diff --git a/extern/storage-sealing/checks.go b/extern/storage-sealing/checks.go index 73511e057..392f2905e 100644 --- a/extern/storage-sealing/checks.go +++ b/extern/storage-sealing/checks.go @@ -79,24 +79,6 @@ func checkPieces(ctx context.Context, maddr address.Address, si SectorInfo, api return nil } -func checkDealExpiration(ctx context.Context, sector SectorInfo, api SealingAPI) error { - tok, height, err := api.ChainHead(ctx) - if err != nil { - return &ErrApi{xerrors.Errorf("getting chain head: %w", err)} - } - - for i, p := range sector.Pieces { - proposal, err := api.StateMarketStorageDealProposal(ctx, p.DealInfo.DealID, tok) - if err != nil { - return &ErrInvalidDeals{xerrors.Errorf("getting deal %d for piece %d: %w", p.DealInfo.DealID, i, err)} - } - if height >= proposal.StartEpoch { - return &ErrExpiredDeals{xerrors.Errorf("piece %d (of %d) of sector %d refers expired deal %d - should start at %d, head %d", i, len(sector.Pieces), sector.SectorNumber, p.DealInfo.DealID, proposal.StartEpoch, height)} - } - } - return nil -} - // checkPrecommit checks that data commitment generated in the sealing process // matches pieces, and that the seal ticket isn't expired func checkPrecommit(ctx context.Context, maddr address.Address, si SectorInfo, tok TipSetToken, height abi.ChainEpoch, api SealingAPI) (err error) { diff --git a/extern/storage-sealing/states_replica_update.go b/extern/storage-sealing/states_replica_update.go index 7c237add5..b2121ef72 100644 --- a/extern/storage-sealing/states_replica_update.go +++ b/extern/storage-sealing/states_replica_update.go @@ -31,7 +31,7 @@ func (m *Sealing) handleProveReplicaUpdate(ctx statemachine.Context, sector Sect return xerrors.Errorf("invalid sector %d with nil CommR", sector.SectorNumber) } - if err := checkDealExpiration(ctx.Context(), sector, m.Api); err != nil { // Sanity check state + if err := checkPieces(ctx.Context(), m.maddr, sector, m.Api); err != nil { // Sanity check state return handleErrors(ctx, err, sector) } @@ -58,7 +58,7 @@ func (m *Sealing) handleSubmitReplicaUpdate(ctx statemachine.Context, sector Sec return nil } - if err := checkDealExpiration(ctx.Context(), sector, m.Api); err != nil { // Sanity check state + if err := checkPieces(ctx.Context(), m.maddr, sector, m.Api); err != nil { // Sanity check state return handleErrors(ctx, err, sector) }