Merge pull request #6634 from GFZRZK/GFZRZK/correct_check_commit
remove precommit check in handleCommitFailed
This commit is contained in:
commit
2dad06d59f
29
extern/storage-sealing/states_failed.go
vendored
29
extern/storage-sealing/states_failed.go
vendored
@ -182,7 +182,7 @@ func (m *Sealing) handleComputeProofFailed(ctx statemachine.Context, sector Sect
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (m *Sealing) handleCommitFailed(ctx statemachine.Context, sector SectorInfo) error {
|
func (m *Sealing) handleCommitFailed(ctx statemachine.Context, sector SectorInfo) error {
|
||||||
tok, height, err := m.api.ChainHead(ctx.Context())
|
tok, _, err := m.api.ChainHead(ctx.Context())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Errorf("handleCommitting: api error, not proceeding: %+v", err)
|
log.Errorf("handleCommitting: api error, not proceeding: %+v", err)
|
||||||
return nil
|
return nil
|
||||||
@ -216,33 +216,6 @@ func (m *Sealing) handleCommitFailed(ctx statemachine.Context, sector SectorInfo
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := checkPrecommit(ctx.Context(), m.maddr, sector, tok, height, m.api); err != nil {
|
|
||||||
switch err.(type) {
|
|
||||||
case *ErrApi:
|
|
||||||
log.Errorf("handleCommitFailed: api error, not proceeding: %+v", err)
|
|
||||||
return nil
|
|
||||||
case *ErrBadCommD:
|
|
||||||
return ctx.Send(SectorSealPreCommit1Failed{xerrors.Errorf("bad CommD error: %w", err)})
|
|
||||||
case *ErrExpiredTicket:
|
|
||||||
return ctx.Send(SectorTicketExpired{xerrors.Errorf("ticket expired error, removing sector: %w", err)})
|
|
||||||
case *ErrBadTicket:
|
|
||||||
return ctx.Send(SectorTicketExpired{xerrors.Errorf("expired ticket, removing sector: %w", err)})
|
|
||||||
case *ErrInvalidDeals:
|
|
||||||
log.Warnf("invalid deals in sector %d: %v", sector.SectorNumber, err)
|
|
||||||
return ctx.Send(SectorInvalidDealIDs{Return: RetCommitFailed})
|
|
||||||
case *ErrExpiredDeals:
|
|
||||||
return ctx.Send(SectorDealsExpired{xerrors.Errorf("sector deals expired: %w", err)})
|
|
||||||
case nil:
|
|
||||||
return ctx.Send(SectorChainPreCommitFailed{xerrors.Errorf("no precommit: %w", err)})
|
|
||||||
case *ErrPrecommitOnChain:
|
|
||||||
// noop, this is expected
|
|
||||||
case *ErrSectorNumberAllocated:
|
|
||||||
// noop, already committed?
|
|
||||||
default:
|
|
||||||
return xerrors.Errorf("checkPrecommit sanity check error (%T): %w", err, err)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if err := m.checkCommit(ctx.Context(), sector, sector.Proof, tok); err != nil {
|
if err := m.checkCommit(ctx.Context(), sector, sector.Proof, tok); err != nil {
|
||||||
switch err.(type) {
|
switch err.(type) {
|
||||||
case *ErrApi:
|
case *ErrApi:
|
||||||
|
Loading…
Reference in New Issue
Block a user