Skip to content

Commit

Permalink
Merge pull request #7900 from filecoin-project/7891
Browse files Browse the repository at this point in the history
enhancement: #7891 sectors: disable existing existing cc upgrade path 2 days before the upgrade epoch
  • Loading branch information
arajasek authored Jan 11, 2022
2 parents 0130b28 + 1e24ef4 commit f87d8d0
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions cmd/lotus-miner/sectors.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ import (
"strings"
"time"

"github.com/filecoin-project/lotus/build"
"github.com/filecoin-project/lotus/chain/actors/builtin"

"github.com/docker/go-units"
"github.com/fatih/color"
cbor "github.com/ipfs/go-ipld-cbor"
Expand Down Expand Up @@ -1547,6 +1550,18 @@ var sectorsMarkForUpgradeCmd = &cli.Command{
return xerrors.Errorf("classic cc upgrades disabled v15 and beyond, use `snap-up`")
}

// disable mark for upgrade two days before the ntwk v15 upgrade
// TODO: remove the following block in v1.15.1
head, err := api.ChainHead(ctx)
if err != nil {
return xerrors.Errorf("failed to get chain head: %w", err)
}
twoDays := abi.ChainEpoch(2 * builtin.EpochsInDay)
if head.Height() > (build.UpgradeSnapDealsHeight - twoDays) {
return xerrors.Errorf("OhSnap is coming soon, " +
"please use `snap-up` to upgrade your cc sectors after the network v15 upgrade!")
}

id, err := strconv.ParseUint(cctx.Args().Get(0), 10, 64)
if err != nil {
return xerrors.Errorf("could not parse sector number: %w", err)
Expand Down

0 comments on commit f87d8d0

Please sign in to comment.