diff --git a/build/forks.go b/build/forks.go index 51f292123..113e4a7c0 100644 --- a/build/forks.go +++ b/build/forks.go @@ -1,3 +1,5 @@ package build const ForkBlizzardHeight = 6288 + +const ForkFrigidHeight = 7950 diff --git a/build/version.go b/build/version.go index e52d0ab62..1c9442ffd 100644 --- a/build/version.go +++ b/build/version.go @@ -5,7 +5,7 @@ import "fmt" var CurrentCommit string // BuildVersion is the local build version, set by build system -const BuildVersion = "0.2.3" +const BuildVersion = "0.2.4" var UserVersion = BuildVersion + CurrentCommit diff --git a/chain/actors/actor_init.go b/chain/actors/actor_init.go index 2bb31ce7f..f71704c5c 100644 --- a/chain/actors/actor_init.go +++ b/chain/actors/actor_init.go @@ -161,7 +161,7 @@ func (ia InitActor) Exec(act *types.Actor, vmctx types.VMContext, p *ExecParams) func IsBuiltinActor(code cid.Cid) bool { switch code { - case StorageMarketCodeCid, StoragePowerCodeCid, StorageMinerCodeCid, AccountCodeCid, InitCodeCid, MultisigCodeCid, PaymentChannelCodeCid: + case StorageMarketCodeCid, StoragePowerCodeCid, StorageMinerCodeCid, StorageMiner2CodeCid, AccountCodeCid, InitCodeCid, MultisigCodeCid, PaymentChannelCodeCid: return true default: return false diff --git a/chain/actors/actor_storagepower.go b/chain/actors/actor_storagepower.go index 4a62a118f..4bd5a0cb7 100644 --- a/chain/actors/actor_storagepower.go +++ b/chain/actors/actor_storagepower.go @@ -85,7 +85,13 @@ func (spa StoragePowerActor) CreateStorageMiner(act *types.Actor, vmctx types.VM return nil, aerrors.Newf(1, "not enough funds passed to cover required miner collateral (needed %s, got %s)", reqColl, vmctx.Message().Value) } - encoded, err := CreateExecParams(StorageMinerCodeCid, &StorageMinerConstructorParams{ + // FORK + minerCid := StorageMinerCodeCid + if vmctx.BlockHeight() > build.ForkFrigidHeight { + minerCid = StorageMiner2CodeCid + } + + encoded, err := CreateExecParams(minerCid, &StorageMinerConstructorParams{ Owner: params.Owner, Worker: params.Worker, SectorSize: params.SectorSize, diff --git a/chain/stmgr/forks.go b/chain/stmgr/forks.go index 78b85e840..96bc173c6 100644 --- a/chain/stmgr/forks.go +++ b/chain/stmgr/forks.go @@ -18,11 +18,20 @@ func (sm *StateManager) handleStateForks(ctx context.Context, pstate cid.Cid, he for i := parentH; i < height; i++ { switch i { case build.ForkBlizzardHeight: + log.Warnw("Executing blizzard fork logic", "height", i) npstate, err := fixBlizzardAMTBug(ctx, sm, pstate) if err != nil { return cid.Undef, xerrors.Errorf("blizzard bug fix failed: %w", err) } + return npstate, nil + case build.ForkFrigidHeight: + log.Warnw("Executing frigid fork logic", "height", i) + npstate, err := fixBlizzardAMTBug(ctx, sm, pstate) + if err != nil { + return cid.Undef, xerrors.Errorf("frigid bug fix failed: %w", err) + } + return npstate, nil } } diff --git a/cmd/lotus-chainwatch/sync.go b/cmd/lotus-chainwatch/sync.go index e851dbf9f..eac861aa8 100644 --- a/cmd/lotus-chainwatch/sync.go +++ b/cmd/lotus-chainwatch/sync.go @@ -221,7 +221,7 @@ func syncHead(ctx context.Context, api api.FullNode, st *storage, ts *types.TipS for addr, m := range actors { for actor, c := range m { - if actor.Code != actors2.StorageMinerCodeCid { + if !(actor.Code == actors2.StorageMinerCodeCid || actor.Code == actors2.StorageMiner2CodeCid) { continue }