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 aa13b5a
Show file tree
Hide file tree
Showing 8 changed files with 90 additions and 6 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
15 changes: 12 additions & 3 deletions itests/direct_data_onboard_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,10 @@ func TestOnboardMixedMarketDDO(t *testing.T) {
ctx = context.Background()
)

client, miner, ens := kit.EnsembleMinimal(t, kit.ThroughRPC())
client, miner, ens := kit.EnsembleMinimal(t, kit.ThroughRPC(), kit.MutateSealingConfig(func(sc *config.SealingConfig) {
sc.RequireActivationSuccess = true
sc.RequireNotificationSuccess = true
}))
ens.InterconnectAll().BeginMiningMustPost(blocktime)

maddr, err := miner.ActorAddress(ctx)
Expand All @@ -157,6 +160,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 +204,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 +273,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 All @@ -285,7 +294,7 @@ func TestOnboardRawPieceSnap(t *testing.T) {
sc.MakeCCSectorsAvailable = true
sc.AggregateCommits = false
}))
ens.InterconnectAll().BeginMining(blocktime)
ens.InterconnectAll().BeginMiningMustPost(blocktime)

miner.PledgeSectors(ctx, 1, 0, nil)
sl, err := miner.SectorsListNonGenesis(ctx)
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 aa13b5a

Please sign in to comment.