From 27030aa1e8bba3949dc5ca7315e97ab20976cd45 Mon Sep 17 00:00:00 2001 From: Aayush Date: Fri, 23 Sep 2022 10:53:17 -0400 Subject: [PATCH] fix: miner: init miner's with 32GiB sectors by default --- cmd/lotus-miner/init.go | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/cmd/lotus-miner/init.go b/cmd/lotus-miner/init.go index ee458f686..f0f84eb67 100644 --- a/cmd/lotus-miner/init.go +++ b/cmd/lotus-miner/init.go @@ -90,7 +90,6 @@ var initCmd = &cli.Command{ &cli.StringFlag{ Name: "sector-size", Usage: "specify sector size to use", - Value: units.BytesSize(float64(abi.SectorSize(2048))), }, &cli.StringSliceFlag{ Name: "pre-sealed-sectors", @@ -129,11 +128,18 @@ var initCmd = &cli.Command{ Action: func(cctx *cli.Context) error { log.Info("Initializing lotus miner") - sectorSizeInt, err := units.RAMInBytes(cctx.String("sector-size")) + ssize, err := abi.RegisteredSealProof_StackedDrg32GiBV1.SectorSize() if err != nil { - return err + return xerrors.Errorf("failed to calculate default sector size: %w", err) + } + + if cctx.IsSet("sector-size") { + sectorSizeInt, err := units.RAMInBytes(cctx.String("sector-size")) + if err != nil { + return err + } + ssize = abi.SectorSize(sectorSizeInt) } - ssize := abi.SectorSize(sectorSizeInt) gasPrice, err := types.BigFromString(cctx.String("gas-premium")) if err != nil {