Skip to content

Commit 9e03fca

Browse files
magik6kjennijujuarajasekShrenuj Bansalrjan90
authored
feat: sealing: Support nv22 DDO features in the sealing pipeline (#11226)
* Initial work supporting DDO pieces in lotus-miner * sealing: Update pipeline input to operate on UniversalPiece * sealing: Update pipeline checks/sealing states to operate on UniversalPiece * sealing: Make pipeline build with UniversalPiece * move PieceDealInfo out of api * make gen * make sealing pipeline unit tests pass * fix itest ensemble build * don't panic in SectorsStatus with deals * stop linter from complaining about checkPieces * fix sector import tests * mod tidy * sealing: Add logic for (pre)committing DDO sectors * sealing: state-types with method defs * DDO non-snap pipeline works(?), DDO Itests * DDO support in snapdeals pipeline * make gen * update actor bundles * update the gst market fix * fix: chain: use PreCommitSectorsBatch2 when setting up genesis * some bug fixes * integration working changes * update actor bundles * Make TestOnboardRawPieceSnap pass * Appease the linter * Make deadlines test pass with v12 actors * Update go-state-types, abstract market DealState * make gen * mod tidy, lint fixes * Fix some more tests * Bump version in master Bump version in master * Make gen Make gen * fix sender * fix: lotus-provider: Fix winning PoSt * fix: sql Scan cannot write to an object * Actually show miner-addrs in info-log Actually show miner-addrs in lotus-provider info-log * [WIP] feat: Add nv22 skeleton Addition of Network Version 22 skeleton * update FFI * ddo is now nv22 * make gen * temp actor bundle with ddo * use working go-state-types * gst with v13 market migration * update bundle, builtin.MethodsMiner.ProveCommitSectors2 -> 3 * actually working v13 migration, v13 migration itest * Address review * sealing: Correct DDO snap pledge math * itests: Mixed ddo itest * pipeline: Fix sectorWeight * sealing: convert market deals into PAMs in mixed sectors * sealing: make market to ddo conversion work * fix lint * update gst * Update actors and GST to lastest integ branch * commit batcher: Update ProveCommitSectors3Params builder logic * make gen * use builtin-actors master * ddo: address review * itests: Add commd assertions to ddo tests * make gen * gst with fixed types * config knobs for RequireActivationSuccess * storage: Drop obsolete flaky tasts --------- Co-authored-by: Jennifer Wang <[email protected]> Co-authored-by: Aayush <[email protected]> Co-authored-by: Shrenuj Bansal <[email protected]> Co-authored-by: Phi <[email protected]> Co-authored-by: Andrew Jackson (Ajax) <[email protected]> Co-authored-by: TippyFlits <[email protected]>
1 parent a967a36 commit 9e03fca

File tree

103 files changed

+3581
-3140
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

103 files changed

+3581
-3140
lines changed

.circleci/config.yml

+6
Original file line numberDiff line numberDiff line change
@@ -663,6 +663,12 @@ workflows:
663663
- build
664664
suite: itest-decode_params
665665
target: "./itests/decode_params_test.go"
666+
- test:
667+
name: test-itest-direct_data_onboard
668+
requires:
669+
- build
670+
suite: itest-direct_data_onboard
671+
target: "./itests/direct_data_onboard_test.go"
666672
- test:
667673
name: test-itest-dup_mpool_messages
668674
requires:

api/api_full.go

+43-2
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,17 @@ import (
2020
"github.com/filecoin-project/go-state-types/abi"
2121
"github.com/filecoin-project/go-state-types/big"
2222
"github.com/filecoin-project/go-state-types/builtin/v8/paych"
23-
"github.com/filecoin-project/go-state-types/builtin/v9/market"
2423
verifregtypes "github.com/filecoin-project/go-state-types/builtin/v9/verifreg"
2524
"github.com/filecoin-project/go-state-types/crypto"
2625
"github.com/filecoin-project/go-state-types/dline"
2726
abinetwork "github.com/filecoin-project/go-state-types/network"
2827

2928
apitypes "github.com/filecoin-project/lotus/api/types"
3029
"github.com/filecoin-project/lotus/chain/actors/builtin"
30+
"github.com/filecoin-project/lotus/chain/actors/builtin/market"
3131
"github.com/filecoin-project/lotus/chain/actors/builtin/miner"
3232
"github.com/filecoin-project/lotus/chain/actors/builtin/power"
33+
"github.com/filecoin-project/lotus/chain/actors/builtin/verifreg"
3334
"github.com/filecoin-project/lotus/chain/types"
3435
"github.com/filecoin-project/lotus/chain/types/ethtypes"
3536
"github.com/filecoin-project/lotus/node/modules/dtypes"
@@ -552,6 +553,8 @@ type FullNode interface {
552553
// StateGetAllocationForPendingDeal returns the allocation for a given deal ID of a pending deal. Returns nil if
553554
// pending allocation is not found.
554555
StateGetAllocationForPendingDeal(ctx context.Context, dealId abi.DealID, tsk types.TipSetKey) (*verifregtypes.Allocation, error) //perm:read
556+
// StateGetAllocationIdForPendingDeal is like StateGetAllocationForPendingDeal except it returns the allocation ID
557+
StateGetAllocationIdForPendingDeal(ctx context.Context, dealId abi.DealID, tsk types.TipSetKey) (verifreg.AllocationId, error) //perm:read
555558
// StateGetAllocation returns the allocation for a given address and allocation ID.
556559
StateGetAllocation(ctx context.Context, clientAddr address.Address, allocationId verifregtypes.AllocationId, tsk types.TipSetKey) (*verifregtypes.Allocation, error) //perm:read
557560
// StateGetAllocations returns the all the allocations for a given client.
@@ -1117,9 +1120,47 @@ type MarketBalance struct {
11171120
Locked big.Int
11181121
}
11191122

1123+
type MarketDealState struct {
1124+
SectorStartEpoch abi.ChainEpoch // -1 if not yet included in proven sector
1125+
LastUpdatedEpoch abi.ChainEpoch // -1 if deal state never updated
1126+
SlashEpoch abi.ChainEpoch // -1 if deal never slashed
1127+
}
1128+
1129+
func MakeDealState(mds market.DealState) MarketDealState {
1130+
return MarketDealState{
1131+
SectorStartEpoch: mds.SectorStartEpoch(),
1132+
LastUpdatedEpoch: mds.LastUpdatedEpoch(),
1133+
SlashEpoch: mds.SlashEpoch(),
1134+
}
1135+
}
1136+
1137+
type mstate struct {
1138+
s MarketDealState
1139+
}
1140+
1141+
func (m mstate) SectorStartEpoch() abi.ChainEpoch {
1142+
return m.s.SectorStartEpoch
1143+
}
1144+
1145+
func (m mstate) LastUpdatedEpoch() abi.ChainEpoch {
1146+
return m.s.LastUpdatedEpoch
1147+
}
1148+
1149+
func (m mstate) SlashEpoch() abi.ChainEpoch {
1150+
return m.s.SlashEpoch
1151+
}
1152+
1153+
func (m mstate) Equals(o market.DealState) bool {
1154+
return market.DealStatesEqual(m, o)
1155+
}
1156+
1157+
func (m MarketDealState) Iface() market.DealState {
1158+
return mstate{m}
1159+
}
1160+
11201161
type MarketDeal struct {
11211162
Proposal market.DealProposal
1122-
State market.DealState
1163+
State MarketDealState
11231164
}
11241165

11251166
type RetrievalOrder struct {

api/api_storage.go

+15-25
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import (
2424
builtinactors "github.com/filecoin-project/lotus/chain/actors/builtin"
2525
"github.com/filecoin-project/lotus/chain/actors/builtin/miner"
2626
"github.com/filecoin-project/lotus/chain/types"
27+
"github.com/filecoin-project/lotus/storage/pipeline/piece"
2728
"github.com/filecoin-project/lotus/storage/pipeline/sealiface"
2829
"github.com/filecoin-project/lotus/storage/sealer/fsutil"
2930
"github.com/filecoin-project/lotus/storage/sealer/storiface"
@@ -75,7 +76,7 @@ type StorageMiner interface {
7576
// Add piece to an open sector. If no sectors with enough space are open,
7677
// either a new sector will be created, or this call will block until more
7778
// sectors can be created.
78-
SectorAddPieceToAny(ctx context.Context, size abi.UnpaddedPieceSize, r storiface.Data, d PieceDealInfo) (SectorOffset, error) //perm:admin
79+
SectorAddPieceToAny(ctx context.Context, size abi.UnpaddedPieceSize, r storiface.Data, d piece.PieceDealInfo) (SectorOffset, error) //perm:admin
7980

8081
SectorsUnsealPiece(ctx context.Context, sector storiface.SectorRef, offset storiface.UnpaddedByteIndex, size abi.UnpaddedPieceSize, randomness abi.SealRandomness, commd *cid.Cid) error //perm:admin
8182

@@ -353,10 +354,21 @@ type SectorLog struct {
353354
}
354355

355356
type SectorPiece struct {
356-
Piece abi.PieceInfo
357-
DealInfo *PieceDealInfo // nil for pieces which do not appear in deals (e.g. filler pieces)
357+
Piece abi.PieceInfo
358+
359+
// DealInfo is nil for pieces which do not appear in deals (e.g. filler pieces)
360+
// NOTE: DDO pieces which aren't associated with a market deal and have no
361+
// verified allocation will still have a non-nil DealInfo.
362+
// nil DealInfo indicates that the piece is a filler, and has zero piece commitment.
363+
DealInfo *piece.PieceDealInfo
358364
}
359365

366+
// DEPRECATED: Use piece.PieceDealInfo instead
367+
type PieceDealInfo = piece.PieceDealInfo
368+
369+
// DEPRECATED: Use piece.DealSchedule instead
370+
type DealSchedule = piece.DealSchedule
371+
360372
type SectorInfo struct {
361373
SectorID abi.SectorNumber
362374
State SectorState
@@ -459,28 +471,6 @@ type SectorOffset struct {
459471
Offset abi.PaddedPieceSize
460472
}
461473

462-
// DealInfo is a tuple of deal identity and its schedule
463-
type PieceDealInfo struct {
464-
// "Old" builtin-market deal info
465-
PublishCid *cid.Cid
466-
DealID abi.DealID
467-
DealProposal *market.DealProposal
468-
469-
// Common deal info
470-
DealSchedule DealSchedule
471-
472-
// Best-effort deal asks
473-
KeepUnsealed bool
474-
}
475-
476-
// DealSchedule communicates the time interval of a storage deal. The deal must
477-
// appear in a sealed (proven) sector no later than StartEpoch, otherwise it
478-
// is invalid.
479-
type DealSchedule struct {
480-
StartEpoch abi.ChainEpoch
481-
EndEpoch abi.ChainEpoch
482-
}
483-
484474
// DagstoreShardInfo is the serialized form of dagstore.DagstoreShardInfo that
485475
// we expose through JSON-RPC to avoid clients having to depend on the
486476
// dagstore lib.

0 commit comments

Comments
 (0)