From d8441b134aae5d21b867e501823fe50bd27b5782 Mon Sep 17 00:00:00 2001 From: Aayush Date: Fri, 23 Sep 2022 11:20:02 -0400 Subject: [PATCH 1/4] fix: miner: init: only get sector-size once --- cmd/lotus-miner/init.go | 11 +++-------- documentation/en/cli-lotus-miner.md | 2 +- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/cmd/lotus-miner/init.go b/cmd/lotus-miner/init.go index ce69fad5b..ee458f686 100644 --- a/cmd/lotus-miner/init.go +++ b/cmd/lotus-miner/init.go @@ -541,7 +541,7 @@ func storageMinerInit(ctx context.Context, cctx *cli.Context, api v1api.FullNode addr = a } else { - a, err := createStorageMiner(ctx, api, peerid, gasPrice, cctx) + a, err := createStorageMiner(ctx, api, ssize, peerid, gasPrice, cctx) if err != nil { return xerrors.Errorf("creating miner failed: %w", err) } @@ -621,7 +621,7 @@ func configureStorageMiner(ctx context.Context, api v1api.FullNode, addr address return nil } -func createStorageMiner(ctx context.Context, api v1api.FullNode, peerid peer.ID, gasPrice types.BigInt, cctx *cli.Context) (address.Address, error) { +func createStorageMiner(ctx context.Context, api v1api.FullNode, ssize abi.SectorSize, peerid peer.ID, gasPrice types.BigInt, cctx *cli.Context) (address.Address, error) { var err error var owner address.Address if cctx.String("owner") != "" { @@ -633,11 +633,6 @@ func createStorageMiner(ctx context.Context, api v1api.FullNode, peerid peer.ID, return address.Undef, err } - ssize, err := units.RAMInBytes(cctx.String("sector-size")) - if err != nil { - return address.Undef, fmt.Errorf("failed to parse sector size: %w", err) - } - worker := owner if cctx.String("worker") != "" { worker, err = address.NewFromString(cctx.String("worker")) @@ -712,7 +707,7 @@ func createStorageMiner(ctx context.Context, api v1api.FullNode, peerid peer.ID, } // Note: the correct thing to do would be to call SealProofTypeFromSectorSize if actors version is v3 or later, but this still works - spt, err := miner.WindowPoStProofTypeFromSectorSize(abi.SectorSize(ssize)) + spt, err := miner.WindowPoStProofTypeFromSectorSize(ssize) if err != nil { return address.Undef, xerrors.Errorf("getting post proof type: %w", err) } diff --git a/documentation/en/cli-lotus-miner.md b/documentation/en/cli-lotus-miner.md index e8b568948..9f27d7327 100644 --- a/documentation/en/cli-lotus-miner.md +++ b/documentation/en/cli-lotus-miner.md @@ -71,7 +71,7 @@ OPTIONS: --create-worker-key create separate worker key (default: false) --worker value, -w value worker key to use (overrides --create-worker-key) --owner value, -o value owner key to use - --sector-size value specify sector size to use (default: "2KiB") + --sector-size value specify sector size to use --pre-sealed-sectors value specify set of presealed sectors for starting as a genesis miner (accepts multiple inputs) --pre-sealed-metadata value specify the metadata file for the presealed sectors --nosync don't check full-node sync status (default: false) From 27030aa1e8bba3949dc5ca7315e97ab20976cd45 Mon Sep 17 00:00:00 2001 From: Aayush Date: Fri, 23 Sep 2022 10:53:17 -0400 Subject: [PATCH 2/4] 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 { From b4ec045bc0f5c4f6b6346c1d1b5a306766f128b8 Mon Sep 17 00:00:00 2001 From: Aayush Date: Thu, 22 Sep 2022 11:42:06 -0400 Subject: [PATCH 3/4] fix: build: set PropagationDelaySecs correctly --- build/params_calibnet.go | 9 ++++++--- build/params_mainnet.go | 4 ++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/build/params_calibnet.go b/build/params_calibnet.go index cdf8dc6e9..faedd3ea8 100644 --- a/build/params_calibnet.go +++ b/build/params_calibnet.go @@ -89,13 +89,16 @@ func init() { Devnet = true + // NOTE: DO NOT change this unless you REALLY know what you're doing. This is not consensus critical, however, + //set this value too high may impacts your block submission; set this value too low may cause you miss + //parent tipsets for blocking forming and mining. if len(os.Getenv("PROPAGATION_DELAY_SECS")) != 0 { - PropagationDelaySecs, err := strconv.ParseUint(os.Getenv("PROPAGATION_DELAY_SECS"), 10, 64) + pds, err := strconv.ParseUint(os.Getenv("PROPAGATION_DELAY_SECS"), 10, 64) if err != nil { - PropagationDelaySecs = uint64(10) log.Warnw("Error setting PROPAGATION_DELAY_SECS, %v, proceed with default value %s", err, PropagationDelaySecs) } else { + PropagationDelaySecs = pds log.Warnw(" !!WARNING!! propagation delay is set to be %s second, "+ "this value impacts your message republish interval and block forming - monitor with caution!!", PropagationDelaySecs) } @@ -107,7 +110,7 @@ func init() { const BlockDelaySecs = uint64(builtin2.EpochDurationSeconds) -const PropagationDelaySecs = uint64(10) +var PropagationDelaySecs = uint64(10) // BootstrapPeerThreshold is the minimum number peers we need to track for a sync worker to start const BootstrapPeerThreshold = 4 diff --git a/build/params_mainnet.go b/build/params_mainnet.go index 45ceb89bd..c3864ffd2 100644 --- a/build/params_mainnet.go +++ b/build/params_mainnet.go @@ -103,12 +103,12 @@ func init() { //set this value too high may impacts your block submission; set this value too low may cause you miss //parent tipsets for blocking forming and mining. if len(os.Getenv("PROPAGATION_DELAY_SECS")) != 0 { - PropagationDelaySecs, err := strconv.ParseUint(os.Getenv("PROPAGATION_DELAY_SECS"), 10, 64) + pds, err := strconv.ParseUint(os.Getenv("PROPAGATION_DELAY_SECS"), 10, 64) if err != nil { - PropagationDelaySecs = uint64(10) log.Warnw("Error setting PROPAGATION_DELAY_SECS, %v, proceed with default value %s", err, PropagationDelaySecs) } else { + PropagationDelaySecs = pds log.Warnw(" !!WARNING!! propagation delay is set to be %s second, "+ "this value impacts your message republish interval and block forming - monitor with caution!!", PropagationDelaySecs) } From f228bf484ee57b0e74f61321f7beec445d969230 Mon Sep 17 00:00:00 2001 From: Ian Davis Date: Wed, 21 Sep 2022 12:20:26 -0400 Subject: [PATCH 4/4] Don't publish new homebrew releases for RC builds --- .circleci/config.yml | 7 +++++-- .circleci/template.yml | 7 +++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 7fcd20677..66f30e7d5 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1129,12 +1129,15 @@ workflows: - /.*/ tags: only: - - /^v\d+\.\d+\.\d+(-rc\d+)?$/ + - /^v\d+\.\d+\.\d+$/ - build-macos: filters: branches: only: - /^release\/v\d+\.\d+\.\d+(-rc\d+)?$/ + tags: + only: + - /^v\d+\.\d+\.\d+-rc\d+$/ - build-appimage: filters: branches: @@ -1265,4 +1268,4 @@ workflows: only: - master jobs: - - publish-packer-snap \ No newline at end of file + - publish-packer-snap diff --git a/.circleci/template.yml b/.circleci/template.yml index 9843463df..6e7a44364 100644 --- a/.circleci/template.yml +++ b/.circleci/template.yml @@ -854,12 +854,15 @@ workflows: - /.*/ tags: only: - - /^v\d+\.\d+\.\d+(-rc\d+)?$/ + - /^v\d+\.\d+\.\d+$/ - build-macos: filters: branches: only: - /^release\/v\d+\.\d+\.\d+(-rc\d+)?$/ + tags: + only: + - /^v\d+\.\d+\.\d+-rc\d+$/ - build-appimage: filters: branches: @@ -990,4 +993,4 @@ workflows: only: - master jobs: - - publish-packer-snap \ No newline at end of file + - publish-packer-snap