stmgr: Correctly read sectorset

This commit is contained in:
Łukasz Magiera 2020-02-19 21:34:21 +01:00
parent 835e3d803f
commit c69c9e62c2
3 changed files with 6 additions and 9 deletions

View File

@ -535,7 +535,7 @@ func IsRoundWinner(ctx context.Context, ts *types.TipSet, round int64, miner add
for _, s := range pset {
cr, err := commcid.CIDToReplicaCommitmentV1(s.Info.Info.SealedCID)
if err != nil {
return nil, err
return nil, xerrors.Errorf("get sealed cid: %w", err)
}
var commRa [32]byte
copy(commRa[:], cr)

View File

@ -352,6 +352,10 @@ func (sm *StateManager) LoadActorState(ctx context.Context, a address.Address, o
cst := cbor.NewCborStore(sm.cs.Blockstore())
if err := cst.Get(ctx, act.Head, out); err != nil {
var r cbg.Deferred
cst.Get(ctx, act.Head, &r)
fmt.Printf("badhead %x\n", r.Raw)
return nil, err
}

View File

@ -272,14 +272,7 @@ func LoadSectorsFromSet(ctx context.Context, bs blockstore.Blockstore, ssc cid.C
return err
}
sset = append(sset, &api.ChainSectorInfo{
Info: miner.SectorOnChainInfo{
Info: miner.SectorPreCommitInfo{},
ActivationEpoch: 0,
DealWeight: abi.DealWeight{},
PledgeRequirement: abi.TokenAmount{},
DeclaredFaultEpoch: 0,
DeclaredFaultDuration: 0,
},
Info: oci,
ID: abi.SectorNumber(i),
})
return nil