Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
- `DealIDs` has now been removed from the public API's `SectorOnChainInfo` (was deprecated in FIP-0079)
- Removed `--only-cc` from `spcli sectors extend` command
- Change circulating supply calculation for calibnet, butterflynet and 2k for nv25 upgrade; see ([filecoin-project/lotus#12938](https://github.com/filecoin-project/lotus/pull/12938)) for more information
- feat(miner): remove batch balancer-related functionality ([filecoin-project/lotus#12919](https://github.com/filecoin-project/lotus/pull/12919))

# UNRELEASED v.1.32.0

Expand Down
6 changes: 5 additions & 1 deletion chain/actors/policy/policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ const (
SealRandomnessLookback = ChainFinality
PaychSettleDelay = paych16.SettleDelay
MaxPreCommitRandomnessLookback = builtin16.EpochsInDay + SealRandomnessLookback
DeclarationsMax = 3000
)

var (
Expand Down Expand Up @@ -842,6 +843,9 @@ func GetAddressedSectorsMax(nwVer network.Version) (int, error) {
}
}

// GetDeclarationsMax is deprecated
//
// DEPRECATED: remove after nv25 (FIP 0100)
func GetDeclarationsMax(nwVer network.Version) (int, error) {
v, err := actorstypes.VersionForNetwork(nwVer)
if err != nil {
Expand Down Expand Up @@ -912,7 +916,7 @@ func GetDeclarationsMax(nwVer network.Version) (int, error) {

case actorstypes.Version16:

return miner16.DeclarationsMax, nil
return DeclarationsMax, nil

default:
return 0, xerrors.Errorf("unsupported network version")
Expand Down
6 changes: 6 additions & 0 deletions chain/actors/policy/policy.go.template
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ const (
SealRandomnessLookback = ChainFinality
PaychSettleDelay = paych{{.latestVersion}}.SettleDelay
MaxPreCommitRandomnessLookback = builtin{{.latestVersion}}.EpochsInDay + SealRandomnessLookback
DeclarationsMax = 3000
)

var (
Expand Down Expand Up @@ -283,6 +284,9 @@ func GetAddressedSectorsMax(nwVer network.Version) (int, error) {
}
}

// GetDeclarationsMax is deprecated
//
// DEPRECATED: remove after nv25 (FIP 0100)
func GetDeclarationsMax(nwVer network.Version) (int, error) {
v, err := actorstypes.VersionForNetwork(nwVer)
if err != nil {
Expand All @@ -294,6 +298,8 @@ func GetDeclarationsMax(nwVer network.Version) (int, error) {
{{if (eq . 0)}}
// TODO: Should we instead error here since the concept doesn't exist yet?
return miner{{.}}.AddressedPartitionsMax, nil
{{else if (ge . 16)}}
return DeclarationsMax, nil
{{else}}
return miner{{.}}.DeclarationsMax, nil
{{end}}
Expand Down
1 change: 1 addition & 0 deletions cli/spcli/sectors.go
Original file line number Diff line number Diff line change
Expand Up @@ -864,6 +864,7 @@ func SectorsExtendCmd(getActorAddress ActorAddressGetter) *cli.Command {
return err
}

// TODO: remove after nv25 (FIP 0100)
declMax, err := policy.GetDeclarationsMax(nv)
if err != nil {
return err
Expand Down
3 changes: 1 addition & 2 deletions cmd/lotus-sim/simulation/stages/precommit_stage.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import (
"github.com/filecoin-project/go-state-types/builtin"
minertypes "github.com/filecoin-project/go-state-types/builtin/v9/miner"
"github.com/filecoin-project/go-state-types/network"
miner5 "github.com/filecoin-project/specs-actors/v5/actors/builtin/miner"

"github.com/filecoin-project/lotus/chain/actors"
"github.com/filecoin-project/lotus/chain/actors/aerrors"
Expand All @@ -27,7 +26,7 @@ import (

const (
minPreCommitBatchSize = 1
maxPreCommitBatchSize = miner5.PreCommitSectorBatchMaxSize
maxPreCommitBatchSize = 256
Comment thread
Stebalien marked this conversation as resolved.
)

type PreCommitStage struct {
Expand Down
2 changes: 2 additions & 0 deletions documentation/en/default-lotus-miner-config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,7 @@
# env var: LOTUS_SEALING_COMMITBATCHSLACK
#CommitBatchSlack = "1h0m0s"

# DEPRECATED: remove after nv25 (FIP 0100)
# network BaseFee below which to stop doing precommit batching, instead
# sending precommit messages to the chain individually. When the basefee is
# below this threshold, precommit messages will get sent out immediately.
Expand All @@ -389,6 +390,7 @@
# env var: LOTUS_SEALING_BATCHPRECOMMITABOVEBASEFEE
#BatchPreCommitAboveBaseFee = "0.00000000032 FIL"

# DEPRECATED: remove after nv25 (FIP 0100)
# network BaseFee below which to stop doing commit aggregation, instead
# submitting proofs to the chain individually
#
Expand Down
4 changes: 2 additions & 2 deletions node/config/def.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,8 @@ func DefaultStorageMiner() *StorageMiner {
AvailableBalanceBuffer: types.FIL(big.Zero()),
DisableCollateralFallback: false,

MaxPreCommitBatch: miner5.PreCommitSectorBatchMaxSize, // up to 256 sectors
PreCommitBatchWait: Duration(24 * time.Hour), // this should be less than 31.5 hours, which is the expiration of a precommit ticket
MaxPreCommitBatch: 256,
Comment thread
Stebalien marked this conversation as resolved.
PreCommitBatchWait: Duration(24 * time.Hour), // this should be less than 31.5 hours, which is the expiration of a precommit ticket
// XXX snap deals wait deals slack if first
PreCommitBatchSlack: Duration(3 * time.Hour), // time buffer for forceful batch submission before sectors/deals in batch would start expiring, higher value will lower the chances for message fail due to expiration

Expand Down
6 changes: 4 additions & 2 deletions node/config/doc_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions node/config/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -294,11 +294,13 @@ type SealingConfig struct {
// time buffer for forceful batch submission before sectors/deals in batch would start expiring
CommitBatchSlack Duration

// DEPRECATED: remove after nv25 (FIP 0100)
// network BaseFee below which to stop doing precommit batching, instead
// sending precommit messages to the chain individually. When the basefee is
// below this threshold, precommit messages will get sent out immediately.
BatchPreCommitAboveBaseFee types.FIL

// DEPRECATED: remove after nv25 (FIP 0100)
// network BaseFee below which to stop doing commit aggregation, instead
// submitting proofs to the chain individually
AggregateAboveBaseFee types.FIL
Expand Down
3 changes: 2 additions & 1 deletion storage/pipeline/commit_batch.go
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,8 @@ func (b *CommitBatcher) maybeStartBatch(notif bool) ([]sealiface.CommitBatchRes,

individual := (total < cfg.MinCommitBatch) || (total < miner.MinAggregatedSectors) || blackedOut() || !cfg.AggregateCommits

if !individual && !cfg.AggregateAboveBaseFee.Equals(big.Zero()) {
// TODO: remove after nv25 (FIP 0100)
if !individual && !cfg.AggregateAboveBaseFee.Equals(big.Zero()) && nv < network.Version25 {
if ts.MinTicketBlock().ParentBaseFee.LessThan(cfg.AggregateAboveBaseFee) {
individual = true
}
Expand Down
13 changes: 7 additions & 6 deletions storage/pipeline/precommit_batch.go
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,14 @@ func (b *PreCommitBatcher) maybeStartBatch(notif bool) ([]sealiface.PreCommitBat
return nil, err
}

nv, err := b.api.StateNetworkVersion(b.mctx, ts.Key())
if err != nil {
return nil, xerrors.Errorf("couldn't get network version: %w", err)
}

// TODO: remove after nv25 (FIP 0100)
curBasefeeLow := false
if !cfg.BatchPreCommitAboveBaseFee.Equals(big.Zero()) && ts.MinTicketBlock().ParentBaseFee.LessThan(cfg.BatchPreCommitAboveBaseFee) {
if !cfg.BatchPreCommitAboveBaseFee.Equals(big.Zero()) && ts.MinTicketBlock().ParentBaseFee.LessThan(cfg.BatchPreCommitAboveBaseFee) && nv < network.Version25 {
curBasefeeLow = true
}

Expand All @@ -207,11 +213,6 @@ func (b *PreCommitBatcher) maybeStartBatch(notif bool) ([]sealiface.PreCommitBat
return nil, nil
}

nv, err := b.api.StateNetworkVersion(b.mctx, ts.Key())
if err != nil {
return nil, xerrors.Errorf("couldn't get network version: %w", err)
}

// For precommits the only method to precommit sectors after nv21(22?) is to use the new precommit_batch2 method
// So we always batch
res, err := b.processBatch(cfg, ts.Key(), ts.MinTicketBlock().ParentBaseFee, nv)
Expand Down
4 changes: 3 additions & 1 deletion storage/pipeline/sealiface/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@ type Config struct {
CommitBatchWait time.Duration
CommitBatchSlack time.Duration

AggregateAboveBaseFee abi.TokenAmount
// DEPRECATED: remove after nv25 (FIP 0100)
AggregateAboveBaseFee abi.TokenAmount
// DEPRECATED: remove after nv25 (FIP 0100)
BatchPreCommitAboveBaseFee abi.TokenAmount

MaxSectorProveCommitsSubmittedPerEpoch uint64
Expand Down
1 change: 1 addition & 0 deletions storage/pipeline/terminate_batch.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ func (b *TerminateBatcher) processBatch(notif, after bool) (*cid.Cid, error) {
break
}

// TODO: remove after nv25 (FIP 0100)
if len(params.Terminations) >= miner.DeclarationsMax {
break
}
Expand Down
1 change: 1 addition & 0 deletions storage/wdpost/wdpost_run.go
Original file line number Diff line number Diff line change
Expand Up @@ -544,6 +544,7 @@ func (s *WindowPoStScheduler) BatchPartitions(partitions []api.Partition, nv net
return nil, xerrors.Errorf("getting sectors per partition: %w", err)
}

// TODO: remove after nv25 (FIP 0100)
// Also respect the AddressedPartitionsMax (which is the same as DeclarationsMax (which is all really just MaxPartitionsPerDeadline))
declMax, err := policy.GetDeclarationsMax(nv)
if err != nil {
Expand Down