Skip to content

Commit

Permalink
config knobs for RequireActivationSuccess
Browse files Browse the repository at this point in the history
  • Loading branch information
magik6k committed Jan 25, 2024
1 parent 52361f7 commit 7984900
Show file tree
Hide file tree
Showing 8 changed files with 85 additions and 4 deletions.
24 changes: 24 additions & 0 deletions documentation/en/default-lotus-miner-config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -702,6 +702,30 @@
# env var: LOTUS_SEALING_USESYNTHETICPOREP
#UseSyntheticPoRep = false

# Whether to abort if any sector activation in a batch fails (newly sealed sectors, only with ProveCommitSectors3).
#
# type: bool
# env var: LOTUS_SEALING_REQUIREACTIVATIONSUCCESS
#RequireActivationSuccess = false

# Whether to abort if any piece activation notification returns a non-zero exit code (newly sealed sectors, only with ProveCommitSectors3).
#
# type: bool
# env var: LOTUS_SEALING_REQUIREACTIVATIONSUCCESSUPDATE
#RequireActivationSuccessUpdate = false

# Whether to abort if any sector activation in a batch fails (updating sectors, only with ProveReplicaUpdates3).
#
# type: bool
# env var: LOTUS_SEALING_REQUIRENOTIFICATIONSUCCESS
#RequireNotificationSuccess = false

# Whether to abort if any piece activation notification returns a non-zero exit code (updating sectors, only with ProveReplicaUpdates3).
#
# type: bool
# env var: LOTUS_SEALING_REQUIRENOTIFICATIONSUCCESSUPDATE
#RequireNotificationSuccessUpdate = false


[Storage]
# type: int
Expand Down
8 changes: 7 additions & 1 deletion itests/direct_data_onboard_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ func TestOnboardMixedMarketDDO(t *testing.T) {
require.NoError(t, err)

var pieces []abi.PieceInfo
var dealID abi.DealID

{
// market piece
Expand Down Expand Up @@ -200,7 +201,7 @@ func TestOnboardMixedMarketDDO(t *testing.T) {

res, err := market.DecodePublishStorageDealsReturn(r.Receipt.Return, nv)
require.NoError(t, err)
dealID := must.One(res.DealIDs())[0]
dealID = must.One(res.DealIDs())[0]

mcid := smsg.Cid()

Expand Down Expand Up @@ -269,6 +270,11 @@ func TestOnboardMixedMarketDDO(t *testing.T) {
si, err := miner.SectorsStatus(ctx, 2, false)
require.NoError(t, err)
require.Equal(t, expectCommD, *si.CommD)

ds, err := client.StateMarketStorageDeal(ctx, dealID, types.EmptyTSK)
require.NoError(t, err)

require.NotEqual(t, -1, ds.State.SectorStartEpoch)
}

func TestOnboardRawPieceSnap(t *testing.T) {
Expand Down
24 changes: 24 additions & 0 deletions node/config/doc_gen.go

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

9 changes: 9 additions & 0 deletions node/config/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -487,6 +487,15 @@ type SealingConfig struct {

// UseSyntheticPoRep, when set to true, will reduce the amount of cache data held on disk after the completion of PreCommit 2 to 11GiB.
UseSyntheticPoRep bool

// Whether to abort if any sector activation in a batch fails (newly sealed sectors, only with ProveCommitSectors3).
RequireActivationSuccess bool
// Whether to abort if any piece activation notification returns a non-zero exit code (newly sealed sectors, only with ProveCommitSectors3).
RequireActivationSuccessUpdate bool
// Whether to abort if any sector activation in a batch fails (updating sectors, only with ProveReplicaUpdates3).
RequireNotificationSuccess bool
// Whether to abort if any piece activation notification returns a non-zero exit code (updating sectors, only with ProveReplicaUpdates3).
RequireNotificationSuccessUpdate bool
}

type SealerConfig struct {
Expand Down
10 changes: 10 additions & 0 deletions node/modules/storageminer.go
Original file line number Diff line number Diff line change
Expand Up @@ -1017,6 +1017,11 @@ func NewSetSealConfigFunc(r repo.LockedRepo) (dtypes.SetSealingConfigFunc, error
TerminateBatchWait: config.Duration(cfg.TerminateBatchWait),
MaxSectorProveCommitsSubmittedPerEpoch: cfg.MaxSectorProveCommitsSubmittedPerEpoch,
UseSyntheticPoRep: cfg.UseSyntheticPoRep,

RequireActivationSuccess: cfg.RequireActivationSuccess,
RequireActivationSuccessUpdate: cfg.RequireActivationSuccessUpdate,
RequireNotificationSuccess: cfg.RequireNotificationSuccess,
RequireNotificationSuccessUpdate: cfg.RequireNotificationSuccessUpdate,
}
c.SetSealingConfig(newCfg)
})
Expand Down Expand Up @@ -1062,6 +1067,11 @@ func ToSealingConfig(dealmakingCfg config.DealmakingConfig, sealingCfg config.Se
TerminateBatchMin: sealingCfg.TerminateBatchMin,
TerminateBatchWait: time.Duration(sealingCfg.TerminateBatchWait),
UseSyntheticPoRep: sealingCfg.UseSyntheticPoRep,

RequireActivationSuccess: sealingCfg.RequireActivationSuccess,
RequireActivationSuccessUpdate: sealingCfg.RequireActivationSuccessUpdate,
RequireNotificationSuccess: sealingCfg.RequireNotificationSuccess,
RequireNotificationSuccessUpdate: sealingCfg.RequireNotificationSuccessUpdate,
}
}

Expand Down
5 changes: 4 additions & 1 deletion storage/pipeline/commit_batch.go
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,10 @@ func (b *CommitBatcher) processBatchV2(cfg sealiface.Config, sectors []abi.Secto
FailedSectors: map[abi.SectorNumber]string{},
}

params := miner.ProveCommitSectors3Params{}
params := miner.ProveCommitSectors3Params{
RequireActivationSuccess: cfg.RequireActivationSuccess,
RequireNotificationSuccess: cfg.RequireNotificationSuccess,
}

infos := make([]proof.AggregateSealVerifyInfo, 0, total)
collateral := big.Zero()
Expand Down
5 changes: 5 additions & 0 deletions storage/pipeline/sealiface/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,9 @@ type Config struct {
TerminateBatchWait time.Duration

UseSyntheticPoRep bool

RequireActivationSuccess bool
RequireActivationSuccessUpdate bool
RequireNotificationSuccess bool
RequireNotificationSuccessUpdate bool
}
4 changes: 2 additions & 2 deletions storage/pipeline/states_replica_update.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,8 @@ func (m *Sealing) handleSubmitReplicaUpdate(ctx statemachine.Context, sector Sec
UpdateProofsType: updateProof,
//AggregateProof
//AggregateProofType
RequireActivationSuccess: false, // todo??
RequireNotificationSuccess: false,
RequireActivationSuccess: cfg.RequireActivationSuccessUpdate,
RequireNotificationSuccess: cfg.RequireNotificationSuccessUpdate,
}

enc := new(bytes.Buffer)
Expand Down

0 comments on commit 7984900

Please sign in to comment.