add Dealmaking.StartEpochSealingBuffer config
This commit is contained in:
committed by
Łukasz Magiera
parent
c2fa54ca9c
commit
809289f5ef
Vendored
+6
-1
@@ -274,11 +274,16 @@ func (m *Sealing) SectorAddPieceToAny(ctx context.Context, size abi.UnpaddedPiec
|
||||
return api.SectorOffset{}, xerrors.Errorf("getting proposal CID: %w", err)
|
||||
}
|
||||
|
||||
cfg, err := m.getConfig()
|
||||
if err != nil {
|
||||
return api.SectorOffset{}, xerrors.Errorf("getting config: %w", err)
|
||||
}
|
||||
|
||||
_, head, err := m.Api.ChainHead(ctx)
|
||||
if err != nil {
|
||||
return api.SectorOffset{}, xerrors.Errorf("couldnt get chain head: %w", err)
|
||||
}
|
||||
if head > deal.DealProposal.StartEpoch {
|
||||
if head+cfg.StartEpochSealingBuffer > deal.DealProposal.StartEpoch {
|
||||
return api.SectorOffset{}, xerrors.Errorf(
|
||||
"cannot add piece for deal with piece CID %s: current epoch %d has passed deal proposal start epoch %d",
|
||||
deal.DealProposal.PieceCID, head, deal.DealProposal.StartEpoch)
|
||||
|
||||
+2
@@ -22,6 +22,8 @@ type Config struct {
|
||||
|
||||
CommittedCapacitySectorLifetime time.Duration
|
||||
|
||||
StartEpochSealingBuffer abi.ChainEpoch
|
||||
|
||||
AlwaysKeepUnsealedCopy bool
|
||||
|
||||
FinalizeEarly bool
|
||||
|
||||
Reference in New Issue
Block a user