Disable mark-for-upgrade two days before the network v15 OhSnap upgrade to avoid unexpected edge cases that may cause deal/sector failure
This commit is contained in:
parent
ac3bea489b
commit
87babdf3e7
@ -5,6 +5,8 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"github.com/filecoin-project/lotus/build"
|
||||||
|
"github.com/filecoin-project/lotus/chain/actors/builtin"
|
||||||
"os"
|
"os"
|
||||||
"sort"
|
"sort"
|
||||||
"strconv"
|
"strconv"
|
||||||
@ -1547,6 +1549,17 @@ var sectorsMarkForUpgradeCmd = &cli.Command{
|
|||||||
return xerrors.Errorf("classic cc upgrades disabled v15 and beyond, use `snap-up`")
|
return xerrors.Errorf("classic cc upgrades disabled v15 and beyond, use `snap-up`")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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)
|
id, err := strconv.ParseUint(cctx.Args().Get(0), 10, 64)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return xerrors.Errorf("could not parse sector number: %w", err)
|
return xerrors.Errorf("could not parse sector number: %w", err)
|
||||||
|
Loading…
Reference in New Issue
Block a user