If sectorInfo doesnt have CommD or CommR set during commit, don't crash
This commit is contained in:
parent
8df9c483f3
commit
2e78f2c267
2
extern/storage-sealing/checks.go
vendored
2
extern/storage-sealing/checks.go
vendored
@ -79,7 +79,7 @@ func checkPrecommit(ctx context.Context, maddr address.Address, si SectorInfo, t
|
|||||||
return &ErrApi{xerrors.Errorf("calling StateComputeDataCommitment: %w", err)}
|
return &ErrApi{xerrors.Errorf("calling StateComputeDataCommitment: %w", err)}
|
||||||
}
|
}
|
||||||
|
|
||||||
if !commD.Equals(*si.CommD) {
|
if si.CommD == nil || !commD.Equals(*si.CommD) {
|
||||||
return &ErrBadCommD{xerrors.Errorf("on chain CommD differs from sector: %s != %s", commD, si.CommD)}
|
return &ErrBadCommD{xerrors.Errorf("on chain CommD differs from sector: %s != %s", commD, si.CommD)}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
4
extern/storage-sealing/states_sealing.go
vendored
4
extern/storage-sealing/states_sealing.go
vendored
@ -308,6 +308,10 @@ func (m *Sealing) handleCommitting(ctx statemachine.Context, sector SectorInfo)
|
|||||||
|
|
||||||
log.Infof("KOMIT %d %x(%d); %x(%d); %v; r:%x; d:%x", sector.SectorNumber, sector.TicketValue, sector.TicketEpoch, sector.SeedValue, sector.SeedEpoch, sector.pieceInfos(), sector.CommR, sector.CommD)
|
log.Infof("KOMIT %d %x(%d); %x(%d); %v; r:%x; d:%x", sector.SectorNumber, sector.TicketValue, sector.TicketEpoch, sector.SeedValue, sector.SeedEpoch, sector.pieceInfos(), sector.CommR, sector.CommD)
|
||||||
|
|
||||||
|
if sector.CommD == nil || sector.CommR == nil {
|
||||||
|
return ctx.Send(SectorCommitFailed{xerrors.Errorf("sector had nil commR or commD")})
|
||||||
|
}
|
||||||
|
|
||||||
cids := storage.SectorCids{
|
cids := storage.SectorCids{
|
||||||
Unsealed: *sector.CommD,
|
Unsealed: *sector.CommD,
|
||||||
Sealed: *sector.CommR,
|
Sealed: *sector.CommR,
|
||||||
|
Loading…
Reference in New Issue
Block a user