Skip to content

Commit

Permalink
address review
Browse files Browse the repository at this point in the history
  • Loading branch information
arajasek committed Oct 31, 2023
1 parent 3edd23c commit e3ac4ea
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 7 deletions.
2 changes: 2 additions & 0 deletions build/builtin_actors.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ func init() {
panic(err)
}

// The following code cid existed temporarily on the calibnet testnet, as a "buggy" storage miner actor implementation.
// We include it in our builtin bundle, but intentionally omit from metadata.
if NetworkBundle == "calibrationnet" {
actors.AddActorMeta("storageminer", cid.MustParse("bafk2bzacecnh2ouohmonvebq7uughh4h3ppmg4cjsk74dzxlbbtlcij4xbzxq"), actorstypes.Version12)
}
Expand Down
5 changes: 2 additions & 3 deletions build/params_calibnet.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,10 @@ const UpgradeLightningHeight = 489094
// 2023-04-21T16:00:00Z
const UpgradeThunderHeight = UpgradeLightningHeight + 3120

// 2023-10-19T13:00:00Z
// 2023-11-07T13:00:00Z
const UpgradeWatermelonHeight = 1013134

// TODO: SET THE PATCH HEIGHT EPOCH
const UpgradeWatermelonFixHeight = -1
const UpgradeWatermelonFixHeight = 1070494

var SupportedProofTypes = []abi.RegisteredSealProof{
abi.RegisteredSealProof_StackedDrg32GiBV1,
Expand Down
2 changes: 2 additions & 0 deletions chain/actors/manifest.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ func RegisterManifest(av actorstypes.Version, manifestCid cid.Cid, entries map[s
}

func AddActorMeta(name string, codeId cid.Cid, av actorstypes.Version) {
manifestMx.Lock()
defer manifestMx.Unlock()
actorMeta[codeId] = actorEntry{name: name, version: av}
}

Expand Down
11 changes: 7 additions & 4 deletions chain/consensus/filcns/upgrades.go
Original file line number Diff line number Diff line change
Expand Up @@ -1876,6 +1876,8 @@ func UpgradeActorsV12(ctx context.Context, sm *stmgr.StateManager, cache stmgr.M
return newRoot, nil
}

var calibnetv12BuggyBundle = cid.MustParse("bafy2bzacedrunxfqta5skb7q7x32lnp4efz2oq7fn226ffm7fu5iqs62jkmvs")

func upgradeActorsV12Common(
ctx context.Context, sm *stmgr.StateManager, cache stmgr.MigrationCache,
root cid.Cid, epoch abi.ChainEpoch, ts *types.TipSet,
Expand Down Expand Up @@ -1932,9 +1934,8 @@ func upgradeActorsV12Common(
return cid.Undef, xerrors.Errorf("failed to load buggy calibnet bundle: %w", err)
}

expectedCid := cid.MustParse("bafy2bzacedrunxfqta5skb7q7x32lnp4efz2oq7fn226ffm7fu5iqs62jkmvs")
if manifestCid != expectedCid {
return cid.Undef, xerrors.Errorf("didn't find expected buggy calibnet bundle manifest: %s != %s", manifestCid, expectedCid)
if manifestCid != calibnetv12BuggyBundle {
return cid.Undef, xerrors.Errorf("didn't find expected buggy calibnet bundle manifest: %s != %s", manifestCid, calibnetv12BuggyBundle)
}
} else {
ok := false
Expand Down Expand Up @@ -1975,6 +1976,8 @@ func upgradeActorsV12Common(

//////////////////////

var calibnetv12BuggyMinerCID = cid.MustParse("bafk2bzacecnh2ouohmonvebq7uughh4h3ppmg4cjsk74dzxlbbtlcij4xbzxq")

func upgradeActorsV12Fix(ctx context.Context, sm *stmgr.StateManager, cache stmgr.MigrationCache, cb stmgr.ExecMonitor,
root cid.Cid, epoch abi.ChainEpoch, ts *types.TipSet) (cid.Cid, error) {
stateStore := sm.ChainStore().StateBlockstore()
Expand Down Expand Up @@ -2078,7 +2081,7 @@ func upgradeActorsV12Fix(ctx context.Context, sm *stmgr.StateManager, cache stmg
}

// This is the hard-coded "buggy" miner actor Code ID
if inActor.Code != cid.MustParse("bafk2bzacecnh2ouohmonvebq7uughh4h3ppmg4cjsk74dzxlbbtlcij4xbzxq") && inActor.Code != outActor.Code {
if inActor.Code != calibnetv12BuggyMinerCID && inActor.Code != outActor.Code {
return xerrors.Errorf("unexpected change in code for actor %s", a)
}

Expand Down

0 comments on commit e3ac4ea

Please sign in to comment.