Merge pull request #9325 from filecoin-project/fix/missing-pci

fix: sealing: Drop unused PreCommitInfo from pipeline.SectorInfo
This commit is contained in:
Aayush Rajasekaran 2022-09-16 12:10:45 -04:00 committed by GitHub
commit 7663ec2bde
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 1 additions and 46 deletions

View File

@ -13,7 +13,6 @@ import (
xerrors "golang.org/x/xerrors"
abi "github.com/filecoin-project/go-state-types/abi"
miner "github.com/filecoin-project/go-state-types/builtin/v9/miner"
api "github.com/filecoin-project/lotus/api"
)
@ -154,7 +153,7 @@ func (t *SectorInfo) MarshalCBOR(w io.Writer) error {
cw := cbg.NewCborWriter(w)
if _, err := cw.Write([]byte{184, 32}); err != nil {
if _, err := cw.Write([]byte{184, 31}); err != nil {
return err
}
@ -404,22 +403,6 @@ func (t *SectorInfo) MarshalCBOR(w io.Writer) error {
return err
}
// t.PreCommitInfo (miner.SectorPreCommitInfo) (struct)
if len("PreCommitInfo") > cbg.MaxLength {
return xerrors.Errorf("Value in field \"PreCommitInfo\" was too long")
}
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("PreCommitInfo"))); err != nil {
return err
}
if _, err := io.WriteString(w, string("PreCommitInfo")); err != nil {
return err
}
if err := t.PreCommitInfo.MarshalCBOR(cw); err != nil {
return err
}
// t.PreCommitDeposit (big.Int) (struct)
if len("PreCommitDeposit") > cbg.MaxLength {
return xerrors.Errorf("Value in field \"PreCommitDeposit\" was too long")
@ -1128,26 +1111,6 @@ func (t *SectorInfo) UnmarshalCBOR(r io.Reader) (err error) {
if _, err := io.ReadFull(cr, t.Proof[:]); err != nil {
return err
}
// t.PreCommitInfo (miner.SectorPreCommitInfo) (struct)
case "PreCommitInfo":
{
b, err := cr.ReadByte()
if err != nil {
return err
}
if b != cbg.CborNull[0] {
if err := cr.UnreadByte(); err != nil {
return err
}
t.PreCommitInfo = new(miner.SectorPreCommitInfo)
if err := t.PreCommitInfo.UnmarshalCBOR(cr); err != nil {
return xerrors.Errorf("unmarshaling t.PreCommitInfo pointer: %w", err)
}
}
}
// t.PreCommitDeposit (big.Int) (struct)
case "PreCommitDeposit":

View File

@ -205,7 +205,6 @@ type SectorPreCommitted struct {
func (evt SectorPreCommitted) apply(state *SectorInfo) {
state.PreCommitMessage = &evt.Message
state.PreCommitDeposit = evt.PreCommitDeposit
state.PreCommitInfo = &evt.PreCommitInfo
}
type SectorSeedReady struct {

View File

@ -391,11 +391,6 @@ func (m *Sealing) handleDealsExpired(ctx statemachine.Context, sector SectorInfo
return xerrors.Errorf("sector is committed on-chain, but we're in DealsExpired")
}
if sector.PreCommitInfo == nil {
// TODO: Create a separate state which will remove those pieces, and go back to PC1
log.Errorf("non-precommitted sector with expired deals, can't recover from this yet")
}
// Not much to do here, we can't go back in time to commit this sector
return ctx.Send(SectorRemove{})
}

View File

@ -7,7 +7,6 @@ import (
"github.com/filecoin-project/go-state-types/abi"
"github.com/filecoin-project/go-state-types/big"
"github.com/filecoin-project/go-state-types/builtin/v9/miner"
"github.com/filecoin-project/lotus/api"
"github.com/filecoin-project/lotus/chain/types"
@ -74,7 +73,6 @@ type SectorInfo struct {
CommR *cid.Cid // SectorKey
Proof []byte
PreCommitInfo *miner.SectorPreCommitInfo
PreCommitDeposit big.Int
PreCommitMessage *cid.Cid
PreCommitTipSet types.TipSetKey