sealing pipeline: Set commd in precommit params
This commit is contained in:
parent
1c447b265b
commit
556815f844
@ -13,6 +13,7 @@ import (
|
||||
"github.com/filecoin-project/go-fil-markets/storagemarket"
|
||||
"github.com/filecoin-project/go-state-types/abi"
|
||||
"github.com/filecoin-project/go-state-types/builtin"
|
||||
miner2 "github.com/filecoin-project/go-state-types/builtin/v11/miner"
|
||||
"github.com/filecoin-project/go-state-types/builtin/v8/miner"
|
||||
"github.com/filecoin-project/go-state-types/builtin/v9/market"
|
||||
|
||||
@ -107,7 +108,10 @@ func (mgr *SectorCommittedManager) OnDealSectorPreCommitted(ctx context.Context,
|
||||
|
||||
// Watch for a pre-commit message to the provider.
|
||||
matchEvent := func(msg *types.Message) (bool, error) {
|
||||
matched := msg.To == provider && (msg.Method == builtin.MethodsMiner.PreCommitSector || msg.Method == builtin.MethodsMiner.PreCommitSectorBatch || msg.Method == builtin.MethodsMiner.ProveReplicaUpdates)
|
||||
matched := msg.To == provider && (msg.Method == builtin.MethodsMiner.PreCommitSector ||
|
||||
msg.Method == builtin.MethodsMiner.PreCommitSectorBatch ||
|
||||
msg.Method == builtin.MethodsMiner.PreCommitSectorBatch2 ||
|
||||
msg.Method == builtin.MethodsMiner.ProveReplicaUpdates)
|
||||
return matched, nil
|
||||
}
|
||||
|
||||
@ -333,6 +337,21 @@ func dealSectorInPreCommitMsg(msg *types.Message, res pipeline.CurrentDealInfo)
|
||||
return nil, xerrors.Errorf("unmarshal pre commit: %w", err)
|
||||
}
|
||||
|
||||
for _, precommit := range params.Sectors {
|
||||
// Check through the deal IDs associated with this message
|
||||
for _, did := range precommit.DealIDs {
|
||||
if did == res.DealID {
|
||||
// Found the deal ID in this message. Callback with the sector ID.
|
||||
return &precommit.SectorNumber, nil
|
||||
}
|
||||
}
|
||||
}
|
||||
case builtin.MethodsMiner.PreCommitSectorBatch2:
|
||||
var params miner2.PreCommitSectorBatchParams2
|
||||
if err := params.UnmarshalCBOR(bytes.NewReader(msg.Params)); err != nil {
|
||||
return nil, xerrors.Errorf("unmarshal pre commit: %w", err)
|
||||
}
|
||||
|
||||
for _, precommit := range params.Sectors {
|
||||
// Check through the deal IDs associated with this message
|
||||
for _, did := range precommit.DealIDs {
|
||||
|
@ -366,6 +366,8 @@ func (m *Sealing) preCommitInfo(ctx statemachine.Context, sector SectorInfo) (*m
|
||||
SealedCID: *sector.CommR,
|
||||
SealRandEpoch: sector.TicketEpoch,
|
||||
DealIDs: sector.dealIDs(),
|
||||
|
||||
UnsealedCid: sector.CommD,
|
||||
}
|
||||
|
||||
collateral, err := m.Api.StateMinerPreCommitDepositForPower(ctx.Context(), m.maddr, *params, ts.Key())
|
||||
|
Loading…
Reference in New Issue
Block a user