actors v12 migration + nv20 upgrade epochs.

This commit is contained in:
Raúl Kripalani
2023-02-12 21:53:29 +00:00
parent 1786a8a1c6
commit feaf397dcc
7 changed files with 39 additions and 2 deletions
+2
View File
@@ -63,6 +63,8 @@ var UpgradeHyggeHeight = abi.ChainEpoch(30)
var UpgradeHyperspaceNV19Height = abi.ChainEpoch(60)
var UpgradeHyperspaceNV20Height = abi.ChainEpoch(70)
var DrandSchedule = map[abi.ChainEpoch]DrandEnum{
0: DrandMainnet,
}
+2
View File
@@ -55,6 +55,8 @@ const UpgradeHyggeHeight = abi.ChainEpoch(600)
var UpgradeHyperspaceNV19Height = abi.ChainEpoch(99999999999999)
var UpgradeHyperspaceNV20Height = abi.ChainEpoch(99999999999999)
var SupportedProofTypes = []abi.RegisteredSealProof{
abi.RegisteredSealProof_StackedDrg512MiBV1,
abi.RegisteredSealProof_StackedDrg32GiBV1,
+5 -1
View File
@@ -73,7 +73,11 @@ const UpgradeSharkHeight = 16800 // 6 days after genesis
const UpgradeHyggeHeight = math.MaxInt64
var UpgradeHyperspaceNV19Height = abi.ChainEpoch(99999999999999)
// dummy
var UpgradeHyperspaceNV19Height = abi.ChainEpoch(math.MaxInt64)
// dummy
var UpgradeHyperspaceNV20Height = abi.ChainEpoch(math.MaxInt64)
var SupportedProofTypes = []abi.RegisteredSealProof{
abi.RegisteredSealProof_StackedDrg32GiBV1,
+3
View File
@@ -58,6 +58,9 @@ var UpgradeHyggeHeight = abi.ChainEpoch(-21)
// 2023-01-18T15:00:00Z
var UpgradeHyperspaceNV19Height = abi.ChainEpoch(6840)
// TODO set upgrade epoch
var UpgradeHyperspaceNV20Height = abi.ChainEpoch(math.MaxInt64)
var DrandSchedule = map[abi.ChainEpoch]DrandEnum{
0: DrandMainnet,
}
+2
View File
@@ -56,6 +56,8 @@ const UpgradeHyggeHeight = abi.ChainEpoch(99999999999999)
var UpgradeHyperspaceNV19Height = abi.ChainEpoch(99999999999999)
var UpgradeHyperspaceNV20Height = abi.ChainEpoch(math.MaxInt64)
var DrandSchedule = map[abi.ChainEpoch]DrandEnum{
0: DrandMainnet,
}
+3
View File
@@ -92,6 +92,9 @@ var UpgradeHyggeHeight = abi.ChainEpoch(math.MaxInt64 - 1)
// ??????????????
var UpgradeHyperspaceNV19Height = abi.ChainEpoch(math.MaxInt64)
// dummy
var UpgradeHyperspaceNV20Height = abi.ChainEpoch(math.MaxInt64)
var SupportedProofTypes = []abi.RegisteredSealProof{
abi.RegisteredSealProof_StackedDrg32GiBV1,
abi.RegisteredSealProof_StackedDrg64GiBV1,
+22 -1
View File
@@ -249,6 +249,10 @@ func DefaultUpgradeSchedule() stmgr.UpgradeSchedule {
Height: build.UpgradeHyperspaceNV19Height,
Network: network.Version19,
Migration: UpgradeActorsV11,
}, {
Height: build.UpgradeHyperspaceNV20Height,
Network: network.Version20,
Migration: UpgradeActorsV12,
},
}
@@ -1724,7 +1728,24 @@ func UpgradeActorsV11(ctx context.Context, sm *stmgr.StateManager, _ stmgr.Migra
}
func UpgradeActorsV12(ctx context.Context, sm *stmgr.StateManager, _ stmgr.MigrationCache, _ stmgr.ExecMonitor, root cid.Cid, _ abi.ChainEpoch, _ *types.TipSet) (cid.Cid, error) {
return cid.Undef, nil
oldAv := actorstypes.Version11
newAv := actorstypes.Version12
// This may change for upgrade
oldStateTreeVersion := types.StateTreeVersion5
newStateTreeVersion := types.StateTreeVersion5
// ensure that the manifest is loaded in the blockstore
if err := bundle.LoadBundles(ctx, sm.ChainStore().StateBlockstore(), newAv); err != nil {
return cid.Undef, xerrors.Errorf("failed to load manifest bundle: %w", err)
}
newActorsManifestCid, ok := actors.GetManifest(newAv)
if !ok {
return cid.Undef, xerrors.Errorf("no manifest CID for actors v12 upgrade")
}
bstore := sm.ChainStore().StateBlockstore()
return LiteMigration(ctx, bstore, newActorsManifestCid, root, oldAv, newAv, oldStateTreeVersion, newStateTreeVersion)
}
func LiteMigration(ctx context.Context, bstore blockstore.Blockstore, newActorsManifestCid cid.Cid, root cid.Cid, oldAv actorstypes.Version, newAv actorstypes.Version, oldStateTreeVersion types.StateTreeVersion, newStateTreeVersion types.StateTreeVersion) (cid.Cid, error) {