diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 8d19589f728..54d608c161d 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -43,7 +43,6 @@ jobs: - uses: ./.github/actions/install-go - run: make deps lotus - run: go install golang.org/x/tools/cmd/goimports - - run: go install github.com/hannahhoward/cbor-gen-for - run: make gen - run: git diff --exit-code - run: make docsgen-cli diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4553158f9bc..ac7b38ee5b1 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -96,6 +96,7 @@ jobs: "itest-get_messages_in_ts": ["self-hosted", "linux", "x64", "xlarge"], "itest-lite_migration": ["self-hosted", "linux", "x64", "xlarge"], "itest-lookup_robust_address": ["self-hosted", "linux", "x64", "xlarge"], + "itest-manual_onboarding": ["self-hosted", "linux", "x64", "xlarge"], "itest-mempool": ["self-hosted", "linux", "x64", "xlarge"], "itest-mpool_msg_uuid": ["self-hosted", "linux", "x64", "xlarge"], "itest-mpool_push_with_uuid": ["self-hosted", "linux", "x64", "xlarge"], @@ -128,6 +129,7 @@ jobs: "itest-deals", "itest-direct_data_onboard_verified", "itest-direct_data_onboard", + "itest-manual_onboarding", "itest-net", "itest-path_detach_redeclare", "itest-path_type_filters", diff --git a/api/api_full.go b/api/api_full.go index 5d2fdc49103..069f12bda34 100644 --- a/api/api_full.go +++ b/api/api_full.go @@ -9,13 +9,9 @@ import ( "github.com/google/uuid" blocks "github.com/ipfs/go-block-format" "github.com/ipfs/go-cid" - "github.com/libp2p/go-libp2p/core/peer" "github.com/filecoin-project/go-address" "github.com/filecoin-project/go-bitfield" - datatransfer "github.com/filecoin-project/go-data-transfer/v2" - "github.com/filecoin-project/go-fil-markets/retrievalmarket" - "github.com/filecoin-project/go-fil-markets/storagemarket" "github.com/filecoin-project/go-jsonrpc" "github.com/filecoin-project/go-state-types/abi" "github.com/filecoin-project/go-state-types/big" @@ -34,7 +30,6 @@ import ( "github.com/filecoin-project/lotus/chain/types" "github.com/filecoin-project/lotus/chain/types/ethtypes" "github.com/filecoin-project/lotus/node/modules/dtypes" - "github.com/filecoin-project/lotus/node/repo/imports" ) //go:generate go run github.com/golang/mock/mockgen -destination=mocks/mock_full.go -package=mocks . FullNode @@ -348,74 +343,6 @@ type FullNode interface { // Other - // MethodGroup: Client - // The Client methods all have to do with interacting with the storage and - // retrieval markets as a client - - // ClientImport imports file under the specified path into filestore. - ClientImport(ctx context.Context, ref FileRef) (*ImportRes, error) //perm:admin - // ClientRemoveImport removes file import - ClientRemoveImport(ctx context.Context, importID imports.ID) error //perm:admin - // ClientStartDeal proposes a deal with a miner. - ClientStartDeal(ctx context.Context, params *StartDealParams) (*cid.Cid, error) //perm:admin - // ClientStatelessDeal fire-and-forget-proposes an offline deal to a miner without subsequent tracking. - ClientStatelessDeal(ctx context.Context, params *StartDealParams) (*cid.Cid, error) //perm:write - // ClientGetDealInfo returns the latest information about a given deal. - ClientGetDealInfo(context.Context, cid.Cid) (*DealInfo, error) //perm:read - // ClientListDeals returns information about the deals made by the local client. - ClientListDeals(ctx context.Context) ([]DealInfo, error) //perm:write - // ClientGetDealUpdates returns the status of updated deals - ClientGetDealUpdates(ctx context.Context) (<-chan DealInfo, error) //perm:write - // ClientGetDealStatus returns status given a code - ClientGetDealStatus(ctx context.Context, statusCode uint64) (string, error) //perm:read - // ClientHasLocal indicates whether a certain CID is locally stored. - ClientHasLocal(ctx context.Context, root cid.Cid) (bool, error) //perm:write - // ClientFindData identifies peers that have a certain file, and returns QueryOffers (one per peer). - ClientFindData(ctx context.Context, root cid.Cid, piece *cid.Cid) ([]QueryOffer, error) //perm:read - // ClientMinerQueryOffer returns a QueryOffer for the specific miner and file. - ClientMinerQueryOffer(ctx context.Context, miner address.Address, root cid.Cid, piece *cid.Cid) (QueryOffer, error) //perm:read - // ClientRetrieve initiates the retrieval of a file, as specified in the order. - ClientRetrieve(ctx context.Context, params RetrievalOrder) (*RestrievalRes, error) //perm:admin - // ClientRetrieveWait waits for retrieval to be complete - ClientRetrieveWait(ctx context.Context, deal retrievalmarket.DealID) error //perm:admin - // ClientExport exports a file stored in the local filestore to a system file - ClientExport(ctx context.Context, exportRef ExportRef, fileRef FileRef) error //perm:admin - // ClientListRetrievals returns information about retrievals made by the local client - ClientListRetrievals(ctx context.Context) ([]RetrievalInfo, error) //perm:write - // ClientGetRetrievalUpdates returns status of updated retrieval deals - ClientGetRetrievalUpdates(ctx context.Context) (<-chan RetrievalInfo, error) //perm:write - // ClientQueryAsk returns a signed StorageAsk from the specified miner. - ClientQueryAsk(ctx context.Context, p peer.ID, miner address.Address) (*StorageAsk, error) //perm:read - // ClientCalcCommP calculates the CommP and data size of the specified CID - ClientDealPieceCID(ctx context.Context, root cid.Cid) (DataCIDSize, error) //perm:read - // ClientCalcCommP calculates the CommP for a specified file - ClientCalcCommP(ctx context.Context, inpath string) (*CommPRet, error) //perm:write - // ClientGenCar generates a CAR file for the specified file. - ClientGenCar(ctx context.Context, ref FileRef, outpath string) error //perm:write - // ClientDealSize calculates real deal data size - ClientDealSize(ctx context.Context, root cid.Cid) (DataSize, error) //perm:read - // ClientListTransfers returns the status of all ongoing transfers of data - ClientListDataTransfers(ctx context.Context) ([]DataTransferChannel, error) //perm:write - ClientDataTransferUpdates(ctx context.Context) (<-chan DataTransferChannel, error) //perm:write - // ClientRestartDataTransfer attempts to restart a data transfer with the given transfer ID and other peer - ClientRestartDataTransfer(ctx context.Context, transferID datatransfer.TransferID, otherPeer peer.ID, isInitiator bool) error //perm:write - // ClientCancelDataTransfer cancels a data transfer with the given transfer ID and other peer - ClientCancelDataTransfer(ctx context.Context, transferID datatransfer.TransferID, otherPeer peer.ID, isInitiator bool) error //perm:write - // ClientRetrieveTryRestartInsufficientFunds attempts to restart stalled retrievals on a given payment channel - // which are stuck due to insufficient funds - ClientRetrieveTryRestartInsufficientFunds(ctx context.Context, paymentChannel address.Address) error //perm:write - - // ClientCancelRetrievalDeal cancels an ongoing retrieval deal based on DealID - ClientCancelRetrievalDeal(ctx context.Context, dealid retrievalmarket.DealID) error //perm:write - - // ClientUnimport removes references to the specified file from filestore - // ClientUnimport(path string) - - // ClientListImports lists imported files and their root CIDs - ClientListImports(ctx context.Context) ([]Import, error) //perm:write - - // ClientListAsks() []Ask - // MethodGroup: State // The State methods are used to query, inspect, and interact with chain state. // Most methods take a TipSetKey as a parameter. The state looked up is the parent state of the tipset. @@ -938,17 +865,6 @@ type EthSubscriber interface { EthSubscription(ctx context.Context, r jsonrpc.RawParams) error // rpc_method:eth_subscription notify:true } -type StorageAsk struct { - Response *storagemarket.StorageAsk - - DealProtocols []string -} - -type FileRef struct { - Path string - IsCAR bool -} - type MinerSectors struct { // Live sectors that should be proven. Live uint64 @@ -958,55 +874,6 @@ type MinerSectors struct { Faulty uint64 } -type ImportRes struct { - Root cid.Cid - ImportID imports.ID -} - -type Import struct { - Key imports.ID - Err string - - Root *cid.Cid - - // Source is the provenance of the import, e.g. "import", "unknown", else. - // Currently useless but may be used in the future. - Source string - - // FilePath is the path of the original file. It is important that the file - // is retained at this path, because it will be referenced during - // the transfer (when we do the UnixFS chunking, we don't duplicate the - // leaves, but rather point to chunks of the original data through - // positional references). - FilePath string - - // CARPath is the path of the CAR file containing the DAG for this import. - CARPath string -} - -type DealInfo struct { - ProposalCid cid.Cid - State storagemarket.StorageDealStatus - Message string // more information about deal state, particularly errors - DealStages *storagemarket.DealStages - Provider address.Address - - DataRef *storagemarket.DataRef - PieceCID cid.Cid - Size uint64 - - PricePerEpoch types.BigInt - Duration uint64 - - DealID abi.DealID - - CreationTime time.Time - Verified bool - - TransferChannelID *datatransfer.ChannelID - DataTransfer *DataTransferChannel -} - type MsgLookup struct { Message cid.Cid // Can be different than requested, in case it was replaced, but only gas values changed Receipt types.MessageReceipt @@ -1128,38 +995,6 @@ type MinerPower struct { HasMinPower bool } -type QueryOffer struct { - Err string - - Root cid.Cid - Piece *cid.Cid - - Size uint64 - MinPrice types.BigInt - UnsealPrice types.BigInt - PricePerByte abi.TokenAmount - PaymentInterval uint64 - PaymentIntervalIncrease uint64 - Miner address.Address - MinerPeer retrievalmarket.RetrievalPeer -} - -func (o *QueryOffer) Order(client address.Address) RetrievalOrder { - return RetrievalOrder{ - Root: o.Root, - Piece: o.Piece, - Size: o.Size, - Total: o.MinPrice, - UnsealPrice: o.UnsealPrice, - PaymentInterval: o.PaymentInterval, - PaymentIntervalIncrease: o.PaymentIntervalIncrease, - Client: client, - - Miner: o.Miner, - MinerPeer: &o.MinerPeer, - } -} - type MarketBalance struct { Escrow big.Int Locked big.Int @@ -1214,25 +1049,6 @@ type MarketDeal struct { State MarketDealState } -type RetrievalOrder struct { - Root cid.Cid - Piece *cid.Cid - DataSelector *Selector - - // todo: Size/Total are only used for calculating price per byte; we should let users just pass that - Size uint64 - Total types.BigInt - - UnsealPrice types.BigInt - PaymentInterval uint64 - PaymentIntervalIncrease uint64 - Client address.Address - Miner address.Address - MinerPeer *retrievalmarket.RetrievalPeer - - RemoteStore *RemoteStoreID `json:"RemoteStore,omitempty"` -} - type RemoteStoreID = uuid.UUID type InvocResult struct { @@ -1250,34 +1066,6 @@ type MethodCall struct { Error string } -type StartDealParams struct { - Data *storagemarket.DataRef - Wallet address.Address - Miner address.Address - EpochPrice types.BigInt - MinBlocksDuration uint64 - ProviderCollateral big.Int - DealStartEpoch abi.ChainEpoch - FastRetrieval bool - VerifiedDeal bool -} - -func (s *StartDealParams) UnmarshalJSON(raw []byte) (err error) { - type sdpAlias StartDealParams - - sdp := sdpAlias{ - FastRetrieval: true, - } - - if err := json.Unmarshal(raw, &sdp); err != nil { - return err - } - - *s = StartDealParams(sdp) - - return nil -} - type IpldObject struct { Cid cid.Cid Obj interface{} diff --git a/api/api_storage.go b/api/api_storage.go index 410fa2af16c..82cc6153f77 100644 --- a/api/api_storage.go +++ b/api/api_storage.go @@ -7,14 +7,9 @@ import ( "github.com/google/uuid" "github.com/ipfs/go-cid" - "github.com/libp2p/go-libp2p/core/peer" "github.com/filecoin-project/go-address" "github.com/filecoin-project/go-bitfield" - datatransfer "github.com/filecoin-project/go-data-transfer/v2" - "github.com/filecoin-project/go-fil-markets/piecestore" - "github.com/filecoin-project/go-fil-markets/retrievalmarket" - "github.com/filecoin-project/go-fil-markets/storagemarket" "github.com/filecoin-project/go-jsonrpc/auth" "github.com/filecoin-project/go-state-types/abi" "github.com/filecoin-project/go-state-types/big" @@ -215,109 +210,13 @@ type StorageMiner interface { StorageDetachLocal(ctx context.Context, path string) error //perm:admin StorageRedeclareLocal(ctx context.Context, id *storiface.ID, dropMissing bool) error //perm:admin - MarketImportDealData(ctx context.Context, propcid cid.Cid, path string) error //perm:write - MarketListDeals(ctx context.Context) ([]*MarketDeal, error) //perm:read - - // MarketListRetrievalDeals is deprecated, returns empty list - MarketListRetrievalDeals(ctx context.Context) ([]struct{}, error) //perm:read - MarketGetDealUpdates(ctx context.Context) (<-chan storagemarket.MinerDeal, error) //perm:read - MarketListIncompleteDeals(ctx context.Context) ([]storagemarket.MinerDeal, error) //perm:read - MarketSetAsk(ctx context.Context, price types.BigInt, verifiedPrice types.BigInt, duration abi.ChainEpoch, minPieceSize abi.PaddedPieceSize, maxPieceSize abi.PaddedPieceSize) error //perm:admin - MarketGetAsk(ctx context.Context) (*storagemarket.SignedStorageAsk, error) //perm:read - MarketSetRetrievalAsk(ctx context.Context, rask *retrievalmarket.Ask) error //perm:admin - MarketGetRetrievalAsk(ctx context.Context) (*retrievalmarket.Ask, error) //perm:read - MarketListDataTransfers(ctx context.Context) ([]DataTransferChannel, error) //perm:write - MarketDataTransferUpdates(ctx context.Context) (<-chan DataTransferChannel, error) //perm:write - // MarketDataTransferDiagnostics generates debugging information about current data transfers over graphsync - MarketDataTransferDiagnostics(ctx context.Context, p peer.ID) (*TransferDiagnostics, error) //perm:write - // MarketRestartDataTransfer attempts to restart a data transfer with the given transfer ID and other peer - MarketRestartDataTransfer(ctx context.Context, transferID datatransfer.TransferID, otherPeer peer.ID, isInitiator bool) error //perm:write - // MarketCancelDataTransfer cancels a data transfer with the given transfer ID and other peer - MarketCancelDataTransfer(ctx context.Context, transferID datatransfer.TransferID, otherPeer peer.ID, isInitiator bool) error //perm:write - MarketPendingDeals(ctx context.Context) (PendingDealInfo, error) //perm:write - MarketPublishPendingDeals(ctx context.Context) error //perm:admin - MarketRetryPublishDeal(ctx context.Context, propcid cid.Cid) error //perm:admin - - // DagstoreListShards returns information about all shards known to the - // DAG store. Only available on nodes running the markets subsystem. - DagstoreListShards(ctx context.Context) ([]DagstoreShardInfo, error) //perm:read - - // DagstoreInitializeShard initializes an uninitialized shard. - // - // Initialization consists of fetching the shard's data (deal payload) from - // the storage subsystem, generating an index, and persisting the index - // to facilitate later retrievals, and/or to publish to external sources. - // - // This operation is intended to complement the initial migration. The - // migration registers a shard for every unique piece CID, with lazy - // initialization. Thus, shards are not initialized immediately to avoid - // IO activity competing with proving. Instead, shard are initialized - // when first accessed. This method forces the initialization of a shard by - // accessing it and immediately releasing it. This is useful to warm up the - // cache to facilitate subsequent retrievals, and to generate the indexes - // to publish them externally. - // - // This operation fails if the shard is not in ShardStateNew state. - // It blocks until initialization finishes. - DagstoreInitializeShard(ctx context.Context, key string) error //perm:write - - // DagstoreRecoverShard attempts to recover a failed shard. - // - // This operation fails if the shard is not in ShardStateErrored state. - // It blocks until recovery finishes. If recovery failed, it returns the - // error. - DagstoreRecoverShard(ctx context.Context, key string) error //perm:write - - // DagstoreInitializeAll initializes all uninitialized shards in bulk, - // according to the policy passed in the parameters. - // - // It is recommended to set a maximum concurrency to avoid extreme - // IO pressure if the storage subsystem has a large amount of deals. - // - // It returns a stream of events to report progress. - DagstoreInitializeAll(ctx context.Context, params DagstoreInitializeAllParams) (<-chan DagstoreInitializeAllEvent, error) //perm:write - - // DagstoreGC runs garbage collection on the DAG store. - DagstoreGC(ctx context.Context) ([]DagstoreShardResult, error) //perm:admin - - // DagstoreRegisterShard registers a shard manually with dagstore with given pieceCID - DagstoreRegisterShard(ctx context.Context, key string) error //perm:admin - - // IndexerAnnounceDeal informs indexer nodes that a new deal was received, - // so they can download its index - IndexerAnnounceDeal(ctx context.Context, proposalCid cid.Cid) error //perm:admin - - // IndexerAnnounceAllDeals informs the indexer nodes aboutall active deals. - IndexerAnnounceAllDeals(ctx context.Context) error //perm:admin - - // DagstoreLookupPieces returns information about shards that contain the given CID. - DagstoreLookupPieces(ctx context.Context, cid cid.Cid) ([]DagstoreShardInfo, error) //perm:admin + MarketListDeals(ctx context.Context) ([]*MarketDeal, error) //perm:read // RuntimeSubsystems returns the subsystems that are enabled // in this instance. RuntimeSubsystems(ctx context.Context) (MinerSubsystems, error) //perm:read - DealsImportData(ctx context.Context, dealPropCid cid.Cid, file string) error //perm:admin - DealsList(ctx context.Context) ([]*MarketDeal, error) //perm:admin - DealsConsiderOnlineStorageDeals(context.Context) (bool, error) //perm:admin - DealsSetConsiderOnlineStorageDeals(context.Context, bool) error //perm:admin - DealsConsiderOnlineRetrievalDeals(context.Context) (bool, error) //perm:admin - DealsSetConsiderOnlineRetrievalDeals(context.Context, bool) error //perm:admin - DealsPieceCidBlocklist(context.Context) ([]cid.Cid, error) //perm:admin - DealsSetPieceCidBlocklist(context.Context, []cid.Cid) error //perm:admin - DealsConsiderOfflineStorageDeals(context.Context) (bool, error) //perm:admin - DealsSetConsiderOfflineStorageDeals(context.Context, bool) error //perm:admin - DealsConsiderOfflineRetrievalDeals(context.Context) (bool, error) //perm:admin - DealsSetConsiderOfflineRetrievalDeals(context.Context, bool) error //perm:admin - DealsConsiderVerifiedStorageDeals(context.Context) (bool, error) //perm:admin - DealsSetConsiderVerifiedStorageDeals(context.Context, bool) error //perm:admin - DealsConsiderUnverifiedStorageDeals(context.Context) (bool, error) //perm:admin - DealsSetConsiderUnverifiedStorageDeals(context.Context, bool) error //perm:admin - - PiecesListPieces(ctx context.Context) ([]cid.Cid, error) //perm:read - PiecesListCidInfos(ctx context.Context) ([]cid.Cid, error) //perm:read - PiecesGetPieceInfo(ctx context.Context, pieceCid cid.Cid) (*piecestore.PieceInfo, error) //perm:read - PiecesGetCIDInfo(ctx context.Context, payloadCid cid.Cid) (*piecestore.CIDInfo, error) //perm:read + DealsList(ctx context.Context) ([]*MarketDeal, error) //perm:admin // CreateBackup creates node backup onder the specified file name. The // method requires that the lotus-miner is running with the @@ -471,37 +370,6 @@ type SectorOffset struct { Offset abi.PaddedPieceSize } -// DagstoreShardInfo is the serialized form of dagstore.DagstoreShardInfo that -// we expose through JSON-RPC to avoid clients having to depend on the -// dagstore lib. -type DagstoreShardInfo struct { - Key string - State string - Error string -} - -// DagstoreShardResult enumerates results per shard. -type DagstoreShardResult struct { - Key string - Success bool - Error string -} - -type DagstoreInitializeAllParams struct { - MaxConcurrency int - IncludeSealed bool -} - -// DagstoreInitializeAllEvent represents an initialization event. -type DagstoreInitializeAllEvent struct { - Key string - Event string // "start", "end" - Success bool - Error string - Total int - Current int -} - type NumAssignerMeta struct { Reserved bitfield.BitField Allocated bitfield.BitField diff --git a/api/docgen/docgen.go b/api/docgen/docgen.go index 2d34a0903cc..a1b722c0a6f 100644 --- a/api/docgen/docgen.go +++ b/api/docgen/docgen.go @@ -16,7 +16,6 @@ import ( "github.com/google/uuid" blocks "github.com/ipfs/go-block-format" "github.com/ipfs/go-cid" - "github.com/ipfs/go-graphsync" textselector "github.com/ipld/go-ipld-selector-text-lite" pubsub "github.com/libp2p/go-libp2p-pubsub" "github.com/libp2p/go-libp2p/core/metrics" @@ -27,9 +26,6 @@ import ( "github.com/filecoin-project/go-address" "github.com/filecoin-project/go-bitfield" - datatransfer "github.com/filecoin-project/go-data-transfer/v2" - "github.com/filecoin-project/go-fil-markets/filestore" - "github.com/filecoin-project/go-fil-markets/retrievalmarket" "github.com/filecoin-project/go-jsonrpc/auth" "github.com/filecoin-project/go-state-types/abi" "github.com/filecoin-project/go-state-types/builtin/v9/verifreg" @@ -44,7 +40,6 @@ import ( "github.com/filecoin-project/lotus/chain/types" "github.com/filecoin-project/lotus/chain/types/ethtypes" "github.com/filecoin-project/lotus/node/modules/dtypes" - "github.com/filecoin-project/lotus/node/repo/imports" sealing "github.com/filecoin-project/lotus/storage/pipeline" "github.com/filecoin-project/lotus/storage/sealer/sealtasks" "github.com/filecoin-project/lotus/storage/sealer/storiface" @@ -96,10 +91,8 @@ func init() { addExample(pid) addExample(&pid) - storeIDExample := imports.ID(50) textSelExample := textselector.Expression("Links/21/Hash/Links/42/Hash") apiSelExample := api.Selector("Links/21/Hash/Links/42/Hash") - clientEvent := retrievalmarket.ClientEventDealAccepted block := blocks.Block(&blocks.BasicBlock{}) ExampleValues[reflect.TypeOf(&block).Elem()] = block @@ -130,15 +123,7 @@ func init() { addExample(api.FullAPIVersion1) addExample(api.PCHInbound) addExample(time.Minute) - addExample(graphsync.NewRequestID()) - addExample(datatransfer.TransferID(3)) - addExample(datatransfer.Ongoing) - addExample(storeIDExample) - addExample(&storeIDExample) - addExample(clientEvent) - addExample(&clientEvent) - addExample(retrievalmarket.ClientEventDealAccepted) - addExample(retrievalmarket.DealStatusNew) + addExample(&textSelExample) addExample(&apiSelExample) addExample(network.ReachabilityPublic) @@ -206,10 +191,9 @@ func init() { ExampleValues[reflect.TypeOf(struct{ A multiaddr.Multiaddr }{}).Field(0).Type] = maddr // miner specific - addExample(filestore.Path(".lotusminer/fstmp123")) + si := uint64(12) addExample(&si) - addExample(retrievalmarket.DealID(5)) addExample(map[string]cid.Cid{}) addExample(map[string][]api.SealedRef{ "98000": { @@ -313,17 +297,8 @@ func init() { api.SubsystemMining, api.SubsystemSealing, api.SubsystemSectorStorage, - api.SubsystemMarkets, - }) - addExample(api.DagstoreShardResult{ - Key: "baga6ea4seaqecmtz7iak33dsfshi627abz4i4665dfuzr3qfs4bmad6dx3iigdq", - Error: "", - }) - addExample(api.DagstoreShardInfo{ - Key: "baga6ea4seaqecmtz7iak33dsfshi627abz4i4665dfuzr3qfs4bmad6dx3iigdq", - State: "ShardStateAvailable", - Error: "", }) + addExample(storiface.ResourceTable) addExample(network.ScopeStat{ Memory: 123, diff --git a/api/miner_subsystems.go b/api/miner_subsystems.go index a77de7e3c95..2f17ad02f4b 100644 --- a/api/miner_subsystems.go +++ b/api/miner_subsystems.go @@ -13,9 +13,6 @@ const ( // SubsystemUnknown is a placeholder for the zero value. It should never // be used. SubsystemUnknown MinerSubsystem = iota - // SubsystemMarkets signifies the storage and retrieval - // deal-making subsystem. - SubsystemMarkets // SubsystemMining signifies the mining subsystem. SubsystemMining // SubsystemSealing signifies the sealing subsystem. @@ -26,7 +23,6 @@ const ( var MinerSubsystemToString = map[MinerSubsystem]string{ SubsystemUnknown: "Unknown", - SubsystemMarkets: "Markets", SubsystemMining: "Mining", SubsystemSealing: "Sealing", SubsystemSectorStorage: "SectorStorage", @@ -34,7 +30,6 @@ var MinerSubsystemToString = map[MinerSubsystem]string{ var MinerSubsystemToID = map[string]MinerSubsystem{ "Unknown": SubsystemUnknown, - "Markets": SubsystemMarkets, "Mining": SubsystemMining, "Sealing": SubsystemSealing, "SectorStorage": SubsystemSectorStorage, diff --git a/api/mocks/mock_full.go b/api/mocks/mock_full.go index 9960faeffe5..4bbd798a87a 100644 --- a/api/mocks/mock_full.go +++ b/api/mocks/mock_full.go @@ -21,8 +21,6 @@ import ( address "github.com/filecoin-project/go-address" bitfield "github.com/filecoin-project/go-bitfield" - datatransfer "github.com/filecoin-project/go-data-transfer/v2" - retrievalmarket "github.com/filecoin-project/go-fil-markets/retrievalmarket" jsonrpc "github.com/filecoin-project/go-jsonrpc" auth "github.com/filecoin-project/go-jsonrpc/auth" abi "github.com/filecoin-project/go-state-types/abi" @@ -42,7 +40,6 @@ import ( ethtypes "github.com/filecoin-project/lotus/chain/types/ethtypes" alerting "github.com/filecoin-project/lotus/journal/alerting" dtypes "github.com/filecoin-project/lotus/node/modules/dtypes" - imports "github.com/filecoin-project/lotus/node/repo/imports" ) // MockFullNode is a mock of FullNode interface. @@ -511,418 +508,6 @@ func (mr *MockFullNodeMockRecorder) ChainTipSetWeight(arg0, arg1 interface{}) *g return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ChainTipSetWeight", reflect.TypeOf((*MockFullNode)(nil).ChainTipSetWeight), arg0, arg1) } -// ClientCalcCommP mocks base method. -func (m *MockFullNode) ClientCalcCommP(arg0 context.Context, arg1 string) (*api.CommPRet, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ClientCalcCommP", arg0, arg1) - ret0, _ := ret[0].(*api.CommPRet) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// ClientCalcCommP indicates an expected call of ClientCalcCommP. -func (mr *MockFullNodeMockRecorder) ClientCalcCommP(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientCalcCommP", reflect.TypeOf((*MockFullNode)(nil).ClientCalcCommP), arg0, arg1) -} - -// ClientCancelDataTransfer mocks base method. -func (m *MockFullNode) ClientCancelDataTransfer(arg0 context.Context, arg1 datatransfer.TransferID, arg2 peer.ID, arg3 bool) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ClientCancelDataTransfer", arg0, arg1, arg2, arg3) - ret0, _ := ret[0].(error) - return ret0 -} - -// ClientCancelDataTransfer indicates an expected call of ClientCancelDataTransfer. -func (mr *MockFullNodeMockRecorder) ClientCancelDataTransfer(arg0, arg1, arg2, arg3 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientCancelDataTransfer", reflect.TypeOf((*MockFullNode)(nil).ClientCancelDataTransfer), arg0, arg1, arg2, arg3) -} - -// ClientCancelRetrievalDeal mocks base method. -func (m *MockFullNode) ClientCancelRetrievalDeal(arg0 context.Context, arg1 retrievalmarket.DealID) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ClientCancelRetrievalDeal", arg0, arg1) - ret0, _ := ret[0].(error) - return ret0 -} - -// ClientCancelRetrievalDeal indicates an expected call of ClientCancelRetrievalDeal. -func (mr *MockFullNodeMockRecorder) ClientCancelRetrievalDeal(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientCancelRetrievalDeal", reflect.TypeOf((*MockFullNode)(nil).ClientCancelRetrievalDeal), arg0, arg1) -} - -// ClientDataTransferUpdates mocks base method. -func (m *MockFullNode) ClientDataTransferUpdates(arg0 context.Context) (<-chan api.DataTransferChannel, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ClientDataTransferUpdates", arg0) - ret0, _ := ret[0].(<-chan api.DataTransferChannel) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// ClientDataTransferUpdates indicates an expected call of ClientDataTransferUpdates. -func (mr *MockFullNodeMockRecorder) ClientDataTransferUpdates(arg0 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientDataTransferUpdates", reflect.TypeOf((*MockFullNode)(nil).ClientDataTransferUpdates), arg0) -} - -// ClientDealPieceCID mocks base method. -func (m *MockFullNode) ClientDealPieceCID(arg0 context.Context, arg1 cid.Cid) (api.DataCIDSize, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ClientDealPieceCID", arg0, arg1) - ret0, _ := ret[0].(api.DataCIDSize) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// ClientDealPieceCID indicates an expected call of ClientDealPieceCID. -func (mr *MockFullNodeMockRecorder) ClientDealPieceCID(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientDealPieceCID", reflect.TypeOf((*MockFullNode)(nil).ClientDealPieceCID), arg0, arg1) -} - -// ClientDealSize mocks base method. -func (m *MockFullNode) ClientDealSize(arg0 context.Context, arg1 cid.Cid) (api.DataSize, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ClientDealSize", arg0, arg1) - ret0, _ := ret[0].(api.DataSize) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// ClientDealSize indicates an expected call of ClientDealSize. -func (mr *MockFullNodeMockRecorder) ClientDealSize(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientDealSize", reflect.TypeOf((*MockFullNode)(nil).ClientDealSize), arg0, arg1) -} - -// ClientExport mocks base method. -func (m *MockFullNode) ClientExport(arg0 context.Context, arg1 api.ExportRef, arg2 api.FileRef) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ClientExport", arg0, arg1, arg2) - ret0, _ := ret[0].(error) - return ret0 -} - -// ClientExport indicates an expected call of ClientExport. -func (mr *MockFullNodeMockRecorder) ClientExport(arg0, arg1, arg2 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientExport", reflect.TypeOf((*MockFullNode)(nil).ClientExport), arg0, arg1, arg2) -} - -// ClientFindData mocks base method. -func (m *MockFullNode) ClientFindData(arg0 context.Context, arg1 cid.Cid, arg2 *cid.Cid) ([]api.QueryOffer, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ClientFindData", arg0, arg1, arg2) - ret0, _ := ret[0].([]api.QueryOffer) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// ClientFindData indicates an expected call of ClientFindData. -func (mr *MockFullNodeMockRecorder) ClientFindData(arg0, arg1, arg2 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientFindData", reflect.TypeOf((*MockFullNode)(nil).ClientFindData), arg0, arg1, arg2) -} - -// ClientGenCar mocks base method. -func (m *MockFullNode) ClientGenCar(arg0 context.Context, arg1 api.FileRef, arg2 string) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ClientGenCar", arg0, arg1, arg2) - ret0, _ := ret[0].(error) - return ret0 -} - -// ClientGenCar indicates an expected call of ClientGenCar. -func (mr *MockFullNodeMockRecorder) ClientGenCar(arg0, arg1, arg2 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientGenCar", reflect.TypeOf((*MockFullNode)(nil).ClientGenCar), arg0, arg1, arg2) -} - -// ClientGetDealInfo mocks base method. -func (m *MockFullNode) ClientGetDealInfo(arg0 context.Context, arg1 cid.Cid) (*api.DealInfo, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ClientGetDealInfo", arg0, arg1) - ret0, _ := ret[0].(*api.DealInfo) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// ClientGetDealInfo indicates an expected call of ClientGetDealInfo. -func (mr *MockFullNodeMockRecorder) ClientGetDealInfo(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientGetDealInfo", reflect.TypeOf((*MockFullNode)(nil).ClientGetDealInfo), arg0, arg1) -} - -// ClientGetDealStatus mocks base method. -func (m *MockFullNode) ClientGetDealStatus(arg0 context.Context, arg1 uint64) (string, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ClientGetDealStatus", arg0, arg1) - ret0, _ := ret[0].(string) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// ClientGetDealStatus indicates an expected call of ClientGetDealStatus. -func (mr *MockFullNodeMockRecorder) ClientGetDealStatus(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientGetDealStatus", reflect.TypeOf((*MockFullNode)(nil).ClientGetDealStatus), arg0, arg1) -} - -// ClientGetDealUpdates mocks base method. -func (m *MockFullNode) ClientGetDealUpdates(arg0 context.Context) (<-chan api.DealInfo, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ClientGetDealUpdates", arg0) - ret0, _ := ret[0].(<-chan api.DealInfo) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// ClientGetDealUpdates indicates an expected call of ClientGetDealUpdates. -func (mr *MockFullNodeMockRecorder) ClientGetDealUpdates(arg0 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientGetDealUpdates", reflect.TypeOf((*MockFullNode)(nil).ClientGetDealUpdates), arg0) -} - -// ClientGetRetrievalUpdates mocks base method. -func (m *MockFullNode) ClientGetRetrievalUpdates(arg0 context.Context) (<-chan api.RetrievalInfo, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ClientGetRetrievalUpdates", arg0) - ret0, _ := ret[0].(<-chan api.RetrievalInfo) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// ClientGetRetrievalUpdates indicates an expected call of ClientGetRetrievalUpdates. -func (mr *MockFullNodeMockRecorder) ClientGetRetrievalUpdates(arg0 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientGetRetrievalUpdates", reflect.TypeOf((*MockFullNode)(nil).ClientGetRetrievalUpdates), arg0) -} - -// ClientHasLocal mocks base method. -func (m *MockFullNode) ClientHasLocal(arg0 context.Context, arg1 cid.Cid) (bool, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ClientHasLocal", arg0, arg1) - ret0, _ := ret[0].(bool) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// ClientHasLocal indicates an expected call of ClientHasLocal. -func (mr *MockFullNodeMockRecorder) ClientHasLocal(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientHasLocal", reflect.TypeOf((*MockFullNode)(nil).ClientHasLocal), arg0, arg1) -} - -// ClientImport mocks base method. -func (m *MockFullNode) ClientImport(arg0 context.Context, arg1 api.FileRef) (*api.ImportRes, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ClientImport", arg0, arg1) - ret0, _ := ret[0].(*api.ImportRes) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// ClientImport indicates an expected call of ClientImport. -func (mr *MockFullNodeMockRecorder) ClientImport(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientImport", reflect.TypeOf((*MockFullNode)(nil).ClientImport), arg0, arg1) -} - -// ClientListDataTransfers mocks base method. -func (m *MockFullNode) ClientListDataTransfers(arg0 context.Context) ([]api.DataTransferChannel, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ClientListDataTransfers", arg0) - ret0, _ := ret[0].([]api.DataTransferChannel) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// ClientListDataTransfers indicates an expected call of ClientListDataTransfers. -func (mr *MockFullNodeMockRecorder) ClientListDataTransfers(arg0 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientListDataTransfers", reflect.TypeOf((*MockFullNode)(nil).ClientListDataTransfers), arg0) -} - -// ClientListDeals mocks base method. -func (m *MockFullNode) ClientListDeals(arg0 context.Context) ([]api.DealInfo, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ClientListDeals", arg0) - ret0, _ := ret[0].([]api.DealInfo) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// ClientListDeals indicates an expected call of ClientListDeals. -func (mr *MockFullNodeMockRecorder) ClientListDeals(arg0 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientListDeals", reflect.TypeOf((*MockFullNode)(nil).ClientListDeals), arg0) -} - -// ClientListImports mocks base method. -func (m *MockFullNode) ClientListImports(arg0 context.Context) ([]api.Import, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ClientListImports", arg0) - ret0, _ := ret[0].([]api.Import) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// ClientListImports indicates an expected call of ClientListImports. -func (mr *MockFullNodeMockRecorder) ClientListImports(arg0 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientListImports", reflect.TypeOf((*MockFullNode)(nil).ClientListImports), arg0) -} - -// ClientListRetrievals mocks base method. -func (m *MockFullNode) ClientListRetrievals(arg0 context.Context) ([]api.RetrievalInfo, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ClientListRetrievals", arg0) - ret0, _ := ret[0].([]api.RetrievalInfo) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// ClientListRetrievals indicates an expected call of ClientListRetrievals. -func (mr *MockFullNodeMockRecorder) ClientListRetrievals(arg0 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientListRetrievals", reflect.TypeOf((*MockFullNode)(nil).ClientListRetrievals), arg0) -} - -// ClientMinerQueryOffer mocks base method. -func (m *MockFullNode) ClientMinerQueryOffer(arg0 context.Context, arg1 address.Address, arg2 cid.Cid, arg3 *cid.Cid) (api.QueryOffer, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ClientMinerQueryOffer", arg0, arg1, arg2, arg3) - ret0, _ := ret[0].(api.QueryOffer) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// ClientMinerQueryOffer indicates an expected call of ClientMinerQueryOffer. -func (mr *MockFullNodeMockRecorder) ClientMinerQueryOffer(arg0, arg1, arg2, arg3 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientMinerQueryOffer", reflect.TypeOf((*MockFullNode)(nil).ClientMinerQueryOffer), arg0, arg1, arg2, arg3) -} - -// ClientQueryAsk mocks base method. -func (m *MockFullNode) ClientQueryAsk(arg0 context.Context, arg1 peer.ID, arg2 address.Address) (*api.StorageAsk, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ClientQueryAsk", arg0, arg1, arg2) - ret0, _ := ret[0].(*api.StorageAsk) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// ClientQueryAsk indicates an expected call of ClientQueryAsk. -func (mr *MockFullNodeMockRecorder) ClientQueryAsk(arg0, arg1, arg2 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientQueryAsk", reflect.TypeOf((*MockFullNode)(nil).ClientQueryAsk), arg0, arg1, arg2) -} - -// ClientRemoveImport mocks base method. -func (m *MockFullNode) ClientRemoveImport(arg0 context.Context, arg1 imports.ID) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ClientRemoveImport", arg0, arg1) - ret0, _ := ret[0].(error) - return ret0 -} - -// ClientRemoveImport indicates an expected call of ClientRemoveImport. -func (mr *MockFullNodeMockRecorder) ClientRemoveImport(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientRemoveImport", reflect.TypeOf((*MockFullNode)(nil).ClientRemoveImport), arg0, arg1) -} - -// ClientRestartDataTransfer mocks base method. -func (m *MockFullNode) ClientRestartDataTransfer(arg0 context.Context, arg1 datatransfer.TransferID, arg2 peer.ID, arg3 bool) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ClientRestartDataTransfer", arg0, arg1, arg2, arg3) - ret0, _ := ret[0].(error) - return ret0 -} - -// ClientRestartDataTransfer indicates an expected call of ClientRestartDataTransfer. -func (mr *MockFullNodeMockRecorder) ClientRestartDataTransfer(arg0, arg1, arg2, arg3 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientRestartDataTransfer", reflect.TypeOf((*MockFullNode)(nil).ClientRestartDataTransfer), arg0, arg1, arg2, arg3) -} - -// ClientRetrieve mocks base method. -func (m *MockFullNode) ClientRetrieve(arg0 context.Context, arg1 api.RetrievalOrder) (*api.RestrievalRes, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ClientRetrieve", arg0, arg1) - ret0, _ := ret[0].(*api.RestrievalRes) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// ClientRetrieve indicates an expected call of ClientRetrieve. -func (mr *MockFullNodeMockRecorder) ClientRetrieve(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientRetrieve", reflect.TypeOf((*MockFullNode)(nil).ClientRetrieve), arg0, arg1) -} - -// ClientRetrieveTryRestartInsufficientFunds mocks base method. -func (m *MockFullNode) ClientRetrieveTryRestartInsufficientFunds(arg0 context.Context, arg1 address.Address) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ClientRetrieveTryRestartInsufficientFunds", arg0, arg1) - ret0, _ := ret[0].(error) - return ret0 -} - -// ClientRetrieveTryRestartInsufficientFunds indicates an expected call of ClientRetrieveTryRestartInsufficientFunds. -func (mr *MockFullNodeMockRecorder) ClientRetrieveTryRestartInsufficientFunds(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientRetrieveTryRestartInsufficientFunds", reflect.TypeOf((*MockFullNode)(nil).ClientRetrieveTryRestartInsufficientFunds), arg0, arg1) -} - -// ClientRetrieveWait mocks base method. -func (m *MockFullNode) ClientRetrieveWait(arg0 context.Context, arg1 retrievalmarket.DealID) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ClientRetrieveWait", arg0, arg1) - ret0, _ := ret[0].(error) - return ret0 -} - -// ClientRetrieveWait indicates an expected call of ClientRetrieveWait. -func (mr *MockFullNodeMockRecorder) ClientRetrieveWait(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientRetrieveWait", reflect.TypeOf((*MockFullNode)(nil).ClientRetrieveWait), arg0, arg1) -} - -// ClientStartDeal mocks base method. -func (m *MockFullNode) ClientStartDeal(arg0 context.Context, arg1 *api.StartDealParams) (*cid.Cid, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ClientStartDeal", arg0, arg1) - ret0, _ := ret[0].(*cid.Cid) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// ClientStartDeal indicates an expected call of ClientStartDeal. -func (mr *MockFullNodeMockRecorder) ClientStartDeal(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientStartDeal", reflect.TypeOf((*MockFullNode)(nil).ClientStartDeal), arg0, arg1) -} - -// ClientStatelessDeal mocks base method. -func (m *MockFullNode) ClientStatelessDeal(arg0 context.Context, arg1 *api.StartDealParams) (*cid.Cid, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ClientStatelessDeal", arg0, arg1) - ret0, _ := ret[0].(*cid.Cid) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// ClientStatelessDeal indicates an expected call of ClientStatelessDeal. -func (mr *MockFullNodeMockRecorder) ClientStatelessDeal(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientStatelessDeal", reflect.TypeOf((*MockFullNode)(nil).ClientStatelessDeal), arg0, arg1) -} - // Closing mocks base method. func (m *MockFullNode) Closing(arg0 context.Context) (<-chan struct{}, error) { m.ctrl.T.Helper() diff --git a/api/proxy_gen.go b/api/proxy_gen.go index cde8230c4a7..6e972fe77b1 100644 --- a/api/proxy_gen.go +++ b/api/proxy_gen.go @@ -20,10 +20,6 @@ import ( "github.com/filecoin-project/go-address" "github.com/filecoin-project/go-bitfield" - datatransfer "github.com/filecoin-project/go-data-transfer/v2" - "github.com/filecoin-project/go-fil-markets/piecestore" - "github.com/filecoin-project/go-fil-markets/retrievalmarket" - "github.com/filecoin-project/go-fil-markets/storagemarket" "github.com/filecoin-project/go-jsonrpc" "github.com/filecoin-project/go-jsonrpc/auth" "github.com/filecoin-project/go-state-types/abi" @@ -42,7 +38,6 @@ import ( "github.com/filecoin-project/lotus/chain/types/ethtypes" "github.com/filecoin-project/lotus/journal/alerting" "github.com/filecoin-project/lotus/node/modules/dtypes" - "github.com/filecoin-project/lotus/node/repo/imports" "github.com/filecoin-project/lotus/storage/pipeline/piece" "github.com/filecoin-project/lotus/storage/pipeline/sealiface" "github.com/filecoin-project/lotus/storage/sealer/fsutil" @@ -226,62 +221,6 @@ type FullNodeMethods struct { ChainTipSetWeight func(p0 context.Context, p1 types.TipSetKey) (types.BigInt, error) `perm:"read"` - ClientCalcCommP func(p0 context.Context, p1 string) (*CommPRet, error) `perm:"write"` - - ClientCancelDataTransfer func(p0 context.Context, p1 datatransfer.TransferID, p2 peer.ID, p3 bool) error `perm:"write"` - - ClientCancelRetrievalDeal func(p0 context.Context, p1 retrievalmarket.DealID) error `perm:"write"` - - ClientDataTransferUpdates func(p0 context.Context) (<-chan DataTransferChannel, error) `perm:"write"` - - ClientDealPieceCID func(p0 context.Context, p1 cid.Cid) (DataCIDSize, error) `perm:"read"` - - ClientDealSize func(p0 context.Context, p1 cid.Cid) (DataSize, error) `perm:"read"` - - ClientExport func(p0 context.Context, p1 ExportRef, p2 FileRef) error `perm:"admin"` - - ClientFindData func(p0 context.Context, p1 cid.Cid, p2 *cid.Cid) ([]QueryOffer, error) `perm:"read"` - - ClientGenCar func(p0 context.Context, p1 FileRef, p2 string) error `perm:"write"` - - ClientGetDealInfo func(p0 context.Context, p1 cid.Cid) (*DealInfo, error) `perm:"read"` - - ClientGetDealStatus func(p0 context.Context, p1 uint64) (string, error) `perm:"read"` - - ClientGetDealUpdates func(p0 context.Context) (<-chan DealInfo, error) `perm:"write"` - - ClientGetRetrievalUpdates func(p0 context.Context) (<-chan RetrievalInfo, error) `perm:"write"` - - ClientHasLocal func(p0 context.Context, p1 cid.Cid) (bool, error) `perm:"write"` - - ClientImport func(p0 context.Context, p1 FileRef) (*ImportRes, error) `perm:"admin"` - - ClientListDataTransfers func(p0 context.Context) ([]DataTransferChannel, error) `perm:"write"` - - ClientListDeals func(p0 context.Context) ([]DealInfo, error) `perm:"write"` - - ClientListImports func(p0 context.Context) ([]Import, error) `perm:"write"` - - ClientListRetrievals func(p0 context.Context) ([]RetrievalInfo, error) `perm:"write"` - - ClientMinerQueryOffer func(p0 context.Context, p1 address.Address, p2 cid.Cid, p3 *cid.Cid) (QueryOffer, error) `perm:"read"` - - ClientQueryAsk func(p0 context.Context, p1 peer.ID, p2 address.Address) (*StorageAsk, error) `perm:"read"` - - ClientRemoveImport func(p0 context.Context, p1 imports.ID) error `perm:"admin"` - - ClientRestartDataTransfer func(p0 context.Context, p1 datatransfer.TransferID, p2 peer.ID, p3 bool) error `perm:"write"` - - ClientRetrieve func(p0 context.Context, p1 RetrievalOrder) (*RestrievalRes, error) `perm:"admin"` - - ClientRetrieveTryRestartInsufficientFunds func(p0 context.Context, p1 address.Address) error `perm:"write"` - - ClientRetrieveWait func(p0 context.Context, p1 retrievalmarket.DealID) error `perm:"admin"` - - ClientStartDeal func(p0 context.Context, p1 *StartDealParams) (*cid.Cid, error) `perm:"admin"` - - ClientStatelessDeal func(p0 context.Context, p1 *StartDealParams) (*cid.Cid, error) `perm:"write"` - CreateBackup func(p0 context.Context, p1 string) error `perm:"admin"` EthAccounts func(p0 context.Context) ([]ethtypes.EthAddress, error) `perm:"read"` @@ -985,100 +924,12 @@ type StorageMinerMethods struct { CreateBackup func(p0 context.Context, p1 string) error `perm:"admin"` - DagstoreGC func(p0 context.Context) ([]DagstoreShardResult, error) `perm:"admin"` - - DagstoreInitializeAll func(p0 context.Context, p1 DagstoreInitializeAllParams) (<-chan DagstoreInitializeAllEvent, error) `perm:"write"` - - DagstoreInitializeShard func(p0 context.Context, p1 string) error `perm:"write"` - - DagstoreListShards func(p0 context.Context) ([]DagstoreShardInfo, error) `perm:"read"` - - DagstoreLookupPieces func(p0 context.Context, p1 cid.Cid) ([]DagstoreShardInfo, error) `perm:"admin"` - - DagstoreRecoverShard func(p0 context.Context, p1 string) error `perm:"write"` - - DagstoreRegisterShard func(p0 context.Context, p1 string) error `perm:"admin"` - - DealsConsiderOfflineRetrievalDeals func(p0 context.Context) (bool, error) `perm:"admin"` - - DealsConsiderOfflineStorageDeals func(p0 context.Context) (bool, error) `perm:"admin"` - - DealsConsiderOnlineRetrievalDeals func(p0 context.Context) (bool, error) `perm:"admin"` - - DealsConsiderOnlineStorageDeals func(p0 context.Context) (bool, error) `perm:"admin"` - - DealsConsiderUnverifiedStorageDeals func(p0 context.Context) (bool, error) `perm:"admin"` - - DealsConsiderVerifiedStorageDeals func(p0 context.Context) (bool, error) `perm:"admin"` - - DealsImportData func(p0 context.Context, p1 cid.Cid, p2 string) error `perm:"admin"` - DealsList func(p0 context.Context) ([]*MarketDeal, error) `perm:"admin"` - DealsPieceCidBlocklist func(p0 context.Context) ([]cid.Cid, error) `perm:"admin"` - - DealsSetConsiderOfflineRetrievalDeals func(p0 context.Context, p1 bool) error `perm:"admin"` - - DealsSetConsiderOfflineStorageDeals func(p0 context.Context, p1 bool) error `perm:"admin"` - - DealsSetConsiderOnlineRetrievalDeals func(p0 context.Context, p1 bool) error `perm:"admin"` - - DealsSetConsiderOnlineStorageDeals func(p0 context.Context, p1 bool) error `perm:"admin"` - - DealsSetConsiderUnverifiedStorageDeals func(p0 context.Context, p1 bool) error `perm:"admin"` - - DealsSetConsiderVerifiedStorageDeals func(p0 context.Context, p1 bool) error `perm:"admin"` - - DealsSetPieceCidBlocklist func(p0 context.Context, p1 []cid.Cid) error `perm:"admin"` - - IndexerAnnounceAllDeals func(p0 context.Context) error `perm:"admin"` - - IndexerAnnounceDeal func(p0 context.Context, p1 cid.Cid) error `perm:"admin"` - - MarketCancelDataTransfer func(p0 context.Context, p1 datatransfer.TransferID, p2 peer.ID, p3 bool) error `perm:"write"` - - MarketDataTransferDiagnostics func(p0 context.Context, p1 peer.ID) (*TransferDiagnostics, error) `perm:"write"` - - MarketDataTransferUpdates func(p0 context.Context) (<-chan DataTransferChannel, error) `perm:"write"` - - MarketGetAsk func(p0 context.Context) (*storagemarket.SignedStorageAsk, error) `perm:"read"` - - MarketGetDealUpdates func(p0 context.Context) (<-chan storagemarket.MinerDeal, error) `perm:"read"` - - MarketGetRetrievalAsk func(p0 context.Context) (*retrievalmarket.Ask, error) `perm:"read"` - - MarketImportDealData func(p0 context.Context, p1 cid.Cid, p2 string) error `perm:"write"` - - MarketListDataTransfers func(p0 context.Context) ([]DataTransferChannel, error) `perm:"write"` - MarketListDeals func(p0 context.Context) ([]*MarketDeal, error) `perm:"read"` - MarketListIncompleteDeals func(p0 context.Context) ([]storagemarket.MinerDeal, error) `perm:"read"` - - MarketListRetrievalDeals func(p0 context.Context) ([]struct{}, error) `perm:"read"` - - MarketPendingDeals func(p0 context.Context) (PendingDealInfo, error) `perm:"write"` - - MarketPublishPendingDeals func(p0 context.Context) error `perm:"admin"` - - MarketRestartDataTransfer func(p0 context.Context, p1 datatransfer.TransferID, p2 peer.ID, p3 bool) error `perm:"write"` - - MarketRetryPublishDeal func(p0 context.Context, p1 cid.Cid) error `perm:"admin"` - - MarketSetAsk func(p0 context.Context, p1 types.BigInt, p2 types.BigInt, p3 abi.ChainEpoch, p4 abi.PaddedPieceSize, p5 abi.PaddedPieceSize) error `perm:"admin"` - - MarketSetRetrievalAsk func(p0 context.Context, p1 *retrievalmarket.Ask) error `perm:"admin"` - MiningBase func(p0 context.Context) (*types.TipSet, error) `perm:"read"` - PiecesGetCIDInfo func(p0 context.Context, p1 cid.Cid) (*piecestore.CIDInfo, error) `perm:"read"` - - PiecesGetPieceInfo func(p0 context.Context, p1 cid.Cid) (*piecestore.PieceInfo, error) `perm:"read"` - - PiecesListCidInfos func(p0 context.Context) ([]cid.Cid, error) `perm:"read"` - - PiecesListPieces func(p0 context.Context) ([]cid.Cid, error) `perm:"read"` - PledgeSector func(p0 context.Context) (abi.SectorID, error) `perm:"write"` RecoverFault func(p0 context.Context, p1 []abi.SectorNumber) ([]cid.Cid, error) `perm:"admin"` @@ -1960,314 +1811,6 @@ func (s *FullNodeStub) ChainTipSetWeight(p0 context.Context, p1 types.TipSetKey) return *new(types.BigInt), ErrNotSupported } -func (s *FullNodeStruct) ClientCalcCommP(p0 context.Context, p1 string) (*CommPRet, error) { - if s.Internal.ClientCalcCommP == nil { - return nil, ErrNotSupported - } - return s.Internal.ClientCalcCommP(p0, p1) -} - -func (s *FullNodeStub) ClientCalcCommP(p0 context.Context, p1 string) (*CommPRet, error) { - return nil, ErrNotSupported -} - -func (s *FullNodeStruct) ClientCancelDataTransfer(p0 context.Context, p1 datatransfer.TransferID, p2 peer.ID, p3 bool) error { - if s.Internal.ClientCancelDataTransfer == nil { - return ErrNotSupported - } - return s.Internal.ClientCancelDataTransfer(p0, p1, p2, p3) -} - -func (s *FullNodeStub) ClientCancelDataTransfer(p0 context.Context, p1 datatransfer.TransferID, p2 peer.ID, p3 bool) error { - return ErrNotSupported -} - -func (s *FullNodeStruct) ClientCancelRetrievalDeal(p0 context.Context, p1 retrievalmarket.DealID) error { - if s.Internal.ClientCancelRetrievalDeal == nil { - return ErrNotSupported - } - return s.Internal.ClientCancelRetrievalDeal(p0, p1) -} - -func (s *FullNodeStub) ClientCancelRetrievalDeal(p0 context.Context, p1 retrievalmarket.DealID) error { - return ErrNotSupported -} - -func (s *FullNodeStruct) ClientDataTransferUpdates(p0 context.Context) (<-chan DataTransferChannel, error) { - if s.Internal.ClientDataTransferUpdates == nil { - return nil, ErrNotSupported - } - return s.Internal.ClientDataTransferUpdates(p0) -} - -func (s *FullNodeStub) ClientDataTransferUpdates(p0 context.Context) (<-chan DataTransferChannel, error) { - return nil, ErrNotSupported -} - -func (s *FullNodeStruct) ClientDealPieceCID(p0 context.Context, p1 cid.Cid) (DataCIDSize, error) { - if s.Internal.ClientDealPieceCID == nil { - return *new(DataCIDSize), ErrNotSupported - } - return s.Internal.ClientDealPieceCID(p0, p1) -} - -func (s *FullNodeStub) ClientDealPieceCID(p0 context.Context, p1 cid.Cid) (DataCIDSize, error) { - return *new(DataCIDSize), ErrNotSupported -} - -func (s *FullNodeStruct) ClientDealSize(p0 context.Context, p1 cid.Cid) (DataSize, error) { - if s.Internal.ClientDealSize == nil { - return *new(DataSize), ErrNotSupported - } - return s.Internal.ClientDealSize(p0, p1) -} - -func (s *FullNodeStub) ClientDealSize(p0 context.Context, p1 cid.Cid) (DataSize, error) { - return *new(DataSize), ErrNotSupported -} - -func (s *FullNodeStruct) ClientExport(p0 context.Context, p1 ExportRef, p2 FileRef) error { - if s.Internal.ClientExport == nil { - return ErrNotSupported - } - return s.Internal.ClientExport(p0, p1, p2) -} - -func (s *FullNodeStub) ClientExport(p0 context.Context, p1 ExportRef, p2 FileRef) error { - return ErrNotSupported -} - -func (s *FullNodeStruct) ClientFindData(p0 context.Context, p1 cid.Cid, p2 *cid.Cid) ([]QueryOffer, error) { - if s.Internal.ClientFindData == nil { - return *new([]QueryOffer), ErrNotSupported - } - return s.Internal.ClientFindData(p0, p1, p2) -} - -func (s *FullNodeStub) ClientFindData(p0 context.Context, p1 cid.Cid, p2 *cid.Cid) ([]QueryOffer, error) { - return *new([]QueryOffer), ErrNotSupported -} - -func (s *FullNodeStruct) ClientGenCar(p0 context.Context, p1 FileRef, p2 string) error { - if s.Internal.ClientGenCar == nil { - return ErrNotSupported - } - return s.Internal.ClientGenCar(p0, p1, p2) -} - -func (s *FullNodeStub) ClientGenCar(p0 context.Context, p1 FileRef, p2 string) error { - return ErrNotSupported -} - -func (s *FullNodeStruct) ClientGetDealInfo(p0 context.Context, p1 cid.Cid) (*DealInfo, error) { - if s.Internal.ClientGetDealInfo == nil { - return nil, ErrNotSupported - } - return s.Internal.ClientGetDealInfo(p0, p1) -} - -func (s *FullNodeStub) ClientGetDealInfo(p0 context.Context, p1 cid.Cid) (*DealInfo, error) { - return nil, ErrNotSupported -} - -func (s *FullNodeStruct) ClientGetDealStatus(p0 context.Context, p1 uint64) (string, error) { - if s.Internal.ClientGetDealStatus == nil { - return "", ErrNotSupported - } - return s.Internal.ClientGetDealStatus(p0, p1) -} - -func (s *FullNodeStub) ClientGetDealStatus(p0 context.Context, p1 uint64) (string, error) { - return "", ErrNotSupported -} - -func (s *FullNodeStruct) ClientGetDealUpdates(p0 context.Context) (<-chan DealInfo, error) { - if s.Internal.ClientGetDealUpdates == nil { - return nil, ErrNotSupported - } - return s.Internal.ClientGetDealUpdates(p0) -} - -func (s *FullNodeStub) ClientGetDealUpdates(p0 context.Context) (<-chan DealInfo, error) { - return nil, ErrNotSupported -} - -func (s *FullNodeStruct) ClientGetRetrievalUpdates(p0 context.Context) (<-chan RetrievalInfo, error) { - if s.Internal.ClientGetRetrievalUpdates == nil { - return nil, ErrNotSupported - } - return s.Internal.ClientGetRetrievalUpdates(p0) -} - -func (s *FullNodeStub) ClientGetRetrievalUpdates(p0 context.Context) (<-chan RetrievalInfo, error) { - return nil, ErrNotSupported -} - -func (s *FullNodeStruct) ClientHasLocal(p0 context.Context, p1 cid.Cid) (bool, error) { - if s.Internal.ClientHasLocal == nil { - return false, ErrNotSupported - } - return s.Internal.ClientHasLocal(p0, p1) -} - -func (s *FullNodeStub) ClientHasLocal(p0 context.Context, p1 cid.Cid) (bool, error) { - return false, ErrNotSupported -} - -func (s *FullNodeStruct) ClientImport(p0 context.Context, p1 FileRef) (*ImportRes, error) { - if s.Internal.ClientImport == nil { - return nil, ErrNotSupported - } - return s.Internal.ClientImport(p0, p1) -} - -func (s *FullNodeStub) ClientImport(p0 context.Context, p1 FileRef) (*ImportRes, error) { - return nil, ErrNotSupported -} - -func (s *FullNodeStruct) ClientListDataTransfers(p0 context.Context) ([]DataTransferChannel, error) { - if s.Internal.ClientListDataTransfers == nil { - return *new([]DataTransferChannel), ErrNotSupported - } - return s.Internal.ClientListDataTransfers(p0) -} - -func (s *FullNodeStub) ClientListDataTransfers(p0 context.Context) ([]DataTransferChannel, error) { - return *new([]DataTransferChannel), ErrNotSupported -} - -func (s *FullNodeStruct) ClientListDeals(p0 context.Context) ([]DealInfo, error) { - if s.Internal.ClientListDeals == nil { - return *new([]DealInfo), ErrNotSupported - } - return s.Internal.ClientListDeals(p0) -} - -func (s *FullNodeStub) ClientListDeals(p0 context.Context) ([]DealInfo, error) { - return *new([]DealInfo), ErrNotSupported -} - -func (s *FullNodeStruct) ClientListImports(p0 context.Context) ([]Import, error) { - if s.Internal.ClientListImports == nil { - return *new([]Import), ErrNotSupported - } - return s.Internal.ClientListImports(p0) -} - -func (s *FullNodeStub) ClientListImports(p0 context.Context) ([]Import, error) { - return *new([]Import), ErrNotSupported -} - -func (s *FullNodeStruct) ClientListRetrievals(p0 context.Context) ([]RetrievalInfo, error) { - if s.Internal.ClientListRetrievals == nil { - return *new([]RetrievalInfo), ErrNotSupported - } - return s.Internal.ClientListRetrievals(p0) -} - -func (s *FullNodeStub) ClientListRetrievals(p0 context.Context) ([]RetrievalInfo, error) { - return *new([]RetrievalInfo), ErrNotSupported -} - -func (s *FullNodeStruct) ClientMinerQueryOffer(p0 context.Context, p1 address.Address, p2 cid.Cid, p3 *cid.Cid) (QueryOffer, error) { - if s.Internal.ClientMinerQueryOffer == nil { - return *new(QueryOffer), ErrNotSupported - } - return s.Internal.ClientMinerQueryOffer(p0, p1, p2, p3) -} - -func (s *FullNodeStub) ClientMinerQueryOffer(p0 context.Context, p1 address.Address, p2 cid.Cid, p3 *cid.Cid) (QueryOffer, error) { - return *new(QueryOffer), ErrNotSupported -} - -func (s *FullNodeStruct) ClientQueryAsk(p0 context.Context, p1 peer.ID, p2 address.Address) (*StorageAsk, error) { - if s.Internal.ClientQueryAsk == nil { - return nil, ErrNotSupported - } - return s.Internal.ClientQueryAsk(p0, p1, p2) -} - -func (s *FullNodeStub) ClientQueryAsk(p0 context.Context, p1 peer.ID, p2 address.Address) (*StorageAsk, error) { - return nil, ErrNotSupported -} - -func (s *FullNodeStruct) ClientRemoveImport(p0 context.Context, p1 imports.ID) error { - if s.Internal.ClientRemoveImport == nil { - return ErrNotSupported - } - return s.Internal.ClientRemoveImport(p0, p1) -} - -func (s *FullNodeStub) ClientRemoveImport(p0 context.Context, p1 imports.ID) error { - return ErrNotSupported -} - -func (s *FullNodeStruct) ClientRestartDataTransfer(p0 context.Context, p1 datatransfer.TransferID, p2 peer.ID, p3 bool) error { - if s.Internal.ClientRestartDataTransfer == nil { - return ErrNotSupported - } - return s.Internal.ClientRestartDataTransfer(p0, p1, p2, p3) -} - -func (s *FullNodeStub) ClientRestartDataTransfer(p0 context.Context, p1 datatransfer.TransferID, p2 peer.ID, p3 bool) error { - return ErrNotSupported -} - -func (s *FullNodeStruct) ClientRetrieve(p0 context.Context, p1 RetrievalOrder) (*RestrievalRes, error) { - if s.Internal.ClientRetrieve == nil { - return nil, ErrNotSupported - } - return s.Internal.ClientRetrieve(p0, p1) -} - -func (s *FullNodeStub) ClientRetrieve(p0 context.Context, p1 RetrievalOrder) (*RestrievalRes, error) { - return nil, ErrNotSupported -} - -func (s *FullNodeStruct) ClientRetrieveTryRestartInsufficientFunds(p0 context.Context, p1 address.Address) error { - if s.Internal.ClientRetrieveTryRestartInsufficientFunds == nil { - return ErrNotSupported - } - return s.Internal.ClientRetrieveTryRestartInsufficientFunds(p0, p1) -} - -func (s *FullNodeStub) ClientRetrieveTryRestartInsufficientFunds(p0 context.Context, p1 address.Address) error { - return ErrNotSupported -} - -func (s *FullNodeStruct) ClientRetrieveWait(p0 context.Context, p1 retrievalmarket.DealID) error { - if s.Internal.ClientRetrieveWait == nil { - return ErrNotSupported - } - return s.Internal.ClientRetrieveWait(p0, p1) -} - -func (s *FullNodeStub) ClientRetrieveWait(p0 context.Context, p1 retrievalmarket.DealID) error { - return ErrNotSupported -} - -func (s *FullNodeStruct) ClientStartDeal(p0 context.Context, p1 *StartDealParams) (*cid.Cid, error) { - if s.Internal.ClientStartDeal == nil { - return nil, ErrNotSupported - } - return s.Internal.ClientStartDeal(p0, p1) -} - -func (s *FullNodeStub) ClientStartDeal(p0 context.Context, p1 *StartDealParams) (*cid.Cid, error) { - return nil, ErrNotSupported -} - -func (s *FullNodeStruct) ClientStatelessDeal(p0 context.Context, p1 *StartDealParams) (*cid.Cid, error) { - if s.Internal.ClientStatelessDeal == nil { - return nil, ErrNotSupported - } - return s.Internal.ClientStatelessDeal(p0, p1) -} - -func (s *FullNodeStub) ClientStatelessDeal(p0 context.Context, p1 *StartDealParams) (*cid.Cid, error) { - return nil, ErrNotSupported -} - func (s *FullNodeStruct) CreateBackup(p0 context.Context, p1 string) error { if s.Internal.CreateBackup == nil { return ErrNotSupported @@ -5898,369 +5441,17 @@ func (s *StorageMinerStub) CreateBackup(p0 context.Context, p1 string) error { return ErrNotSupported } -func (s *StorageMinerStruct) DagstoreGC(p0 context.Context) ([]DagstoreShardResult, error) { - if s.Internal.DagstoreGC == nil { - return *new([]DagstoreShardResult), ErrNotSupported +func (s *StorageMinerStruct) DealsList(p0 context.Context) ([]*MarketDeal, error) { + if s.Internal.DealsList == nil { + return *new([]*MarketDeal), ErrNotSupported } - return s.Internal.DagstoreGC(p0) -} - -func (s *StorageMinerStub) DagstoreGC(p0 context.Context) ([]DagstoreShardResult, error) { - return *new([]DagstoreShardResult), ErrNotSupported -} - -func (s *StorageMinerStruct) DagstoreInitializeAll(p0 context.Context, p1 DagstoreInitializeAllParams) (<-chan DagstoreInitializeAllEvent, error) { - if s.Internal.DagstoreInitializeAll == nil { - return nil, ErrNotSupported - } - return s.Internal.DagstoreInitializeAll(p0, p1) -} - -func (s *StorageMinerStub) DagstoreInitializeAll(p0 context.Context, p1 DagstoreInitializeAllParams) (<-chan DagstoreInitializeAllEvent, error) { - return nil, ErrNotSupported -} - -func (s *StorageMinerStruct) DagstoreInitializeShard(p0 context.Context, p1 string) error { - if s.Internal.DagstoreInitializeShard == nil { - return ErrNotSupported - } - return s.Internal.DagstoreInitializeShard(p0, p1) -} - -func (s *StorageMinerStub) DagstoreInitializeShard(p0 context.Context, p1 string) error { - return ErrNotSupported -} - -func (s *StorageMinerStruct) DagstoreListShards(p0 context.Context) ([]DagstoreShardInfo, error) { - if s.Internal.DagstoreListShards == nil { - return *new([]DagstoreShardInfo), ErrNotSupported - } - return s.Internal.DagstoreListShards(p0) -} - -func (s *StorageMinerStub) DagstoreListShards(p0 context.Context) ([]DagstoreShardInfo, error) { - return *new([]DagstoreShardInfo), ErrNotSupported -} - -func (s *StorageMinerStruct) DagstoreLookupPieces(p0 context.Context, p1 cid.Cid) ([]DagstoreShardInfo, error) { - if s.Internal.DagstoreLookupPieces == nil { - return *new([]DagstoreShardInfo), ErrNotSupported - } - return s.Internal.DagstoreLookupPieces(p0, p1) -} - -func (s *StorageMinerStub) DagstoreLookupPieces(p0 context.Context, p1 cid.Cid) ([]DagstoreShardInfo, error) { - return *new([]DagstoreShardInfo), ErrNotSupported -} - -func (s *StorageMinerStruct) DagstoreRecoverShard(p0 context.Context, p1 string) error { - if s.Internal.DagstoreRecoverShard == nil { - return ErrNotSupported - } - return s.Internal.DagstoreRecoverShard(p0, p1) -} - -func (s *StorageMinerStub) DagstoreRecoverShard(p0 context.Context, p1 string) error { - return ErrNotSupported -} - -func (s *StorageMinerStruct) DagstoreRegisterShard(p0 context.Context, p1 string) error { - if s.Internal.DagstoreRegisterShard == nil { - return ErrNotSupported - } - return s.Internal.DagstoreRegisterShard(p0, p1) -} - -func (s *StorageMinerStub) DagstoreRegisterShard(p0 context.Context, p1 string) error { - return ErrNotSupported -} - -func (s *StorageMinerStruct) DealsConsiderOfflineRetrievalDeals(p0 context.Context) (bool, error) { - if s.Internal.DealsConsiderOfflineRetrievalDeals == nil { - return false, ErrNotSupported - } - return s.Internal.DealsConsiderOfflineRetrievalDeals(p0) -} - -func (s *StorageMinerStub) DealsConsiderOfflineRetrievalDeals(p0 context.Context) (bool, error) { - return false, ErrNotSupported -} - -func (s *StorageMinerStruct) DealsConsiderOfflineStorageDeals(p0 context.Context) (bool, error) { - if s.Internal.DealsConsiderOfflineStorageDeals == nil { - return false, ErrNotSupported - } - return s.Internal.DealsConsiderOfflineStorageDeals(p0) -} - -func (s *StorageMinerStub) DealsConsiderOfflineStorageDeals(p0 context.Context) (bool, error) { - return false, ErrNotSupported -} - -func (s *StorageMinerStruct) DealsConsiderOnlineRetrievalDeals(p0 context.Context) (bool, error) { - if s.Internal.DealsConsiderOnlineRetrievalDeals == nil { - return false, ErrNotSupported - } - return s.Internal.DealsConsiderOnlineRetrievalDeals(p0) -} - -func (s *StorageMinerStub) DealsConsiderOnlineRetrievalDeals(p0 context.Context) (bool, error) { - return false, ErrNotSupported -} - -func (s *StorageMinerStruct) DealsConsiderOnlineStorageDeals(p0 context.Context) (bool, error) { - if s.Internal.DealsConsiderOnlineStorageDeals == nil { - return false, ErrNotSupported - } - return s.Internal.DealsConsiderOnlineStorageDeals(p0) -} - -func (s *StorageMinerStub) DealsConsiderOnlineStorageDeals(p0 context.Context) (bool, error) { - return false, ErrNotSupported -} - -func (s *StorageMinerStruct) DealsConsiderUnverifiedStorageDeals(p0 context.Context) (bool, error) { - if s.Internal.DealsConsiderUnverifiedStorageDeals == nil { - return false, ErrNotSupported - } - return s.Internal.DealsConsiderUnverifiedStorageDeals(p0) -} - -func (s *StorageMinerStub) DealsConsiderUnverifiedStorageDeals(p0 context.Context) (bool, error) { - return false, ErrNotSupported -} - -func (s *StorageMinerStruct) DealsConsiderVerifiedStorageDeals(p0 context.Context) (bool, error) { - if s.Internal.DealsConsiderVerifiedStorageDeals == nil { - return false, ErrNotSupported - } - return s.Internal.DealsConsiderVerifiedStorageDeals(p0) -} - -func (s *StorageMinerStub) DealsConsiderVerifiedStorageDeals(p0 context.Context) (bool, error) { - return false, ErrNotSupported -} - -func (s *StorageMinerStruct) DealsImportData(p0 context.Context, p1 cid.Cid, p2 string) error { - if s.Internal.DealsImportData == nil { - return ErrNotSupported - } - return s.Internal.DealsImportData(p0, p1, p2) -} - -func (s *StorageMinerStub) DealsImportData(p0 context.Context, p1 cid.Cid, p2 string) error { - return ErrNotSupported -} - -func (s *StorageMinerStruct) DealsList(p0 context.Context) ([]*MarketDeal, error) { - if s.Internal.DealsList == nil { - return *new([]*MarketDeal), ErrNotSupported - } - return s.Internal.DealsList(p0) + return s.Internal.DealsList(p0) } func (s *StorageMinerStub) DealsList(p0 context.Context) ([]*MarketDeal, error) { return *new([]*MarketDeal), ErrNotSupported } -func (s *StorageMinerStruct) DealsPieceCidBlocklist(p0 context.Context) ([]cid.Cid, error) { - if s.Internal.DealsPieceCidBlocklist == nil { - return *new([]cid.Cid), ErrNotSupported - } - return s.Internal.DealsPieceCidBlocklist(p0) -} - -func (s *StorageMinerStub) DealsPieceCidBlocklist(p0 context.Context) ([]cid.Cid, error) { - return *new([]cid.Cid), ErrNotSupported -} - -func (s *StorageMinerStruct) DealsSetConsiderOfflineRetrievalDeals(p0 context.Context, p1 bool) error { - if s.Internal.DealsSetConsiderOfflineRetrievalDeals == nil { - return ErrNotSupported - } - return s.Internal.DealsSetConsiderOfflineRetrievalDeals(p0, p1) -} - -func (s *StorageMinerStub) DealsSetConsiderOfflineRetrievalDeals(p0 context.Context, p1 bool) error { - return ErrNotSupported -} - -func (s *StorageMinerStruct) DealsSetConsiderOfflineStorageDeals(p0 context.Context, p1 bool) error { - if s.Internal.DealsSetConsiderOfflineStorageDeals == nil { - return ErrNotSupported - } - return s.Internal.DealsSetConsiderOfflineStorageDeals(p0, p1) -} - -func (s *StorageMinerStub) DealsSetConsiderOfflineStorageDeals(p0 context.Context, p1 bool) error { - return ErrNotSupported -} - -func (s *StorageMinerStruct) DealsSetConsiderOnlineRetrievalDeals(p0 context.Context, p1 bool) error { - if s.Internal.DealsSetConsiderOnlineRetrievalDeals == nil { - return ErrNotSupported - } - return s.Internal.DealsSetConsiderOnlineRetrievalDeals(p0, p1) -} - -func (s *StorageMinerStub) DealsSetConsiderOnlineRetrievalDeals(p0 context.Context, p1 bool) error { - return ErrNotSupported -} - -func (s *StorageMinerStruct) DealsSetConsiderOnlineStorageDeals(p0 context.Context, p1 bool) error { - if s.Internal.DealsSetConsiderOnlineStorageDeals == nil { - return ErrNotSupported - } - return s.Internal.DealsSetConsiderOnlineStorageDeals(p0, p1) -} - -func (s *StorageMinerStub) DealsSetConsiderOnlineStorageDeals(p0 context.Context, p1 bool) error { - return ErrNotSupported -} - -func (s *StorageMinerStruct) DealsSetConsiderUnverifiedStorageDeals(p0 context.Context, p1 bool) error { - if s.Internal.DealsSetConsiderUnverifiedStorageDeals == nil { - return ErrNotSupported - } - return s.Internal.DealsSetConsiderUnverifiedStorageDeals(p0, p1) -} - -func (s *StorageMinerStub) DealsSetConsiderUnverifiedStorageDeals(p0 context.Context, p1 bool) error { - return ErrNotSupported -} - -func (s *StorageMinerStruct) DealsSetConsiderVerifiedStorageDeals(p0 context.Context, p1 bool) error { - if s.Internal.DealsSetConsiderVerifiedStorageDeals == nil { - return ErrNotSupported - } - return s.Internal.DealsSetConsiderVerifiedStorageDeals(p0, p1) -} - -func (s *StorageMinerStub) DealsSetConsiderVerifiedStorageDeals(p0 context.Context, p1 bool) error { - return ErrNotSupported -} - -func (s *StorageMinerStruct) DealsSetPieceCidBlocklist(p0 context.Context, p1 []cid.Cid) error { - if s.Internal.DealsSetPieceCidBlocklist == nil { - return ErrNotSupported - } - return s.Internal.DealsSetPieceCidBlocklist(p0, p1) -} - -func (s *StorageMinerStub) DealsSetPieceCidBlocklist(p0 context.Context, p1 []cid.Cid) error { - return ErrNotSupported -} - -func (s *StorageMinerStruct) IndexerAnnounceAllDeals(p0 context.Context) error { - if s.Internal.IndexerAnnounceAllDeals == nil { - return ErrNotSupported - } - return s.Internal.IndexerAnnounceAllDeals(p0) -} - -func (s *StorageMinerStub) IndexerAnnounceAllDeals(p0 context.Context) error { - return ErrNotSupported -} - -func (s *StorageMinerStruct) IndexerAnnounceDeal(p0 context.Context, p1 cid.Cid) error { - if s.Internal.IndexerAnnounceDeal == nil { - return ErrNotSupported - } - return s.Internal.IndexerAnnounceDeal(p0, p1) -} - -func (s *StorageMinerStub) IndexerAnnounceDeal(p0 context.Context, p1 cid.Cid) error { - return ErrNotSupported -} - -func (s *StorageMinerStruct) MarketCancelDataTransfer(p0 context.Context, p1 datatransfer.TransferID, p2 peer.ID, p3 bool) error { - if s.Internal.MarketCancelDataTransfer == nil { - return ErrNotSupported - } - return s.Internal.MarketCancelDataTransfer(p0, p1, p2, p3) -} - -func (s *StorageMinerStub) MarketCancelDataTransfer(p0 context.Context, p1 datatransfer.TransferID, p2 peer.ID, p3 bool) error { - return ErrNotSupported -} - -func (s *StorageMinerStruct) MarketDataTransferDiagnostics(p0 context.Context, p1 peer.ID) (*TransferDiagnostics, error) { - if s.Internal.MarketDataTransferDiagnostics == nil { - return nil, ErrNotSupported - } - return s.Internal.MarketDataTransferDiagnostics(p0, p1) -} - -func (s *StorageMinerStub) MarketDataTransferDiagnostics(p0 context.Context, p1 peer.ID) (*TransferDiagnostics, error) { - return nil, ErrNotSupported -} - -func (s *StorageMinerStruct) MarketDataTransferUpdates(p0 context.Context) (<-chan DataTransferChannel, error) { - if s.Internal.MarketDataTransferUpdates == nil { - return nil, ErrNotSupported - } - return s.Internal.MarketDataTransferUpdates(p0) -} - -func (s *StorageMinerStub) MarketDataTransferUpdates(p0 context.Context) (<-chan DataTransferChannel, error) { - return nil, ErrNotSupported -} - -func (s *StorageMinerStruct) MarketGetAsk(p0 context.Context) (*storagemarket.SignedStorageAsk, error) { - if s.Internal.MarketGetAsk == nil { - return nil, ErrNotSupported - } - return s.Internal.MarketGetAsk(p0) -} - -func (s *StorageMinerStub) MarketGetAsk(p0 context.Context) (*storagemarket.SignedStorageAsk, error) { - return nil, ErrNotSupported -} - -func (s *StorageMinerStruct) MarketGetDealUpdates(p0 context.Context) (<-chan storagemarket.MinerDeal, error) { - if s.Internal.MarketGetDealUpdates == nil { - return nil, ErrNotSupported - } - return s.Internal.MarketGetDealUpdates(p0) -} - -func (s *StorageMinerStub) MarketGetDealUpdates(p0 context.Context) (<-chan storagemarket.MinerDeal, error) { - return nil, ErrNotSupported -} - -func (s *StorageMinerStruct) MarketGetRetrievalAsk(p0 context.Context) (*retrievalmarket.Ask, error) { - if s.Internal.MarketGetRetrievalAsk == nil { - return nil, ErrNotSupported - } - return s.Internal.MarketGetRetrievalAsk(p0) -} - -func (s *StorageMinerStub) MarketGetRetrievalAsk(p0 context.Context) (*retrievalmarket.Ask, error) { - return nil, ErrNotSupported -} - -func (s *StorageMinerStruct) MarketImportDealData(p0 context.Context, p1 cid.Cid, p2 string) error { - if s.Internal.MarketImportDealData == nil { - return ErrNotSupported - } - return s.Internal.MarketImportDealData(p0, p1, p2) -} - -func (s *StorageMinerStub) MarketImportDealData(p0 context.Context, p1 cid.Cid, p2 string) error { - return ErrNotSupported -} - -func (s *StorageMinerStruct) MarketListDataTransfers(p0 context.Context) ([]DataTransferChannel, error) { - if s.Internal.MarketListDataTransfers == nil { - return *new([]DataTransferChannel), ErrNotSupported - } - return s.Internal.MarketListDataTransfers(p0) -} - -func (s *StorageMinerStub) MarketListDataTransfers(p0 context.Context) ([]DataTransferChannel, error) { - return *new([]DataTransferChannel), ErrNotSupported -} - func (s *StorageMinerStruct) MarketListDeals(p0 context.Context) ([]*MarketDeal, error) { if s.Internal.MarketListDeals == nil { return *new([]*MarketDeal), ErrNotSupported @@ -6272,94 +5463,6 @@ func (s *StorageMinerStub) MarketListDeals(p0 context.Context) ([]*MarketDeal, e return *new([]*MarketDeal), ErrNotSupported } -func (s *StorageMinerStruct) MarketListIncompleteDeals(p0 context.Context) ([]storagemarket.MinerDeal, error) { - if s.Internal.MarketListIncompleteDeals == nil { - return *new([]storagemarket.MinerDeal), ErrNotSupported - } - return s.Internal.MarketListIncompleteDeals(p0) -} - -func (s *StorageMinerStub) MarketListIncompleteDeals(p0 context.Context) ([]storagemarket.MinerDeal, error) { - return *new([]storagemarket.MinerDeal), ErrNotSupported -} - -func (s *StorageMinerStruct) MarketListRetrievalDeals(p0 context.Context) ([]struct{}, error) { - if s.Internal.MarketListRetrievalDeals == nil { - return *new([]struct{}), ErrNotSupported - } - return s.Internal.MarketListRetrievalDeals(p0) -} - -func (s *StorageMinerStub) MarketListRetrievalDeals(p0 context.Context) ([]struct{}, error) { - return *new([]struct{}), ErrNotSupported -} - -func (s *StorageMinerStruct) MarketPendingDeals(p0 context.Context) (PendingDealInfo, error) { - if s.Internal.MarketPendingDeals == nil { - return *new(PendingDealInfo), ErrNotSupported - } - return s.Internal.MarketPendingDeals(p0) -} - -func (s *StorageMinerStub) MarketPendingDeals(p0 context.Context) (PendingDealInfo, error) { - return *new(PendingDealInfo), ErrNotSupported -} - -func (s *StorageMinerStruct) MarketPublishPendingDeals(p0 context.Context) error { - if s.Internal.MarketPublishPendingDeals == nil { - return ErrNotSupported - } - return s.Internal.MarketPublishPendingDeals(p0) -} - -func (s *StorageMinerStub) MarketPublishPendingDeals(p0 context.Context) error { - return ErrNotSupported -} - -func (s *StorageMinerStruct) MarketRestartDataTransfer(p0 context.Context, p1 datatransfer.TransferID, p2 peer.ID, p3 bool) error { - if s.Internal.MarketRestartDataTransfer == nil { - return ErrNotSupported - } - return s.Internal.MarketRestartDataTransfer(p0, p1, p2, p3) -} - -func (s *StorageMinerStub) MarketRestartDataTransfer(p0 context.Context, p1 datatransfer.TransferID, p2 peer.ID, p3 bool) error { - return ErrNotSupported -} - -func (s *StorageMinerStruct) MarketRetryPublishDeal(p0 context.Context, p1 cid.Cid) error { - if s.Internal.MarketRetryPublishDeal == nil { - return ErrNotSupported - } - return s.Internal.MarketRetryPublishDeal(p0, p1) -} - -func (s *StorageMinerStub) MarketRetryPublishDeal(p0 context.Context, p1 cid.Cid) error { - return ErrNotSupported -} - -func (s *StorageMinerStruct) MarketSetAsk(p0 context.Context, p1 types.BigInt, p2 types.BigInt, p3 abi.ChainEpoch, p4 abi.PaddedPieceSize, p5 abi.PaddedPieceSize) error { - if s.Internal.MarketSetAsk == nil { - return ErrNotSupported - } - return s.Internal.MarketSetAsk(p0, p1, p2, p3, p4, p5) -} - -func (s *StorageMinerStub) MarketSetAsk(p0 context.Context, p1 types.BigInt, p2 types.BigInt, p3 abi.ChainEpoch, p4 abi.PaddedPieceSize, p5 abi.PaddedPieceSize) error { - return ErrNotSupported -} - -func (s *StorageMinerStruct) MarketSetRetrievalAsk(p0 context.Context, p1 *retrievalmarket.Ask) error { - if s.Internal.MarketSetRetrievalAsk == nil { - return ErrNotSupported - } - return s.Internal.MarketSetRetrievalAsk(p0, p1) -} - -func (s *StorageMinerStub) MarketSetRetrievalAsk(p0 context.Context, p1 *retrievalmarket.Ask) error { - return ErrNotSupported -} - func (s *StorageMinerStruct) MiningBase(p0 context.Context) (*types.TipSet, error) { if s.Internal.MiningBase == nil { return nil, ErrNotSupported @@ -6371,50 +5474,6 @@ func (s *StorageMinerStub) MiningBase(p0 context.Context) (*types.TipSet, error) return nil, ErrNotSupported } -func (s *StorageMinerStruct) PiecesGetCIDInfo(p0 context.Context, p1 cid.Cid) (*piecestore.CIDInfo, error) { - if s.Internal.PiecesGetCIDInfo == nil { - return nil, ErrNotSupported - } - return s.Internal.PiecesGetCIDInfo(p0, p1) -} - -func (s *StorageMinerStub) PiecesGetCIDInfo(p0 context.Context, p1 cid.Cid) (*piecestore.CIDInfo, error) { - return nil, ErrNotSupported -} - -func (s *StorageMinerStruct) PiecesGetPieceInfo(p0 context.Context, p1 cid.Cid) (*piecestore.PieceInfo, error) { - if s.Internal.PiecesGetPieceInfo == nil { - return nil, ErrNotSupported - } - return s.Internal.PiecesGetPieceInfo(p0, p1) -} - -func (s *StorageMinerStub) PiecesGetPieceInfo(p0 context.Context, p1 cid.Cid) (*piecestore.PieceInfo, error) { - return nil, ErrNotSupported -} - -func (s *StorageMinerStruct) PiecesListCidInfos(p0 context.Context) ([]cid.Cid, error) { - if s.Internal.PiecesListCidInfos == nil { - return *new([]cid.Cid), ErrNotSupported - } - return s.Internal.PiecesListCidInfos(p0) -} - -func (s *StorageMinerStub) PiecesListCidInfos(p0 context.Context) ([]cid.Cid, error) { - return *new([]cid.Cid), ErrNotSupported -} - -func (s *StorageMinerStruct) PiecesListPieces(p0 context.Context) ([]cid.Cid, error) { - if s.Internal.PiecesListPieces == nil { - return *new([]cid.Cid), ErrNotSupported - } - return s.Internal.PiecesListPieces(p0) -} - -func (s *StorageMinerStub) PiecesListPieces(p0 context.Context) ([]cid.Cid, error) { - return *new([]cid.Cid), ErrNotSupported -} - func (s *StorageMinerStruct) PledgeSector(p0 context.Context) (abi.SectorID, error) { if s.Internal.PledgeSector == nil { return *new(abi.SectorID), ErrNotSupported diff --git a/api/types.go b/api/types.go index 71ad7d500a0..a79615f12ec 100644 --- a/api/types.go +++ b/api/types.go @@ -2,22 +2,16 @@ package api import ( "encoding/json" - "fmt" "time" "github.com/google/uuid" "github.com/ipfs/go-cid" - "github.com/ipfs/go-graphsync" - "github.com/ipld/go-ipld-prime" - "github.com/ipld/go-ipld-prime/codec/dagjson" pubsub "github.com/libp2p/go-libp2p-pubsub" "github.com/libp2p/go-libp2p/core/network" "github.com/libp2p/go-libp2p/core/peer" ma "github.com/multiformats/go-multiaddr" "github.com/filecoin-project/go-address" - datatransfer "github.com/filecoin-project/go-data-transfer/v2" - "github.com/filecoin-project/go-fil-markets/retrievalmarket" "github.com/filecoin-project/go-state-types/abi" "github.com/filecoin-project/lotus/chain/actors/builtin/miner" @@ -69,71 +63,6 @@ type MessageSendSpec struct { MaximizeFeeCap bool } -// GraphSyncDataTransfer provides diagnostics on a data transfer happening over graphsync -type GraphSyncDataTransfer struct { - // GraphSync request id for this transfer - RequestID *graphsync.RequestID - // Graphsync state for this transfer - RequestState string - // If a channel ID is present, indicates whether this is the current graphsync request for this channel - // (could have changed in a restart) - IsCurrentChannelRequest bool - // Data transfer channel ID for this transfer - ChannelID *datatransfer.ChannelID - // Data transfer state for this transfer - ChannelState *DataTransferChannel - // Diagnostic information about this request -- and unexpected inconsistencies in - // request state - Diagnostics []string -} - -// TransferDiagnostics give current information about transfers going over graphsync that may be helpful for debugging -type TransferDiagnostics struct { - ReceivingTransfers []*GraphSyncDataTransfer - SendingTransfers []*GraphSyncDataTransfer -} - -type DataTransferChannel struct { - TransferID datatransfer.TransferID - Status datatransfer.Status - BaseCID cid.Cid - IsInitiator bool - IsSender bool - Voucher string - Message string - OtherPeer peer.ID - Transferred uint64 - Stages *datatransfer.ChannelStages -} - -// NewDataTransferChannel constructs an API DataTransferChannel type from full channel state snapshot and a host id -func NewDataTransferChannel(hostID peer.ID, channelState datatransfer.ChannelState) DataTransferChannel { - channel := DataTransferChannel{ - TransferID: channelState.TransferID(), - Status: channelState.Status(), - BaseCID: channelState.BaseCID(), - IsSender: channelState.Sender() == hostID, - Message: channelState.Message(), - } - voucher := channelState.Voucher() - voucherJSON, err := ipld.Encode(voucher.Voucher, dagjson.Encode) - if err != nil { - channel.Voucher = fmt.Errorf("Voucher Serialization: %w", err).Error() - } else { - channel.Voucher = string(voucherJSON) - } - if channel.IsSender { - channel.IsInitiator = !channelState.IsPull() - channel.Transferred = channelState.Sent() - channel.OtherPeer = channelState.Recipient() - } else { - channel.IsInitiator = channelState.IsPull() - channel.Transferred = channelState.Received() - channel.OtherPeer = channelState.Sender() - } - return channel -} - type NetStat struct { System *network.ScopeStat `json:",omitempty"` Transient *network.ScopeStat `json:",omitempty"` @@ -229,31 +158,6 @@ type MessagePrototype struct { ValidNonce bool } -type RetrievalInfo struct { - PayloadCID cid.Cid - ID retrievalmarket.DealID - PieceCID *cid.Cid - PricePerByte abi.TokenAmount - UnsealPrice abi.TokenAmount - - Status retrievalmarket.DealStatus - Message string // more information about deal state, particularly errors - Provider peer.ID - BytesReceived uint64 - BytesPaidFor uint64 - TotalPaid abi.TokenAmount - - TransferChannelID *datatransfer.ChannelID - DataTransfer *DataTransferChannel - - // optional event if part of ClientGetRetrievalUpdates - Event *retrievalmarket.ClientEvent -} - -type RestrievalRes struct { - DealID retrievalmarket.DealID -} - // Selector specifies ipld selector string // - if the string starts with '{', it's interpreted as json selector string // see https://ipld.io/specs/selectors/ and https://ipld.io/specs/selectors/fixtures/selector-fixtures-1/ @@ -261,35 +165,6 @@ type RestrievalRes struct { // see https://github.com/ipld/go-ipld-selector-text-lite type Selector string -type DagSpec struct { - // DataSelector matches data to be retrieved - // - when using textselector, the path specifies subtree - // - the matched graph must have a single root - DataSelector *Selector - - // ExportMerkleProof is applicable only when exporting to a CAR file via a path textselector - // When true, in addition to the selection target, the resulting CAR will contain every block along the - // path back to, and including the original root - // When false the resulting CAR contains only the blocks of the target subdag - ExportMerkleProof bool -} - -type ExportRef struct { - Root cid.Cid - - // DAGs array specifies a list of DAGs to export - // - If exporting into unixfs files, only one DAG is supported, DataSelector is only used to find the targeted root node - // - If exporting into a car file - // - When exactly one text-path DataSelector is specified exports the subgraph and its full merkle-path from the original root - // - Otherwise ( multiple paths and/or JSON selector specs) determines each individual subroot and exports the subtrees as a multi-root car - // - When not specified defaults to a single DAG: - // - Data - the entire DAG: `{"R":{"l":{"none":{}},":>":{"a":{">":{"@":{}}}}}}` - DAGs []DagSpec - - FromLocalCAR string // if specified, get data from a local CARv2 file. - DealID retrievalmarket.DealID -} - type MinerInfo struct { Owner address.Address // Must be an ID-address. Worker address.Address // Must be an ID-address. diff --git a/api/v0api/full.go b/api/v0api/full.go index b61fc157025..334c5c56dab 100644 --- a/api/v0api/full.go +++ b/api/v0api/full.go @@ -5,14 +5,9 @@ import ( blocks "github.com/ipfs/go-block-format" "github.com/ipfs/go-cid" - textselector "github.com/ipld/go-ipld-selector-text-lite" - "github.com/libp2p/go-libp2p/core/peer" "github.com/filecoin-project/go-address" "github.com/filecoin-project/go-bitfield" - datatransfer "github.com/filecoin-project/go-data-transfer/v2" - "github.com/filecoin-project/go-fil-markets/retrievalmarket" - "github.com/filecoin-project/go-fil-markets/storagemarket" "github.com/filecoin-project/go-state-types/abi" "github.com/filecoin-project/go-state-types/builtin/v8/paych" verifregtypes "github.com/filecoin-project/go-state-types/builtin/v9/verifreg" @@ -24,9 +19,7 @@ import ( apitypes "github.com/filecoin-project/lotus/api/types" "github.com/filecoin-project/lotus/chain/actors/builtin/miner" "github.com/filecoin-project/lotus/chain/types" - marketevents "github.com/filecoin-project/lotus/markets/loggers" "github.com/filecoin-project/lotus/node/modules/dtypes" - "github.com/filecoin-project/lotus/node/repo/imports" ) //go:generate go run github.com/golang/mock/mockgen -destination=v0mocks/mock_full.go -package=v0mocks . FullNode @@ -305,74 +298,6 @@ type FullNode interface { WalletValidateAddress(context.Context, string) (address.Address, error) //perm:read // Other - - // MethodGroup: Client - // The Client methods all have to do with interacting with the storage and - // retrieval markets as a client - - // ClientImport imports file under the specified path into filestore. - ClientImport(ctx context.Context, ref api.FileRef) (*api.ImportRes, error) //perm:admin - // ClientRemoveImport removes file import - ClientRemoveImport(ctx context.Context, importID imports.ID) error //perm:admin - // ClientStartDeal proposes a deal with a miner. - ClientStartDeal(ctx context.Context, params *api.StartDealParams) (*cid.Cid, error) //perm:admin - // ClientStatelessDeal fire-and-forget-proposes an offline deal to a miner without subsequent tracking. - ClientStatelessDeal(ctx context.Context, params *api.StartDealParams) (*cid.Cid, error) //perm:write - // ClientGetDealInfo returns the latest information about a given deal. - ClientGetDealInfo(context.Context, cid.Cid) (*api.DealInfo, error) //perm:read - // ClientListDeals returns information about the deals made by the local client. - ClientListDeals(ctx context.Context) ([]api.DealInfo, error) //perm:write - // ClientGetDealUpdates returns the status of updated deals - ClientGetDealUpdates(ctx context.Context) (<-chan api.DealInfo, error) //perm:write - // ClientGetDealStatus returns status given a code - ClientGetDealStatus(ctx context.Context, statusCode uint64) (string, error) //perm:read - // ClientHasLocal indicates whether a certain CID is locally stored. - ClientHasLocal(ctx context.Context, root cid.Cid) (bool, error) //perm:write - // ClientFindData identifies peers that have a certain file, and returns QueryOffers (one per peer). - ClientFindData(ctx context.Context, root cid.Cid, piece *cid.Cid) ([]api.QueryOffer, error) //perm:read - // ClientMinerQueryOffer returns a QueryOffer for the specific miner and file. - ClientMinerQueryOffer(ctx context.Context, miner address.Address, root cid.Cid, piece *cid.Cid) (api.QueryOffer, error) //perm:read - // ClientRetrieve initiates the retrieval of a file, as specified in the order. - ClientRetrieve(ctx context.Context, order RetrievalOrder, ref *api.FileRef) error //perm:admin - // ClientRetrieveWithEvents initiates the retrieval of a file, as specified in the order, and provides a channel - // of status updates. - ClientRetrieveWithEvents(ctx context.Context, order RetrievalOrder, ref *api.FileRef) (<-chan marketevents.RetrievalEvent, error) //perm:admin - // ClientQueryAsk returns a signed StorageAsk from the specified miner. - // ClientListRetrievals returns information about retrievals made by the local client - ClientListRetrievals(ctx context.Context) ([]api.RetrievalInfo, error) //perm:write - // ClientGetRetrievalUpdates returns status of updated retrieval deals - ClientGetRetrievalUpdates(ctx context.Context) (<-chan api.RetrievalInfo, error) //perm:write - ClientQueryAsk(ctx context.Context, p peer.ID, miner address.Address) (*storagemarket.StorageAsk, error) //perm:read - // ClientCalcCommP calculates the CommP and data size of the specified CID - ClientDealPieceCID(ctx context.Context, root cid.Cid) (api.DataCIDSize, error) //perm:read - // ClientCalcCommP calculates the CommP for a specified file - ClientCalcCommP(ctx context.Context, inpath string) (*api.CommPRet, error) //perm:write - // ClientGenCar generates a CAR file for the specified file. - ClientGenCar(ctx context.Context, ref api.FileRef, outpath string) error //perm:write - // ClientDealSize calculates real deal data size - ClientDealSize(ctx context.Context, root cid.Cid) (api.DataSize, error) //perm:read - // ClientListTransfers returns the status of all ongoing transfers of data - ClientListDataTransfers(ctx context.Context) ([]api.DataTransferChannel, error) //perm:write - ClientDataTransferUpdates(ctx context.Context) (<-chan api.DataTransferChannel, error) //perm:write - // ClientRestartDataTransfer attempts to restart a data transfer with the given transfer ID and other peer - ClientRestartDataTransfer(ctx context.Context, transferID datatransfer.TransferID, otherPeer peer.ID, isInitiator bool) error //perm:write - // ClientCancelDataTransfer cancels a data transfer with the given transfer ID and other peer - ClientCancelDataTransfer(ctx context.Context, transferID datatransfer.TransferID, otherPeer peer.ID, isInitiator bool) error //perm:write - // ClientRetrieveTryRestartInsufficientFunds attempts to restart stalled retrievals on a given payment channel - // which are stuck due to insufficient funds - ClientRetrieveTryRestartInsufficientFunds(ctx context.Context, paymentChannel address.Address) error //perm:write - - // ClientCancelRetrievalDeal cancels an ongoing retrieval deal based on DealID - ClientCancelRetrievalDeal(ctx context.Context, dealid retrievalmarket.DealID) error //perm:write - - // ClientUnimport removes references to the specified file from filestore - // ClientUnimport(path string) - - // ClientListImports lists imported files and their root CIDs - ClientListImports(ctx context.Context) ([]api.Import, error) //perm:write - - // ClientListAsks() []Ask - // MethodGroup: State // The State methods are used to query, inspect, and interact with chain state. // Most methods take a TipSetKey as a parameter. The state looked up is the parent state of the tipset. @@ -743,37 +668,3 @@ type FullNode interface { // the path specified when calling CreateBackup is within the base path CreateBackup(ctx context.Context, fpath string) error //perm:admin } - -func OfferOrder(o api.QueryOffer, client address.Address) RetrievalOrder { - return RetrievalOrder{ - Root: o.Root, - Piece: o.Piece, - Size: o.Size, - Total: o.MinPrice, - UnsealPrice: o.UnsealPrice, - PaymentInterval: o.PaymentInterval, - PaymentIntervalIncrease: o.PaymentIntervalIncrease, - Client: client, - - Miner: o.Miner, - MinerPeer: &o.MinerPeer, - } -} - -type RetrievalOrder struct { - // TODO: make this less unixfs specific - Root cid.Cid - Piece *cid.Cid - DatamodelPathSelector *textselector.Expression - Size uint64 - - FromLocalCAR string // if specified, get data from a local CARv2 file. - // TODO: support offset - Total types.BigInt - UnsealPrice types.BigInt - PaymentInterval uint64 - PaymentIntervalIncrease uint64 - Client address.Address - Miner address.Address - MinerPeer *retrievalmarket.RetrievalPeer -} diff --git a/api/v0api/proxy_gen.go b/api/v0api/proxy_gen.go index 90c25d4a774..a8756894951 100644 --- a/api/v0api/proxy_gen.go +++ b/api/v0api/proxy_gen.go @@ -7,14 +7,10 @@ import ( blocks "github.com/ipfs/go-block-format" "github.com/ipfs/go-cid" - "github.com/libp2p/go-libp2p/core/peer" "golang.org/x/xerrors" "github.com/filecoin-project/go-address" "github.com/filecoin-project/go-bitfield" - datatransfer "github.com/filecoin-project/go-data-transfer/v2" - "github.com/filecoin-project/go-fil-markets/retrievalmarket" - "github.com/filecoin-project/go-fil-markets/storagemarket" "github.com/filecoin-project/go-state-types/abi" "github.com/filecoin-project/go-state-types/builtin/v8/paych" verifregtypes "github.com/filecoin-project/go-state-types/builtin/v9/verifreg" @@ -26,9 +22,7 @@ import ( apitypes "github.com/filecoin-project/lotus/api/types" "github.com/filecoin-project/lotus/chain/actors/builtin/miner" "github.com/filecoin-project/lotus/chain/types" - marketevents "github.com/filecoin-project/lotus/markets/loggers" "github.com/filecoin-project/lotus/node/modules/dtypes" - "github.com/filecoin-project/lotus/node/repo/imports" ) var ErrNotSupported = xerrors.New("method not supported") @@ -90,60 +84,6 @@ type FullNodeMethods struct { ChainTipSetWeight func(p0 context.Context, p1 types.TipSetKey) (types.BigInt, error) `perm:"read"` - ClientCalcCommP func(p0 context.Context, p1 string) (*api.CommPRet, error) `perm:"write"` - - ClientCancelDataTransfer func(p0 context.Context, p1 datatransfer.TransferID, p2 peer.ID, p3 bool) error `perm:"write"` - - ClientCancelRetrievalDeal func(p0 context.Context, p1 retrievalmarket.DealID) error `perm:"write"` - - ClientDataTransferUpdates func(p0 context.Context) (<-chan api.DataTransferChannel, error) `perm:"write"` - - ClientDealPieceCID func(p0 context.Context, p1 cid.Cid) (api.DataCIDSize, error) `perm:"read"` - - ClientDealSize func(p0 context.Context, p1 cid.Cid) (api.DataSize, error) `perm:"read"` - - ClientFindData func(p0 context.Context, p1 cid.Cid, p2 *cid.Cid) ([]api.QueryOffer, error) `perm:"read"` - - ClientGenCar func(p0 context.Context, p1 api.FileRef, p2 string) error `perm:"write"` - - ClientGetDealInfo func(p0 context.Context, p1 cid.Cid) (*api.DealInfo, error) `perm:"read"` - - ClientGetDealStatus func(p0 context.Context, p1 uint64) (string, error) `perm:"read"` - - ClientGetDealUpdates func(p0 context.Context) (<-chan api.DealInfo, error) `perm:"write"` - - ClientGetRetrievalUpdates func(p0 context.Context) (<-chan api.RetrievalInfo, error) `perm:"write"` - - ClientHasLocal func(p0 context.Context, p1 cid.Cid) (bool, error) `perm:"write"` - - ClientImport func(p0 context.Context, p1 api.FileRef) (*api.ImportRes, error) `perm:"admin"` - - ClientListDataTransfers func(p0 context.Context) ([]api.DataTransferChannel, error) `perm:"write"` - - ClientListDeals func(p0 context.Context) ([]api.DealInfo, error) `perm:"write"` - - ClientListImports func(p0 context.Context) ([]api.Import, error) `perm:"write"` - - ClientListRetrievals func(p0 context.Context) ([]api.RetrievalInfo, error) `perm:"write"` - - ClientMinerQueryOffer func(p0 context.Context, p1 address.Address, p2 cid.Cid, p3 *cid.Cid) (api.QueryOffer, error) `perm:"read"` - - ClientQueryAsk func(p0 context.Context, p1 peer.ID, p2 address.Address) (*storagemarket.StorageAsk, error) `perm:"read"` - - ClientRemoveImport func(p0 context.Context, p1 imports.ID) error `perm:"admin"` - - ClientRestartDataTransfer func(p0 context.Context, p1 datatransfer.TransferID, p2 peer.ID, p3 bool) error `perm:"write"` - - ClientRetrieve func(p0 context.Context, p1 RetrievalOrder, p2 *api.FileRef) error `perm:"admin"` - - ClientRetrieveTryRestartInsufficientFunds func(p0 context.Context, p1 address.Address) error `perm:"write"` - - ClientRetrieveWithEvents func(p0 context.Context, p1 RetrievalOrder, p2 *api.FileRef) (<-chan marketevents.RetrievalEvent, error) `perm:"admin"` - - ClientStartDeal func(p0 context.Context, p1 *api.StartDealParams) (*cid.Cid, error) `perm:"admin"` - - ClientStatelessDeal func(p0 context.Context, p1 *api.StartDealParams) (*cid.Cid, error) `perm:"write"` - CreateBackup func(p0 context.Context, p1 string) error `perm:"admin"` GasEstimateFeeCap func(p0 context.Context, p1 *types.Message, p2 int64, p3 types.TipSetKey) (types.BigInt, error) `perm:"read"` @@ -796,303 +736,6 @@ func (s *FullNodeStub) ChainTipSetWeight(p0 context.Context, p1 types.TipSetKey) return *new(types.BigInt), ErrNotSupported } -func (s *FullNodeStruct) ClientCalcCommP(p0 context.Context, p1 string) (*api.CommPRet, error) { - if s.Internal.ClientCalcCommP == nil { - return nil, ErrNotSupported - } - return s.Internal.ClientCalcCommP(p0, p1) -} - -func (s *FullNodeStub) ClientCalcCommP(p0 context.Context, p1 string) (*api.CommPRet, error) { - return nil, ErrNotSupported -} - -func (s *FullNodeStruct) ClientCancelDataTransfer(p0 context.Context, p1 datatransfer.TransferID, p2 peer.ID, p3 bool) error { - if s.Internal.ClientCancelDataTransfer == nil { - return ErrNotSupported - } - return s.Internal.ClientCancelDataTransfer(p0, p1, p2, p3) -} - -func (s *FullNodeStub) ClientCancelDataTransfer(p0 context.Context, p1 datatransfer.TransferID, p2 peer.ID, p3 bool) error { - return ErrNotSupported -} - -func (s *FullNodeStruct) ClientCancelRetrievalDeal(p0 context.Context, p1 retrievalmarket.DealID) error { - if s.Internal.ClientCancelRetrievalDeal == nil { - return ErrNotSupported - } - return s.Internal.ClientCancelRetrievalDeal(p0, p1) -} - -func (s *FullNodeStub) ClientCancelRetrievalDeal(p0 context.Context, p1 retrievalmarket.DealID) error { - return ErrNotSupported -} - -func (s *FullNodeStruct) ClientDataTransferUpdates(p0 context.Context) (<-chan api.DataTransferChannel, error) { - if s.Internal.ClientDataTransferUpdates == nil { - return nil, ErrNotSupported - } - return s.Internal.ClientDataTransferUpdates(p0) -} - -func (s *FullNodeStub) ClientDataTransferUpdates(p0 context.Context) (<-chan api.DataTransferChannel, error) { - return nil, ErrNotSupported -} - -func (s *FullNodeStruct) ClientDealPieceCID(p0 context.Context, p1 cid.Cid) (api.DataCIDSize, error) { - if s.Internal.ClientDealPieceCID == nil { - return *new(api.DataCIDSize), ErrNotSupported - } - return s.Internal.ClientDealPieceCID(p0, p1) -} - -func (s *FullNodeStub) ClientDealPieceCID(p0 context.Context, p1 cid.Cid) (api.DataCIDSize, error) { - return *new(api.DataCIDSize), ErrNotSupported -} - -func (s *FullNodeStruct) ClientDealSize(p0 context.Context, p1 cid.Cid) (api.DataSize, error) { - if s.Internal.ClientDealSize == nil { - return *new(api.DataSize), ErrNotSupported - } - return s.Internal.ClientDealSize(p0, p1) -} - -func (s *FullNodeStub) ClientDealSize(p0 context.Context, p1 cid.Cid) (api.DataSize, error) { - return *new(api.DataSize), ErrNotSupported -} - -func (s *FullNodeStruct) ClientFindData(p0 context.Context, p1 cid.Cid, p2 *cid.Cid) ([]api.QueryOffer, error) { - if s.Internal.ClientFindData == nil { - return *new([]api.QueryOffer), ErrNotSupported - } - return s.Internal.ClientFindData(p0, p1, p2) -} - -func (s *FullNodeStub) ClientFindData(p0 context.Context, p1 cid.Cid, p2 *cid.Cid) ([]api.QueryOffer, error) { - return *new([]api.QueryOffer), ErrNotSupported -} - -func (s *FullNodeStruct) ClientGenCar(p0 context.Context, p1 api.FileRef, p2 string) error { - if s.Internal.ClientGenCar == nil { - return ErrNotSupported - } - return s.Internal.ClientGenCar(p0, p1, p2) -} - -func (s *FullNodeStub) ClientGenCar(p0 context.Context, p1 api.FileRef, p2 string) error { - return ErrNotSupported -} - -func (s *FullNodeStruct) ClientGetDealInfo(p0 context.Context, p1 cid.Cid) (*api.DealInfo, error) { - if s.Internal.ClientGetDealInfo == nil { - return nil, ErrNotSupported - } - return s.Internal.ClientGetDealInfo(p0, p1) -} - -func (s *FullNodeStub) ClientGetDealInfo(p0 context.Context, p1 cid.Cid) (*api.DealInfo, error) { - return nil, ErrNotSupported -} - -func (s *FullNodeStruct) ClientGetDealStatus(p0 context.Context, p1 uint64) (string, error) { - if s.Internal.ClientGetDealStatus == nil { - return "", ErrNotSupported - } - return s.Internal.ClientGetDealStatus(p0, p1) -} - -func (s *FullNodeStub) ClientGetDealStatus(p0 context.Context, p1 uint64) (string, error) { - return "", ErrNotSupported -} - -func (s *FullNodeStruct) ClientGetDealUpdates(p0 context.Context) (<-chan api.DealInfo, error) { - if s.Internal.ClientGetDealUpdates == nil { - return nil, ErrNotSupported - } - return s.Internal.ClientGetDealUpdates(p0) -} - -func (s *FullNodeStub) ClientGetDealUpdates(p0 context.Context) (<-chan api.DealInfo, error) { - return nil, ErrNotSupported -} - -func (s *FullNodeStruct) ClientGetRetrievalUpdates(p0 context.Context) (<-chan api.RetrievalInfo, error) { - if s.Internal.ClientGetRetrievalUpdates == nil { - return nil, ErrNotSupported - } - return s.Internal.ClientGetRetrievalUpdates(p0) -} - -func (s *FullNodeStub) ClientGetRetrievalUpdates(p0 context.Context) (<-chan api.RetrievalInfo, error) { - return nil, ErrNotSupported -} - -func (s *FullNodeStruct) ClientHasLocal(p0 context.Context, p1 cid.Cid) (bool, error) { - if s.Internal.ClientHasLocal == nil { - return false, ErrNotSupported - } - return s.Internal.ClientHasLocal(p0, p1) -} - -func (s *FullNodeStub) ClientHasLocal(p0 context.Context, p1 cid.Cid) (bool, error) { - return false, ErrNotSupported -} - -func (s *FullNodeStruct) ClientImport(p0 context.Context, p1 api.FileRef) (*api.ImportRes, error) { - if s.Internal.ClientImport == nil { - return nil, ErrNotSupported - } - return s.Internal.ClientImport(p0, p1) -} - -func (s *FullNodeStub) ClientImport(p0 context.Context, p1 api.FileRef) (*api.ImportRes, error) { - return nil, ErrNotSupported -} - -func (s *FullNodeStruct) ClientListDataTransfers(p0 context.Context) ([]api.DataTransferChannel, error) { - if s.Internal.ClientListDataTransfers == nil { - return *new([]api.DataTransferChannel), ErrNotSupported - } - return s.Internal.ClientListDataTransfers(p0) -} - -func (s *FullNodeStub) ClientListDataTransfers(p0 context.Context) ([]api.DataTransferChannel, error) { - return *new([]api.DataTransferChannel), ErrNotSupported -} - -func (s *FullNodeStruct) ClientListDeals(p0 context.Context) ([]api.DealInfo, error) { - if s.Internal.ClientListDeals == nil { - return *new([]api.DealInfo), ErrNotSupported - } - return s.Internal.ClientListDeals(p0) -} - -func (s *FullNodeStub) ClientListDeals(p0 context.Context) ([]api.DealInfo, error) { - return *new([]api.DealInfo), ErrNotSupported -} - -func (s *FullNodeStruct) ClientListImports(p0 context.Context) ([]api.Import, error) { - if s.Internal.ClientListImports == nil { - return *new([]api.Import), ErrNotSupported - } - return s.Internal.ClientListImports(p0) -} - -func (s *FullNodeStub) ClientListImports(p0 context.Context) ([]api.Import, error) { - return *new([]api.Import), ErrNotSupported -} - -func (s *FullNodeStruct) ClientListRetrievals(p0 context.Context) ([]api.RetrievalInfo, error) { - if s.Internal.ClientListRetrievals == nil { - return *new([]api.RetrievalInfo), ErrNotSupported - } - return s.Internal.ClientListRetrievals(p0) -} - -func (s *FullNodeStub) ClientListRetrievals(p0 context.Context) ([]api.RetrievalInfo, error) { - return *new([]api.RetrievalInfo), ErrNotSupported -} - -func (s *FullNodeStruct) ClientMinerQueryOffer(p0 context.Context, p1 address.Address, p2 cid.Cid, p3 *cid.Cid) (api.QueryOffer, error) { - if s.Internal.ClientMinerQueryOffer == nil { - return *new(api.QueryOffer), ErrNotSupported - } - return s.Internal.ClientMinerQueryOffer(p0, p1, p2, p3) -} - -func (s *FullNodeStub) ClientMinerQueryOffer(p0 context.Context, p1 address.Address, p2 cid.Cid, p3 *cid.Cid) (api.QueryOffer, error) { - return *new(api.QueryOffer), ErrNotSupported -} - -func (s *FullNodeStruct) ClientQueryAsk(p0 context.Context, p1 peer.ID, p2 address.Address) (*storagemarket.StorageAsk, error) { - if s.Internal.ClientQueryAsk == nil { - return nil, ErrNotSupported - } - return s.Internal.ClientQueryAsk(p0, p1, p2) -} - -func (s *FullNodeStub) ClientQueryAsk(p0 context.Context, p1 peer.ID, p2 address.Address) (*storagemarket.StorageAsk, error) { - return nil, ErrNotSupported -} - -func (s *FullNodeStruct) ClientRemoveImport(p0 context.Context, p1 imports.ID) error { - if s.Internal.ClientRemoveImport == nil { - return ErrNotSupported - } - return s.Internal.ClientRemoveImport(p0, p1) -} - -func (s *FullNodeStub) ClientRemoveImport(p0 context.Context, p1 imports.ID) error { - return ErrNotSupported -} - -func (s *FullNodeStruct) ClientRestartDataTransfer(p0 context.Context, p1 datatransfer.TransferID, p2 peer.ID, p3 bool) error { - if s.Internal.ClientRestartDataTransfer == nil { - return ErrNotSupported - } - return s.Internal.ClientRestartDataTransfer(p0, p1, p2, p3) -} - -func (s *FullNodeStub) ClientRestartDataTransfer(p0 context.Context, p1 datatransfer.TransferID, p2 peer.ID, p3 bool) error { - return ErrNotSupported -} - -func (s *FullNodeStruct) ClientRetrieve(p0 context.Context, p1 RetrievalOrder, p2 *api.FileRef) error { - if s.Internal.ClientRetrieve == nil { - return ErrNotSupported - } - return s.Internal.ClientRetrieve(p0, p1, p2) -} - -func (s *FullNodeStub) ClientRetrieve(p0 context.Context, p1 RetrievalOrder, p2 *api.FileRef) error { - return ErrNotSupported -} - -func (s *FullNodeStruct) ClientRetrieveTryRestartInsufficientFunds(p0 context.Context, p1 address.Address) error { - if s.Internal.ClientRetrieveTryRestartInsufficientFunds == nil { - return ErrNotSupported - } - return s.Internal.ClientRetrieveTryRestartInsufficientFunds(p0, p1) -} - -func (s *FullNodeStub) ClientRetrieveTryRestartInsufficientFunds(p0 context.Context, p1 address.Address) error { - return ErrNotSupported -} - -func (s *FullNodeStruct) ClientRetrieveWithEvents(p0 context.Context, p1 RetrievalOrder, p2 *api.FileRef) (<-chan marketevents.RetrievalEvent, error) { - if s.Internal.ClientRetrieveWithEvents == nil { - return nil, ErrNotSupported - } - return s.Internal.ClientRetrieveWithEvents(p0, p1, p2) -} - -func (s *FullNodeStub) ClientRetrieveWithEvents(p0 context.Context, p1 RetrievalOrder, p2 *api.FileRef) (<-chan marketevents.RetrievalEvent, error) { - return nil, ErrNotSupported -} - -func (s *FullNodeStruct) ClientStartDeal(p0 context.Context, p1 *api.StartDealParams) (*cid.Cid, error) { - if s.Internal.ClientStartDeal == nil { - return nil, ErrNotSupported - } - return s.Internal.ClientStartDeal(p0, p1) -} - -func (s *FullNodeStub) ClientStartDeal(p0 context.Context, p1 *api.StartDealParams) (*cid.Cid, error) { - return nil, ErrNotSupported -} - -func (s *FullNodeStruct) ClientStatelessDeal(p0 context.Context, p1 *api.StartDealParams) (*cid.Cid, error) { - if s.Internal.ClientStatelessDeal == nil { - return nil, ErrNotSupported - } - return s.Internal.ClientStatelessDeal(p0, p1) -} - -func (s *FullNodeStub) ClientStatelessDeal(p0 context.Context, p1 *api.StartDealParams) (*cid.Cid, error) { - return nil, ErrNotSupported -} - func (s *FullNodeStruct) CreateBackup(p0 context.Context, p1 string) error { if s.Internal.CreateBackup == nil { return ErrNotSupported diff --git a/api/v0api/v0mocks/mock_full.go b/api/v0api/v0mocks/mock_full.go index df67d087656..092d93b67bf 100644 --- a/api/v0api/v0mocks/mock_full.go +++ b/api/v0api/v0mocks/mock_full.go @@ -20,9 +20,6 @@ import ( address "github.com/filecoin-project/go-address" bitfield "github.com/filecoin-project/go-bitfield" - datatransfer "github.com/filecoin-project/go-data-transfer/v2" - retrievalmarket "github.com/filecoin-project/go-fil-markets/retrievalmarket" - storagemarket "github.com/filecoin-project/go-fil-markets/storagemarket" auth "github.com/filecoin-project/go-jsonrpc/auth" abi "github.com/filecoin-project/go-state-types/abi" big "github.com/filecoin-project/go-state-types/big" @@ -36,13 +33,10 @@ import ( api "github.com/filecoin-project/lotus/api" apitypes "github.com/filecoin-project/lotus/api/types" - v0api "github.com/filecoin-project/lotus/api/v0api" miner1 "github.com/filecoin-project/lotus/chain/actors/builtin/miner" types "github.com/filecoin-project/lotus/chain/types" alerting "github.com/filecoin-project/lotus/journal/alerting" - marketevents "github.com/filecoin-project/lotus/markets/loggers" dtypes "github.com/filecoin-project/lotus/node/modules/dtypes" - imports "github.com/filecoin-project/lotus/node/repo/imports" ) // MockFullNode is a mock of FullNode interface. @@ -455,404 +449,6 @@ func (mr *MockFullNodeMockRecorder) ChainTipSetWeight(arg0, arg1 interface{}) *g return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ChainTipSetWeight", reflect.TypeOf((*MockFullNode)(nil).ChainTipSetWeight), arg0, arg1) } -// ClientCalcCommP mocks base method. -func (m *MockFullNode) ClientCalcCommP(arg0 context.Context, arg1 string) (*api.CommPRet, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ClientCalcCommP", arg0, arg1) - ret0, _ := ret[0].(*api.CommPRet) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// ClientCalcCommP indicates an expected call of ClientCalcCommP. -func (mr *MockFullNodeMockRecorder) ClientCalcCommP(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientCalcCommP", reflect.TypeOf((*MockFullNode)(nil).ClientCalcCommP), arg0, arg1) -} - -// ClientCancelDataTransfer mocks base method. -func (m *MockFullNode) ClientCancelDataTransfer(arg0 context.Context, arg1 datatransfer.TransferID, arg2 peer.ID, arg3 bool) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ClientCancelDataTransfer", arg0, arg1, arg2, arg3) - ret0, _ := ret[0].(error) - return ret0 -} - -// ClientCancelDataTransfer indicates an expected call of ClientCancelDataTransfer. -func (mr *MockFullNodeMockRecorder) ClientCancelDataTransfer(arg0, arg1, arg2, arg3 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientCancelDataTransfer", reflect.TypeOf((*MockFullNode)(nil).ClientCancelDataTransfer), arg0, arg1, arg2, arg3) -} - -// ClientCancelRetrievalDeal mocks base method. -func (m *MockFullNode) ClientCancelRetrievalDeal(arg0 context.Context, arg1 retrievalmarket.DealID) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ClientCancelRetrievalDeal", arg0, arg1) - ret0, _ := ret[0].(error) - return ret0 -} - -// ClientCancelRetrievalDeal indicates an expected call of ClientCancelRetrievalDeal. -func (mr *MockFullNodeMockRecorder) ClientCancelRetrievalDeal(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientCancelRetrievalDeal", reflect.TypeOf((*MockFullNode)(nil).ClientCancelRetrievalDeal), arg0, arg1) -} - -// ClientDataTransferUpdates mocks base method. -func (m *MockFullNode) ClientDataTransferUpdates(arg0 context.Context) (<-chan api.DataTransferChannel, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ClientDataTransferUpdates", arg0) - ret0, _ := ret[0].(<-chan api.DataTransferChannel) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// ClientDataTransferUpdates indicates an expected call of ClientDataTransferUpdates. -func (mr *MockFullNodeMockRecorder) ClientDataTransferUpdates(arg0 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientDataTransferUpdates", reflect.TypeOf((*MockFullNode)(nil).ClientDataTransferUpdates), arg0) -} - -// ClientDealPieceCID mocks base method. -func (m *MockFullNode) ClientDealPieceCID(arg0 context.Context, arg1 cid.Cid) (api.DataCIDSize, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ClientDealPieceCID", arg0, arg1) - ret0, _ := ret[0].(api.DataCIDSize) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// ClientDealPieceCID indicates an expected call of ClientDealPieceCID. -func (mr *MockFullNodeMockRecorder) ClientDealPieceCID(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientDealPieceCID", reflect.TypeOf((*MockFullNode)(nil).ClientDealPieceCID), arg0, arg1) -} - -// ClientDealSize mocks base method. -func (m *MockFullNode) ClientDealSize(arg0 context.Context, arg1 cid.Cid) (api.DataSize, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ClientDealSize", arg0, arg1) - ret0, _ := ret[0].(api.DataSize) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// ClientDealSize indicates an expected call of ClientDealSize. -func (mr *MockFullNodeMockRecorder) ClientDealSize(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientDealSize", reflect.TypeOf((*MockFullNode)(nil).ClientDealSize), arg0, arg1) -} - -// ClientFindData mocks base method. -func (m *MockFullNode) ClientFindData(arg0 context.Context, arg1 cid.Cid, arg2 *cid.Cid) ([]api.QueryOffer, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ClientFindData", arg0, arg1, arg2) - ret0, _ := ret[0].([]api.QueryOffer) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// ClientFindData indicates an expected call of ClientFindData. -func (mr *MockFullNodeMockRecorder) ClientFindData(arg0, arg1, arg2 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientFindData", reflect.TypeOf((*MockFullNode)(nil).ClientFindData), arg0, arg1, arg2) -} - -// ClientGenCar mocks base method. -func (m *MockFullNode) ClientGenCar(arg0 context.Context, arg1 api.FileRef, arg2 string) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ClientGenCar", arg0, arg1, arg2) - ret0, _ := ret[0].(error) - return ret0 -} - -// ClientGenCar indicates an expected call of ClientGenCar. -func (mr *MockFullNodeMockRecorder) ClientGenCar(arg0, arg1, arg2 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientGenCar", reflect.TypeOf((*MockFullNode)(nil).ClientGenCar), arg0, arg1, arg2) -} - -// ClientGetDealInfo mocks base method. -func (m *MockFullNode) ClientGetDealInfo(arg0 context.Context, arg1 cid.Cid) (*api.DealInfo, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ClientGetDealInfo", arg0, arg1) - ret0, _ := ret[0].(*api.DealInfo) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// ClientGetDealInfo indicates an expected call of ClientGetDealInfo. -func (mr *MockFullNodeMockRecorder) ClientGetDealInfo(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientGetDealInfo", reflect.TypeOf((*MockFullNode)(nil).ClientGetDealInfo), arg0, arg1) -} - -// ClientGetDealStatus mocks base method. -func (m *MockFullNode) ClientGetDealStatus(arg0 context.Context, arg1 uint64) (string, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ClientGetDealStatus", arg0, arg1) - ret0, _ := ret[0].(string) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// ClientGetDealStatus indicates an expected call of ClientGetDealStatus. -func (mr *MockFullNodeMockRecorder) ClientGetDealStatus(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientGetDealStatus", reflect.TypeOf((*MockFullNode)(nil).ClientGetDealStatus), arg0, arg1) -} - -// ClientGetDealUpdates mocks base method. -func (m *MockFullNode) ClientGetDealUpdates(arg0 context.Context) (<-chan api.DealInfo, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ClientGetDealUpdates", arg0) - ret0, _ := ret[0].(<-chan api.DealInfo) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// ClientGetDealUpdates indicates an expected call of ClientGetDealUpdates. -func (mr *MockFullNodeMockRecorder) ClientGetDealUpdates(arg0 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientGetDealUpdates", reflect.TypeOf((*MockFullNode)(nil).ClientGetDealUpdates), arg0) -} - -// ClientGetRetrievalUpdates mocks base method. -func (m *MockFullNode) ClientGetRetrievalUpdates(arg0 context.Context) (<-chan api.RetrievalInfo, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ClientGetRetrievalUpdates", arg0) - ret0, _ := ret[0].(<-chan api.RetrievalInfo) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// ClientGetRetrievalUpdates indicates an expected call of ClientGetRetrievalUpdates. -func (mr *MockFullNodeMockRecorder) ClientGetRetrievalUpdates(arg0 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientGetRetrievalUpdates", reflect.TypeOf((*MockFullNode)(nil).ClientGetRetrievalUpdates), arg0) -} - -// ClientHasLocal mocks base method. -func (m *MockFullNode) ClientHasLocal(arg0 context.Context, arg1 cid.Cid) (bool, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ClientHasLocal", arg0, arg1) - ret0, _ := ret[0].(bool) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// ClientHasLocal indicates an expected call of ClientHasLocal. -func (mr *MockFullNodeMockRecorder) ClientHasLocal(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientHasLocal", reflect.TypeOf((*MockFullNode)(nil).ClientHasLocal), arg0, arg1) -} - -// ClientImport mocks base method. -func (m *MockFullNode) ClientImport(arg0 context.Context, arg1 api.FileRef) (*api.ImportRes, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ClientImport", arg0, arg1) - ret0, _ := ret[0].(*api.ImportRes) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// ClientImport indicates an expected call of ClientImport. -func (mr *MockFullNodeMockRecorder) ClientImport(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientImport", reflect.TypeOf((*MockFullNode)(nil).ClientImport), arg0, arg1) -} - -// ClientListDataTransfers mocks base method. -func (m *MockFullNode) ClientListDataTransfers(arg0 context.Context) ([]api.DataTransferChannel, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ClientListDataTransfers", arg0) - ret0, _ := ret[0].([]api.DataTransferChannel) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// ClientListDataTransfers indicates an expected call of ClientListDataTransfers. -func (mr *MockFullNodeMockRecorder) ClientListDataTransfers(arg0 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientListDataTransfers", reflect.TypeOf((*MockFullNode)(nil).ClientListDataTransfers), arg0) -} - -// ClientListDeals mocks base method. -func (m *MockFullNode) ClientListDeals(arg0 context.Context) ([]api.DealInfo, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ClientListDeals", arg0) - ret0, _ := ret[0].([]api.DealInfo) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// ClientListDeals indicates an expected call of ClientListDeals. -func (mr *MockFullNodeMockRecorder) ClientListDeals(arg0 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientListDeals", reflect.TypeOf((*MockFullNode)(nil).ClientListDeals), arg0) -} - -// ClientListImports mocks base method. -func (m *MockFullNode) ClientListImports(arg0 context.Context) ([]api.Import, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ClientListImports", arg0) - ret0, _ := ret[0].([]api.Import) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// ClientListImports indicates an expected call of ClientListImports. -func (mr *MockFullNodeMockRecorder) ClientListImports(arg0 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientListImports", reflect.TypeOf((*MockFullNode)(nil).ClientListImports), arg0) -} - -// ClientListRetrievals mocks base method. -func (m *MockFullNode) ClientListRetrievals(arg0 context.Context) ([]api.RetrievalInfo, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ClientListRetrievals", arg0) - ret0, _ := ret[0].([]api.RetrievalInfo) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// ClientListRetrievals indicates an expected call of ClientListRetrievals. -func (mr *MockFullNodeMockRecorder) ClientListRetrievals(arg0 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientListRetrievals", reflect.TypeOf((*MockFullNode)(nil).ClientListRetrievals), arg0) -} - -// ClientMinerQueryOffer mocks base method. -func (m *MockFullNode) ClientMinerQueryOffer(arg0 context.Context, arg1 address.Address, arg2 cid.Cid, arg3 *cid.Cid) (api.QueryOffer, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ClientMinerQueryOffer", arg0, arg1, arg2, arg3) - ret0, _ := ret[0].(api.QueryOffer) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// ClientMinerQueryOffer indicates an expected call of ClientMinerQueryOffer. -func (mr *MockFullNodeMockRecorder) ClientMinerQueryOffer(arg0, arg1, arg2, arg3 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientMinerQueryOffer", reflect.TypeOf((*MockFullNode)(nil).ClientMinerQueryOffer), arg0, arg1, arg2, arg3) -} - -// ClientQueryAsk mocks base method. -func (m *MockFullNode) ClientQueryAsk(arg0 context.Context, arg1 peer.ID, arg2 address.Address) (*storagemarket.StorageAsk, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ClientQueryAsk", arg0, arg1, arg2) - ret0, _ := ret[0].(*storagemarket.StorageAsk) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// ClientQueryAsk indicates an expected call of ClientQueryAsk. -func (mr *MockFullNodeMockRecorder) ClientQueryAsk(arg0, arg1, arg2 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientQueryAsk", reflect.TypeOf((*MockFullNode)(nil).ClientQueryAsk), arg0, arg1, arg2) -} - -// ClientRemoveImport mocks base method. -func (m *MockFullNode) ClientRemoveImport(arg0 context.Context, arg1 imports.ID) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ClientRemoveImport", arg0, arg1) - ret0, _ := ret[0].(error) - return ret0 -} - -// ClientRemoveImport indicates an expected call of ClientRemoveImport. -func (mr *MockFullNodeMockRecorder) ClientRemoveImport(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientRemoveImport", reflect.TypeOf((*MockFullNode)(nil).ClientRemoveImport), arg0, arg1) -} - -// ClientRestartDataTransfer mocks base method. -func (m *MockFullNode) ClientRestartDataTransfer(arg0 context.Context, arg1 datatransfer.TransferID, arg2 peer.ID, arg3 bool) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ClientRestartDataTransfer", arg0, arg1, arg2, arg3) - ret0, _ := ret[0].(error) - return ret0 -} - -// ClientRestartDataTransfer indicates an expected call of ClientRestartDataTransfer. -func (mr *MockFullNodeMockRecorder) ClientRestartDataTransfer(arg0, arg1, arg2, arg3 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientRestartDataTransfer", reflect.TypeOf((*MockFullNode)(nil).ClientRestartDataTransfer), arg0, arg1, arg2, arg3) -} - -// ClientRetrieve mocks base method. -func (m *MockFullNode) ClientRetrieve(arg0 context.Context, arg1 v0api.RetrievalOrder, arg2 *api.FileRef) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ClientRetrieve", arg0, arg1, arg2) - ret0, _ := ret[0].(error) - return ret0 -} - -// ClientRetrieve indicates an expected call of ClientRetrieve. -func (mr *MockFullNodeMockRecorder) ClientRetrieve(arg0, arg1, arg2 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientRetrieve", reflect.TypeOf((*MockFullNode)(nil).ClientRetrieve), arg0, arg1, arg2) -} - -// ClientRetrieveTryRestartInsufficientFunds mocks base method. -func (m *MockFullNode) ClientRetrieveTryRestartInsufficientFunds(arg0 context.Context, arg1 address.Address) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ClientRetrieveTryRestartInsufficientFunds", arg0, arg1) - ret0, _ := ret[0].(error) - return ret0 -} - -// ClientRetrieveTryRestartInsufficientFunds indicates an expected call of ClientRetrieveTryRestartInsufficientFunds. -func (mr *MockFullNodeMockRecorder) ClientRetrieveTryRestartInsufficientFunds(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientRetrieveTryRestartInsufficientFunds", reflect.TypeOf((*MockFullNode)(nil).ClientRetrieveTryRestartInsufficientFunds), arg0, arg1) -} - -// ClientRetrieveWithEvents mocks base method. -func (m *MockFullNode) ClientRetrieveWithEvents(arg0 context.Context, arg1 v0api.RetrievalOrder, arg2 *api.FileRef) (<-chan marketevents.RetrievalEvent, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ClientRetrieveWithEvents", arg0, arg1, arg2) - ret0, _ := ret[0].(<-chan marketevents.RetrievalEvent) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// ClientRetrieveWithEvents indicates an expected call of ClientRetrieveWithEvents. -func (mr *MockFullNodeMockRecorder) ClientRetrieveWithEvents(arg0, arg1, arg2 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientRetrieveWithEvents", reflect.TypeOf((*MockFullNode)(nil).ClientRetrieveWithEvents), arg0, arg1, arg2) -} - -// ClientStartDeal mocks base method. -func (m *MockFullNode) ClientStartDeal(arg0 context.Context, arg1 *api.StartDealParams) (*cid.Cid, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ClientStartDeal", arg0, arg1) - ret0, _ := ret[0].(*cid.Cid) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// ClientStartDeal indicates an expected call of ClientStartDeal. -func (mr *MockFullNodeMockRecorder) ClientStartDeal(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientStartDeal", reflect.TypeOf((*MockFullNode)(nil).ClientStartDeal), arg0, arg1) -} - -// ClientStatelessDeal mocks base method. -func (m *MockFullNode) ClientStatelessDeal(arg0 context.Context, arg1 *api.StartDealParams) (*cid.Cid, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ClientStatelessDeal", arg0, arg1) - ret0, _ := ret[0].(*cid.Cid) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// ClientStatelessDeal indicates an expected call of ClientStatelessDeal. -func (mr *MockFullNodeMockRecorder) ClientStatelessDeal(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClientStatelessDeal", reflect.TypeOf((*MockFullNode)(nil).ClientStatelessDeal), arg0, arg1) -} - // Closing mocks base method. func (m *MockFullNode) Closing(arg0 context.Context) (<-chan struct{}, error) { m.ctrl.T.Helper() diff --git a/api/v0api/v1_wrapper.go b/api/v0api/v1_wrapper.go index 265674e718f..97b8ff597d2 100644 --- a/api/v0api/v1_wrapper.go +++ b/api/v0api/v1_wrapper.go @@ -4,21 +4,16 @@ import ( "context" "github.com/ipfs/go-cid" - "github.com/libp2p/go-libp2p/core/peer" "golang.org/x/xerrors" "github.com/filecoin-project/go-address" - "github.com/filecoin-project/go-fil-markets/retrievalmarket" - "github.com/filecoin-project/go-fil-markets/storagemarket" "github.com/filecoin-project/go-state-types/abi" - "github.com/filecoin-project/go-state-types/big" "github.com/filecoin-project/go-state-types/crypto" "github.com/filecoin-project/lotus/api" "github.com/filecoin-project/lotus/api/v1api" "github.com/filecoin-project/lotus/chain/actors/builtin/miner" "github.com/filecoin-project/lotus/chain/types" - marketevents "github.com/filecoin-project/lotus/markets/loggers" ) type WrapperV1Full struct { @@ -210,158 +205,10 @@ func (w *WrapperV1Full) ChainGetRandomnessFromBeacon(ctx context.Context, tsk ty return w.StateGetRandomnessFromBeacon(ctx, personalization, randEpoch, entropy, tsk) } -func (w *WrapperV1Full) ClientRetrieve(ctx context.Context, order RetrievalOrder, ref *api.FileRef) error { - events := make(chan marketevents.RetrievalEvent) - go w.clientRetrieve(ctx, order, ref, events) - - for { - select { - case evt, ok := <-events: - if !ok { // done successfully - return nil - } - - if evt.Err != "" { - return xerrors.Errorf("retrieval failed: %s", evt.Err) - } - case <-ctx.Done(): - return xerrors.Errorf("retrieval timed out") - } - } -} - -func (w *WrapperV1Full) ClientRetrieveWithEvents(ctx context.Context, order RetrievalOrder, ref *api.FileRef) (<-chan marketevents.RetrievalEvent, error) { - events := make(chan marketevents.RetrievalEvent) - go w.clientRetrieve(ctx, order, ref, events) - return events, nil -} - -func readSubscribeEvents(ctx context.Context, dealID retrievalmarket.DealID, subscribeEvents <-chan api.RetrievalInfo, events chan marketevents.RetrievalEvent) error { - for { - var subscribeEvent api.RetrievalInfo - var evt retrievalmarket.ClientEvent - select { - case <-ctx.Done(): - return xerrors.New("Retrieval Timed Out") - case subscribeEvent = <-subscribeEvents: - if subscribeEvent.ID != dealID { - // we can't check the deal ID ahead of time because: - // 1. We need to subscribe before retrieving. - // 2. We won't know the deal ID until after retrieving. - continue - } - if subscribeEvent.Event != nil { - evt = *subscribeEvent.Event - } - } - - select { - case <-ctx.Done(): - return xerrors.New("Retrieval Timed Out") - case events <- marketevents.RetrievalEvent{ - Event: evt, - Status: subscribeEvent.Status, - BytesReceived: subscribeEvent.BytesReceived, - FundsSpent: subscribeEvent.TotalPaid, - }: - } - - switch subscribeEvent.Status { - case retrievalmarket.DealStatusCompleted: - return nil - case retrievalmarket.DealStatusRejected: - return xerrors.Errorf("Retrieval Proposal Rejected: %s", subscribeEvent.Message) - case - retrievalmarket.DealStatusDealNotFound, - retrievalmarket.DealStatusErrored: - return xerrors.Errorf("Retrieval Error: %s", subscribeEvent.Message) - } - } -} - -func (w *WrapperV1Full) clientRetrieve(ctx context.Context, order RetrievalOrder, ref *api.FileRef, events chan marketevents.RetrievalEvent) { - defer close(events) - - finish := func(e error) { - if e != nil { - events <- marketevents.RetrievalEvent{Err: e.Error(), FundsSpent: big.Zero()} - } - } - - var dealID retrievalmarket.DealID - if order.FromLocalCAR == "" { - // Subscribe to events before retrieving to avoid losing events. - subscribeCtx, cancel := context.WithCancel(ctx) - defer cancel() - retrievalEvents, err := w.ClientGetRetrievalUpdates(subscribeCtx) - - if err != nil { - finish(xerrors.Errorf("GetRetrievalUpdates failed: %w", err)) - return - } - - retrievalRes, err := w.FullNode.ClientRetrieve(ctx, api.RetrievalOrder{ - Root: order.Root, - Piece: order.Piece, - Size: order.Size, - Total: order.Total, - UnsealPrice: order.UnsealPrice, - PaymentInterval: order.PaymentInterval, - PaymentIntervalIncrease: order.PaymentIntervalIncrease, - Client: order.Client, - Miner: order.Miner, - MinerPeer: order.MinerPeer, - }) - - if err != nil { - finish(xerrors.Errorf("Retrieve failed: %w", err)) - return - } - - dealID = retrievalRes.DealID - - err = readSubscribeEvents(ctx, retrievalRes.DealID, retrievalEvents, events) - if err != nil { - finish(xerrors.Errorf("Retrieve: %w", err)) - return - } - } - - // If ref is nil, it only fetches the data into the configured blockstore. - if ref == nil { - finish(nil) - return - } - - eref := api.ExportRef{ - Root: order.Root, - FromLocalCAR: order.FromLocalCAR, - DealID: dealID, - } - - if order.DatamodelPathSelector != nil { - s := api.Selector(*order.DatamodelPathSelector) - eref.DAGs = append(eref.DAGs, api.DagSpec{ - DataSelector: &s, - ExportMerkleProof: true, - }) - } - - finish(w.ClientExport(ctx, eref, *ref)) -} - func (w *WrapperV1Full) PaychGet(ctx context.Context, from, to address.Address, amt types.BigInt) (*api.ChannelInfo, error) { return w.FullNode.PaychFund(ctx, from, to, amt) } -func (w *WrapperV1Full) ClientQueryAsk(ctx context.Context, p peer.ID, miner address.Address) (*storagemarket.StorageAsk, error) { - a, err := w.FullNode.ClientQueryAsk(ctx, p, miner) - if err != nil { - return nil, err - } - return a.Response, nil -} - func (w *WrapperV1Full) BeaconGetEntry(ctx context.Context, epoch abi.ChainEpoch) (*types.BeaconEntry, error) { return w.StateGetBeaconEntry(ctx, epoch) } diff --git a/build/actors/v14.tar.zst b/build/actors/v14.tar.zst index 19b023f1c84..bebaec24203 100644 Binary files a/build/actors/v14.tar.zst and b/build/actors/v14.tar.zst differ diff --git a/build/builtin_actors_gen.go b/build/builtin_actors_gen.go index 8107e1d5405..964de9574ff 100644 --- a/build/builtin_actors_gen.go +++ b/build/builtin_actors_gen.go @@ -6,7 +6,7 @@ import ( "github.com/ipfs/go-cid" ) -var EmbeddedBuiltinActorsMetadata = []*BuiltinActorsMetadata{{ +var EmbeddedBuiltinActorsMetadata []*BuiltinActorsMetadata = []*BuiltinActorsMetadata{{ Network: "butterflynet", Version: 8, @@ -143,25 +143,25 @@ var EmbeddedBuiltinActorsMetadata = []*BuiltinActorsMetadata{{ }, { Network: "butterflynet", Version: 14, - BundleGitTag: "v13.0.0", - ManifestCid: MustParseCid("bafy2bzacec75zk7ufzwx6tg5avls5fxdjx5asaqmd2bfqdvkqrkzoxgyflosu"), + BundleGitTag: "v14.0.0-rvdev", + ManifestCid: MustParseCid("bafy2bzaceatmdsgkloctjl2fzvpzhcd4fd72ynudwybww3w5y7iucx54av2wg"), Actors: map[string]cid.Cid{ - "account": MustParseCid("bafk2bzacedl533kwbzouqxibejpwp6syfdekvmzy4vmmno6j4iaydbdmv4xek"), - "cron": MustParseCid("bafk2bzacecimv5xnuwyoqgxk26qt4xqpgntleret475pnh35s3vvhqtdct4ow"), - "datacap": MustParseCid("bafk2bzacebpdd4ctavhs7wkcykfahpifct3p4hbptgtf4jfrqcp2trtlygvow"), - "eam": MustParseCid("bafk2bzaceahw5rrgj7prgbnmn237di7ymjz2ssea32wr525jydpfrwpuhs67m"), - "ethaccount": MustParseCid("bafk2bzacebrslcbew5mq3le2zsn36xqxd4gt5hryeoslxnuqwgw3rhuwh6ygu"), - "evm": MustParseCid("bafk2bzaced5smz4lhpem4mbr7igcskv3e5qopbdp7dqshww2qs4ahacgzjzo4"), - "init": MustParseCid("bafk2bzacedgj6hawhdw2ot2ufisci374o2bq6bfkvlvdt6q7s3uoe5ffyv43k"), - "multisig": MustParseCid("bafk2bzacectnnnpwyqiccaymy3h6ghu74ghjrqyhtqv5odfd4opivzebjj6to"), - "paymentchannel": MustParseCid("bafk2bzaceckhx44jawhzhkz6k23gfnv2gcutgb4j4ekhonj2plwaent4b2tpk"), + "account": MustParseCid("bafk2bzaceaf66u5nc4r45hd25mg3ucwn4zqi3i23egyl5vog7b3vy3x4pzcla"), + "cron": MustParseCid("bafk2bzacebhkxg5cwyntqygq2zelhttiwsfvf4is2xb6svw3tjsxtl7xueweq"), + "datacap": MustParseCid("bafk2bzacebrawxvup4cdn4cgpltjvucz72auxmdgjtxk6r3juj7ubznftzzso"), + "eam": MustParseCid("bafk2bzacedmstkcx6keshwhy5jgi7ngnptsewps3ph5tq3qnqo37af2pssgje"), + "ethaccount": MustParseCid("bafk2bzaceanc7o6y3rxi2lpxtfyjrfhwstmqzdz6a55bw2yni434bl7obkxky"), + "evm": MustParseCid("bafk2bzaceb7cqdyr4lczakbmv4fkpj64crg4veny3mnnywdp6jakqkkcm7pmk"), + "init": MustParseCid("bafk2bzaceaaiuo3tzqr6mktwhdu3zk6h7ht4jwdmvwyj7sktw43zssm6htgha"), + "multisig": MustParseCid("bafk2bzacebezynbytievqvgkrjr2bvqtb43rpcwbcscorms4dvrj7x6ebtkus"), + "paymentchannel": MustParseCid("bafk2bzacedmxz3hfqo3vaqqwhtkln2jhpq3jylfggqop56aqiqsntgdit5bk6"), "placeholder": MustParseCid("bafk2bzacedfvut2myeleyq67fljcrw4kkmn5pb5dpyozovj7jpoez5irnc3ro"), - "reward": MustParseCid("bafk2bzacebbs3rlg7y3wbvxrj4wgbsqmasw4ksbbr3lyqbkaxj2t25qz6zzuy"), - "storagemarket": MustParseCid("bafk2bzaced3zmxsmlhp2nsiwkxcp2ugonbsebcd53t7htzo2jcoidvu464xmm"), - "storageminer": MustParseCid("bafk2bzacebedx7iaa2ruspxvghkg46ez7un5b7oiijjtnvddq2aot5wk7p7ry"), - "storagepower": MustParseCid("bafk2bzacebvne7m2l3hxxw4xa6oujol75x35yqpnlqiwx74jilyrop4cs7cse"), - "system": MustParseCid("bafk2bzaceacjmlxrvydlud77ilpzbscez46yedx6zjsj6olxsdeuv6d4x4cwe"), - "verifiedregistry": MustParseCid("bafk2bzacebs5muoq7ft2wgqojhjio7a4vltbyprqkmlr43ojlzbil4nwvj3jg"), + "reward": MustParseCid("bafk2bzacea532wkvkky2m4swek2c42352bd7qk6vkdycwj6nr2rml4cpm4ogo"), + "storagemarket": MustParseCid("bafk2bzacea4xuyzcmsuoua24rn7ijjmao42ouct6nkj7khp4ugy23ci57gg64"), + "storageminer": MustParseCid("bafk2bzaceavmpj5dx6ya6vmgxvkd2b3nzqp3mqxhetqdfcanmzoelgvbqnf6o"), + "storagepower": MustParseCid("bafk2bzacedb4o3otapngkms3hwof5h6jjtihxlbcv2reenz6j54bf7wqyidre"), + "system": MustParseCid("bafk2bzacec4mc5silogdy3jfeucvxpod54ogizngysm5drhrcpqqg6ywxylbc"), + "verifiedregistry": MustParseCid("bafk2bzacecxcqom6sabmvxcda4ifa7jcl6ckx74jbh23klsnvv2ucct7owxam"), }, }, { Network: "calibrationnet", @@ -295,25 +295,25 @@ var EmbeddedBuiltinActorsMetadata = []*BuiltinActorsMetadata{{ }, { Network: "calibrationnet", Version: 14, - BundleGitTag: "v13.0.0", - ManifestCid: MustParseCid("bafy2bzacect4ktyujrwp6mjlsitnpvuw2pbuppz6w52sfljyo4agjevzm75qs"), + BundleGitTag: "v14.0.0-rvdev", + ManifestCid: MustParseCid("bafy2bzacecqn3ns2vnd63sv4tazp5gp6cynayfy7l4tobm6m7oruh7ewx2uee"), Actors: map[string]cid.Cid{ - "account": MustParseCid("bafk2bzaceb3j36ri5y5mfklgp5emlvrms6g4733ss2j3l7jismrxq6ng3tcc6"), - "cron": MustParseCid("bafk2bzaceaz6rocamdxehgpwcbku6wlapwpgzyyvkrploj66mlqptsulf52bs"), - "datacap": MustParseCid("bafk2bzacea22nv5g3yngpxvonqfj4r2nkfk64y6yw2malicm7odk77x7zuads"), - "eam": MustParseCid("bafk2bzaceatqtjzj7623i426noaslouvluhz6e3md3vvquqzku5qj3532uaxg"), - "ethaccount": MustParseCid("bafk2bzacean3hs7ga5csw6g3uu7watxfnqv5uvxviebn3ba6vg4sagwdur5pu"), - "evm": MustParseCid("bafk2bzacec5ibmbtzuzjgwjmksm2n6zfq3gkicxqywwu7tsscqgdzajpfctxk"), - "init": MustParseCid("bafk2bzaced5sq72oemz6qwi6yssxwlos2g54zfprslrx5qfhhx2vlgsbvdpcs"), - "multisig": MustParseCid("bafk2bzacedbgei6jkx36fwdgvoohce4aghvpohqdhoco7p4thszgssms7olv2"), - "paymentchannel": MustParseCid("bafk2bzaceasmgmfsi4mjanxlowsub65fmevhzky4toeqbtw4kp6tmu4kxjpgq"), + "account": MustParseCid("bafk2bzacecvlj5zdidukl5afruyjn7x2xkgd7njt76fnr3uayqzz75b5lmdk4"), + "cron": MustParseCid("bafk2bzacecvlwnptggoswh7iu7dpzefxl3k5yjkvzhh3bsvagq7jn3cmrgpqq"), + "datacap": MustParseCid("bafk2bzaced4quueeula7hujnnk26fygxwnxxyhlpvjxuhdowrqzrdfije4v62"), + "eam": MustParseCid("bafk2bzacea6n42g2cp5wjn7mzq27sjs2juehb4cq6nukh3lhpmfu26f5aizhc"), + "ethaccount": MustParseCid("bafk2bzaceafssw3dffuf6yri57ufmqnoah2xwhe2fkfrxs52siiw7rxky4i4e"), + "evm": MustParseCid("bafk2bzacecexlp6qelbcjdr7ayakywwav2m3smdptstrav2axkenw7xzbma26"), + "init": MustParseCid("bafk2bzacecmqqjyyxkryg757a4tyywpfitu4blh5gjus57ahbfmeqe7pkoyaa"), + "multisig": MustParseCid("bafk2bzacedluzbyciapbabcnlxgx2hiyl5djmwerio3fgrmheq2a47iwixium"), + "paymentchannel": MustParseCid("bafk2bzaceaqxiyg3b3rgwtutla2ijlhiqb4yaomoeojtpr35c7tc3apo3gg7c"), "placeholder": MustParseCid("bafk2bzacedfvut2myeleyq67fljcrw4kkmn5pb5dpyozovj7jpoez5irnc3ro"), - "reward": MustParseCid("bafk2bzacedjyp6ll5ez27dfgldjj4tntxfvyp4pa5zkk7s5uhipzqjyx2gmuc"), - "storagemarket": MustParseCid("bafk2bzaceabolct6qdnefwcrtati2us3sxtxfghyqk6aamfhl6byyefmtssqi"), - "storageminer": MustParseCid("bafk2bzaceckzw3v7wqliyggvjvihz4wywchnnsie4frfvkm3fm5znb64mofri"), - "storagepower": MustParseCid("bafk2bzacea7t4wynzjajl442mpdqbnh3wusjusqtnzgpvefvweh4n2tgzgqhu"), - "system": MustParseCid("bafk2bzacedjnrb5glewazsxpcx6rwiuhl4kwrfcqolyprn6rrjtlzmthlhdq6"), - "verifiedregistry": MustParseCid("bafk2bzacebj2zdquagzy2xxn7up574oemg3w7ed3fe4aujkyhgdwj57voesn2"), + "reward": MustParseCid("bafk2bzaceamnd37uf3tkbjgjgvkpnoapgh2x7yuujtytodxxfnc4tgrzszgco"), + "storagemarket": MustParseCid("bafk2bzaceci23j53fhhi5mj5akfwyywrbrehekl4n22hh6xz65dskioideenq"), + "storageminer": MustParseCid("bafk2bzacecbxaci4qhd2rta3fecrtk6vxkqa7vusjlxrph44iyoe42gtidfgw"), + "storagepower": MustParseCid("bafk2bzacedm5pialabsgbyevnr54auyls5grddzdilewxa6h4t4ltsgcqgrto"), + "system": MustParseCid("bafk2bzacedxlwbvb6v7sqtnn53osesvxkvdni2ubgvwrurp3nin6k6uol5zra"), + "verifiedregistry": MustParseCid("bafk2bzacedkoqmyg33kwc5xjmnecug24dlzvrjjzeotat65qs7nxl3xrft4gu"), }, }, { Network: "caterpillarnet", @@ -456,25 +456,25 @@ var EmbeddedBuiltinActorsMetadata = []*BuiltinActorsMetadata{{ }, { Network: "caterpillarnet", Version: 14, - BundleGitTag: "v13.0.0", - ManifestCid: MustParseCid("bafy2bzacedu7kk2zngxp7y3lynhtaht6vgadgn5jzkxe5nuowtwzasnogx63w"), + BundleGitTag: "v14.0.0-rvdev", + ManifestCid: MustParseCid("bafy2bzacecnhwvuesgdyuq2hgy5npvnbisdloduo3c5b24h66fr2owkce3ihk"), Actors: map[string]cid.Cid{ - "account": MustParseCid("bafk2bzacecro3uo6ypqhfzwdhnamzcole5qmhrbkx7qny6t2qsrcpqxelt6s2"), - "cron": MustParseCid("bafk2bzaceam3kci46y4siltbw7f4itoap34kp7b7pvn2fco5s2bvnotomwdbe"), - "datacap": MustParseCid("bafk2bzacecmtdspcbqmmjtsaz4vucuqoqjqfsgxjonns7tom7eblkngbcm7bw"), - "eam": MustParseCid("bafk2bzaceaudqhrt7djewopqdnryvwxagfufyt7ja4gdvovrxbh6edh6evgrw"), - "ethaccount": MustParseCid("bafk2bzaced676ds3z6xe333wr7frwq3f2iq5kjwp4okl3te6rne3xf7kuqrwm"), - "evm": MustParseCid("bafk2bzacebeih4jt2s6mel6x4hje7xmnugh6twul2a5axx4iczu7fu4wcdi6k"), - "init": MustParseCid("bafk2bzaceba7vvuzzwj5wqnq2bvpbgtxup53mhr3qybezbllftnxvpqbfymxo"), - "multisig": MustParseCid("bafk2bzaceapkajhnqoczrgry5javqbl7uebgmsbpqqfemzc4yb5q2dqia2qog"), - "paymentchannel": MustParseCid("bafk2bzacebg7xq4ca22gafmdbkcq357x7v6slflib4h3fnj4amsovg6ulqg3o"), + "account": MustParseCid("bafk2bzacea3w6x6ug2u6nohe3sdhnc2ca2vraupiqscjrbn7zkkmprtweoh6e"), + "cron": MustParseCid("bafk2bzacebc77zjo7rwl2tz7tt6kru43d73a2atfewodih327csyjyiicnmjo"), + "datacap": MustParseCid("bafk2bzacecmm72lenzaeoq3e53fah6jbhbhiciqoz7uchvedxfmh6p2s7e6cq"), + "eam": MustParseCid("bafk2bzacebupjeub5do5vs6zlbsx4khn4c5w4rhzzor7hw4fyvagkr4q5rzqi"), + "ethaccount": MustParseCid("bafk2bzaceathe4ihs3i3sm3epcxpaqz6jtiulnjdhfgxw3odky6ejhdpjmgxy"), + "evm": MustParseCid("bafk2bzacebfgbcj6dglyw74isss27e3v4v6brgpcsydhlb2xkpc35mb67qxb6"), + "init": MustParseCid("bafk2bzacecbiwhczry2uromh23nszgjekldz4i4mnc4zryokps4ckw4wuwtvo"), + "multisig": MustParseCid("bafk2bzacecwj5phcc56m3oqdi4hvxfr6x4aksjm5kswaos2yq4zq26xdgbmmq"), + "paymentchannel": MustParseCid("bafk2bzacedwp544ussiwdpo5qrelsznrq2cqjfihdtizkemh7lv4kkmbu5sps"), "placeholder": MustParseCid("bafk2bzacedfvut2myeleyq67fljcrw4kkmn5pb5dpyozovj7jpoez5irnc3ro"), - "reward": MustParseCid("bafk2bzaceajt4idf26ffnyipybcib55fykjxnek7oszkqzi7lu7mbgijmkgos"), - "storagemarket": MustParseCid("bafk2bzaceadfmay7pyl7osjsdmrireafasnjnoziacljy5ewrcsxpp56kzqbw"), - "storageminer": MustParseCid("bafk2bzaceardbn5a7aq5jxl7efr4btmsbl7txnxm4hrrd3llyhujuc2cr5vcs"), - "storagepower": MustParseCid("bafk2bzacear4563jznjqyseoy42xl6kenyqk6umv6xl3bp5bsjb3hbs6sp6bm"), - "system": MustParseCid("bafk2bzacecc5oavxivfnvirx2g7megpdf6lugooyoc2wijloju247xzjcdezy"), - "verifiedregistry": MustParseCid("bafk2bzacebnkdt42mpf5emypo6iroux3hszfh5yt54v2mmnnura3ketholly4"), + "reward": MustParseCid("bafk2bzacedliecq2e6nv5gf4qauz2ywv47qr32zriquvvwnahkiy5gmnlerdw"), + "storagemarket": MustParseCid("bafk2bzaced2u4v2wkk626wwahha7yt3v4yvm2yjn5hxmscmq7qkwr6i642lmy"), + "storageminer": MustParseCid("bafk2bzacec6rq6jbxmybf2fmnxbk777zatupl4xnlfem2d6co26bcvo4p2ho6"), + "storagepower": MustParseCid("bafk2bzaceblgfmvghbeh6yoee3u4kfkr5wmno7nameyakktou6veswnzycm4k"), + "system": MustParseCid("bafk2bzacebsqjmle7ix7h3mz7gjzqvtvpc32ch2mx4gvzxunrqidf4jjh4kxi"), + "verifiedregistry": MustParseCid("bafk2bzaceduoybwyy2r2opfdt5q5xuvsllmpiolkohjsemko6lm2nobn3ujpw"), }, }, { Network: "devnet", @@ -608,25 +608,25 @@ var EmbeddedBuiltinActorsMetadata = []*BuiltinActorsMetadata{{ }, { Network: "devnet", Version: 14, - BundleGitTag: "v13.0.0", - ManifestCid: MustParseCid("bafy2bzacecn7uxgehrqbcs462ktl2h23u23cmduy2etqj6xrd6tkkja56fna4"), + BundleGitTag: "v14.0.0-rvdev", + ManifestCid: MustParseCid("bafy2bzaceb6g6itnapkslx5cgxivjvrlfz3aii5fehozqjqtccrmisurnqu4o"), Actors: map[string]cid.Cid{ - "account": MustParseCid("bafk2bzacebev3fu5geeehpx577b3kvza4xsmmggmepjj7rlsnr27hpoq27q2i"), - "cron": MustParseCid("bafk2bzacedalzqahtuz2bmnf7uawbcujfhhe5xzv5ys5ufadu6ggs3tcu6lsy"), - "datacap": MustParseCid("bafk2bzaceb7ou2vn7ac4xidespoowq2q5w7ognr7s4ujy3xzzgiishajpe7le"), - "eam": MustParseCid("bafk2bzacedqic2qskattorj4svf6mbto2k76ej3ll3ugsyorqramrg7rpq3by"), - "ethaccount": MustParseCid("bafk2bzaceaoad7iknpywijigv2h3jyvkijff2oxvohzue533v5hby3iix5vdu"), - "evm": MustParseCid("bafk2bzacecjgiw26gagsn6a7tffkrgoor4zfgzfokp76u6cwervtmvjbopmwg"), - "init": MustParseCid("bafk2bzaced2obubqojxggeddr246cpwtyzi6knnq52jsvsc2fs3tuk2kh6dtg"), - "multisig": MustParseCid("bafk2bzacebquruzb6zho45orbdkku624t6w6jt4tudaqzraz4yh3li3jfstpg"), - "paymentchannel": MustParseCid("bafk2bzaceaydrilyxvflsuzr24hmw32qwz6sy4hgls73bhpveydcsqskdgpca"), + "account": MustParseCid("bafk2bzaceb3qxyno6rxt2x3ztmzisxedm4zsjasi7e5t6nnft46sarlmofoeo"), + "cron": MustParseCid("bafk2bzacebplvcwcz3mnetu4wvfafhz53m5acgltg6ccxlyztiabh3zd4msta"), + "datacap": MustParseCid("bafk2bzaceazvaknr6j4cnl4sijsv7vhbvjtvmochuurau5fdtjwmu6o7mbshe"), + "eam": MustParseCid("bafk2bzacecvfmyk6x6qni4baxdfokezc4ydrbis44ov7fjbyyevrilzp6uzlk"), + "ethaccount": MustParseCid("bafk2bzacea6hzdhichghd3zq2s4qzmubqnir6cvfx5nipwyzsi3jkviltyqdc"), + "evm": MustParseCid("bafk2bzaceaafv6jswtjzcyqx6g3xe5iezdipy5xo5odp4vz3ccqbfmglfh3ha"), + "init": MustParseCid("bafk2bzacednkkkvlibfdozkmryneotueysbhewuvxegxjgsyfd2cwnsprx5mu"), + "multisig": MustParseCid("bafk2bzaceaedxfklfmfkqvf6xnxapphlogvjftgzrfli23ihvhuax36awvvf4"), + "paymentchannel": MustParseCid("bafk2bzaceaqrbadlu4avg2ogb4etz2tzu2eze2c2gdarwnx3trzbgea5qanxk"), "placeholder": MustParseCid("bafk2bzacedfvut2myeleyq67fljcrw4kkmn5pb5dpyozovj7jpoez5irnc3ro"), - "reward": MustParseCid("bafk2bzaceb74owpuzdddqoj2tson6ymbyuguqrnqefyiaxqvwm4ygitpabjrq"), - "storagemarket": MustParseCid("bafk2bzaceaw6dslv6pfqha4ynghq2imij5khnnjrie22kmfgtpie3bvxho6jq"), - "storageminer": MustParseCid("bafk2bzacecsputz6xygjfyrvx2d7bxkpp7b5v4icrmpckec7gnbabx2w377qs"), - "storagepower": MustParseCid("bafk2bzaceceyaa5yjwhxvvcqouob4l746zp5nesivr6enhtpimakdtby6kafi"), - "system": MustParseCid("bafk2bzaceaxg6k5vuozxlemfi5hv663m6jcawzu5puboo4znj73i36e3tsovs"), - "verifiedregistry": MustParseCid("bafk2bzacea2czkb4vt2iiiwdb6e57qfwqse4mk2pcyvwjmdl5ojbnla57oh2u"), + "reward": MustParseCid("bafk2bzaceb5mh4dwnvqfft5wk62qpabucwk4z2grmapvapjb7dpkeebuivsgm"), + "storagemarket": MustParseCid("bafk2bzacecbwaj4qotdx4nnbkcnmmfdoe3gvpz6bxlg4maorz76jumc3kdcww"), + "storageminer": MustParseCid("bafk2bzacecc2ak5uaqiqevkmykyggkigep2ovkpg242zi5vpnuualpugcpne6"), + "storagepower": MustParseCid("bafk2bzacecrsneei2mmj4y632djezdfd3oft5gw6j56h5eabjeye6hdxbxxcu"), + "system": MustParseCid("bafk2bzaceac2x6cdzowghykozhho5qss26lzwgpqfati54rzqgzo2qjm7j56a"), + "verifiedregistry": MustParseCid("bafk2bzacebuep2lc3bdajv6kxzpjctgdthppz24a242hukfdgyjjeu62qxrwm"), }, }, { Network: "hyperspace", @@ -783,25 +783,25 @@ var EmbeddedBuiltinActorsMetadata = []*BuiltinActorsMetadata{{ }, { Network: "mainnet", Version: 14, - BundleGitTag: "v13.0.0", - ManifestCid: MustParseCid("bafy2bzacecdhvfmtirtojwhw2tyciu4jkbpsbk5g53oe24br27oy62sn4dc4e"), + BundleGitTag: "v14.0.0-rvdev", + ManifestCid: MustParseCid("bafy2bzacedml6mcjlpm5xuvnueyc56kfwsnlby6wptdizvakv7ma4lmw4ltxk"), Actors: map[string]cid.Cid{ - "account": MustParseCid("bafk2bzacedxnbtlsqdk76fsfmnhyvsblwyfducerwwtp3mqtx2wbrvs5idl52"), - "cron": MustParseCid("bafk2bzacebbopddyn5csb3fsuhh2an4ttd23x6qnwixgohlirj5ahtcudphyc"), - "datacap": MustParseCid("bafk2bzaceah42tfnhd7xnztawgf46gbvc3m2gudoxshlba2ucmmo2vy67t7ci"), - "eam": MustParseCid("bafk2bzaceb23bhvvcjsth7cn7vp3gbaphrutsaz7v6hkls3ogotzs4bnhm4mk"), - "ethaccount": MustParseCid("bafk2bzaceautge6zhuy6jbj3uldwoxwhpywuon6z3xfvmdbzpbdribc6zzmei"), - "evm": MustParseCid("bafk2bzacedq6v2lyuhgywhlllwmudfj2zufzcauxcsvvd34m2ek5xr55mvh2q"), - "init": MustParseCid("bafk2bzacedr4xacm3fts4vilyeiacjr2hpmwzclyzulbdo24lrfxbtau2wbai"), - "multisig": MustParseCid("bafk2bzacecr5zqarfqak42xqcfeulsxlavcltawsx2fvc7zsjtby6ti4b3wqc"), - "paymentchannel": MustParseCid("bafk2bzacebntdhfmyc24e7tm52ggx5tnw4i3hrr3jmllsepv3mibez4hywsa2"), + "account": MustParseCid("bafk2bzacedntv5tsg3wgh23vvzaxbbobxjwky45n4urbjfik457uritqhmgio"), + "cron": MustParseCid("bafk2bzacedd7ms3ghorr4mbl26z5bapyrkaa2elpueobchihvhgqusbkfo7eu"), + "datacap": MustParseCid("bafk2bzacean6srozlyuv62g6ulpgd2rck7iooxcxksa4uiukhyfd6vvbrmbda"), + "eam": MustParseCid("bafk2bzacebesjxxhmaip54kkcbml3iwmgnu6kjk46iwb6rr5dlhkkoh7coupc"), + "ethaccount": MustParseCid("bafk2bzacedkf35y7b6rqm6jvcowkxl2radqwnsn2qlb3u5pl3lv43tujusvxg"), + "evm": MustParseCid("bafk2bzaceaidev6rcmdu22ayb7bpjvmbc7ec6pi7k24wbibqtnnhqooey3y32"), + "init": MustParseCid("bafk2bzaceavqzkoakuemgfjyimshmkhppmulcblemptossjzusskzg5tbqvss"), + "multisig": MustParseCid("bafk2bzacedaw3hybpoxwwkvepi5uz7ucg3bv3fdeqlb5kkxpkmfsl25kdwoum"), + "paymentchannel": MustParseCid("bafk2bzacea56gdox6nog5ilphxoefoq6yjddvi4tmi5lj3gf2orrbymuqjbbu"), "placeholder": MustParseCid("bafk2bzacedfvut2myeleyq67fljcrw4kkmn5pb5dpyozovj7jpoez5irnc3ro"), - "reward": MustParseCid("bafk2bzacedq4q2kwkruu4xm7rkyygumlbw2yt4nimna2ivea4qarvtkohnuwu"), - "storagemarket": MustParseCid("bafk2bzacebjtoltdviyznpj34hh5qp6u257jnnbjole5rhqfixm7ug3epvrfu"), - "storageminer": MustParseCid("bafk2bzacebf4rrqyk7gcfggggul6nfpzay7f2ordnkwm7z2wcf4mq6r7i77t2"), - "storagepower": MustParseCid("bafk2bzacecjy4dkulvxppg3ocbmeixe2wgg6yxoyjxrm4ko2fm3uhpvfvam6e"), - "system": MustParseCid("bafk2bzacecyf523quuq2kdjfdvyty446z2ounmamtgtgeqnr3ynlu5cqrlt6e"), - "verifiedregistry": MustParseCid("bafk2bzacedkxehp7y7iyukbcje3wbpqcvufisos6exatkanyrbotoecdkrbta"), + "reward": MustParseCid("bafk2bzacedkobejpckdprg4qcvgu4snyyiedusfyeamlbma6nhgdilmpq4p4k"), + "storagemarket": MustParseCid("bafk2bzaced2kk2ox7uggaqiq5434s6vjjokdnbsprcuk4n5sts75qhbqhuhq2"), + "storageminer": MustParseCid("bafk2bzacedledu4hyc733nxxx4oxzirc63jtmi3wn3atho3cnc54i2ywgd4go"), + "storagepower": MustParseCid("bafk2bzacedt53rrjeajubboj6kiixyyxsbsurapuxw4eapau5nyqje5w5t35o"), + "system": MustParseCid("bafk2bzaceaeiatolcccdyv7modphzqnhe6ookcapm2mzi34fy5at24kb37rwk"), + "verifiedregistry": MustParseCid("bafk2bzaceafkksj2sili3yi6ywhderpzlmtt4pm2w75iln5tsfrtghpcajzks"), }, }, { Network: "testing", @@ -935,25 +935,25 @@ var EmbeddedBuiltinActorsMetadata = []*BuiltinActorsMetadata{{ }, { Network: "testing", Version: 14, - BundleGitTag: "v13.0.0", - ManifestCid: MustParseCid("bafy2bzacedg47dqxmtgzjch6i42kth72esd7w23gujyd6c6oppg3n6auag5ou"), + BundleGitTag: "v14.0.0-rvdev", + ManifestCid: MustParseCid("bafy2bzaceasoszibhx2uspvtqp2gamuss3y2kxdoj6traczpayvpvo5fk7kgo"), Actors: map[string]cid.Cid{ - "account": MustParseCid("bafk2bzaceb3tncntgeqvzzr5fzhvpsc5ntv3tpqrsh4jst4irfyzpkdyigibc"), - "cron": MustParseCid("bafk2bzacecwwasmhixpgtshczm5cfspwciyawc25mrefknqhlxfrd6m57tqmc"), - "datacap": MustParseCid("bafk2bzaceckj66by6eohjrybazh5cymmovgl5bmikpvzki2q7huwk2fweoef2"), - "eam": MustParseCid("bafk2bzaceafzm65wvnaam3775homn4vzsv7odftn5tkifmn44wd2t6gupy63y"), - "ethaccount": MustParseCid("bafk2bzaced4q7m4mha2dsezhwub3ru64rgimkg52t25ul4gnekax6uq7hbkqu"), - "evm": MustParseCid("bafk2bzaceakpknw5cuizil3552jr5z35rs6ijaignjigciswtok67drhzdss6"), - "init": MustParseCid("bafk2bzacec7mbkemwugyg2p4oy2xgnovykk4dnsu5ym4wkreooujvxfsxbo3i"), - "multisig": MustParseCid("bafk2bzacebmftoql6dcyqf54xznwjg2bfgdsi67spqquwslpvvtvcx6qenhz2"), - "paymentchannel": MustParseCid("bafk2bzaceau57wpiiikea6pu5om4ryyqjrxjzfksfl4reqosnohydzv3pf4qq"), + "account": MustParseCid("bafk2bzacebazbmjqlcczpp67vmpe6ccg2dzorjc6mlxyur77bpgtsoklquj3i"), + "cron": MustParseCid("bafk2bzacedsv32dnewxo6lcse7csga7fi2xou5hhhicqfkouuiewhsqwwof3q"), + "datacap": MustParseCid("bafk2bzacedfj2xqwoldrocy7ihtetay67ivxzvqxzx3tvq76pmkmmpluitdqc"), + "eam": MustParseCid("bafk2bzacecii4fkzymm3hkvvknai74nr7yku2qirbqsteb7ibhltcxrfl4zp2"), + "ethaccount": MustParseCid("bafk2bzacebjj2ermihfnpjauwne5hdpsrynuoluscngqmigz3e77abshhdziy"), + "evm": MustParseCid("bafk2bzacecme7thils6hcv5oywjrleoganqxno4pjweqmregbg3ceypu4a7xg"), + "init": MustParseCid("bafk2bzacebrgdzlxtd2nrd4bkxzqvqpzloitf342fhvvkbqh7smnaciura4ng"), + "multisig": MustParseCid("bafk2bzacedfk2mbtuiyhpq24oifhasrcm7kx3whu5w4qf2znrrcqkmidg75yo"), + "paymentchannel": MustParseCid("bafk2bzacecanl4f5icltty7x2i4aadkjpmca7yagpeggfaiu3j3fetcsdybsk"), "placeholder": MustParseCid("bafk2bzacedfvut2myeleyq67fljcrw4kkmn5pb5dpyozovj7jpoez5irnc3ro"), - "reward": MustParseCid("bafk2bzacecvlcdgbqlk3dyfzkcjrywg2th5bmn7ilijifikulpxr4ffcrw23o"), - "storagemarket": MustParseCid("bafk2bzacecgj53dwqla7eiubs2uiza7cgxkxtefxkfpjontj5jxefl3a4i2nq"), - "storageminer": MustParseCid("bafk2bzaceailclue4dba2edjethfjw6ycufcwsx4qjjmgsh77xcyprmogdjvu"), - "storagepower": MustParseCid("bafk2bzaceaqw6dhdjlqovhk3p4lb4sb25i5d6mhln2ir5m7tj6m4fegkgkinw"), - "system": MustParseCid("bafk2bzaceby6aiiosnrtb5kzlmrvd4k3o27oo3idmbd6llydz2uqibbp23pzq"), - "verifiedregistry": MustParseCid("bafk2bzaceadw6mxuyb6ipaq3fhekk7u5osyyiis3c4wbkvysy2ut6qfsua5zs"), + "reward": MustParseCid("bafk2bzaceabc6t4udhuy36hwa2qtnpwlkqumxcyz23zvn6rq25duh5a5ryoxq"), + "storagemarket": MustParseCid("bafk2bzacedysvci64l7wig6oonf3hlan7mdodulsk2cgavt6j2xjuqagbfvtw"), + "storageminer": MustParseCid("bafk2bzaceazxwttua3z5u2f7l35q7dpzzdgodpib4ubdphl6qn5ftqhxusysu"), + "storagepower": MustParseCid("bafk2bzacebtk6swzkdfhvcbvdkfj5awogrbdqvjkt3gdckaoqxbn56dsdjuko"), + "system": MustParseCid("bafk2bzaceaov7yspfhmj22r5dw4ejwcwnmbfuacqgy4sj4gn2zyqbqh4pe72c"), + "verifiedregistry": MustParseCid("bafk2bzacedmuwxjglpggeglk7hm4wtry2kdqizuctzy3jlyitxtpobzssfvgc"), }, }, { Network: "testing-fake-proofs", @@ -1087,24 +1087,24 @@ var EmbeddedBuiltinActorsMetadata = []*BuiltinActorsMetadata{{ }, { Network: "testing-fake-proofs", Version: 14, - BundleGitTag: "v13.0.0", - ManifestCid: MustParseCid("bafy2bzaceaf7fz33sp2i5ag5xg5ompn3dwppqlbwfacrwuvzaqdbqrtni7m5q"), + BundleGitTag: "v14.0.0-rvdev", + ManifestCid: MustParseCid("bafy2bzaced6nmsg6gcvhp52577ebv5egqoglog4nark67zaopfx5mbvj2bew4"), Actors: map[string]cid.Cid{ - "account": MustParseCid("bafk2bzaceb3tncntgeqvzzr5fzhvpsc5ntv3tpqrsh4jst4irfyzpkdyigibc"), - "cron": MustParseCid("bafk2bzacecwwasmhixpgtshczm5cfspwciyawc25mrefknqhlxfrd6m57tqmc"), - "datacap": MustParseCid("bafk2bzaceckj66by6eohjrybazh5cymmovgl5bmikpvzki2q7huwk2fweoef2"), - "eam": MustParseCid("bafk2bzaceafzm65wvnaam3775homn4vzsv7odftn5tkifmn44wd2t6gupy63y"), - "ethaccount": MustParseCid("bafk2bzaced4q7m4mha2dsezhwub3ru64rgimkg52t25ul4gnekax6uq7hbkqu"), - "evm": MustParseCid("bafk2bzaceakpknw5cuizil3552jr5z35rs6ijaignjigciswtok67drhzdss6"), - "init": MustParseCid("bafk2bzacec7mbkemwugyg2p4oy2xgnovykk4dnsu5ym4wkreooujvxfsxbo3i"), - "multisig": MustParseCid("bafk2bzacedy4vldq4viv6bzzh4fueip3by3axsbgbh655lashddgumknc6pvs"), - "paymentchannel": MustParseCid("bafk2bzaceau57wpiiikea6pu5om4ryyqjrxjzfksfl4reqosnohydzv3pf4qq"), + "account": MustParseCid("bafk2bzacebazbmjqlcczpp67vmpe6ccg2dzorjc6mlxyur77bpgtsoklquj3i"), + "cron": MustParseCid("bafk2bzacedsv32dnewxo6lcse7csga7fi2xou5hhhicqfkouuiewhsqwwof3q"), + "datacap": MustParseCid("bafk2bzacedfj2xqwoldrocy7ihtetay67ivxzvqxzx3tvq76pmkmmpluitdqc"), + "eam": MustParseCid("bafk2bzacecii4fkzymm3hkvvknai74nr7yku2qirbqsteb7ibhltcxrfl4zp2"), + "ethaccount": MustParseCid("bafk2bzacebjj2ermihfnpjauwne5hdpsrynuoluscngqmigz3e77abshhdziy"), + "evm": MustParseCid("bafk2bzacecme7thils6hcv5oywjrleoganqxno4pjweqmregbg3ceypu4a7xg"), + "init": MustParseCid("bafk2bzacebrgdzlxtd2nrd4bkxzqvqpzloitf342fhvvkbqh7smnaciura4ng"), + "multisig": MustParseCid("bafk2bzacecxohetjy6s3ybdhh5alzwvr5y67zriitbeznuccbanac7tnzwsgk"), + "paymentchannel": MustParseCid("bafk2bzacecanl4f5icltty7x2i4aadkjpmca7yagpeggfaiu3j3fetcsdybsk"), "placeholder": MustParseCid("bafk2bzacedfvut2myeleyq67fljcrw4kkmn5pb5dpyozovj7jpoez5irnc3ro"), - "reward": MustParseCid("bafk2bzacecvlcdgbqlk3dyfzkcjrywg2th5bmn7ilijifikulpxr4ffcrw23o"), - "storagemarket": MustParseCid("bafk2bzacecgj53dwqla7eiubs2uiza7cgxkxtefxkfpjontj5jxefl3a4i2nq"), - "storageminer": MustParseCid("bafk2bzaceb6atn3k6yhmskgmc3lgfiwpzpfmaxzacohtnb2hivme2oroycqr6"), - "storagepower": MustParseCid("bafk2bzacedameh56mp2g4y7nprhax5sddbzcmpk5p7l523l45rtn2wjc6ah4e"), - "system": MustParseCid("bafk2bzaceby6aiiosnrtb5kzlmrvd4k3o27oo3idmbd6llydz2uqibbp23pzq"), - "verifiedregistry": MustParseCid("bafk2bzaceadw6mxuyb6ipaq3fhekk7u5osyyiis3c4wbkvysy2ut6qfsua5zs"), + "reward": MustParseCid("bafk2bzaceabc6t4udhuy36hwa2qtnpwlkqumxcyz23zvn6rq25duh5a5ryoxq"), + "storagemarket": MustParseCid("bafk2bzacedysvci64l7wig6oonf3hlan7mdodulsk2cgavt6j2xjuqagbfvtw"), + "storageminer": MustParseCid("bafk2bzacebaj3gghuvkvj2n4r7mpe2odmnd4s7xisih4a32pfkklkvgymyo62"), + "storagepower": MustParseCid("bafk2bzacecaxrjtn2wfnquj2fvoljjl3b4tz4krxmh57yeyn4zfsxvyd6d27a"), + "system": MustParseCid("bafk2bzaceaov7yspfhmj22r5dw4ejwcwnmbfuacqgy4sj4gn2zyqbqh4pe72c"), + "verifiedregistry": MustParseCid("bafk2bzacedmuwxjglpggeglk7hm4wtry2kdqizuctzy3jlyitxtpobzssfvgc"), }, }} diff --git a/build/openrpc/full.json b/build/openrpc/full.json index 8895cfa8c82..6193573d214 100644 --- a/build/openrpc/full.json +++ b/build/openrpc/full.json @@ -37,7 +37,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1655" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1506" } }, { @@ -60,7 +60,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1666" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1517" } }, { @@ -103,7 +103,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1677" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1528" } }, { @@ -214,7 +214,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1699" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1550" } }, { @@ -454,7 +454,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1710" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1561" } }, { @@ -685,7 +685,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1721" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1572" } }, { @@ -784,7 +784,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1732" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1583" } }, { @@ -816,7 +816,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1743" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1594" } }, { @@ -922,7 +922,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1754" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1605" } }, { @@ -1019,7 +1019,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1765" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1616" } }, { @@ -1078,7 +1078,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1776" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1627" } }, { @@ -1171,7 +1171,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1787" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1638" } }, { @@ -1255,7 +1255,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1798" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1649" } }, { @@ -1355,7 +1355,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1809" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1660" } }, { @@ -1411,7 +1411,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1820" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1671" } }, { @@ -1484,7 +1484,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1831" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1682" } }, { @@ -1557,7 +1557,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1842" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1693" } }, { @@ -1604,7 +1604,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1853" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1704" } }, { @@ -1636,7 +1636,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1864" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1715" } }, { @@ -1691,7 +1691,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1875" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1726" } }, { @@ -1743,7 +1743,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1897" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1748" } }, { @@ -1780,7 +1780,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1908" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1759" } }, { @@ -1827,7 +1827,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1919" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1770" } }, { @@ -1874,7 +1874,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1930" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1781" } }, { @@ -1954,7 +1954,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1941" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1792" } }, { @@ -2006,2748 +2006,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1952" - } - }, - { - "name": "Filecoin.ClientCalcCommP", - "description": "```go\nfunc (s *FullNodeStruct) ClientCalcCommP(p0 context.Context, p1 string) (*CommPRet, error) {\n\tif s.Internal.ClientCalcCommP == nil {\n\t\treturn nil, ErrNotSupported\n\t}\n\treturn s.Internal.ClientCalcCommP(p0, p1)\n}\n```", - "summary": "ClientCalcCommP calculates the CommP for a specified file\n", - "paramStructure": "by-position", - "params": [ - { - "name": "p1", - "description": "string", - "summary": "", - "schema": { - "examples": [ - "string value" - ], - "type": [ - "string" - ] - }, - "required": true, - "deprecated": false - } - ], - "result": { - "name": "*CommPRet", - "description": "*CommPRet", - "summary": "", - "schema": { - "examples": [ - { - "Root": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "Size": 1024 - } - ], - "additionalProperties": false, - "properties": { - "Root": { - "title": "Content Identifier", - "type": "string" - }, - "Size": { - "title": "number", - "type": "number" - } - }, - "type": [ - "object" - ] - }, - "required": true, - "deprecated": false - }, - "deprecated": false, - "externalDocs": { - "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1963" - } - }, - { - "name": "Filecoin.ClientCancelDataTransfer", - "description": "```go\nfunc (s *FullNodeStruct) ClientCancelDataTransfer(p0 context.Context, p1 datatransfer.TransferID, p2 peer.ID, p3 bool) error {\n\tif s.Internal.ClientCancelDataTransfer == nil {\n\t\treturn ErrNotSupported\n\t}\n\treturn s.Internal.ClientCancelDataTransfer(p0, p1, p2, p3)\n}\n```", - "summary": "ClientCancelDataTransfer cancels a data transfer with the given transfer ID and other peer\n", - "paramStructure": "by-position", - "params": [ - { - "name": "p1", - "description": "datatransfer.TransferID", - "summary": "", - "schema": { - "title": "number", - "description": "Number is a number", - "examples": [ - 3 - ], - "type": [ - "number" - ] - }, - "required": true, - "deprecated": false - }, - { - "name": "p2", - "description": "peer.ID", - "summary": "", - "schema": { - "examples": [ - "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf" - ], - "type": [ - "string" - ] - }, - "required": true, - "deprecated": false - }, - { - "name": "p3", - "description": "bool", - "summary": "", - "schema": { - "examples": [ - true - ], - "type": [ - "boolean" - ] - }, - "required": true, - "deprecated": false - } - ], - "result": { - "name": "Null", - "description": "Null", - "schema": { - "type": [ - "null" - ] - }, - "required": true, - "deprecated": false - }, - "deprecated": false, - "externalDocs": { - "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1974" - } - }, - { - "name": "Filecoin.ClientCancelRetrievalDeal", - "description": "```go\nfunc (s *FullNodeStruct) ClientCancelRetrievalDeal(p0 context.Context, p1 retrievalmarket.DealID) error {\n\tif s.Internal.ClientCancelRetrievalDeal == nil {\n\t\treturn ErrNotSupported\n\t}\n\treturn s.Internal.ClientCancelRetrievalDeal(p0, p1)\n}\n```", - "summary": "ClientCancelRetrievalDeal cancels an ongoing retrieval deal based on DealID\n", - "paramStructure": "by-position", - "params": [ - { - "name": "p1", - "description": "retrievalmarket.DealID", - "summary": "", - "schema": { - "title": "number", - "description": "Number is a number", - "examples": [ - 5 - ], - "type": [ - "number" - ] - }, - "required": true, - "deprecated": false - } - ], - "result": { - "name": "Null", - "description": "Null", - "schema": { - "type": [ - "null" - ] - }, - "required": true, - "deprecated": false - }, - "deprecated": false, - "externalDocs": { - "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1985" - } - }, - { - "name": "Filecoin.ClientDealPieceCID", - "description": "```go\nfunc (s *FullNodeStruct) ClientDealPieceCID(p0 context.Context, p1 cid.Cid) (DataCIDSize, error) {\n\tif s.Internal.ClientDealPieceCID == nil {\n\t\treturn *new(DataCIDSize), ErrNotSupported\n\t}\n\treturn s.Internal.ClientDealPieceCID(p0, p1)\n}\n```", - "summary": "ClientCalcCommP calculates the CommP and data size of the specified CID\n", - "paramStructure": "by-position", - "params": [ - { - "name": "p1", - "description": "cid.Cid", - "summary": "", - "schema": { - "title": "Content Identifier", - "description": "Cid represents a self-describing content addressed identifier. It is formed by a Version, a Codec (which indicates a multicodec-packed content type) and a Multihash.", - "examples": [ - { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - } - ], - "type": [ - "string" - ] - }, - "required": true, - "deprecated": false - } - ], - "result": { - "name": "DataCIDSize", - "description": "DataCIDSize", - "summary": "", - "schema": { - "examples": [ - { - "PayloadSize": 9, - "PieceSize": 1032, - "PieceCID": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - } - } - ], - "additionalProperties": false, - "properties": { - "PayloadSize": { - "title": "number", - "type": "number" - }, - "PieceCID": { - "title": "Content Identifier", - "type": "string" - }, - "PieceSize": { - "title": "number", - "type": "number" - } - }, - "type": [ - "object" - ] - }, - "required": true, - "deprecated": false - }, - "deprecated": false, - "externalDocs": { - "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2007" - } - }, - { - "name": "Filecoin.ClientDealSize", - "description": "```go\nfunc (s *FullNodeStruct) ClientDealSize(p0 context.Context, p1 cid.Cid) (DataSize, error) {\n\tif s.Internal.ClientDealSize == nil {\n\t\treturn *new(DataSize), ErrNotSupported\n\t}\n\treturn s.Internal.ClientDealSize(p0, p1)\n}\n```", - "summary": "ClientDealSize calculates real deal data size\n", - "paramStructure": "by-position", - "params": [ - { - "name": "p1", - "description": "cid.Cid", - "summary": "", - "schema": { - "title": "Content Identifier", - "description": "Cid represents a self-describing content addressed identifier. It is formed by a Version, a Codec (which indicates a multicodec-packed content type) and a Multihash.", - "examples": [ - { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - } - ], - "type": [ - "string" - ] - }, - "required": true, - "deprecated": false - } - ], - "result": { - "name": "DataSize", - "description": "DataSize", - "summary": "", - "schema": { - "examples": [ - { - "PayloadSize": 9, - "PieceSize": 1032 - } - ], - "additionalProperties": false, - "properties": { - "PayloadSize": { - "title": "number", - "type": "number" - }, - "PieceSize": { - "title": "number", - "type": "number" - } - }, - "type": [ - "object" - ] - }, - "required": true, - "deprecated": false - }, - "deprecated": false, - "externalDocs": { - "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2018" - } - }, - { - "name": "Filecoin.ClientExport", - "description": "```go\nfunc (s *FullNodeStruct) ClientExport(p0 context.Context, p1 ExportRef, p2 FileRef) error {\n\tif s.Internal.ClientExport == nil {\n\t\treturn ErrNotSupported\n\t}\n\treturn s.Internal.ClientExport(p0, p1, p2)\n}\n```", - "summary": "ClientExport exports a file stored in the local filestore to a system file\n", - "paramStructure": "by-position", - "params": [ - { - "name": "p1", - "description": "ExportRef", - "summary": "", - "schema": { - "examples": [ - { - "Root": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "DAGs": [ - { - "DataSelector": "Links/21/Hash/Links/42/Hash", - "ExportMerkleProof": true - } - ], - "FromLocalCAR": "string value", - "DealID": 5 - } - ], - "additionalProperties": false, - "properties": { - "DAGs": { - "items": { - "additionalProperties": false, - "properties": { - "DataSelector": { - "type": "string" - }, - "ExportMerkleProof": { - "type": "boolean" - } - }, - "type": "object" - }, - "type": "array" - }, - "DealID": { - "title": "number", - "type": "number" - }, - "FromLocalCAR": { - "type": "string" - }, - "Root": { - "title": "Content Identifier", - "type": "string" - } - }, - "type": [ - "object" - ] - }, - "required": true, - "deprecated": false - }, - { - "name": "p2", - "description": "FileRef", - "summary": "", - "schema": { - "examples": [ - { - "Path": "string value", - "IsCAR": true - } - ], - "additionalProperties": false, - "properties": { - "IsCAR": { - "type": "boolean" - }, - "Path": { - "type": "string" - } - }, - "type": [ - "object" - ] - }, - "required": true, - "deprecated": false - } - ], - "result": { - "name": "Null", - "description": "Null", - "schema": { - "type": [ - "null" - ] - }, - "required": true, - "deprecated": false - }, - "deprecated": false, - "externalDocs": { - "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2029" - } - }, - { - "name": "Filecoin.ClientFindData", - "description": "```go\nfunc (s *FullNodeStruct) ClientFindData(p0 context.Context, p1 cid.Cid, p2 *cid.Cid) ([]QueryOffer, error) {\n\tif s.Internal.ClientFindData == nil {\n\t\treturn *new([]QueryOffer), ErrNotSupported\n\t}\n\treturn s.Internal.ClientFindData(p0, p1, p2)\n}\n```", - "summary": "ClientFindData identifies peers that have a certain file, and returns QueryOffers (one per peer).\n", - "paramStructure": "by-position", - "params": [ - { - "name": "p1", - "description": "cid.Cid", - "summary": "", - "schema": { - "title": "Content Identifier", - "description": "Cid represents a self-describing content addressed identifier. It is formed by a Version, a Codec (which indicates a multicodec-packed content type) and a Multihash.", - "examples": [ - { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - } - ], - "type": [ - "string" - ] - }, - "required": true, - "deprecated": false - }, - { - "name": "p2", - "description": "*cid.Cid", - "summary": "", - "schema": { - "title": "Content Identifier", - "description": "Cid represents a self-describing content addressed identifier. It is formed by a Version, a Codec (which indicates a multicodec-packed content type) and a Multihash.", - "examples": [ - { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - } - ], - "type": [ - "string" - ] - }, - "required": true, - "deprecated": false - } - ], - "result": { - "name": "[]QueryOffer", - "description": "[]QueryOffer", - "summary": "", - "schema": { - "examples": [ - [ - { - "Err": "string value", - "Root": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "Piece": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "Size": 42, - "MinPrice": "0", - "UnsealPrice": "0", - "PricePerByte": "0", - "PaymentInterval": 42, - "PaymentIntervalIncrease": 42, - "Miner": "f01234", - "MinerPeer": { - "Address": "f01234", - "ID": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "PieceCID": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - } - } - } - ] - ], - "items": [ - { - "additionalProperties": false, - "properties": { - "Err": { - "type": "string" - }, - "MinPrice": { - "additionalProperties": false, - "type": "object" - }, - "Miner": { - "additionalProperties": false, - "type": "object" - }, - "MinerPeer": { - "additionalProperties": false, - "properties": { - "Address": { - "additionalProperties": false, - "type": "object" - }, - "ID": { - "type": "string" - }, - "PieceCID": { - "title": "Content Identifier", - "type": "string" - } - }, - "type": "object" - }, - "PaymentInterval": { - "title": "number", - "type": "number" - }, - "PaymentIntervalIncrease": { - "title": "number", - "type": "number" - }, - "Piece": { - "title": "Content Identifier", - "type": "string" - }, - "PricePerByte": { - "additionalProperties": false, - "type": "object" - }, - "Root": { - "title": "Content Identifier", - "type": "string" - }, - "Size": { - "title": "number", - "type": "number" - }, - "UnsealPrice": { - "additionalProperties": false, - "type": "object" - } - }, - "type": [ - "object" - ] - } - ], - "type": [ - "array" - ] - }, - "required": true, - "deprecated": false - }, - "deprecated": false, - "externalDocs": { - "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2040" - } - }, - { - "name": "Filecoin.ClientGenCar", - "description": "```go\nfunc (s *FullNodeStruct) ClientGenCar(p0 context.Context, p1 FileRef, p2 string) error {\n\tif s.Internal.ClientGenCar == nil {\n\t\treturn ErrNotSupported\n\t}\n\treturn s.Internal.ClientGenCar(p0, p1, p2)\n}\n```", - "summary": "ClientGenCar generates a CAR file for the specified file.\n", - "paramStructure": "by-position", - "params": [ - { - "name": "p1", - "description": "FileRef", - "summary": "", - "schema": { - "examples": [ - { - "Path": "string value", - "IsCAR": true - } - ], - "additionalProperties": false, - "properties": { - "IsCAR": { - "type": "boolean" - }, - "Path": { - "type": "string" - } - }, - "type": [ - "object" - ] - }, - "required": true, - "deprecated": false - }, - { - "name": "p2", - "description": "string", - "summary": "", - "schema": { - "examples": [ - "string value" - ], - "type": [ - "string" - ] - }, - "required": true, - "deprecated": false - } - ], - "result": { - "name": "Null", - "description": "Null", - "schema": { - "type": [ - "null" - ] - }, - "required": true, - "deprecated": false - }, - "deprecated": false, - "externalDocs": { - "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2051" - } - }, - { - "name": "Filecoin.ClientGetDealInfo", - "description": "```go\nfunc (s *FullNodeStruct) ClientGetDealInfo(p0 context.Context, p1 cid.Cid) (*DealInfo, error) {\n\tif s.Internal.ClientGetDealInfo == nil {\n\t\treturn nil, ErrNotSupported\n\t}\n\treturn s.Internal.ClientGetDealInfo(p0, p1)\n}\n```", - "summary": "ClientGetDealInfo returns the latest information about a given deal.\n", - "paramStructure": "by-position", - "params": [ - { - "name": "p1", - "description": "cid.Cid", - "summary": "", - "schema": { - "title": "Content Identifier", - "description": "Cid represents a self-describing content addressed identifier. It is formed by a Version, a Codec (which indicates a multicodec-packed content type) and a Multihash.", - "examples": [ - { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - } - ], - "type": [ - "string" - ] - }, - "required": true, - "deprecated": false - } - ], - "result": { - "name": "*DealInfo", - "description": "*DealInfo", - "summary": "", - "schema": { - "examples": [ - { - "ProposalCid": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "State": 42, - "Message": "string value", - "DealStages": { - "Stages": [ - { - "Name": "string value", - "Description": "string value", - "ExpectedDuration": "string value", - "CreatedTime": "0001-01-01T00:00:00Z", - "UpdatedTime": "0001-01-01T00:00:00Z", - "Logs": [ - { - "Log": "string value", - "UpdatedTime": "0001-01-01T00:00:00Z" - } - ] - } - ] - }, - "Provider": "f01234", - "DataRef": { - "TransferType": "string value", - "Root": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "PieceCid": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "PieceSize": 1024, - "RawBlockSize": 42 - }, - "PieceCID": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "Size": 42, - "PricePerEpoch": "0", - "Duration": 42, - "DealID": 5432, - "CreationTime": "0001-01-01T00:00:00Z", - "Verified": true, - "TransferChannelID": { - "Initiator": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "Responder": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "ID": 3 - }, - "DataTransfer": { - "TransferID": 3, - "Status": 1, - "BaseCID": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "IsInitiator": true, - "IsSender": true, - "Voucher": "string value", - "Message": "string value", - "OtherPeer": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "Transferred": 42, - "Stages": { - "Stages": [ - { - "Name": "string value", - "Description": "string value", - "CreatedTime": "0001-01-01T00:00:00Z", - "UpdatedTime": "0001-01-01T00:00:00Z", - "Logs": [ - { - "Log": "string value", - "UpdatedTime": "0001-01-01T00:00:00Z" - } - ] - } - ] - } - } - } - ], - "additionalProperties": false, - "properties": { - "CreationTime": { - "format": "date-time", - "type": "string" - }, - "DataRef": { - "additionalProperties": false, - "properties": { - "PieceCid": { - "title": "Content Identifier", - "type": "string" - }, - "PieceSize": { - "title": "number", - "type": "number" - }, - "RawBlockSize": { - "title": "number", - "type": "number" - }, - "Root": { - "title": "Content Identifier", - "type": "string" - }, - "TransferType": { - "type": "string" - } - }, - "type": "object" - }, - "DataTransfer": { - "additionalProperties": false, - "properties": { - "BaseCID": { - "title": "Content Identifier", - "type": "string" - }, - "IsInitiator": { - "type": "boolean" - }, - "IsSender": { - "type": "boolean" - }, - "Message": { - "type": "string" - }, - "OtherPeer": { - "type": "string" - }, - "Stages": { - "additionalProperties": false, - "properties": { - "Stages": { - "items": { - "additionalProperties": false, - "properties": { - "CreatedTime": { - "additionalProperties": false, - "type": "object" - }, - "Description": { - "type": "string" - }, - "Logs": { - "items": { - "additionalProperties": false, - "properties": { - "Log": { - "type": "string" - }, - "UpdatedTime": { - "additionalProperties": false, - "type": "object" - } - }, - "type": "object" - }, - "type": "array" - }, - "Name": { - "type": "string" - }, - "UpdatedTime": { - "additionalProperties": false, - "type": "object" - } - }, - "type": "object" - }, - "type": "array" - } - }, - "type": "object" - }, - "Status": { - "title": "number", - "type": "number" - }, - "TransferID": { - "title": "number", - "type": "number" - }, - "Transferred": { - "title": "number", - "type": "number" - }, - "Voucher": { - "type": "string" - } - }, - "type": "object" - }, - "DealID": { - "title": "number", - "type": "number" - }, - "DealStages": { - "additionalProperties": false, - "properties": { - "Stages": { - "items": { - "additionalProperties": false, - "properties": { - "CreatedTime": { - "additionalProperties": false, - "type": "object" - }, - "Description": { - "type": "string" - }, - "ExpectedDuration": { - "type": "string" - }, - "Logs": { - "items": { - "additionalProperties": false, - "properties": { - "Log": { - "type": "string" - }, - "UpdatedTime": { - "additionalProperties": false, - "type": "object" - } - }, - "type": "object" - }, - "type": "array" - }, - "Name": { - "type": "string" - }, - "UpdatedTime": { - "additionalProperties": false, - "type": "object" - } - }, - "type": "object" - }, - "type": "array" - } - }, - "type": "object" - }, - "Duration": { - "title": "number", - "type": "number" - }, - "Message": { - "type": "string" - }, - "PieceCID": { - "title": "Content Identifier", - "type": "string" - }, - "PricePerEpoch": { - "additionalProperties": false, - "type": "object" - }, - "ProposalCid": { - "title": "Content Identifier", - "type": "string" - }, - "Provider": { - "additionalProperties": false, - "type": "object" - }, - "Size": { - "title": "number", - "type": "number" - }, - "State": { - "title": "number", - "type": "number" - }, - "TransferChannelID": { - "additionalProperties": false, - "properties": { - "ID": { - "title": "number", - "type": "number" - }, - "Initiator": { - "type": "string" - }, - "Responder": { - "type": "string" - } - }, - "type": "object" - }, - "Verified": { - "type": "boolean" - } - }, - "type": [ - "object" - ] - }, - "required": true, - "deprecated": false - }, - "deprecated": false, - "externalDocs": { - "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2062" - } - }, - { - "name": "Filecoin.ClientGetDealStatus", - "description": "```go\nfunc (s *FullNodeStruct) ClientGetDealStatus(p0 context.Context, p1 uint64) (string, error) {\n\tif s.Internal.ClientGetDealStatus == nil {\n\t\treturn \"\", ErrNotSupported\n\t}\n\treturn s.Internal.ClientGetDealStatus(p0, p1)\n}\n```", - "summary": "ClientGetDealStatus returns status given a code\n", - "paramStructure": "by-position", - "params": [ - { - "name": "p1", - "description": "uint64", - "summary": "", - "schema": { - "title": "number", - "description": "Number is a number", - "examples": [ - 42 - ], - "type": [ - "number" - ] - }, - "required": true, - "deprecated": false - } - ], - "result": { - "name": "string", - "description": "string", - "summary": "", - "schema": { - "examples": [ - "string value" - ], - "type": [ - "string" - ] - }, - "required": true, - "deprecated": false - }, - "deprecated": false, - "externalDocs": { - "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2073" - } - }, - { - "name": "Filecoin.ClientHasLocal", - "description": "```go\nfunc (s *FullNodeStruct) ClientHasLocal(p0 context.Context, p1 cid.Cid) (bool, error) {\n\tif s.Internal.ClientHasLocal == nil {\n\t\treturn false, ErrNotSupported\n\t}\n\treturn s.Internal.ClientHasLocal(p0, p1)\n}\n```", - "summary": "ClientHasLocal indicates whether a certain CID is locally stored.\n", - "paramStructure": "by-position", - "params": [ - { - "name": "p1", - "description": "cid.Cid", - "summary": "", - "schema": { - "title": "Content Identifier", - "description": "Cid represents a self-describing content addressed identifier. It is formed by a Version, a Codec (which indicates a multicodec-packed content type) and a Multihash.", - "examples": [ - { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - } - ], - "type": [ - "string" - ] - }, - "required": true, - "deprecated": false - } - ], - "result": { - "name": "bool", - "description": "bool", - "summary": "", - "schema": { - "examples": [ - true - ], - "type": [ - "boolean" - ] - }, - "required": true, - "deprecated": false - }, - "deprecated": false, - "externalDocs": { - "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2106" - } - }, - { - "name": "Filecoin.ClientImport", - "description": "```go\nfunc (s *FullNodeStruct) ClientImport(p0 context.Context, p1 FileRef) (*ImportRes, error) {\n\tif s.Internal.ClientImport == nil {\n\t\treturn nil, ErrNotSupported\n\t}\n\treturn s.Internal.ClientImport(p0, p1)\n}\n```", - "summary": "ClientImport imports file under the specified path into filestore.\n", - "paramStructure": "by-position", - "params": [ - { - "name": "p1", - "description": "FileRef", - "summary": "", - "schema": { - "examples": [ - { - "Path": "string value", - "IsCAR": true - } - ], - "additionalProperties": false, - "properties": { - "IsCAR": { - "type": "boolean" - }, - "Path": { - "type": "string" - } - }, - "type": [ - "object" - ] - }, - "required": true, - "deprecated": false - } - ], - "result": { - "name": "*ImportRes", - "description": "*ImportRes", - "summary": "", - "schema": { - "examples": [ - { - "Root": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "ImportID": 50 - } - ], - "additionalProperties": false, - "properties": { - "ImportID": { - "title": "number", - "type": "number" - }, - "Root": { - "title": "Content Identifier", - "type": "string" - } - }, - "type": [ - "object" - ] - }, - "required": true, - "deprecated": false - }, - "deprecated": false, - "externalDocs": { - "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2117" - } - }, - { - "name": "Filecoin.ClientListDataTransfers", - "description": "```go\nfunc (s *FullNodeStruct) ClientListDataTransfers(p0 context.Context) ([]DataTransferChannel, error) {\n\tif s.Internal.ClientListDataTransfers == nil {\n\t\treturn *new([]DataTransferChannel), ErrNotSupported\n\t}\n\treturn s.Internal.ClientListDataTransfers(p0)\n}\n```", - "summary": "ClientListTransfers returns the status of all ongoing transfers of data\n", - "paramStructure": "by-position", - "params": [], - "result": { - "name": "[]DataTransferChannel", - "description": "[]DataTransferChannel", - "summary": "", - "schema": { - "examples": [ - [ - { - "TransferID": 3, - "Status": 1, - "BaseCID": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "IsInitiator": true, - "IsSender": true, - "Voucher": "string value", - "Message": "string value", - "OtherPeer": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "Transferred": 42, - "Stages": { - "Stages": [ - { - "Name": "string value", - "Description": "string value", - "CreatedTime": "0001-01-01T00:00:00Z", - "UpdatedTime": "0001-01-01T00:00:00Z", - "Logs": [ - { - "Log": "string value", - "UpdatedTime": "0001-01-01T00:00:00Z" - } - ] - } - ] - } - } - ] - ], - "items": [ - { - "additionalProperties": false, - "properties": { - "BaseCID": { - "title": "Content Identifier", - "type": "string" - }, - "IsInitiator": { - "type": "boolean" - }, - "IsSender": { - "type": "boolean" - }, - "Message": { - "type": "string" - }, - "OtherPeer": { - "type": "string" - }, - "Stages": { - "additionalProperties": false, - "properties": { - "Stages": { - "items": { - "additionalProperties": false, - "properties": { - "CreatedTime": { - "additionalProperties": false, - "type": "object" - }, - "Description": { - "type": "string" - }, - "Logs": { - "items": { - "additionalProperties": false, - "properties": { - "Log": { - "type": "string" - }, - "UpdatedTime": { - "additionalProperties": false, - "type": "object" - } - }, - "type": "object" - }, - "type": "array" - }, - "Name": { - "type": "string" - }, - "UpdatedTime": { - "additionalProperties": false, - "type": "object" - } - }, - "type": "object" - }, - "type": "array" - } - }, - "type": "object" - }, - "Status": { - "title": "number", - "type": "number" - }, - "TransferID": { - "title": "number", - "type": "number" - }, - "Transferred": { - "title": "number", - "type": "number" - }, - "Voucher": { - "type": "string" - } - }, - "type": [ - "object" - ] - } - ], - "type": [ - "array" - ] - }, - "required": true, - "deprecated": false - }, - "deprecated": false, - "externalDocs": { - "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2128" - } - }, - { - "name": "Filecoin.ClientListDeals", - "description": "```go\nfunc (s *FullNodeStruct) ClientListDeals(p0 context.Context) ([]DealInfo, error) {\n\tif s.Internal.ClientListDeals == nil {\n\t\treturn *new([]DealInfo), ErrNotSupported\n\t}\n\treturn s.Internal.ClientListDeals(p0)\n}\n```", - "summary": "ClientListDeals returns information about the deals made by the local client.\n", - "paramStructure": "by-position", - "params": [], - "result": { - "name": "[]DealInfo", - "description": "[]DealInfo", - "summary": "", - "schema": { - "examples": [ - [ - { - "ProposalCid": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "State": 42, - "Message": "string value", - "DealStages": { - "Stages": [ - { - "Name": "string value", - "Description": "string value", - "ExpectedDuration": "string value", - "CreatedTime": "0001-01-01T00:00:00Z", - "UpdatedTime": "0001-01-01T00:00:00Z", - "Logs": [ - { - "Log": "string value", - "UpdatedTime": "0001-01-01T00:00:00Z" - } - ] - } - ] - }, - "Provider": "f01234", - "DataRef": { - "TransferType": "string value", - "Root": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "PieceCid": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "PieceSize": 1024, - "RawBlockSize": 42 - }, - "PieceCID": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "Size": 42, - "PricePerEpoch": "0", - "Duration": 42, - "DealID": 5432, - "CreationTime": "0001-01-01T00:00:00Z", - "Verified": true, - "TransferChannelID": { - "Initiator": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "Responder": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "ID": 3 - }, - "DataTransfer": { - "TransferID": 3, - "Status": 1, - "BaseCID": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "IsInitiator": true, - "IsSender": true, - "Voucher": "string value", - "Message": "string value", - "OtherPeer": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "Transferred": 42, - "Stages": { - "Stages": [ - { - "Name": "string value", - "Description": "string value", - "CreatedTime": "0001-01-01T00:00:00Z", - "UpdatedTime": "0001-01-01T00:00:00Z", - "Logs": [ - { - "Log": "string value", - "UpdatedTime": "0001-01-01T00:00:00Z" - } - ] - } - ] - } - } - } - ] - ], - "items": [ - { - "additionalProperties": false, - "properties": { - "CreationTime": { - "format": "date-time", - "type": "string" - }, - "DataRef": { - "additionalProperties": false, - "properties": { - "PieceCid": { - "title": "Content Identifier", - "type": "string" - }, - "PieceSize": { - "title": "number", - "type": "number" - }, - "RawBlockSize": { - "title": "number", - "type": "number" - }, - "Root": { - "title": "Content Identifier", - "type": "string" - }, - "TransferType": { - "type": "string" - } - }, - "type": "object" - }, - "DataTransfer": { - "additionalProperties": false, - "properties": { - "BaseCID": { - "title": "Content Identifier", - "type": "string" - }, - "IsInitiator": { - "type": "boolean" - }, - "IsSender": { - "type": "boolean" - }, - "Message": { - "type": "string" - }, - "OtherPeer": { - "type": "string" - }, - "Stages": { - "additionalProperties": false, - "properties": { - "Stages": { - "items": { - "additionalProperties": false, - "properties": { - "CreatedTime": { - "additionalProperties": false, - "type": "object" - }, - "Description": { - "type": "string" - }, - "Logs": { - "items": { - "additionalProperties": false, - "properties": { - "Log": { - "type": "string" - }, - "UpdatedTime": { - "additionalProperties": false, - "type": "object" - } - }, - "type": "object" - }, - "type": "array" - }, - "Name": { - "type": "string" - }, - "UpdatedTime": { - "additionalProperties": false, - "type": "object" - } - }, - "type": "object" - }, - "type": "array" - } - }, - "type": "object" - }, - "Status": { - "title": "number", - "type": "number" - }, - "TransferID": { - "title": "number", - "type": "number" - }, - "Transferred": { - "title": "number", - "type": "number" - }, - "Voucher": { - "type": "string" - } - }, - "type": "object" - }, - "DealID": { - "title": "number", - "type": "number" - }, - "DealStages": { - "additionalProperties": false, - "properties": { - "Stages": { - "items": { - "additionalProperties": false, - "properties": { - "CreatedTime": { - "additionalProperties": false, - "type": "object" - }, - "Description": { - "type": "string" - }, - "ExpectedDuration": { - "type": "string" - }, - "Logs": { - "items": { - "additionalProperties": false, - "properties": { - "Log": { - "type": "string" - }, - "UpdatedTime": { - "additionalProperties": false, - "type": "object" - } - }, - "type": "object" - }, - "type": "array" - }, - "Name": { - "type": "string" - }, - "UpdatedTime": { - "additionalProperties": false, - "type": "object" - } - }, - "type": "object" - }, - "type": "array" - } - }, - "type": "object" - }, - "Duration": { - "title": "number", - "type": "number" - }, - "Message": { - "type": "string" - }, - "PieceCID": { - "title": "Content Identifier", - "type": "string" - }, - "PricePerEpoch": { - "additionalProperties": false, - "type": "object" - }, - "ProposalCid": { - "title": "Content Identifier", - "type": "string" - }, - "Provider": { - "additionalProperties": false, - "type": "object" - }, - "Size": { - "title": "number", - "type": "number" - }, - "State": { - "title": "number", - "type": "number" - }, - "TransferChannelID": { - "additionalProperties": false, - "properties": { - "ID": { - "title": "number", - "type": "number" - }, - "Initiator": { - "type": "string" - }, - "Responder": { - "type": "string" - } - }, - "type": "object" - }, - "Verified": { - "type": "boolean" - } - }, - "type": [ - "object" - ] - } - ], - "type": [ - "array" - ] - }, - "required": true, - "deprecated": false - }, - "deprecated": false, - "externalDocs": { - "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2139" - } - }, - { - "name": "Filecoin.ClientListImports", - "description": "```go\nfunc (s *FullNodeStruct) ClientListImports(p0 context.Context) ([]Import, error) {\n\tif s.Internal.ClientListImports == nil {\n\t\treturn *new([]Import), ErrNotSupported\n\t}\n\treturn s.Internal.ClientListImports(p0)\n}\n```", - "summary": "ClientListImports lists imported files and their root CIDs\n", - "paramStructure": "by-position", - "params": [], - "result": { - "name": "[]Import", - "description": "[]Import", - "summary": "", - "schema": { - "examples": [ - [ - { - "Key": 50, - "Err": "string value", - "Root": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "Source": "string value", - "FilePath": "string value", - "CARPath": "string value" - } - ] - ], - "items": [ - { - "additionalProperties": false, - "properties": { - "CARPath": { - "type": "string" - }, - "Err": { - "type": "string" - }, - "FilePath": { - "type": "string" - }, - "Key": { - "title": "number", - "type": "number" - }, - "Root": { - "title": "Content Identifier", - "type": "string" - }, - "Source": { - "type": "string" - } - }, - "type": [ - "object" - ] - } - ], - "type": [ - "array" - ] - }, - "required": true, - "deprecated": false - }, - "deprecated": false, - "externalDocs": { - "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2150" - } - }, - { - "name": "Filecoin.ClientListRetrievals", - "description": "```go\nfunc (s *FullNodeStruct) ClientListRetrievals(p0 context.Context) ([]RetrievalInfo, error) {\n\tif s.Internal.ClientListRetrievals == nil {\n\t\treturn *new([]RetrievalInfo), ErrNotSupported\n\t}\n\treturn s.Internal.ClientListRetrievals(p0)\n}\n```", - "summary": "ClientListRetrievals returns information about retrievals made by the local client\n", - "paramStructure": "by-position", - "params": [], - "result": { - "name": "[]RetrievalInfo", - "description": "[]RetrievalInfo", - "summary": "", - "schema": { - "examples": [ - [ - { - "PayloadCID": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "ID": 5, - "PieceCID": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "PricePerByte": "0", - "UnsealPrice": "0", - "Status": 0, - "Message": "string value", - "Provider": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "BytesReceived": 42, - "BytesPaidFor": 42, - "TotalPaid": "0", - "TransferChannelID": { - "Initiator": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "Responder": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "ID": 3 - }, - "DataTransfer": { - "TransferID": 3, - "Status": 1, - "BaseCID": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "IsInitiator": true, - "IsSender": true, - "Voucher": "string value", - "Message": "string value", - "OtherPeer": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "Transferred": 42, - "Stages": { - "Stages": [ - { - "Name": "string value", - "Description": "string value", - "CreatedTime": "0001-01-01T00:00:00Z", - "UpdatedTime": "0001-01-01T00:00:00Z", - "Logs": [ - { - "Log": "string value", - "UpdatedTime": "0001-01-01T00:00:00Z" - } - ] - } - ] - } - }, - "Event": 5 - } - ] - ], - "items": [ - { - "additionalProperties": false, - "properties": { - "BytesPaidFor": { - "title": "number", - "type": "number" - }, - "BytesReceived": { - "title": "number", - "type": "number" - }, - "DataTransfer": { - "additionalProperties": false, - "properties": { - "BaseCID": { - "title": "Content Identifier", - "type": "string" - }, - "IsInitiator": { - "type": "boolean" - }, - "IsSender": { - "type": "boolean" - }, - "Message": { - "type": "string" - }, - "OtherPeer": { - "type": "string" - }, - "Stages": { - "additionalProperties": false, - "properties": { - "Stages": { - "items": { - "additionalProperties": false, - "properties": { - "CreatedTime": { - "additionalProperties": false, - "type": "object" - }, - "Description": { - "type": "string" - }, - "Logs": { - "items": { - "additionalProperties": false, - "properties": { - "Log": { - "type": "string" - }, - "UpdatedTime": { - "additionalProperties": false, - "type": "object" - } - }, - "type": "object" - }, - "type": "array" - }, - "Name": { - "type": "string" - }, - "UpdatedTime": { - "additionalProperties": false, - "type": "object" - } - }, - "type": "object" - }, - "type": "array" - } - }, - "type": "object" - }, - "Status": { - "title": "number", - "type": "number" - }, - "TransferID": { - "title": "number", - "type": "number" - }, - "Transferred": { - "title": "number", - "type": "number" - }, - "Voucher": { - "type": "string" - } - }, - "type": "object" - }, - "Event": { - "title": "number", - "type": "number" - }, - "ID": { - "title": "number", - "type": "number" - }, - "Message": { - "type": "string" - }, - "PayloadCID": { - "title": "Content Identifier", - "type": "string" - }, - "PieceCID": { - "title": "Content Identifier", - "type": "string" - }, - "PricePerByte": { - "additionalProperties": false, - "type": "object" - }, - "Provider": { - "type": "string" - }, - "Status": { - "title": "number", - "type": "number" - }, - "TotalPaid": { - "additionalProperties": false, - "type": "object" - }, - "TransferChannelID": { - "additionalProperties": false, - "properties": { - "ID": { - "title": "number", - "type": "number" - }, - "Initiator": { - "type": "string" - }, - "Responder": { - "type": "string" - } - }, - "type": "object" - }, - "UnsealPrice": { - "additionalProperties": false, - "type": "object" - } - }, - "type": [ - "object" - ] - } - ], - "type": [ - "array" - ] - }, - "required": true, - "deprecated": false - }, - "deprecated": false, - "externalDocs": { - "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2161" - } - }, - { - "name": "Filecoin.ClientMinerQueryOffer", - "description": "```go\nfunc (s *FullNodeStruct) ClientMinerQueryOffer(p0 context.Context, p1 address.Address, p2 cid.Cid, p3 *cid.Cid) (QueryOffer, error) {\n\tif s.Internal.ClientMinerQueryOffer == nil {\n\t\treturn *new(QueryOffer), ErrNotSupported\n\t}\n\treturn s.Internal.ClientMinerQueryOffer(p0, p1, p2, p3)\n}\n```", - "summary": "ClientMinerQueryOffer returns a QueryOffer for the specific miner and file.\n", - "paramStructure": "by-position", - "params": [ - { - "name": "p1", - "description": "address.Address", - "summary": "", - "schema": { - "examples": [ - "f01234" - ], - "additionalProperties": false, - "type": [ - "object" - ] - }, - "required": true, - "deprecated": false - }, - { - "name": "p2", - "description": "cid.Cid", - "summary": "", - "schema": { - "title": "Content Identifier", - "description": "Cid represents a self-describing content addressed identifier. It is formed by a Version, a Codec (which indicates a multicodec-packed content type) and a Multihash.", - "examples": [ - { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - } - ], - "type": [ - "string" - ] - }, - "required": true, - "deprecated": false - }, - { - "name": "p3", - "description": "*cid.Cid", - "summary": "", - "schema": { - "title": "Content Identifier", - "description": "Cid represents a self-describing content addressed identifier. It is formed by a Version, a Codec (which indicates a multicodec-packed content type) and a Multihash.", - "examples": [ - { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - } - ], - "type": [ - "string" - ] - }, - "required": true, - "deprecated": false - } - ], - "result": { - "name": "QueryOffer", - "description": "QueryOffer", - "summary": "", - "schema": { - "examples": [ - { - "Err": "string value", - "Root": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "Piece": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "Size": 42, - "MinPrice": "0", - "UnsealPrice": "0", - "PricePerByte": "0", - "PaymentInterval": 42, - "PaymentIntervalIncrease": 42, - "Miner": "f01234", - "MinerPeer": { - "Address": "f01234", - "ID": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "PieceCID": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - } - } - } - ], - "additionalProperties": false, - "properties": { - "Err": { - "type": "string" - }, - "MinPrice": { - "additionalProperties": false, - "type": "object" - }, - "Miner": { - "additionalProperties": false, - "type": "object" - }, - "MinerPeer": { - "additionalProperties": false, - "properties": { - "Address": { - "additionalProperties": false, - "type": "object" - }, - "ID": { - "type": "string" - }, - "PieceCID": { - "title": "Content Identifier", - "type": "string" - } - }, - "type": "object" - }, - "PaymentInterval": { - "title": "number", - "type": "number" - }, - "PaymentIntervalIncrease": { - "title": "number", - "type": "number" - }, - "Piece": { - "title": "Content Identifier", - "type": "string" - }, - "PricePerByte": { - "additionalProperties": false, - "type": "object" - }, - "Root": { - "title": "Content Identifier", - "type": "string" - }, - "Size": { - "title": "number", - "type": "number" - }, - "UnsealPrice": { - "additionalProperties": false, - "type": "object" - } - }, - "type": [ - "object" - ] - }, - "required": true, - "deprecated": false - }, - "deprecated": false, - "externalDocs": { - "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2172" - } - }, - { - "name": "Filecoin.ClientQueryAsk", - "description": "```go\nfunc (s *FullNodeStruct) ClientQueryAsk(p0 context.Context, p1 peer.ID, p2 address.Address) (*StorageAsk, error) {\n\tif s.Internal.ClientQueryAsk == nil {\n\t\treturn nil, ErrNotSupported\n\t}\n\treturn s.Internal.ClientQueryAsk(p0, p1, p2)\n}\n```", - "summary": "ClientQueryAsk returns a signed StorageAsk from the specified miner.\n", - "paramStructure": "by-position", - "params": [ - { - "name": "p1", - "description": "peer.ID", - "summary": "", - "schema": { - "examples": [ - "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf" - ], - "type": [ - "string" - ] - }, - "required": true, - "deprecated": false - }, - { - "name": "p2", - "description": "address.Address", - "summary": "", - "schema": { - "examples": [ - "f01234" - ], - "additionalProperties": false, - "type": [ - "object" - ] - }, - "required": true, - "deprecated": false - } - ], - "result": { - "name": "*StorageAsk", - "description": "*StorageAsk", - "summary": "", - "schema": { - "examples": [ - { - "Response": { - "Price": "0", - "VerifiedPrice": "0", - "MinPieceSize": 1032, - "MaxPieceSize": 1032, - "Miner": "f01234", - "Timestamp": 10101, - "Expiry": 10101, - "SeqNo": 42 - }, - "DealProtocols": [ - "string value" - ] - } - ], - "additionalProperties": false, - "properties": { - "DealProtocols": { - "items": { - "type": "string" - }, - "type": "array" - }, - "Response": {} - }, - "type": [ - "object" - ] - }, - "required": true, - "deprecated": false - }, - "deprecated": false, - "externalDocs": { - "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2183" - } - }, - { - "name": "Filecoin.ClientRemoveImport", - "description": "```go\nfunc (s *FullNodeStruct) ClientRemoveImport(p0 context.Context, p1 imports.ID) error {\n\tif s.Internal.ClientRemoveImport == nil {\n\t\treturn ErrNotSupported\n\t}\n\treturn s.Internal.ClientRemoveImport(p0, p1)\n}\n```", - "summary": "ClientRemoveImport removes file import\n", - "paramStructure": "by-position", - "params": [ - { - "name": "p1", - "description": "imports.ID", - "summary": "", - "schema": { - "title": "number", - "description": "Number is a number", - "examples": [ - 50 - ], - "type": [ - "number" - ] - }, - "required": true, - "deprecated": false - } - ], - "result": { - "name": "Null", - "description": "Null", - "schema": { - "type": [ - "null" - ] - }, - "required": true, - "deprecated": false - }, - "deprecated": false, - "externalDocs": { - "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2194" - } - }, - { - "name": "Filecoin.ClientRestartDataTransfer", - "description": "```go\nfunc (s *FullNodeStruct) ClientRestartDataTransfer(p0 context.Context, p1 datatransfer.TransferID, p2 peer.ID, p3 bool) error {\n\tif s.Internal.ClientRestartDataTransfer == nil {\n\t\treturn ErrNotSupported\n\t}\n\treturn s.Internal.ClientRestartDataTransfer(p0, p1, p2, p3)\n}\n```", - "summary": "ClientRestartDataTransfer attempts to restart a data transfer with the given transfer ID and other peer\n", - "paramStructure": "by-position", - "params": [ - { - "name": "p1", - "description": "datatransfer.TransferID", - "summary": "", - "schema": { - "title": "number", - "description": "Number is a number", - "examples": [ - 3 - ], - "type": [ - "number" - ] - }, - "required": true, - "deprecated": false - }, - { - "name": "p2", - "description": "peer.ID", - "summary": "", - "schema": { - "examples": [ - "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf" - ], - "type": [ - "string" - ] - }, - "required": true, - "deprecated": false - }, - { - "name": "p3", - "description": "bool", - "summary": "", - "schema": { - "examples": [ - true - ], - "type": [ - "boolean" - ] - }, - "required": true, - "deprecated": false - } - ], - "result": { - "name": "Null", - "description": "Null", - "schema": { - "type": [ - "null" - ] - }, - "required": true, - "deprecated": false - }, - "deprecated": false, - "externalDocs": { - "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2205" - } - }, - { - "name": "Filecoin.ClientRetrieve", - "description": "```go\nfunc (s *FullNodeStruct) ClientRetrieve(p0 context.Context, p1 RetrievalOrder) (*RestrievalRes, error) {\n\tif s.Internal.ClientRetrieve == nil {\n\t\treturn nil, ErrNotSupported\n\t}\n\treturn s.Internal.ClientRetrieve(p0, p1)\n}\n```", - "summary": "ClientRetrieve initiates the retrieval of a file, as specified in the order.\n", - "paramStructure": "by-position", - "params": [ - { - "name": "p1", - "description": "RetrievalOrder", - "summary": "", - "schema": { - "examples": [ - { - "Root": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "Piece": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "DataSelector": "Links/21/Hash/Links/42/Hash", - "Size": 42, - "Total": "0", - "UnsealPrice": "0", - "PaymentInterval": 42, - "PaymentIntervalIncrease": 42, - "Client": "f01234", - "Miner": "f01234", - "MinerPeer": { - "Address": "f01234", - "ID": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "PieceCID": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - } - }, - "RemoteStore": "00000000-0000-0000-0000-000000000000" - } - ], - "additionalProperties": false, - "properties": { - "Client": { - "additionalProperties": false, - "type": "object" - }, - "DataSelector": { - "type": "string" - }, - "Miner": { - "additionalProperties": false, - "type": "object" - }, - "MinerPeer": { - "additionalProperties": false, - "properties": { - "Address": { - "additionalProperties": false, - "type": "object" - }, - "ID": { - "type": "string" - }, - "PieceCID": { - "title": "Content Identifier", - "type": "string" - } - }, - "type": "object" - }, - "PaymentInterval": { - "title": "number", - "type": "number" - }, - "PaymentIntervalIncrease": { - "title": "number", - "type": "number" - }, - "Piece": { - "title": "Content Identifier", - "type": "string" - }, - "RemoteStore": { - "items": { - "description": "Number is a number", - "title": "number", - "type": "number" - }, - "maxItems": 16, - "minItems": 16, - "type": "array" - }, - "Root": { - "title": "Content Identifier", - "type": "string" - }, - "Size": { - "title": "number", - "type": "number" - }, - "Total": { - "additionalProperties": false, - "type": "object" - }, - "UnsealPrice": { - "additionalProperties": false, - "type": "object" - } - }, - "type": [ - "object" - ] - }, - "required": true, - "deprecated": false - } - ], - "result": { - "name": "*RestrievalRes", - "description": "*RestrievalRes", - "summary": "", - "schema": { - "examples": [ - { - "DealID": 5 - } - ], - "additionalProperties": false, - "properties": { - "DealID": { - "title": "number", - "type": "number" - } - }, - "type": [ - "object" - ] - }, - "required": true, - "deprecated": false - }, - "deprecated": false, - "externalDocs": { - "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2216" - } - }, - { - "name": "Filecoin.ClientRetrieveTryRestartInsufficientFunds", - "description": "```go\nfunc (s *FullNodeStruct) ClientRetrieveTryRestartInsufficientFunds(p0 context.Context, p1 address.Address) error {\n\tif s.Internal.ClientRetrieveTryRestartInsufficientFunds == nil {\n\t\treturn ErrNotSupported\n\t}\n\treturn s.Internal.ClientRetrieveTryRestartInsufficientFunds(p0, p1)\n}\n```", - "summary": "ClientRetrieveTryRestartInsufficientFunds attempts to restart stalled retrievals on a given payment channel\nwhich are stuck due to insufficient funds\n", - "paramStructure": "by-position", - "params": [ - { - "name": "p1", - "description": "address.Address", - "summary": "", - "schema": { - "examples": [ - "f01234" - ], - "additionalProperties": false, - "type": [ - "object" - ] - }, - "required": true, - "deprecated": false - } - ], - "result": { - "name": "Null", - "description": "Null", - "schema": { - "type": [ - "null" - ] - }, - "required": true, - "deprecated": false - }, - "deprecated": false, - "externalDocs": { - "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2227" - } - }, - { - "name": "Filecoin.ClientRetrieveWait", - "description": "```go\nfunc (s *FullNodeStruct) ClientRetrieveWait(p0 context.Context, p1 retrievalmarket.DealID) error {\n\tif s.Internal.ClientRetrieveWait == nil {\n\t\treturn ErrNotSupported\n\t}\n\treturn s.Internal.ClientRetrieveWait(p0, p1)\n}\n```", - "summary": "ClientRetrieveWait waits for retrieval to be complete\n", - "paramStructure": "by-position", - "params": [ - { - "name": "p1", - "description": "retrievalmarket.DealID", - "summary": "", - "schema": { - "title": "number", - "description": "Number is a number", - "examples": [ - 5 - ], - "type": [ - "number" - ] - }, - "required": true, - "deprecated": false - } - ], - "result": { - "name": "Null", - "description": "Null", - "schema": { - "type": [ - "null" - ] - }, - "required": true, - "deprecated": false - }, - "deprecated": false, - "externalDocs": { - "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2238" - } - }, - { - "name": "Filecoin.ClientStartDeal", - "description": "```go\nfunc (s *FullNodeStruct) ClientStartDeal(p0 context.Context, p1 *StartDealParams) (*cid.Cid, error) {\n\tif s.Internal.ClientStartDeal == nil {\n\t\treturn nil, ErrNotSupported\n\t}\n\treturn s.Internal.ClientStartDeal(p0, p1)\n}\n```", - "summary": "ClientStartDeal proposes a deal with a miner.\n", - "paramStructure": "by-position", - "params": [ - { - "name": "p1", - "description": "*StartDealParams", - "summary": "", - "schema": { - "examples": [ - { - "Data": { - "TransferType": "string value", - "Root": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "PieceCid": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "PieceSize": 1024, - "RawBlockSize": 42 - }, - "Wallet": "f01234", - "Miner": "f01234", - "EpochPrice": "0", - "MinBlocksDuration": 42, - "ProviderCollateral": "0", - "DealStartEpoch": 10101, - "FastRetrieval": true, - "VerifiedDeal": true - } - ], - "additionalProperties": false, - "properties": { - "Data": { - "additionalProperties": false, - "properties": { - "PieceCid": { - "title": "Content Identifier", - "type": "string" - }, - "PieceSize": { - "title": "number", - "type": "number" - }, - "RawBlockSize": { - "title": "number", - "type": "number" - }, - "Root": { - "title": "Content Identifier", - "type": "string" - }, - "TransferType": { - "type": "string" - } - }, - "type": "object" - }, - "DealStartEpoch": { - "title": "number", - "type": "number" - }, - "EpochPrice": { - "additionalProperties": false, - "type": "object" - }, - "FastRetrieval": { - "type": "boolean" - }, - "MinBlocksDuration": { - "title": "number", - "type": "number" - }, - "Miner": { - "additionalProperties": false, - "type": "object" - }, - "ProviderCollateral": { - "additionalProperties": false, - "type": "object" - }, - "VerifiedDeal": { - "type": "boolean" - }, - "Wallet": { - "additionalProperties": false, - "type": "object" - } - }, - "type": [ - "object" - ] - }, - "required": true, - "deprecated": false - } - ], - "result": { - "name": "*cid.Cid", - "description": "*cid.Cid", - "summary": "", - "schema": { - "title": "Content Identifier", - "description": "Cid represents a self-describing content addressed identifier. It is formed by a Version, a Codec (which indicates a multicodec-packed content type) and a Multihash.", - "examples": [ - { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - } - ], - "type": [ - "string" - ] - }, - "required": true, - "deprecated": false - }, - "deprecated": false, - "externalDocs": { - "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2249" - } - }, - { - "name": "Filecoin.ClientStatelessDeal", - "description": "```go\nfunc (s *FullNodeStruct) ClientStatelessDeal(p0 context.Context, p1 *StartDealParams) (*cid.Cid, error) {\n\tif s.Internal.ClientStatelessDeal == nil {\n\t\treturn nil, ErrNotSupported\n\t}\n\treturn s.Internal.ClientStatelessDeal(p0, p1)\n}\n```", - "summary": "ClientStatelessDeal fire-and-forget-proposes an offline deal to a miner without subsequent tracking.\n", - "paramStructure": "by-position", - "params": [ - { - "name": "p1", - "description": "*StartDealParams", - "summary": "", - "schema": { - "examples": [ - { - "Data": { - "TransferType": "string value", - "Root": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "PieceCid": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "PieceSize": 1024, - "RawBlockSize": 42 - }, - "Wallet": "f01234", - "Miner": "f01234", - "EpochPrice": "0", - "MinBlocksDuration": 42, - "ProviderCollateral": "0", - "DealStartEpoch": 10101, - "FastRetrieval": true, - "VerifiedDeal": true - } - ], - "additionalProperties": false, - "properties": { - "Data": { - "additionalProperties": false, - "properties": { - "PieceCid": { - "title": "Content Identifier", - "type": "string" - }, - "PieceSize": { - "title": "number", - "type": "number" - }, - "RawBlockSize": { - "title": "number", - "type": "number" - }, - "Root": { - "title": "Content Identifier", - "type": "string" - }, - "TransferType": { - "type": "string" - } - }, - "type": "object" - }, - "DealStartEpoch": { - "title": "number", - "type": "number" - }, - "EpochPrice": { - "additionalProperties": false, - "type": "object" - }, - "FastRetrieval": { - "type": "boolean" - }, - "MinBlocksDuration": { - "title": "number", - "type": "number" - }, - "Miner": { - "additionalProperties": false, - "type": "object" - }, - "ProviderCollateral": { - "additionalProperties": false, - "type": "object" - }, - "VerifiedDeal": { - "type": "boolean" - }, - "Wallet": { - "additionalProperties": false, - "type": "object" - } - }, - "type": [ - "object" - ] - }, - "required": true, - "deprecated": false - } - ], - "result": { - "name": "*cid.Cid", - "description": "*cid.Cid", - "summary": "", - "schema": { - "title": "Content Identifier", - "description": "Cid represents a self-describing content addressed identifier. It is formed by a Version, a Codec (which indicates a multicodec-packed content type) and a Multihash.", - "examples": [ - { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - } - ], - "type": [ - "string" - ] - }, - "required": true, - "deprecated": false - }, - "deprecated": false, - "externalDocs": { - "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2260" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1803" } }, { @@ -4786,7 +2045,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2271" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1814" } }, { @@ -4833,7 +2092,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2282" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1825" } }, { @@ -4888,7 +2147,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2293" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1836" } }, { @@ -4917,7 +2176,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2304" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1847" } }, { @@ -5054,7 +2313,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2315" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1858" } }, { @@ -5083,7 +2342,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2326" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1869" } }, { @@ -5137,7 +2396,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2337" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1880" } }, { @@ -5228,7 +2487,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2348" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1891" } }, { @@ -5256,7 +2515,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2359" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1902" } }, { @@ -5346,7 +2605,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2370" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1913" } }, { @@ -5602,7 +2861,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2381" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1924" } }, { @@ -5847,7 +3106,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2392" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1935" } }, { @@ -5903,7 +3162,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2403" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1946" } }, { @@ -5950,7 +3209,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2414" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1957" } }, { @@ -6048,7 +3307,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2425" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1968" } }, { @@ -6114,7 +3373,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2436" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1979" } }, { @@ -6180,7 +3439,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2447" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L1990" } }, { @@ -6289,7 +3548,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2458" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2001" } }, { @@ -6347,7 +3606,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2469" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2012" } }, { @@ -6469,7 +3728,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2480" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2023" } }, { @@ -6673,7 +3932,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2491" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2034" } }, { @@ -6868,7 +4127,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2502" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2045" } }, { @@ -7055,7 +4314,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2513" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2056" } }, { @@ -7259,7 +4518,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2524" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2067" } }, { @@ -7350,7 +4609,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2535" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2078" } }, { @@ -7408,7 +4667,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2546" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2089" } }, { @@ -7666,7 +4925,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2557" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2100" } }, { @@ -7941,7 +5200,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2568" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2111" } }, { @@ -7969,7 +5228,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2579" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2122" } }, { @@ -8007,7 +5266,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2590" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2133" } }, { @@ -8115,7 +5374,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2601" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2144" } }, { @@ -8153,7 +5412,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2612" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2155" } }, { @@ -8182,7 +5441,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2623" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2166" } }, { @@ -8245,7 +5504,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2634" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2177" } }, { @@ -8308,7 +5567,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2645" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2188" } }, { @@ -8353,7 +5612,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2656" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2199" } }, { @@ -8475,7 +5734,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2667" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2210" } }, { @@ -8630,7 +5889,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2678" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2221" } }, { @@ -8684,7 +5943,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2689" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2232" } }, { @@ -8738,7 +5997,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2700" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2243" } }, { @@ -8793,7 +6052,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2711" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2254" } }, { @@ -8936,7 +6195,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2722" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2265" } }, { @@ -9063,7 +6322,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2733" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2276" } }, { @@ -9165,7 +6424,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2744" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2287" } }, { @@ -9388,7 +6647,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2755" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2298" } }, { @@ -9571,7 +6830,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2766" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2309" } }, { @@ -9651,7 +6910,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2777" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2320" } }, { @@ -9696,7 +6955,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2788" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2331" } }, { @@ -9752,7 +7011,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2799" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2342" } }, { @@ -9832,7 +7091,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2810" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2353" } }, { @@ -9912,7 +7171,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2821" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2364" } }, { @@ -10397,7 +7656,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2832" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2375" } }, { @@ -10591,7 +7850,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2843" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2386" } }, { @@ -10746,7 +8005,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2854" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2397" } }, { @@ -10995,7 +8254,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2865" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2408" } }, { @@ -11150,7 +8409,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2876" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2419" } }, { @@ -11327,7 +8586,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2887" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2430" } }, { @@ -11425,7 +8684,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2898" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2441" } }, { @@ -11590,7 +8849,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2909" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2452" } }, { @@ -11629,7 +8888,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2920" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2463" } }, { @@ -11694,7 +8953,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2931" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2474" } }, { @@ -11740,7 +8999,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2942" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2485" } }, { @@ -11890,7 +9149,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2953" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2496" } }, { @@ -12027,7 +9286,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2964" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2507" } }, { @@ -12258,7 +9517,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2975" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2518" } }, { @@ -12395,7 +9654,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2986" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2529" } }, { @@ -12560,7 +9819,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2997" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2540" } }, { @@ -12637,7 +9896,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3008" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2551" } }, { @@ -12832,7 +10091,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3030" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2573" } }, { @@ -13011,7 +10270,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3041" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2584" } }, { @@ -13173,7 +10432,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3052" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2595" } }, { @@ -13321,7 +10580,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3063" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2606" } }, { @@ -13549,7 +10808,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3074" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2617" } }, { @@ -13697,7 +10956,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3085" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2628" } }, { @@ -13909,7 +11168,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3096" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2639" } }, { @@ -14115,7 +11374,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3107" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2650" } }, { @@ -14183,7 +11442,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3118" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2661" } }, { @@ -14300,7 +11559,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3129" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2672" } }, { @@ -14391,7 +11650,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3140" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2683" } }, { @@ -14477,7 +11736,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3151" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2694" } }, { @@ -14672,7 +11931,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3162" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2705" } }, { @@ -14834,7 +12093,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3173" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2716" } }, { @@ -15030,7 +12289,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3184" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2727" } }, { @@ -15210,7 +12469,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3195" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2738" } }, { @@ -15373,7 +12632,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3206" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2749" } }, { @@ -15400,7 +12659,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3217" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2760" } }, { @@ -15427,7 +12686,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3228" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2771" } }, { @@ -15526,7 +12785,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3239" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2782" } }, { @@ -15572,7 +12831,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3250" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2793" } }, { @@ -15672,7 +12931,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3261" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2804" } }, { @@ -15788,7 +13047,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3272" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2815" } }, { @@ -15836,7 +13095,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3283" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2826" } }, { @@ -15928,7 +13187,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3294" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2837" } }, { @@ -16043,7 +13302,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3305" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2848" } }, { @@ -16091,7 +13350,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3316" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2859" } }, { @@ -16128,7 +13387,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3327" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2870" } }, { @@ -16400,7 +13659,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3338" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2881" } }, { @@ -16448,7 +13707,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3349" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2892" } }, { @@ -16506,7 +13765,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3360" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2903" } }, { @@ -16711,7 +13970,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3371" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2914" } }, { @@ -16914,7 +14173,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3382" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2925" } }, { @@ -17083,7 +14342,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3393" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2936" } }, { @@ -17287,7 +14546,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3404" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2947" } }, { @@ -17454,7 +14713,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3415" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2958" } }, { @@ -17661,7 +14920,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3426" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2969" } }, { @@ -17729,7 +14988,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3437" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2980" } }, { @@ -17781,7 +15040,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3448" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L2991" } }, { @@ -17830,7 +15089,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3459" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3002" } }, { @@ -17921,7 +15180,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3470" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3013" } }, { @@ -18427,7 +15686,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3481" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3024" } }, { @@ -18533,7 +15792,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3492" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3035" } }, { @@ -18585,7 +15844,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3503" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3046" } }, { @@ -19137,7 +16396,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3514" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3057" } }, { @@ -19251,7 +16510,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3525" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3068" } }, { @@ -19348,7 +16607,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3536" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3079" } }, { @@ -19448,7 +16707,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3547" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3090" } }, { @@ -19536,7 +16795,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3558" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3101" } }, { @@ -19636,7 +16895,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3569" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3112" } }, { @@ -19723,7 +16982,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3580" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3123" } }, { @@ -19814,7 +17073,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3591" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3134" } }, { @@ -19939,7 +17198,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3602" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3145" } }, { @@ -20048,7 +17307,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3613" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3156" } }, { @@ -20118,7 +17377,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3624" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3167" } }, { @@ -20221,7 +17480,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3635" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3178" } }, { @@ -20282,7 +17541,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3646" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3189" } }, { @@ -20412,7 +17671,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3657" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3200" } }, { @@ -20519,7 +17778,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3668" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3211" } }, { @@ -20733,7 +17992,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3679" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3222" } }, { @@ -20810,7 +18069,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3690" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3233" } }, { @@ -20887,7 +18146,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3701" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3244" } }, { @@ -20996,7 +18255,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3712" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3255" } }, { @@ -21105,7 +18364,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3723" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3266" } }, { @@ -21166,7 +18425,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3734" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3277" } }, { @@ -21276,7 +18535,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3745" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3288" } }, { @@ -21337,7 +18596,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3756" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3299" } }, { @@ -21405,7 +18664,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3767" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3310" } }, { @@ -21473,7 +18732,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3778" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3321" } }, { @@ -21554,7 +18813,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3789" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3332" } }, { @@ -21708,7 +18967,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3800" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3343" } }, { @@ -21780,7 +19039,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3811" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3354" } }, { @@ -21944,7 +19203,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3822" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3365" } }, { @@ -22109,7 +19368,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3833" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3376" } }, { @@ -22179,7 +19438,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3844" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3387" } }, { @@ -22247,7 +19506,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3855" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3398" } }, { @@ -22340,7 +19599,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3866" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3409" } }, { @@ -22411,7 +19670,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3877" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3420" } }, { @@ -22612,7 +19871,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3888" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3431" } }, { @@ -22744,7 +20003,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3899" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3442" } }, { @@ -22881,7 +20140,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3910" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3453" } }, { @@ -22992,7 +20251,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3921" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3464" } }, { @@ -23124,7 +20383,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3932" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3475" } }, { @@ -23255,7 +20514,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3943" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3486" } }, { @@ -23326,7 +20585,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3954" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3497" } }, { @@ -23410,7 +20669,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3965" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3508" } }, { @@ -23496,7 +20755,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3976" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3519" } }, { @@ -23679,7 +20938,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3987" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3530" } }, { @@ -23706,7 +20965,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3998" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3541" } }, { @@ -23759,7 +21018,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4009" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3552" } }, { @@ -23847,7 +21106,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4020" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3563" } }, { @@ -24298,7 +21557,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4031" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3574" } }, { @@ -24465,7 +21724,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4042" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3585" } }, { @@ -24563,7 +21822,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4053" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3596" } }, { @@ -24736,7 +21995,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4064" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3607" } }, { @@ -24834,7 +22093,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4075" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3618" } }, { @@ -24985,7 +22244,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4086" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3629" } }, { @@ -25070,7 +22329,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4097" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3640" } }, { @@ -25138,7 +22397,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4108" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3651" } }, { @@ -25190,7 +22449,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4119" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3662" } }, { @@ -25258,7 +22517,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4130" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3673" } }, { @@ -25419,7 +22678,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4141" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3684" } }, { @@ -25466,7 +22725,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4163" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3706" } }, { @@ -25513,7 +22772,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4174" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3717" } }, { @@ -25556,7 +22815,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4196" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3739" } }, { @@ -25652,7 +22911,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4207" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3750" } }, { @@ -25918,7 +23177,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4218" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3761" } }, { @@ -25941,7 +23200,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4229" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3772" } }, { @@ -25984,7 +23243,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4240" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3783" } }, { @@ -26035,7 +23294,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4251" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3794" } }, { @@ -26080,7 +23339,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4262" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3805" } }, { @@ -26108,7 +23367,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4273" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3816" } }, { @@ -26148,7 +23407,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4284" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3827" } }, { @@ -26207,7 +23466,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4295" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3838" } }, { @@ -26251,7 +23510,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4306" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3849" } }, { @@ -26310,7 +23569,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4317" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3860" } }, { @@ -26347,7 +23606,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4328" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3871" } }, { @@ -26391,7 +23650,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4339" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3882" } }, { @@ -26431,7 +23690,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4350" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3893" } }, { @@ -26506,7 +23765,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4361" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3904" } }, { @@ -26714,7 +23973,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4372" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3915" } }, { @@ -26758,7 +24017,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4383" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3926" } }, { @@ -26848,7 +24107,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4394" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3937" } }, { @@ -26875,7 +24134,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4405" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3948" } } ] diff --git a/build/openrpc/gateway.json b/build/openrpc/gateway.json index 6978bb1407f..fbc90bdee03 100644 --- a/build/openrpc/gateway.json +++ b/build/openrpc/gateway.json @@ -242,7 +242,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4416" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3959" } }, { @@ -473,7 +473,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4427" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3970" } }, { @@ -572,7 +572,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4438" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3981" } }, { @@ -604,7 +604,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4449" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L3992" } }, { @@ -710,7 +710,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4460" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4003" } }, { @@ -803,7 +803,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4471" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4014" } }, { @@ -887,7 +887,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4482" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4025" } }, { @@ -987,7 +987,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4493" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4036" } }, { @@ -1043,7 +1043,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4504" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4047" } }, { @@ -1116,7 +1116,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4515" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4058" } }, { @@ -1189,7 +1189,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4526" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4069" } }, { @@ -1236,7 +1236,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4537" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4080" } }, { @@ -1268,7 +1268,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4548" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4091" } }, { @@ -1305,7 +1305,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4570" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4113" } }, { @@ -1352,7 +1352,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4581" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4124" } }, { @@ -1392,7 +1392,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4592" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4135" } }, { @@ -1439,7 +1439,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4603" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4146" } }, { @@ -1494,7 +1494,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4614" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4157" } }, { @@ -1523,7 +1523,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4625" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4168" } }, { @@ -1660,7 +1660,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4636" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4179" } }, { @@ -1689,7 +1689,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4647" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4190" } }, { @@ -1743,7 +1743,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4658" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4201" } }, { @@ -1834,7 +1834,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4669" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4212" } }, { @@ -1862,7 +1862,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4680" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4223" } }, { @@ -1952,7 +1952,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4691" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4234" } }, { @@ -2208,7 +2208,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4702" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4245" } }, { @@ -2453,7 +2453,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4713" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4256" } }, { @@ -2509,7 +2509,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4724" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4267" } }, { @@ -2556,7 +2556,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4735" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4278" } }, { @@ -2654,7 +2654,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4746" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4289" } }, { @@ -2720,7 +2720,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4757" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4300" } }, { @@ -2786,7 +2786,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4768" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4311" } }, { @@ -2895,7 +2895,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4779" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4322" } }, { @@ -2953,7 +2953,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4790" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4333" } }, { @@ -3075,7 +3075,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4801" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4344" } }, { @@ -3262,7 +3262,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4812" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4355" } }, { @@ -3466,7 +3466,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4823" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4366" } }, { @@ -3557,7 +3557,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4834" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4377" } }, { @@ -3615,7 +3615,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4845" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4388" } }, { @@ -3873,7 +3873,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4856" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4399" } }, { @@ -4148,7 +4148,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4867" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4410" } }, { @@ -4176,7 +4176,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4878" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4421" } }, { @@ -4214,7 +4214,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4889" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4432" } }, { @@ -4322,7 +4322,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4900" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4443" } }, { @@ -4360,7 +4360,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4911" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4454" } }, { @@ -4389,7 +4389,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4922" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4465" } }, { @@ -4452,7 +4452,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4933" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4476" } }, { @@ -4515,7 +4515,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4944" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4487" } }, { @@ -4560,7 +4560,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4955" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4498" } }, { @@ -4682,7 +4682,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4966" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4509" } }, { @@ -4837,7 +4837,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4977" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4520" } }, { @@ -4891,7 +4891,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4988" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4531" } }, { @@ -4945,7 +4945,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4999" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4542" } }, { @@ -5000,7 +5000,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5010" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4553" } }, { @@ -5102,7 +5102,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5021" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4564" } }, { @@ -5325,7 +5325,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5032" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4575" } }, { @@ -5508,7 +5508,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5043" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4586" } }, { @@ -5702,7 +5702,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5054" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4597" } }, { @@ -5748,7 +5748,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5065" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4608" } }, { @@ -5898,7 +5898,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5076" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4619" } }, { @@ -6035,7 +6035,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5087" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4630" } }, { @@ -6103,7 +6103,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5098" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4641" } }, { @@ -6220,7 +6220,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5109" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4652" } }, { @@ -6311,7 +6311,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5120" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4663" } }, { @@ -6397,7 +6397,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5131" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4674" } }, { @@ -6424,7 +6424,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5142" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4685" } }, { @@ -6451,7 +6451,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5153" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4696" } }, { @@ -6519,7 +6519,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5164" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4707" } }, { @@ -7025,7 +7025,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5175" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4718" } }, { @@ -7122,7 +7122,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5186" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4729" } }, { @@ -7222,7 +7222,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5197" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4740" } }, { @@ -7322,7 +7322,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5208" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4751" } }, { @@ -7447,7 +7447,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5219" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4762" } }, { @@ -7556,7 +7556,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5230" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4773" } }, { @@ -7659,7 +7659,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5241" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4784" } }, { @@ -7789,7 +7789,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5252" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4795" } }, { @@ -7896,7 +7896,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5263" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4806" } }, { @@ -7957,7 +7957,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5274" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4817" } }, { @@ -8025,7 +8025,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5285" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4828" } }, { @@ -8106,7 +8106,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5296" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4839" } }, { @@ -8270,7 +8270,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5307" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4850" } }, { @@ -8363,7 +8363,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5318" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4861" } }, { @@ -8564,7 +8564,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5329" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4872" } }, { @@ -8675,7 +8675,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5340" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4883" } }, { @@ -8806,7 +8806,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5351" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4894" } }, { @@ -8892,7 +8892,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5362" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4905" } }, { @@ -8919,7 +8919,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5373" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4916" } }, { @@ -8972,7 +8972,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5384" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4927" } }, { @@ -9060,7 +9060,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5395" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4938" } }, { @@ -9511,7 +9511,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5406" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4949" } }, { @@ -9678,7 +9678,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5417" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4960" } }, { @@ -9851,7 +9851,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5428" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4971" } }, { @@ -9919,7 +9919,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5439" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4982" } }, { @@ -9987,7 +9987,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5450" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4993" } }, { @@ -10148,7 +10148,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5461" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5004" } }, { @@ -10193,7 +10193,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5483" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5026" } }, { @@ -10238,7 +10238,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5494" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5037" } }, { @@ -10265,7 +10265,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5505" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5048" } } ] diff --git a/build/openrpc/miner.json b/build/openrpc/miner.json index 5e6ac618fa6..9f9ea316370 100644 --- a/build/openrpc/miner.json +++ b/build/openrpc/miner.json @@ -30,7 +30,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5791" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5334" } }, { @@ -109,7 +109,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5802" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5345" } }, { @@ -155,7 +155,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5813" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5356" } }, { @@ -203,7 +203,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5824" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5367" } }, { @@ -251,7 +251,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5835" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5378" } }, { @@ -354,7 +354,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5846" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5389" } }, { @@ -428,7 +428,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5857" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5400" } }, { @@ -591,7 +591,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5868" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5411" } }, { @@ -742,7 +742,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5879" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5422" } }, { @@ -781,26 +781,44 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5890" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5433" } }, { - "name": "Filecoin.DagstoreGC", - "description": "```go\nfunc (s *StorageMinerStruct) DagstoreGC(p0 context.Context) ([]DagstoreShardResult, error) {\n\tif s.Internal.DagstoreGC == nil {\n\t\treturn *new([]DagstoreShardResult), ErrNotSupported\n\t}\n\treturn s.Internal.DagstoreGC(p0)\n}\n```", - "summary": "DagstoreGC runs garbage collection on the DAG store.\n", + "name": "Filecoin.DealsList", + "description": "```go\nfunc (s *StorageMinerStruct) DealsList(p0 context.Context) ([]*MarketDeal, error) {\n\tif s.Internal.DealsList == nil {\n\t\treturn *new([]*MarketDeal), ErrNotSupported\n\t}\n\treturn s.Internal.DealsList(p0)\n}\n```", + "summary": "", "paramStructure": "by-position", "params": [], "result": { - "name": "[]DagstoreShardResult", - "description": "[]DagstoreShardResult", + "name": "[]*MarketDeal", + "description": "[]*MarketDeal", "summary": "", "schema": { "examples": [ [ { - "Key": "baga6ea4seaqecmtz7iak33dsfshi627abz4i4665dfuzr3qfs4bmad6dx3iigdq", - "Success": false, - "Error": "\u003cerror\u003e" + "Proposal": { + "PieceCID": { + "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" + }, + "PieceSize": 1032, + "VerifiedDeal": true, + "Client": "f01234", + "Provider": "f01234", + "Label": "", + "StartEpoch": 10101, + "EndEpoch": 10101, + "StoragePricePerEpoch": "0", + "ProviderCollateral": "0", + "ClientCollateral": "0" + }, + "State": { + "SectorNumber": 9, + "SectorStartEpoch": 10101, + "LastUpdatedEpoch": 10101, + "SlashEpoch": 10101 + } } ] ], @@ -808,14 +826,76 @@ { "additionalProperties": false, "properties": { - "Error": { - "type": "string" - }, - "Key": { - "type": "string" + "Proposal": { + "additionalProperties": false, + "properties": { + "Client": { + "additionalProperties": false, + "type": "object" + }, + "ClientCollateral": { + "additionalProperties": false, + "type": "object" + }, + "EndEpoch": { + "title": "number", + "type": "number" + }, + "Label": { + "additionalProperties": false, + "type": "object" + }, + "PieceCID": { + "title": "Content Identifier", + "type": "string" + }, + "PieceSize": { + "title": "number", + "type": "number" + }, + "Provider": { + "additionalProperties": false, + "type": "object" + }, + "ProviderCollateral": { + "additionalProperties": false, + "type": "object" + }, + "StartEpoch": { + "title": "number", + "type": "number" + }, + "StoragePricePerEpoch": { + "additionalProperties": false, + "type": "object" + }, + "VerifiedDeal": { + "type": "boolean" + } + }, + "type": "object" }, - "Success": { - "type": "boolean" + "State": { + "additionalProperties": false, + "properties": { + "LastUpdatedEpoch": { + "title": "number", + "type": "number" + }, + "SectorNumber": { + "title": "number", + "type": "number" + }, + "SectorStartEpoch": { + "title": "number", + "type": "number" + }, + "SlashEpoch": { + "title": "number", + "type": "number" + } + }, + "type": "object" } }, "type": [ @@ -833,65 +913,44 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5901" - } - }, - { - "name": "Filecoin.DagstoreInitializeShard", - "description": "```go\nfunc (s *StorageMinerStruct) DagstoreInitializeShard(p0 context.Context, p1 string) error {\n\tif s.Internal.DagstoreInitializeShard == nil {\n\t\treturn ErrNotSupported\n\t}\n\treturn s.Internal.DagstoreInitializeShard(p0, p1)\n}\n```", - "summary": "DagstoreInitializeShard initializes an uninitialized shard.\n\nInitialization consists of fetching the shard's data (deal payload) from\nthe storage subsystem, generating an index, and persisting the index\nto facilitate later retrievals, and/or to publish to external sources.\n\nThis operation is intended to complement the initial migration. The\nmigration registers a shard for every unique piece CID, with lazy\ninitialization. Thus, shards are not initialized immediately to avoid\nIO activity competing with proving. Instead, shard are initialized\nwhen first accessed. This method forces the initialization of a shard by\naccessing it and immediately releasing it. This is useful to warm up the\ncache to facilitate subsequent retrievals, and to generate the indexes\nto publish them externally.\n\nThis operation fails if the shard is not in ShardStateNew state.\nIt blocks until initialization finishes.\n", - "paramStructure": "by-position", - "params": [ - { - "name": "p1", - "description": "string", - "summary": "", - "schema": { - "examples": [ - "string value" - ], - "type": [ - "string" - ] - }, - "required": true, - "deprecated": false - } - ], - "result": { - "name": "Null", - "description": "Null", - "schema": { - "type": [ - "null" - ] - }, - "required": true, - "deprecated": false - }, - "deprecated": false, - "externalDocs": { - "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5923" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5444" } }, { - "name": "Filecoin.DagstoreListShards", - "description": "```go\nfunc (s *StorageMinerStruct) DagstoreListShards(p0 context.Context) ([]DagstoreShardInfo, error) {\n\tif s.Internal.DagstoreListShards == nil {\n\t\treturn *new([]DagstoreShardInfo), ErrNotSupported\n\t}\n\treturn s.Internal.DagstoreListShards(p0)\n}\n```", - "summary": "DagstoreListShards returns information about all shards known to the\nDAG store. Only available on nodes running the markets subsystem.\n", + "name": "Filecoin.MarketListDeals", + "description": "```go\nfunc (s *StorageMinerStruct) MarketListDeals(p0 context.Context) ([]*MarketDeal, error) {\n\tif s.Internal.MarketListDeals == nil {\n\t\treturn *new([]*MarketDeal), ErrNotSupported\n\t}\n\treturn s.Internal.MarketListDeals(p0)\n}\n```", + "summary": "", "paramStructure": "by-position", "params": [], "result": { - "name": "[]DagstoreShardInfo", - "description": "[]DagstoreShardInfo", + "name": "[]*MarketDeal", + "description": "[]*MarketDeal", "summary": "", "schema": { "examples": [ [ { - "Key": "baga6ea4seaqecmtz7iak33dsfshi627abz4i4665dfuzr3qfs4bmad6dx3iigdq", - "State": "ShardStateAvailable", - "Error": "\u003cerror\u003e" + "Proposal": { + "PieceCID": { + "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" + }, + "PieceSize": 1032, + "VerifiedDeal": true, + "Client": "f01234", + "Provider": "f01234", + "Label": "", + "StartEpoch": 10101, + "EndEpoch": 10101, + "StoragePricePerEpoch": "0", + "ProviderCollateral": "0", + "ClientCollateral": "0" + }, + "State": { + "SectorNumber": 9, + "SectorStartEpoch": 10101, + "LastUpdatedEpoch": 10101, + "SlashEpoch": 10101 + } } ] ], @@ -899,14 +958,76 @@ { "additionalProperties": false, "properties": { - "Error": { - "type": "string" - }, - "Key": { - "type": "string" + "Proposal": { + "additionalProperties": false, + "properties": { + "Client": { + "additionalProperties": false, + "type": "object" + }, + "ClientCollateral": { + "additionalProperties": false, + "type": "object" + }, + "EndEpoch": { + "title": "number", + "type": "number" + }, + "Label": { + "additionalProperties": false, + "type": "object" + }, + "PieceCID": { + "title": "Content Identifier", + "type": "string" + }, + "PieceSize": { + "title": "number", + "type": "number" + }, + "Provider": { + "additionalProperties": false, + "type": "object" + }, + "ProviderCollateral": { + "additionalProperties": false, + "type": "object" + }, + "StartEpoch": { + "title": "number", + "type": "number" + }, + "StoragePricePerEpoch": { + "additionalProperties": false, + "type": "object" + }, + "VerifiedDeal": { + "type": "boolean" + } + }, + "type": "object" }, "State": { - "type": "string" + "additionalProperties": false, + "properties": { + "LastUpdatedEpoch": { + "title": "number", + "type": "number" + }, + "SectorNumber": { + "title": "number", + "type": "number" + }, + "SectorStartEpoch": { + "title": "number", + "type": "number" + }, + "SlashEpoch": { + "title": "number", + "type": "number" + } + }, + "type": "object" } }, "type": [ @@ -924,2588 +1045,13 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5934" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5455" } }, { - "name": "Filecoin.DagstoreLookupPieces", - "description": "```go\nfunc (s *StorageMinerStruct) DagstoreLookupPieces(p0 context.Context, p1 cid.Cid) ([]DagstoreShardInfo, error) {\n\tif s.Internal.DagstoreLookupPieces == nil {\n\t\treturn *new([]DagstoreShardInfo), ErrNotSupported\n\t}\n\treturn s.Internal.DagstoreLookupPieces(p0, p1)\n}\n```", - "summary": "DagstoreLookupPieces returns information about shards that contain the given CID.\n", - "paramStructure": "by-position", - "params": [ - { - "name": "p1", - "description": "cid.Cid", - "summary": "", - "schema": { - "title": "Content Identifier", - "description": "Cid represents a self-describing content addressed identifier. It is formed by a Version, a Codec (which indicates a multicodec-packed content type) and a Multihash.", - "examples": [ - { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - } - ], - "type": [ - "string" - ] - }, - "required": true, - "deprecated": false - } - ], - "result": { - "name": "[]DagstoreShardInfo", - "description": "[]DagstoreShardInfo", - "summary": "", - "schema": { - "examples": [ - [ - { - "Key": "baga6ea4seaqecmtz7iak33dsfshi627abz4i4665dfuzr3qfs4bmad6dx3iigdq", - "State": "ShardStateAvailable", - "Error": "\u003cerror\u003e" - } - ] - ], - "items": [ - { - "additionalProperties": false, - "properties": { - "Error": { - "type": "string" - }, - "Key": { - "type": "string" - }, - "State": { - "type": "string" - } - }, - "type": [ - "object" - ] - } - ], - "type": [ - "array" - ] - }, - "required": true, - "deprecated": false - }, - "deprecated": false, - "externalDocs": { - "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5945" - } - }, - { - "name": "Filecoin.DagstoreRecoverShard", - "description": "```go\nfunc (s *StorageMinerStruct) DagstoreRecoverShard(p0 context.Context, p1 string) error {\n\tif s.Internal.DagstoreRecoverShard == nil {\n\t\treturn ErrNotSupported\n\t}\n\treturn s.Internal.DagstoreRecoverShard(p0, p1)\n}\n```", - "summary": "DagstoreRecoverShard attempts to recover a failed shard.\n\nThis operation fails if the shard is not in ShardStateErrored state.\nIt blocks until recovery finishes. If recovery failed, it returns the\nerror.\n", - "paramStructure": "by-position", - "params": [ - { - "name": "p1", - "description": "string", - "summary": "", - "schema": { - "examples": [ - "string value" - ], - "type": [ - "string" - ] - }, - "required": true, - "deprecated": false - } - ], - "result": { - "name": "Null", - "description": "Null", - "schema": { - "type": [ - "null" - ] - }, - "required": true, - "deprecated": false - }, - "deprecated": false, - "externalDocs": { - "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5956" - } - }, - { - "name": "Filecoin.DagstoreRegisterShard", - "description": "```go\nfunc (s *StorageMinerStruct) DagstoreRegisterShard(p0 context.Context, p1 string) error {\n\tif s.Internal.DagstoreRegisterShard == nil {\n\t\treturn ErrNotSupported\n\t}\n\treturn s.Internal.DagstoreRegisterShard(p0, p1)\n}\n```", - "summary": "DagstoreRegisterShard registers a shard manually with dagstore with given pieceCID\n", - "paramStructure": "by-position", - "params": [ - { - "name": "p1", - "description": "string", - "summary": "", - "schema": { - "examples": [ - "string value" - ], - "type": [ - "string" - ] - }, - "required": true, - "deprecated": false - } - ], - "result": { - "name": "Null", - "description": "Null", - "schema": { - "type": [ - "null" - ] - }, - "required": true, - "deprecated": false - }, - "deprecated": false, - "externalDocs": { - "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5967" - } - }, - { - "name": "Filecoin.DealsConsiderOfflineRetrievalDeals", - "description": "```go\nfunc (s *StorageMinerStruct) DealsConsiderOfflineRetrievalDeals(p0 context.Context) (bool, error) {\n\tif s.Internal.DealsConsiderOfflineRetrievalDeals == nil {\n\t\treturn false, ErrNotSupported\n\t}\n\treturn s.Internal.DealsConsiderOfflineRetrievalDeals(p0)\n}\n```", - "summary": "", - "paramStructure": "by-position", - "params": [], - "result": { - "name": "bool", - "description": "bool", - "summary": "", - "schema": { - "examples": [ - true - ], - "type": [ - "boolean" - ] - }, - "required": true, - "deprecated": false - }, - "deprecated": false, - "externalDocs": { - "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5978" - } - }, - { - "name": "Filecoin.DealsConsiderOfflineStorageDeals", - "description": "```go\nfunc (s *StorageMinerStruct) DealsConsiderOfflineStorageDeals(p0 context.Context) (bool, error) {\n\tif s.Internal.DealsConsiderOfflineStorageDeals == nil {\n\t\treturn false, ErrNotSupported\n\t}\n\treturn s.Internal.DealsConsiderOfflineStorageDeals(p0)\n}\n```", - "summary": "", - "paramStructure": "by-position", - "params": [], - "result": { - "name": "bool", - "description": "bool", - "summary": "", - "schema": { - "examples": [ - true - ], - "type": [ - "boolean" - ] - }, - "required": true, - "deprecated": false - }, - "deprecated": false, - "externalDocs": { - "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5989" - } - }, - { - "name": "Filecoin.DealsConsiderOnlineRetrievalDeals", - "description": "```go\nfunc (s *StorageMinerStruct) DealsConsiderOnlineRetrievalDeals(p0 context.Context) (bool, error) {\n\tif s.Internal.DealsConsiderOnlineRetrievalDeals == nil {\n\t\treturn false, ErrNotSupported\n\t}\n\treturn s.Internal.DealsConsiderOnlineRetrievalDeals(p0)\n}\n```", - "summary": "", - "paramStructure": "by-position", - "params": [], - "result": { - "name": "bool", - "description": "bool", - "summary": "", - "schema": { - "examples": [ - true - ], - "type": [ - "boolean" - ] - }, - "required": true, - "deprecated": false - }, - "deprecated": false, - "externalDocs": { - "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6000" - } - }, - { - "name": "Filecoin.DealsConsiderOnlineStorageDeals", - "description": "```go\nfunc (s *StorageMinerStruct) DealsConsiderOnlineStorageDeals(p0 context.Context) (bool, error) {\n\tif s.Internal.DealsConsiderOnlineStorageDeals == nil {\n\t\treturn false, ErrNotSupported\n\t}\n\treturn s.Internal.DealsConsiderOnlineStorageDeals(p0)\n}\n```", - "summary": "", - "paramStructure": "by-position", - "params": [], - "result": { - "name": "bool", - "description": "bool", - "summary": "", - "schema": { - "examples": [ - true - ], - "type": [ - "boolean" - ] - }, - "required": true, - "deprecated": false - }, - "deprecated": false, - "externalDocs": { - "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6011" - } - }, - { - "name": "Filecoin.DealsConsiderUnverifiedStorageDeals", - "description": "```go\nfunc (s *StorageMinerStruct) DealsConsiderUnverifiedStorageDeals(p0 context.Context) (bool, error) {\n\tif s.Internal.DealsConsiderUnverifiedStorageDeals == nil {\n\t\treturn false, ErrNotSupported\n\t}\n\treturn s.Internal.DealsConsiderUnverifiedStorageDeals(p0)\n}\n```", - "summary": "", - "paramStructure": "by-position", - "params": [], - "result": { - "name": "bool", - "description": "bool", - "summary": "", - "schema": { - "examples": [ - true - ], - "type": [ - "boolean" - ] - }, - "required": true, - "deprecated": false - }, - "deprecated": false, - "externalDocs": { - "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6022" - } - }, - { - "name": "Filecoin.DealsConsiderVerifiedStorageDeals", - "description": "```go\nfunc (s *StorageMinerStruct) DealsConsiderVerifiedStorageDeals(p0 context.Context) (bool, error) {\n\tif s.Internal.DealsConsiderVerifiedStorageDeals == nil {\n\t\treturn false, ErrNotSupported\n\t}\n\treturn s.Internal.DealsConsiderVerifiedStorageDeals(p0)\n}\n```", - "summary": "", - "paramStructure": "by-position", - "params": [], - "result": { - "name": "bool", - "description": "bool", - "summary": "", - "schema": { - "examples": [ - true - ], - "type": [ - "boolean" - ] - }, - "required": true, - "deprecated": false - }, - "deprecated": false, - "externalDocs": { - "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6033" - } - }, - { - "name": "Filecoin.DealsImportData", - "description": "```go\nfunc (s *StorageMinerStruct) DealsImportData(p0 context.Context, p1 cid.Cid, p2 string) error {\n\tif s.Internal.DealsImportData == nil {\n\t\treturn ErrNotSupported\n\t}\n\treturn s.Internal.DealsImportData(p0, p1, p2)\n}\n```", - "summary": "", - "paramStructure": "by-position", - "params": [ - { - "name": "p1", - "description": "cid.Cid", - "summary": "", - "schema": { - "title": "Content Identifier", - "description": "Cid represents a self-describing content addressed identifier. It is formed by a Version, a Codec (which indicates a multicodec-packed content type) and a Multihash.", - "examples": [ - { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - } - ], - "type": [ - "string" - ] - }, - "required": true, - "deprecated": false - }, - { - "name": "p2", - "description": "string", - "summary": "", - "schema": { - "examples": [ - "string value" - ], - "type": [ - "string" - ] - }, - "required": true, - "deprecated": false - } - ], - "result": { - "name": "Null", - "description": "Null", - "schema": { - "type": [ - "null" - ] - }, - "required": true, - "deprecated": false - }, - "deprecated": false, - "externalDocs": { - "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6044" - } - }, - { - "name": "Filecoin.DealsList", - "description": "```go\nfunc (s *StorageMinerStruct) DealsList(p0 context.Context) ([]*MarketDeal, error) {\n\tif s.Internal.DealsList == nil {\n\t\treturn *new([]*MarketDeal), ErrNotSupported\n\t}\n\treturn s.Internal.DealsList(p0)\n}\n```", - "summary": "", - "paramStructure": "by-position", - "params": [], - "result": { - "name": "[]*MarketDeal", - "description": "[]*MarketDeal", - "summary": "", - "schema": { - "examples": [ - [ - { - "Proposal": { - "PieceCID": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "PieceSize": 1032, - "VerifiedDeal": true, - "Client": "f01234", - "Provider": "f01234", - "Label": "", - "StartEpoch": 10101, - "EndEpoch": 10101, - "StoragePricePerEpoch": "0", - "ProviderCollateral": "0", - "ClientCollateral": "0" - }, - "State": { - "SectorNumber": 9, - "SectorStartEpoch": 10101, - "LastUpdatedEpoch": 10101, - "SlashEpoch": 10101 - } - } - ] - ], - "items": [ - { - "additionalProperties": false, - "properties": { - "Proposal": { - "additionalProperties": false, - "properties": { - "Client": { - "additionalProperties": false, - "type": "object" - }, - "ClientCollateral": { - "additionalProperties": false, - "type": "object" - }, - "EndEpoch": { - "title": "number", - "type": "number" - }, - "Label": { - "additionalProperties": false, - "type": "object" - }, - "PieceCID": { - "title": "Content Identifier", - "type": "string" - }, - "PieceSize": { - "title": "number", - "type": "number" - }, - "Provider": { - "additionalProperties": false, - "type": "object" - }, - "ProviderCollateral": { - "additionalProperties": false, - "type": "object" - }, - "StartEpoch": { - "title": "number", - "type": "number" - }, - "StoragePricePerEpoch": { - "additionalProperties": false, - "type": "object" - }, - "VerifiedDeal": { - "type": "boolean" - } - }, - "type": "object" - }, - "State": { - "additionalProperties": false, - "properties": { - "LastUpdatedEpoch": { - "title": "number", - "type": "number" - }, - "SectorNumber": { - "title": "number", - "type": "number" - }, - "SectorStartEpoch": { - "title": "number", - "type": "number" - }, - "SlashEpoch": { - "title": "number", - "type": "number" - } - }, - "type": "object" - } - }, - "type": [ - "object" - ] - } - ], - "type": [ - "array" - ] - }, - "required": true, - "deprecated": false - }, - "deprecated": false, - "externalDocs": { - "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6055" - } - }, - { - "name": "Filecoin.DealsPieceCidBlocklist", - "description": "```go\nfunc (s *StorageMinerStruct) DealsPieceCidBlocklist(p0 context.Context) ([]cid.Cid, error) {\n\tif s.Internal.DealsPieceCidBlocklist == nil {\n\t\treturn *new([]cid.Cid), ErrNotSupported\n\t}\n\treturn s.Internal.DealsPieceCidBlocklist(p0)\n}\n```", - "summary": "", - "paramStructure": "by-position", - "params": [], - "result": { - "name": "[]cid.Cid", - "description": "[]cid.Cid", - "summary": "", - "schema": { - "examples": [ - [ - { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - } - ] - ], - "items": [ - { - "title": "Content Identifier", - "description": "Cid represents a self-describing content addressed identifier. It is formed by a Version, a Codec (which indicates a multicodec-packed content type) and a Multihash.", - "type": [ - "string" - ] - } - ], - "type": [ - "array" - ] - }, - "required": true, - "deprecated": false - }, - "deprecated": false, - "externalDocs": { - "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6066" - } - }, - { - "name": "Filecoin.DealsSetConsiderOfflineRetrievalDeals", - "description": "```go\nfunc (s *StorageMinerStruct) DealsSetConsiderOfflineRetrievalDeals(p0 context.Context, p1 bool) error {\n\tif s.Internal.DealsSetConsiderOfflineRetrievalDeals == nil {\n\t\treturn ErrNotSupported\n\t}\n\treturn s.Internal.DealsSetConsiderOfflineRetrievalDeals(p0, p1)\n}\n```", - "summary": "", - "paramStructure": "by-position", - "params": [ - { - "name": "p1", - "description": "bool", - "summary": "", - "schema": { - "examples": [ - true - ], - "type": [ - "boolean" - ] - }, - "required": true, - "deprecated": false - } - ], - "result": { - "name": "Null", - "description": "Null", - "schema": { - "type": [ - "null" - ] - }, - "required": true, - "deprecated": false - }, - "deprecated": false, - "externalDocs": { - "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6077" - } - }, - { - "name": "Filecoin.DealsSetConsiderOfflineStorageDeals", - "description": "```go\nfunc (s *StorageMinerStruct) DealsSetConsiderOfflineStorageDeals(p0 context.Context, p1 bool) error {\n\tif s.Internal.DealsSetConsiderOfflineStorageDeals == nil {\n\t\treturn ErrNotSupported\n\t}\n\treturn s.Internal.DealsSetConsiderOfflineStorageDeals(p0, p1)\n}\n```", - "summary": "", - "paramStructure": "by-position", - "params": [ - { - "name": "p1", - "description": "bool", - "summary": "", - "schema": { - "examples": [ - true - ], - "type": [ - "boolean" - ] - }, - "required": true, - "deprecated": false - } - ], - "result": { - "name": "Null", - "description": "Null", - "schema": { - "type": [ - "null" - ] - }, - "required": true, - "deprecated": false - }, - "deprecated": false, - "externalDocs": { - "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6088" - } - }, - { - "name": "Filecoin.DealsSetConsiderOnlineRetrievalDeals", - "description": "```go\nfunc (s *StorageMinerStruct) DealsSetConsiderOnlineRetrievalDeals(p0 context.Context, p1 bool) error {\n\tif s.Internal.DealsSetConsiderOnlineRetrievalDeals == nil {\n\t\treturn ErrNotSupported\n\t}\n\treturn s.Internal.DealsSetConsiderOnlineRetrievalDeals(p0, p1)\n}\n```", - "summary": "", - "paramStructure": "by-position", - "params": [ - { - "name": "p1", - "description": "bool", - "summary": "", - "schema": { - "examples": [ - true - ], - "type": [ - "boolean" - ] - }, - "required": true, - "deprecated": false - } - ], - "result": { - "name": "Null", - "description": "Null", - "schema": { - "type": [ - "null" - ] - }, - "required": true, - "deprecated": false - }, - "deprecated": false, - "externalDocs": { - "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6099" - } - }, - { - "name": "Filecoin.DealsSetConsiderOnlineStorageDeals", - "description": "```go\nfunc (s *StorageMinerStruct) DealsSetConsiderOnlineStorageDeals(p0 context.Context, p1 bool) error {\n\tif s.Internal.DealsSetConsiderOnlineStorageDeals == nil {\n\t\treturn ErrNotSupported\n\t}\n\treturn s.Internal.DealsSetConsiderOnlineStorageDeals(p0, p1)\n}\n```", - "summary": "", - "paramStructure": "by-position", - "params": [ - { - "name": "p1", - "description": "bool", - "summary": "", - "schema": { - "examples": [ - true - ], - "type": [ - "boolean" - ] - }, - "required": true, - "deprecated": false - } - ], - "result": { - "name": "Null", - "description": "Null", - "schema": { - "type": [ - "null" - ] - }, - "required": true, - "deprecated": false - }, - "deprecated": false, - "externalDocs": { - "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6110" - } - }, - { - "name": "Filecoin.DealsSetConsiderUnverifiedStorageDeals", - "description": "```go\nfunc (s *StorageMinerStruct) DealsSetConsiderUnverifiedStorageDeals(p0 context.Context, p1 bool) error {\n\tif s.Internal.DealsSetConsiderUnverifiedStorageDeals == nil {\n\t\treturn ErrNotSupported\n\t}\n\treturn s.Internal.DealsSetConsiderUnverifiedStorageDeals(p0, p1)\n}\n```", - "summary": "", - "paramStructure": "by-position", - "params": [ - { - "name": "p1", - "description": "bool", - "summary": "", - "schema": { - "examples": [ - true - ], - "type": [ - "boolean" - ] - }, - "required": true, - "deprecated": false - } - ], - "result": { - "name": "Null", - "description": "Null", - "schema": { - "type": [ - "null" - ] - }, - "required": true, - "deprecated": false - }, - "deprecated": false, - "externalDocs": { - "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6121" - } - }, - { - "name": "Filecoin.DealsSetConsiderVerifiedStorageDeals", - "description": "```go\nfunc (s *StorageMinerStruct) DealsSetConsiderVerifiedStorageDeals(p0 context.Context, p1 bool) error {\n\tif s.Internal.DealsSetConsiderVerifiedStorageDeals == nil {\n\t\treturn ErrNotSupported\n\t}\n\treturn s.Internal.DealsSetConsiderVerifiedStorageDeals(p0, p1)\n}\n```", - "summary": "", - "paramStructure": "by-position", - "params": [ - { - "name": "p1", - "description": "bool", - "summary": "", - "schema": { - "examples": [ - true - ], - "type": [ - "boolean" - ] - }, - "required": true, - "deprecated": false - } - ], - "result": { - "name": "Null", - "description": "Null", - "schema": { - "type": [ - "null" - ] - }, - "required": true, - "deprecated": false - }, - "deprecated": false, - "externalDocs": { - "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6132" - } - }, - { - "name": "Filecoin.DealsSetPieceCidBlocklist", - "description": "```go\nfunc (s *StorageMinerStruct) DealsSetPieceCidBlocklist(p0 context.Context, p1 []cid.Cid) error {\n\tif s.Internal.DealsSetPieceCidBlocklist == nil {\n\t\treturn ErrNotSupported\n\t}\n\treturn s.Internal.DealsSetPieceCidBlocklist(p0, p1)\n}\n```", - "summary": "", - "paramStructure": "by-position", - "params": [ - { - "name": "p1", - "description": "[]cid.Cid", - "summary": "", - "schema": { - "examples": [ - [ - { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - } - ] - ], - "items": [ - { - "title": "Content Identifier", - "description": "Cid represents a self-describing content addressed identifier. It is formed by a Version, a Codec (which indicates a multicodec-packed content type) and a Multihash.", - "type": [ - "string" - ] - } - ], - "type": [ - "array" - ] - }, - "required": true, - "deprecated": false - } - ], - "result": { - "name": "Null", - "description": "Null", - "schema": { - "type": [ - "null" - ] - }, - "required": true, - "deprecated": false - }, - "deprecated": false, - "externalDocs": { - "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6143" - } - }, - { - "name": "Filecoin.IndexerAnnounceAllDeals", - "description": "```go\nfunc (s *StorageMinerStruct) IndexerAnnounceAllDeals(p0 context.Context) error {\n\tif s.Internal.IndexerAnnounceAllDeals == nil {\n\t\treturn ErrNotSupported\n\t}\n\treturn s.Internal.IndexerAnnounceAllDeals(p0)\n}\n```", - "summary": "IndexerAnnounceAllDeals informs the indexer nodes aboutall active deals.\n", - "paramStructure": "by-position", - "params": [], - "result": { - "name": "Null", - "description": "Null", - "schema": { - "type": [ - "null" - ] - }, - "required": true, - "deprecated": false - }, - "deprecated": false, - "externalDocs": { - "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6154" - } - }, - { - "name": "Filecoin.IndexerAnnounceDeal", - "description": "```go\nfunc (s *StorageMinerStruct) IndexerAnnounceDeal(p0 context.Context, p1 cid.Cid) error {\n\tif s.Internal.IndexerAnnounceDeal == nil {\n\t\treturn ErrNotSupported\n\t}\n\treturn s.Internal.IndexerAnnounceDeal(p0, p1)\n}\n```", - "summary": "IndexerAnnounceDeal informs indexer nodes that a new deal was received,\nso they can download its index\n", - "paramStructure": "by-position", - "params": [ - { - "name": "p1", - "description": "cid.Cid", - "summary": "", - "schema": { - "title": "Content Identifier", - "description": "Cid represents a self-describing content addressed identifier. It is formed by a Version, a Codec (which indicates a multicodec-packed content type) and a Multihash.", - "examples": [ - { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - } - ], - "type": [ - "string" - ] - }, - "required": true, - "deprecated": false - } - ], - "result": { - "name": "Null", - "description": "Null", - "schema": { - "type": [ - "null" - ] - }, - "required": true, - "deprecated": false - }, - "deprecated": false, - "externalDocs": { - "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6165" - } - }, - { - "name": "Filecoin.MarketCancelDataTransfer", - "description": "```go\nfunc (s *StorageMinerStruct) MarketCancelDataTransfer(p0 context.Context, p1 datatransfer.TransferID, p2 peer.ID, p3 bool) error {\n\tif s.Internal.MarketCancelDataTransfer == nil {\n\t\treturn ErrNotSupported\n\t}\n\treturn s.Internal.MarketCancelDataTransfer(p0, p1, p2, p3)\n}\n```", - "summary": "MarketCancelDataTransfer cancels a data transfer with the given transfer ID and other peer\n", - "paramStructure": "by-position", - "params": [ - { - "name": "p1", - "description": "datatransfer.TransferID", - "summary": "", - "schema": { - "title": "number", - "description": "Number is a number", - "examples": [ - 3 - ], - "type": [ - "number" - ] - }, - "required": true, - "deprecated": false - }, - { - "name": "p2", - "description": "peer.ID", - "summary": "", - "schema": { - "examples": [ - "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf" - ], - "type": [ - "string" - ] - }, - "required": true, - "deprecated": false - }, - { - "name": "p3", - "description": "bool", - "summary": "", - "schema": { - "examples": [ - true - ], - "type": [ - "boolean" - ] - }, - "required": true, - "deprecated": false - } - ], - "result": { - "name": "Null", - "description": "Null", - "schema": { - "type": [ - "null" - ] - }, - "required": true, - "deprecated": false - }, - "deprecated": false, - "externalDocs": { - "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6176" - } - }, - { - "name": "Filecoin.MarketDataTransferDiagnostics", - "description": "```go\nfunc (s *StorageMinerStruct) MarketDataTransferDiagnostics(p0 context.Context, p1 peer.ID) (*TransferDiagnostics, error) {\n\tif s.Internal.MarketDataTransferDiagnostics == nil {\n\t\treturn nil, ErrNotSupported\n\t}\n\treturn s.Internal.MarketDataTransferDiagnostics(p0, p1)\n}\n```", - "summary": "MarketDataTransferDiagnostics generates debugging information about current data transfers over graphsync\n", - "paramStructure": "by-position", - "params": [ - { - "name": "p1", - "description": "peer.ID", - "summary": "", - "schema": { - "examples": [ - "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf" - ], - "type": [ - "string" - ] - }, - "required": true, - "deprecated": false - } - ], - "result": { - "name": "*TransferDiagnostics", - "description": "*TransferDiagnostics", - "summary": "", - "schema": { - "examples": [ - { - "ReceivingTransfers": [ - { - "RequestID": {}, - "RequestState": "string value", - "IsCurrentChannelRequest": true, - "ChannelID": { - "Initiator": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "Responder": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "ID": 3 - }, - "ChannelState": { - "TransferID": 3, - "Status": 1, - "BaseCID": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "IsInitiator": true, - "IsSender": true, - "Voucher": "string value", - "Message": "string value", - "OtherPeer": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "Transferred": 42, - "Stages": { - "Stages": [ - { - "Name": "string value", - "Description": "string value", - "CreatedTime": "0001-01-01T00:00:00Z", - "UpdatedTime": "0001-01-01T00:00:00Z", - "Logs": [ - { - "Log": "string value", - "UpdatedTime": "0001-01-01T00:00:00Z" - } - ] - } - ] - } - }, - "Diagnostics": [ - "string value" - ] - } - ], - "SendingTransfers": [ - { - "RequestID": {}, - "RequestState": "string value", - "IsCurrentChannelRequest": true, - "ChannelID": { - "Initiator": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "Responder": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "ID": 3 - }, - "ChannelState": { - "TransferID": 3, - "Status": 1, - "BaseCID": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "IsInitiator": true, - "IsSender": true, - "Voucher": "string value", - "Message": "string value", - "OtherPeer": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "Transferred": 42, - "Stages": { - "Stages": [ - { - "Name": "string value", - "Description": "string value", - "CreatedTime": "0001-01-01T00:00:00Z", - "UpdatedTime": "0001-01-01T00:00:00Z", - "Logs": [ - { - "Log": "string value", - "UpdatedTime": "0001-01-01T00:00:00Z" - } - ] - } - ] - } - }, - "Diagnostics": [ - "string value" - ] - } - ] - } - ], - "additionalProperties": false, - "properties": { - "ReceivingTransfers": { - "items": { - "additionalProperties": false, - "properties": { - "ChannelID": { - "additionalProperties": false, - "properties": { - "ID": { - "title": "number", - "type": "number" - }, - "Initiator": { - "type": "string" - }, - "Responder": { - "type": "string" - } - }, - "type": "object" - }, - "ChannelState": { - "additionalProperties": false, - "properties": { - "BaseCID": { - "title": "Content Identifier", - "type": "string" - }, - "IsInitiator": { - "type": "boolean" - }, - "IsSender": { - "type": "boolean" - }, - "Message": { - "type": "string" - }, - "OtherPeer": { - "type": "string" - }, - "Stages": { - "additionalProperties": false, - "properties": { - "Stages": { - "items": { - "additionalProperties": false, - "properties": { - "CreatedTime": { - "additionalProperties": false, - "type": "object" - }, - "Description": { - "type": "string" - }, - "Logs": { - "items": { - "additionalProperties": false, - "properties": { - "Log": { - "type": "string" - }, - "UpdatedTime": { - "additionalProperties": false, - "type": "object" - } - }, - "type": "object" - }, - "type": "array" - }, - "Name": { - "type": "string" - }, - "UpdatedTime": { - "additionalProperties": false, - "type": "object" - } - }, - "type": "object" - }, - "type": "array" - } - }, - "type": "object" - }, - "Status": { - "title": "number", - "type": "number" - }, - "TransferID": { - "title": "number", - "type": "number" - }, - "Transferred": { - "title": "number", - "type": "number" - }, - "Voucher": { - "type": "string" - } - }, - "type": "object" - }, - "Diagnostics": { - "items": { - "type": "string" - }, - "type": "array" - }, - "IsCurrentChannelRequest": { - "type": "boolean" - }, - "RequestID": { - "additionalProperties": false, - "type": "object" - }, - "RequestState": { - "type": "string" - } - }, - "type": "object" - }, - "type": "array" - }, - "SendingTransfers": { - "items": { - "additionalProperties": false, - "properties": { - "ChannelID": { - "additionalProperties": false, - "properties": { - "ID": { - "title": "number", - "type": "number" - }, - "Initiator": { - "type": "string" - }, - "Responder": { - "type": "string" - } - }, - "type": "object" - }, - "ChannelState": { - "additionalProperties": false, - "properties": { - "BaseCID": { - "title": "Content Identifier", - "type": "string" - }, - "IsInitiator": { - "type": "boolean" - }, - "IsSender": { - "type": "boolean" - }, - "Message": { - "type": "string" - }, - "OtherPeer": { - "type": "string" - }, - "Stages": { - "additionalProperties": false, - "properties": { - "Stages": { - "items": { - "additionalProperties": false, - "properties": { - "CreatedTime": { - "additionalProperties": false, - "type": "object" - }, - "Description": { - "type": "string" - }, - "Logs": { - "items": { - "additionalProperties": false, - "properties": { - "Log": { - "type": "string" - }, - "UpdatedTime": { - "additionalProperties": false, - "type": "object" - } - }, - "type": "object" - }, - "type": "array" - }, - "Name": { - "type": "string" - }, - "UpdatedTime": { - "additionalProperties": false, - "type": "object" - } - }, - "type": "object" - }, - "type": "array" - } - }, - "type": "object" - }, - "Status": { - "title": "number", - "type": "number" - }, - "TransferID": { - "title": "number", - "type": "number" - }, - "Transferred": { - "title": "number", - "type": "number" - }, - "Voucher": { - "type": "string" - } - }, - "type": "object" - }, - "Diagnostics": { - "items": { - "type": "string" - }, - "type": "array" - }, - "IsCurrentChannelRequest": { - "type": "boolean" - }, - "RequestID": { - "additionalProperties": false, - "type": "object" - }, - "RequestState": { - "type": "string" - } - }, - "type": "object" - }, - "type": "array" - } - }, - "type": [ - "object" - ] - }, - "required": true, - "deprecated": false - }, - "deprecated": false, - "externalDocs": { - "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6187" - } - }, - { - "name": "Filecoin.MarketGetAsk", - "description": "```go\nfunc (s *StorageMinerStruct) MarketGetAsk(p0 context.Context) (*storagemarket.SignedStorageAsk, error) {\n\tif s.Internal.MarketGetAsk == nil {\n\t\treturn nil, ErrNotSupported\n\t}\n\treturn s.Internal.MarketGetAsk(p0)\n}\n```", - "summary": "", - "paramStructure": "by-position", - "params": [], - "result": { - "name": "*storagemarket.SignedStorageAsk", - "description": "*storagemarket.SignedStorageAsk", - "summary": "", - "schema": { - "examples": [ - { - "Ask": { - "Price": "0", - "VerifiedPrice": "0", - "MinPieceSize": 1032, - "MaxPieceSize": 1032, - "Miner": "f01234", - "Timestamp": 10101, - "Expiry": 10101, - "SeqNo": 42 - }, - "Signature": { - "Type": 2, - "Data": "Ynl0ZSBhcnJheQ==" - } - } - ], - "additionalProperties": false, - "properties": { - "Ask": { - "additionalProperties": false, - "properties": { - "Expiry": { - "title": "number", - "type": "number" - }, - "MaxPieceSize": { - "title": "number", - "type": "number" - }, - "MinPieceSize": { - "title": "number", - "type": "number" - }, - "Miner": { - "additionalProperties": false, - "type": "object" - }, - "Price": { - "additionalProperties": false, - "type": "object" - }, - "SeqNo": { - "title": "number", - "type": "number" - }, - "Timestamp": { - "title": "number", - "type": "number" - }, - "VerifiedPrice": { - "additionalProperties": false, - "type": "object" - } - }, - "type": "object" - }, - "Signature": { - "additionalProperties": false, - "properties": { - "Data": { - "media": { - "binaryEncoding": "base64" - }, - "type": "string" - }, - "Type": { - "title": "number", - "type": "number" - } - }, - "type": "object" - } - }, - "type": [ - "object" - ] - }, - "required": true, - "deprecated": false - }, - "deprecated": false, - "externalDocs": { - "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6209" - } - }, - { - "name": "Filecoin.MarketGetRetrievalAsk", - "description": "```go\nfunc (s *StorageMinerStruct) MarketGetRetrievalAsk(p0 context.Context) (*retrievalmarket.Ask, error) {\n\tif s.Internal.MarketGetRetrievalAsk == nil {\n\t\treturn nil, ErrNotSupported\n\t}\n\treturn s.Internal.MarketGetRetrievalAsk(p0)\n}\n```", - "summary": "", - "paramStructure": "by-position", - "params": [], - "result": { - "name": "*retrievalmarket.Ask", - "description": "*retrievalmarket.Ask", - "summary": "", - "schema": { - "examples": [ - { - "PricePerByte": "0", - "UnsealPrice": "0", - "PaymentInterval": 42, - "PaymentIntervalIncrease": 42 - } - ], - "additionalProperties": false, - "properties": { - "PaymentInterval": { - "title": "number", - "type": "number" - }, - "PaymentIntervalIncrease": { - "title": "number", - "type": "number" - }, - "PricePerByte": { - "additionalProperties": false, - "type": "object" - }, - "UnsealPrice": { - "additionalProperties": false, - "type": "object" - } - }, - "type": [ - "object" - ] - }, - "required": true, - "deprecated": false - }, - "deprecated": false, - "externalDocs": { - "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6231" - } - }, - { - "name": "Filecoin.MarketImportDealData", - "description": "```go\nfunc (s *StorageMinerStruct) MarketImportDealData(p0 context.Context, p1 cid.Cid, p2 string) error {\n\tif s.Internal.MarketImportDealData == nil {\n\t\treturn ErrNotSupported\n\t}\n\treturn s.Internal.MarketImportDealData(p0, p1, p2)\n}\n```", - "summary": "", - "paramStructure": "by-position", - "params": [ - { - "name": "p1", - "description": "cid.Cid", - "summary": "", - "schema": { - "title": "Content Identifier", - "description": "Cid represents a self-describing content addressed identifier. It is formed by a Version, a Codec (which indicates a multicodec-packed content type) and a Multihash.", - "examples": [ - { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - } - ], - "type": [ - "string" - ] - }, - "required": true, - "deprecated": false - }, - { - "name": "p2", - "description": "string", - "summary": "", - "schema": { - "examples": [ - "string value" - ], - "type": [ - "string" - ] - }, - "required": true, - "deprecated": false - } - ], - "result": { - "name": "Null", - "description": "Null", - "schema": { - "type": [ - "null" - ] - }, - "required": true, - "deprecated": false - }, - "deprecated": false, - "externalDocs": { - "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6242" - } - }, - { - "name": "Filecoin.MarketListDataTransfers", - "description": "```go\nfunc (s *StorageMinerStruct) MarketListDataTransfers(p0 context.Context) ([]DataTransferChannel, error) {\n\tif s.Internal.MarketListDataTransfers == nil {\n\t\treturn *new([]DataTransferChannel), ErrNotSupported\n\t}\n\treturn s.Internal.MarketListDataTransfers(p0)\n}\n```", - "summary": "", - "paramStructure": "by-position", - "params": [], - "result": { - "name": "[]DataTransferChannel", - "description": "[]DataTransferChannel", - "summary": "", - "schema": { - "examples": [ - [ - { - "TransferID": 3, - "Status": 1, - "BaseCID": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "IsInitiator": true, - "IsSender": true, - "Voucher": "string value", - "Message": "string value", - "OtherPeer": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "Transferred": 42, - "Stages": { - "Stages": [ - { - "Name": "string value", - "Description": "string value", - "CreatedTime": "0001-01-01T00:00:00Z", - "UpdatedTime": "0001-01-01T00:00:00Z", - "Logs": [ - { - "Log": "string value", - "UpdatedTime": "0001-01-01T00:00:00Z" - } - ] - } - ] - } - } - ] - ], - "items": [ - { - "additionalProperties": false, - "properties": { - "BaseCID": { - "title": "Content Identifier", - "type": "string" - }, - "IsInitiator": { - "type": "boolean" - }, - "IsSender": { - "type": "boolean" - }, - "Message": { - "type": "string" - }, - "OtherPeer": { - "type": "string" - }, - "Stages": { - "additionalProperties": false, - "properties": { - "Stages": { - "items": { - "additionalProperties": false, - "properties": { - "CreatedTime": { - "additionalProperties": false, - "type": "object" - }, - "Description": { - "type": "string" - }, - "Logs": { - "items": { - "additionalProperties": false, - "properties": { - "Log": { - "type": "string" - }, - "UpdatedTime": { - "additionalProperties": false, - "type": "object" - } - }, - "type": "object" - }, - "type": "array" - }, - "Name": { - "type": "string" - }, - "UpdatedTime": { - "additionalProperties": false, - "type": "object" - } - }, - "type": "object" - }, - "type": "array" - } - }, - "type": "object" - }, - "Status": { - "title": "number", - "type": "number" - }, - "TransferID": { - "title": "number", - "type": "number" - }, - "Transferred": { - "title": "number", - "type": "number" - }, - "Voucher": { - "type": "string" - } - }, - "type": [ - "object" - ] - } - ], - "type": [ - "array" - ] - }, - "required": true, - "deprecated": false - }, - "deprecated": false, - "externalDocs": { - "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6253" - } - }, - { - "name": "Filecoin.MarketListDeals", - "description": "```go\nfunc (s *StorageMinerStruct) MarketListDeals(p0 context.Context) ([]*MarketDeal, error) {\n\tif s.Internal.MarketListDeals == nil {\n\t\treturn *new([]*MarketDeal), ErrNotSupported\n\t}\n\treturn s.Internal.MarketListDeals(p0)\n}\n```", - "summary": "", - "paramStructure": "by-position", - "params": [], - "result": { - "name": "[]*MarketDeal", - "description": "[]*MarketDeal", - "summary": "", - "schema": { - "examples": [ - [ - { - "Proposal": { - "PieceCID": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "PieceSize": 1032, - "VerifiedDeal": true, - "Client": "f01234", - "Provider": "f01234", - "Label": "", - "StartEpoch": 10101, - "EndEpoch": 10101, - "StoragePricePerEpoch": "0", - "ProviderCollateral": "0", - "ClientCollateral": "0" - }, - "State": { - "SectorNumber": 9, - "SectorStartEpoch": 10101, - "LastUpdatedEpoch": 10101, - "SlashEpoch": 10101 - } - } - ] - ], - "items": [ - { - "additionalProperties": false, - "properties": { - "Proposal": { - "additionalProperties": false, - "properties": { - "Client": { - "additionalProperties": false, - "type": "object" - }, - "ClientCollateral": { - "additionalProperties": false, - "type": "object" - }, - "EndEpoch": { - "title": "number", - "type": "number" - }, - "Label": { - "additionalProperties": false, - "type": "object" - }, - "PieceCID": { - "title": "Content Identifier", - "type": "string" - }, - "PieceSize": { - "title": "number", - "type": "number" - }, - "Provider": { - "additionalProperties": false, - "type": "object" - }, - "ProviderCollateral": { - "additionalProperties": false, - "type": "object" - }, - "StartEpoch": { - "title": "number", - "type": "number" - }, - "StoragePricePerEpoch": { - "additionalProperties": false, - "type": "object" - }, - "VerifiedDeal": { - "type": "boolean" - } - }, - "type": "object" - }, - "State": { - "additionalProperties": false, - "properties": { - "LastUpdatedEpoch": { - "title": "number", - "type": "number" - }, - "SectorNumber": { - "title": "number", - "type": "number" - }, - "SectorStartEpoch": { - "title": "number", - "type": "number" - }, - "SlashEpoch": { - "title": "number", - "type": "number" - } - }, - "type": "object" - } - }, - "type": [ - "object" - ] - } - ], - "type": [ - "array" - ] - }, - "required": true, - "deprecated": false - }, - "deprecated": false, - "externalDocs": { - "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6264" - } - }, - { - "name": "Filecoin.MarketListIncompleteDeals", - "description": "```go\nfunc (s *StorageMinerStruct) MarketListIncompleteDeals(p0 context.Context) ([]storagemarket.MinerDeal, error) {\n\tif s.Internal.MarketListIncompleteDeals == nil {\n\t\treturn *new([]storagemarket.MinerDeal), ErrNotSupported\n\t}\n\treturn s.Internal.MarketListIncompleteDeals(p0)\n}\n```", - "summary": "", - "paramStructure": "by-position", - "params": [], - "result": { - "name": "[]storagemarket.MinerDeal", - "description": "[]storagemarket.MinerDeal", - "summary": "", - "schema": { - "examples": [ - [ - { - "Proposal": { - "PieceCID": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "PieceSize": 1032, - "VerifiedDeal": true, - "Client": "f01234", - "Provider": "f01234", - "Label": "", - "StartEpoch": 10101, - "EndEpoch": 10101, - "StoragePricePerEpoch": "0", - "ProviderCollateral": "0", - "ClientCollateral": "0" - }, - "ClientSignature": { - "Type": 2, - "Data": "Ynl0ZSBhcnJheQ==" - }, - "ProposalCid": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "AddFundsCid": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "PublishCid": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "Miner": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "Client": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "State": 42, - "PiecePath": ".lotusminer/fstmp123", - "MetadataPath": ".lotusminer/fstmp123", - "SlashEpoch": 10101, - "FastRetrieval": true, - "Message": "string value", - "FundsReserved": "0", - "Ref": { - "TransferType": "string value", - "Root": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "PieceCid": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "PieceSize": 1024, - "RawBlockSize": 42 - }, - "AvailableForRetrieval": true, - "DealID": 5432, - "CreationTime": "0001-01-01T00:00:00Z", - "TransferChannelId": { - "Initiator": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "Responder": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "ID": 3 - }, - "SectorNumber": 9, - "InboundCAR": "string value" - } - ] - ], - "items": [ - { - "additionalProperties": false, - "properties": { - "AddFundsCid": { - "title": "Content Identifier", - "type": "string" - }, - "AvailableForRetrieval": { - "type": "boolean" - }, - "Client": { - "type": "string" - }, - "ClientSignature": { - "additionalProperties": false, - "properties": { - "Data": { - "media": { - "binaryEncoding": "base64" - }, - "type": "string" - }, - "Type": { - "title": "number", - "type": "number" - } - }, - "type": "object" - }, - "CreationTime": { - "additionalProperties": false, - "type": "object" - }, - "DealID": { - "title": "number", - "type": "number" - }, - "FastRetrieval": { - "type": "boolean" - }, - "FundsReserved": { - "additionalProperties": false, - "type": "object" - }, - "InboundCAR": { - "type": "string" - }, - "Message": { - "type": "string" - }, - "MetadataPath": { - "type": "string" - }, - "Miner": { - "type": "string" - }, - "PiecePath": { - "type": "string" - }, - "Proposal": { - "additionalProperties": false, - "properties": { - "Client": { - "additionalProperties": false, - "type": "object" - }, - "ClientCollateral": { - "additionalProperties": false, - "type": "object" - }, - "EndEpoch": { - "title": "number", - "type": "number" - }, - "Label": { - "additionalProperties": false, - "type": "object" - }, - "PieceCID": { - "title": "Content Identifier", - "type": "string" - }, - "PieceSize": { - "title": "number", - "type": "number" - }, - "Provider": { - "additionalProperties": false, - "type": "object" - }, - "ProviderCollateral": { - "additionalProperties": false, - "type": "object" - }, - "StartEpoch": { - "title": "number", - "type": "number" - }, - "StoragePricePerEpoch": { - "additionalProperties": false, - "type": "object" - }, - "VerifiedDeal": { - "type": "boolean" - } - }, - "type": "object" - }, - "ProposalCid": { - "title": "Content Identifier", - "type": "string" - }, - "PublishCid": { - "title": "Content Identifier", - "type": "string" - }, - "Ref": { - "additionalProperties": false, - "properties": { - "PieceCid": { - "title": "Content Identifier", - "type": "string" - }, - "PieceSize": { - "title": "number", - "type": "number" - }, - "RawBlockSize": { - "title": "number", - "type": "number" - }, - "Root": { - "title": "Content Identifier", - "type": "string" - }, - "TransferType": { - "type": "string" - } - }, - "type": "object" - }, - "SectorNumber": { - "title": "number", - "type": "number" - }, - "SlashEpoch": { - "title": "number", - "type": "number" - }, - "State": { - "title": "number", - "type": "number" - }, - "TransferChannelId": { - "additionalProperties": false, - "properties": { - "ID": { - "title": "number", - "type": "number" - }, - "Initiator": { - "type": "string" - }, - "Responder": { - "type": "string" - } - }, - "type": "object" - } - }, - "type": [ - "object" - ] - } - ], - "type": [ - "array" - ] - }, - "required": true, - "deprecated": false - }, - "deprecated": false, - "externalDocs": { - "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6275" - } - }, - { - "name": "Filecoin.MarketListRetrievalDeals", - "description": "```go\nfunc (s *StorageMinerStruct) MarketListRetrievalDeals(p0 context.Context) ([]struct{}, error) {\n\tif s.Internal.MarketListRetrievalDeals == nil {\n\t\treturn *new([]struct{}), ErrNotSupported\n\t}\n\treturn s.Internal.MarketListRetrievalDeals(p0)\n}\n```", - "summary": "MarketListRetrievalDeals is deprecated, returns empty list\n", - "paramStructure": "by-position", - "params": [], - "result": { - "name": "[]struct{}", - "description": "[]struct{}", - "summary": "", - "schema": { - "examples": [ - [ - {} - ] - ], - "items": [ - { - "additionalProperties": false, - "type": [ - "object" - ] - } - ], - "type": [ - "array" - ] - }, - "required": true, - "deprecated": false - }, - "deprecated": false, - "externalDocs": { - "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6286" - } - }, - { - "name": "Filecoin.MarketPendingDeals", - "description": "```go\nfunc (s *StorageMinerStruct) MarketPendingDeals(p0 context.Context) (PendingDealInfo, error) {\n\tif s.Internal.MarketPendingDeals == nil {\n\t\treturn *new(PendingDealInfo), ErrNotSupported\n\t}\n\treturn s.Internal.MarketPendingDeals(p0)\n}\n```", - "summary": "", - "paramStructure": "by-position", - "params": [], - "result": { - "name": "PendingDealInfo", - "description": "PendingDealInfo", - "summary": "", - "schema": { - "examples": [ - { - "Deals": [ - { - "Proposal": { - "PieceCID": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "PieceSize": 1032, - "VerifiedDeal": true, - "Client": "f01234", - "Provider": "f01234", - "Label": "", - "StartEpoch": 10101, - "EndEpoch": 10101, - "StoragePricePerEpoch": "0", - "ProviderCollateral": "0", - "ClientCollateral": "0" - }, - "ClientSignature": { - "Type": 2, - "Data": "Ynl0ZSBhcnJheQ==" - } - } - ], - "PublishPeriodStart": "0001-01-01T00:00:00Z", - "PublishPeriod": 60000000000 - } - ], - "additionalProperties": false, - "properties": { - "Deals": { - "items": { - "additionalProperties": false, - "properties": { - "ClientSignature": { - "additionalProperties": false, - "properties": { - "Data": { - "media": { - "binaryEncoding": "base64" - }, - "type": "string" - }, - "Type": { - "title": "number", - "type": "number" - } - }, - "type": "object" - }, - "Proposal": { - "additionalProperties": false, - "properties": { - "Client": { - "additionalProperties": false, - "type": "object" - }, - "ClientCollateral": { - "additionalProperties": false, - "type": "object" - }, - "EndEpoch": { - "title": "number", - "type": "number" - }, - "Label": { - "additionalProperties": false, - "type": "object" - }, - "PieceCID": { - "title": "Content Identifier", - "type": "string" - }, - "PieceSize": { - "title": "number", - "type": "number" - }, - "Provider": { - "additionalProperties": false, - "type": "object" - }, - "ProviderCollateral": { - "additionalProperties": false, - "type": "object" - }, - "StartEpoch": { - "title": "number", - "type": "number" - }, - "StoragePricePerEpoch": { - "additionalProperties": false, - "type": "object" - }, - "VerifiedDeal": { - "type": "boolean" - } - }, - "type": "object" - } - }, - "type": "object" - }, - "type": "array" - }, - "PublishPeriod": { - "title": "number", - "type": "number" - }, - "PublishPeriodStart": { - "format": "date-time", - "type": "string" - } - }, - "type": [ - "object" - ] - }, - "required": true, - "deprecated": false - }, - "deprecated": false, - "externalDocs": { - "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6297" - } - }, - { - "name": "Filecoin.MarketPublishPendingDeals", - "description": "```go\nfunc (s *StorageMinerStruct) MarketPublishPendingDeals(p0 context.Context) error {\n\tif s.Internal.MarketPublishPendingDeals == nil {\n\t\treturn ErrNotSupported\n\t}\n\treturn s.Internal.MarketPublishPendingDeals(p0)\n}\n```", - "summary": "", - "paramStructure": "by-position", - "params": [], - "result": { - "name": "Null", - "description": "Null", - "schema": { - "type": [ - "null" - ] - }, - "required": true, - "deprecated": false - }, - "deprecated": false, - "externalDocs": { - "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6308" - } - }, - { - "name": "Filecoin.MarketRestartDataTransfer", - "description": "```go\nfunc (s *StorageMinerStruct) MarketRestartDataTransfer(p0 context.Context, p1 datatransfer.TransferID, p2 peer.ID, p3 bool) error {\n\tif s.Internal.MarketRestartDataTransfer == nil {\n\t\treturn ErrNotSupported\n\t}\n\treturn s.Internal.MarketRestartDataTransfer(p0, p1, p2, p3)\n}\n```", - "summary": "MarketRestartDataTransfer attempts to restart a data transfer with the given transfer ID and other peer\n", - "paramStructure": "by-position", - "params": [ - { - "name": "p1", - "description": "datatransfer.TransferID", - "summary": "", - "schema": { - "title": "number", - "description": "Number is a number", - "examples": [ - 3 - ], - "type": [ - "number" - ] - }, - "required": true, - "deprecated": false - }, - { - "name": "p2", - "description": "peer.ID", - "summary": "", - "schema": { - "examples": [ - "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf" - ], - "type": [ - "string" - ] - }, - "required": true, - "deprecated": false - }, - { - "name": "p3", - "description": "bool", - "summary": "", - "schema": { - "examples": [ - true - ], - "type": [ - "boolean" - ] - }, - "required": true, - "deprecated": false - } - ], - "result": { - "name": "Null", - "description": "Null", - "schema": { - "type": [ - "null" - ] - }, - "required": true, - "deprecated": false - }, - "deprecated": false, - "externalDocs": { - "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6319" - } - }, - { - "name": "Filecoin.MarketRetryPublishDeal", - "description": "```go\nfunc (s *StorageMinerStruct) MarketRetryPublishDeal(p0 context.Context, p1 cid.Cid) error {\n\tif s.Internal.MarketRetryPublishDeal == nil {\n\t\treturn ErrNotSupported\n\t}\n\treturn s.Internal.MarketRetryPublishDeal(p0, p1)\n}\n```", - "summary": "", - "paramStructure": "by-position", - "params": [ - { - "name": "p1", - "description": "cid.Cid", - "summary": "", - "schema": { - "title": "Content Identifier", - "description": "Cid represents a self-describing content addressed identifier. It is formed by a Version, a Codec (which indicates a multicodec-packed content type) and a Multihash.", - "examples": [ - { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - } - ], - "type": [ - "string" - ] - }, - "required": true, - "deprecated": false - } - ], - "result": { - "name": "Null", - "description": "Null", - "schema": { - "type": [ - "null" - ] - }, - "required": true, - "deprecated": false - }, - "deprecated": false, - "externalDocs": { - "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6330" - } - }, - { - "name": "Filecoin.MarketSetAsk", - "description": "```go\nfunc (s *StorageMinerStruct) MarketSetAsk(p0 context.Context, p1 types.BigInt, p2 types.BigInt, p3 abi.ChainEpoch, p4 abi.PaddedPieceSize, p5 abi.PaddedPieceSize) error {\n\tif s.Internal.MarketSetAsk == nil {\n\t\treturn ErrNotSupported\n\t}\n\treturn s.Internal.MarketSetAsk(p0, p1, p2, p3, p4, p5)\n}\n```", - "summary": "", - "paramStructure": "by-position", - "params": [ - { - "name": "p1", - "description": "types.BigInt", - "summary": "", - "schema": { - "examples": [ - "0" - ], - "additionalProperties": false, - "type": [ - "object" - ] - }, - "required": true, - "deprecated": false - }, - { - "name": "p2", - "description": "types.BigInt", - "summary": "", - "schema": { - "examples": [ - "0" - ], - "additionalProperties": false, - "type": [ - "object" - ] - }, - "required": true, - "deprecated": false - }, - { - "name": "p3", - "description": "abi.ChainEpoch", - "summary": "", - "schema": { - "title": "number", - "description": "Number is a number", - "examples": [ - 10101 - ], - "type": [ - "number" - ] - }, - "required": true, - "deprecated": false - }, - { - "name": "p4", - "description": "abi.PaddedPieceSize", - "summary": "", - "schema": { - "title": "number", - "description": "Number is a number", - "examples": [ - 1032 - ], - "type": [ - "number" - ] - }, - "required": true, - "deprecated": false - }, - { - "name": "p5", - "description": "abi.PaddedPieceSize", - "summary": "", - "schema": { - "title": "number", - "description": "Number is a number", - "examples": [ - 1032 - ], - "type": [ - "number" - ] - }, - "required": true, - "deprecated": false - } - ], - "result": { - "name": "Null", - "description": "Null", - "schema": { - "type": [ - "null" - ] - }, - "required": true, - "deprecated": false - }, - "deprecated": false, - "externalDocs": { - "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6341" - } - }, - { - "name": "Filecoin.MarketSetRetrievalAsk", - "description": "```go\nfunc (s *StorageMinerStruct) MarketSetRetrievalAsk(p0 context.Context, p1 *retrievalmarket.Ask) error {\n\tif s.Internal.MarketSetRetrievalAsk == nil {\n\t\treturn ErrNotSupported\n\t}\n\treturn s.Internal.MarketSetRetrievalAsk(p0, p1)\n}\n```", - "summary": "", - "paramStructure": "by-position", - "params": [ - { - "name": "p1", - "description": "*retrievalmarket.Ask", - "summary": "", - "schema": { - "examples": [ - { - "PricePerByte": "0", - "UnsealPrice": "0", - "PaymentInterval": 42, - "PaymentIntervalIncrease": 42 - } - ], - "additionalProperties": false, - "properties": { - "PaymentInterval": { - "title": "number", - "type": "number" - }, - "PaymentIntervalIncrease": { - "title": "number", - "type": "number" - }, - "PricePerByte": { - "additionalProperties": false, - "type": "object" - }, - "UnsealPrice": { - "additionalProperties": false, - "type": "object" - } - }, - "type": [ - "object" - ] - }, - "required": true, - "deprecated": false - } - ], - "result": { - "name": "Null", - "description": "Null", - "schema": { - "type": [ - "null" - ] - }, - "required": true, - "deprecated": false - }, - "deprecated": false, - "externalDocs": { - "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6352" - } - }, - { - "name": "Filecoin.MiningBase", - "description": "```go\nfunc (s *StorageMinerStruct) MiningBase(p0 context.Context) (*types.TipSet, error) {\n\tif s.Internal.MiningBase == nil {\n\t\treturn nil, ErrNotSupported\n\t}\n\treturn s.Internal.MiningBase(p0)\n}\n```", - "summary": "", + "name": "Filecoin.MiningBase", + "description": "```go\nfunc (s *StorageMinerStruct) MiningBase(p0 context.Context) (*types.TipSet, error) {\n\tif s.Internal.MiningBase == nil {\n\t\treturn nil, ErrNotSupported\n\t}\n\treturn s.Internal.MiningBase(p0)\n}\n```", + "summary": "", "paramStructure": "by-position", "params": [], "result": { @@ -3531,266 +1077,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6363" - } - }, - { - "name": "Filecoin.PiecesGetCIDInfo", - "description": "```go\nfunc (s *StorageMinerStruct) PiecesGetCIDInfo(p0 context.Context, p1 cid.Cid) (*piecestore.CIDInfo, error) {\n\tif s.Internal.PiecesGetCIDInfo == nil {\n\t\treturn nil, ErrNotSupported\n\t}\n\treturn s.Internal.PiecesGetCIDInfo(p0, p1)\n}\n```", - "summary": "", - "paramStructure": "by-position", - "params": [ - { - "name": "p1", - "description": "cid.Cid", - "summary": "", - "schema": { - "title": "Content Identifier", - "description": "Cid represents a self-describing content addressed identifier. It is formed by a Version, a Codec (which indicates a multicodec-packed content type) and a Multihash.", - "examples": [ - { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - } - ], - "type": [ - "string" - ] - }, - "required": true, - "deprecated": false - } - ], - "result": { - "name": "*piecestore.CIDInfo", - "description": "*piecestore.CIDInfo", - "summary": "", - "schema": { - "examples": [ - { - "CID": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "PieceBlockLocations": [ - { - "RelOffset": 42, - "BlockSize": 42, - "PieceCID": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - } - } - ] - } - ], - "additionalProperties": false, - "properties": { - "CID": { - "title": "Content Identifier", - "type": "string" - }, - "PieceBlockLocations": { - "items": { - "additionalProperties": false, - "properties": { - "BlockSize": { - "title": "number", - "type": "number" - }, - "PieceCID": { - "title": "Content Identifier", - "type": "string" - }, - "RelOffset": { - "title": "number", - "type": "number" - } - }, - "type": "object" - }, - "type": "array" - } - }, - "type": [ - "object" - ] - }, - "required": true, - "deprecated": false - }, - "deprecated": false, - "externalDocs": { - "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6374" - } - }, - { - "name": "Filecoin.PiecesGetPieceInfo", - "description": "```go\nfunc (s *StorageMinerStruct) PiecesGetPieceInfo(p0 context.Context, p1 cid.Cid) (*piecestore.PieceInfo, error) {\n\tif s.Internal.PiecesGetPieceInfo == nil {\n\t\treturn nil, ErrNotSupported\n\t}\n\treturn s.Internal.PiecesGetPieceInfo(p0, p1)\n}\n```", - "summary": "", - "paramStructure": "by-position", - "params": [ - { - "name": "p1", - "description": "cid.Cid", - "summary": "", - "schema": { - "title": "Content Identifier", - "description": "Cid represents a self-describing content addressed identifier. It is formed by a Version, a Codec (which indicates a multicodec-packed content type) and a Multihash.", - "examples": [ - { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - } - ], - "type": [ - "string" - ] - }, - "required": true, - "deprecated": false - } - ], - "result": { - "name": "*piecestore.PieceInfo", - "description": "*piecestore.PieceInfo", - "summary": "", - "schema": { - "examples": [ - { - "PieceCID": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "Deals": [ - { - "DealID": 5432, - "SectorID": 9, - "Offset": 1032, - "Length": 1032 - } - ] - } - ], - "additionalProperties": false, - "properties": { - "Deals": { - "items": { - "additionalProperties": false, - "properties": { - "DealID": { - "title": "number", - "type": "number" - }, - "Length": { - "title": "number", - "type": "number" - }, - "Offset": { - "title": "number", - "type": "number" - }, - "SectorID": { - "title": "number", - "type": "number" - } - }, - "type": "object" - }, - "type": "array" - }, - "PieceCID": { - "title": "Content Identifier", - "type": "string" - } - }, - "type": [ - "object" - ] - }, - "required": true, - "deprecated": false - }, - "deprecated": false, - "externalDocs": { - "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6385" - } - }, - { - "name": "Filecoin.PiecesListCidInfos", - "description": "```go\nfunc (s *StorageMinerStruct) PiecesListCidInfos(p0 context.Context) ([]cid.Cid, error) {\n\tif s.Internal.PiecesListCidInfos == nil {\n\t\treturn *new([]cid.Cid), ErrNotSupported\n\t}\n\treturn s.Internal.PiecesListCidInfos(p0)\n}\n```", - "summary": "", - "paramStructure": "by-position", - "params": [], - "result": { - "name": "[]cid.Cid", - "description": "[]cid.Cid", - "summary": "", - "schema": { - "examples": [ - [ - { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - } - ] - ], - "items": [ - { - "title": "Content Identifier", - "description": "Cid represents a self-describing content addressed identifier. It is formed by a Version, a Codec (which indicates a multicodec-packed content type) and a Multihash.", - "type": [ - "string" - ] - } - ], - "type": [ - "array" - ] - }, - "required": true, - "deprecated": false - }, - "deprecated": false, - "externalDocs": { - "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6396" - } - }, - { - "name": "Filecoin.PiecesListPieces", - "description": "```go\nfunc (s *StorageMinerStruct) PiecesListPieces(p0 context.Context) ([]cid.Cid, error) {\n\tif s.Internal.PiecesListPieces == nil {\n\t\treturn *new([]cid.Cid), ErrNotSupported\n\t}\n\treturn s.Internal.PiecesListPieces(p0)\n}\n```", - "summary": "", - "paramStructure": "by-position", - "params": [], - "result": { - "name": "[]cid.Cid", - "description": "[]cid.Cid", - "summary": "", - "schema": { - "examples": [ - [ - { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - } - ] - ], - "items": [ - { - "title": "Content Identifier", - "description": "Cid represents a self-describing content addressed identifier. It is formed by a Version, a Codec (which indicates a multicodec-packed content type) and a Multihash.", - "type": [ - "string" - ] - } - ], - "type": [ - "array" - ] - }, - "required": true, - "deprecated": false - }, - "deprecated": false, - "externalDocs": { - "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6407" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5466" } }, { @@ -3831,7 +1118,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6418" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5477" } }, { @@ -3899,7 +1186,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6429" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5488" } }, { @@ -4030,7 +1317,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6440" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5499" } }, { @@ -4161,7 +1448,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6451" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5510" } }, { @@ -4261,7 +1548,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6462" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5521" } }, { @@ -4361,7 +1648,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6473" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5532" } }, { @@ -4461,7 +1748,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6484" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5543" } }, { @@ -4561,7 +1848,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6495" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5554" } }, { @@ -4661,7 +1948,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6506" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5565" } }, { @@ -4761,7 +2048,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6517" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5576" } }, { @@ -4885,7 +2172,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6528" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5587" } }, { @@ -5009,7 +2296,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6539" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5598" } }, { @@ -5124,7 +2411,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6550" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5609" } }, { @@ -5224,7 +2511,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6561" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5620" } }, { @@ -5357,7 +2644,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6572" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5631" } }, { @@ -5481,7 +2768,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6583" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5642" } }, { @@ -5605,7 +2892,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6594" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5653" } }, { @@ -5729,7 +3016,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6605" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5664" } }, { @@ -5862,7 +3149,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6616" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5675" } }, { @@ -5962,7 +3249,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6627" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5686" } }, { @@ -5980,8 +3267,7 @@ [ "Mining", "Sealing", - "SectorStorage", - "Markets" + "SectorStorage" ] ], "items": [ @@ -6003,7 +3289,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6638" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5697" } }, { @@ -6075,7 +3361,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6649" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5708" } }, { @@ -6125,7 +3411,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6660" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5719" } }, { @@ -6169,7 +3455,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6671" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5730" } }, { @@ -6210,7 +3496,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6682" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5741" } }, { @@ -6454,7 +3740,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6693" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5752" } }, { @@ -6528,7 +3814,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6704" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5763" } }, { @@ -6578,7 +3864,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6715" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5774" } }, { @@ -6607,7 +3893,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6726" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5785" } }, { @@ -6636,7 +3922,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6737" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5796" } }, { @@ -6692,7 +3978,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6748" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5807" } }, { @@ -6715,7 +4001,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6759" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5818" } }, { @@ -6775,7 +4061,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6770" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5829" } }, { @@ -6814,7 +4100,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6781" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5840" } }, { @@ -6854,7 +4140,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6792" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5851" } }, { @@ -6927,7 +4213,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6803" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5862" } }, { @@ -6991,7 +4277,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6814" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5873" } }, { @@ -7054,7 +4340,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6825" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5884" } }, { @@ -7104,7 +4390,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6836" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5895" } }, { @@ -7663,7 +4949,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6847" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5906" } }, { @@ -7704,7 +4990,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6858" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5917" } }, { @@ -7745,7 +5031,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6869" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5928" } }, { @@ -7786,7 +5072,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6880" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5939" } }, { @@ -7827,7 +5113,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6891" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5950" } }, { @@ -7868,7 +5154,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6902" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5961" } }, { @@ -7899,7 +5185,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6913" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5972" } }, { @@ -7949,7 +5235,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6924" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5983" } }, { @@ -7990,7 +5276,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6935" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5994" } }, { @@ -8029,7 +5315,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6946" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6005" } }, { @@ -8093,7 +5379,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6957" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6016" } }, { @@ -8151,7 +5437,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6968" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6027" } }, { @@ -8598,7 +5884,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6979" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6038" } }, { @@ -8634,7 +5920,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6990" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6049" } }, { @@ -8777,7 +6063,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7001" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6060" } }, { @@ -8833,7 +6119,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7012" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6071" } }, { @@ -8872,7 +6158,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7023" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6082" } }, { @@ -9049,7 +6335,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7034" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6093" } }, { @@ -9101,7 +6387,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7045" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6104" } }, { @@ -9293,7 +6579,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7056" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6115" } }, { @@ -9393,7 +6679,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7067" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6126" } }, { @@ -9447,7 +6733,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7078" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6137" } }, { @@ -9486,7 +6772,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7089" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6148" } }, { @@ -9571,7 +6857,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7100" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6159" } }, { @@ -9765,7 +7051,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7111" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6170" } }, { @@ -9863,7 +7149,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7122" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6181" } }, { @@ -9995,7 +7281,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7133" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6192" } }, { @@ -10049,7 +7335,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7144" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6203" } }, { @@ -10083,7 +7369,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7155" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6214" } }, { @@ -10170,7 +7456,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7166" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6225" } }, { @@ -10224,7 +7510,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7177" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6236" } }, { @@ -10324,7 +7610,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7188" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6247" } }, { @@ -10401,7 +7687,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7199" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6258" } }, { @@ -10492,7 +7778,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7210" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6269" } }, { @@ -10531,7 +7817,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7221" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6280" } }, { @@ -10647,7 +7933,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7232" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6291" } }, { @@ -12747,7 +10033,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7243" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6302" } } ] diff --git a/build/openrpc/worker.json b/build/openrpc/worker.json index fbd1f706a32..774d26395dc 100644 --- a/build/openrpc/worker.json +++ b/build/openrpc/worker.json @@ -161,7 +161,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7331" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6390" } }, { @@ -252,7 +252,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7342" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6401" } }, { @@ -420,7 +420,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7353" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6412" } }, { @@ -447,7 +447,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7364" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6423" } }, { @@ -597,7 +597,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7375" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6434" } }, { @@ -700,7 +700,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7386" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6445" } }, { @@ -803,7 +803,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7397" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6456" } }, { @@ -925,7 +925,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7408" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6467" } }, { @@ -1135,7 +1135,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7419" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6478" } }, { @@ -1306,7 +1306,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7430" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6489" } }, { @@ -3350,7 +3350,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7441" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6500" } }, { @@ -3470,7 +3470,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7452" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6511" } }, { @@ -3531,7 +3531,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7463" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6522" } }, { @@ -3569,7 +3569,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7474" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6533" } }, { @@ -3729,7 +3729,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7485" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6544" } }, { @@ -3913,7 +3913,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7496" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6555" } }, { @@ -4054,7 +4054,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7507" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6566" } }, { @@ -4107,7 +4107,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7518" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6577" } }, { @@ -4250,7 +4250,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7529" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6588" } }, { @@ -4474,7 +4474,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7540" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6599" } }, { @@ -4601,7 +4601,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7551" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6610" } }, { @@ -4768,7 +4768,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7562" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6621" } }, { @@ -4895,7 +4895,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7573" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6632" } }, { @@ -4933,7 +4933,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7584" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6643" } }, { @@ -4972,7 +4972,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7595" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6654" } }, { @@ -4995,7 +4995,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7606" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6665" } }, { @@ -5034,7 +5034,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7617" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6676" } }, { @@ -5057,7 +5057,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7628" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6687" } }, { @@ -5096,7 +5096,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7639" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6698" } }, { @@ -5130,7 +5130,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7650" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6709" } }, { @@ -5184,7 +5184,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7661" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6720" } }, { @@ -5223,7 +5223,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7672" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6731" } }, { @@ -5262,7 +5262,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7683" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6742" } }, { @@ -5297,7 +5297,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7694" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6753" } }, { @@ -5477,7 +5477,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7705" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6764" } }, { @@ -5506,7 +5506,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7716" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6775" } }, { @@ -5529,7 +5529,7 @@ "deprecated": false, "externalDocs": { "description": "Github remote link", - "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7727" + "url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L6786" } } ] diff --git a/chain/actors/builtin/miner/utils.go b/chain/actors/builtin/miner/utils.go index 072eab986bc..cafc0f33418 100644 --- a/chain/actors/builtin/miner/utils.go +++ b/chain/actors/builtin/miner/utils.go @@ -8,7 +8,16 @@ import ( "github.com/filecoin-project/go-state-types/network" ) +type SealProofVariant int + +const ( + SealProofVariant_Standard SealProofVariant = iota + SealProofVariant_Synthetic + SealProofVariant_NonInteractive +) + var MinSyntheticPoRepVersion = network.Version21 +var MinNonInteractivePoRepVersion = network.Version23 func AllPartSectors(mas State, sget func(Partition) (bitfield.BitField, error)) (bitfield.BitField, error) { var parts []bitfield.BitField @@ -33,7 +42,18 @@ func AllPartSectors(mas State, sget func(Partition) (bitfield.BitField, error)) // SealProofTypeFromSectorSize returns preferred seal proof type for creating // new miner actors and new sectors -func SealProofTypeFromSectorSize(ssize abi.SectorSize, nv network.Version, synthetic bool) (abi.RegisteredSealProof, error) { +func SealProofTypeFromSectorSize(ssize abi.SectorSize, nv network.Version, variant SealProofVariant) (abi.RegisteredSealProof, error) { + switch variant { + case SealProofVariant_Synthetic: + if nv < MinSyntheticPoRepVersion { + return 0, xerrors.Errorf("synthetic proofs are not supported on network version %d", nv) + } + case SealProofVariant_NonInteractive: + if nv < MinNonInteractivePoRepVersion { + return 0, xerrors.Errorf("non-interactive proofs are not supported on network version %d", nv) + } + } + switch { case nv < network.Version7: switch ssize { @@ -67,11 +87,13 @@ func SealProofTypeFromSectorSize(ssize abi.SectorSize, nv network.Version, synth return 0, xerrors.Errorf("unsupported sector size for miner: %v", ssize) } - if nv >= MinSyntheticPoRepVersion && synthetic { + switch variant { + case SealProofVariant_Synthetic: return toSynthetic(v) - } else { - return v, nil + case SealProofVariant_NonInteractive: + return toNonInteractive(v) } + return v, nil } return 0, xerrors.Errorf("unsupported network version") @@ -94,6 +116,23 @@ func toSynthetic(in abi.RegisteredSealProof) (abi.RegisteredSealProof, error) { } } +func toNonInteractive(in abi.RegisteredSealProof) (abi.RegisteredSealProof, error) { + switch in { + case abi.RegisteredSealProof_StackedDrg2KiBV1_1: + return abi.RegisteredSealProof_StackedDrg2KiBV1_2_Feat_NiPoRep, nil + case abi.RegisteredSealProof_StackedDrg8MiBV1_1: + return abi.RegisteredSealProof_StackedDrg8MiBV1_2_Feat_NiPoRep, nil + case abi.RegisteredSealProof_StackedDrg512MiBV1_1: + return abi.RegisteredSealProof_StackedDrg512MiBV1_2_Feat_NiPoRep, nil + case abi.RegisteredSealProof_StackedDrg32GiBV1_1: + return abi.RegisteredSealProof_StackedDrg32GiBV1_2_Feat_NiPoRep, nil + case abi.RegisteredSealProof_StackedDrg64GiBV1_1: + return abi.RegisteredSealProof_StackedDrg64GiBV1_2_Feat_NiPoRep, nil + default: + return 0, xerrors.Errorf("unsupported conversion to non-interactive: %v", in) + } +} + // WindowPoStProofTypeFromSectorSize returns preferred post proof type for creating // new miner actors and new sectors func WindowPoStProofTypeFromSectorSize(ssize abi.SectorSize, nv network.Version) (abi.RegisteredPoStProof, error) { diff --git a/chain/gen/genesis/miners.go b/chain/gen/genesis/miners.go index 9ae39cf35cb..c2c1d5e6f49 100644 --- a/chain/gen/genesis/miners.go +++ b/chain/gen/genesis/miners.go @@ -136,7 +136,11 @@ func SetupStorageMiners(ctx context.Context, cs *store.ChainStore, sys vm.Syscal i := i m := m - spt, err := miner.SealProofTypeFromSectorSize(m.SectorSize, nv, synthetic) + variant := miner.SealProofVariant_Standard + if synthetic { + variant = miner.SealProofVariant_Synthetic + } + spt, err := miner.SealProofTypeFromSectorSize(m.SectorSize, nv, variant) if err != nil { return cid.Undef, err } diff --git a/chain/sub/incoming.go b/chain/sub/incoming.go index b50ddc46779..42d270a95f5 100644 --- a/chain/sub/incoming.go +++ b/chain/sub/incoming.go @@ -16,6 +16,7 @@ import ( pubsub "github.com/libp2p/go-libp2p-pubsub" "github.com/libp2p/go-libp2p/core/connmgr" "github.com/libp2p/go-libp2p/core/peer" + mh "github.com/multiformats/go-multihash" "go.opencensus.io/stats" "go.opencensus.io/tag" "golang.org/x/xerrors" @@ -30,16 +31,16 @@ import ( "github.com/filecoin-project/lotus/chain/sub/ratelimit" "github.com/filecoin-project/lotus/chain/types" "github.com/filecoin-project/lotus/metrics" - "github.com/filecoin-project/lotus/node/impl/client" "github.com/filecoin-project/lotus/node/impl/full" ) var log = logging.Logger("sub") +var DefaultHashFunction = uint64(mh.BLAKE2B_MIN + 31) var msgCidPrefix = cid.Prefix{ Version: 1, Codec: cid.DagCBOR, - MhType: client.DefaultHashFunction, + MhType: DefaultHashFunction, MhLength: 32, } diff --git a/cli/clicommands/cmd.go b/cli/clicommands/cmd.go index a37ce329acc..791a11927d7 100644 --- a/cli/clicommands/cmd.go +++ b/cli/clicommands/cmd.go @@ -10,7 +10,6 @@ var Commands = []*cli.Command{ lcli.WithCategory("basic", lcli.SendCmd), lcli.WithCategory("basic", lcli.WalletCmd), lcli.WithCategory("basic", lcli.InfoCmd), - lcli.WithCategory("basic", lcli.ClientCmd), lcli.WithCategory("basic", lcli.MultisigCmd), lcli.WithCategory("basic", lcli.FilplusCmd), lcli.WithCategory("basic", lcli.PaychCmd), diff --git a/cli/client.go b/cli/client.go deleted file mode 100644 index e40a6686679..00000000000 --- a/cli/client.go +++ /dev/null @@ -1,2468 +0,0 @@ -package cli - -import ( - "bufio" - "context" - "encoding/json" - "errors" - "fmt" - "io" - "math" - "math/rand" - "os" - "path/filepath" - "sort" - "strconv" - "strings" - "sync" - "sync/atomic" - "text/tabwriter" - "time" - - tm "github.com/buger/goterm" - "github.com/chzyer/readline" - "github.com/docker/go-units" - "github.com/fatih/color" - "github.com/ipfs/go-cid" - "github.com/ipfs/go-cidutil/cidenc" - "github.com/libp2p/go-libp2p/core/peer" - "github.com/multiformats/go-multibase" - "github.com/urfave/cli/v2" - "golang.org/x/xerrors" - - "github.com/filecoin-project/go-address" - datatransfer "github.com/filecoin-project/go-data-transfer/v2" - "github.com/filecoin-project/go-fil-markets/retrievalmarket" - "github.com/filecoin-project/go-fil-markets/storagemarket" - "github.com/filecoin-project/go-state-types/abi" - "github.com/filecoin-project/go-state-types/big" - - "github.com/filecoin-project/lotus/api" - lapi "github.com/filecoin-project/lotus/api" - "github.com/filecoin-project/lotus/api/v0api" - "github.com/filecoin-project/lotus/build" - "github.com/filecoin-project/lotus/chain/actors/builtin" - "github.com/filecoin-project/lotus/chain/actors/builtin/market" - "github.com/filecoin-project/lotus/chain/types" - "github.com/filecoin-project/lotus/lib/tablewriter" - "github.com/filecoin-project/lotus/node/repo/imports" -) - -var CidBaseFlag = cli.StringFlag{ - Name: "cid-base", - Hidden: true, - Value: "base32", - Usage: "Multibase encoding used for version 1 CIDs in output.", - DefaultText: "base32", -} - -// GetCidEncoder returns an encoder using the `cid-base` flag if provided, or -// the default (Base32) encoder if not. -func GetCidEncoder(cctx *cli.Context) (cidenc.Encoder, error) { - val := cctx.String("cid-base") - - e := cidenc.Encoder{Base: multibase.MustNewEncoder(multibase.Base32)} - - if val != "" { - var err error - e.Base, err = multibase.EncoderByName(val) - if err != nil { - return e, err - } - } - - return e, nil -} - -var ClientCmd = &cli.Command{ - Name: "client", - Usage: "Make deals, store data, retrieve data", - Subcommands: []*cli.Command{ - WithCategory("storage", clientDealCmd), - WithCategory("storage", clientQueryAskCmd), - WithCategory("storage", clientListDeals), - WithCategory("storage", clientGetDealCmd), - WithCategory("storage", clientListAsksCmd), - WithCategory("storage", clientDealStatsCmd), - WithCategory("storage", clientInspectDealCmd), - WithCategory("data", clientImportCmd), - WithCategory("data", clientDropCmd), - WithCategory("data", clientLocalCmd), - WithCategory("data", clientStat), - WithCategory("retrieval", clientFindCmd), - WithCategory("retrieval", clientQueryRetrievalAskCmd), - WithCategory("retrieval", clientRetrieveCmd), - WithCategory("retrieval", clientRetrieveCatCmd), - WithCategory("retrieval", clientRetrieveLsCmd), - WithCategory("retrieval", clientCancelRetrievalDealCmd), - WithCategory("retrieval", clientListRetrievalsCmd), - WithCategory("util", clientCommPCmd), - WithCategory("util", clientCarGenCmd), - WithCategory("util", clientBalancesCmd), - WithCategory("util", clientListTransfers), - WithCategory("util", clientRestartTransfer), - WithCategory("util", clientCancelTransfer), - }, -} - -var clientImportCmd = &cli.Command{ - Name: "import", - Usage: "Import data", - ArgsUsage: "[inputPath]", - Flags: []cli.Flag{ - &cli.BoolFlag{ - Name: "car", - Usage: "import from a car file instead of a regular file", - }, - &cli.BoolFlag{ - Name: "quiet", - Aliases: []string{"q"}, - Usage: "Output root CID only", - }, - &CidBaseFlag, - }, - Action: func(cctx *cli.Context) error { - api, closer, err := GetFullNodeAPI(cctx) - if err != nil { - return err - } - defer closer() - ctx := ReqContext(cctx) - - if cctx.NArg() != 1 { - return IncorrectNumArgs(cctx) - } - - absPath, err := filepath.Abs(cctx.Args().First()) - if err != nil { - return err - } - - ref := lapi.FileRef{ - Path: absPath, - IsCAR: cctx.Bool("car"), - } - c, err := api.ClientImport(ctx, ref) - if err != nil { - return err - } - - encoder, err := GetCidEncoder(cctx) - if err != nil { - return err - } - - if !cctx.Bool("quiet") { - fmt.Printf("Import %d, Root ", c.ImportID) - } - fmt.Println(encoder.Encode(c.Root)) - - return nil - }, -} - -var clientDropCmd = &cli.Command{ - Name: "drop", - Usage: "Remove import", - ArgsUsage: "[import ID...]", - Action: func(cctx *cli.Context) error { - if cctx.NArg() != 1 { - return IncorrectNumArgs(cctx) - } - - api, closer, err := GetFullNodeAPI(cctx) - if err != nil { - return err - } - defer closer() - ctx := ReqContext(cctx) - - var ids []uint64 - for i, s := range cctx.Args().Slice() { - id, err := strconv.ParseUint(s, 10, 64) - if err != nil { - return xerrors.Errorf("parsing %d-th import ID: %w", i, err) - } - - ids = append(ids, id) - } - - for _, id := range ids { - if err := api.ClientRemoveImport(ctx, imports.ID(id)); err != nil { - return xerrors.Errorf("removing import %d: %w", id, err) - } - } - - return nil - }, -} - -var clientCommPCmd = &cli.Command{ - Name: "commP", - Usage: "Calculate the piece-cid (commP) of a CAR file", - ArgsUsage: "[inputFile]", - Flags: []cli.Flag{ - &CidBaseFlag, - }, - Action: func(cctx *cli.Context) error { - api, closer, err := GetFullNodeAPI(cctx) - if err != nil { - return err - } - defer closer() - ctx := ReqContext(cctx) - - if cctx.NArg() != 1 { - return IncorrectNumArgs(cctx) - } - - ret, err := api.ClientCalcCommP(ctx, cctx.Args().Get(0)) - if err != nil { - return err - } - - encoder, err := GetCidEncoder(cctx) - if err != nil { - return err - } - - fmt.Println("CID: ", encoder.Encode(ret.Root)) - fmt.Println("Piece size: ", types.SizeStr(types.NewInt(uint64(ret.Size)))) - fmt.Println("Piece size in bytes: ", types.NewInt(uint64(ret.Size))) - return nil - }, -} - -var clientCarGenCmd = &cli.Command{ - Name: "generate-car", - Usage: "Generate a car file from input", - ArgsUsage: "[inputPath outputPath]", - Action: func(cctx *cli.Context) error { - api, closer, err := GetFullNodeAPI(cctx) - if err != nil { - return err - } - defer closer() - ctx := ReqContext(cctx) - - if cctx.NArg() != 2 { - return IncorrectNumArgs(cctx) - } - - ref := lapi.FileRef{ - Path: cctx.Args().First(), - IsCAR: false, - } - - op := cctx.Args().Get(1) - - if err = api.ClientGenCar(ctx, ref, op); err != nil { - return err - } - return nil - }, -} - -var clientLocalCmd = &cli.Command{ - Name: "local", - Usage: "List locally imported data", - Flags: []cli.Flag{ - &CidBaseFlag, - }, - Action: func(cctx *cli.Context) error { - api, closer, err := GetFullNodeAPI(cctx) - if err != nil { - return err - } - defer closer() - ctx := ReqContext(cctx) - - list, err := api.ClientListImports(ctx) - if err != nil { - return err - } - - encoder, err := GetCidEncoder(cctx) - if err != nil { - return err - } - - sort.Slice(list, func(i, j int) bool { - return list[i].Key < list[j].Key - }) - - for _, v := range list { - cidStr := "" - if v.Root != nil { - cidStr = encoder.Encode(*v.Root) - } - - fmt.Printf("%d: %s @%s (%s)\n", v.Key, cidStr, v.FilePath, v.Source) - if v.Err != "" { - fmt.Printf("\terror: %s\n", v.Err) - } - } - return nil - }, -} - -var clientDealCmd = &cli.Command{ - Name: "deal", - Usage: "Initialize storage deal with a miner", - Description: `Make a deal with a miner. -dataCid comes from running 'lotus client import'. -miner is the address of the miner you wish to make a deal with. -price is measured in FIL/Epoch. Miners usually don't accept a bid -lower than their advertised ask (which is in FIL/GiB/Epoch). You can check a miners listed price -with 'lotus client query-ask '. -duration is how long the miner should store the data for, in blocks. -The minimum value is 518400 (6 months).`, - ArgsUsage: "[dataCid miner price duration]", - Flags: []cli.Flag{ - &cli.StringFlag{ - Name: "manual-piece-cid", - Usage: "manually specify piece commitment for data (dataCid must be to a car file)", - }, - &cli.Int64Flag{ - Name: "manual-piece-size", - Usage: "if manually specifying piece cid, used to specify size (dataCid must be to a car file)", - }, - &cli.BoolFlag{ - Name: "manual-stateless-deal", - Usage: "instructs the node to send an offline deal without registering it with the deallist/fsm", - }, - &cli.StringFlag{ - Name: "from", - Usage: "specify address to fund the deal with", - }, - &cli.Int64Flag{ - Name: "start-epoch", - Usage: "specify the epoch that the deal should start at", - Value: -1, - }, - &cli.BoolFlag{ - Name: "fast-retrieval", - Usage: "indicates that data should be available for fast retrieval", - Value: true, - }, - &cli.BoolFlag{ - Name: "verified-deal", - Usage: "indicate that the deal counts towards verified client total", - DefaultText: "true if client is verified, false otherwise", - }, - &cli.StringFlag{ - Name: "provider-collateral", - Usage: "specify the requested provider collateral the miner should put up", - }, - &CidBaseFlag, - }, - Action: func(cctx *cli.Context) error { - - expectedArgsMsg := "expected 4 args: dataCid, miner, price, duration" - - if !cctx.Args().Present() { - if cctx.Bool("manual-stateless-deal") { - return xerrors.New("--manual-stateless-deal can not be combined with interactive deal mode: you must specify the " + expectedArgsMsg) - } - return interactiveDeal(cctx) - } - - api, closer, err := GetFullNodeAPI(cctx) - if err != nil { - return err - } - defer closer() - ctx := ReqContext(cctx) - afmt := NewAppFmt(cctx.App) - - if cctx.NArg() != 4 { - return IncorrectNumArgs(cctx) - } - - // [data, miner, price, dur] - - data, err := cid.Parse(cctx.Args().Get(0)) - if err != nil { - return err - } - - miner, err := address.NewFromString(cctx.Args().Get(1)) - if err != nil { - return err - } - - price, err := types.ParseFIL(cctx.Args().Get(2)) - if err != nil { - return err - } - - dur, err := strconv.ParseInt(cctx.Args().Get(3), 10, 32) - if err != nil { - return err - } - - var provCol big.Int - if pcs := cctx.String("provider-collateral"); pcs != "" { - pc, err := big.FromString(pcs) - if err != nil { - return fmt.Errorf("failed to parse provider-collateral: %w", err) - } - provCol = pc - } - - if abi.ChainEpoch(dur) < build.MinDealDuration { - return xerrors.Errorf("minimum deal duration is %d blocks", build.MinDealDuration) - } - if abi.ChainEpoch(dur) > build.MaxDealDuration { - return xerrors.Errorf("maximum deal duration is %d blocks", build.MaxDealDuration) - } - - var a address.Address - if from := cctx.String("from"); from != "" { - faddr, err := address.NewFromString(from) - if err != nil { - return xerrors.Errorf("failed to parse 'from' address: %w", err) - } - a = faddr - } else { - def, err := api.WalletDefaultAddress(ctx) - if err != nil { - return err - } - a = def - } - - ref := &storagemarket.DataRef{ - TransferType: storagemarket.TTGraphsync, - Root: data, - } - - if mpc := cctx.String("manual-piece-cid"); mpc != "" { - c, err := cid.Parse(mpc) - if err != nil { - return xerrors.Errorf("failed to parse provided manual piece cid: %w", err) - } - - ref.PieceCid = &c - - psize := cctx.Int64("manual-piece-size") - if psize == 0 { - return xerrors.Errorf("must specify piece size when manually setting cid") - } - - ref.PieceSize = abi.UnpaddedPieceSize(psize) - - ref.TransferType = storagemarket.TTManual - } - - // Check if the address is a verified client - dcap, err := api.StateVerifiedClientStatus(ctx, a, types.EmptyTSK) - if err != nil { - return err - } - - isVerified := dcap != nil - - // If the user has explicitly set the --verified-deal flag - if cctx.IsSet("verified-deal") { - // If --verified-deal is true, but the address is not a verified - // client, return an error - verifiedDealParam := cctx.Bool("verified-deal") - if verifiedDealParam && !isVerified { - return xerrors.Errorf("address %s does not have verified client status", a) - } - - // Override the default - isVerified = verifiedDealParam - } - - sdParams := &lapi.StartDealParams{ - Data: ref, - Wallet: a, - Miner: miner, - EpochPrice: types.BigInt(price), - MinBlocksDuration: uint64(dur), - DealStartEpoch: abi.ChainEpoch(cctx.Int64("start-epoch")), - FastRetrieval: cctx.Bool("fast-retrieval"), - VerifiedDeal: isVerified, - ProviderCollateral: provCol, - } - - var proposal *cid.Cid - if cctx.Bool("manual-stateless-deal") { - if ref.TransferType != storagemarket.TTManual || price.Int64() != 0 { - return xerrors.New("when manual-stateless-deal is enabled, you must also provide a 'price' of 0 and specify 'manual-piece-cid' and 'manual-piece-size'") - } - proposal, err = api.ClientStatelessDeal(ctx, sdParams) - } else { - proposal, err = api.ClientStartDeal(ctx, sdParams) - } - - if err != nil { - return err - } - - encoder, err := GetCidEncoder(cctx) - if err != nil { - return err - } - - afmt.Println(encoder.Encode(*proposal)) - - return nil - }, -} - -func interactiveDeal(cctx *cli.Context) error { - api, closer, err := GetFullNodeAPIV1(cctx) - if err != nil { - return err - } - defer closer() - ctx := ReqContext(cctx) - ctx, cancel := context.WithCancel(ctx) - defer cancel() - afmt := NewAppFmt(cctx.App) - - state := "import" - gib := types.NewInt(1 << 30) - - var data cid.Cid - var days int - var maddrs []address.Address - var ask []storagemarket.StorageAsk - var epochPrices []big.Int - var dur time.Duration - var epochs abi.ChainEpoch - var verified bool - var ds lapi.DataCIDSize - - // find - var candidateAsks []QueriedAsk - var budget types.FIL - var dealCount int64 - var medianPing, maxAcceptablePing time.Duration - - var a address.Address - if from := cctx.String("from"); from != "" { - faddr, err := address.NewFromString(from) - if err != nil { - return xerrors.Errorf("failed to parse 'from' address: %w", err) - } - a = faddr - } else { - def, err := api.WalletDefaultAddress(ctx) - if err != nil { - return err - } - a = def - } - - if _, err := api.StateGetActor(ctx, a, types.EmptyTSK); err != nil { - return xerrors.Errorf("address not initialized on chain: %w", err) - } - - fromBal, err := api.WalletBalance(ctx, a) - if err != nil { - return xerrors.Errorf("checking from address balance: %w", err) - } - - printErr := func(err error) { - afmt.Printf("%s %s\n", color.RedString("Error:"), err.Error()) - } - - cs := readline.NewCancelableStdin(afmt.Stdin) - go func() { - <-ctx.Done() - _ = cs.Close() - }() - - rl := bufio.NewReader(cs) - -uiLoop: - for { - // TODO: better exit handling - if err := ctx.Err(); err != nil { - return err - } - - switch state { - case "import": - afmt.Print("Data CID (from " + color.YellowString("lotus client import") + "): ") - - _cidStr, _, err := rl.ReadLine() - cidStr := string(_cidStr) - if err != nil { - printErr(xerrors.Errorf("reading cid string: %w", err)) - continue - } - - data, err = cid.Parse(cidStr) - if err != nil { - printErr(xerrors.Errorf("parsing cid string: %w", err)) - continue - } - - color.Blue(".. calculating data size\n") - ds, err = api.ClientDealPieceCID(ctx, data) - if err != nil { - return err - } - - state = "duration" - case "duration": - afmt.Print("Deal duration (days): ") - - _daystr, _, err := rl.ReadLine() - daystr := string(_daystr) - if err != nil { - return err - } - - _, err = fmt.Sscan(daystr, &days) - if err != nil { - printErr(xerrors.Errorf("parsing duration: %w", err)) - continue - } - - minDealDurationDays := uint64(build.MinDealDuration) / (builtin.SecondsInDay / build.BlockDelaySecs) - if days < int(minDealDurationDays) { - printErr(xerrors.Errorf("minimum duration is %d days, got %d", minDealDurationDays, days)) - continue - } - - maxDealDurationDays := uint64(build.MaxDealDuration) / (builtin.SecondsInDay / build.BlockDelaySecs) - if days > int(maxDealDurationDays) { - printErr(xerrors.Errorf("maximum duration is %d days, got %d", maxDealDurationDays, days)) - continue - } - - dur = 24 * time.Hour * time.Duration(days) - epochs = abi.ChainEpoch(dur / (time.Duration(build.BlockDelaySecs) * time.Second)) - - state = "verified" - case "verified": - ts, err := api.ChainHead(ctx) - if err != nil { - return err - } - - dcap, err := api.StateVerifiedClientStatus(ctx, a, ts.Key()) - if err != nil { - return err - } - - if dcap == nil { - state = "miner" - continue - } - - if dcap.Uint64() < uint64(ds.PieceSize) { - color.Yellow(".. not enough DataCap available for a verified deal\n") - state = "miner" - continue - } - - afmt.Print("\nMake this a verified deal? (yes/no): ") - - _yn, _, err := rl.ReadLine() - yn := string(_yn) - if err != nil { - return err - } - - switch yn { - case "yes": - verified = true - case "no": - verified = false - default: - afmt.Println("Type in full 'yes' or 'no'") - continue - } - - state = "miner" - case "miner": - maddrs = maddrs[:0] - ask = ask[:0] - afmt.Print("Miner Addresses (f0.. f0..), none to find: ") - - _maddrsStr, _, err := rl.ReadLine() - maddrsStr := string(_maddrsStr) - if err != nil { - printErr(xerrors.Errorf("reading miner address: %w", err)) - continue - } - - for _, s := range strings.Fields(maddrsStr) { - maddr, err := address.NewFromString(strings.TrimSpace(s)) - if err != nil { - printErr(xerrors.Errorf("parsing miner address: %w", err)) - continue uiLoop - } - - maddrs = append(maddrs, maddr) - } - - state = "query" - if len(maddrs) == 0 { - state = "find" - } - case "find": - asks, err := GetAsks(ctx, api) - if err != nil { - return err - } - - if len(asks) == 0 { - printErr(xerrors.Errorf("no asks found")) - continue uiLoop - } - - medianPing = asks[len(asks)/2].Ping - var avgPing time.Duration - for _, ask := range asks { - avgPing += ask.Ping - } - avgPing /= time.Duration(len(asks)) - - for _, ask := range asks { - if ask.Ask.MinPieceSize > ds.PieceSize { - continue - } - if ask.Ask.MaxPieceSize < ds.PieceSize { - continue - } - candidateAsks = append(candidateAsks, ask) - } - - afmt.Printf("Found %d candidate asks\n", len(candidateAsks)) - afmt.Printf("Average network latency: %s; Median latency: %s\n", avgPing.Truncate(time.Millisecond), medianPing.Truncate(time.Millisecond)) - state = "max-ping" - case "max-ping": - maxAcceptablePing = medianPing - - afmt.Printf("Maximum network latency (default: %s) (ms): ", maxAcceptablePing.Truncate(time.Millisecond)) - _latStr, _, err := rl.ReadLine() - latStr := string(_latStr) - if err != nil { - printErr(xerrors.Errorf("reading maximum latency: %w", err)) - continue - } - - if latStr != "" { - maxMs, err := strconv.ParseInt(latStr, 10, 64) - if err != nil { - printErr(xerrors.Errorf("parsing FIL: %w", err)) - continue uiLoop - } - - maxAcceptablePing = time.Millisecond * time.Duration(maxMs) - } - - var goodAsks []QueriedAsk - for _, candidateAsk := range candidateAsks { - if candidateAsk.Ping < maxAcceptablePing { - goodAsks = append(goodAsks, candidateAsk) - } - } - - if len(goodAsks) == 0 { - afmt.Printf("no asks left after filtering for network latency\n") - continue uiLoop - } - - afmt.Printf("%d asks left after filtering for network latency\n", len(goodAsks)) - candidateAsks = goodAsks - - state = "find-budget" - case "find-budget": - afmt.Printf("Proposing from %s, Current Balance: %s\n", a, types.FIL(fromBal)) - afmt.Print("Maximum budget (FIL): ") // TODO: Propose some default somehow? - - _budgetStr, _, err := rl.ReadLine() - budgetStr := string(_budgetStr) - if err != nil { - printErr(xerrors.Errorf("reading miner address: %w", err)) - continue - } - - budget, err = types.ParseFIL(budgetStr) - if err != nil { - printErr(xerrors.Errorf("parsing FIL: %w", err)) - continue uiLoop - } - - var goodAsks []QueriedAsk - for _, ask := range candidateAsks { - p := ask.Ask.Price - if verified { - p = ask.Ask.VerifiedPrice - } - - epochPrice := types.BigDiv(types.BigMul(p, types.NewInt(uint64(ds.PieceSize))), gib) - totalPrice := types.BigMul(epochPrice, types.NewInt(uint64(epochs))) - - if totalPrice.LessThan(abi.TokenAmount(budget)) { - goodAsks = append(goodAsks, ask) - } - } - candidateAsks = goodAsks - afmt.Printf("%d asks within budget\n", len(candidateAsks)) - state = "find-count" - case "find-count": - afmt.Print("Deals to make (1): ") - dealcStr, _, err := rl.ReadLine() - if err != nil { - printErr(xerrors.Errorf("reading deal count: %w", err)) - continue - } - - dealCount, err = strconv.ParseInt(string(dealcStr), 10, 64) - if err != nil { - printErr(xerrors.Errorf("reading deal count: invalid number")) - continue - } - - color.Blue(".. Picking miners") - - // TODO: some better strategy (this tries to pick randomly) - var pickedAsks []*storagemarket.StorageAsk - pickLoop: - for i := 0; i < 64; i++ { - rand.Shuffle(len(candidateAsks), func(i, j int) { - candidateAsks[i], candidateAsks[j] = candidateAsks[j], candidateAsks[i] - }) - - remainingBudget := abi.TokenAmount(budget) - pickedAsks = []*storagemarket.StorageAsk{} - - for _, ask := range candidateAsks { - p := ask.Ask.Price - if verified { - p = ask.Ask.VerifiedPrice - } - - epochPrice := types.BigDiv(types.BigMul(p, types.NewInt(uint64(ds.PieceSize))), gib) - totalPrice := types.BigMul(epochPrice, types.NewInt(uint64(epochs))) - - if totalPrice.GreaterThan(remainingBudget) { - continue - } - - pickedAsks = append(pickedAsks, ask.Ask) - remainingBudget = big.Sub(remainingBudget, totalPrice) - - if len(pickedAsks) == int(dealCount) { - break pickLoop - } - } - } - - for _, pickedAsk := range pickedAsks { - maddrs = append(maddrs, pickedAsk.Miner) - ask = append(ask, *pickedAsk) - } - - state = "confirm" - case "query": - color.Blue(".. querying miner asks") - - for _, maddr := range maddrs { - mi, err := api.StateMinerInfo(ctx, maddr, types.EmptyTSK) - if err != nil { - printErr(xerrors.Errorf("failed to get peerID for miner: %w", err)) - state = "miner" - continue uiLoop - } - - a, err := api.ClientQueryAsk(ctx, *mi.PeerId, maddr) - if err != nil { - printErr(xerrors.Errorf("failed to query ask for miner %s: %w", maddr.String(), err)) - state = "miner" - continue uiLoop - } - - ask = append(ask, *a.Response) - } - - // TODO: run more validation - state = "confirm" - case "confirm": - // TODO: do some more or epochs math (round to miner PP, deal start buffer) - - afmt.Printf("-----\n") - afmt.Printf("Proposing from %s\n", a) - afmt.Printf("\tBalance: %s\n", types.FIL(fromBal)) - afmt.Printf("\n") - afmt.Printf("Piece size: %s (Payload size: %s)\n", units.BytesSize(float64(ds.PieceSize)), units.BytesSize(float64(ds.PayloadSize))) - afmt.Printf("Duration: %s\n", dur) - - pricePerGib := big.Zero() - for _, a := range ask { - p := a.Price - if verified { - p = a.VerifiedPrice - } - pricePerGib = big.Add(pricePerGib, p) - epochPrice := types.BigDiv(types.BigMul(p, types.NewInt(uint64(ds.PieceSize))), gib) - epochPrices = append(epochPrices, epochPrice) - - mpow, err := api.StateMinerPower(ctx, a.Miner, types.EmptyTSK) - if err != nil { - return xerrors.Errorf("getting power (%s): %w", a.Miner, err) - } - - if len(ask) > 1 { - totalPrice := types.BigMul(epochPrice, types.NewInt(uint64(epochs))) - afmt.Printf("Miner %s (Power:%s) price: ~%s (%s per epoch)\n", color.YellowString(a.Miner.String()), color.GreenString(types.SizeStr(mpow.MinerPower.QualityAdjPower)), color.BlueString(types.FIL(totalPrice).String()), types.FIL(epochPrice)) - } - } - - // TODO: price is based on PaddedPieceSize, right? - epochPrice := types.BigDiv(types.BigMul(pricePerGib, types.NewInt(uint64(ds.PieceSize))), gib) - totalPrice := types.BigMul(epochPrice, types.NewInt(uint64(epochs))) - - afmt.Printf("Total price: ~%s (%s per epoch)\n", color.CyanString(types.FIL(totalPrice).String()), types.FIL(epochPrice)) - afmt.Printf("Verified: %v\n", verified) - - state = "accept" - case "accept": - afmt.Print("\nAccept (yes/no): ") - - _yn, _, err := rl.ReadLine() - yn := string(_yn) - if err != nil { - return err - } - - if yn == "no" { - return nil - } - - if yn != "yes" { - afmt.Println("Type in full 'yes' or 'no'") - continue - } - - state = "execute" - case "execute": - color.Blue(".. executing\n") - - for i, maddr := range maddrs { - proposal, err := api.ClientStartDeal(ctx, &lapi.StartDealParams{ - Data: &storagemarket.DataRef{ - TransferType: storagemarket.TTGraphsync, - Root: data, - - PieceCid: &ds.PieceCID, - PieceSize: ds.PieceSize.Unpadded(), - }, - Wallet: a, - Miner: maddr, - EpochPrice: epochPrices[i], - MinBlocksDuration: uint64(epochs), - DealStartEpoch: abi.ChainEpoch(cctx.Int64("start-epoch")), - FastRetrieval: cctx.Bool("fast-retrieval"), - VerifiedDeal: verified, - }) - if err != nil { - return err - } - - encoder, err := GetCidEncoder(cctx) - if err != nil { - return err - } - - afmt.Printf("Deal (%s) CID: %s\n", maddr, color.GreenString(encoder.Encode(*proposal))) - } - - return nil - default: - return xerrors.Errorf("unknown state: %s", state) - } - } -} - -var clientFindCmd = &cli.Command{ - Name: "find", - Usage: "Find data in the network", - ArgsUsage: "[dataCid]", - Flags: []cli.Flag{ - &cli.StringFlag{ - Name: "pieceCid", - Usage: "require data to be retrieved from a specific Piece CID", - }, - }, - Action: func(cctx *cli.Context) error { - if cctx.NArg() != 1 { - return IncorrectNumArgs(cctx) - } - - file, err := cid.Parse(cctx.Args().First()) - if err != nil { - return err - } - - api, closer, err := GetFullNodeAPI(cctx) - if err != nil { - return err - } - defer closer() - ctx := ReqContext(cctx) - - // Check if we already have this data locally - - has, err := api.ClientHasLocal(ctx, file) - if err != nil { - return err - } - - if has { - fmt.Println("LOCAL") - } - - var pieceCid *cid.Cid - if cctx.String("pieceCid") != "" { - parsed, err := cid.Parse(cctx.String("pieceCid")) - if err != nil { - return err - } - pieceCid = &parsed - } - - offers, err := api.ClientFindData(ctx, file, pieceCid) - if err != nil { - return err - } - - for _, offer := range offers { - if offer.Err != "" { - fmt.Printf("ERR %s@%s: %s\n", offer.Miner, offer.MinerPeer.ID, offer.Err) - continue - } - fmt.Printf("RETRIEVAL %s@%s-%s-%s\n", offer.Miner, offer.MinerPeer.ID, types.FIL(offer.MinPrice), types.SizeStr(types.NewInt(offer.Size))) - } - - return nil - }, -} - -var clientQueryRetrievalAskCmd = &cli.Command{ - Name: "retrieval-ask", - Usage: "Get a miner's retrieval ask", - ArgsUsage: "[minerAddress] [data CID]", - Flags: []cli.Flag{ - &cli.Int64Flag{ - Name: "size", - Usage: "data size in bytes", - }, - }, - Action: func(cctx *cli.Context) error { - afmt := NewAppFmt(cctx.App) - if cctx.NArg() != 2 { - return IncorrectNumArgs(cctx) - } - - maddr, err := address.NewFromString(cctx.Args().First()) - if err != nil { - return err - } - - dataCid, err := cid.Parse(cctx.Args().Get(1)) - if err != nil { - return fmt.Errorf("parsing data cid: %w", err) - } - - api, closer, err := GetFullNodeAPI(cctx) - if err != nil { - return err - } - defer closer() - ctx := ReqContext(cctx) - - ask, err := api.ClientMinerQueryOffer(ctx, maddr, dataCid, nil) - if err != nil { - return err - } - - afmt.Printf("Ask: %s\n", maddr) - afmt.Printf("Unseal price: %s\n", types.FIL(ask.UnsealPrice)) - afmt.Printf("Price per byte: %s\n", types.FIL(ask.PricePerByte)) - afmt.Printf("Payment interval: %s\n", types.SizeStr(types.NewInt(ask.PaymentInterval))) - afmt.Printf("Payment interval increase: %s\n", types.SizeStr(types.NewInt(ask.PaymentIntervalIncrease))) - - size := cctx.Uint64("size") - if size == 0 { - if ask.Size == 0 { - return nil - } - size = ask.Size - afmt.Printf("Size: %s\n", types.SizeStr(types.NewInt(ask.Size))) - } - transferPrice := types.BigMul(ask.PricePerByte, types.NewInt(size)) - totalPrice := types.BigAdd(ask.UnsealPrice, transferPrice) - afmt.Printf("Total price for %d bytes: %s\n", size, types.FIL(totalPrice)) - - return nil - }, -} - -var clientListRetrievalsCmd = &cli.Command{ - Name: "list-retrievals", - Usage: "List retrieval market deals", - Flags: []cli.Flag{ - &cli.BoolFlag{ - Name: "verbose", - Aliases: []string{"v"}, - Usage: "print verbose deal details", - }, - &cli.BoolFlag{ - Name: "show-failed", - Usage: "show failed/failing deals", - Value: true, - }, - &cli.BoolFlag{ - Name: "completed", - Usage: "show completed retrievals", - }, - &cli.BoolFlag{ - Name: "watch", - Usage: "watch deal updates in real-time, rather than a one time list", - }, - }, - Action: func(cctx *cli.Context) error { - api, closer, err := GetFullNodeAPI(cctx) - if err != nil { - return err - } - defer closer() - ctx := ReqContext(cctx) - - verbose := cctx.Bool("verbose") - watch := cctx.Bool("watch") - showFailed := cctx.Bool("show-failed") - completed := cctx.Bool("completed") - - localDeals, err := api.ClientListRetrievals(ctx) - if err != nil { - return err - } - - if watch { - updates, err := api.ClientGetRetrievalUpdates(ctx) - if err != nil { - return err - } - - for { - tm.Clear() - tm.MoveCursor(1, 1) - - err = outputRetrievalDeals(ctx, tm.Screen, localDeals, verbose, showFailed, completed) - if err != nil { - return err - } - - tm.Flush() - - select { - case <-ctx.Done(): - return nil - case updated := <-updates: - var found bool - for i, existing := range localDeals { - if existing.ID == updated.ID { - localDeals[i] = updated - found = true - break - } - } - if !found { - localDeals = append(localDeals, updated) - } - } - } - } - - return outputRetrievalDeals(ctx, cctx.App.Writer, localDeals, verbose, showFailed, completed) - }, -} - -func isTerminalError(status retrievalmarket.DealStatus) bool { - // should patch this in go-fil-markets but to solve the problem immediate and not have buggy output - return retrievalmarket.IsTerminalError(status) || status == retrievalmarket.DealStatusErrored || status == retrievalmarket.DealStatusCancelled -} -func outputRetrievalDeals(ctx context.Context, out io.Writer, localDeals []lapi.RetrievalInfo, verbose bool, showFailed bool, completed bool) error { - var deals []api.RetrievalInfo - for _, deal := range localDeals { - if !showFailed && isTerminalError(deal.Status) { - continue - } - if !completed && retrievalmarket.IsTerminalSuccess(deal.Status) { - continue - } - deals = append(deals, deal) - } - - tableColumns := []tablewriter.Column{ - tablewriter.Col("PayloadCID"), - tablewriter.Col("DealId"), - tablewriter.Col("Provider"), - tablewriter.Col("Status"), - tablewriter.Col("PricePerByte"), - tablewriter.Col("Received"), - tablewriter.Col("TotalPaid"), - } - - if verbose { - tableColumns = append(tableColumns, - tablewriter.Col("PieceCID"), - tablewriter.Col("UnsealPrice"), - tablewriter.Col("BytesPaidFor"), - tablewriter.Col("TransferChannelID"), - tablewriter.Col("TransferStatus"), - ) - } - tableColumns = append(tableColumns, tablewriter.NewLineCol("Message")) - - w := tablewriter.New(tableColumns...) - - for _, d := range deals { - w.Write(toRetrievalOutput(d, verbose)) - } - - return w.Flush(out) -} - -func toRetrievalOutput(d api.RetrievalInfo, verbose bool) map[string]interface{} { - - payloadCID := d.PayloadCID.String() - provider := d.Provider.String() - if !verbose { - payloadCID = ellipsis(payloadCID, 8) - provider = ellipsis(provider, 8) - } - - retrievalOutput := map[string]interface{}{ - "PayloadCID": payloadCID, - "DealId": d.ID, - "Provider": provider, - "Status": retrievalStatusString(d.Status), - "PricePerByte": types.FIL(d.PricePerByte), - "Received": units.BytesSize(float64(d.BytesReceived)), - "TotalPaid": types.FIL(d.TotalPaid), - "Message": d.Message, - } - - if verbose { - transferChannelID := "" - if d.TransferChannelID != nil { - transferChannelID = d.TransferChannelID.String() - } - transferStatus := "" - if d.DataTransfer != nil { - transferStatus = datatransfer.Statuses[d.DataTransfer.Status] - } - pieceCID := "" - if d.PieceCID != nil { - pieceCID = d.PieceCID.String() - } - - retrievalOutput["PieceCID"] = pieceCID - retrievalOutput["UnsealPrice"] = types.FIL(d.UnsealPrice) - retrievalOutput["BytesPaidFor"] = units.BytesSize(float64(d.BytesPaidFor)) - retrievalOutput["TransferChannelID"] = transferChannelID - retrievalOutput["TransferStatus"] = transferStatus - } - return retrievalOutput -} - -func retrievalStatusString(status retrievalmarket.DealStatus) string { - s := retrievalmarket.DealStatuses[status] - - switch { - case isTerminalError(status): - return color.RedString(s) - case retrievalmarket.IsTerminalSuccess(status): - return color.GreenString(s) - default: - return s - } -} - -var clientInspectDealCmd = &cli.Command{ - Name: "inspect-deal", - Usage: "Inspect detailed information about deal's lifecycle and the various stages it goes through", - Flags: []cli.Flag{ - &cli.IntFlag{ - Name: "deal-id", - }, - &cli.StringFlag{ - Name: "proposal-cid", - }, - }, - Action: func(cctx *cli.Context) error { - api, closer, err := GetFullNodeAPI(cctx) - if err != nil { - return err - } - defer closer() - - ctx := ReqContext(cctx) - return inspectDealCmd(ctx, api, cctx.String("proposal-cid"), cctx.Int("deal-id")) - }, -} - -var clientDealStatsCmd = &cli.Command{ - Name: "deal-stats", - Usage: "Print statistics about local storage deals", - Flags: []cli.Flag{ - &cli.DurationFlag{ - Name: "newer-than", - }, - }, - Action: func(cctx *cli.Context) error { - api, closer, err := GetFullNodeAPI(cctx) - if err != nil { - return err - } - defer closer() - ctx := ReqContext(cctx) - - localDeals, err := api.ClientListDeals(ctx) - if err != nil { - return err - } - - var totalSize uint64 - byState := map[storagemarket.StorageDealStatus][]uint64{} - for _, deal := range localDeals { - if cctx.IsSet("newer-than") { - if time.Now().Sub(deal.CreationTime) > cctx.Duration("newer-than") { - continue - } - } - - totalSize += deal.Size - byState[deal.State] = append(byState[deal.State], deal.Size) - } - - fmt.Printf("Total: %d deals, %s\n", len(localDeals), types.SizeStr(types.NewInt(totalSize))) - - type stateStat struct { - state storagemarket.StorageDealStatus - count int - bytes uint64 - } - - stateStats := make([]stateStat, 0, len(byState)) - for state, deals := range byState { - if state == storagemarket.StorageDealActive { - state = math.MaxUint64 // for sort - } - - st := stateStat{ - state: state, - count: len(deals), - } - for _, b := range deals { - st.bytes += b - } - - stateStats = append(stateStats, st) - } - - sort.Slice(stateStats, func(i, j int) bool { - return int64(stateStats[i].state) < int64(stateStats[j].state) - }) - - for _, st := range stateStats { - if st.state == math.MaxUint64 { - st.state = storagemarket.StorageDealActive - } - fmt.Printf("%s: %d deals, %s\n", storagemarket.DealStates[st.state], st.count, types.SizeStr(types.NewInt(st.bytes))) - } - - return nil - }, -} - -var clientListAsksCmd = &cli.Command{ - Name: "list-asks", - Usage: "List asks for top miners", - Flags: []cli.Flag{ - &cli.BoolFlag{ - Name: "by-ping", - Usage: "sort by ping", - }, - &cli.StringFlag{ - Name: "output-format", - Value: "text", - Usage: "Either 'text' or 'csv'", - }, - &cli.BoolFlag{ - Name: "protocols", - Usage: "Output supported deal protocols", - }, - }, - Action: func(cctx *cli.Context) error { - api, closer, err := GetFullNodeAPIV1(cctx) - if err != nil { - return err - } - defer closer() - ctx := ReqContext(cctx) - - asks, err := GetAsks(ctx, api) - if err != nil { - return err - } - - if cctx.Bool("by-ping") { - sort.Slice(asks, func(i, j int) bool { - return asks[i].Ping < asks[j].Ping - }) - } - pfmt := "%s: min:%s max:%s price:%s/GiB/Epoch verifiedPrice:%s/GiB/Epoch ping:%s protos:%s\n" - if cctx.String("output-format") == "csv" { - fmt.Printf("Miner,Min,Max,Price,VerifiedPrice,Ping,Protocols") - pfmt = "%s,%s,%s,%s,%s,%s,%s\n" - } - - for _, a := range asks { - ask := a.Ask - - protos := "" - if cctx.Bool("protocols") { - protos = "[" + strings.Join(a.DealProtocols, ",") + "]" - } - - fmt.Printf(pfmt, ask.Miner, - types.SizeStr(types.NewInt(uint64(ask.MinPieceSize))), - types.SizeStr(types.NewInt(uint64(ask.MaxPieceSize))), - types.FIL(ask.Price), - types.FIL(ask.VerifiedPrice), - a.Ping, - protos, - ) - } - - return nil - }, -} - -type QueriedAsk struct { - Ask *storagemarket.StorageAsk - DealProtocols []string - - Ping time.Duration -} - -func GetAsks(ctx context.Context, api lapi.FullNode) ([]QueriedAsk, error) { - isTTY := true - if fileInfo, _ := os.Stdout.Stat(); (fileInfo.Mode() & os.ModeCharDevice) == 0 { - isTTY = false - } - if isTTY { - color.Blue(".. getting miner list") - } - miners, err := api.StateListMiners(ctx, types.EmptyTSK) - if err != nil { - return nil, xerrors.Errorf("getting miner list: %w", err) - } - - var lk sync.Mutex - var found int64 - var withMinPower []address.Address - done := make(chan struct{}) - - go func() { - defer close(done) - - var wg sync.WaitGroup - wg.Add(len(miners)) - - throttle := make(chan struct{}, 50) - for _, miner := range miners { - throttle <- struct{}{} - go func(miner address.Address) { - defer wg.Done() - defer func() { - <-throttle - }() - - power, err := api.StateMinerPower(ctx, miner, types.EmptyTSK) - if err != nil { - return - } - - if power.HasMinPower { // TODO: Lower threshold - atomic.AddInt64(&found, 1) - lk.Lock() - withMinPower = append(withMinPower, miner) - lk.Unlock() - } - }(miner) - } - - wg.Wait() - }() - -loop: - for { - select { - case <-time.After(150 * time.Millisecond): - if isTTY { - fmt.Printf("\r* Found %d miners with power", atomic.LoadInt64(&found)) - } - case <-done: - break loop - } - } - if isTTY { - fmt.Printf("\r* Found %d miners with power\n", atomic.LoadInt64(&found)) - - color.Blue(".. querying asks") - } - - var asks []QueriedAsk - var queried, got int64 - - done = make(chan struct{}) - go func() { - defer close(done) - - var wg sync.WaitGroup - wg.Add(len(withMinPower)) - - throttle := make(chan struct{}, 50) - for _, miner := range withMinPower { - throttle <- struct{}{} - go func(miner address.Address) { - defer wg.Done() - defer func() { - <-throttle - atomic.AddInt64(&queried, 1) - }() - - ctx, cancel := context.WithTimeout(ctx, 4*time.Second) - defer cancel() - - mi, err := api.StateMinerInfo(ctx, miner, types.EmptyTSK) - if err != nil { - return - } - if mi.PeerId == nil { - return - } - - ask, err := api.ClientQueryAsk(ctx, *mi.PeerId, miner) - if err != nil { - return - } - - rt := time.Now() - _, err = api.ClientQueryAsk(ctx, *mi.PeerId, miner) - if err != nil { - return - } - pingDuration := time.Now().Sub(rt) - - atomic.AddInt64(&got, 1) - lk.Lock() - asks = append(asks, QueriedAsk{ - Ask: ask.Response, - DealProtocols: ask.DealProtocols, - - Ping: pingDuration, - }) - lk.Unlock() - }(miner) - } - - wg.Wait() - }() - -loop2: - for { - select { - case <-time.After(150 * time.Millisecond): - if isTTY { - fmt.Printf("\r* Queried %d asks, got %d responses", atomic.LoadInt64(&queried), atomic.LoadInt64(&got)) - } - case <-done: - break loop2 - } - } - if isTTY { - fmt.Printf("\r* Queried %d asks, got %d responses\n", atomic.LoadInt64(&queried), atomic.LoadInt64(&got)) - } - - sort.Slice(asks, func(i, j int) bool { - return asks[i].Ask.Price.LessThan(asks[j].Ask.Price) - }) - - return asks, nil -} - -var clientQueryAskCmd = &cli.Command{ - Name: "query-ask", - Usage: "Find a miners ask", - ArgsUsage: "[minerAddress]", - Flags: []cli.Flag{ - &cli.StringFlag{ - Name: "peerid", - Usage: "specify peer ID of node to make query against", - }, - &cli.Int64Flag{ - Name: "size", - Usage: "data size in bytes", - }, - &cli.Int64Flag{ - Name: "duration", - Usage: "deal duration", - }, - }, - Action: func(cctx *cli.Context) error { - afmt := NewAppFmt(cctx.App) - if cctx.NArg() != 1 { - return IncorrectNumArgs(cctx) - } - - maddr, err := address.NewFromString(cctx.Args().First()) - if err != nil { - return err - } - - api, closer, err := GetFullNodeAPI(cctx) - if err != nil { - return err - } - defer closer() - ctx := ReqContext(cctx) - - var pid peer.ID - if pidstr := cctx.String("peerid"); pidstr != "" { - p, err := peer.Decode(pidstr) - if err != nil { - return err - } - pid = p - } else { - mi, err := api.StateMinerInfo(ctx, maddr, types.EmptyTSK) - if err != nil { - return xerrors.Errorf("failed to get peerID for miner: %w", err) - } - - if mi.PeerId == nil || *mi.PeerId == ("SETME") { - return fmt.Errorf("the miner hasn't initialized yet") - } - - pid = *mi.PeerId - } - - ask, err := api.ClientQueryAsk(ctx, pid, maddr) - if err != nil { - return err - } - - afmt.Printf("Ask: %s\n", maddr) - afmt.Printf("Price per GiB: %s\n", types.FIL(ask.Price)) - afmt.Printf("Verified Price per GiB: %s\n", types.FIL(ask.VerifiedPrice)) - afmt.Printf("Max Piece size: %s\n", types.SizeStr(types.NewInt(uint64(ask.MaxPieceSize)))) - afmt.Printf("Min Piece size: %s\n", types.SizeStr(types.NewInt(uint64(ask.MinPieceSize)))) - - size := cctx.Int64("size") - if size == 0 { - return nil - } - perEpoch := types.BigDiv(types.BigMul(ask.Price, types.NewInt(uint64(size))), types.NewInt(1<<30)) - afmt.Printf("Price per Block: %s\n", types.FIL(perEpoch)) - - duration := cctx.Int64("duration") - if duration == 0 { - return nil - } - afmt.Printf("Total Price: %s\n", types.FIL(types.BigMul(perEpoch, types.NewInt(uint64(duration))))) - - return nil - }, -} - -var clientListDeals = &cli.Command{ - Name: "list-deals", - Usage: "List storage market deals", - Flags: []cli.Flag{ - &cli.BoolFlag{ - Name: "verbose", - Aliases: []string{"v"}, - Usage: "print verbose deal details", - }, - &cli.BoolFlag{ - Name: "show-failed", - Usage: "show failed/failing deals", - }, - &cli.BoolFlag{ - Name: "watch", - Usage: "watch deal updates in real-time, rather than a one time list", - }, - }, - Action: func(cctx *cli.Context) error { - api, closer, err := GetFullNodeAPI(cctx) - if err != nil { - return err - } - defer closer() - ctx := ReqContext(cctx) - - verbose := cctx.Bool("verbose") - watch := cctx.Bool("watch") - showFailed := cctx.Bool("show-failed") - - localDeals, err := api.ClientListDeals(ctx) - if err != nil { - return err - } - - if watch { - updates, err := api.ClientGetDealUpdates(ctx) - if err != nil { - return err - } - - for { - tm.Clear() - tm.MoveCursor(1, 1) - - err = outputStorageDeals(ctx, tm.Screen, api, localDeals, verbose, showFailed) - if err != nil { - return err - } - - tm.Flush() - - select { - case <-ctx.Done(): - return nil - case updated := <-updates: - var found bool - for i, existing := range localDeals { - if existing.ProposalCid.Equals(updated.ProposalCid) { - localDeals[i] = updated - found = true - break - } - } - if !found { - localDeals = append(localDeals, updated) - } - } - } - } - - return outputStorageDeals(ctx, cctx.App.Writer, api, localDeals, verbose, showFailed) - }, -} - -func dealFromDealInfo(ctx context.Context, full v0api.FullNode, head *types.TipSet, v api.DealInfo) deal { - if v.DealID == 0 { - return deal{ - LocalDeal: v, - OnChainDealState: market.EmptyDealState(), - } - } - - onChain, err := full.StateMarketStorageDeal(ctx, v.DealID, head.Key()) - if err != nil { - return deal{LocalDeal: v} - } - - return deal{ - LocalDeal: v, - OnChainDealState: onChain.State.Iface(), - } -} - -func outputStorageDeals(ctx context.Context, out io.Writer, full v0api.FullNode, localDeals []lapi.DealInfo, verbose bool, showFailed bool) error { - sort.Slice(localDeals, func(i, j int) bool { - return localDeals[i].CreationTime.Before(localDeals[j].CreationTime) - }) - - head, err := full.ChainHead(ctx) - if err != nil { - return err - } - - var deals []deal - for _, localDeal := range localDeals { - if showFailed || localDeal.State != storagemarket.StorageDealError { - deals = append(deals, dealFromDealInfo(ctx, full, head, localDeal)) - } - } - - if verbose { - w := tabwriter.NewWriter(out, 2, 4, 2, ' ', 0) - fmt.Fprintf(w, "Created\tDealCid\tDealId\tProvider\tState\tOn Chain?\tSlashed?\tPieceCID\tSize\tPrice\tDuration\tTransferChannelID\tTransferStatus\tVerified\tMessage\n") - for _, d := range deals { - onChain := "N" - if d.OnChainDealState.SectorStartEpoch() != -1 { - onChain = fmt.Sprintf("Y (epoch %d)", d.OnChainDealState.SectorStartEpoch()) - } - - slashed := "N" - if d.OnChainDealState.SlashEpoch() != -1 { - slashed = fmt.Sprintf("Y (epoch %d)", d.OnChainDealState.SlashEpoch()) - } - - price := types.FIL(types.BigMul(d.LocalDeal.PricePerEpoch, types.NewInt(d.LocalDeal.Duration))) - transferChannelID := "" - if d.LocalDeal.TransferChannelID != nil { - transferChannelID = d.LocalDeal.TransferChannelID.String() - } - transferStatus := "" - if d.LocalDeal.DataTransfer != nil { - transferStatus = datatransfer.Statuses[d.LocalDeal.DataTransfer.Status] - // TODO: Include the transferred percentage once this bug is fixed: - // https://github.com/ipfs/go-graphsync/issues/126 - //fmt.Printf("transferred: %d / size: %d\n", d.LocalDeal.DataTransfer.Transferred, d.LocalDeal.Size) - //if d.LocalDeal.Size > 0 { - // pct := (100 * d.LocalDeal.DataTransfer.Transferred) / d.LocalDeal.Size - // transferPct = fmt.Sprintf("%d%%", pct) - //} - } - fmt.Fprintf(w, "%s\t%s\t%d\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%d\t%s\t%s\t%v\t%s\n", - d.LocalDeal.CreationTime.Format(time.Stamp), - d.LocalDeal.ProposalCid, - d.LocalDeal.DealID, - d.LocalDeal.Provider, - dealStateString(d.LocalDeal.State), - onChain, - slashed, - d.LocalDeal.PieceCID, - types.SizeStr(types.NewInt(d.LocalDeal.Size)), - price, - d.LocalDeal.Duration, - transferChannelID, - transferStatus, - d.LocalDeal.Verified, - d.LocalDeal.Message) - } - return w.Flush() - } - - w := tablewriter.New(tablewriter.Col("DealCid"), - tablewriter.Col("DealId"), - tablewriter.Col("Provider"), - tablewriter.Col("State"), - tablewriter.Col("On Chain?"), - tablewriter.Col("Slashed?"), - tablewriter.Col("PieceCID"), - tablewriter.Col("Size"), - tablewriter.Col("Price"), - tablewriter.Col("Duration"), - tablewriter.Col("Verified"), - tablewriter.NewLineCol("Message")) - - for _, d := range deals { - propcid := ellipsis(d.LocalDeal.ProposalCid.String(), 8) - - onChain := "N" - if d.OnChainDealState.SectorStartEpoch() != -1 { - onChain = fmt.Sprintf("Y (epoch %d)", d.OnChainDealState.SectorStartEpoch()) - } - - slashed := "N" - if d.OnChainDealState.SlashEpoch() != -1 { - slashed = fmt.Sprintf("Y (epoch %d)", d.OnChainDealState.SlashEpoch()) - } - - piece := ellipsis(d.LocalDeal.PieceCID.String(), 8) - - price := types.FIL(types.BigMul(d.LocalDeal.PricePerEpoch, types.NewInt(d.LocalDeal.Duration))) - - w.Write(map[string]interface{}{ - "DealCid": propcid, - "DealId": d.LocalDeal.DealID, - "Provider": d.LocalDeal.Provider, - "State": dealStateString(d.LocalDeal.State), - "On Chain?": onChain, - "Slashed?": slashed, - "PieceCID": piece, - "Size": types.SizeStr(types.NewInt(d.LocalDeal.Size)), - "Price": price, - "Verified": d.LocalDeal.Verified, - "Duration": d.LocalDeal.Duration, - "Message": d.LocalDeal.Message, - }) - } - - return w.Flush(out) -} - -func dealStateString(state storagemarket.StorageDealStatus) string { - s := storagemarket.DealStates[state] - switch state { - case storagemarket.StorageDealError, storagemarket.StorageDealExpired: - return color.RedString(s) - case storagemarket.StorageDealActive: - return color.GreenString(s) - default: - return s - } -} - -type deal struct { - LocalDeal lapi.DealInfo - OnChainDealState market.DealState -} - -var clientGetDealCmd = &cli.Command{ - Name: "get-deal", - Usage: "Print detailed deal information", - ArgsUsage: "[proposalCID]", - Action: func(cctx *cli.Context) error { - if cctx.NArg() != 1 { - return IncorrectNumArgs(cctx) - } - - api, closer, err := GetFullNodeAPI(cctx) - if err != nil { - return err - } - defer closer() - ctx := ReqContext(cctx) - - propcid, err := cid.Decode(cctx.Args().First()) - if err != nil { - return err - } - - di, err := api.ClientGetDealInfo(ctx, propcid) - if err != nil { - return err - } - - out := map[string]interface{}{ - "DealInfo: ": di, - } - - if di.DealID != 0 { - onChain, err := api.StateMarketStorageDeal(ctx, di.DealID, types.EmptyTSK) - if err != nil { - return err - } - - out["OnChain"] = onChain - } - - b, err := json.MarshalIndent(out, "", " ") - if err != nil { - return err - } - fmt.Println(string(b)) - return nil - }, -} - -var clientBalancesCmd = &cli.Command{ - Name: "balances", - Usage: "Print storage market client balances", - Flags: []cli.Flag{ - &cli.StringFlag{ - Name: "client", - Usage: "specify storage client address", - }, - }, - Action: func(cctx *cli.Context) error { - api, closer, err := GetFullNodeAPI(cctx) - if err != nil { - return err - } - defer closer() - ctx := ReqContext(cctx) - - var addr address.Address - if clientFlag := cctx.String("client"); clientFlag != "" { - ca, err := address.NewFromString(clientFlag) - if err != nil { - return err - } - - addr = ca - } else { - def, err := api.WalletDefaultAddress(ctx) - if err != nil { - return err - } - addr = def - } - - balance, err := api.StateMarketBalance(ctx, addr, types.EmptyTSK) - if err != nil { - return err - } - - reserved, err := api.MarketGetReserved(ctx, addr) - if err != nil { - return err - } - - avail := big.Sub(big.Sub(balance.Escrow, balance.Locked), reserved) - if avail.LessThan(big.Zero()) { - avail = big.Zero() - } - - fmt.Printf("Client Market Balance for address %s:\n", addr) - - fmt.Printf(" Escrowed Funds: %s\n", types.FIL(balance.Escrow)) - fmt.Printf(" Locked Funds: %s\n", types.FIL(balance.Locked)) - fmt.Printf(" Reserved Funds: %s\n", types.FIL(reserved)) - fmt.Printf(" Available to Withdraw: %s\n", types.FIL(avail)) - - return nil - }, -} - -var clientStat = &cli.Command{ - Name: "stat", - Usage: "Print information about a locally stored file (piece size, etc)", - ArgsUsage: "", - Action: func(cctx *cli.Context) error { - api, closer, err := GetFullNodeAPI(cctx) - if err != nil { - return err - } - defer closer() - ctx := ReqContext(cctx) - - if cctx.NArg() != 1 { - return IncorrectNumArgs(cctx) - } - - dataCid, err := cid.Parse(cctx.Args().First()) - if err != nil { - return fmt.Errorf("parsing data cid: %w", err) - } - - ds, err := api.ClientDealSize(ctx, dataCid) - if err != nil { - return err - } - - fmt.Printf("Piece Size : %v\n", ds.PieceSize) - fmt.Printf("Payload Size: %v\n", ds.PayloadSize) - - return nil - }, -} - -var clientRestartTransfer = &cli.Command{ - Name: "restart-transfer", - Usage: "Force restart a stalled data transfer", - ArgsUsage: "[transferID]", - Flags: []cli.Flag{ - &cli.StringFlag{ - Name: "peerid", - Usage: "narrow to transfer with specific peer", - }, - &cli.BoolFlag{ - Name: "initiator", - Usage: "specify only transfers where peer is/is not initiator", - Value: true, - }, - }, - Action: func(cctx *cli.Context) error { - if cctx.NArg() != 1 { - return IncorrectNumArgs(cctx) - } - api, closer, err := GetFullNodeAPI(cctx) - if err != nil { - return err - } - defer closer() - ctx := ReqContext(cctx) - - transferUint, err := strconv.ParseUint(cctx.Args().First(), 10, 64) - if err != nil { - return fmt.Errorf("Error reading transfer ID: %w", err) - } - transferID := datatransfer.TransferID(transferUint) - initiator := cctx.Bool("initiator") - var other peer.ID - if pidstr := cctx.String("peerid"); pidstr != "" { - p, err := peer.Decode(pidstr) - if err != nil { - return err - } - other = p - } else { - channels, err := api.ClientListDataTransfers(ctx) - if err != nil { - return err - } - found := false - for _, channel := range channels { - if channel.IsInitiator == initiator && channel.TransferID == transferID { - other = channel.OtherPeer - found = true - break - } - } - if !found { - return errors.New("unable to find matching data transfer") - } - } - - return api.ClientRestartDataTransfer(ctx, transferID, other, initiator) - }, -} - -var clientCancelTransfer = &cli.Command{ - Name: "cancel-transfer", - Usage: "Force cancel a data transfer", - ArgsUsage: "[transferID]", - Flags: []cli.Flag{ - &cli.StringFlag{ - Name: "peerid", - Usage: "narrow to transfer with specific peer", - }, - &cli.BoolFlag{ - Name: "initiator", - Usage: "specify only transfers where peer is/is not initiator", - Value: true, - }, - &cli.DurationFlag{ - Name: "cancel-timeout", - Usage: "time to wait for cancel to be sent to storage provider", - Value: 5 * time.Second, - }, - }, - Action: func(cctx *cli.Context) error { - if cctx.NArg() != 1 { - return IncorrectNumArgs(cctx) - } - api, closer, err := GetFullNodeAPI(cctx) - if err != nil { - return err - } - defer closer() - ctx := ReqContext(cctx) - - transferUint, err := strconv.ParseUint(cctx.Args().First(), 10, 64) - if err != nil { - return fmt.Errorf("Error reading transfer ID: %w", err) - } - transferID := datatransfer.TransferID(transferUint) - initiator := cctx.Bool("initiator") - var other peer.ID - if pidstr := cctx.String("peerid"); pidstr != "" { - p, err := peer.Decode(pidstr) - if err != nil { - return err - } - other = p - } else { - channels, err := api.ClientListDataTransfers(ctx) - if err != nil { - return err - } - found := false - for _, channel := range channels { - if channel.IsInitiator == initiator && channel.TransferID == transferID { - other = channel.OtherPeer - found = true - break - } - } - if !found { - return errors.New("unable to find matching data transfer") - } - } - - timeoutCtx, cancel := context.WithTimeout(ctx, cctx.Duration("cancel-timeout")) - defer cancel() - return api.ClientCancelDataTransfer(timeoutCtx, transferID, other, initiator) - }, -} - -var clientCancelRetrievalDealCmd = &cli.Command{ - Name: "cancel-retrieval", - Usage: "Cancel a retrieval deal by deal ID; this also cancels the associated transfer", - Flags: []cli.Flag{ - &cli.Int64Flag{ - Name: "deal-id", - Usage: "specify retrieval deal by deal ID", - Required: true, - }, - }, - Action: func(cctx *cli.Context) error { - api, closer, err := GetFullNodeAPI(cctx) - if err != nil { - return err - } - defer closer() - ctx := ReqContext(cctx) - - id := cctx.Int64("deal-id") - if id < 0 { - return errors.New("deal id cannot be negative") - } - - return api.ClientCancelRetrievalDeal(ctx, retrievalmarket.DealID(id)) - }, -} - -var clientListTransfers = &cli.Command{ - Name: "list-transfers", - Usage: "List ongoing data transfers for deals", - Flags: []cli.Flag{ - &cli.BoolFlag{ - Name: "verbose", - Aliases: []string{"v"}, - Usage: "print verbose transfer details", - }, - &cli.BoolFlag{ - Name: "completed", - Usage: "show completed data transfers", - }, - &cli.BoolFlag{ - Name: "watch", - Usage: "watch deal updates in real-time, rather than a one time list", - }, - &cli.BoolFlag{ - Name: "show-failed", - Usage: "show failed/cancelled transfers", - }, - }, - Action: func(cctx *cli.Context) error { - api, closer, err := GetFullNodeAPI(cctx) - if err != nil { - return err - } - defer closer() - ctx := ReqContext(cctx) - - channels, err := api.ClientListDataTransfers(ctx) - if err != nil { - return err - } - - verbose := cctx.Bool("verbose") - completed := cctx.Bool("completed") - watch := cctx.Bool("watch") - showFailed := cctx.Bool("show-failed") - if watch { - channelUpdates, err := api.ClientDataTransferUpdates(ctx) - if err != nil { - return err - } - - for { - tm.Clear() // Clear current screen - - tm.MoveCursor(1, 1) - - OutputDataTransferChannels(tm.Screen, channels, verbose, completed, showFailed) - - tm.Flush() - - select { - case <-ctx.Done(): - return nil - case channelUpdate := <-channelUpdates: - var found bool - for i, existing := range channels { - if existing.TransferID == channelUpdate.TransferID && - existing.OtherPeer == channelUpdate.OtherPeer && - existing.IsSender == channelUpdate.IsSender && - existing.IsInitiator == channelUpdate.IsInitiator { - channels[i] = channelUpdate - found = true - break - } - } - if !found { - channels = append(channels, channelUpdate) - } - } - } - } - OutputDataTransferChannels(os.Stdout, channels, verbose, completed, showFailed) - return nil - }, -} - -// OutputDataTransferChannels generates table output for a list of channels -func OutputDataTransferChannels(out io.Writer, channels []lapi.DataTransferChannel, verbose, completed, showFailed bool) { - sort.Slice(channels, func(i, j int) bool { - return channels[i].TransferID < channels[j].TransferID - }) - - var receivingChannels, sendingChannels []lapi.DataTransferChannel - for _, channel := range channels { - if !completed && channel.Status == datatransfer.Completed { - continue - } - if !showFailed && (channel.Status == datatransfer.Failed || channel.Status == datatransfer.Cancelled) { - continue - } - if channel.IsSender { - sendingChannels = append(sendingChannels, channel) - } else { - receivingChannels = append(receivingChannels, channel) - } - } - - fmt.Fprintf(out, "Sending Channels\n\n") - w := tablewriter.New(tablewriter.Col("ID"), - tablewriter.Col("Status"), - tablewriter.Col("Sending To"), - tablewriter.Col("Root Cid"), - tablewriter.Col("Initiated?"), - tablewriter.Col("Transferred"), - tablewriter.Col("Voucher"), - tablewriter.NewLineCol("Message")) - for _, channel := range sendingChannels { - w.Write(toChannelOutput("Sending To", channel, verbose)) - } - _ = w.Flush(out) - - fmt.Fprintf(out, "\nReceiving Channels\n\n") - w = tablewriter.New(tablewriter.Col("ID"), - tablewriter.Col("Status"), - tablewriter.Col("Receiving From"), - tablewriter.Col("Root Cid"), - tablewriter.Col("Initiated?"), - tablewriter.Col("Transferred"), - tablewriter.Col("Voucher"), - tablewriter.NewLineCol("Message")) - for _, channel := range receivingChannels { - w.Write(toChannelOutput("Receiving From", channel, verbose)) - } - _ = w.Flush(out) -} - -func channelStatusString(status datatransfer.Status) string { - s := datatransfer.Statuses[status] - switch status { - case datatransfer.Failed, datatransfer.Cancelled: - return color.RedString(s) - case datatransfer.Completed: - return color.GreenString(s) - default: - return s - } -} - -func toChannelOutput(otherPartyColumn string, channel lapi.DataTransferChannel, verbose bool) map[string]interface{} { - rootCid := channel.BaseCID.String() - otherParty := channel.OtherPeer.String() - if !verbose { - rootCid = ellipsis(rootCid, 8) - otherParty = ellipsis(otherParty, 8) - } - - initiated := "N" - if channel.IsInitiator { - initiated = "Y" - } - - voucher := channel.Voucher - if len(voucher) > 40 && !verbose { - voucher = ellipsis(voucher, 37) - } - - return map[string]interface{}{ - "ID": channel.TransferID, - "Status": channelStatusString(channel.Status), - otherPartyColumn: otherParty, - "Root Cid": rootCid, - "Initiated?": initiated, - "Transferred": units.BytesSize(float64(channel.Transferred)), - "Voucher": voucher, - "Message": channel.Message, - } -} - -func ellipsis(s string, length int) string { - if length > 0 && len(s) > length { - return "..." + s[len(s)-length:] - } - return s -} - -func inspectDealCmd(ctx context.Context, api v0api.FullNode, proposalCid string, dealId int) error { - ctx, cancel := context.WithCancel(ctx) - defer cancel() - - deals, err := api.ClientListDeals(ctx) - if err != nil { - return err - } - - var di *lapi.DealInfo - for i, cdi := range deals { - if proposalCid != "" && cdi.ProposalCid.String() == proposalCid { - di = &deals[i] - break - } - - if dealId != 0 && int(cdi.DealID) == dealId { - di = &deals[i] - break - } - } - - if di == nil { - if proposalCid != "" { - return fmt.Errorf("cannot find deal with proposal cid: %s", proposalCid) - } - if dealId != 0 { - return fmt.Errorf("cannot find deal with deal id: %v", dealId) - } - return errors.New("you must specify proposal cid or deal id in order to inspect a deal") - } - - // populate DealInfo.DealStages and DataTransfer.Stages - di, err = api.ClientGetDealInfo(ctx, di.ProposalCid) - if err != nil { - return fmt.Errorf("cannot get deal info for proposal cid: %v", di.ProposalCid) - } - - renderDeal(di) - - return nil -} - -func renderDeal(di *lapi.DealInfo) { - color.Blue("Deal ID: %d\n", int(di.DealID)) - color.Blue("Proposal CID: %s\n\n", di.ProposalCid.String()) - - if di.DealStages == nil { - color.Yellow("Deal was made with an older version of Lotus and Lotus did not collect detailed information about its stages") - return - } - - for _, stg := range di.DealStages.Stages { - msg := fmt.Sprintf("%s %s: %s (expected duration: %s)", color.BlueString("Stage:"), color.BlueString(strings.TrimPrefix(stg.Name, "StorageDeal")), stg.Description, color.GreenString(stg.ExpectedDuration)) - if stg.UpdatedTime.Time().IsZero() { - msg = color.YellowString(msg) - } - fmt.Println(msg) - - for _, l := range stg.Logs { - fmt.Printf(" %s %s\n", color.YellowString(l.UpdatedTime.Time().UTC().Round(time.Second).Format(time.Stamp)), l.Log) - } - - if stg.Name == "StorageDealStartDataTransfer" { - for _, dtStg := range di.DataTransfer.Stages.Stages { - fmt.Printf(" %s %s %s\n", color.YellowString(dtStg.CreatedTime.Time().UTC().Round(time.Second).Format(time.Stamp)), color.BlueString("Data transfer stage:"), color.BlueString(dtStg.Name)) - for _, l := range dtStg.Logs { - fmt.Printf(" %s %s\n", color.YellowString(l.UpdatedTime.Time().UTC().Round(time.Second).Format(time.Stamp)), l.Log) - } - } - } - } -} diff --git a/cli/client_retr.go b/cli/client_retr.go deleted file mode 100644 index fa8164ab5ef..00000000000 --- a/cli/client_retr.go +++ /dev/null @@ -1,550 +0,0 @@ -package cli - -import ( - "bytes" - "context" - "fmt" - "io" - "os" - "sort" - "strings" - "time" - - "github.com/ipfs/boxo/blockservice" - offline "github.com/ipfs/boxo/exchange/offline" - "github.com/ipfs/boxo/ipld/merkledag" - "github.com/ipfs/go-cid" - carv2 "github.com/ipld/go-car/v2" - "github.com/ipld/go-car/v2/blockstore" - "github.com/ipld/go-ipld-prime" - "github.com/ipld/go-ipld-prime/codec/dagjson" - basicnode "github.com/ipld/go-ipld-prime/node/basic" - "github.com/ipld/go-ipld-prime/traversal" - "github.com/ipld/go-ipld-prime/traversal/selector" - "github.com/ipld/go-ipld-prime/traversal/selector/builder" - selectorparse "github.com/ipld/go-ipld-prime/traversal/selector/parse" - textselector "github.com/ipld/go-ipld-selector-text-lite" - "github.com/urfave/cli/v2" - "golang.org/x/xerrors" - - "github.com/filecoin-project/go-address" - "github.com/filecoin-project/go-fil-markets/retrievalmarket" - "github.com/filecoin-project/go-state-types/big" - - lapi "github.com/filecoin-project/lotus/api" - "github.com/filecoin-project/lotus/chain/types" - cliutil "github.com/filecoin-project/lotus/cli/util" - "github.com/filecoin-project/lotus/markets/utils" - "github.com/filecoin-project/lotus/node/repo" -) - -const DefaultMaxRetrievePrice = "0" - -func retrieve(ctx context.Context, cctx *cli.Context, fapi lapi.FullNode, sel *lapi.Selector, printf func(string, ...interface{})) (*lapi.ExportRef, error) { - var payer address.Address - var err error - if cctx.String("from") != "" { - payer, err = address.NewFromString(cctx.String("from")) - } else { - payer, err = fapi.WalletDefaultAddress(ctx) - } - if err != nil { - return nil, err - } - - file, err := cid.Parse(cctx.Args().Get(0)) - if err != nil { - return nil, err - } - - var pieceCid *cid.Cid - if cctx.String("pieceCid") != "" { - parsed, err := cid.Parse(cctx.String("pieceCid")) - if err != nil { - return nil, err - } - pieceCid = &parsed - } - - var eref *lapi.ExportRef - if cctx.Bool("allow-local") { - imports, err := fapi.ClientListImports(ctx) - if err != nil { - return nil, err - } - - for _, i := range imports { - if i.Root != nil && i.Root.Equals(file) { - eref = &lapi.ExportRef{ - Root: file, - FromLocalCAR: i.CARPath, - } - break - } - } - } - - // no local found, so make a retrieval - if eref == nil { - var offer lapi.QueryOffer - minerStrAddr := cctx.String("provider") - if minerStrAddr == "" { // Local discovery - offers, err := fapi.ClientFindData(ctx, file, pieceCid) - - var cleaned []lapi.QueryOffer - // filter out offers that errored - for _, o := range offers { - if o.Err == "" { - cleaned = append(cleaned, o) - } - } - - offers = cleaned - - // sort by price low to high - sort.Slice(offers, func(i, j int) bool { - return offers[i].MinPrice.LessThan(offers[j].MinPrice) - }) - if err != nil { - return nil, err - } - - // TODO: parse offer strings from `client find`, make this smarter - if len(offers) < 1 { - fmt.Println("Failed to find file") - return nil, nil - } - offer = offers[0] - } else { // Directed retrieval - minerAddr, err := address.NewFromString(minerStrAddr) - if err != nil { - return nil, err - } - offer, err = fapi.ClientMinerQueryOffer(ctx, minerAddr, file, pieceCid) - if err != nil { - return nil, err - } - } - if offer.Err != "" { - return nil, fmt.Errorf("offer error: %s", offer.Err) - } - - maxPrice := types.MustParseFIL(DefaultMaxRetrievePrice) - - if cctx.String("maxPrice") != "" { - maxPrice, err = types.ParseFIL(cctx.String("maxPrice")) - if err != nil { - return nil, xerrors.Errorf("parsing maxPrice: %w", err) - } - } - - if offer.MinPrice.GreaterThan(big.Int(maxPrice)) { - return nil, xerrors.Errorf("failed to find offer satisfying maxPrice: %s. Try increasing maxPrice", maxPrice) - } - - o := offer.Order(payer) - o.DataSelector = sel - - subscribeEvents, err := fapi.ClientGetRetrievalUpdates(ctx) - if err != nil { - return nil, xerrors.Errorf("error setting up retrieval updates: %w", err) - } - retrievalRes, err := fapi.ClientRetrieve(ctx, o) - if err != nil { - return nil, xerrors.Errorf("error setting up retrieval: %w", err) - } - - start := time.Now() - readEvents: - for { - var evt lapi.RetrievalInfo - select { - case <-ctx.Done(): - return nil, xerrors.New("Retrieval Timed Out") - case evt = <-subscribeEvents: - if evt.ID != retrievalRes.DealID { - // we can't check the deal ID ahead of time because: - // 1. We need to subscribe before retrieving. - // 2. We won't know the deal ID until after retrieving. - continue - } - } - - event := "New" - if evt.Event != nil { - event = retrievalmarket.ClientEvents[*evt.Event] - } - - printf("Recv %s, Paid %s, %s (%s), %s [%d|%d]\n", - types.SizeStr(types.NewInt(evt.BytesReceived)), - types.FIL(evt.TotalPaid), - strings.TrimPrefix(event, "ClientEvent"), - strings.TrimPrefix(retrievalmarket.DealStatuses[evt.Status], "DealStatus"), - time.Now().Sub(start).Truncate(time.Millisecond), - evt.ID, - types.NewInt(evt.BytesReceived), - ) - - switch evt.Status { - case retrievalmarket.DealStatusCompleted: - break readEvents - case retrievalmarket.DealStatusRejected: - return nil, xerrors.Errorf("Retrieval Proposal Rejected: %s", evt.Message) - case retrievalmarket.DealStatusCancelled: - return nil, xerrors.Errorf("Retrieval Proposal Cancelled: %s", evt.Message) - case - retrievalmarket.DealStatusDealNotFound, - retrievalmarket.DealStatusErrored: - return nil, xerrors.Errorf("Retrieval Error: %s", evt.Message) - } - } - - eref = &lapi.ExportRef{ - Root: file, - DealID: retrievalRes.DealID, - } - } - - return eref, nil -} - -var retrFlagsCommon = []cli.Flag{ - &cli.StringFlag{ - Name: "from", - Usage: "address to send transactions from", - }, - &cli.StringFlag{ - Name: "provider", - Usage: "provider to use for retrieval, if not present it'll use local discovery", - Aliases: []string{"miner"}, - }, - &cli.StringFlag{ - Name: "maxPrice", - Usage: fmt.Sprintf("maximum price the client is willing to consider (default: %s FIL)", DefaultMaxRetrievePrice), - }, - &cli.StringFlag{ - Name: "pieceCid", - Usage: "require data to be retrieved from a specific Piece CID", - }, - &cli.BoolFlag{ - Name: "allow-local", - // todo: default to true? - }, -} - -var clientRetrieveCmd = &cli.Command{ - Name: "retrieve", - Usage: "Retrieve data from network", - ArgsUsage: "[dataCid outputPath]", - Description: `Retrieve data from the Filecoin network. - -The retrieve command will attempt to find a provider make a retrieval deal with -them. In case a provider can't be found, it can be specified with the --provider -flag. - -By default the data will be interpreted as DAG-PB UnixFSv1 File. Alternatively -a CAR file containing the raw IPLD graph can be exported by setting the --car -flag. - -Partial Retrieval: - -The --data-selector flag can be used to specify a sub-graph to fetch. The -selector can be specified as either IPLD datamodel text-path selector, or IPLD -json selector. - -In case of unixfs retrieval, the selector must point at a single root node, and -match the entire graph under that node. - -In case of CAR retrieval, the selector must have one common "sub-root" node. - -Examples: - -- Retrieve a file by CID - $ lotus client retrieve Qm... my-file.txt - -- Retrieve a file by CID from f0123 - $ lotus client retrieve --provider f0123 Qm... my-file.txt - -- Retrieve a first file from a specified directory - $ lotus client retrieve --data-selector /Links/0/Hash Qm... my-file.txt -`, - Flags: append([]cli.Flag{ - &cli.BoolFlag{ - Name: "car", - Usage: "Export to a car file instead of a regular file", - }, - &cli.StringFlag{ - Name: "data-selector", - Aliases: []string{"datamodel-path-selector"}, - Usage: "IPLD datamodel text-path selector, or IPLD json selector", - }, - &cli.BoolFlag{ - Name: "car-export-merkle-proof", - Usage: "(requires --data-selector and --car) Export data-selector merkle proof", - }, - }, retrFlagsCommon...), - Action: func(cctx *cli.Context) error { - if cctx.NArg() != 2 { - return IncorrectNumArgs(cctx) - } - - if cctx.Bool("car-export-merkle-proof") { - if !cctx.Bool("car") || !cctx.IsSet("data-selector") { - return ShowHelp(cctx, fmt.Errorf("--car-export-merkle-proof requires --car and --data-selector")) - } - } - - fapi, closer, err := GetFullNodeAPIV1(cctx) - if err != nil { - return err - } - defer closer() - ctx := ReqContext(cctx) - afmt := NewAppFmt(cctx.App) - - var s *lapi.Selector - if sel := lapi.Selector(cctx.String("data-selector")); sel != "" { - s = &sel - } - - eref, err := retrieve(ctx, cctx, fapi, s, afmt.Printf) - if err != nil { - return err - } - if eref == nil { - return xerrors.Errorf("failed to find providers") - } - - if s != nil { - eref.DAGs = append(eref.DAGs, lapi.DagSpec{DataSelector: s, ExportMerkleProof: cctx.Bool("car-export-merkle-proof")}) - } - - err = fapi.ClientExport(ctx, *eref, lapi.FileRef{ - Path: cctx.Args().Get(1), - IsCAR: cctx.Bool("car"), - }) - if err != nil { - return err - } - afmt.Println("Success") - return nil - }, -} - -var clientRetrieveCatCmd = &cli.Command{ - Name: "cat", - Usage: "Show data from network", - ArgsUsage: "[dataCid]", - Flags: append([]cli.Flag{ - &cli.BoolFlag{ - Name: "ipld", - Usage: "list IPLD datamodel links", - }, - &cli.StringFlag{ - Name: "data-selector", - Usage: "IPLD datamodel text-path selector, or IPLD json selector", - }, - }, retrFlagsCommon...), - Action: func(cctx *cli.Context) error { - if cctx.NArg() != 1 { - return IncorrectNumArgs(cctx) - } - - ainfo, err := GetAPIInfo(cctx, repo.FullNode) - if err != nil { - return xerrors.Errorf("could not get API info: %w", err) - } - - fapi, closer, err := GetFullNodeAPIV1(cctx) - if err != nil { - return err - } - defer closer() - ctx := ReqContext(cctx) - afmt := NewAppFmt(cctx.App) - - sel := lapi.Selector(cctx.String("data-selector")) - selp := &sel - if sel == "" { - selp = nil - } - - eref, err := retrieve(ctx, cctx, fapi, selp, afmt.Printf) - if err != nil { - return err - } - - fmt.Println() // separate retrieval events from results - - if sel != "" { - eref.DAGs = append(eref.DAGs, lapi.DagSpec{DataSelector: &sel}) - } - - rc, err := cliutil.ClientExportStream(ainfo.Addr, ainfo.AuthHeader(), *eref, false) - if err != nil { - return err - } - defer rc.Close() // nolint - - _, err = io.Copy(os.Stdout, rc) - return err - }, -} - -func pathToSel(psel string, matchTraversal bool, sub builder.SelectorSpec) (lapi.Selector, error) { - rs, err := textselector.SelectorSpecFromPath(textselector.Expression(psel), matchTraversal, sub) - if err != nil { - return "", xerrors.Errorf("failed to parse path-selector: %w", err) - } - - var b bytes.Buffer - if err := dagjson.Encode(rs.Node(), &b); err != nil { - return "", err - } - - return lapi.Selector(b.String()), nil -} - -var clientRetrieveLsCmd = &cli.Command{ - Name: "ls", - Usage: "List object links", - ArgsUsage: "[dataCid]", - Flags: append([]cli.Flag{ - &cli.BoolFlag{ - Name: "ipld", - Usage: "list IPLD datamodel links", - }, - &cli.IntFlag{ - Name: "depth", - Usage: "list links recursively up to the specified depth", - Value: 1, - }, - &cli.StringFlag{ - Name: "data-selector", - Usage: "IPLD datamodel text-path selector, or IPLD json selector", - }, - }, retrFlagsCommon...), - Action: func(cctx *cli.Context) error { - if cctx.NArg() != 1 { - return IncorrectNumArgs(cctx) - } - - ainfo, err := GetAPIInfo(cctx, repo.FullNode) - if err != nil { - return xerrors.Errorf("could not get API info: %w", err) - } - - fapi, closer, err := GetFullNodeAPIV1(cctx) - if err != nil { - return err - } - defer closer() - ctx := ReqContext(cctx) - afmt := NewAppFmt(cctx.App) - - dataSelector := lapi.Selector(fmt.Sprintf(`{"R":{"l":{"depth":%d},":>":{"a":{">":{"|":[{"@":{}},{".":{}}]}}}}}`, cctx.Int("depth"))) - - if cctx.IsSet("data-selector") { - ssb := builder.NewSelectorSpecBuilder(basicnode.Prototype.Any) - dataSelector, err = pathToSel(cctx.String("data-selector"), cctx.Bool("ipld"), - ssb.ExploreUnion( - ssb.Matcher(), - ssb.ExploreAll( - ssb.ExploreRecursive(selector.RecursionLimitDepth(int64(cctx.Int("depth"))), ssb.ExploreAll(ssb.ExploreUnion(ssb.Matcher(), ssb.ExploreRecursiveEdge()))), - ))) - if err != nil { - return xerrors.Errorf("parsing datamodel path: %w", err) - } - } - - eref, err := retrieve(ctx, cctx, fapi, &dataSelector, afmt.Printf) - if err != nil { - return xerrors.Errorf("retrieve: %w", err) - } - - fmt.Println() // separate retrieval events from results - - eref.DAGs = append(eref.DAGs, lapi.DagSpec{ - DataSelector: &dataSelector, - }) - - rc, err := cliutil.ClientExportStream(ainfo.Addr, ainfo.AuthHeader(), *eref, true) - if err != nil { - return xerrors.Errorf("export: %w", err) - } - defer rc.Close() // nolint - - var memcar bytes.Buffer - _, err = io.Copy(&memcar, rc) - if err != nil { - return err - } - - cbs, err := blockstore.NewReadOnly(&bytesReaderAt{bytes.NewReader(memcar.Bytes())}, nil, - carv2.ZeroLengthSectionAsEOF(true), - blockstore.UseWholeCIDs(true)) - if err != nil { - return xerrors.Errorf("opening car blockstore: %w", err) - } - - roots, err := cbs.Roots() - if err != nil { - return xerrors.Errorf("getting roots: %w", err) - } - - if len(roots) != 1 { - return xerrors.Errorf("expected 1 car root, got %d", len(roots)) - } - dserv := merkledag.NewDAGService(blockservice.New(cbs, offline.Exchange(cbs))) - - if !cctx.Bool("ipld") { - links, err := dserv.GetLinks(ctx, roots[0]) - if err != nil { - return xerrors.Errorf("getting links: %w", err) - } - - for _, link := range links { - fmt.Printf("%s %s\t%d\n", link.Cid, link.Name, link.Size) - } - } else { - jsel := lapi.Selector(fmt.Sprintf(`{"R":{"l":{"depth":%d},":>":{"a":{">":{"|":[{"@":{}},{".":{}}]}}}}}`, cctx.Int("depth"))) - - if cctx.IsSet("data-selector") { - ssb := builder.NewSelectorSpecBuilder(basicnode.Prototype.Any) - jsel, err = pathToSel(cctx.String("data-selector"), false, - ssb.ExploreRecursive(selector.RecursionLimitDepth(int64(cctx.Int("depth"))), ssb.ExploreAll(ssb.ExploreUnion(ssb.Matcher(), ssb.ExploreRecursiveEdge()))), - ) - } - - sel, _ := selectorparse.ParseJSONSelector(string(jsel)) - - if err := utils.TraverseDag( - ctx, - dserv, - roots[0], - sel, - nil, - func(p traversal.Progress, n ipld.Node, r traversal.VisitReason) error { - if r == traversal.VisitReason_SelectionMatch { - fmt.Println(p.Path) - } - return nil - }, - ); err != nil { - return err - } - } - - return err - }, -} - -type bytesReaderAt struct { - btr *bytes.Reader -} - -func (b bytesReaderAt) ReadAt(p []byte, off int64) (n int, err error) { - return b.btr.ReadAt(p, off) -} - -var _ io.ReaderAt = &bytesReaderAt{} diff --git a/cli/cmd.go b/cli/cmd.go index 76c0ab300a6..9ae8c14b75e 100644 --- a/cli/cmd.go +++ b/cli/cmd.go @@ -54,7 +54,6 @@ var GetFullNodeAPIV1 = cliutil.GetFullNodeAPIV1 var GetGatewayAPI = cliutil.GetGatewayAPI var GetStorageMinerAPI = cliutil.GetStorageMinerAPI -var GetMarketsAPI = cliutil.GetMarketsAPI var GetWorkerAPI = cliutil.GetWorkerAPI var CommonCommands = []*cli.Command{ diff --git a/cli/info.go b/cli/info.go index 01f64dee9b4..4b87c5dcafa 100644 --- a/cli/info.go +++ b/cli/info.go @@ -3,9 +3,7 @@ package cli import ( "context" "fmt" - "math" "os" - "sort" "strings" "text/tabwriter" "time" @@ -14,7 +12,6 @@ import ( "github.com/fatih/color" "github.com/urfave/cli/v2" - "github.com/filecoin-project/go-fil-markets/storagemarket" "github.com/filecoin-project/go-state-types/big" "github.com/filecoin-project/lotus/api/v1api" @@ -155,57 +152,6 @@ func infoCmdAct(cctx *cli.Context) error { fmt.Printf("Payment Channels: %v channels\n", len(chs)) } fmt.Println() - - localDeals, err := fullapi.ClientListDeals(ctx) - if err != nil { - return err - } - - var totalSize uint64 - byState := map[storagemarket.StorageDealStatus][]uint64{} - for _, deal := range localDeals { - totalSize += deal.Size - byState[deal.State] = append(byState[deal.State], deal.Size) - } - - fmt.Printf("Deals: %d, %s\n", len(localDeals), types.SizeStr(types.NewInt(totalSize))) - - type stateStat struct { - state storagemarket.StorageDealStatus - count int - bytes uint64 - } - - stateStats := make([]stateStat, 0, len(byState)) - for state, deals := range byState { - if state == storagemarket.StorageDealActive { - state = math.MaxUint64 // for sort - } - - st := stateStat{ - state: state, - count: len(deals), - } - for _, b := range deals { - st.bytes += b - } - - stateStats = append(stateStats, st) - } - - sort.Slice(stateStats, func(i, j int) bool { - return int64(stateStats[i].state) < int64(stateStats[j].state) - }) - - for _, st := range stateStats { - if st.state == math.MaxUint64 { - st.state = storagemarket.StorageDealActive - } - fmt.Printf(" %s: %d deals, %s\n", storagemarket.DealStates[st.state], st.count, types.SizeStr(types.NewInt(st.bytes))) - } - - fmt.Println() - tw := tabwriter.NewWriter(os.Stdout, 6, 6, 2, ' ', 0) s, err := fullapi.NetBandwidthStats(ctx) diff --git a/cli/paych.go b/cli/paych.go index 46b043d6a6d..272eda4affb 100644 --- a/cli/paych.go +++ b/cli/paych.go @@ -39,11 +39,6 @@ var paychAddFundsCmd = &cli.Command{ Usage: "Add funds to the payment channel between fromAddress and toAddress. Creates the payment channel if it doesn't already exist.", ArgsUsage: "[fromAddress toAddress amount]", Flags: []cli.Flag{ - &cli.BoolFlag{ - Name: "restart-retrievals", - Usage: "restart stalled retrieval deals on this payment channel", - Value: true, - }, &cli.BoolFlag{ Name: "reserve", Usage: "mark funds as reserved", @@ -99,10 +94,6 @@ var paychAddFundsCmd = &cli.Command{ } fmt.Fprintln(cctx.App.Writer, chAddr) - restartRetrievals := cctx.Bool("restart-retrievals") - if restartRetrievals { - return api.ClientRetrieveTryRestartInsufficientFunds(ctx, chAddr) - } return nil }, } diff --git a/cli/util/api.go b/cli/util/api.go index 7940f67c63a..a734b23371e 100644 --- a/cli/util/api.go +++ b/cli/util/api.go @@ -456,27 +456,6 @@ func GetWorkerAPI(ctx *cli.Context) (api.Worker, jsonrpc.ClientCloser, error) { return client.NewWorkerRPCV0(ctx.Context, addr, headers) } -func GetMarketsAPI(ctx *cli.Context) (api.StorageMiner, jsonrpc.ClientCloser, error) { - // to support lotus-miner cli tests. - if tn, ok := ctx.App.Metadata["testnode-storage"]; ok { - return tn.(api.StorageMiner), func() {}, nil - } - - addr, headers, err := GetRawAPI(ctx, repo.Markets, "v0") - if err != nil { - return nil, nil, err - } - - if IsVeryVerbose { - _, _ = fmt.Fprintln(ctx.App.Writer, "using markets API v0 endpoint:", addr) - } - - // the markets node is a specialised miner's node, supporting only the - // markets API, which is a subset of the miner API. All non-markets - // operations will error out with "unsupported". - return client.NewStorageMinerRPCV0(ctx.Context, addr, headers) -} - func GetGatewayAPI(ctx *cli.Context) (api.Gateway, jsonrpc.ClientCloser, error) { addr, headers, err := GetRawAPI(ctx, repo.FullNode, "v1") if err != nil { diff --git a/cli/util/retrieval.go b/cli/util/retrieval.go deleted file mode 100644 index ac34fcf3a48..00000000000 --- a/cli/util/retrieval.go +++ /dev/null @@ -1,77 +0,0 @@ -package cliutil - -import ( - "encoding/json" - "fmt" - "io" - "net/http" - "net/url" - "path" - - "github.com/multiformats/go-multiaddr" - manet "github.com/multiformats/go-multiaddr/net" - "golang.org/x/xerrors" - - "github.com/filecoin-project/lotus/api" -) - -func ApiAddrToUrl(apiAddr string) (*url.URL, error) { - ma, err := multiaddr.NewMultiaddr(apiAddr) - if err == nil { - _, addr, err := manet.DialArgs(ma) - if err != nil { - return nil, err - } - // todo: make cliutil helpers for this - apiAddr = "http://" + addr - } - aa, err := url.Parse(apiAddr) - if err != nil { - return nil, xerrors.Errorf("parsing api address: %w", err) - } - switch aa.Scheme { - case "ws": - aa.Scheme = "http" - case "wss": - aa.Scheme = "https" - } - - return aa, nil -} - -func ClientExportStream(apiAddr string, apiAuth http.Header, eref api.ExportRef, car bool) (io.ReadCloser, error) { - rj, err := json.Marshal(eref) - if err != nil { - return nil, xerrors.Errorf("marshaling export ref: %w", err) - } - - aa, err := ApiAddrToUrl(apiAddr) - if err != nil { - return nil, err - } - - aa.Path = path.Join(aa.Path, "rest/v0/export") - req, err := http.NewRequest("GET", fmt.Sprintf("%s?car=%t&export=%s", aa, car, url.QueryEscape(string(rj))), nil) - if err != nil { - return nil, err - } - - req.Header = apiAuth - - resp, err := http.DefaultClient.Do(req) - if err != nil { - return nil, err - } - - if resp.StatusCode != http.StatusOK { - em, err := io.ReadAll(resp.Body) - if err != nil { - return nil, xerrors.Errorf("reading error body: %w", err) - } - - resp.Body.Close() // nolint - return nil, xerrors.Errorf("getting root car: http %d: %s", resp.StatusCode, string(em)) - } - - return resp.Body, nil -} diff --git a/cmd/lotus-bench/bench-sectors.sh b/cmd/lotus-bench/bench-sectors.sh new file mode 100755 index 00000000000..75b16bc9be9 --- /dev/null +++ b/cmd/lotus-bench/bench-sectors.sh @@ -0,0 +1,79 @@ +#!/usr/bin/env bash + +set -e +set -o pipefail + +tmpdir=/tmp + +flags="" +# flags="--non-interactive" +sector_size=2KiB +# sector_size=8MiB +# sector_size=512MiB +# sector_size=32GiB +# sector_size=64GiB + +unsealed_file=${tmpdir}/unsealed${sector_size} +sealed_file=${tmpdir}/sealed${sector_size} +cache_dir=${tmpdir}/cache${sector_size} +c1_file=${tmpdir}/c1_${sector_size}.json +proof_out=${tmpdir}/proof_${sector_size}.hex +rm -rf $unsealed_file $sealed_file $cache_dir $c1_file + +echo "Generating unsealed sector ..." +read -r unsealed_cid unsealed_size <<< $(./lotus-bench simple addpiece --sector-size $sector_size /dev/zero $unsealed_file | tail -1) +if [ $? -ne 0 ]; then exit 1; fi +echo "Unsealed CID: $unsealed_cid" +echo "Unsealed Size: $unsealed_size" + +start_total=$(date +%s%3N) + +echo "Running PC1 ..." +echo "./lotus-bench simple precommit1 --sector-size $sector_size $flags $unsealed_file $sealed_file $cache_dir $unsealed_cid $unsealed_size" +start_pc1=$(date +%s%3N) +pc1_output=$(./lotus-bench simple precommit1 --sector-size $sector_size $flags $unsealed_file $sealed_file $cache_dir $unsealed_cid $unsealed_size | tail -1) +if [ $? -ne 0 ]; then exit 1; fi +end_pc1=$(date +%s%3N) +pc1_duration=$((end_pc1 - start_pc1)) + +echo "Running PC2 ..." +echo "./lotus-bench simple precommit2 --sector-size $sector_size $flags $sealed_file $cache_dir $pc1_output" +start_pc2=$(date +%s%3N) +read -r commd commr <<< $(./lotus-bench simple precommit2 --sector-size $sector_size $flags $sealed_file $cache_dir $pc1_output | tail -1 | sed -E 's/[dr]://g') +if [ $? -ne 0 ]; then exit 1; fi +end_pc2=$(date +%s%3N) +pc2_duration=$((end_pc2 - start_pc2)) + +echo "CommD CID: $commd" +echo "CommR CID: $commr" + +echo "Running C1 ..." +echo "./lotus-bench simple commit1 --sector-size $sector_size $flags $sealed_file $cache_dir ${commd} ${commr} $c1_file" +start_c1=$(date +%s%3N) +./lotus-bench simple commit1 --sector-size $sector_size $flags $sealed_file $cache_dir ${commd} ${commr} $c1_file +end_c1=$(date +%s%3N) +c1_duration=$((end_c1 - start_c1)) + +echo "Running C2 ..." +echo "./lotus-bench simple commit2 $flags $c1_file" +start_c2=$(date +%s%3N) +proof=$(./lotus-bench simple commit2 $flags $c1_file | tail -1 | sed 's/^proof: //') +if [ $? -ne 0 ]; then exit 1; fi +end_c2=$(date +%s%3N) +c2_duration=$((end_c2 - start_c2)) + +echo $proof > $proof_out +echo "Wrote proof to $proof_out" + +# $proof is hex, calculate the length of it in bytes +proof_len=$(echo "scale=0; ${#proof}/2" | bc) +echo "Proof length: $proof_len" + +end_total=$(date +%s%3N) +total_duration=$((end_total - start_total)) + +echo "PC1 duration: $((pc1_duration / 1000)).$((pc1_duration % 1000)) seconds" +echo "PC2 duration: $((pc2_duration / 1000)).$((pc2_duration % 1000)) seconds" +echo "C1 duration: $((c1_duration / 1000)).$((c1_duration % 1000)) seconds" +echo "C2 duration: $((c2_duration / 1000)).$((c2_duration % 1000)) seconds" +echo "Total duration: $((total_duration / 1000)).$((total_duration % 1000)) seconds" \ No newline at end of file diff --git a/cmd/lotus-bench/main.go b/cmd/lotus-bench/main.go index 1a7a0d08792..91ac7c063e6 100644 --- a/cmd/lotus-bench/main.go +++ b/cmd/lotus-bench/main.go @@ -338,7 +338,7 @@ var sealBenchCmd = &cli.Command{ if !skipc2 { log.Info("generating winning post candidates") - wipt, err := spt(sectorSize, false).RegisteredWinningPoStProof() + wipt, err := spt(sectorSize, miner.SealProofVariant_Standard).RegisteredWinningPoStProof() if err != nil { return err } @@ -556,7 +556,7 @@ func runSeals(sb *ffiwrapper.Sealer, sbfs *basicfs.Provider, numSectors int, par Miner: mid, Number: i, }, - ProofType: spt(sectorSize, false), + ProofType: spt(sectorSize, miner.SealProofVariant_Standard), } start := time.Now() @@ -586,7 +586,7 @@ func runSeals(sb *ffiwrapper.Sealer, sbfs *basicfs.Provider, numSectors int, par Miner: mid, Number: i, }, - ProofType: spt(sectorSize, false), + ProofType: spt(sectorSize, miner.SealProofVariant_Standard), } start := time.Now() @@ -797,7 +797,7 @@ var proveCmd = &cli.Command{ Miner: abi.ActorID(mid), Number: abi.SectorNumber(c2in.SectorNum), }, - ProofType: spt(abi.SectorSize(c2in.SectorSize), false), + ProofType: spt(abi.SectorSize(c2in.SectorSize), miner.SealProofVariant_Standard), } fmt.Printf("----\nstart proof computation\n") @@ -828,8 +828,8 @@ func bps(sectorSize abi.SectorSize, sectorNum int, d time.Duration) string { return types.SizeStr(types.BigInt{Int: bps}) + "/s" } -func spt(ssize abi.SectorSize, synth bool) abi.RegisteredSealProof { - spt, err := miner.SealProofTypeFromSectorSize(ssize, build.TestNetworkVersion, synth) +func spt(ssize abi.SectorSize, variant miner.SealProofVariant) abi.RegisteredSealProof { + spt, err := miner.SealProofTypeFromSectorSize(ssize, build.TestNetworkVersion, variant) if err != nil { panic(err) } diff --git a/cmd/lotus-bench/simple.go b/cmd/lotus-bench/simple.go index 35d909ffb8c..4c32d366a2e 100644 --- a/cmd/lotus-bench/simple.go +++ b/cmd/lotus-bench/simple.go @@ -21,6 +21,7 @@ import ( prf "github.com/filecoin-project/specs-actors/actors/runtime/proof" "github.com/filecoin-project/lotus/build" + "github.com/filecoin-project/lotus/chain/actors/builtin/miner" lcli "github.com/filecoin-project/lotus/cli" "github.com/filecoin-project/lotus/storage/sealer/ffiwrapper" "github.com/filecoin-project/lotus/storage/sealer/storiface" @@ -186,7 +187,7 @@ var simpleAddPiece = &cli.Command{ Miner: mid, Number: 1, }, - ProofType: spt(sectorSize, false), + ProofType: spt(sectorSize, miner.SealProofVariant_Standard), } data, err := os.Open(cctx.Args().First()) @@ -201,7 +202,7 @@ var simpleAddPiece = &cli.Command{ return xerrors.Errorf("add piece: %w", err) } - took := time.Now().Sub(start) + took := time.Since(start) fmt.Printf("AddPiece %s (%s)\n", took, bps(abi.SectorSize(pi.Size), 1, took)) fmt.Printf("%s %d\n", pi.PieceCID, pi.Size) @@ -227,6 +228,10 @@ var simplePreCommit1 = &cli.Command{ Name: "synthetic", Usage: "generate synthetic PoRep proofs", }, + &cli.BoolFlag{ + Name: "non-interactive", + Usage: "generate NI-PoRep proofs", + }, }, ArgsUsage: "[unsealed] [sealed] [cache] [[piece cid] [piece size]]...", Action: func(cctx *cli.Context) error { @@ -258,12 +263,17 @@ var simplePreCommit1 = &cli.Command{ return err } + variant, err := variantFromArgs(cctx) + if err != nil { + return err + } + sr := storiface.SectorRef{ ID: abi.SectorID{ Miner: mid, Number: 1, }, - ProofType: spt(sectorSize, cctx.Bool("synthetic")), + ProofType: spt(sectorSize, variant), } ticket := [32]byte{} @@ -283,7 +293,7 @@ var simplePreCommit1 = &cli.Command{ return xerrors.Errorf("precommit1: %w", err) } - took := time.Now().Sub(start) + took := time.Since(start) fmt.Printf("PreCommit1 %s (%s)\n", took, bps(sectorSize, 1, took)) fmt.Println(base64.StdEncoding.EncodeToString(p1o)) @@ -308,6 +318,10 @@ var simplePreCommit2 = &cli.Command{ Name: "synthetic", Usage: "generate synthetic PoRep proofs", }, + &cli.BoolFlag{ + Name: "non-interactive", + Usage: "generate NI-PoRep proofs", + }, &cli.StringFlag{ Name: "external-pc2", Usage: "command for computing PC2 externally", @@ -383,12 +397,17 @@ Example invocation of lotus-bench as external executor: return err } + variant, err := variantFromArgs(cctx) + if err != nil { + return err + } + sr := storiface.SectorRef{ ID: abi.SectorID{ Miner: mid, Number: 1, }, - ProofType: spt(sectorSize, cctx.Bool("synthetic")), + ProofType: spt(sectorSize, variant), } start := time.Now() @@ -398,7 +417,7 @@ Example invocation of lotus-bench as external executor: return xerrors.Errorf("precommit2: %w", err) } - took := time.Now().Sub(start) + took := time.Since(start) fmt.Printf("PreCommit2 %s (%s)\n", took, bps(sectorSize, 1, took)) fmt.Printf("d:%s r:%s\n", p2o.Unsealed, p2o.Sealed) @@ -423,6 +442,10 @@ var simpleCommit1 = &cli.Command{ Name: "synthetic", Usage: "generate synthetic PoRep proofs", }, + &cli.BoolFlag{ + Name: "non-interactive", + Usage: "generate NI-PoRep proofs", + }, }, ArgsUsage: "[sealed] [cache] [comm D] [comm R] [c1out.json]", Action: func(cctx *cli.Context) error { @@ -453,12 +476,17 @@ var simpleCommit1 = &cli.Command{ return err } + variant, err := variantFromArgs(cctx) + if err != nil { + return err + } + sr := storiface.SectorRef{ ID: abi.SectorID{ Miner: mid, Number: 1, }, - ProofType: spt(sectorSize, cctx.Bool("synthetic")), + ProofType: spt(sectorSize, variant), } start := time.Now() @@ -493,7 +521,7 @@ var simpleCommit1 = &cli.Command{ return xerrors.Errorf("commit1: %w", err) } - took := time.Now().Sub(start) + took := time.Since(start) fmt.Printf("Commit1 %s (%s)\n", took, bps(sectorSize, 1, took)) @@ -533,6 +561,10 @@ var simpleCommit2 = &cli.Command{ Name: "synthetic", Usage: "generate synthetic PoRep proofs", }, + &cli.BoolFlag{ + Name: "non-interactive", + Usage: "generate NI-PoRep proofs", + }, }, Action: func(c *cli.Context) error { if c.Bool("no-gpu") { @@ -574,12 +606,17 @@ var simpleCommit2 = &cli.Command{ return err } + variant, err := variantFromArgs(c) + if err != nil { + return err + } + ref := storiface.SectorRef{ ID: abi.SectorID{ Miner: abi.ActorID(mid), Number: abi.SectorNumber(c2in.SectorNum), }, - ProofType: spt(abi.SectorSize(c2in.SectorSize), c.Bool("synthetic")), + ProofType: spt(abi.SectorSize(c2in.SectorSize), variant), } start := time.Now() @@ -637,7 +674,7 @@ var simpleWindowPost = &cli.Command{ return xerrors.Errorf("parse commr: %w", err) } - wpt, err := spt(sectorSize, false).RegisteredWindowPoStProof() + wpt, err := spt(sectorSize, miner.SealProofVariant_Standard).RegisteredWindowPoStProof() if err != nil { return err } @@ -657,7 +694,7 @@ var simpleWindowPost = &cli.Command{ vp, err := ffi.GenerateSingleVanillaProof(ffi.PrivateSectorInfo{ SectorInfo: prf.SectorInfo{ - SealProof: spt(sectorSize, false), + SealProof: spt(sectorSize, miner.SealProofVariant_Standard), SectorNumber: sn, SealedCID: commr, }, @@ -728,7 +765,7 @@ var simpleWinningPost = &cli.Command{ return xerrors.Errorf("parse commr: %w", err) } - wpt, err := spt(sectorSize, false).RegisteredWinningPoStProof() + wpt, err := spt(sectorSize, miner.SealProofVariant_Standard).RegisteredWinningPoStProof() if err != nil { return err } @@ -748,7 +785,7 @@ var simpleWinningPost = &cli.Command{ vp, err := ffi.GenerateSingleVanillaProof(ffi.PrivateSectorInfo{ SectorInfo: prf.SectorInfo{ - SealProof: spt(sectorSize, false), + SealProof: spt(sectorSize, miner.SealProofVariant_Standard), SectorNumber: sn, SealedCID: commr, }, @@ -842,7 +879,7 @@ var simpleReplicaUpdate = &cli.Command{ Miner: mid, Number: 1, }, - ProofType: spt(sectorSize, false), + ProofType: spt(sectorSize, miner.SealProofVariant_Standard), } start := time.Now() @@ -852,7 +889,7 @@ var simpleReplicaUpdate = &cli.Command{ return xerrors.Errorf("replica update: %w", err) } - took := time.Now().Sub(start) + took := time.Since(start) fmt.Printf("ReplicaUpdate %s (%s)\n", took, bps(sectorSize, 1, took)) fmt.Printf("d:%s r:%s\n", ruo.NewUnsealed, ruo.NewSealed) @@ -910,7 +947,7 @@ var simpleProveReplicaUpdate1 = &cli.Command{ Miner: mid, Number: 1, }, - ProofType: spt(sectorSize, false), + ProofType: spt(sectorSize, miner.SealProofVariant_Standard), } start := time.Now() @@ -935,7 +972,7 @@ var simpleProveReplicaUpdate1 = &cli.Command{ return xerrors.Errorf("replica update: %w", err) } - took := time.Now().Sub(start) + took := time.Since(start) fmt.Printf("ProveReplicaUpdate1 %s (%s)\n", took, bps(sectorSize, 1, took)) @@ -997,7 +1034,7 @@ var simpleProveReplicaUpdate2 = &cli.Command{ Miner: mid, Number: 1, }, - ProofType: spt(sectorSize, false), + ProofType: spt(sectorSize, miner.SealProofVariant_Standard), } start := time.Now() @@ -1032,7 +1069,7 @@ var simpleProveReplicaUpdate2 = &cli.Command{ return xerrors.Errorf("prove replica update2: %w", err) } - took := time.Now().Sub(start) + took := time.Since(start) fmt.Printf("ProveReplicaUpdate2 %s (%s)\n", took, bps(sectorSize, 1, took)) fmt.Println("p:", base64.StdEncoding.EncodeToString(p)) @@ -1071,3 +1108,16 @@ func ParsePieceInfos(cctx *cli.Context, firstArg int) ([]abi.PieceInfo, error) { return out, nil } + +func variantFromArgs(cctx *cli.Context) (miner.SealProofVariant, error) { + variant := miner.SealProofVariant_Standard + if cctx.Bool("synthetic") { + if cctx.Bool("non-interactive") { + return variant, xerrors.Errorf("can't use both synthetic and non-interactive") + } + variant = miner.SealProofVariant_Synthetic + } else if cctx.Bool("non-interactive") { + variant = miner.SealProofVariant_NonInteractive + } + return variant, nil +} diff --git a/cmd/lotus-miner/allinfo_test.go b/cmd/lotus-miner/allinfo_test.go index 2388f2f7aeb..a0735fc9771 100644 --- a/cmd/lotus-miner/allinfo_test.go +++ b/cmd/lotus-miner/allinfo_test.go @@ -2,7 +2,6 @@ package main import ( - "context" "flag" "testing" "time" @@ -43,11 +42,5 @@ func TestMinerAllInfo(t *testing.T) { t.Run("pre-info-all", run) - //stm: @CLIENT_DATA_IMPORT_001, @CLIENT_STORAGE_DEALS_GET_001 - dh := kit.NewDealHarness(t, client, miner, miner) - deal, res, inPath := dh.MakeOnlineDeal(context.Background(), kit.MakeFullDealParams{Rseed: 6}) - outPath := dh.PerformRetrieval(context.Background(), deal, res.Root, false) - kit.AssertFilesEqual(t, inPath, outPath) - t.Run("post-info-all", run) } diff --git a/cmd/lotus-miner/dagstore.go b/cmd/lotus-miner/dagstore.go deleted file mode 100644 index c0e37f63bf0..00000000000 --- a/cmd/lotus-miner/dagstore.go +++ /dev/null @@ -1,282 +0,0 @@ -package main - -import ( - "fmt" - "os" - "strings" - - "github.com/fatih/color" - "github.com/ipfs/go-cid" - "github.com/urfave/cli/v2" - - "github.com/filecoin-project/lotus/api" - lcli "github.com/filecoin-project/lotus/cli" - "github.com/filecoin-project/lotus/lib/tablewriter" -) - -var dagstoreCmd = &cli.Command{ - Name: "dagstore", - Usage: "Manage the dagstore on the markets subsystem", - Subcommands: []*cli.Command{ - dagstoreListShardsCmd, - dagstoreRegisterShardCmd, - dagstoreInitializeShardCmd, - dagstoreRecoverShardCmd, - dagstoreInitializeAllCmd, - dagstoreGcCmd, - dagstoreLookupPiecesCmd, - }, -} - -var dagstoreListShardsCmd = &cli.Command{ - Name: "list-shards", - Usage: "List all shards known to the dagstore, with their current status", - Action: func(cctx *cli.Context) error { - marketsApi, closer, err := lcli.GetMarketsAPI(cctx) - if err != nil { - return err - } - defer closer() - - ctx := lcli.ReqContext(cctx) - - shards, err := marketsApi.DagstoreListShards(ctx) - if err != nil { - return err - } - - return printTableShards(shards) - }, -} - -var dagstoreRegisterShardCmd = &cli.Command{ - Name: "register-shard", - ArgsUsage: "[key]", - Usage: "Register a shard", - Action: func(cctx *cli.Context) error { - if cctx.NArg() != 1 { - return lcli.IncorrectNumArgs(cctx) - } - - marketsAPI, closer, err := lcli.GetMarketsAPI(cctx) - if err != nil { - return err - } - defer closer() - - ctx := lcli.ReqContext(cctx) - - shardKey := cctx.Args().First() - err = marketsAPI.DagstoreRegisterShard(ctx, shardKey) - if err != nil { - return err - } - - fmt.Println("Registered shard " + shardKey) - return nil - }, -} - -var dagstoreInitializeShardCmd = &cli.Command{ - Name: "initialize-shard", - ArgsUsage: "[key]", - Usage: "Initialize the specified shard", - Action: func(cctx *cli.Context) error { - if cctx.NArg() != 1 { - return lcli.IncorrectNumArgs(cctx) - } - - marketsApi, closer, err := lcli.GetMarketsAPI(cctx) - if err != nil { - return err - } - defer closer() - - ctx := lcli.ReqContext(cctx) - - return marketsApi.DagstoreInitializeShard(ctx, cctx.Args().First()) - }, -} - -var dagstoreRecoverShardCmd = &cli.Command{ - Name: "recover-shard", - ArgsUsage: "[key]", - Usage: "Attempt to recover a shard in errored state", - Action: func(cctx *cli.Context) error { - if cctx.NArg() != 1 { - return lcli.IncorrectNumArgs(cctx) - } - - marketsApi, closer, err := lcli.GetMarketsAPI(cctx) - if err != nil { - return err - } - defer closer() - - ctx := lcli.ReqContext(cctx) - - return marketsApi.DagstoreRecoverShard(ctx, cctx.Args().First()) - }, -} - -var dagstoreInitializeAllCmd = &cli.Command{ - Name: "initialize-all", - Usage: "Initialize all uninitialized shards, streaming results as they're produced; only shards for unsealed pieces are initialized by default", - Flags: []cli.Flag{ - &cli.UintFlag{ - Name: "concurrency", - Usage: "maximum shards to initialize concurrently at a time; use 0 for unlimited", - Required: true, - }, - &cli.BoolFlag{ - Name: "include-sealed", - Usage: "initialize sealed pieces as well", - }, - }, - Action: func(cctx *cli.Context) error { - concurrency := cctx.Uint("concurrency") - sealed := cctx.Bool("sealed") - - marketsApi, closer, err := lcli.GetMarketsAPI(cctx) - if err != nil { - return err - } - defer closer() - - ctx := lcli.ReqContext(cctx) - - params := api.DagstoreInitializeAllParams{ - MaxConcurrency: int(concurrency), - IncludeSealed: sealed, - } - - ch, err := marketsApi.DagstoreInitializeAll(ctx, params) - if err != nil { - return err - } - - for { - select { - case evt, ok := <-ch: - if !ok { - return nil - } - _, _ = fmt.Fprint(os.Stdout, color.New(color.BgHiBlack).Sprintf("(%d/%d)", evt.Current, evt.Total)) - _, _ = fmt.Fprint(os.Stdout, " ") - if evt.Event == "start" { - _, _ = fmt.Fprintln(os.Stdout, evt.Key, color.New(color.Reset).Sprint("STARTING")) - } else { - if evt.Success { - _, _ = fmt.Fprintln(os.Stdout, evt.Key, color.New(color.FgGreen).Sprint("SUCCESS")) - } else { - _, _ = fmt.Fprintln(os.Stdout, evt.Key, color.New(color.FgRed).Sprint("ERROR"), evt.Error) - } - } - - case <-ctx.Done(): - return fmt.Errorf("aborted") - } - } - }, -} - -var dagstoreGcCmd = &cli.Command{ - Name: "gc", - Usage: "Garbage collect the dagstore", - Action: func(cctx *cli.Context) error { - marketsApi, closer, err := lcli.GetMarketsAPI(cctx) - if err != nil { - return err - } - defer closer() - - ctx := lcli.ReqContext(cctx) - - collected, err := marketsApi.DagstoreGC(ctx) - if err != nil { - return err - } - - if len(collected) == 0 { - _, _ = fmt.Fprintln(os.Stdout, "no shards collected") - return nil - } - - for _, e := range collected { - if e.Error == "" { - _, _ = fmt.Fprintln(os.Stdout, e.Key, color.New(color.FgGreen).Sprint("SUCCESS")) - } else { - _, _ = fmt.Fprintln(os.Stdout, e.Key, color.New(color.FgRed).Sprint("ERROR"), e.Error) - } - } - - return nil - }, -} - -func printTableShards(shards []api.DagstoreShardInfo) error { - if len(shards) == 0 { - return nil - } - - tw := tablewriter.New( - tablewriter.Col("Key"), - tablewriter.Col("State"), - tablewriter.Col("Error"), - ) - - colors := map[string]color.Attribute{ - "ShardStateAvailable": color.FgGreen, - "ShardStateServing": color.FgBlue, - "ShardStateErrored": color.FgRed, - "ShardStateNew": color.FgYellow, - } - - for _, s := range shards { - m := map[string]interface{}{ - "Key": s.Key, - "State": func() string { - trimmedState := strings.TrimPrefix(s.State, "ShardState") - if c, ok := colors[s.State]; ok { - return color.New(c).Sprint(trimmedState) - } - return trimmedState - }(), - "Error": s.Error, - } - tw.Write(m) - } - return tw.Flush(os.Stdout) -} - -var dagstoreLookupPiecesCmd = &cli.Command{ - Name: "lookup-pieces", - Usage: "Lookup pieces that a given CID belongs to", - ArgsUsage: "", - Action: func(cctx *cli.Context) error { - if cctx.NArg() != 1 { - return lcli.IncorrectNumArgs(cctx) - } - - cidStr := cctx.Args().First() - cid, err := cid.Parse(cidStr) - if err != nil { - return fmt.Errorf("invalid CID: %w", err) - } - - marketsApi, closer, err := lcli.GetMarketsAPI(cctx) - if err != nil { - return err - } - defer closer() - - ctx := lcli.ReqContext(cctx) - - shards, err := marketsApi.DagstoreLookupPieces(ctx, cid) - if err != nil { - return err - } - - return printTableShards(shards) - }, -} diff --git a/cmd/lotus-miner/index_provider.go b/cmd/lotus-miner/index_provider.go deleted file mode 100644 index 2b6838a4b3f..00000000000 --- a/cmd/lotus-miner/index_provider.go +++ /dev/null @@ -1,62 +0,0 @@ -package main - -import ( - "fmt" - - "github.com/ipfs/go-cid" - "github.com/urfave/cli/v2" - - lcli "github.com/filecoin-project/lotus/cli" -) - -var indexProvCmd = &cli.Command{ - Name: "index", - Usage: "Manage the index provider on the markets subsystem", - Subcommands: []*cli.Command{ - indexProvAnnounceCmd, - indexProvAnnounceAllCmd, - }, -} - -var indexProvAnnounceCmd = &cli.Command{ - Name: "announce", - ArgsUsage: "", - Usage: "Announce a deal to indexers so they can download its index", - Action: func(cctx *cli.Context) error { - if cctx.NArg() != 1 { - return lcli.IncorrectNumArgs(cctx) - } - - proposalCidStr := cctx.Args().First() - proposalCid, err := cid.Parse(proposalCidStr) - if err != nil { - return fmt.Errorf("invalid deal proposal CID: %w", err) - } - - marketsApi, closer, err := lcli.GetMarketsAPI(cctx) - if err != nil { - return err - } - defer closer() - - ctx := lcli.ReqContext(cctx) - - return marketsApi.IndexerAnnounceDeal(ctx, proposalCid) - }, -} - -var indexProvAnnounceAllCmd = &cli.Command{ - Name: "announce-all", - Usage: "Announce all active deals to indexers so they can download the indices", - Action: func(cctx *cli.Context) error { - marketsApi, closer, err := lcli.GetMarketsAPI(cctx) - if err != nil { - return err - } - defer closer() - - ctx := lcli.ReqContext(cctx) - - return marketsApi.IndexerAnnounceAllDeals(ctx) - }, -} diff --git a/cmd/lotus-miner/info_all.go b/cmd/lotus-miner/info_all.go index 5b83467a2f8..253d2befc67 100644 --- a/cmd/lotus-miner/info_all.go +++ b/cmd/lotus-miner/info_all.go @@ -112,72 +112,6 @@ var infoAllCmd = &cli.Command{ fmt.Println("ERROR: ", err) } - fmt.Println("\n#: Storage Ask") - if err := getAskCmd.Action(cctx); err != nil { - fmt.Println("ERROR: ", err) - } - - fmt.Println("\n#: Storage Deals") - { - fs := &flag.FlagSet{} - for _, f := range dealsListCmd.Flags { - if err := f.Apply(fs); err != nil { - fmt.Println("ERROR: ", err) - } - } - if err := fs.Parse([]string{"--verbose"}); err != nil { - fmt.Println("ERROR: ", err) - } - - if err := dealsListCmd.Action(cli.NewContext(cctx.App, fs, cctx)); err != nil { - fmt.Println("ERROR: ", err) - } - } - - fmt.Println("\n#: Storage Deals JSON") - { - fs := &flag.FlagSet{} - for _, f := range dealsListCmd.Flags { - if err := f.Apply(fs); err != nil { - fmt.Println("ERROR: ", err) - } - } - if err := fs.Parse([]string{"--verbose", "--format=json"}); err != nil { - fmt.Println("ERROR: ", err) - } - - if err := dealsListCmd.Action(cli.NewContext(cctx.App, fs, cctx)); err != nil { - fmt.Println("ERROR: ", err) - } - } - - fmt.Println("\n#: Data Transfers") - { - fs := &flag.FlagSet{} - for _, f := range transfersListCmd.Flags { - if err := f.Apply(fs); err != nil { - fmt.Println("ERROR: ", err) - } - } - if err := fs.Parse([]string{"--verbose", "--completed", "--show-failed"}); err != nil { - fmt.Println("ERROR: ", err) - } - - if err := transfersListCmd.Action(cli.NewContext(cctx.App, fs, cctx)); err != nil { - fmt.Println("ERROR: ", err) - } - } - - fmt.Println("\n#: DAGStore shards") - if err := dagstoreListShardsCmd.Action(cctx); err != nil { - fmt.Println("ERROR: ", err) - } - - fmt.Println("\n#: Pending Batch Deals") - if err := dealsPendingPublish.Action(cctx); err != nil { - fmt.Println("ERROR: ", err) - } - fmt.Println("\n#: Pending Batch Terminations") if err := sectorsTerminatePendingCmd.Action(cctx); err != nil { fmt.Println("ERROR: ", err) @@ -217,11 +151,6 @@ var infoAllCmd = &cli.Command{ fmt.Println("ERROR: ", err) } - fmt.Println("\n#: Sector Refs") - if err := sectorsRefsCmd.Action(cctx); err != nil { - fmt.Println("ERROR: ", err) - } - // Very Very Verbose info fmt.Println("\n#: Per Sector Info") diff --git a/cmd/lotus-miner/init.go b/cmd/lotus-miner/init.go index 9ab4e8b05b0..621cb078e7e 100644 --- a/cmd/lotus-miner/init.go +++ b/cmd/lotus-miner/init.go @@ -129,7 +129,6 @@ var initCmd = &cli.Command{ }, Subcommands: []*cli.Command{ restoreCmd, - serviceCmd, }, Action: func(cctx *cli.Context) error { log.Info("Initializing lotus miner") diff --git a/cmd/lotus-miner/init_service.go b/cmd/lotus-miner/init_service.go deleted file mode 100644 index 876313941f9..00000000000 --- a/cmd/lotus-miner/init_service.go +++ /dev/null @@ -1,159 +0,0 @@ -package main - -import ( - "context" - "strings" - - "github.com/libp2p/go-libp2p/core/peer" - "github.com/urfave/cli/v2" - "golang.org/x/xerrors" - - "github.com/filecoin-project/go-address" - "github.com/filecoin-project/go-state-types/big" - - "github.com/filecoin-project/lotus/api" - lapi "github.com/filecoin-project/lotus/api" - "github.com/filecoin-project/lotus/api/client" - lcli "github.com/filecoin-project/lotus/cli" - cliutil "github.com/filecoin-project/lotus/cli/util" - "github.com/filecoin-project/lotus/node/config" - "github.com/filecoin-project/lotus/storage/sealer/storiface" -) - -const ( - MarketsService = "markets" -) - -var serviceCmd = &cli.Command{ - Name: "service", - Usage: "Initialize a lotus miner sub-service", - Flags: []cli.Flag{ - &cli.StringFlag{ - Name: "config", - Usage: "config file (config.toml)", - Required: true, - }, - &cli.BoolFlag{ - Name: "nosync", - Usage: "don't check full-node sync status", - }, - &cli.StringSliceFlag{ - Name: "type", - Usage: "type of service to be enabled", - }, - &cli.StringFlag{ - Name: "api-sealer", - Usage: "sealer API info (lotus-miner auth api-info --perm=admin)", - }, - &cli.StringFlag{ - Name: "api-sector-index", - Usage: "sector Index API info (lotus-miner auth api-info --perm=admin)", - }, - }, - ArgsUsage: "[backupFile]", - Action: func(cctx *cli.Context) error { - ctx := lcli.ReqContext(cctx) - log.Info("Initializing lotus miner service") - - es := EnabledServices(cctx.StringSlice("type")) - - if len(es) == 0 { - return xerrors.Errorf("at least one module must be enabled") - } - - // we should remove this as soon as we have more service types and not just `markets` - if !es.Contains(MarketsService) { - return xerrors.Errorf("markets module must be enabled") - } - - if !cctx.IsSet("api-sealer") { - return xerrors.Errorf("--api-sealer is required without the sealer module enabled") - } - if !cctx.IsSet("api-sector-index") { - return xerrors.Errorf("--api-sector-index is required without the sector storage module enabled") - } - - repoPath := cctx.String(FlagMarketsRepo) - if repoPath == "" { - return xerrors.Errorf("please provide Lotus markets repo path via flag %s", FlagMarketsRepo) - } - - if err := restore(ctx, cctx, repoPath, &storiface.StorageConfig{}, func(cfg *config.StorageMiner) error { - cfg.Subsystems.EnableMarkets = es.Contains(MarketsService) - cfg.Subsystems.EnableMining = false - cfg.Subsystems.EnableSealing = false - cfg.Subsystems.EnableSectorStorage = false - - if !cfg.Subsystems.EnableSealing { - ai, err := checkApiInfo(ctx, cctx.String("api-sealer")) - if err != nil { - return xerrors.Errorf("checking sealer API: %w", err) - } - cfg.Subsystems.SealerApiInfo = ai - } - - if !cfg.Subsystems.EnableSectorStorage { - ai, err := checkApiInfo(ctx, cctx.String("api-sector-index")) - if err != nil { - return xerrors.Errorf("checking sector index API: %w", err) - } - cfg.Subsystems.SectorIndexApiInfo = ai - } - - return nil - }, func(api lapi.FullNode, maddr address.Address, peerid peer.ID, mi api.MinerInfo) error { - if es.Contains(MarketsService) { - log.Info("Configuring miner actor") - - if err := configureStorageMiner(ctx, api, maddr, peerid, big.Zero(), cctx.Uint64("confidence")); err != nil { - return err - } - } - - return nil - }); err != nil { - return err - } - - return nil - }, -} - -type EnabledServices []string - -func (es EnabledServices) Contains(name string) bool { - for _, s := range es { - if s == name { - return true - } - } - return false -} - -func checkApiInfo(ctx context.Context, ai string) (string, error) { - ai = strings.TrimPrefix(strings.TrimSpace(ai), "MINER_API_INFO=") - info := cliutil.ParseApiInfo(ai) - addr, err := info.DialArgs("v0") - if err != nil { - return "", xerrors.Errorf("could not get DialArgs: %w", err) - } - - log.Infof("Checking api version of %s", addr) - - api, closer, err := client.NewStorageMinerRPCV0(ctx, addr, info.AuthHeader()) - if err != nil { - return "", err - } - defer closer() - - v, err := api.Version(ctx) - if err != nil { - return "", xerrors.Errorf("checking version: %w", err) - } - - if !v.APIVersion.EqMajorMinor(lapi.MinerAPIVersion0) { - return "", xerrors.Errorf("remote service API version didn't match (expected %s, remote %s)", lapi.MinerAPIVersion0, v.APIVersion) - } - - return ai, nil -} diff --git a/cmd/lotus-miner/main.go b/cmd/lotus-miner/main.go index 1fc7abfa8da..0d20a36e010 100644 --- a/cmd/lotus-miner/main.go +++ b/cmd/lotus-miner/main.go @@ -43,16 +43,10 @@ func main() { backupCmd, lcli.WithCategory("chain", actorCmd), lcli.WithCategory("chain", infoCmd), - lcli.WithCategory("market", setHidden(storageDealsCmd)), - lcli.WithCategory("market", setHidden(retrievalDealsCmd)), - lcli.WithCategory("market", setHidden(dataTransfersCmd)), - lcli.WithCategory("market", setHidden(dagstoreCmd)), - lcli.WithCategory("market", setHidden(indexProvCmd)), lcli.WithCategory("storage", sectorsCmd), lcli.WithCategory("storage", provingCmd), lcli.WithCategory("storage", storageCmd), lcli.WithCategory("storage", sealingCmd), - lcli.WithCategory("retrieval", setHidden(piecesCmd)), } jaeger := tracing.SetupJaegerTracing("lotus") @@ -193,11 +187,6 @@ func getActorAddress(ctx context.Context, cctx *cli.Context) (maddr address.Addr return maddr, nil } -func setHidden(cmd *cli.Command) *cli.Command { - cmd.Hidden = true - return cmd -} - func LMActorOrEnvGetter(cctx *cli.Context) (address.Address, error) { return getActorAddress(cctx.Context, cctx) } diff --git a/cmd/lotus-miner/market.go b/cmd/lotus-miner/market.go deleted file mode 100644 index 29eb662a78d..00000000000 --- a/cmd/lotus-miner/market.go +++ /dev/null @@ -1,1039 +0,0 @@ -package main - -import ( - "bufio" - "context" - "encoding/json" - "errors" - "fmt" - "io" - "os" - "path/filepath" - "sort" - "strconv" - "text/tabwriter" - "time" - - tm "github.com/buger/goterm" - "github.com/docker/go-units" - "github.com/ipfs/go-cid" - "github.com/ipfs/go-cidutil/cidenc" - "github.com/libp2p/go-libp2p/core/peer" - "github.com/multiformats/go-multibase" - "github.com/urfave/cli/v2" - "golang.org/x/xerrors" - - cborutil "github.com/filecoin-project/go-cbor-util" - datatransfer "github.com/filecoin-project/go-data-transfer/v2" - "github.com/filecoin-project/go-fil-markets/storagemarket" - "github.com/filecoin-project/go-state-types/abi" - - "github.com/filecoin-project/lotus/api" - "github.com/filecoin-project/lotus/build" - "github.com/filecoin-project/lotus/chain/types" - lcli "github.com/filecoin-project/lotus/cli" -) - -var CidBaseFlag = cli.StringFlag{ - Name: "cid-base", - Hidden: true, - Value: "base32", - Usage: "Multibase encoding used for version 1 CIDs in output.", - DefaultText: "base32", -} - -// GetCidEncoder returns an encoder using the `cid-base` flag if provided, or -// the default (Base32) encoder if not. -func GetCidEncoder(cctx *cli.Context) (cidenc.Encoder, error) { - val := cctx.String("cid-base") - - e := cidenc.Encoder{Base: multibase.MustNewEncoder(multibase.Base32)} - - if val != "" { - var err error - e.Base, err = multibase.EncoderByName(val) - if err != nil { - return e, err - } - } - - return e, nil -} - -var storageDealSelectionCmd = &cli.Command{ - Name: "selection", - Usage: "Configure acceptance criteria for storage deal proposals", - Subcommands: []*cli.Command{ - storageDealSelectionShowCmd, - storageDealSelectionResetCmd, - storageDealSelectionRejectCmd, - }, -} - -var storageDealSelectionShowCmd = &cli.Command{ - Name: "list", - Usage: "List storage deal proposal selection criteria", - Action: func(cctx *cli.Context) error { - smapi, closer, err := lcli.GetMarketsAPI(cctx) - if err != nil { - return err - } - defer closer() - - onlineOk, err := smapi.DealsConsiderOnlineStorageDeals(lcli.DaemonContext(cctx)) - if err != nil { - return err - } - - offlineOk, err := smapi.DealsConsiderOfflineStorageDeals(lcli.DaemonContext(cctx)) - if err != nil { - return err - } - - fmt.Printf("considering online storage deals: %t\n", onlineOk) - fmt.Printf("considering offline storage deals: %t\n", offlineOk) - - return nil - }, -} - -var storageDealSelectionResetCmd = &cli.Command{ - Name: "reset", - Usage: "Reset storage deal proposal selection criteria to default values", - Action: func(cctx *cli.Context) error { - smapi, closer, err := lcli.GetMarketsAPI(cctx) - if err != nil { - return err - } - defer closer() - - err = smapi.DealsSetConsiderOnlineStorageDeals(lcli.DaemonContext(cctx), true) - if err != nil { - return err - } - - err = smapi.DealsSetConsiderOfflineStorageDeals(lcli.DaemonContext(cctx), true) - if err != nil { - return err - } - - err = smapi.DealsSetConsiderVerifiedStorageDeals(lcli.DaemonContext(cctx), true) - if err != nil { - return err - } - - err = smapi.DealsSetConsiderUnverifiedStorageDeals(lcli.DaemonContext(cctx), true) - if err != nil { - return err - } - - return nil - }, -} - -var storageDealSelectionRejectCmd = &cli.Command{ - Name: "reject", - Usage: "Configure criteria which necessitate automatic rejection", - Flags: []cli.Flag{ - &cli.BoolFlag{ - Name: "online", - }, - &cli.BoolFlag{ - Name: "offline", - }, - &cli.BoolFlag{ - Name: "verified", - }, - &cli.BoolFlag{ - Name: "unverified", - }, - }, - Action: func(cctx *cli.Context) error { - smapi, closer, err := lcli.GetMarketsAPI(cctx) - if err != nil { - return err - } - defer closer() - - if cctx.Bool("online") { - err = smapi.DealsSetConsiderOnlineStorageDeals(lcli.DaemonContext(cctx), false) - if err != nil { - return err - } - } - - if cctx.Bool("offline") { - err = smapi.DealsSetConsiderOfflineStorageDeals(lcli.DaemonContext(cctx), false) - if err != nil { - return err - } - } - - if cctx.Bool("verified") { - err = smapi.DealsSetConsiderVerifiedStorageDeals(lcli.DaemonContext(cctx), false) - if err != nil { - return err - } - } - - if cctx.Bool("unverified") { - err = smapi.DealsSetConsiderUnverifiedStorageDeals(lcli.DaemonContext(cctx), false) - if err != nil { - return err - } - } - - return nil - }, -} - -var setAskCmd = &cli.Command{ - Name: "set-ask", - Usage: "Configure the miner's ask", - Flags: []cli.Flag{ - &cli.StringFlag{ - Name: "price", - Usage: "Set the price of the ask for unverified deals (specified as FIL / GiB / Epoch) to `PRICE`.", - Required: true, - }, - &cli.StringFlag{ - Name: "verified-price", - Usage: "Set the price of the ask for verified deals (specified as FIL / GiB / Epoch) to `PRICE`", - Required: true, - }, - &cli.StringFlag{ - Name: "min-piece-size", - Usage: "Set minimum piece size (w/bit-padding, in bytes) in ask to `SIZE`", - DefaultText: "256B", - Value: "256B", - }, - &cli.StringFlag{ - Name: "max-piece-size", - Usage: "Set maximum piece size (w/bit-padding, in bytes) in ask to `SIZE`", - DefaultText: "miner sector size", - Value: "0", - }, - }, - Action: func(cctx *cli.Context) error { - ctx := lcli.DaemonContext(cctx) - - minerApi, closer, err := lcli.GetStorageMinerAPI(cctx) - if err != nil { - return err - } - defer closer() - - marketsApi, closer, err := lcli.GetMarketsAPI(cctx) - if err != nil { - return err - } - defer closer() - - pri, err := types.ParseFIL(cctx.String("price")) - if err != nil { - return err - } - - vpri, err := types.ParseFIL(cctx.String("verified-price")) - if err != nil { - return err - } - - dur, err := time.ParseDuration("720h0m0s") - if err != nil { - return xerrors.Errorf("cannot parse duration: %w", err) - } - - qty := dur.Seconds() / float64(build.BlockDelaySecs) - - min, err := units.RAMInBytes(cctx.String("min-piece-size")) - if err != nil { - return xerrors.Errorf("cannot parse min-piece-size to quantity of bytes: %w", err) - } - - if min < 256 { - return xerrors.New("minimum piece size (w/bit-padding) is 256B") - } - - max, err := units.RAMInBytes(cctx.String("max-piece-size")) - if err != nil { - return xerrors.Errorf("cannot parse max-piece-size to quantity of bytes: %w", err) - } - - maddr, err := minerApi.ActorAddress(ctx) - if err != nil { - return err - } - - ssize, err := minerApi.ActorSectorSize(ctx, maddr) - if err != nil { - return err - } - - smax := int64(ssize) - - if max == 0 { - max = smax - } - - if max > smax { - return xerrors.Errorf("max piece size (w/bit-padding) %s cannot exceed miner sector size %s", types.SizeStr(types.NewInt(uint64(max))), types.SizeStr(types.NewInt(uint64(smax)))) - } - - return marketsApi.MarketSetAsk(ctx, types.BigInt(pri), types.BigInt(vpri), abi.ChainEpoch(qty), abi.PaddedPieceSize(min), abi.PaddedPieceSize(max)) - }, -} - -var getAskCmd = &cli.Command{ - Name: "get-ask", - Usage: "Print the miner's ask", - Flags: []cli.Flag{}, - Action: func(cctx *cli.Context) error { - ctx := lcli.DaemonContext(cctx) - - fnapi, closer, err := lcli.GetFullNodeAPI(cctx) - if err != nil { - return err - } - defer closer() - - smapi, closer, err := lcli.GetMarketsAPI(cctx) - if err != nil { - return err - } - defer closer() - - sask, err := smapi.MarketGetAsk(ctx) - if err != nil { - return err - } - - var ask *storagemarket.StorageAsk - if sask != nil && sask.Ask != nil { - ask = sask.Ask - } - - w := tabwriter.NewWriter(os.Stdout, 2, 4, 2, ' ', 0) - fmt.Fprintf(w, "Price per GiB/Epoch\tVerified\tMin. Piece Size (padded)\tMax. Piece Size (padded)\tExpiry (Epoch)\tExpiry (Appx. Rem. Time)\tSeq. No.\n") - if ask == nil { - fmt.Fprintf(w, "\n") - - return w.Flush() - } - - head, err := fnapi.ChainHead(ctx) - if err != nil { - return err - } - - dlt := ask.Expiry - head.Height() - rem := "" - if dlt > 0 { - rem = (time.Second * time.Duration(int64(dlt)*int64(build.BlockDelaySecs))).String() - } - - fmt.Fprintf(w, "%s\t%s\t%s\t%s\t%d\t%s\t%d\n", types.FIL(ask.Price), types.FIL(ask.VerifiedPrice), types.SizeStr(types.NewInt(uint64(ask.MinPieceSize))), types.SizeStr(types.NewInt(uint64(ask.MaxPieceSize))), ask.Expiry, rem, ask.SeqNo) - - return w.Flush() - }, -} - -var storageDealsCmd = &cli.Command{ - Name: "storage-deals", - Usage: "Manage storage deals and related configuration", - Subcommands: []*cli.Command{ - dealsImportDataCmd, - dealsListCmd, - storageDealSelectionCmd, - setAskCmd, - getAskCmd, - setBlocklistCmd, - getBlocklistCmd, - resetBlocklistCmd, - setSealDurationCmd, - dealsPendingPublish, - dealsRetryPublish, - }, -} - -var dealsImportDataCmd = &cli.Command{ - Name: "import-data", - Usage: "Manually import data for a deal", - ArgsUsage: " ", - Action: func(cctx *cli.Context) error { - api, closer, err := lcli.GetMarketsAPI(cctx) - if err != nil { - return err - } - defer closer() - - ctx := lcli.DaemonContext(cctx) - - if cctx.NArg() != 2 { - return lcli.IncorrectNumArgs(cctx) - } - - propCid, err := cid.Decode(cctx.Args().Get(0)) - if err != nil { - return err - } - - fpath := cctx.Args().Get(1) - - return api.DealsImportData(ctx, propCid, fpath) - - }, -} - -var dealsListCmd = &cli.Command{ - Name: "list", - Usage: "List all deals for this miner", - Flags: []cli.Flag{ - &cli.StringFlag{ - Name: "format", - Usage: "output format of data, supported: table, json", - Value: "table", - }, - &cli.BoolFlag{ - Name: "verbose", - Aliases: []string{"v"}, - }, - &cli.BoolFlag{ - Name: "watch", - Usage: "watch deal updates in real-time, rather than a one time list", - }, - }, - Action: func(cctx *cli.Context) error { - switch cctx.String("format") { - case "table": - return listDealsWithTable(cctx) - case "json": - return listDealsWithJSON(cctx) - } - - return fmt.Errorf("unknown format: %s; use `table` or `json`", cctx.String("format")) - }, -} - -func listDealsWithTable(cctx *cli.Context) error { - api, closer, err := lcli.GetMarketsAPI(cctx) - if err != nil { - return err - } - defer closer() - - ctx := lcli.DaemonContext(cctx) - - deals, err := api.MarketListIncompleteDeals(ctx) - if err != nil { - return err - } - - verbose := cctx.Bool("verbose") - watch := cctx.Bool("watch") - - if watch { - updates, err := api.MarketGetDealUpdates(ctx) - if err != nil { - return err - } - - for { - tm.Clear() - tm.MoveCursor(1, 1) - - err = outputStorageDealsTable(tm.Output, deals, verbose) - if err != nil { - return err - } - - tm.Flush() - - select { - case <-ctx.Done(): - return nil - case updated := <-updates: - var found bool - for i, existing := range deals { - if existing.ProposalCid.Equals(updated.ProposalCid) { - deals[i] = updated - found = true - break - } - } - if !found { - deals = append(deals, updated) - } - } - } - } - - return outputStorageDealsTable(os.Stdout, deals, verbose) -} - -func outputStorageDealsTable(out io.Writer, deals []storagemarket.MinerDeal, verbose bool) error { - sort.Slice(deals, func(i, j int) bool { - return deals[i].CreationTime.Time().Before(deals[j].CreationTime.Time()) - }) - - w := tabwriter.NewWriter(out, 2, 4, 2, ' ', 0) - - if verbose { - _, _ = fmt.Fprintf(w, "Creation\tVerified\tProposalCid\tDealId\tState\tClient\tSize\tPrice\tDuration\tTransferChannelID\tMessage\n") - } else { - _, _ = fmt.Fprintf(w, "ProposalCid\tDealId\tState\tClient\tSize\tPrice\tDuration\n") - } - - for _, deal := range deals { - propcid := deal.ProposalCid.String() - if !verbose { - propcid = "..." + propcid[len(propcid)-8:] - } - - fil := types.FIL(types.BigMul(deal.Proposal.StoragePricePerEpoch, types.NewInt(uint64(deal.Proposal.Duration())))) - - if verbose { - _, _ = fmt.Fprintf(w, "%s\t%t\t", deal.CreationTime.Time().Format(time.Stamp), deal.Proposal.VerifiedDeal) - } - - _, _ = fmt.Fprintf(w, "%s\t%d\t%s\t%s\t%s\t%s\t%s", propcid, deal.DealID, storagemarket.DealStates[deal.State], deal.Proposal.Client, units.BytesSize(float64(deal.Proposal.PieceSize)), fil, deal.Proposal.Duration()) - if verbose { - tchid := "" - if deal.TransferChannelId != nil { - tchid = deal.TransferChannelId.String() - } - _, _ = fmt.Fprintf(w, "\t%s", tchid) - _, _ = fmt.Fprintf(w, "\t%s", deal.Message) - } - - _, _ = fmt.Fprintln(w) - } - - return w.Flush() -} - -var getBlocklistCmd = &cli.Command{ - Name: "get-blocklist", - Usage: "List the contents of the miner's piece CID blocklist", - Flags: []cli.Flag{ - &CidBaseFlag, - }, - Action: func(cctx *cli.Context) error { - api, closer, err := lcli.GetMarketsAPI(cctx) - if err != nil { - return err - } - defer closer() - - blocklist, err := api.DealsPieceCidBlocklist(lcli.DaemonContext(cctx)) - if err != nil { - return err - } - - encoder, err := GetCidEncoder(cctx) - if err != nil { - return err - } - - for idx := range blocklist { - fmt.Println(encoder.Encode(blocklist[idx])) - } - - return nil - }, -} - -var setBlocklistCmd = &cli.Command{ - Name: "set-blocklist", - Usage: "Set the miner's list of blocklisted piece CIDs", - ArgsUsage: "[ (optional, will read from stdin if omitted)]", - Flags: []cli.Flag{}, - Action: func(cctx *cli.Context) error { - api, closer, err := lcli.GetMarketsAPI(cctx) - if err != nil { - return err - } - defer closer() - - scanner := bufio.NewScanner(os.Stdin) - if cctx.Args().Present() && cctx.Args().First() != "-" { - absPath, err := filepath.Abs(cctx.Args().First()) - if err != nil { - return err - } - - file, err := os.Open(absPath) - if err != nil { - log.Fatal(err) - } - defer file.Close() //nolint:errcheck - - scanner = bufio.NewScanner(file) - } - - var blocklist []cid.Cid - for scanner.Scan() { - decoded, err := cid.Decode(scanner.Text()) - if err != nil { - return err - } - - blocklist = append(blocklist, decoded) - } - - err = scanner.Err() - if err != nil { - return err - } - - return api.DealsSetPieceCidBlocklist(lcli.DaemonContext(cctx), blocklist) - }, -} - -var resetBlocklistCmd = &cli.Command{ - Name: "reset-blocklist", - Usage: "Remove all entries from the miner's piece CID blocklist", - Flags: []cli.Flag{}, - Action: func(cctx *cli.Context) error { - api, closer, err := lcli.GetMarketsAPI(cctx) - if err != nil { - return err - } - defer closer() - - return api.DealsSetPieceCidBlocklist(lcli.DaemonContext(cctx), []cid.Cid{}) - }, -} - -var setSealDurationCmd = &cli.Command{ - Name: "set-seal-duration", - Usage: "Set the expected time, in minutes, that you expect sealing sectors to take. Deals that start before this duration will be rejected.", - ArgsUsage: "", - Action: func(cctx *cli.Context) error { - nodeApi, closer, err := lcli.GetMarketsAPI(cctx) - if err != nil { - return err - } - defer closer() - ctx := lcli.ReqContext(cctx) - if cctx.NArg() != 1 { - return lcli.IncorrectNumArgs(cctx) - } - - hs, err := strconv.ParseUint(cctx.Args().Get(0), 10, 64) - if err != nil { - return xerrors.Errorf("could not parse duration: %w", err) - } - - delay := hs * uint64(time.Minute) - - return nodeApi.SectorSetExpectedSealDuration(ctx, time.Duration(delay)) - }, -} - -var dataTransfersCmd = &cli.Command{ - Name: "data-transfers", - Usage: "Manage data transfers", - Subcommands: []*cli.Command{ - transfersListCmd, - marketRestartTransfer, - marketCancelTransfer, - transfersDiagnosticsCmd, - }, -} - -var marketRestartTransfer = &cli.Command{ - Name: "restart", - Usage: "Force restart a stalled data transfer", - Flags: []cli.Flag{ - &cli.StringFlag{ - Name: "peerid", - Usage: "narrow to transfer with specific peer", - }, - &cli.BoolFlag{ - Name: "initiator", - Usage: "specify only transfers where peer is/is not initiator", - Value: false, - }, - }, - Action: func(cctx *cli.Context) error { - if !cctx.Args().Present() { - return cli.ShowCommandHelp(cctx, cctx.Command.Name) - } - nodeApi, closer, err := lcli.GetMarketsAPI(cctx) - if err != nil { - return err - } - defer closer() - ctx := lcli.ReqContext(cctx) - - transferUint, err := strconv.ParseUint(cctx.Args().First(), 10, 64) - if err != nil { - return fmt.Errorf("Error reading transfer ID: %w", err) - } - transferID := datatransfer.TransferID(transferUint) - initiator := cctx.Bool("initiator") - var other peer.ID - if pidstr := cctx.String("peerid"); pidstr != "" { - p, err := peer.Decode(pidstr) - if err != nil { - return err - } - other = p - } else { - channels, err := nodeApi.MarketListDataTransfers(ctx) - if err != nil { - return err - } - found := false - for _, channel := range channels { - if channel.IsInitiator == initiator && channel.TransferID == transferID { - other = channel.OtherPeer - found = true - break - } - } - if !found { - return errors.New("unable to find matching data transfer") - } - } - - return nodeApi.MarketRestartDataTransfer(ctx, transferID, other, initiator) - }, -} - -var marketCancelTransfer = &cli.Command{ - Name: "cancel", - Usage: "Force cancel a data transfer", - Flags: []cli.Flag{ - &cli.StringFlag{ - Name: "peerid", - Usage: "narrow to transfer with specific peer", - }, - &cli.BoolFlag{ - Name: "initiator", - Usage: "specify only transfers where peer is/is not initiator", - Value: false, - }, - &cli.DurationFlag{ - Name: "cancel-timeout", - Usage: "time to wait for cancel to be sent to client", - Value: 5 * time.Second, - }, - }, - Action: func(cctx *cli.Context) error { - if !cctx.Args().Present() { - return cli.ShowCommandHelp(cctx, cctx.Command.Name) - } - nodeApi, closer, err := lcli.GetMarketsAPI(cctx) - if err != nil { - return err - } - defer closer() - ctx := lcli.ReqContext(cctx) - - transferUint, err := strconv.ParseUint(cctx.Args().First(), 10, 64) - if err != nil { - return fmt.Errorf("Error reading transfer ID: %w", err) - } - transferID := datatransfer.TransferID(transferUint) - initiator := cctx.Bool("initiator") - var other peer.ID - if pidstr := cctx.String("peerid"); pidstr != "" { - p, err := peer.Decode(pidstr) - if err != nil { - return err - } - other = p - } else { - channels, err := nodeApi.MarketListDataTransfers(ctx) - if err != nil { - return err - } - found := false - for _, channel := range channels { - if channel.IsInitiator == initiator && channel.TransferID == transferID { - other = channel.OtherPeer - found = true - break - } - } - if !found { - return errors.New("unable to find matching data transfer") - } - } - - timeoutCtx, cancel := context.WithTimeout(ctx, cctx.Duration("cancel-timeout")) - defer cancel() - return nodeApi.MarketCancelDataTransfer(timeoutCtx, transferID, other, initiator) - }, -} - -var transfersListCmd = &cli.Command{ - Name: "list", - Usage: "List ongoing data transfers for this miner", - Flags: []cli.Flag{ - &cli.BoolFlag{ - Name: "verbose", - Aliases: []string{"v"}, - Usage: "print verbose transfer details", - }, - &cli.BoolFlag{ - Name: "completed", - Usage: "show completed data transfers", - }, - &cli.BoolFlag{ - Name: "watch", - Usage: "watch deal updates in real-time, rather than a one time list", - }, - &cli.BoolFlag{ - Name: "show-failed", - Usage: "show failed/cancelled transfers", - }, - }, - Action: func(cctx *cli.Context) error { - api, closer, err := lcli.GetMarketsAPI(cctx) - if err != nil { - return err - } - defer closer() - ctx := lcli.ReqContext(cctx) - - channels, err := api.MarketListDataTransfers(ctx) - if err != nil { - return err - } - - verbose := cctx.Bool("verbose") - completed := cctx.Bool("completed") - watch := cctx.Bool("watch") - showFailed := cctx.Bool("show-failed") - if watch { - channelUpdates, err := api.MarketDataTransferUpdates(ctx) - if err != nil { - return err - } - - for { - tm.Clear() // Clear current screen - - tm.MoveCursor(1, 1) - - lcli.OutputDataTransferChannels(tm.Screen, channels, verbose, completed, showFailed) - - tm.Flush() - - select { - case <-ctx.Done(): - return nil - case channelUpdate := <-channelUpdates: - var found bool - for i, existing := range channels { - if existing.TransferID == channelUpdate.TransferID && - existing.OtherPeer == channelUpdate.OtherPeer && - existing.IsSender == channelUpdate.IsSender && - existing.IsInitiator == channelUpdate.IsInitiator { - channels[i] = channelUpdate - found = true - break - } - } - if !found { - channels = append(channels, channelUpdate) - } - } - } - } - lcli.OutputDataTransferChannels(os.Stdout, channels, verbose, completed, showFailed) - return nil - }, -} - -var transfersDiagnosticsCmd = &cli.Command{ - Name: "diagnostics", - Usage: "Get detailed diagnostics on active transfers with a specific peer", - Flags: []cli.Flag{}, - Action: func(cctx *cli.Context) error { - if !cctx.Args().Present() { - return cli.ShowCommandHelp(cctx, cctx.Command.Name) - } - api, closer, err := lcli.GetMarketsAPI(cctx) - if err != nil { - return err - } - defer closer() - ctx := lcli.ReqContext(cctx) - - targetPeer, err := peer.Decode(cctx.Args().First()) - if err != nil { - return err - } - diagnostics, err := api.MarketDataTransferDiagnostics(ctx, targetPeer) - if err != nil { - return err - } - out, err := json.MarshalIndent(diagnostics, "", "\t") - if err != nil { - return err - } - fmt.Println(string(out)) - return nil - }, -} - -var dealsPendingPublish = &cli.Command{ - Name: "pending-publish", - Usage: "list deals waiting in publish queue", - Flags: []cli.Flag{ - &cli.BoolFlag{ - Name: "publish-now", - Usage: "send a publish message now", - }, - }, - Action: func(cctx *cli.Context) error { - api, closer, err := lcli.GetMarketsAPI(cctx) - if err != nil { - return err - } - defer closer() - ctx := lcli.ReqContext(cctx) - - if cctx.Bool("publish-now") { - if err := api.MarketPublishPendingDeals(ctx); err != nil { - return xerrors.Errorf("publishing deals: %w", err) - } - fmt.Println("triggered deal publishing") - return nil - } - - pending, err := api.MarketPendingDeals(ctx) - if err != nil { - return xerrors.Errorf("getting pending deals: %w", err) - } - - if len(pending.Deals) > 0 { - endsIn := pending.PublishPeriodStart.Add(pending.PublishPeriod).Sub(time.Now()) - w := tabwriter.NewWriter(os.Stdout, 2, 4, 2, ' ', 0) - _, _ = fmt.Fprintf(w, "Publish period: %s (ends in %s)\n", pending.PublishPeriod, endsIn.Round(time.Second)) - _, _ = fmt.Fprintf(w, "First deal queued at: %s\n", pending.PublishPeriodStart) - _, _ = fmt.Fprintf(w, "Deals will be published at: %s\n", pending.PublishPeriodStart.Add(pending.PublishPeriod)) - _, _ = fmt.Fprintf(w, "%d deals queued to be published:\n", len(pending.Deals)) - _, _ = fmt.Fprintf(w, "ProposalCID\tClient\tSize\n") - for _, deal := range pending.Deals { - proposalNd, err := cborutil.AsIpld(&deal) // nolint - if err != nil { - return err - } - - _, _ = fmt.Fprintf(w, "%s\t%s\t%s\n", proposalNd.Cid(), deal.Proposal.Client, units.BytesSize(float64(deal.Proposal.PieceSize))) - } - return w.Flush() - } - - fmt.Println("No deals queued to be published") - return nil - }, -} - -var dealsRetryPublish = &cli.Command{ - Name: "retry-publish", - Usage: "retry publishing a deal", - ArgsUsage: "", - Action: func(cctx *cli.Context) error { - if !cctx.Args().Present() { - return cli.ShowCommandHelp(cctx, cctx.Command.Name) - } - api, closer, err := lcli.GetMarketsAPI(cctx) - if err != nil { - return err - } - defer closer() - ctx := lcli.ReqContext(cctx) - - propcid := cctx.Args().First() - fmt.Printf("retrying deal with proposal-cid: %s\n", propcid) - - cid, err := cid.Decode(propcid) - if err != nil { - return err - } - if err := api.MarketRetryPublishDeal(ctx, cid); err != nil { - return xerrors.Errorf("retrying publishing deal: %w", err) - } - fmt.Println("retried to publish deal") - return nil - }, -} - -func listDealsWithJSON(cctx *cli.Context) error { - node, closer, err := lcli.GetMarketsAPI(cctx) - if err != nil { - return err - } - defer closer() - - ctx := lcli.DaemonContext(cctx) - - deals, err := node.MarketListIncompleteDeals(ctx) - if err != nil { - return err - } - - channels, err := node.MarketListDataTransfers(ctx) - if err != nil { - return err - } - - sort.Slice(deals, func(i, j int) bool { - return deals[i].CreationTime.Time().Before(deals[j].CreationTime.Time()) - }) - - channelsByTransferID := map[datatransfer.TransferID]api.DataTransferChannel{} - for _, c := range channels { - channelsByTransferID[c.TransferID] = c - } - - w := json.NewEncoder(os.Stdout) - - for _, deal := range deals { - val := struct { - DateTime string `json:"datetime"` - VerifiedDeal bool `json:"verified-deal"` - ProposalCID string `json:"proposal-cid"` - DealID abi.DealID `json:"deal-id"` - DealStatus string `json:"deal-status"` - Client string `json:"client"` - PieceSize string `json:"piece-size"` - Price types.FIL `json:"price"` - DurationEpochs abi.ChainEpoch `json:"duration-epochs"` - TransferID *datatransfer.TransferID `json:"transfer-id,omitempty"` - TransferStatus string `json:"transfer-status,omitempty"` - TransferredData string `json:"transferred-data,omitempty"` - }{} - - val.DateTime = deal.CreationTime.Time().Format(time.RFC3339) - val.VerifiedDeal = deal.Proposal.VerifiedDeal - val.ProposalCID = deal.ProposalCid.String() - val.DealID = deal.DealID - val.DealStatus = storagemarket.DealStates[deal.State] - val.Client = deal.Proposal.Client.String() - val.PieceSize = units.BytesSize(float64(deal.Proposal.PieceSize)) - val.Price = types.FIL(types.BigMul(deal.Proposal.StoragePricePerEpoch, types.NewInt(uint64(deal.Proposal.Duration())))) - val.DurationEpochs = deal.Proposal.Duration() - - if deal.TransferChannelId != nil { - if c, ok := channelsByTransferID[deal.TransferChannelId.ID]; ok { - val.TransferID = &c.TransferID - val.TransferStatus = datatransfer.Statuses[c.Status] - val.TransferredData = units.BytesSize(float64(c.Transferred)) - } - } - - err := w.Encode(val) - if err != nil { - return err - } - } - - return nil -} diff --git a/cmd/lotus-miner/pieces.go b/cmd/lotus-miner/pieces.go deleted file mode 100644 index a64142237c2..00000000000 --- a/cmd/lotus-miner/pieces.go +++ /dev/null @@ -1,193 +0,0 @@ -package main - -import ( - "fmt" - "os" - "text/tabwriter" - - "github.com/ipfs/go-cid" - "github.com/urfave/cli/v2" - - lcli "github.com/filecoin-project/lotus/cli" - "github.com/filecoin-project/lotus/lib/tablewriter" -) - -var piecesCmd = &cli.Command{ - Name: "pieces", - Usage: "interact with the piecestore", - Description: "The piecestore is a database that tracks and manages data that is made available to the retrieval market", - Subcommands: []*cli.Command{ - piecesListPiecesCmd, - piecesListCidInfosCmd, - piecesInfoCmd, - piecesCidInfoCmd, - }, -} - -var piecesListPiecesCmd = &cli.Command{ - Name: "list-pieces", - Usage: "list registered pieces", - Action: func(cctx *cli.Context) error { - nodeApi, closer, err := lcli.GetMarketsAPI(cctx) - if err != nil { - return err - } - defer closer() - ctx := lcli.ReqContext(cctx) - - pieceCids, err := nodeApi.PiecesListPieces(ctx) - if err != nil { - return err - } - - for _, pc := range pieceCids { - fmt.Println(pc) - } - return nil - }, -} - -var piecesListCidInfosCmd = &cli.Command{ - Name: "list-cids", - Usage: "list registered payload CIDs", - Flags: []cli.Flag{ - &cli.BoolFlag{ - Name: "verbose", - Aliases: []string{"v"}, - }, - }, - Action: func(cctx *cli.Context) error { - nodeApi, closer, err := lcli.GetMarketsAPI(cctx) - if err != nil { - return err - } - defer closer() - ctx := lcli.ReqContext(cctx) - - cids, err := nodeApi.PiecesListCidInfos(ctx) - if err != nil { - return err - } - - w := tablewriter.New(tablewriter.Col("CID"), - tablewriter.Col("Piece"), - tablewriter.Col("BlockOffset"), - tablewriter.Col("BlockLen"), - tablewriter.Col("Deal"), - tablewriter.Col("Sector"), - tablewriter.Col("DealOffset"), - tablewriter.Col("DealLen"), - ) - - for _, c := range cids { - if !cctx.Bool("verbose") { - fmt.Println(c) - continue - } - - ci, err := nodeApi.PiecesGetCIDInfo(ctx, c) - if err != nil { - fmt.Printf("Error getting CID info: %s\n", err) - continue - } - - for _, location := range ci.PieceBlockLocations { - pi, err := nodeApi.PiecesGetPieceInfo(ctx, location.PieceCID) - if err != nil { - fmt.Printf("Error getting piece info: %s\n", err) - continue - } - - for _, deal := range pi.Deals { - w.Write(map[string]interface{}{ - "CID": c, - "Piece": location.PieceCID, - "BlockOffset": location.RelOffset, - "BlockLen": location.BlockSize, - "Deal": deal.DealID, - "Sector": deal.SectorID, - "DealOffset": deal.Offset, - "DealLen": deal.Length, - }) - } - } - } - - if cctx.Bool("verbose") { - return w.Flush(os.Stdout) - } - - return nil - }, -} - -var piecesInfoCmd = &cli.Command{ - Name: "piece-info", - Usage: "get registered information for a given piece CID", - Action: func(cctx *cli.Context) error { - if !cctx.Args().Present() { - return lcli.ShowHelp(cctx, fmt.Errorf("must specify piece cid")) - } - - nodeApi, closer, err := lcli.GetMarketsAPI(cctx) - if err != nil { - return err - } - defer closer() - ctx := lcli.ReqContext(cctx) - - c, err := cid.Decode(cctx.Args().First()) - if err != nil { - return err - } - - pi, err := nodeApi.PiecesGetPieceInfo(ctx, c) - if err != nil { - return err - } - - fmt.Println("Piece: ", pi.PieceCID) - w := tabwriter.NewWriter(os.Stdout, 4, 4, 2, ' ', 0) - fmt.Fprintln(w, "Deals:\nDealID\tSectorID\tLength\tOffset") - for _, d := range pi.Deals { - fmt.Fprintf(w, "%d\t%d\t%d\t%d\n", d.DealID, d.SectorID, d.Length, d.Offset) - } - return w.Flush() - }, -} - -var piecesCidInfoCmd = &cli.Command{ - Name: "cid-info", - Usage: "get registered information for a given payload CID", - Action: func(cctx *cli.Context) error { - if !cctx.Args().Present() { - return lcli.ShowHelp(cctx, fmt.Errorf("must specify payload cid")) - } - - nodeApi, closer, err := lcli.GetMarketsAPI(cctx) - if err != nil { - return err - } - defer closer() - ctx := lcli.ReqContext(cctx) - - c, err := cid.Decode(cctx.Args().First()) - if err != nil { - return err - } - - ci, err := nodeApi.PiecesGetCIDInfo(ctx, c) - if err != nil { - return err - } - - fmt.Println("Info for: ", ci.CID) - - w := tabwriter.NewWriter(os.Stdout, 4, 4, 2, ' ', 0) - fmt.Fprintf(w, "PieceCid\tOffset\tSize\n") - for _, loc := range ci.PieceBlockLocations { - fmt.Fprintf(w, "%s\t%d\t%d\n", loc.PieceCID, loc.RelOffset, loc.BlockSize) - } - return w.Flush() - }, -} diff --git a/cmd/lotus-miner/retrieval-deals.go b/cmd/lotus-miner/retrieval-deals.go deleted file mode 100644 index 42b0fa1f6f8..00000000000 --- a/cmd/lotus-miner/retrieval-deals.go +++ /dev/null @@ -1,231 +0,0 @@ -package main - -import ( - "fmt" - "os" - "text/tabwriter" - - "github.com/docker/go-units" - "github.com/urfave/cli/v2" - - "github.com/filecoin-project/go-state-types/abi" - - "github.com/filecoin-project/lotus/chain/types" - lcli "github.com/filecoin-project/lotus/cli" -) - -var retrievalDealsCmd = &cli.Command{ - Name: "retrieval-deals", - Usage: "Manage retrieval deals and related configuration", - Subcommands: []*cli.Command{ - retrievalDealSelectionCmd, - retrievalSetAskCmd, - retrievalGetAskCmd, - }, -} - -var retrievalDealSelectionCmd = &cli.Command{ - Name: "selection", - Usage: "Configure acceptance criteria for retrieval deal proposals", - Subcommands: []*cli.Command{ - retrievalDealSelectionShowCmd, - retrievalDealSelectionResetCmd, - retrievalDealSelectionRejectCmd, - }, -} - -var retrievalDealSelectionShowCmd = &cli.Command{ - Name: "list", - Usage: "List retrieval deal proposal selection criteria", - Action: func(cctx *cli.Context) error { - smapi, closer, err := lcli.GetMarketsAPI(cctx) - if err != nil { - return err - } - defer closer() - - onlineOk, err := smapi.DealsConsiderOnlineRetrievalDeals(lcli.DaemonContext(cctx)) - if err != nil { - return err - } - - offlineOk, err := smapi.DealsConsiderOfflineRetrievalDeals(lcli.DaemonContext(cctx)) - if err != nil { - return err - } - - fmt.Printf("considering online retrieval deals: %t\n", onlineOk) - fmt.Printf("considering offline retrieval deals: %t\n", offlineOk) - - return nil - }, -} - -var retrievalDealSelectionResetCmd = &cli.Command{ - Name: "reset", - Usage: "Reset retrieval deal proposal selection criteria to default values", - Action: func(cctx *cli.Context) error { - smapi, closer, err := lcli.GetMarketsAPI(cctx) - if err != nil { - return err - } - defer closer() - - err = smapi.DealsSetConsiderOnlineRetrievalDeals(lcli.DaemonContext(cctx), true) - if err != nil { - return err - } - - err = smapi.DealsSetConsiderOfflineRetrievalDeals(lcli.DaemonContext(cctx), true) - if err != nil { - return err - } - - return nil - }, -} - -var retrievalDealSelectionRejectCmd = &cli.Command{ - Name: "reject", - Usage: "Configure criteria which necessitate automatic rejection", - Flags: []cli.Flag{ - &cli.BoolFlag{ - Name: "online", - }, - &cli.BoolFlag{ - Name: "offline", - }, - }, - Action: func(cctx *cli.Context) error { - smapi, closer, err := lcli.GetMarketsAPI(cctx) - if err != nil { - return err - } - defer closer() - - if cctx.Bool("online") { - err = smapi.DealsSetConsiderOnlineRetrievalDeals(lcli.DaemonContext(cctx), false) - if err != nil { - return err - } - } - - if cctx.Bool("offline") { - err = smapi.DealsSetConsiderOfflineRetrievalDeals(lcli.DaemonContext(cctx), false) - if err != nil { - return err - } - } - - return nil - }, -} - -var retrievalSetAskCmd = &cli.Command{ - Name: "set-ask", - Usage: "Configure the provider's retrieval ask", - Flags: []cli.Flag{ - &cli.StringFlag{ - Name: "price", - Usage: "Set the price of the ask for retrievals (FIL/GiB)", - }, - &cli.StringFlag{ - Name: "unseal-price", - Usage: "Set the price to unseal", - }, - &cli.StringFlag{ - Name: "payment-interval", - Usage: "Set the payment interval (in bytes) for retrieval", - DefaultText: "1MiB", - }, - &cli.StringFlag{ - Name: "payment-interval-increase", - Usage: "Set the payment interval increase (in bytes) for retrieval", - DefaultText: "1MiB", - }, - }, - Action: func(cctx *cli.Context) error { - ctx := lcli.DaemonContext(cctx) - - api, closer, err := lcli.GetMarketsAPI(cctx) - if err != nil { - return err - } - defer closer() - - ask, err := api.MarketGetRetrievalAsk(ctx) - if err != nil { - return err - } - - if cctx.IsSet("price") { - v, err := types.ParseFIL(cctx.String("price")) - if err != nil { - return err - } - ask.PricePerByte = types.BigDiv(types.BigInt(v), types.NewInt(1<<30)) - } - - if cctx.IsSet("unseal-price") { - v, err := types.ParseFIL(cctx.String("unseal-price")) - if err != nil { - return err - } - ask.UnsealPrice = abi.TokenAmount(v) - } - - if cctx.IsSet("payment-interval") { - v, err := units.RAMInBytes(cctx.String("payment-interval")) - if err != nil { - return err - } - ask.PaymentInterval = uint64(v) - } - - if cctx.IsSet("payment-interval-increase") { - v, err := units.RAMInBytes(cctx.String("payment-interval-increase")) - if err != nil { - return err - } - ask.PaymentIntervalIncrease = uint64(v) - } - - return api.MarketSetRetrievalAsk(ctx, ask) - }, -} - -var retrievalGetAskCmd = &cli.Command{ - Name: "get-ask", - Usage: "Get the provider's current retrieval ask configured by the provider in the ask-store using the set-ask CLI command", - Flags: []cli.Flag{}, - Action: func(cctx *cli.Context) error { - ctx := lcli.DaemonContext(cctx) - - api, closer, err := lcli.GetMarketsAPI(cctx) - if err != nil { - return err - } - defer closer() - - ask, err := api.MarketGetRetrievalAsk(ctx) - if err != nil { - return err - } - - w := tabwriter.NewWriter(os.Stdout, 2, 4, 2, ' ', 0) - _, _ = fmt.Fprintf(w, "Price per Byte\tUnseal Price\tPayment Interval\tPayment Interval Increase\n") - if ask == nil { - _, _ = fmt.Fprintf(w, "\n") - return w.Flush() - } - - _, _ = fmt.Fprintf(w, "%s\t%s\t%s\t%s\n", - types.FIL(ask.PricePerByte), - types.FIL(ask.UnsealPrice), - units.BytesSize(float64(ask.PaymentInterval)), - units.BytesSize(float64(ask.PaymentIntervalIncrease)), - ) - return w.Flush() - - }, -} diff --git a/cmd/lotus-miner/run.go b/cmd/lotus-miner/run.go index 93dfea2fc4d..a513d8cb617 100644 --- a/cmd/lotus-miner/run.go +++ b/cmd/lotus-miner/run.go @@ -20,7 +20,6 @@ import ( "github.com/filecoin-project/lotus/lib/ulimit" "github.com/filecoin-project/lotus/metrics" "github.com/filecoin-project/lotus/node" - "github.com/filecoin-project/lotus/node/config" "github.com/filecoin-project/lotus/node/modules/dtypes" "github.com/filecoin-project/lotus/node/repo" ) @@ -121,16 +120,6 @@ var runCmd = &cli.Command{ if err != nil { return err } - c, err := lr.Config() - if err != nil { - return err - } - cfg, ok := c.(*config.StorageMiner) - if !ok { - return xerrors.Errorf("invalid config for repo, got: %T", c) - } - - bootstrapLibP2P := cfg.Subsystems.EnableMarkets err = lr.Close() if err != nil { @@ -141,7 +130,7 @@ var runCmd = &cli.Command{ var minerapi api.StorageMiner stop, err := node.New(ctx, - node.StorageMiner(&minerapi, cfg.Subsystems), + node.StorageMiner(&minerapi, false), node.Override(new(dtypes.ShutdownChan), shutdownChan), node.Base(), node.Repo(r), @@ -161,20 +150,6 @@ var runCmd = &cli.Command{ return xerrors.Errorf("getting API endpoint: %w", err) } - if bootstrapLibP2P { - log.Infof("Bootstrapping libp2p network with full node") - - // Bootstrap with full node - remoteAddrs, err := nodeApi.NetAddrsListen(ctx) - if err != nil { - return xerrors.Errorf("getting full node libp2p address: %w", err) - } - - if err := minerapi.NetConnect(ctx, remoteAddrs); err != nil { - return xerrors.Errorf("connecting to full node (libp2p): %w", err) - } - } - log.Infof("Remote version %s", v) // Instantiate the miner node handler. diff --git a/cmd/lotus-miner/sectors.go b/cmd/lotus-miner/sectors.go index cf32f424895..c05cf37e614 100644 --- a/cmd/lotus-miner/sectors.go +++ b/cmd/lotus-miner/sectors.go @@ -45,7 +45,6 @@ var sectorsCmd = &cli.Command{ Subcommands: []*cli.Command{ spcli.SectorsStatusCmd(LMActorOrEnvGetter, getOnDiskInfo), sectorsListCmd, - sectorsRefsCmd, sectorsUpdateCmd, sectorsPledgeCmd, sectorsNumbersCmd, @@ -584,32 +583,6 @@ var sectorsListUpgradeBoundsCmd = &cli.Command{ }, } -var sectorsRefsCmd = &cli.Command{ - Name: "refs", - Usage: "List References to sectors", - Action: func(cctx *cli.Context) error { - nodeApi, closer, err := lcli.GetMarketsAPI(cctx) - if err != nil { - return err - } - defer closer() - ctx := lcli.ReqContext(cctx) - - refs, err := nodeApi.SectorsRefs(ctx) - if err != nil { - return err - } - - for name, refs := range refs { - fmt.Printf("Block %s:\n", name) - for _, ref := range refs { - fmt.Printf("\t%d+%d %d bytes\n", ref.SectorID, ref.Offset, ref.Size) - } - } - return nil - }, -} - var sectorsTerminateCmd = &cli.Command{ Name: "terminate", Usage: "Terminate sector on-chain then remove (WARNING: This means losing power and collateral for the removed sector)", diff --git a/cmd/lotus-seed/main.go b/cmd/lotus-seed/main.go index 9deae560eb9..27b6d76a546 100644 --- a/cmd/lotus-seed/main.go +++ b/cmd/lotus-seed/main.go @@ -137,9 +137,8 @@ var preSealCmd = &cli.Command{ nv = network.Version(c.Uint64("network-version")) } - var synthetic = false // there's little reason to have this for a seed. - - spt, err := miner.SealProofTypeFromSectorSize(sectorSize, nv, synthetic) + var variant = miner.SealProofVariant_Standard // there's little reason to have this for a seed. + spt, err := miner.SealProofTypeFromSectorSize(sectorSize, nv, variant) if err != nil { return err } diff --git a/cmd/lotus-shed/main.go b/cmd/lotus-shed/main.go index b04b271def8..1ecd5122b54 100644 --- a/cmd/lotus-shed/main.go +++ b/cmd/lotus-shed/main.go @@ -48,7 +48,6 @@ func main() { proofsCmd, verifRegCmd, marketCmd, - miscCmd, mpoolCmd, helloCmd, genesisVerifyCmd, diff --git a/cmd/lotus-shed/misc.go b/cmd/lotus-shed/misc.go deleted file mode 100644 index cfda362c497..00000000000 --- a/cmd/lotus-shed/misc.go +++ /dev/null @@ -1,40 +0,0 @@ -package main - -import ( - "fmt" - "strconv" - - "github.com/urfave/cli/v2" - - "github.com/filecoin-project/go-fil-markets/storagemarket" -) - -var miscCmd = &cli.Command{ - Name: "misc", - Usage: "Assorted unsorted commands for various purposes", - Flags: []cli.Flag{}, - Subcommands: []*cli.Command{ - dealStateMappingCmd, - }, -} - -var dealStateMappingCmd = &cli.Command{ - Name: "deal-state", - Action: func(cctx *cli.Context) error { - if !cctx.Args().Present() { - return cli.ShowCommandHelp(cctx, cctx.Command.Name) - } - - num, err := strconv.Atoi(cctx.Args().First()) - if err != nil { - return err - } - - ststr, ok := storagemarket.DealStates[uint64(num)] - if !ok { - return fmt.Errorf("no such deal state %d", num) - } - fmt.Println(ststr) - return nil - }, -} diff --git a/curiosrc/docker/docker-compose.yaml b/curiosrc/docker/docker-compose.yaml index 2cc32bc65a6..e24fd7699ee 100644 --- a/curiosrc/docker/docker-compose.yaml +++ b/curiosrc/docker/docker-compose.yaml @@ -48,7 +48,6 @@ services: - LOTUS_API_REMOTELISTENADDRESS=lotus-miner:2345 - LOTUS_SEALING_BATCHPRECOMMITS=false - LOTUS_SEALING_AGGREGATECOMMITS=false - - LOTUS_SUBSYSTEMS_ENABLEMARKETS=false - LOTUS_SEALING_WAITDEALSDELAY=20s restart: unless-stopped logging: *default-logging diff --git a/curiosrc/market/fakelm/lmimpl.go b/curiosrc/market/fakelm/lmimpl.go index 9dc19e627d8..01f48e7e528 100644 --- a/curiosrc/market/fakelm/lmimpl.go +++ b/curiosrc/market/fakelm/lmimpl.go @@ -97,7 +97,7 @@ func (l *LMRPCProvider) SectorsStatus(ctx context.Context, sid abi.SectorNumber, } } - spt, err := miner.SealProofTypeFromSectorSize(l.ssize, network.Version20, false) // good enough, just need this for ssize anyways + spt, err := miner.SealProofTypeFromSectorSize(l.ssize, network.Version20, miner.SealProofVariant_Standard) // good enough, just need this for ssize anyways if err != nil { return api.SectorInfo{}, err } diff --git a/documentation/en/api-v0-methods-miner.md b/documentation/en/api-v0-methods-miner.md index 263585b71db..ad963e7428d 100644 --- a/documentation/en/api-v0-methods-miner.md +++ b/documentation/en/api-v0-methods-miner.md @@ -23,58 +23,16 @@ * [ComputeWindowPoSt](#ComputeWindowPoSt) * [Create](#Create) * [CreateBackup](#CreateBackup) -* [Dagstore](#Dagstore) - * [DagstoreGC](#DagstoreGC) - * [DagstoreInitializeAll](#DagstoreInitializeAll) - * [DagstoreInitializeShard](#DagstoreInitializeShard) - * [DagstoreListShards](#DagstoreListShards) - * [DagstoreLookupPieces](#DagstoreLookupPieces) - * [DagstoreRecoverShard](#DagstoreRecoverShard) - * [DagstoreRegisterShard](#DagstoreRegisterShard) * [Deals](#Deals) - * [DealsConsiderOfflineRetrievalDeals](#DealsConsiderOfflineRetrievalDeals) - * [DealsConsiderOfflineStorageDeals](#DealsConsiderOfflineStorageDeals) - * [DealsConsiderOnlineRetrievalDeals](#DealsConsiderOnlineRetrievalDeals) - * [DealsConsiderOnlineStorageDeals](#DealsConsiderOnlineStorageDeals) - * [DealsConsiderUnverifiedStorageDeals](#DealsConsiderUnverifiedStorageDeals) - * [DealsConsiderVerifiedStorageDeals](#DealsConsiderVerifiedStorageDeals) - * [DealsImportData](#DealsImportData) * [DealsList](#DealsList) - * [DealsPieceCidBlocklist](#DealsPieceCidBlocklist) - * [DealsSetConsiderOfflineRetrievalDeals](#DealsSetConsiderOfflineRetrievalDeals) - * [DealsSetConsiderOfflineStorageDeals](#DealsSetConsiderOfflineStorageDeals) - * [DealsSetConsiderOnlineRetrievalDeals](#DealsSetConsiderOnlineRetrievalDeals) - * [DealsSetConsiderOnlineStorageDeals](#DealsSetConsiderOnlineStorageDeals) - * [DealsSetConsiderUnverifiedStorageDeals](#DealsSetConsiderUnverifiedStorageDeals) - * [DealsSetConsiderVerifiedStorageDeals](#DealsSetConsiderVerifiedStorageDeals) - * [DealsSetPieceCidBlocklist](#DealsSetPieceCidBlocklist) * [I](#I) * [ID](#ID) -* [Indexer](#Indexer) - * [IndexerAnnounceAllDeals](#IndexerAnnounceAllDeals) - * [IndexerAnnounceDeal](#IndexerAnnounceDeal) * [Log](#Log) * [LogAlerts](#LogAlerts) * [LogList](#LogList) * [LogSetLevel](#LogSetLevel) * [Market](#Market) - * [MarketCancelDataTransfer](#MarketCancelDataTransfer) - * [MarketDataTransferDiagnostics](#MarketDataTransferDiagnostics) - * [MarketDataTransferUpdates](#MarketDataTransferUpdates) - * [MarketGetAsk](#MarketGetAsk) - * [MarketGetDealUpdates](#MarketGetDealUpdates) - * [MarketGetRetrievalAsk](#MarketGetRetrievalAsk) - * [MarketImportDealData](#MarketImportDealData) - * [MarketListDataTransfers](#MarketListDataTransfers) * [MarketListDeals](#MarketListDeals) - * [MarketListIncompleteDeals](#MarketListIncompleteDeals) - * [MarketListRetrievalDeals](#MarketListRetrievalDeals) - * [MarketPendingDeals](#MarketPendingDeals) - * [MarketPublishPendingDeals](#MarketPublishPendingDeals) - * [MarketRestartDataTransfer](#MarketRestartDataTransfer) - * [MarketRetryPublishDeal](#MarketRetryPublishDeal) - * [MarketSetAsk](#MarketSetAsk) - * [MarketSetRetrievalAsk](#MarketSetRetrievalAsk) * [Mining](#Mining) * [MiningBase](#MiningBase) * [Net](#Net) @@ -101,11 +59,6 @@ * [NetPubsubScores](#NetPubsubScores) * [NetSetLimit](#NetSetLimit) * [NetStat](#NetStat) -* [Pieces](#Pieces) - * [PiecesGetCIDInfo](#PiecesGetCIDInfo) - * [PiecesGetPieceInfo](#PiecesGetPieceInfo) - * [PiecesListCidInfos](#PiecesListCidInfos) - * [PiecesListPieces](#PiecesListPieces) * [Pledge](#Pledge) * [PledgeSector](#PledgeSector) * [Recover](#Recover) @@ -556,851 +509,13 @@ Inputs: Response: `{}` -## Dagstore - - -### DagstoreGC -DagstoreGC runs garbage collection on the DAG store. - - -Perms: admin - -Inputs: `null` - -Response: -```json -[ - { - "Key": "baga6ea4seaqecmtz7iak33dsfshi627abz4i4665dfuzr3qfs4bmad6dx3iigdq", - "Success": false, - "Error": "\u003cerror\u003e" - } -] -``` - -### DagstoreInitializeAll -DagstoreInitializeAll initializes all uninitialized shards in bulk, -according to the policy passed in the parameters. - -It is recommended to set a maximum concurrency to avoid extreme -IO pressure if the storage subsystem has a large amount of deals. - -It returns a stream of events to report progress. - - -Perms: write - -Inputs: -```json -[ - { - "MaxConcurrency": 123, - "IncludeSealed": true - } -] -``` - -Response: -```json -{ - "Key": "string value", - "Event": "string value", - "Success": true, - "Error": "string value", - "Total": 123, - "Current": 123 -} -``` - -### DagstoreInitializeShard -DagstoreInitializeShard initializes an uninitialized shard. - -Initialization consists of fetching the shard's data (deal payload) from -the storage subsystem, generating an index, and persisting the index -to facilitate later retrievals, and/or to publish to external sources. - -This operation is intended to complement the initial migration. The -migration registers a shard for every unique piece CID, with lazy -initialization. Thus, shards are not initialized immediately to avoid -IO activity competing with proving. Instead, shard are initialized -when first accessed. This method forces the initialization of a shard by -accessing it and immediately releasing it. This is useful to warm up the -cache to facilitate subsequent retrievals, and to generate the indexes -to publish them externally. - -This operation fails if the shard is not in ShardStateNew state. -It blocks until initialization finishes. - - -Perms: write - -Inputs: -```json -[ - "string value" -] -``` - -Response: `{}` - -### DagstoreListShards -DagstoreListShards returns information about all shards known to the -DAG store. Only available on nodes running the markets subsystem. - - -Perms: read - -Inputs: `null` - -Response: -```json -[ - { - "Key": "baga6ea4seaqecmtz7iak33dsfshi627abz4i4665dfuzr3qfs4bmad6dx3iigdq", - "State": "ShardStateAvailable", - "Error": "\u003cerror\u003e" - } -] -``` - -### DagstoreLookupPieces -DagstoreLookupPieces returns information about shards that contain the given CID. - - -Perms: admin - -Inputs: -```json -[ - { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - } -] -``` - -Response: -```json -[ - { - "Key": "baga6ea4seaqecmtz7iak33dsfshi627abz4i4665dfuzr3qfs4bmad6dx3iigdq", - "State": "ShardStateAvailable", - "Error": "\u003cerror\u003e" - } -] -``` - -### DagstoreRecoverShard -DagstoreRecoverShard attempts to recover a failed shard. - -This operation fails if the shard is not in ShardStateErrored state. -It blocks until recovery finishes. If recovery failed, it returns the -error. - - -Perms: write - -Inputs: -```json -[ - "string value" -] -``` - -Response: `{}` - -### DagstoreRegisterShard -DagstoreRegisterShard registers a shard manually with dagstore with given pieceCID - - -Perms: admin - -Inputs: -```json -[ - "string value" -] -``` - -Response: `{}` - -## Deals - - -### DealsConsiderOfflineRetrievalDeals - - -Perms: admin - -Inputs: `null` - -Response: `true` - -### DealsConsiderOfflineStorageDeals - - -Perms: admin - -Inputs: `null` - -Response: `true` - -### DealsConsiderOnlineRetrievalDeals - - -Perms: admin - -Inputs: `null` - -Response: `true` - -### DealsConsiderOnlineStorageDeals - - -Perms: admin - -Inputs: `null` - -Response: `true` - -### DealsConsiderUnverifiedStorageDeals - - -Perms: admin - -Inputs: `null` - -Response: `true` - -### DealsConsiderVerifiedStorageDeals - - -Perms: admin - -Inputs: `null` - -Response: `true` - -### DealsImportData - - -Perms: admin - -Inputs: -```json -[ - { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "string value" -] -``` - -Response: `{}` - -### DealsList - - -Perms: admin - -Inputs: `null` - -Response: -```json -[ - { - "Proposal": { - "PieceCID": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "PieceSize": 1032, - "VerifiedDeal": true, - "Client": "f01234", - "Provider": "f01234", - "Label": "", - "StartEpoch": 10101, - "EndEpoch": 10101, - "StoragePricePerEpoch": "0", - "ProviderCollateral": "0", - "ClientCollateral": "0" - }, - "State": { - "SectorNumber": 9, - "SectorStartEpoch": 10101, - "LastUpdatedEpoch": 10101, - "SlashEpoch": 10101 - } - } -] -``` - -### DealsPieceCidBlocklist - - -Perms: admin - -Inputs: `null` - -Response: -```json -[ - { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - } -] -``` - -### DealsSetConsiderOfflineRetrievalDeals - - -Perms: admin - -Inputs: -```json -[ - true -] -``` - -Response: `{}` - -### DealsSetConsiderOfflineStorageDeals - - -Perms: admin - -Inputs: -```json -[ - true -] -``` - -Response: `{}` - -### DealsSetConsiderOnlineRetrievalDeals - - -Perms: admin - -Inputs: -```json -[ - true -] -``` - -Response: `{}` - -### DealsSetConsiderOnlineStorageDeals - - -Perms: admin - -Inputs: -```json -[ - true -] -``` - -Response: `{}` - -### DealsSetConsiderUnverifiedStorageDeals - - -Perms: admin - -Inputs: -```json -[ - true -] -``` - -Response: `{}` - -### DealsSetConsiderVerifiedStorageDeals - - -Perms: admin - -Inputs: -```json -[ - true -] -``` - -Response: `{}` - -### DealsSetPieceCidBlocklist - - -Perms: admin - -Inputs: -```json -[ - [ - { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - } - ] -] -``` - -Response: `{}` - -## I - - -### ID - - -Perms: read - -Inputs: `null` - -Response: `"12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf"` - -## Indexer - - -### IndexerAnnounceAllDeals -IndexerAnnounceAllDeals informs the indexer nodes aboutall active deals. - - -Perms: admin - -Inputs: `null` - -Response: `{}` - -### IndexerAnnounceDeal -IndexerAnnounceDeal informs indexer nodes that a new deal was received, -so they can download its index - - -Perms: admin - -Inputs: -```json -[ - { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - } -] -``` - -Response: `{}` - -## Log - - -### LogAlerts - - -Perms: admin - -Inputs: `null` - -Response: -```json -[ - { - "Type": { - "System": "string value", - "Subsystem": "string value" - }, - "Active": true, - "LastActive": { - "Type": "string value", - "Message": "json raw message", - "Time": "0001-01-01T00:00:00Z" - }, - "LastResolved": { - "Type": "string value", - "Message": "json raw message", - "Time": "0001-01-01T00:00:00Z" - } - } -] -``` - -### LogList - - -Perms: write - -Inputs: `null` - -Response: -```json -[ - "string value" -] -``` - -### LogSetLevel - - -Perms: write - -Inputs: -```json -[ - "string value", - "string value" -] -``` - -Response: `{}` - -## Market - - -### MarketCancelDataTransfer -MarketCancelDataTransfer cancels a data transfer with the given transfer ID and other peer - - -Perms: write - -Inputs: -```json -[ - 3, - "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - true -] -``` - -Response: `{}` - -### MarketDataTransferDiagnostics -MarketDataTransferDiagnostics generates debugging information about current data transfers over graphsync - - -Perms: write - -Inputs: -```json -[ - "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf" -] -``` - -Response: -```json -{ - "ReceivingTransfers": [ - { - "RequestID": {}, - "RequestState": "string value", - "IsCurrentChannelRequest": true, - "ChannelID": { - "Initiator": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "Responder": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "ID": 3 - }, - "ChannelState": { - "TransferID": 3, - "Status": 1, - "BaseCID": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "IsInitiator": true, - "IsSender": true, - "Voucher": "string value", - "Message": "string value", - "OtherPeer": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "Transferred": 42, - "Stages": { - "Stages": [ - { - "Name": "string value", - "Description": "string value", - "CreatedTime": "0001-01-01T00:00:00Z", - "UpdatedTime": "0001-01-01T00:00:00Z", - "Logs": [ - { - "Log": "string value", - "UpdatedTime": "0001-01-01T00:00:00Z" - } - ] - } - ] - } - }, - "Diagnostics": [ - "string value" - ] - } - ], - "SendingTransfers": [ - { - "RequestID": {}, - "RequestState": "string value", - "IsCurrentChannelRequest": true, - "ChannelID": { - "Initiator": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "Responder": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "ID": 3 - }, - "ChannelState": { - "TransferID": 3, - "Status": 1, - "BaseCID": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "IsInitiator": true, - "IsSender": true, - "Voucher": "string value", - "Message": "string value", - "OtherPeer": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "Transferred": 42, - "Stages": { - "Stages": [ - { - "Name": "string value", - "Description": "string value", - "CreatedTime": "0001-01-01T00:00:00Z", - "UpdatedTime": "0001-01-01T00:00:00Z", - "Logs": [ - { - "Log": "string value", - "UpdatedTime": "0001-01-01T00:00:00Z" - } - ] - } - ] - } - }, - "Diagnostics": [ - "string value" - ] - } - ] -} -``` - -### MarketDataTransferUpdates - - -Perms: write - -Inputs: `null` - -Response: -```json -{ - "TransferID": 3, - "Status": 1, - "BaseCID": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "IsInitiator": true, - "IsSender": true, - "Voucher": "string value", - "Message": "string value", - "OtherPeer": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "Transferred": 42, - "Stages": { - "Stages": [ - { - "Name": "string value", - "Description": "string value", - "CreatedTime": "0001-01-01T00:00:00Z", - "UpdatedTime": "0001-01-01T00:00:00Z", - "Logs": [ - { - "Log": "string value", - "UpdatedTime": "0001-01-01T00:00:00Z" - } - ] - } - ] - } -} -``` - -### MarketGetAsk - - -Perms: read - -Inputs: `null` - -Response: -```json -{ - "Ask": { - "Price": "0", - "VerifiedPrice": "0", - "MinPieceSize": 1032, - "MaxPieceSize": 1032, - "Miner": "f01234", - "Timestamp": 10101, - "Expiry": 10101, - "SeqNo": 42 - }, - "Signature": { - "Type": 2, - "Data": "Ynl0ZSBhcnJheQ==" - } -} -``` - -### MarketGetDealUpdates - - -Perms: read - -Inputs: `null` - -Response: -```json -{ - "Proposal": { - "PieceCID": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "PieceSize": 1032, - "VerifiedDeal": true, - "Client": "f01234", - "Provider": "f01234", - "Label": "", - "StartEpoch": 10101, - "EndEpoch": 10101, - "StoragePricePerEpoch": "0", - "ProviderCollateral": "0", - "ClientCollateral": "0" - }, - "ClientSignature": { - "Type": 2, - "Data": "Ynl0ZSBhcnJheQ==" - }, - "ProposalCid": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "AddFundsCid": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "PublishCid": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "Miner": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "Client": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "State": 42, - "PiecePath": ".lotusminer/fstmp123", - "MetadataPath": ".lotusminer/fstmp123", - "SlashEpoch": 10101, - "FastRetrieval": true, - "Message": "string value", - "FundsReserved": "0", - "Ref": { - "TransferType": "string value", - "Root": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "PieceCid": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "PieceSize": 1024, - "RawBlockSize": 42 - }, - "AvailableForRetrieval": true, - "DealID": 5432, - "CreationTime": "0001-01-01T00:00:00Z", - "TransferChannelId": { - "Initiator": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "Responder": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "ID": 3 - }, - "SectorNumber": 9, - "InboundCAR": "string value" -} -``` - -### MarketGetRetrievalAsk - - -Perms: read - -Inputs: `null` - -Response: -```json -{ - "PricePerByte": "0", - "UnsealPrice": "0", - "PaymentInterval": 42, - "PaymentIntervalIncrease": 42 -} -``` - -### MarketImportDealData - - -Perms: write - -Inputs: -```json -[ - { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "string value" -] -``` - -Response: `{}` - -### MarketListDataTransfers - - -Perms: write - -Inputs: `null` +## Deals -Response: -```json -[ - { - "TransferID": 3, - "Status": 1, - "BaseCID": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "IsInitiator": true, - "IsSender": true, - "Voucher": "string value", - "Message": "string value", - "OtherPeer": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "Transferred": 42, - "Stages": { - "Stages": [ - { - "Name": "string value", - "Description": "string value", - "CreatedTime": "0001-01-01T00:00:00Z", - "UpdatedTime": "0001-01-01T00:00:00Z", - "Logs": [ - { - "Log": "string value", - "UpdatedTime": "0001-01-01T00:00:00Z" - } - ] - } - ] - } - } -] -``` -### MarketListDeals +### DealsList -Perms: read +Perms: admin Inputs: `null` @@ -1433,95 +548,52 @@ Response: ] ``` -### MarketListIncompleteDeals +## I + + +### ID Perms: read Inputs: `null` -Response: -```json -[ - { - "Proposal": { - "PieceCID": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "PieceSize": 1032, - "VerifiedDeal": true, - "Client": "f01234", - "Provider": "f01234", - "Label": "", - "StartEpoch": 10101, - "EndEpoch": 10101, - "StoragePricePerEpoch": "0", - "ProviderCollateral": "0", - "ClientCollateral": "0" - }, - "ClientSignature": { - "Type": 2, - "Data": "Ynl0ZSBhcnJheQ==" - }, - "ProposalCid": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "AddFundsCid": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "PublishCid": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "Miner": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "Client": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "State": 42, - "PiecePath": ".lotusminer/fstmp123", - "MetadataPath": ".lotusminer/fstmp123", - "SlashEpoch": 10101, - "FastRetrieval": true, - "Message": "string value", - "FundsReserved": "0", - "Ref": { - "TransferType": "string value", - "Root": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "PieceCid": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "PieceSize": 1024, - "RawBlockSize": 42 - }, - "AvailableForRetrieval": true, - "DealID": 5432, - "CreationTime": "0001-01-01T00:00:00Z", - "TransferChannelId": { - "Initiator": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "Responder": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "ID": 3 - }, - "SectorNumber": 9, - "InboundCAR": "string value" - } -] -``` +Response: `"12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf"` + +## Log + -### MarketListRetrievalDeals -MarketListRetrievalDeals is deprecated, returns empty list +### LogAlerts -Perms: read +Perms: admin Inputs: `null` Response: ```json [ - {} + { + "Type": { + "System": "string value", + "Subsystem": "string value" + }, + "Active": true, + "LastActive": { + "Type": "string value", + "Message": "json raw message", + "Time": "0001-01-01T00:00:00Z" + }, + "LastResolved": { + "Type": "string value", + "Message": "json raw message", + "Time": "0001-01-01T00:00:00Z" + } + } ] ``` -### MarketPendingDeals +### LogList Perms: write @@ -1530,114 +602,65 @@ Inputs: `null` Response: ```json -{ - "Deals": [ - { - "Proposal": { - "PieceCID": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "PieceSize": 1032, - "VerifiedDeal": true, - "Client": "f01234", - "Provider": "f01234", - "Label": "", - "StartEpoch": 10101, - "EndEpoch": 10101, - "StoragePricePerEpoch": "0", - "ProviderCollateral": "0", - "ClientCollateral": "0" - }, - "ClientSignature": { - "Type": 2, - "Data": "Ynl0ZSBhcnJheQ==" - } - } - ], - "PublishPeriodStart": "0001-01-01T00:00:00Z", - "PublishPeriod": 60000000000 -} -``` - -### MarketPublishPendingDeals - - -Perms: admin - -Inputs: `null` - -Response: `{}` - -### MarketRestartDataTransfer -MarketRestartDataTransfer attempts to restart a data transfer with the given transfer ID and other peer - - -Perms: write - -Inputs: -```json [ - 3, - "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - true + "string value" ] ``` -Response: `{}` - -### MarketRetryPublishDeal +### LogSetLevel -Perms: admin +Perms: write Inputs: ```json [ - { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - } + "string value", + "string value" ] ``` Response: `{}` -### MarketSetAsk - - -Perms: admin +## Market -Inputs: -```json -[ - "0", - "0", - 10101, - 1032, - 1032 -] -``` -Response: `{}` +### MarketListDeals -### MarketSetRetrievalAsk +Perms: read -Perms: admin +Inputs: `null` -Inputs: +Response: ```json [ { - "PricePerByte": "0", - "UnsealPrice": "0", - "PaymentInterval": 42, - "PaymentIntervalIncrease": 42 + "Proposal": { + "PieceCID": { + "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" + }, + "PieceSize": 1032, + "VerifiedDeal": true, + "Client": "f01234", + "Provider": "f01234", + "Label": "", + "StartEpoch": 10101, + "EndEpoch": 10101, + "StoragePricePerEpoch": "0", + "ProviderCollateral": "0", + "ClientCollateral": "0" + }, + "State": { + "SectorNumber": 9, + "SectorStartEpoch": 10101, + "LastUpdatedEpoch": 10101, + "SlashEpoch": 10101 + } } ] ``` -Response: `{}` - ## Mining @@ -2161,104 +1184,6 @@ Response: } ``` -## Pieces - - -### PiecesGetCIDInfo - - -Perms: read - -Inputs: -```json -[ - { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - } -] -``` - -Response: -```json -{ - "CID": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "PieceBlockLocations": [ - { - "RelOffset": 42, - "BlockSize": 42, - "PieceCID": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - } - } - ] -} -``` - -### PiecesGetPieceInfo - - -Perms: read - -Inputs: -```json -[ - { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - } -] -``` - -Response: -```json -{ - "PieceCID": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "Deals": [ - { - "DealID": 5432, - "SectorID": 9, - "Offset": 1032, - "Length": 1032 - } - ] -} -``` - -### PiecesListCidInfos - - -Perms: read - -Inputs: `null` - -Response: -```json -[ - { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - } -] -``` - -### PiecesListPieces - - -Perms: read - -Inputs: `null` - -Response: -```json -[ - { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - } -] -``` - ## Pledge @@ -2797,8 +1722,7 @@ Response: [ "Mining", "Sealing", - "SectorStorage", - "Markets" + "SectorStorage" ] ``` diff --git a/documentation/en/api-v0-methods.md b/documentation/en/api-v0-methods.md index a3fe23f300f..bd58748eecb 100644 --- a/documentation/en/api-v0-methods.md +++ b/documentation/en/api-v0-methods.md @@ -34,34 +34,6 @@ * [ChainSetHead](#ChainSetHead) * [ChainStatObj](#ChainStatObj) * [ChainTipSetWeight](#ChainTipSetWeight) -* [Client](#Client) - * [ClientCalcCommP](#ClientCalcCommP) - * [ClientCancelDataTransfer](#ClientCancelDataTransfer) - * [ClientCancelRetrievalDeal](#ClientCancelRetrievalDeal) - * [ClientDataTransferUpdates](#ClientDataTransferUpdates) - * [ClientDealPieceCID](#ClientDealPieceCID) - * [ClientDealSize](#ClientDealSize) - * [ClientFindData](#ClientFindData) - * [ClientGenCar](#ClientGenCar) - * [ClientGetDealInfo](#ClientGetDealInfo) - * [ClientGetDealStatus](#ClientGetDealStatus) - * [ClientGetDealUpdates](#ClientGetDealUpdates) - * [ClientGetRetrievalUpdates](#ClientGetRetrievalUpdates) - * [ClientHasLocal](#ClientHasLocal) - * [ClientImport](#ClientImport) - * [ClientListDataTransfers](#ClientListDataTransfers) - * [ClientListDeals](#ClientListDeals) - * [ClientListImports](#ClientListImports) - * [ClientListRetrievals](#ClientListRetrievals) - * [ClientMinerQueryOffer](#ClientMinerQueryOffer) - * [ClientQueryAsk](#ClientQueryAsk) - * [ClientRemoveImport](#ClientRemoveImport) - * [ClientRestartDataTransfer](#ClientRestartDataTransfer) - * [ClientRetrieve](#ClientRetrieve) - * [ClientRetrieveTryRestartInsufficientFunds](#ClientRetrieveTryRestartInsufficientFunds) - * [ClientRetrieveWithEvents](#ClientRetrieveWithEvents) - * [ClientStartDeal](#ClientStartDeal) - * [ClientStatelessDeal](#ClientStatelessDeal) * [Create](#Create) * [CreateBackup](#CreateBackup) * [Gas](#Gas) @@ -1091,1054 +1063,6 @@ Inputs: Response: `"0"` -## Client -The Client methods all have to do with interacting with the storage and -retrieval markets as a client - - -### ClientCalcCommP -ClientCalcCommP calculates the CommP for a specified file - - -Perms: write - -Inputs: -```json -[ - "string value" -] -``` - -Response: -```json -{ - "Root": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "Size": 1024 -} -``` - -### ClientCancelDataTransfer -ClientCancelDataTransfer cancels a data transfer with the given transfer ID and other peer - - -Perms: write - -Inputs: -```json -[ - 3, - "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - true -] -``` - -Response: `{}` - -### ClientCancelRetrievalDeal -ClientCancelRetrievalDeal cancels an ongoing retrieval deal based on DealID - - -Perms: write - -Inputs: -```json -[ - 5 -] -``` - -Response: `{}` - -### ClientDataTransferUpdates - - -Perms: write - -Inputs: `null` - -Response: -```json -{ - "TransferID": 3, - "Status": 1, - "BaseCID": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "IsInitiator": true, - "IsSender": true, - "Voucher": "string value", - "Message": "string value", - "OtherPeer": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "Transferred": 42, - "Stages": { - "Stages": [ - { - "Name": "string value", - "Description": "string value", - "CreatedTime": "0001-01-01T00:00:00Z", - "UpdatedTime": "0001-01-01T00:00:00Z", - "Logs": [ - { - "Log": "string value", - "UpdatedTime": "0001-01-01T00:00:00Z" - } - ] - } - ] - } -} -``` - -### ClientDealPieceCID -ClientCalcCommP calculates the CommP and data size of the specified CID - - -Perms: read - -Inputs: -```json -[ - { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - } -] -``` - -Response: -```json -{ - "PayloadSize": 9, - "PieceSize": 1032, - "PieceCID": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - } -} -``` - -### ClientDealSize -ClientDealSize calculates real deal data size - - -Perms: read - -Inputs: -```json -[ - { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - } -] -``` - -Response: -```json -{ - "PayloadSize": 9, - "PieceSize": 1032 -} -``` - -### ClientFindData -ClientFindData identifies peers that have a certain file, and returns QueryOffers (one per peer). - - -Perms: read - -Inputs: -```json -[ - { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - } -] -``` - -Response: -```json -[ - { - "Err": "string value", - "Root": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "Piece": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "Size": 42, - "MinPrice": "0", - "UnsealPrice": "0", - "PricePerByte": "0", - "PaymentInterval": 42, - "PaymentIntervalIncrease": 42, - "Miner": "f01234", - "MinerPeer": { - "Address": "f01234", - "ID": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "PieceCID": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - } - } - } -] -``` - -### ClientGenCar -ClientGenCar generates a CAR file for the specified file. - - -Perms: write - -Inputs: -```json -[ - { - "Path": "string value", - "IsCAR": true - }, - "string value" -] -``` - -Response: `{}` - -### ClientGetDealInfo -ClientGetDealInfo returns the latest information about a given deal. - - -Perms: read - -Inputs: -```json -[ - { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - } -] -``` - -Response: -```json -{ - "ProposalCid": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "State": 42, - "Message": "string value", - "DealStages": { - "Stages": [ - { - "Name": "string value", - "Description": "string value", - "ExpectedDuration": "string value", - "CreatedTime": "0001-01-01T00:00:00Z", - "UpdatedTime": "0001-01-01T00:00:00Z", - "Logs": [ - { - "Log": "string value", - "UpdatedTime": "0001-01-01T00:00:00Z" - } - ] - } - ] - }, - "Provider": "f01234", - "DataRef": { - "TransferType": "string value", - "Root": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "PieceCid": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "PieceSize": 1024, - "RawBlockSize": 42 - }, - "PieceCID": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "Size": 42, - "PricePerEpoch": "0", - "Duration": 42, - "DealID": 5432, - "CreationTime": "0001-01-01T00:00:00Z", - "Verified": true, - "TransferChannelID": { - "Initiator": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "Responder": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "ID": 3 - }, - "DataTransfer": { - "TransferID": 3, - "Status": 1, - "BaseCID": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "IsInitiator": true, - "IsSender": true, - "Voucher": "string value", - "Message": "string value", - "OtherPeer": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "Transferred": 42, - "Stages": { - "Stages": [ - { - "Name": "string value", - "Description": "string value", - "CreatedTime": "0001-01-01T00:00:00Z", - "UpdatedTime": "0001-01-01T00:00:00Z", - "Logs": [ - { - "Log": "string value", - "UpdatedTime": "0001-01-01T00:00:00Z" - } - ] - } - ] - } - } -} -``` - -### ClientGetDealStatus -ClientGetDealStatus returns status given a code - - -Perms: read - -Inputs: -```json -[ - 42 -] -``` - -Response: `"string value"` - -### ClientGetDealUpdates -ClientGetDealUpdates returns the status of updated deals - - -Perms: write - -Inputs: `null` - -Response: -```json -{ - "ProposalCid": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "State": 42, - "Message": "string value", - "DealStages": { - "Stages": [ - { - "Name": "string value", - "Description": "string value", - "ExpectedDuration": "string value", - "CreatedTime": "0001-01-01T00:00:00Z", - "UpdatedTime": "0001-01-01T00:00:00Z", - "Logs": [ - { - "Log": "string value", - "UpdatedTime": "0001-01-01T00:00:00Z" - } - ] - } - ] - }, - "Provider": "f01234", - "DataRef": { - "TransferType": "string value", - "Root": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "PieceCid": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "PieceSize": 1024, - "RawBlockSize": 42 - }, - "PieceCID": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "Size": 42, - "PricePerEpoch": "0", - "Duration": 42, - "DealID": 5432, - "CreationTime": "0001-01-01T00:00:00Z", - "Verified": true, - "TransferChannelID": { - "Initiator": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "Responder": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "ID": 3 - }, - "DataTransfer": { - "TransferID": 3, - "Status": 1, - "BaseCID": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "IsInitiator": true, - "IsSender": true, - "Voucher": "string value", - "Message": "string value", - "OtherPeer": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "Transferred": 42, - "Stages": { - "Stages": [ - { - "Name": "string value", - "Description": "string value", - "CreatedTime": "0001-01-01T00:00:00Z", - "UpdatedTime": "0001-01-01T00:00:00Z", - "Logs": [ - { - "Log": "string value", - "UpdatedTime": "0001-01-01T00:00:00Z" - } - ] - } - ] - } - } -} -``` - -### ClientGetRetrievalUpdates -ClientGetRetrievalUpdates returns status of updated retrieval deals - - -Perms: write - -Inputs: `null` - -Response: -```json -{ - "PayloadCID": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "ID": 5, - "PieceCID": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "PricePerByte": "0", - "UnsealPrice": "0", - "Status": 0, - "Message": "string value", - "Provider": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "BytesReceived": 42, - "BytesPaidFor": 42, - "TotalPaid": "0", - "TransferChannelID": { - "Initiator": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "Responder": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "ID": 3 - }, - "DataTransfer": { - "TransferID": 3, - "Status": 1, - "BaseCID": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "IsInitiator": true, - "IsSender": true, - "Voucher": "string value", - "Message": "string value", - "OtherPeer": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "Transferred": 42, - "Stages": { - "Stages": [ - { - "Name": "string value", - "Description": "string value", - "CreatedTime": "0001-01-01T00:00:00Z", - "UpdatedTime": "0001-01-01T00:00:00Z", - "Logs": [ - { - "Log": "string value", - "UpdatedTime": "0001-01-01T00:00:00Z" - } - ] - } - ] - } - }, - "Event": 5 -} -``` - -### ClientHasLocal -ClientHasLocal indicates whether a certain CID is locally stored. - - -Perms: write - -Inputs: -```json -[ - { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - } -] -``` - -Response: `true` - -### ClientImport -ClientImport imports file under the specified path into filestore. - - -Perms: admin - -Inputs: -```json -[ - { - "Path": "string value", - "IsCAR": true - } -] -``` - -Response: -```json -{ - "Root": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "ImportID": 50 -} -``` - -### ClientListDataTransfers -ClientListTransfers returns the status of all ongoing transfers of data - - -Perms: write - -Inputs: `null` - -Response: -```json -[ - { - "TransferID": 3, - "Status": 1, - "BaseCID": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "IsInitiator": true, - "IsSender": true, - "Voucher": "string value", - "Message": "string value", - "OtherPeer": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "Transferred": 42, - "Stages": { - "Stages": [ - { - "Name": "string value", - "Description": "string value", - "CreatedTime": "0001-01-01T00:00:00Z", - "UpdatedTime": "0001-01-01T00:00:00Z", - "Logs": [ - { - "Log": "string value", - "UpdatedTime": "0001-01-01T00:00:00Z" - } - ] - } - ] - } - } -] -``` - -### ClientListDeals -ClientListDeals returns information about the deals made by the local client. - - -Perms: write - -Inputs: `null` - -Response: -```json -[ - { - "ProposalCid": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "State": 42, - "Message": "string value", - "DealStages": { - "Stages": [ - { - "Name": "string value", - "Description": "string value", - "ExpectedDuration": "string value", - "CreatedTime": "0001-01-01T00:00:00Z", - "UpdatedTime": "0001-01-01T00:00:00Z", - "Logs": [ - { - "Log": "string value", - "UpdatedTime": "0001-01-01T00:00:00Z" - } - ] - } - ] - }, - "Provider": "f01234", - "DataRef": { - "TransferType": "string value", - "Root": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "PieceCid": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "PieceSize": 1024, - "RawBlockSize": 42 - }, - "PieceCID": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "Size": 42, - "PricePerEpoch": "0", - "Duration": 42, - "DealID": 5432, - "CreationTime": "0001-01-01T00:00:00Z", - "Verified": true, - "TransferChannelID": { - "Initiator": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "Responder": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "ID": 3 - }, - "DataTransfer": { - "TransferID": 3, - "Status": 1, - "BaseCID": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "IsInitiator": true, - "IsSender": true, - "Voucher": "string value", - "Message": "string value", - "OtherPeer": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "Transferred": 42, - "Stages": { - "Stages": [ - { - "Name": "string value", - "Description": "string value", - "CreatedTime": "0001-01-01T00:00:00Z", - "UpdatedTime": "0001-01-01T00:00:00Z", - "Logs": [ - { - "Log": "string value", - "UpdatedTime": "0001-01-01T00:00:00Z" - } - ] - } - ] - } - } - } -] -``` - -### ClientListImports -ClientListImports lists imported files and their root CIDs - - -Perms: write - -Inputs: `null` - -Response: -```json -[ - { - "Key": 50, - "Err": "string value", - "Root": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "Source": "string value", - "FilePath": "string value", - "CARPath": "string value" - } -] -``` - -### ClientListRetrievals -ClientQueryAsk returns a signed StorageAsk from the specified miner. -ClientListRetrievals returns information about retrievals made by the local client - - -Perms: write - -Inputs: `null` - -Response: -```json -[ - { - "PayloadCID": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "ID": 5, - "PieceCID": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "PricePerByte": "0", - "UnsealPrice": "0", - "Status": 0, - "Message": "string value", - "Provider": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "BytesReceived": 42, - "BytesPaidFor": 42, - "TotalPaid": "0", - "TransferChannelID": { - "Initiator": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "Responder": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "ID": 3 - }, - "DataTransfer": { - "TransferID": 3, - "Status": 1, - "BaseCID": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "IsInitiator": true, - "IsSender": true, - "Voucher": "string value", - "Message": "string value", - "OtherPeer": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "Transferred": 42, - "Stages": { - "Stages": [ - { - "Name": "string value", - "Description": "string value", - "CreatedTime": "0001-01-01T00:00:00Z", - "UpdatedTime": "0001-01-01T00:00:00Z", - "Logs": [ - { - "Log": "string value", - "UpdatedTime": "0001-01-01T00:00:00Z" - } - ] - } - ] - } - }, - "Event": 5 - } -] -``` - -### ClientMinerQueryOffer -ClientMinerQueryOffer returns a QueryOffer for the specific miner and file. - - -Perms: read - -Inputs: -```json -[ - "f01234", - { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - } -] -``` - -Response: -```json -{ - "Err": "string value", - "Root": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "Piece": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "Size": 42, - "MinPrice": "0", - "UnsealPrice": "0", - "PricePerByte": "0", - "PaymentInterval": 42, - "PaymentIntervalIncrease": 42, - "Miner": "f01234", - "MinerPeer": { - "Address": "f01234", - "ID": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "PieceCID": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - } - } -} -``` - -### ClientQueryAsk - - -Perms: read - -Inputs: -```json -[ - "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "f01234" -] -``` - -Response: -```json -{ - "Price": "0", - "VerifiedPrice": "0", - "MinPieceSize": 1032, - "MaxPieceSize": 1032, - "Miner": "f01234", - "Timestamp": 10101, - "Expiry": 10101, - "SeqNo": 42 -} -``` - -### ClientRemoveImport -ClientRemoveImport removes file import - - -Perms: admin - -Inputs: -```json -[ - 50 -] -``` - -Response: `{}` - -### ClientRestartDataTransfer -ClientRestartDataTransfer attempts to restart a data transfer with the given transfer ID and other peer - - -Perms: write - -Inputs: -```json -[ - 3, - "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - true -] -``` - -Response: `{}` - -### ClientRetrieve -ClientRetrieve initiates the retrieval of a file, as specified in the order. - - -Perms: admin - -Inputs: -```json -[ - { - "Root": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "Piece": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "DatamodelPathSelector": "Links/21/Hash/Links/42/Hash", - "Size": 42, - "FromLocalCAR": "string value", - "Total": "0", - "UnsealPrice": "0", - "PaymentInterval": 42, - "PaymentIntervalIncrease": 42, - "Client": "f01234", - "Miner": "f01234", - "MinerPeer": { - "Address": "f01234", - "ID": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "PieceCID": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - } - } - }, - { - "Path": "string value", - "IsCAR": true - } -] -``` - -Response: `{}` - -### ClientRetrieveTryRestartInsufficientFunds -ClientRetrieveTryRestartInsufficientFunds attempts to restart stalled retrievals on a given payment channel -which are stuck due to insufficient funds - - -Perms: write - -Inputs: -```json -[ - "f01234" -] -``` - -Response: `{}` - -### ClientRetrieveWithEvents -ClientRetrieveWithEvents initiates the retrieval of a file, as specified in the order, and provides a channel -of status updates. - - -Perms: admin - -Inputs: -```json -[ - { - "Root": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "Piece": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "DatamodelPathSelector": "Links/21/Hash/Links/42/Hash", - "Size": 42, - "FromLocalCAR": "string value", - "Total": "0", - "UnsealPrice": "0", - "PaymentInterval": 42, - "PaymentIntervalIncrease": 42, - "Client": "f01234", - "Miner": "f01234", - "MinerPeer": { - "Address": "f01234", - "ID": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "PieceCID": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - } - } - }, - { - "Path": "string value", - "IsCAR": true - } -] -``` - -Response: -```json -{ - "Event": 5, - "Status": 0, - "BytesReceived": 42, - "FundsSpent": "0", - "Err": "string value" -} -``` - -### ClientStartDeal -ClientStartDeal proposes a deal with a miner. - - -Perms: admin - -Inputs: -```json -[ - { - "Data": { - "TransferType": "string value", - "Root": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "PieceCid": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "PieceSize": 1024, - "RawBlockSize": 42 - }, - "Wallet": "f01234", - "Miner": "f01234", - "EpochPrice": "0", - "MinBlocksDuration": 42, - "ProviderCollateral": "0", - "DealStartEpoch": 10101, - "FastRetrieval": true, - "VerifiedDeal": true - } -] -``` - -Response: -```json -{ - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" -} -``` - -### ClientStatelessDeal -ClientStatelessDeal fire-and-forget-proposes an offline deal to a miner without subsequent tracking. - - -Perms: write - -Inputs: -```json -[ - { - "Data": { - "TransferType": "string value", - "Root": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "PieceCid": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "PieceSize": 1024, - "RawBlockSize": 42 - }, - "Wallet": "f01234", - "Miner": "f01234", - "EpochPrice": "0", - "MinBlocksDuration": 42, - "ProviderCollateral": "0", - "DealStartEpoch": 10101, - "FastRetrieval": true, - "VerifiedDeal": true - } -] -``` - -Response: -```json -{ - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" -} -``` - ## Create @@ -4697,9 +3621,6 @@ Inputs: `null` Response: `"0001-01-01T00:00:00Z"` ## State -The State methods are used to query, inspect, and interact with chain state. -Most methods take a TipSetKey as a parameter. The state looked up is the parent state of the tipset. -A nil TipSetKey can be provided as a param, this will cause the heaviest tipset in the chain to be used. ### StateAccountKey diff --git a/documentation/en/api-v1-unstable-methods.md b/documentation/en/api-v1-unstable-methods.md index 8048bb2cbed..6a9dde92847 100644 --- a/documentation/en/api-v1-unstable-methods.md +++ b/documentation/en/api-v1-unstable-methods.md @@ -37,35 +37,6 @@ * [ChainSetHead](#ChainSetHead) * [ChainStatObj](#ChainStatObj) * [ChainTipSetWeight](#ChainTipSetWeight) -* [Client](#Client) - * [ClientCalcCommP](#ClientCalcCommP) - * [ClientCancelDataTransfer](#ClientCancelDataTransfer) - * [ClientCancelRetrievalDeal](#ClientCancelRetrievalDeal) - * [ClientDataTransferUpdates](#ClientDataTransferUpdates) - * [ClientDealPieceCID](#ClientDealPieceCID) - * [ClientDealSize](#ClientDealSize) - * [ClientExport](#ClientExport) - * [ClientFindData](#ClientFindData) - * [ClientGenCar](#ClientGenCar) - * [ClientGetDealInfo](#ClientGetDealInfo) - * [ClientGetDealStatus](#ClientGetDealStatus) - * [ClientGetDealUpdates](#ClientGetDealUpdates) - * [ClientGetRetrievalUpdates](#ClientGetRetrievalUpdates) - * [ClientHasLocal](#ClientHasLocal) - * [ClientImport](#ClientImport) - * [ClientListDataTransfers](#ClientListDataTransfers) - * [ClientListDeals](#ClientListDeals) - * [ClientListImports](#ClientListImports) - * [ClientListRetrievals](#ClientListRetrievals) - * [ClientMinerQueryOffer](#ClientMinerQueryOffer) - * [ClientQueryAsk](#ClientQueryAsk) - * [ClientRemoveImport](#ClientRemoveImport) - * [ClientRestartDataTransfer](#ClientRestartDataTransfer) - * [ClientRetrieve](#ClientRetrieve) - * [ClientRetrieveTryRestartInsufficientFunds](#ClientRetrieveTryRestartInsufficientFunds) - * [ClientRetrieveWait](#ClientRetrieveWait) - * [ClientStartDeal](#ClientStartDeal) - * [ClientStatelessDeal](#ClientStatelessDeal) * [Create](#Create) * [CreateBackup](#CreateBackup) * [Eth](#Eth) @@ -1253,1054 +1224,6 @@ Inputs: Response: `"0"` -## Client -The Client methods all have to do with interacting with the storage and -retrieval markets as a client - - -### ClientCalcCommP -ClientCalcCommP calculates the CommP for a specified file - - -Perms: write - -Inputs: -```json -[ - "string value" -] -``` - -Response: -```json -{ - "Root": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "Size": 1024 -} -``` - -### ClientCancelDataTransfer -ClientCancelDataTransfer cancels a data transfer with the given transfer ID and other peer - - -Perms: write - -Inputs: -```json -[ - 3, - "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - true -] -``` - -Response: `{}` - -### ClientCancelRetrievalDeal -ClientCancelRetrievalDeal cancels an ongoing retrieval deal based on DealID - - -Perms: write - -Inputs: -```json -[ - 5 -] -``` - -Response: `{}` - -### ClientDataTransferUpdates - - -Perms: write - -Inputs: `null` - -Response: -```json -{ - "TransferID": 3, - "Status": 1, - "BaseCID": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "IsInitiator": true, - "IsSender": true, - "Voucher": "string value", - "Message": "string value", - "OtherPeer": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "Transferred": 42, - "Stages": { - "Stages": [ - { - "Name": "string value", - "Description": "string value", - "CreatedTime": "0001-01-01T00:00:00Z", - "UpdatedTime": "0001-01-01T00:00:00Z", - "Logs": [ - { - "Log": "string value", - "UpdatedTime": "0001-01-01T00:00:00Z" - } - ] - } - ] - } -} -``` - -### ClientDealPieceCID -ClientCalcCommP calculates the CommP and data size of the specified CID - - -Perms: read - -Inputs: -```json -[ - { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - } -] -``` - -Response: -```json -{ - "PayloadSize": 9, - "PieceSize": 1032, - "PieceCID": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - } -} -``` - -### ClientDealSize -ClientDealSize calculates real deal data size - - -Perms: read - -Inputs: -```json -[ - { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - } -] -``` - -Response: -```json -{ - "PayloadSize": 9, - "PieceSize": 1032 -} -``` - -### ClientExport -ClientExport exports a file stored in the local filestore to a system file - - -Perms: admin - -Inputs: -```json -[ - { - "Root": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "DAGs": [ - { - "DataSelector": "Links/21/Hash/Links/42/Hash", - "ExportMerkleProof": true - } - ], - "FromLocalCAR": "string value", - "DealID": 5 - }, - { - "Path": "string value", - "IsCAR": true - } -] -``` - -Response: `{}` - -### ClientFindData -ClientFindData identifies peers that have a certain file, and returns QueryOffers (one per peer). - - -Perms: read - -Inputs: -```json -[ - { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - } -] -``` - -Response: -```json -[ - { - "Err": "string value", - "Root": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "Piece": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "Size": 42, - "MinPrice": "0", - "UnsealPrice": "0", - "PricePerByte": "0", - "PaymentInterval": 42, - "PaymentIntervalIncrease": 42, - "Miner": "f01234", - "MinerPeer": { - "Address": "f01234", - "ID": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "PieceCID": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - } - } - } -] -``` - -### ClientGenCar -ClientGenCar generates a CAR file for the specified file. - - -Perms: write - -Inputs: -```json -[ - { - "Path": "string value", - "IsCAR": true - }, - "string value" -] -``` - -Response: `{}` - -### ClientGetDealInfo -ClientGetDealInfo returns the latest information about a given deal. - - -Perms: read - -Inputs: -```json -[ - { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - } -] -``` - -Response: -```json -{ - "ProposalCid": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "State": 42, - "Message": "string value", - "DealStages": { - "Stages": [ - { - "Name": "string value", - "Description": "string value", - "ExpectedDuration": "string value", - "CreatedTime": "0001-01-01T00:00:00Z", - "UpdatedTime": "0001-01-01T00:00:00Z", - "Logs": [ - { - "Log": "string value", - "UpdatedTime": "0001-01-01T00:00:00Z" - } - ] - } - ] - }, - "Provider": "f01234", - "DataRef": { - "TransferType": "string value", - "Root": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "PieceCid": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "PieceSize": 1024, - "RawBlockSize": 42 - }, - "PieceCID": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "Size": 42, - "PricePerEpoch": "0", - "Duration": 42, - "DealID": 5432, - "CreationTime": "0001-01-01T00:00:00Z", - "Verified": true, - "TransferChannelID": { - "Initiator": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "Responder": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "ID": 3 - }, - "DataTransfer": { - "TransferID": 3, - "Status": 1, - "BaseCID": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "IsInitiator": true, - "IsSender": true, - "Voucher": "string value", - "Message": "string value", - "OtherPeer": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "Transferred": 42, - "Stages": { - "Stages": [ - { - "Name": "string value", - "Description": "string value", - "CreatedTime": "0001-01-01T00:00:00Z", - "UpdatedTime": "0001-01-01T00:00:00Z", - "Logs": [ - { - "Log": "string value", - "UpdatedTime": "0001-01-01T00:00:00Z" - } - ] - } - ] - } - } -} -``` - -### ClientGetDealStatus -ClientGetDealStatus returns status given a code - - -Perms: read - -Inputs: -```json -[ - 42 -] -``` - -Response: `"string value"` - -### ClientGetDealUpdates -ClientGetDealUpdates returns the status of updated deals - - -Perms: write - -Inputs: `null` - -Response: -```json -{ - "ProposalCid": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "State": 42, - "Message": "string value", - "DealStages": { - "Stages": [ - { - "Name": "string value", - "Description": "string value", - "ExpectedDuration": "string value", - "CreatedTime": "0001-01-01T00:00:00Z", - "UpdatedTime": "0001-01-01T00:00:00Z", - "Logs": [ - { - "Log": "string value", - "UpdatedTime": "0001-01-01T00:00:00Z" - } - ] - } - ] - }, - "Provider": "f01234", - "DataRef": { - "TransferType": "string value", - "Root": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "PieceCid": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "PieceSize": 1024, - "RawBlockSize": 42 - }, - "PieceCID": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "Size": 42, - "PricePerEpoch": "0", - "Duration": 42, - "DealID": 5432, - "CreationTime": "0001-01-01T00:00:00Z", - "Verified": true, - "TransferChannelID": { - "Initiator": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "Responder": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "ID": 3 - }, - "DataTransfer": { - "TransferID": 3, - "Status": 1, - "BaseCID": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "IsInitiator": true, - "IsSender": true, - "Voucher": "string value", - "Message": "string value", - "OtherPeer": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "Transferred": 42, - "Stages": { - "Stages": [ - { - "Name": "string value", - "Description": "string value", - "CreatedTime": "0001-01-01T00:00:00Z", - "UpdatedTime": "0001-01-01T00:00:00Z", - "Logs": [ - { - "Log": "string value", - "UpdatedTime": "0001-01-01T00:00:00Z" - } - ] - } - ] - } - } -} -``` - -### ClientGetRetrievalUpdates -ClientGetRetrievalUpdates returns status of updated retrieval deals - - -Perms: write - -Inputs: `null` - -Response: -```json -{ - "PayloadCID": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "ID": 5, - "PieceCID": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "PricePerByte": "0", - "UnsealPrice": "0", - "Status": 0, - "Message": "string value", - "Provider": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "BytesReceived": 42, - "BytesPaidFor": 42, - "TotalPaid": "0", - "TransferChannelID": { - "Initiator": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "Responder": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "ID": 3 - }, - "DataTransfer": { - "TransferID": 3, - "Status": 1, - "BaseCID": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "IsInitiator": true, - "IsSender": true, - "Voucher": "string value", - "Message": "string value", - "OtherPeer": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "Transferred": 42, - "Stages": { - "Stages": [ - { - "Name": "string value", - "Description": "string value", - "CreatedTime": "0001-01-01T00:00:00Z", - "UpdatedTime": "0001-01-01T00:00:00Z", - "Logs": [ - { - "Log": "string value", - "UpdatedTime": "0001-01-01T00:00:00Z" - } - ] - } - ] - } - }, - "Event": 5 -} -``` - -### ClientHasLocal -ClientHasLocal indicates whether a certain CID is locally stored. - - -Perms: write - -Inputs: -```json -[ - { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - } -] -``` - -Response: `true` - -### ClientImport -ClientImport imports file under the specified path into filestore. - - -Perms: admin - -Inputs: -```json -[ - { - "Path": "string value", - "IsCAR": true - } -] -``` - -Response: -```json -{ - "Root": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "ImportID": 50 -} -``` - -### ClientListDataTransfers -ClientListTransfers returns the status of all ongoing transfers of data - - -Perms: write - -Inputs: `null` - -Response: -```json -[ - { - "TransferID": 3, - "Status": 1, - "BaseCID": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "IsInitiator": true, - "IsSender": true, - "Voucher": "string value", - "Message": "string value", - "OtherPeer": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "Transferred": 42, - "Stages": { - "Stages": [ - { - "Name": "string value", - "Description": "string value", - "CreatedTime": "0001-01-01T00:00:00Z", - "UpdatedTime": "0001-01-01T00:00:00Z", - "Logs": [ - { - "Log": "string value", - "UpdatedTime": "0001-01-01T00:00:00Z" - } - ] - } - ] - } - } -] -``` - -### ClientListDeals -ClientListDeals returns information about the deals made by the local client. - - -Perms: write - -Inputs: `null` - -Response: -```json -[ - { - "ProposalCid": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "State": 42, - "Message": "string value", - "DealStages": { - "Stages": [ - { - "Name": "string value", - "Description": "string value", - "ExpectedDuration": "string value", - "CreatedTime": "0001-01-01T00:00:00Z", - "UpdatedTime": "0001-01-01T00:00:00Z", - "Logs": [ - { - "Log": "string value", - "UpdatedTime": "0001-01-01T00:00:00Z" - } - ] - } - ] - }, - "Provider": "f01234", - "DataRef": { - "TransferType": "string value", - "Root": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "PieceCid": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "PieceSize": 1024, - "RawBlockSize": 42 - }, - "PieceCID": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "Size": 42, - "PricePerEpoch": "0", - "Duration": 42, - "DealID": 5432, - "CreationTime": "0001-01-01T00:00:00Z", - "Verified": true, - "TransferChannelID": { - "Initiator": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "Responder": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "ID": 3 - }, - "DataTransfer": { - "TransferID": 3, - "Status": 1, - "BaseCID": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "IsInitiator": true, - "IsSender": true, - "Voucher": "string value", - "Message": "string value", - "OtherPeer": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "Transferred": 42, - "Stages": { - "Stages": [ - { - "Name": "string value", - "Description": "string value", - "CreatedTime": "0001-01-01T00:00:00Z", - "UpdatedTime": "0001-01-01T00:00:00Z", - "Logs": [ - { - "Log": "string value", - "UpdatedTime": "0001-01-01T00:00:00Z" - } - ] - } - ] - } - } - } -] -``` - -### ClientListImports -ClientListImports lists imported files and their root CIDs - - -Perms: write - -Inputs: `null` - -Response: -```json -[ - { - "Key": 50, - "Err": "string value", - "Root": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "Source": "string value", - "FilePath": "string value", - "CARPath": "string value" - } -] -``` - -### ClientListRetrievals -ClientListRetrievals returns information about retrievals made by the local client - - -Perms: write - -Inputs: `null` - -Response: -```json -[ - { - "PayloadCID": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "ID": 5, - "PieceCID": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "PricePerByte": "0", - "UnsealPrice": "0", - "Status": 0, - "Message": "string value", - "Provider": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "BytesReceived": 42, - "BytesPaidFor": 42, - "TotalPaid": "0", - "TransferChannelID": { - "Initiator": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "Responder": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "ID": 3 - }, - "DataTransfer": { - "TransferID": 3, - "Status": 1, - "BaseCID": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "IsInitiator": true, - "IsSender": true, - "Voucher": "string value", - "Message": "string value", - "OtherPeer": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "Transferred": 42, - "Stages": { - "Stages": [ - { - "Name": "string value", - "Description": "string value", - "CreatedTime": "0001-01-01T00:00:00Z", - "UpdatedTime": "0001-01-01T00:00:00Z", - "Logs": [ - { - "Log": "string value", - "UpdatedTime": "0001-01-01T00:00:00Z" - } - ] - } - ] - } - }, - "Event": 5 - } -] -``` - -### ClientMinerQueryOffer -ClientMinerQueryOffer returns a QueryOffer for the specific miner and file. - - -Perms: read - -Inputs: -```json -[ - "f01234", - { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - } -] -``` - -Response: -```json -{ - "Err": "string value", - "Root": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "Piece": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "Size": 42, - "MinPrice": "0", - "UnsealPrice": "0", - "PricePerByte": "0", - "PaymentInterval": 42, - "PaymentIntervalIncrease": 42, - "Miner": "f01234", - "MinerPeer": { - "Address": "f01234", - "ID": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "PieceCID": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - } - } -} -``` - -### ClientQueryAsk -ClientQueryAsk returns a signed StorageAsk from the specified miner. - - -Perms: read - -Inputs: -```json -[ - "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "f01234" -] -``` - -Response: -```json -{ - "Response": { - "Price": "0", - "VerifiedPrice": "0", - "MinPieceSize": 1032, - "MaxPieceSize": 1032, - "Miner": "f01234", - "Timestamp": 10101, - "Expiry": 10101, - "SeqNo": 42 - }, - "DealProtocols": [ - "string value" - ] -} -``` - -### ClientRemoveImport -ClientRemoveImport removes file import - - -Perms: admin - -Inputs: -```json -[ - 50 -] -``` - -Response: `{}` - -### ClientRestartDataTransfer -ClientRestartDataTransfer attempts to restart a data transfer with the given transfer ID and other peer - - -Perms: write - -Inputs: -```json -[ - 3, - "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - true -] -``` - -Response: `{}` - -### ClientRetrieve -ClientRetrieve initiates the retrieval of a file, as specified in the order. - - -Perms: admin - -Inputs: -```json -[ - { - "Root": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "Piece": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "DataSelector": "Links/21/Hash/Links/42/Hash", - "Size": 42, - "Total": "0", - "UnsealPrice": "0", - "PaymentInterval": 42, - "PaymentIntervalIncrease": 42, - "Client": "f01234", - "Miner": "f01234", - "MinerPeer": { - "Address": "f01234", - "ID": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "PieceCID": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - } - }, - "RemoteStore": "00000000-0000-0000-0000-000000000000" - } -] -``` - -Response: -```json -{ - "DealID": 5 -} -``` - -### ClientRetrieveTryRestartInsufficientFunds -ClientRetrieveTryRestartInsufficientFunds attempts to restart stalled retrievals on a given payment channel -which are stuck due to insufficient funds - - -Perms: write - -Inputs: -```json -[ - "f01234" -] -``` - -Response: `{}` - -### ClientRetrieveWait -ClientRetrieveWait waits for retrieval to be complete - - -Perms: admin - -Inputs: -```json -[ - 5 -] -``` - -Response: `{}` - -### ClientStartDeal -ClientStartDeal proposes a deal with a miner. - - -Perms: admin - -Inputs: -```json -[ - { - "Data": { - "TransferType": "string value", - "Root": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "PieceCid": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "PieceSize": 1024, - "RawBlockSize": 42 - }, - "Wallet": "f01234", - "Miner": "f01234", - "EpochPrice": "0", - "MinBlocksDuration": 42, - "ProviderCollateral": "0", - "DealStartEpoch": 10101, - "FastRetrieval": true, - "VerifiedDeal": true - } -] -``` - -Response: -```json -{ - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" -} -``` - -### ClientStatelessDeal -ClientStatelessDeal fire-and-forget-proposes an offline deal to a miner without subsequent tracking. - - -Perms: write - -Inputs: -```json -[ - { - "Data": { - "TransferType": "string value", - "Root": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "PieceCid": { - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" - }, - "PieceSize": 1024, - "RawBlockSize": 42 - }, - "Wallet": "f01234", - "Miner": "f01234", - "EpochPrice": "0", - "MinBlocksDuration": 42, - "ProviderCollateral": "0", - "DealStartEpoch": 10101, - "FastRetrieval": true, - "VerifiedDeal": true - } -] -``` - -Response: -```json -{ - "/": "bafy2bzacea3wsdh6y3a36tb3skempjoxqpuyompjbmfeyf34fi3uy6uue42v4" -} -``` - ## Create diff --git a/documentation/en/cli-lotus-miner.md b/documentation/en/cli-lotus-miner.md index eb20c634bbd..facc406118a 100644 --- a/documentation/en/cli-lotus-miner.md +++ b/documentation/en/cli-lotus-miner.md @@ -49,7 +49,6 @@ USAGE: COMMANDS: restore Initialize a lotus miner repo from a backup - service Initialize a lotus miner sub-service help, h Shows a list of commands or help for one command OPTIONS: @@ -84,23 +83,6 @@ OPTIONS: --help, -h show help ``` -### lotus-miner init service -``` -NAME: - lotus-miner init service - Initialize a lotus miner sub-service - -USAGE: - lotus-miner init service [command options] [backupFile] - -OPTIONS: - --config value config file (config.toml) - --nosync don't check full-node sync status (default: false) - --type value [ --type value ] type of service to be enabled - --api-sealer value sealer API info (lotus-miner auth api-info --perm=admin) - --api-sector-index value sector Index API info (lotus-miner auth api-info --perm=admin) - --help, -h show help -``` - ## lotus-miner run ``` NAME: @@ -598,7 +580,6 @@ USAGE: COMMANDS: status Get the seal status of a sector by its number list List sectors - refs List References to sectors update-state ADVANCED: manually update the state of a sector, this may aid in error recovery pledge store random data in a sector numbers manage sector number assignments @@ -678,18 +659,6 @@ OPTIONS: --help, -h show help ``` -### lotus-miner sectors refs -``` -NAME: - lotus-miner sectors refs - List References to sectors - -USAGE: - lotus-miner sectors refs [command options] [arguments...] - -OPTIONS: - --help, -h show help -``` - ### lotus-miner sectors update-state ``` NAME: diff --git a/documentation/en/cli-lotus.md b/documentation/en/cli-lotus.md index 36e28948c0f..45e6150467e 100644 --- a/documentation/en/cli-lotus.md +++ b/documentation/en/cli-lotus.md @@ -19,7 +19,6 @@ COMMANDS: send Send funds between accounts wallet Manage wallet info Print node info - client Make deals, store data, retrieve data msig Interact with a multisig wallet filplus Interact with the verified registry actor used by Filplus paych Manage payment channels @@ -403,515 +402,6 @@ OPTIONS: --help, -h show help ``` -## lotus client -``` -NAME: - lotus client - Make deals, store data, retrieve data - -USAGE: - lotus client command [command options] [arguments...] - -COMMANDS: - help, h Shows a list of commands or help for one command - DATA: - import Import data - drop Remove import - local List locally imported data - stat Print information about a locally stored file (piece size, etc) - RETRIEVAL: - find Find data in the network - retrieval-ask Get a miner's retrieval ask - retrieve Retrieve data from network - cat Show data from network - ls List object links - cancel-retrieval Cancel a retrieval deal by deal ID; this also cancels the associated transfer - list-retrievals List retrieval market deals - STORAGE: - deal Initialize storage deal with a miner - query-ask Find a miners ask - list-deals List storage market deals - get-deal Print detailed deal information - list-asks List asks for top miners - deal-stats Print statistics about local storage deals - inspect-deal Inspect detailed information about deal's lifecycle and the various stages it goes through - UTIL: - commP Calculate the piece-cid (commP) of a CAR file - generate-car Generate a car file from input - balances Print storage market client balances - list-transfers List ongoing data transfers for deals - restart-transfer Force restart a stalled data transfer - cancel-transfer Force cancel a data transfer - -OPTIONS: - --help, -h show help -``` - -### lotus client import -``` -NAME: - lotus client import - Import data - -USAGE: - lotus client import [command options] [inputPath] - -CATEGORY: - DATA - -OPTIONS: - --car import from a car file instead of a regular file (default: false) - --quiet, -q Output root CID only (default: false) - --help, -h show help -``` - -### lotus client drop -``` -NAME: - lotus client drop - Remove import - -USAGE: - lotus client drop [command options] [import ID...] - -CATEGORY: - DATA - -OPTIONS: - --help, -h show help -``` - -### lotus client local -``` -NAME: - lotus client local - List locally imported data - -USAGE: - lotus client local [command options] [arguments...] - -CATEGORY: - DATA - -OPTIONS: - --help, -h show help -``` - -### lotus client stat -``` -NAME: - lotus client stat - Print information about a locally stored file (piece size, etc) - -USAGE: - lotus client stat [command options] - -CATEGORY: - DATA - -OPTIONS: - --help, -h show help -``` - -### lotus client find -``` -NAME: - lotus client find - Find data in the network - -USAGE: - lotus client find [command options] [dataCid] - -CATEGORY: - RETRIEVAL - -OPTIONS: - --pieceCid value require data to be retrieved from a specific Piece CID - --help, -h show help -``` - -### lotus client retrieval-ask -``` -NAME: - lotus client retrieval-ask - Get a miner's retrieval ask - -USAGE: - lotus client retrieval-ask [command options] [minerAddress] [data CID] - -CATEGORY: - RETRIEVAL - -OPTIONS: - --size value data size in bytes (default: 0) - --help, -h show help -``` - -### lotus client retrieve -``` -NAME: - lotus client retrieve - Retrieve data from network - -USAGE: - lotus client retrieve [command options] [dataCid outputPath] - -CATEGORY: - RETRIEVAL - -DESCRIPTION: - Retrieve data from the Filecoin network. - - The retrieve command will attempt to find a provider make a retrieval deal with - them. In case a provider can't be found, it can be specified with the --provider - flag. - - By default the data will be interpreted as DAG-PB UnixFSv1 File. Alternatively - a CAR file containing the raw IPLD graph can be exported by setting the --car - flag. - - Partial Retrieval: - - The --data-selector flag can be used to specify a sub-graph to fetch. The - selector can be specified as either IPLD datamodel text-path selector, or IPLD - json selector. - - In case of unixfs retrieval, the selector must point at a single root node, and - match the entire graph under that node. - - In case of CAR retrieval, the selector must have one common "sub-root" node. - - Examples: - - - Retrieve a file by CID - $ lotus client retrieve Qm... my-file.txt - - - Retrieve a file by CID from f0123 - $ lotus client retrieve --provider f0123 Qm... my-file.txt - - - Retrieve a first file from a specified directory - $ lotus client retrieve --data-selector /Links/0/Hash Qm... my-file.txt - - -OPTIONS: - --car Export to a car file instead of a regular file (default: false) - --data-selector value, --datamodel-path-selector value IPLD datamodel text-path selector, or IPLD json selector - --car-export-merkle-proof (requires --data-selector and --car) Export data-selector merkle proof (default: false) - --from value address to send transactions from - --provider value, --miner value provider to use for retrieval, if not present it'll use local discovery - --maxPrice value maximum price the client is willing to consider (default: 0 FIL) - --pieceCid value require data to be retrieved from a specific Piece CID - --allow-local (default: false) - --help, -h show help -``` - -### lotus client cat -``` -NAME: - lotus client cat - Show data from network - -USAGE: - lotus client cat [command options] [dataCid] - -CATEGORY: - RETRIEVAL - -OPTIONS: - --ipld list IPLD datamodel links (default: false) - --data-selector value IPLD datamodel text-path selector, or IPLD json selector - --from value address to send transactions from - --provider value, --miner value provider to use for retrieval, if not present it'll use local discovery - --maxPrice value maximum price the client is willing to consider (default: 0 FIL) - --pieceCid value require data to be retrieved from a specific Piece CID - --allow-local (default: false) - --help, -h show help -``` - -### lotus client ls -``` -NAME: - lotus client ls - List object links - -USAGE: - lotus client ls [command options] [dataCid] - -CATEGORY: - RETRIEVAL - -OPTIONS: - --ipld list IPLD datamodel links (default: false) - --depth value list links recursively up to the specified depth (default: 1) - --data-selector value IPLD datamodel text-path selector, or IPLD json selector - --from value address to send transactions from - --provider value, --miner value provider to use for retrieval, if not present it'll use local discovery - --maxPrice value maximum price the client is willing to consider (default: 0 FIL) - --pieceCid value require data to be retrieved from a specific Piece CID - --allow-local (default: false) - --help, -h show help -``` - -### lotus client cancel-retrieval -``` -NAME: - lotus client cancel-retrieval - Cancel a retrieval deal by deal ID; this also cancels the associated transfer - -USAGE: - lotus client cancel-retrieval [command options] [arguments...] - -CATEGORY: - RETRIEVAL - -OPTIONS: - --deal-id value specify retrieval deal by deal ID (default: 0) - --help, -h show help -``` - -### lotus client list-retrievals -``` -NAME: - lotus client list-retrievals - List retrieval market deals - -USAGE: - lotus client list-retrievals [command options] [arguments...] - -CATEGORY: - RETRIEVAL - -OPTIONS: - --verbose, -v print verbose deal details (default: false) - --show-failed show failed/failing deals (default: true) - --completed show completed retrievals (default: false) - --watch watch deal updates in real-time, rather than a one time list (default: false) - --help, -h show help -``` - -### lotus client deal -``` -NAME: - lotus client deal - Initialize storage deal with a miner - -USAGE: - lotus client deal [command options] [dataCid miner price duration] - -CATEGORY: - STORAGE - -DESCRIPTION: - Make a deal with a miner. - dataCid comes from running 'lotus client import'. - miner is the address of the miner you wish to make a deal with. - price is measured in FIL/Epoch. Miners usually don't accept a bid - lower than their advertised ask (which is in FIL/GiB/Epoch). You can check a miners listed price - with 'lotus client query-ask '. - duration is how long the miner should store the data for, in blocks. - The minimum value is 518400 (6 months). - -OPTIONS: - --manual-piece-cid value manually specify piece commitment for data (dataCid must be to a car file) - --manual-piece-size value if manually specifying piece cid, used to specify size (dataCid must be to a car file) (default: 0) - --manual-stateless-deal instructs the node to send an offline deal without registering it with the deallist/fsm (default: false) - --from value specify address to fund the deal with - --start-epoch value specify the epoch that the deal should start at (default: -1) - --fast-retrieval indicates that data should be available for fast retrieval (default: true) - --verified-deal indicate that the deal counts towards verified client total (default: true if client is verified, false otherwise) - --provider-collateral value specify the requested provider collateral the miner should put up - --help, -h show help -``` - -### lotus client query-ask -``` -NAME: - lotus client query-ask - Find a miners ask - -USAGE: - lotus client query-ask [command options] [minerAddress] - -CATEGORY: - STORAGE - -OPTIONS: - --peerid value specify peer ID of node to make query against - --size value data size in bytes (default: 0) - --duration value deal duration (default: 0) - --help, -h show help -``` - -### lotus client list-deals -``` -NAME: - lotus client list-deals - List storage market deals - -USAGE: - lotus client list-deals [command options] [arguments...] - -CATEGORY: - STORAGE - -OPTIONS: - --verbose, -v print verbose deal details (default: false) - --show-failed show failed/failing deals (default: false) - --watch watch deal updates in real-time, rather than a one time list (default: false) - --help, -h show help -``` - -### lotus client get-deal -``` -NAME: - lotus client get-deal - Print detailed deal information - -USAGE: - lotus client get-deal [command options] [proposalCID] - -CATEGORY: - STORAGE - -OPTIONS: - --help, -h show help -``` - -### lotus client list-asks -``` -NAME: - lotus client list-asks - List asks for top miners - -USAGE: - lotus client list-asks [command options] [arguments...] - -CATEGORY: - STORAGE - -OPTIONS: - --by-ping sort by ping (default: false) - --output-format value Either 'text' or 'csv' (default: "text") - --protocols Output supported deal protocols (default: false) - --help, -h show help -``` - -### lotus client deal-stats -``` -NAME: - lotus client deal-stats - Print statistics about local storage deals - -USAGE: - lotus client deal-stats [command options] [arguments...] - -CATEGORY: - STORAGE - -OPTIONS: - --newer-than value (default: 0s) - --help, -h show help -``` - -### lotus client inspect-deal -``` -NAME: - lotus client inspect-deal - Inspect detailed information about deal's lifecycle and the various stages it goes through - -USAGE: - lotus client inspect-deal [command options] [arguments...] - -CATEGORY: - STORAGE - -OPTIONS: - --deal-id value (default: 0) - --proposal-cid value - --help, -h show help -``` - -### lotus client commP -``` -NAME: - lotus client commP - Calculate the piece-cid (commP) of a CAR file - -USAGE: - lotus client commP [command options] [inputFile] - -CATEGORY: - UTIL - -OPTIONS: - --help, -h show help -``` - -### lotus client generate-car -``` -NAME: - lotus client generate-car - Generate a car file from input - -USAGE: - lotus client generate-car [command options] [inputPath outputPath] - -CATEGORY: - UTIL - -OPTIONS: - --help, -h show help -``` - -### lotus client balances -``` -NAME: - lotus client balances - Print storage market client balances - -USAGE: - lotus client balances [command options] [arguments...] - -CATEGORY: - UTIL - -OPTIONS: - --client value specify storage client address - --help, -h show help -``` - -### lotus client list-transfers -``` -NAME: - lotus client list-transfers - List ongoing data transfers for deals - -USAGE: - lotus client list-transfers [command options] [arguments...] - -CATEGORY: - UTIL - -OPTIONS: - --verbose, -v print verbose transfer details (default: false) - --completed show completed data transfers (default: false) - --watch watch deal updates in real-time, rather than a one time list (default: false) - --show-failed show failed/cancelled transfers (default: false) - --help, -h show help -``` - -### lotus client restart-transfer -``` -NAME: - lotus client restart-transfer - Force restart a stalled data transfer - -USAGE: - lotus client restart-transfer [command options] [transferID] - -CATEGORY: - UTIL - -OPTIONS: - --peerid value narrow to transfer with specific peer - --initiator specify only transfers where peer is/is not initiator (default: true) - --help, -h show help -``` - -### lotus client cancel-transfer -``` -NAME: - lotus client cancel-transfer - Force cancel a data transfer - -USAGE: - lotus client cancel-transfer [command options] [transferID] - -CATEGORY: - UTIL - -OPTIONS: - --peerid value narrow to transfer with specific peer - --initiator specify only transfers where peer is/is not initiator (default: true) - --cancel-timeout value time to wait for cancel to be sent to storage provider (default: 5s) - --help, -h show help -``` - ## lotus msig ``` NAME: @@ -1380,9 +870,8 @@ USAGE: lotus paych add-funds [command options] [fromAddress toAddress amount] OPTIONS: - --restart-retrievals restart stalled retrieval deals on this payment channel (default: true) - --reserve mark funds as reserved (default: false) - --help, -h show help + --reserve mark funds as reserved (default: false) + --help, -h show help ``` ### lotus paych list diff --git a/documentation/en/default-lotus-config.toml b/documentation/en/default-lotus-config.toml index 8d3c6a427e8..2971a4e9199 100644 --- a/documentation/en/default-lotus-config.toml +++ b/documentation/en/default-lotus-config.toml @@ -128,30 +128,6 @@ #TracerSourceAuth = "" -[Client] - # The maximum number of simultaneous data transfers between the client - # and storage providers for storage deals - # - # type: uint64 - # env var: LOTUS_CLIENT_SIMULTANEOUSTRANSFERSFORSTORAGE - #SimultaneousTransfersForStorage = 20 - - # The maximum number of simultaneous data transfers between the client - # and storage providers for retrieval deals - # - # type: uint64 - # env var: LOTUS_CLIENT_SIMULTANEOUSTRANSFERSFORRETRIEVAL - #SimultaneousTransfersForRetrieval = 20 - - # Require that retrievals perform no on-chain operations. Paid retrievals - # without existing payment channels with available funds will fail instead - # of automatically performing on-chain operations. - # - # type: bool - # env var: LOTUS_CLIENT_OFFCHAINRETRIEVAL - #OffChainRetrieval = false - - [Wallet] # type: string # env var: LOTUS_WALLET_REMOTEBACKEND diff --git a/documentation/en/default-lotus-miner-config.toml b/documentation/en/default-lotus-miner-config.toml index 17fd24fa370..b2daae0d4f7 100644 --- a/documentation/en/default-lotus-miner-config.toml +++ b/documentation/en/default-lotus-miner-config.toml @@ -1,3 +1,8 @@ +# type: bool +# env var: LOTUS__ENABLELIBP2P +#EnableLibp2p = false + + [API] # Binding address for the Lotus API # @@ -141,10 +146,6 @@ # env var: LOTUS_SUBSYSTEMS_ENABLESECTORSTORAGE #EnableSectorStorage = true - # type: bool - # env var: LOTUS_SUBSYSTEMS_ENABLEMARKETS - #EnableMarkets = false - # When enabled, the sector index will reside in an external database # as opposed to the local KV store in the miner process # This is useful to allow workers to bypass the lotus miner to access sector information @@ -188,190 +189,12 @@ [Dealmaking] - # When enabled, the miner can accept online deals - # - # type: bool - # env var: LOTUS_DEALMAKING_CONSIDERONLINESTORAGEDEALS - #ConsiderOnlineStorageDeals = true - - # When enabled, the miner can accept offline deals - # - # type: bool - # env var: LOTUS_DEALMAKING_CONSIDEROFFLINESTORAGEDEALS - #ConsiderOfflineStorageDeals = true - - # When enabled, the miner can accept retrieval deals - # - # type: bool - # env var: LOTUS_DEALMAKING_CONSIDERONLINERETRIEVALDEALS - #ConsiderOnlineRetrievalDeals = true - - # When enabled, the miner can accept offline retrieval deals - # - # type: bool - # env var: LOTUS_DEALMAKING_CONSIDEROFFLINERETRIEVALDEALS - #ConsiderOfflineRetrievalDeals = true - - # When enabled, the miner can accept verified deals - # - # type: bool - # env var: LOTUS_DEALMAKING_CONSIDERVERIFIEDSTORAGEDEALS - #ConsiderVerifiedStorageDeals = true - - # When enabled, the miner can accept unverified deals - # - # type: bool - # env var: LOTUS_DEALMAKING_CONSIDERUNVERIFIEDSTORAGEDEALS - #ConsiderUnverifiedStorageDeals = true - - # A list of Data CIDs to reject when making deals - # - # type: []cid.Cid - # env var: LOTUS_DEALMAKING_PIECECIDBLOCKLIST - #PieceCidBlocklist = [] - - # Maximum expected amount of time getting the deal into a sealed sector will take - # This includes the time the deal will need to get transferred and published - # before being assigned to a sector - # - # type: Duration - # env var: LOTUS_DEALMAKING_EXPECTEDSEALDURATION - #ExpectedSealDuration = "24h0m0s" - - # Maximum amount of time proposed deal StartEpoch can be in future - # - # type: Duration - # env var: LOTUS_DEALMAKING_MAXDEALSTARTDELAY - #MaxDealStartDelay = "336h0m0s" - - # When a deal is ready to publish, the amount of time to wait for more - # deals to be ready to publish before publishing them all as a batch - # - # type: Duration - # env var: LOTUS_DEALMAKING_PUBLISHMSGPERIOD - #PublishMsgPeriod = "1h0m0s" - - # The maximum number of deals to include in a single PublishStorageDeals - # message - # - # type: uint64 - # env var: LOTUS_DEALMAKING_MAXDEALSPERPUBLISHMSG - #MaxDealsPerPublishMsg = 8 - - # The maximum collateral that the provider will put up against a deal, - # as a multiplier of the minimum collateral bound - # - # type: uint64 - # env var: LOTUS_DEALMAKING_MAXPROVIDERCOLLATERALMULTIPLIER - #MaxProviderCollateralMultiplier = 2 - - # The maximum allowed disk usage size in bytes of staging deals not yet - # passed to the sealing node by the markets service. 0 is unlimited. - # - # type: int64 - # env var: LOTUS_DEALMAKING_MAXSTAGINGDEALSBYTES - #MaxStagingDealsBytes = 0 - - # The maximum number of parallel online data transfers for storage deals - # - # type: uint64 - # env var: LOTUS_DEALMAKING_SIMULTANEOUSTRANSFERSFORSTORAGE - #SimultaneousTransfersForStorage = 20 - - # The maximum number of simultaneous data transfers from any single client - # for storage deals. - # Unset by default (0), and values higher than SimultaneousTransfersForStorage - # will have no effect; i.e. the total number of simultaneous data transfers - # across all storage clients is bound by SimultaneousTransfersForStorage - # regardless of this number. - # - # type: uint64 - # env var: LOTUS_DEALMAKING_SIMULTANEOUSTRANSFERSFORSTORAGEPERCLIENT - #SimultaneousTransfersForStoragePerClient = 0 - - # The maximum number of parallel online data transfers for retrieval deals - # - # type: uint64 - # env var: LOTUS_DEALMAKING_SIMULTANEOUSTRANSFERSFORRETRIEVAL - #SimultaneousTransfersForRetrieval = 20 - # Minimum start epoch buffer to give time for sealing of sector with deal. # # type: uint64 # env var: LOTUS_DEALMAKING_STARTEPOCHSEALINGBUFFER #StartEpochSealingBuffer = 480 - # A command used for fine-grained evaluation of storage deals - # see https://lotus.filecoin.io/storage-providers/advanced-configurations/market/#using-filters-for-fine-grained-storage-and-retrieval-deal-acceptance for more details - # - # type: string - # env var: LOTUS_DEALMAKING_FILTER - #Filter = "" - - # A command used for fine-grained evaluation of retrieval deals - # see https://lotus.filecoin.io/storage-providers/advanced-configurations/market/#using-filters-for-fine-grained-storage-and-retrieval-deal-acceptance for more details - # - # type: string - # env var: LOTUS_DEALMAKING_RETRIEVALFILTER - #RetrievalFilter = "" - - [Dealmaking.RetrievalPricing] - # env var: LOTUS_DEALMAKING_RETRIEVALPRICING_STRATEGY - #Strategy = "default" - - [Dealmaking.RetrievalPricing.Default] - # env var: LOTUS_DEALMAKING_RETRIEVALPRICING_DEFAULT_VERIFIEDDEALSFREETRANSFER - #VerifiedDealsFreeTransfer = true - - [Dealmaking.RetrievalPricing.External] - # env var: LOTUS_DEALMAKING_RETRIEVALPRICING_EXTERNAL_PATH - #Path = "" - - -[IndexProvider] - # Enable set whether to enable indexing announcement to the network and expose endpoints that - # allow indexer nodes to process announcements. Enabled by default. - # - # type: bool - # env var: LOTUS_INDEXPROVIDER_ENABLE - #Enable = true - - # EntriesCacheCapacity sets the maximum capacity to use for caching the indexing advertisement - # entries. Defaults to 1024 if not specified. The cache is evicted using LRU policy. The - # maximum storage used by the cache is a factor of EntriesCacheCapacity, EntriesChunkSize and - # the length of multihashes being advertised. For example, advertising 128-bit long multihashes - # with the default EntriesCacheCapacity, and EntriesChunkSize means the cache size can grow to - # 256MiB when full. - # - # type: int - # env var: LOTUS_INDEXPROVIDER_ENTRIESCACHECAPACITY - #EntriesCacheCapacity = 1024 - - # EntriesChunkSize sets the maximum number of multihashes to include in a single entries chunk. - # Defaults to 16384 if not specified. Note that chunks are chained together for indexing - # advertisements that include more multihashes than the configured EntriesChunkSize. - # - # type: int - # env var: LOTUS_INDEXPROVIDER_ENTRIESCHUNKSIZE - #EntriesChunkSize = 16384 - - # TopicName sets the topic name on which the changes to the advertised content are announced. - # If not explicitly specified, the topic name is automatically inferred from the network name - # in following format: '/indexer/ingest/' - # Defaults to empty, which implies the topic name is inferred from network name. - # - # type: string - # env var: LOTUS_INDEXPROVIDER_TOPICNAME - #TopicName = "" - - # PurgeCacheOnStart sets whether to clear any cached entries chunks when the provider engine - # starts. By default, the cache is rehydrated from previously cached entries stored in - # datastore if any is present. - # - # type: bool - # env var: LOTUS_INDEXPROVIDER_PURGECACHEONSTART - #PurgeCacheOnStart = false - [Proving] # Maximum number of sector checks to run in parallel. (0 = unlimited) @@ -896,63 +719,6 @@ #DisableWorkerFallback = false -[DAGStore] - # Path to the dagstore root directory. This directory contains three - # subdirectories, which can be symlinked to alternative locations if - # need be: - # - ./transients: caches unsealed deals that have been fetched from the - # storage subsystem for serving retrievals. - # - ./indices: stores shard indices. - # - ./datastore: holds the KV store tracking the state of every shard - # known to the DAG store. - # Default value: /dagstore (split deployment) or - # /dagstore (monolith deployment) - # - # type: string - # env var: LOTUS_DAGSTORE_ROOTDIR - #RootDir = "" - - # The maximum amount of indexing jobs that can run simultaneously. - # 0 means unlimited. - # Default value: 5. - # - # type: int - # env var: LOTUS_DAGSTORE_MAXCONCURRENTINDEX - #MaxConcurrentIndex = 5 - - # The maximum amount of unsealed deals that can be fetched simultaneously - # from the storage subsystem. 0 means unlimited. - # Default value: 0 (unlimited). - # - # type: int - # env var: LOTUS_DAGSTORE_MAXCONCURRENTREADYFETCHES - #MaxConcurrentReadyFetches = 0 - - # The maximum amount of unseals that can be processed simultaneously - # from the storage subsystem. 0 means unlimited. - # Default value: 0 (unlimited). - # - # type: int - # env var: LOTUS_DAGSTORE_MAXCONCURRENTUNSEALS - #MaxConcurrentUnseals = 5 - - # The maximum number of simultaneous inflight API calls to the storage - # subsystem. - # Default value: 100. - # - # type: int - # env var: LOTUS_DAGSTORE_MAXCONCURRENCYSTORAGECALLS - #MaxConcurrencyStorageCalls = 100 - - # The time between calls to periodic dagstore GC, in time.Duration string - # representation, e.g. 1m, 5m, 1h. - # Default value: 1 minute. - # - # type: Duration - # env var: LOTUS_DAGSTORE_GCINTERVAL - #GCInterval = "1m0s" - - [HarmonyDB] # HOSTS is a list of hostnames to nodes running YugabyteDB # in a cluster. Only 1 is required diff --git a/extern/filecoin-ffi b/extern/filecoin-ffi deleted file mode 160000 index 081367cae7c..00000000000 --- a/extern/filecoin-ffi +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 081367cae7cdfe87d8b7240a9c3767ce86a40b05 diff --git a/extern/filecoin-ffi b/extern/filecoin-ffi new file mode 120000 index 00000000000..8e87f0735b7 --- /dev/null +++ b/extern/filecoin-ffi @@ -0,0 +1 @@ +../../filecoin-ffi/ \ No newline at end of file diff --git a/go.mod b/go.mod index 3588b8483ef..b3340b935cc 100644 --- a/go.mod +++ b/go.mod @@ -16,7 +16,6 @@ require ( github.com/Kubuxu/imtui v0.0.0-20210401140320-41663d68d0fa github.com/acarl005/stripansi v0.0.0-20180116102854-5a71ef0e047d github.com/alecthomas/jsonschema v0.0.0-20200530073317-71f438968921 - github.com/buger/goterm v1.0.3 github.com/charmbracelet/lipgloss v0.10.0 github.com/chzyer/readline v1.5.1 github.com/codeskyblue/go-sh v0.0.0-20200712050446-30169cf553fe @@ -33,7 +32,6 @@ require ( github.com/elastic/gosigar v0.14.2 github.com/etclabscore/go-openrpc-reflect v0.0.36 github.com/fatih/color v1.15.0 - github.com/filecoin-project/dagstore v0.5.2 github.com/filecoin-project/filecoin-ffi v0.30.4-0.20220519234331-bfd1f5f9fe38 github.com/filecoin-project/go-address v1.1.0 github.com/filecoin-project/go-amt-ipld/v4 v4.3.0 @@ -42,15 +40,13 @@ require ( github.com/filecoin-project/go-commp-utils v0.1.3 github.com/filecoin-project/go-commp-utils/nonffi v0.0.0-20220905160352-62059082a837 github.com/filecoin-project/go-crypto v0.0.1 - github.com/filecoin-project/go-data-transfer/v2 v2.0.0-rc8 github.com/filecoin-project/go-fil-commcid v0.1.0 github.com/filecoin-project/go-fil-commp-hashhash v0.1.0 - github.com/filecoin-project/go-fil-markets v1.28.3 github.com/filecoin-project/go-hamt-ipld/v3 v3.1.0 github.com/filecoin-project/go-jsonrpc v0.3.2 github.com/filecoin-project/go-padreader v0.0.1 github.com/filecoin-project/go-paramfetch v0.0.4 - github.com/filecoin-project/go-state-types v0.14.0-dev + github.com/filecoin-project/go-state-types v0.14.0-dev.0.20240529052523-2d27210dc3cd github.com/filecoin-project/go-statemachine v1.0.3 github.com/filecoin-project/go-statestore v0.2.0 github.com/filecoin-project/go-storedcounter v0.1.0 @@ -92,21 +88,16 @@ require ( github.com/ipfs/go-ds-leveldb v0.5.0 github.com/ipfs/go-ds-measure v0.2.0 github.com/ipfs/go-fs-lock v0.0.7 - github.com/ipfs/go-graphsync v0.17.0 - github.com/ipfs/go-ipfs-blocksutil v0.0.1 github.com/ipfs/go-ipld-cbor v0.1.0 github.com/ipfs/go-ipld-format v0.6.0 github.com/ipfs/go-log/v2 v2.5.1 github.com/ipfs/go-metrics-interface v0.0.1 github.com/ipfs/go-metrics-prometheus v0.0.2 - github.com/ipfs/go-unixfsnode v1.9.0 github.com/ipld/go-car v0.6.1 github.com/ipld/go-car/v2 v2.13.1 - github.com/ipld/go-codec-dagpb v1.6.0 github.com/ipld/go-ipld-prime v0.21.0 github.com/ipld/go-ipld-selector-text-lite v0.0.1 github.com/ipni/go-libipni v0.0.8 - github.com/ipni/index-provider v0.12.0 github.com/jackc/pgerrcode v0.0.0-20220416144525-469b46aa5efa github.com/kelseyhightower/envconfig v1.4.0 github.com/koalacxr/quantile v0.0.1 @@ -127,7 +118,6 @@ require ( github.com/multiformats/go-base32 v0.1.0 github.com/multiformats/go-multiaddr v0.12.3 github.com/multiformats/go-multiaddr-dns v0.3.1 - github.com/multiformats/go-multibase v0.2.0 github.com/multiformats/go-multicodec v0.9.0 github.com/multiformats/go-multihash v0.2.3 github.com/multiformats/go-varint v0.0.7 @@ -181,12 +171,10 @@ require ( github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect github.com/StackExchange/wmi v1.2.1 // indirect github.com/akavel/rsrc v0.8.0 // indirect - github.com/alecthomas/units v0.0.0-20231202071711-9a357b53e9c9 // indirect github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect github.com/bahlo/generic-list-go v0.2.0 // indirect github.com/benbjohnson/clock v1.3.5 // indirect github.com/beorn7/perks v1.0.1 // indirect - github.com/bep/debounce v1.2.1 // indirect github.com/buger/jsonparser v1.1.1 // indirect github.com/cespare/xxhash v1.1.0 // indirect github.com/cespare/xxhash/v2 v2.2.0 // indirect @@ -206,7 +194,6 @@ require ( github.com/etclabscore/go-jsonschema-walk v0.0.6 // indirect github.com/filecoin-project/go-amt-ipld/v2 v2.1.0 // indirect github.com/filecoin-project/go-amt-ipld/v3 v3.1.0 // indirect - github.com/filecoin-project/go-ds-versioning v0.1.2 // indirect github.com/filecoin-project/go-hamt-ipld v0.1.5 // indirect github.com/filecoin-project/go-hamt-ipld/v2 v2.0.0 // indirect github.com/flynn/noise v1.1.0 // indirect @@ -229,12 +216,11 @@ require ( github.com/golang/snappy v0.0.4 // indirect github.com/google/gopacket v1.1.19 // indirect github.com/google/pprof v0.0.0-20240207164012-fb44976bdcd5 // indirect - github.com/hannahhoward/cbor-gen-for v0.0.0-20230214144701-5d17c9d5243c // indirect + github.com/gopherjs/gopherjs v1.17.2 // indirect github.com/hashicorp/errwrap v1.1.0 // indirect github.com/hashicorp/golang-lru v1.0.2 // indirect github.com/huin/goupnp v1.3.0 // indirect github.com/iancoleman/orderedmap v0.1.0 // indirect - github.com/ipfs/go-bitfield v1.1.0 // indirect github.com/ipfs/go-blockservice v0.5.1 // indirect github.com/ipfs/go-ipfs-blockstore v1.3.0 // indirect github.com/ipfs/go-ipfs-delay v0.0.1 // indirect @@ -243,25 +229,22 @@ require ( github.com/ipfs/go-ipfs-pq v0.0.3 // indirect github.com/ipfs/go-ipfs-util v0.0.3 // indirect github.com/ipfs/go-ipld-legacy v0.2.1 // indirect - github.com/ipfs/go-libipfs v0.7.0 // indirect github.com/ipfs/go-log v1.0.5 // indirect github.com/ipfs/go-merkledag v0.11.0 // indirect github.com/ipfs/go-peertaskqueue v0.8.1 // indirect github.com/ipfs/go-verifcid v0.0.2 // indirect - github.com/ipld/go-ipld-adl-hamt v0.0.0-20220616142416-9004dbd839e0 // indirect + github.com/ipld/go-codec-dagpb v1.6.0 // indirect github.com/ipsn/go-secp256k1 v0.0.0-20180726113642-9d62b9f0bc52 // indirect github.com/jackc/pgpassfile v1.0.0 // indirect github.com/jackc/pgservicefile v0.0.0-20231201235250-de7065d80cb9 // indirect github.com/jackc/pgx/v5 v5.4.1 // indirect github.com/jackc/puddle/v2 v2.2.1 // indirect github.com/jackpal/go-nat-pmp v1.0.2 // indirect - github.com/jbenet/go-random v0.0.0-20190219211222-123a90aedc0c // indirect github.com/jbenet/go-temp-err-catcher v0.1.0 // indirect github.com/jbenet/goprocess v0.1.4 // indirect github.com/jessevdk/go-flags v1.4.0 // indirect github.com/joeshaw/multierror v0.0.0-20140124173710-69b34d4ec901 // indirect github.com/josharian/intern v1.0.0 // indirect - github.com/jpillora/backoff v1.0.0 // indirect github.com/kilic/bls12-381 v0.1.0 // indirect github.com/klauspost/compress v1.17.6 // indirect github.com/klauspost/cpuid/v2 v2.2.7 // indirect @@ -269,7 +252,6 @@ require ( github.com/libp2p/go-cidranger v1.1.0 // indirect github.com/libp2p/go-flow-metrics v0.1.0 // indirect github.com/libp2p/go-libp2p-asn-util v0.4.1 // indirect - github.com/libp2p/go-libp2p-gostream v0.6.0 // indirect github.com/libp2p/go-libp2p-kbucket v0.6.3 // indirect github.com/libp2p/go-nat v0.2.0 // indirect github.com/libp2p/go-netroute v0.2.1 // indirect @@ -289,6 +271,7 @@ require ( github.com/muesli/termenv v0.15.2 // indirect github.com/multiformats/go-base36 v0.2.0 // indirect github.com/multiformats/go-multiaddr-fmt v0.1.0 // indirect + github.com/multiformats/go-multibase v0.2.0 // indirect github.com/multiformats/go-multistream v0.5.0 // indirect github.com/nikkolasg/hexjson v0.1.0 // indirect github.com/nkovacs/streamquote v1.0.0 // indirect @@ -311,7 +294,6 @@ require ( github.com/sirupsen/logrus v1.9.2 // indirect github.com/spaolacci/murmur3 v1.1.0 // indirect github.com/tidwall/gjson v1.14.4 // indirect - github.com/twmb/murmur3 v1.1.6 // indirect github.com/valyala/bytebufferpool v1.0.0 // indirect github.com/valyala/fasttemplate v1.0.1 // indirect github.com/whyrusleeping/cbor v0.0.0-20171005072247-63513f603b11 // indirect diff --git a/go.sum b/go.sum index b836d44a3e5..04542b45b9e 100644 --- a/go.sum +++ b/go.sum @@ -36,13 +36,11 @@ contrib.go.opencensus.io/exporter/prometheus v0.4.2 h1:sqfsYl5GIY/L570iT+l93ehxa contrib.go.opencensus.io/exporter/prometheus v0.4.2/go.mod h1:dvEHbiKmgvbr5pjaF9fpw1KeYcjrnC1J8B+JKjsZyRQ= dmitri.shuralyov.com/app/changes v0.0.0-20180602232624-0a106ad413e3/go.mod h1:Yl+fi1br7+Rr3LqpNJf1/uxUdtRUV+Tnj0o93V2B9MU= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= -dmitri.shuralyov.com/gpu/mtl v0.0.0-20201218220906-28db891af037/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= dmitri.shuralyov.com/html/belt v0.0.0-20180602232347-f7d459c86be0/go.mod h1:JLBrvjyP0v+ecvNYvCpyZgu5/xkfAUhi6wJj28eUfSU= dmitri.shuralyov.com/service/change v0.0.0-20181023043359-a85b471d5412/go.mod h1:a1inKt/atXimZ4Mv927x+r7UpyzRUf4emIoiiSC2TN4= dmitri.shuralyov.com/state v0.0.0-20180228185332-28bcc343414c/go.mod h1:0PRwlb0D6DFvNNtx+9ybjezNCa8XF0xaYcETyp6rHWU= git.apache.org/thrift.git v0.0.0-20180902110319-2566ecd5d999/go.mod h1:fPE2ZNJGynbRyZ4dJvy6G277gSllfV2HJqblrnkyeyg= github.com/AndreasBriese/bbloom v0.0.0-20180913140656-343706a395b7/go.mod h1:bOvUY6CB00SOBii9/FifXqc0awNKxLFCL/+pkDPuyl8= -github.com/AndreasBriese/bbloom v0.0.0-20190306092124-e2d15f34fcf9/go.mod h1:bOvUY6CB00SOBii9/FifXqc0awNKxLFCL/+pkDPuyl8= github.com/AndreasBriese/bbloom v0.0.0-20190825152654-46b345b51c96 h1:cTp8I5+VIoKjsnZuH8vjyaysT/ses3EvZeaV/1UkF2M= github.com/AndreasBriese/bbloom v0.0.0-20190825152654-46b345b51c96/go.mod h1:bOvUY6CB00SOBii9/FifXqc0awNKxLFCL/+pkDPuyl8= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= @@ -60,7 +58,6 @@ github.com/Gurpartap/async v0.0.0-20180927173644-4f7f499dd9ee h1:8doiS7ib3zi6/K1 github.com/Gurpartap/async v0.0.0-20180927173644-4f7f499dd9ee/go.mod h1:W0GbEAA4uFNYOGG2cJpmFJ04E6SD1NLELPYZB57/7AY= github.com/Jorropo/jsync v1.0.1 h1:6HgRolFZnsdfzRUj+ImB9og1JYOxQoReSywkHOGSaUU= github.com/Jorropo/jsync v1.0.1/go.mod h1:jCOZj3vrBCri3bSU3ErUYvevKlnbssrXeCivybS5ABQ= -github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= github.com/Kubuxu/go-os-helper v0.0.1/go.mod h1:N8B+I7vPCT80IcP58r50u4+gEEcsZETFUpAzWW2ep1Y= github.com/Kubuxu/imtui v0.0.0-20210401140320-41663d68d0fa h1:1PPxEyGdIGVkX/kqMvLJ95a1dGS1Sz7tpNEgehEYYt0= github.com/Kubuxu/imtui v0.0.0-20210401140320-41663d68d0fa/go.mod h1:WUmMvh9wMtqj1Xhf1hf3kp9RvL+y6odtdYxpyZjb90U= @@ -73,17 +70,13 @@ github.com/PuerkitoBio/purell v1.1.1 h1:WEQqlqaGbrPkxLJWfBwQmfEAE1Z7ONdDLqrN38tN github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV/sSk/8dngufqelfh6jnri85riMAaF/M= github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= -github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= -github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= github.com/StackExchange/wmi v1.2.1 h1:VIkavFPXSjcnS+O8yTq7NI32k0R5Aj+v39y29VYDOSA= github.com/StackExchange/wmi v1.2.1/go.mod h1:rcmrprowKIVzvc+NUiLncP2uuArMWLCbu9SBzvHz7e8= github.com/Stebalien/go-bitfield v0.0.1/go.mod h1:GNjFpasyUVkHMsfEOk8EFLJ9syQ6SI+XWrX9Wf2XH0s= -github.com/VividCortex/gohistogram v1.0.0/go.mod h1:Pf5mBqqDxYaXu3hDrrU+w6nw50o/4+TcAqDqk/vUH7g= github.com/acarl005/stripansi v0.0.0-20180116102854-5a71ef0e047d h1:licZJFw2RwpHMqeKTCYkitsPqHNxTmd4SNR5r94FGM8= github.com/acarl005/stripansi v0.0.0-20180116102854-5a71ef0e047d/go.mod h1:asat636LX7Bqt5lYEZ27JNDcqxfjdBQuJ/MM4CN/Lzo= github.com/aead/siphash v1.0.1 h1:FwHfE/T45KPKYuuSAKyyvE+oPWcaQ+CUmFW0bPlM+kg= github.com/aead/siphash v1.0.1/go.mod h1:Nywa3cDsYNNK3gaciGTWPwHt0wlpNV15vwmswBAUSII= -github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5/go.mod h1:SkGFH1ia65gfNATL8TAiHDNxPzPdmEL5uirI2Uyuz6c= github.com/akavel/rsrc v0.8.0 h1:zjWn7ukO9Kc5Q62DOJCcxGpXC18RawVtYAGdz2aLlfw= github.com/akavel/rsrc v0.8.0/go.mod h1:uLoCtb9J+EyAqh+26kdrTgmzRBFPGOolLWKpdxkKq+c= github.com/alecthomas/jsonschema v0.0.0-20200530073317-71f438968921 h1:T3+cD5fYvuH36h7EZq+TDpm+d8a6FSD4pQsbmuGGQ8o= @@ -97,18 +90,9 @@ github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137/go.mod h1:OMCwj8V github.com/alecthomas/units v0.0.0-20231202071711-9a357b53e9c9 h1:ez/4by2iGztzR4L0zgAOR8lTQK9VlyBVVd7G4omaOQs= github.com/alecthomas/units v0.0.0-20231202071711-9a357b53e9c9/go.mod h1:OMCwj8VM1Kc9e19TLln2VL61YJF0x1XFtfdL4JdbSyE= github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYUyUczH0OGQWaF5ceTx0UBShxjsH6f8oGKYe2c= -github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= -github.com/apache/thrift v0.13.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= github.com/ardanlabs/darwin/v2 v2.0.0 h1:XCisQMgQ5EG+ZvSEcADEo+pyfIMKyWAGnn5o2TgriYE= github.com/ardanlabs/darwin/v2 v2.0.0/go.mod h1:MubZ2e9DAYGaym0mClSOi183NYahrrfKxvSy1HMhoes= -github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= -github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= -github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= -github.com/aryann/difflib v0.0.0-20170710044230-e206f873d14a/go.mod h1:DAHtR1m6lCRdSC2Tm3DSWRPvIPr6xNKyeHdqDQSQT+A= -github.com/aws/aws-lambda-go v1.13.3/go.mod h1:4UKl9IzQMoD+QF79YdCuzCwp8VbmG4VAQwij/eHl5CU= -github.com/aws/aws-sdk-go v1.27.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= -github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g= github.com/aymanbagabas/go-osc52/v2 v2.0.1 h1:HwpRHbFMcZLEVr42D4p7XBqjyuxQH5SMiErDT4WkJ2k= github.com/aymanbagabas/go-osc52/v2 v2.0.1/go.mod h1:uYgXzlJ7ZpABp8OJ+exZzJJhRNQ2ASbcXHWsFqH8hp8= github.com/bahlo/generic-list-go v0.2.0 h1:5sz/EEAK+ls5wF+NeqDpk5+iNdMDXrh3z3nPnH1Wvgk= @@ -121,16 +105,10 @@ github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24 github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= -github.com/bep/debounce v1.2.1 h1:v67fRdBA9UQu2NhLFXrSg0Brw7CexQekrBwDMM8bzeY= -github.com/bep/debounce v1.2.1/go.mod h1:H8yggRPQKLUhUoqrJC1bO2xNya7vanpDl7xR3ISbCJ0= -github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= github.com/bradfitz/go-smtpd v0.0.0-20170404230938-deb6d6237625/go.mod h1:HYsPBTaaSFSlLx/70C2HPIMNZpVV8+vt/A+FMnYP11g= github.com/btcsuite/btcd v0.0.0-20190213025234-306aecffea32/go.mod h1:DrZx5ec/dmnfpw9KyYoQyYo7d0KEvTkk/5M/vbZjAr8= github.com/btcsuite/btcd v0.0.0-20190523000118-16327141da8c/go.mod h1:3J08xEfcugPacsc34/LKRU2yO7YmuT8yt28J8k2+rrI= github.com/btcsuite/btcd v0.0.0-20190605094302-a0d1e3e36d50/go.mod h1:3J08xEfcugPacsc34/LKRU2yO7YmuT8yt28J8k2+rrI= -github.com/btcsuite/btcd v0.0.0-20190824003749-130ea5bddde3/go.mod h1:3J08xEfcugPacsc34/LKRU2yO7YmuT8yt28J8k2+rrI= -github.com/btcsuite/btcd v0.20.1-beta/go.mod h1:wVuoA8VJLEcwgqHBwHmzLRazpKxTv13Px/pDuV7OomQ= -github.com/btcsuite/btcd v0.21.0-beta/go.mod h1:ZSWyehm27aAuS9bvkATT+Xte3hjHZ+MRgMY/8NJ7K94= github.com/btcsuite/btcd v0.24.0 h1:gL3uHE/IaFj6fcZSu03SvqPMSx7s/dPzfpG/atRwWdo= github.com/btcsuite/btcd v0.24.0/go.mod h1:K4IDc1593s8jKXIF7yS7yCTSxrknB9z0STzc2j6XgE4= github.com/btcsuite/btcd/btcec/v2 v2.1.3 h1:xM/n3yIhHAhHy04z4i43C8p4ehixJZMsnrVJkgl+MTE= @@ -143,24 +121,17 @@ github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f h1:bAs4lUbRJpnnkd9 github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f/go.mod h1:TdznJufoqS23FtqVCzL0ZqgP5MqXbb4fg/WgDys70nA= github.com/btcsuite/btcutil v0.0.0-20190207003914-4c204d697803/go.mod h1:+5NJ2+qvTyV9exUAL/rxXi3DcLg2Ts+ymUAY5y4NvMg= github.com/btcsuite/btcutil v0.0.0-20190425235716-9e5f4b9a998d/go.mod h1:+5NJ2+qvTyV9exUAL/rxXi3DcLg2Ts+ymUAY5y4NvMg= -github.com/btcsuite/btcutil v1.0.2/go.mod h1:j9HUFwoQRsZL3V4n+qG+CUnEGHOarIxfC3Le2Yhbcts= github.com/btcsuite/go-socks v0.0.0-20170105172521-4720035b7bfd h1:R/opQEbFEy9JGkIguV40SvRY1uliPX8ifOvi6ICsFCw= github.com/btcsuite/go-socks v0.0.0-20170105172521-4720035b7bfd/go.mod h1:HHNXQzUsZCxOoE+CPiyCTO6x34Zs86zZUiwtpXoGdtg= github.com/btcsuite/goleveldb v0.0.0-20160330041536-7834afc9e8cd/go.mod h1:F+uVaaLLH7j4eDXPRvw78tMflu7Ie2bzYOH4Y8rRKBY= -github.com/btcsuite/goleveldb v1.0.0/go.mod h1:QiK9vBlgftBg6rWQIj6wFzbPfRjiykIEhBH4obrXJ/I= github.com/btcsuite/snappy-go v0.0.0-20151229074030-0bdef8d06723/go.mod h1:8woku9dyThutzjeg+3xrA5iCpBRH8XEEg3lh6TiUghc= -github.com/btcsuite/snappy-go v1.0.0/go.mod h1:8woku9dyThutzjeg+3xrA5iCpBRH8XEEg3lh6TiUghc= github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792 h1:R8vQdOQdZ9Y3SkEwmHoWBmX1DNXhXZqlTpq6s4tyJGc= github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792/go.mod h1:ghJtEyQwv5/p4Mg4C0fgbePVuGr935/5ddU9Z3TmDRY= github.com/btcsuite/winsvc v1.0.0 h1:J9B4L7e3oqhXOcm+2IuNApwzQec85lE+QaikUcCs+dk= github.com/btcsuite/winsvc v1.0.0/go.mod h1:jsenWakMcC0zFBFurPLEAyrnc/teJEM1O46fmI40EZs= -github.com/buger/goterm v1.0.3 h1:7V/HeAQHrzPk/U4BvyH2g9u+xbUW9nr4yRPyG59W4fM= -github.com/buger/goterm v1.0.3/go.mod h1:HiFWV3xnkolgrBV3mY8m0X0Pumt4zg4QhbdOzQtB8tE= github.com/buger/jsonparser v0.0.0-20181115193947-bf1c66bbce23/go.mod h1:bbYlZJ7hK1yFx9hf58LP0zeX7UjIGs20ufpu3evjr+s= github.com/buger/jsonparser v1.1.1 h1:2PnMjfWD7wBILjqQbt530v576A/cAbQvEW9gGIpYMUs= github.com/buger/jsonparser v1.1.1/go.mod h1:6RYKKt7H4d4+iWqouImQ9R2FZql3VbhNgx27UK13J/0= -github.com/casbin/casbin/v2 v2.1.2/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n9yuLkIJQ= -github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= @@ -170,7 +141,6 @@ github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/charmbracelet/lipgloss v0.10.0 h1:KWeXFSexGcfahHX+54URiZGkBFazf70JNMtwg/AFW3s= github.com/charmbracelet/lipgloss v0.10.0/go.mod h1:Wig9DSfvANsxqkRsqj6x87irdy123SR4dOXlKa91ciE= -github.com/cheekybits/genny v1.0.0/go.mod h1:+tQajlRqAUrPI7DOSpB0XAqZYtQakVtB7wXkRAgjxjQ= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/logex v1.2.1 h1:XHDu3E6q+gdHgsdTPH6ImJMIp436vR6MPtH8gP05QzM= github.com/chzyer/logex v1.2.1/go.mod h1:JLbx6lG2kDbNRFnfkgvh4eRJRPX1QCoOIWomwysCBrQ= @@ -183,13 +153,10 @@ github.com/chzyer/test v1.0.0/go.mod h1:2JlltgoNkt4TW/z9V/IzDdFaMTM2JPIi26O1pF38 github.com/cilium/ebpf v0.2.0/go.mod h1:To2CFviqOWL/M0gIMsvSMlqe7em/l1ALkX1PyjrX2Qs= github.com/cilium/ebpf v0.9.1 h1:64sn2K3UKw8NbP/blsixRpF3nXuyhz/VjRlRzvlBRu4= github.com/cilium/ebpf v0.9.1/go.mod h1:+OhNOIXx/Fnu1IE8bJz2dzOA+VSfyTfdNUVdlQnxUFY= -github.com/clbanning/x2j v0.0.0-20191024224557-825249438eec/go.mod h1:jMjuTZXRI4dUb/I5gc9Hdhagfvm9+RyrPryS/auMzxE= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cockroachdb/cockroach-go/v2 v2.2.0 h1:/5znzg5n373N/3ESjHF5SMLxiW4RKB05Ql//KWfeTFs= github.com/cockroachdb/cockroach-go/v2 v2.2.0/go.mod h1:u3MiKYGupPPjkn3ozknpMUpxPaNLTFWAya419/zv6eI= -github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= -github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= github.com/codegangsta/cli v1.20.0/go.mod h1:/qJNoX69yVSKu5o4jLyXAENLRyk1uhi7zkbQ3slBdOA= github.com/codegangsta/inject v0.0.0-20150114235600-33e0aa1cb7c0 h1:sDMmm+q/3+BukdIpxwO365v/Rbspp2Nt5XntgQRXq8Q= github.com/codegangsta/inject v0.0.0-20150114235600-33e0aa1cb7c0/go.mod h1:4Zcjuz89kmFXt9morQgcfYZAYZ5n8WHjt81YYWIwtTM= @@ -202,13 +169,10 @@ github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= -github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd v0.0.0-20181012123002-c6f51f82210d/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= -github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd/v22 v22.1.0/go.mod h1:xO0FLkIi5MaZafQlIrOotqXZ90ih+1atmu1JpKERPPk= github.com/coreos/go-systemd/v22 v22.5.0 h1:RrqgGjYQKalulkV8NGVIfkXQf6YYmOyiJKk8iXXhfZs= github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= -github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/corpix/uarand v0.1.1/go.mod h1:SFKZvkcRoLqVRFZ4u25xPmp6m9ktANfbpXZ7SJ0/FNU= github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= @@ -217,7 +181,6 @@ github.com/cpuguy83/go-md2man/v2 v2.0.2 h1:p1EgwI/C7NhT0JmVkwCD2ZBK8j4aeHQX2pMHH github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/crackcomm/go-gitignore v0.0.0-20231225121904-e25f5bc08668 h1:ZFUue+PNxmHlu7pYv+IYMtqlaO/0VwaGEqKepZf9JpA= github.com/crackcomm/go-gitignore v0.0.0-20231225121904-e25f5bc08668/go.mod h1:p1d6YEZWvFzEh4KLyvBcVSnrfNDDvK2zfK/4x2v/4pE= -github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/cskr/pubsub v1.0.2 h1:vlOzMhl6PFn60gRlTQQsIfVwaPB/B/8MziK8FhEPt/0= github.com/cskr/pubsub v1.0.2/go.mod h1:/8MzYXk/NJAz782G8RPkFzXTZVu63VotefPnR9TIRis= @@ -227,7 +190,6 @@ github.com/davecgh/go-spew v0.0.0-20171005155431-ecdeabc65495/go.mod h1:J7Y8YcW2 github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davidlazar/go-crypto v0.0.0-20170701192655-dcfb0a7ac018/go.mod h1:rQYf4tfk5sSwFsnDg3qYaBxSjsD9S8+59vW0dKUgme4= github.com/davidlazar/go-crypto v0.0.0-20200604182044-b73af7476f6c h1:pFUpOrbxDR6AkioZ1ySsx5yxlDQZ8stG2b88gTPxgJU= github.com/davidlazar/go-crypto v0.0.0-20200604182044-b73af7476f6c/go.mod h1:6UhI8N9EjYm1c2odKpFpAYeR8dsBeM7PtzQhRgxRr9U= github.com/decred/dcrd/crypto/blake256 v1.0.1 h1:7PltbUIQB7u/FfZ39+DGa/ShuMyJ5ilcvdfma9wOH6Y= @@ -239,19 +201,14 @@ github.com/decred/dcrd/lru v1.0.0/go.mod h1:mxKOwFd7lFjN2GZYsiz/ecgqR6kkYAl+0pz0 github.com/detailyang/go-fallocate v0.0.0-20180908115635-432fa640bd2e h1:lj77EKYUpYXTd8CD/+QMIf8b6OIOTsfEBSXiAzuEHTU= github.com/detailyang/go-fallocate v0.0.0-20180908115635-432fa640bd2e/go.mod h1:3ZQK6DMPSz/QZ73jlWxBtUhNA8xZx7LzUFSq/OfP8vk= github.com/dgraph-io/badger v1.5.5-0.20190226225317-8115aed38f8f/go.mod h1:VZxzAIRPHRVNRKRo6AXrX9BJegn6il06VMTZVJYCIjQ= -github.com/dgraph-io/badger v1.6.0-rc1/go.mod h1:zwt7syl517jmP8s94KqSxTlM6IMsdhYy6psNgSztDR4= -github.com/dgraph-io/badger v1.6.0/go.mod h1:zwt7syl517jmP8s94KqSxTlM6IMsdhYy6psNgSztDR4= -github.com/dgraph-io/badger v1.6.1/go.mod h1:FRmFw3uxvcpa8zG3Rxs0th+hCLIuaQg8HlNV5bjgnuU= github.com/dgraph-io/badger v1.6.2 h1:mNw0qs90GVgGGWylh0umH5iag1j6n/PeJtNvL6KY/x8= github.com/dgraph-io/badger v1.6.2/go.mod h1:JW2yswe3V058sS0kZ2h/AXeDSqFjxnZcRrVH//y2UQE= github.com/dgraph-io/badger/v2 v2.2007.3/go.mod h1:26P/7fbL4kUZVEVKLAKXkBXKOydDmM2p1e+NhhnBCAE= github.com/dgraph-io/badger/v2 v2.2007.4 h1:TRWBQg8UrlUhaFdco01nO2uXwzKS7zd+HVdwV/GHc4o= github.com/dgraph-io/badger/v2 v2.2007.4/go.mod h1:vSw/ax2qojzbN6eXHIx6KPKtCSHJN/Uz0X0VPruTIhk= -github.com/dgraph-io/ristretto v0.0.2/go.mod h1:KPxhHT9ZxKefz+PCeOGsrHpl1qZ7i70dGTu2u+Ahh6E= github.com/dgraph-io/ristretto v0.0.3-0.20200630154024-f66de99634de/go.mod h1:KPxhHT9ZxKefz+PCeOGsrHpl1qZ7i70dGTu2u+Ahh6E= github.com/dgraph-io/ristretto v0.1.1 h1:6CWw5tJNgpegArSHpNHJKldNeq03FQCwYvfMVWajOK8= github.com/dgraph-io/ristretto v0.1.1/go.mod h1:S1GPSBCYCIhmVNfcth17y2zZtQT6wzkzgwUve0VDWWA= -github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgryski/go-farm v0.0.0-20190104051053-3adb47b1fb0f/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 h1:fAjc9m62+UWV/WAFKLNi6ZS0675eEUC9y3AlwSbQu1Y= @@ -265,14 +222,9 @@ github.com/drand/kyber v1.2.0 h1:22SbBxsKbgQnJUoyYKIfG909PhBsj0vtANeu4BX5xgE= github.com/drand/kyber v1.2.0/go.mod h1:6TqFlCc7NGOiNVTF9pF2KcDRfllPd9XOkExuG5Xtwfo= github.com/drand/kyber-bls12381 v0.3.1 h1:KWb8l/zYTP5yrvKTgvhOrk2eNPscbMiUOIeWBnmUxGo= github.com/drand/kyber-bls12381 v0.3.1/go.mod h1:H4y9bLPu7KZA/1efDg+jtJ7emKx+ro3PU7/jWUVt140= -github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= -github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs= -github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU= -github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= -github.com/edsrzf/mmap-go v1.0.0/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M= github.com/elastic/go-elasticsearch/v7 v7.14.0 h1:extp3jos/rwJn3J+lgbaGlwAgs0TVsIHme00GyNAyX4= github.com/elastic/go-elasticsearch/v7 v7.14.0/go.mod h1:OJ4wdbtDNk5g503kvlHLyErCgQwwzmDtaFC4XyOxXA4= github.com/elastic/go-sysinfo v1.7.0 h1:4vVvcfi255+8+TyQ7TYUTEK3A+G8v5FLE+ZKYL1z1Dg= @@ -282,7 +234,6 @@ github.com/elastic/go-windows v1.0.0/go.mod h1:TsU0Nrp7/y3+VwE82FoZF8gC/XFg/Elz6 github.com/elastic/gosigar v0.12.0/go.mod h1:iXRIGg2tLnu7LBdpqzyQfGDEidKCfWcCMS0WKyPWoMs= github.com/elastic/gosigar v0.14.2 h1:Dg80n8cr90OZ7x+bAax/QjoW/XqTI11RmA79ZwIm9/4= github.com/elastic/gosigar v0.14.2/go.mod h1:iXRIGg2tLnu7LBdpqzyQfGDEidKCfWcCMS0WKyPWoMs= -github.com/envoyproxy/go-control-plane v0.6.9/go.mod h1:SBwIajubJHhxtWwsL9s8ss4safvEdbitLhGGK48rN6g= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= @@ -291,14 +242,11 @@ github.com/etclabscore/go-jsonschema-walk v0.0.6 h1:DrNzoKWKd8f8XB5nFGBY00IcjakR github.com/etclabscore/go-jsonschema-walk v0.0.6/go.mod h1:VdfDY72AFAiUhy0ZXEaWSpveGjMT5JcDIm903NGqFwQ= github.com/etclabscore/go-openrpc-reflect v0.0.36 h1:kSqNB2U8RVoW4si+4fsv13NGNkRAQ5j78zTUx1qiehk= github.com/etclabscore/go-openrpc-reflect v0.0.36/go.mod h1:0404Ky3igAasAOpyj1eESjstTyneBAIk5PgJFbK4s5E= -github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.8.0/go.mod h1:3l45GVGkyrnYNl9HoIjnp2NnNWvh6hLAqD8yTfGjnw8= github.com/fatih/color v1.15.0 h1:kOqh6YHBtK8aywxGerMG2Eq3H6Qgoqeo13Bk2Mv/nBs= github.com/fatih/color v1.15.0/go.mod h1:0h5ZqXfHYED7Bhv2ZJamyIOUej9KtShiJESRwBDUSsw= github.com/felixge/httpsnoop v1.0.3 h1:s/nj+GCswXYzN5v2DpNMuMQYe+0DDwt5WVCU6CWBdXk= github.com/felixge/httpsnoop v1.0.3/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= -github.com/filecoin-project/dagstore v0.5.2 h1:Nd6oXdnolbbVhpMpkYT5PJHOjQp4OBSntHpMV5pxj3c= -github.com/filecoin-project/dagstore v0.5.2/go.mod h1:mdqKzYrRBHf1pRMthYfMv3n37oOw0Tkx7+TxPt240M0= github.com/filecoin-project/go-address v0.0.3/go.mod h1:jr8JxKsYx+lQlQZmF5i2U0Z+cGQ59wMIps/8YW/lDj8= github.com/filecoin-project/go-address v0.0.5/go.mod h1:jr8JxKsYx+lQlQZmF5i2U0Z+cGQ59wMIps/8YW/lDj8= github.com/filecoin-project/go-address v1.1.0 h1:ofdtUtEsNxkIxkDw67ecSmvtzaVSdcea4boAmLbnHfE= @@ -326,17 +274,11 @@ github.com/filecoin-project/go-commp-utils/nonffi v0.0.0-20220905160352-62059082 github.com/filecoin-project/go-crypto v0.0.0-20191218222705-effae4ea9f03/go.mod h1:+viYnvGtUTgJRdy6oaeF4MTFKAfatX071MPDPBL11EQ= github.com/filecoin-project/go-crypto v0.0.1 h1:AcvpSGGCgjaY8y1az6AMfKQWreF/pWO2JJGLl6gCq6o= github.com/filecoin-project/go-crypto v0.0.1/go.mod h1:+viYnvGtUTgJRdy6oaeF4MTFKAfatX071MPDPBL11EQ= -github.com/filecoin-project/go-data-transfer/v2 v2.0.0-rc8 h1:EWC89lM/tJAjyzaxZ624clq3oyHLoLjISfoyG+WIu9s= -github.com/filecoin-project/go-data-transfer/v2 v2.0.0-rc8/go.mod h1:mK3/NbSljx3Kr335+IXEe8gcdEPA2eZXJaNhodK9bAI= -github.com/filecoin-project/go-ds-versioning v0.1.2 h1:to4pTadv3IeV1wvgbCbN6Vqd+fu+7tveXgv/rCEZy6w= -github.com/filecoin-project/go-ds-versioning v0.1.2/go.mod h1:C9/l9PnB1+mwPa26BBVpCjG/XQCB0yj/q5CK2J8X1I4= github.com/filecoin-project/go-fil-commcid v0.0.0-20201016201715-d41df56b4f6a/go.mod h1:Eaox7Hvus1JgPrL5+M3+h7aSPHc0cVqpSxA+TxIEpZQ= github.com/filecoin-project/go-fil-commcid v0.1.0 h1:3R4ds1A9r6cr8mvZBfMYxTS88OqLYEo6roi+GiIeOh8= github.com/filecoin-project/go-fil-commcid v0.1.0/go.mod h1:Eaox7Hvus1JgPrL5+M3+h7aSPHc0cVqpSxA+TxIEpZQ= github.com/filecoin-project/go-fil-commp-hashhash v0.1.0 h1:imrrpZWEHRnNqqv0tN7LXep5bFEVOVmQWHJvl2mgsGo= github.com/filecoin-project/go-fil-commp-hashhash v0.1.0/go.mod h1:73S8WSEWh9vr0fDJVnKADhfIv/d6dCbAGaAGWbdJEI8= -github.com/filecoin-project/go-fil-markets v1.28.3 h1:2cFu7tLZYrfNz4LnxjgERaVD7k5+Wwp0H76mnnTGPBk= -github.com/filecoin-project/go-fil-markets v1.28.3/go.mod h1:eryxo/oVgIxaR5g5CNr9PlvZOi+u/bak0IsPL/PT1hk= github.com/filecoin-project/go-hamt-ipld v0.1.5 h1:uoXrKbCQZ49OHpsTCkrThPNelC4W3LPEk0OrS/ytIBM= github.com/filecoin-project/go-hamt-ipld v0.1.5/go.mod h1:6Is+ONR5Cd5R6XZoCse1CWaXZc0Hdb/JeX+EQCQzX24= github.com/filecoin-project/go-hamt-ipld/v2 v2.0.0 h1:b3UDemBYN2HNfk3KOXNuxgTTxlWi3xVvbQP0IT38fvM= @@ -351,18 +293,16 @@ github.com/filecoin-project/go-padreader v0.0.1 h1:8h2tVy5HpoNbr2gBRr+WD6zV6VD6X github.com/filecoin-project/go-padreader v0.0.1/go.mod h1:VYVPJqwpsfmtoHnAmPx6MUwmrK6HIcDqZJiuZhtmfLQ= github.com/filecoin-project/go-paramfetch v0.0.4 h1:H+Me8EL8T5+79z/KHYQQcT8NVOzYVqXIi7nhb48tdm8= github.com/filecoin-project/go-paramfetch v0.0.4/go.mod h1:1FH85P8U+DUEmWk1Jkw3Bw7FrwTVUNHk/95PSPG+dts= -github.com/filecoin-project/go-retrieval-types v1.2.0 h1:fz6DauLVP3GRg7UuW7HZ6sE+GTmaUW70DTXBF1r9cK0= -github.com/filecoin-project/go-retrieval-types v1.2.0/go.mod h1:ojW6wSw2GPyoRDBGqw1K6JxUcbfa5NOSIiyQEeh7KK0= github.com/filecoin-project/go-state-types v0.0.0-20200903145444-247639ffa6ad/go.mod h1:IQ0MBPnonv35CJHtWSN3YY1Hz2gkPru1Q9qoaYLxx9I= github.com/filecoin-project/go-state-types v0.0.0-20200928172055-2df22083d8ab/go.mod h1:ezYnPf0bNkTsDibL/psSz5dy4B5awOJ/E7P2Saeep8g= github.com/filecoin-project/go-state-types v0.0.0-20201102161440-c8033295a1fc/go.mod h1:ezYnPf0bNkTsDibL/psSz5dy4B5awOJ/E7P2Saeep8g= github.com/filecoin-project/go-state-types v0.1.0/go.mod h1:ezYnPf0bNkTsDibL/psSz5dy4B5awOJ/E7P2Saeep8g= github.com/filecoin-project/go-state-types v0.1.6/go.mod h1:UwGVoMsULoCK+bWjEdd/xLCvLAQFBC7EDT477SKml+Q= github.com/filecoin-project/go-state-types v0.1.10/go.mod h1:UwGVoMsULoCK+bWjEdd/xLCvLAQFBC7EDT477SKml+Q= -github.com/filecoin-project/go-state-types v0.13.1/go.mod h1:cHpOPup9H1g2T29dKHAjC2sc7/Ef5ypjuW9A3I+e9yY= -github.com/filecoin-project/go-state-types v0.14.0-dev h1:bDwq1S28D7EC/uDmKU8vvNcdFw/YDsNq09pe3zeV5h4= -github.com/filecoin-project/go-state-types v0.14.0-dev/go.mod h1:cHpOPup9H1g2T29dKHAjC2sc7/Ef5ypjuW9A3I+e9yY= -github.com/filecoin-project/go-statemachine v0.0.0-20200925024713-05bd7c71fbfe/go.mod h1:FGwQgZAt2Gh5mjlwJUlVB62JeYdo+if0xWxSEfBD9ig= +github.com/filecoin-project/go-state-types v0.14.0-dev.0.20240529001730-3bfff718e9cc h1:waUN6BYKWlun/O5fT1Fo5/7xtKv98tTG1UWdzZN8Lxk= +github.com/filecoin-project/go-state-types v0.14.0-dev.0.20240529001730-3bfff718e9cc/go.mod h1:cHpOPup9H1g2T29dKHAjC2sc7/Ef5ypjuW9A3I+e9yY= +github.com/filecoin-project/go-state-types v0.14.0-dev.0.20240529052523-2d27210dc3cd h1:i341g+sCAYZFxNg+vLswxoQmAmOYeklVqUoPN8b3YBo= +github.com/filecoin-project/go-state-types v0.14.0-dev.0.20240529052523-2d27210dc3cd/go.mod h1:cHpOPup9H1g2T29dKHAjC2sc7/Ef5ypjuW9A3I+e9yY= github.com/filecoin-project/go-statemachine v1.0.3 h1:N07o6alys+V1tNoSTi4WuuoeNC4erS/6jE74+NsgQuk= github.com/filecoin-project/go-statemachine v1.0.3/go.mod h1:jZdXXiHa61n4NmgWFG4w8tnqgvZVHYbJ3yW7+y8bF54= github.com/filecoin-project/go-statestore v0.1.0/go.mod h1:LFc9hD+fRxPqiHiaqUEZOinUJB4WARkRfNl10O7kTnI= @@ -393,15 +333,11 @@ github.com/filecoin-project/specs-actors/v8 v8.0.1/go.mod h1:UYIPg65iPWoFw5NEftR github.com/filecoin-project/test-vectors/schema v0.0.7 h1:hhrcxLnQR2Oe6fjk63hZXG1fWQGyxgCVXOOlAlR/D9A= github.com/filecoin-project/test-vectors/schema v0.0.7/go.mod h1:WqdmeJrz0V37wp7DucRR/bvrScZffqaCyIk9G0BGw1o= github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc= -github.com/flynn/noise v1.0.0/go.mod h1:xbMo+0i6+IGbYdJhF31t2eR1BIU0CYc12+BNAKwUTag= github.com/flynn/noise v1.1.0 h1:KjPQoQCEFdZDiP03phOvGi11+SVVhBG2wOWAorLsstg= github.com/flynn/noise v1.1.0/go.mod h1:xbMo+0i6+IGbYdJhF31t2eR1BIU0CYc12+BNAKwUTag= github.com/francoispqt/gojay v1.2.13 h1:d2m3sFjloqoIUQU3TsHBgj6qg/BVGlTBeHDUmyJnXKk= github.com/francoispqt/gojay v1.2.13/go.mod h1:ehT5mTG4ua4581f1++1WLG0vPdaA9HaiDsoyrBGkyDY= -github.com/franela/goblin v0.0.0-20200105215937-c9ffbefa60db/go.mod h1:7dvUGVsVBjqR7JHJk0brhHOZYGmfBYOrK0ZhYMEtBr4= -github.com/franela/goreq v0.0.0-20171204163338-bcd34c9993f8/go.mod h1:ZhphrRTfi2rbfLwlschooIH4+wKKDR4Pdxhh+TRoA20= github.com/frankban/quicktest v1.11.3/go.mod h1:wRf/ReqHper53s+kmmSZizM8NamnL3IM0I9ntUbOk+k= -github.com/frankban/quicktest v1.14.0/go.mod h1:NeW+ay9A/U67EYXNFA1nPE8e/tnQv/09mUdL/ijj8og= github.com/frankban/quicktest v1.14.3/go.mod h1:mgiwOwqx65TmIk1wJ6Q7wvnVMocbUorkibMOrVTHZps= github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= @@ -428,7 +364,6 @@ github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2 github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= -github.com/go-kit/kit v0.10.0/go.mod h1:xUsJbQ/Fp4kEt7AFgCuvyX4a71u8h9jB8tj/ORgOZ7o= github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= github.com/go-kit/log v0.2.0/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0= github.com/go-kit/log v0.2.1 h1:MRVx0/zhvdseW+Gza6N9rVzU/IVzaeE1SFI4raAhmBU= @@ -439,7 +374,6 @@ github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= github.com/go-logfmt/logfmt v0.6.0 h1:wGYYu3uicYdqXVgoYbvnkrPVXkuLM1p1ifugDMEdRi4= github.com/go-logfmt/logfmt v0.6.0/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= -github.com/go-logr/logr v0.4.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= @@ -463,7 +397,6 @@ github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh github.com/go-openapi/swag v0.19.8/go.mod h1:ao+8BpOPyKdpQz3AOJfbeEVpLmWAvlT1IfTe5McPyhY= github.com/go-openapi/swag v0.19.11 h1:RFTu/dlFySpyVvJDfp/7674JY4SDglYWKztbiIGFpmc= github.com/go-openapi/swag v0.19.11/go.mod h1:Uc0gKkdR+ojzsEpjh39QChyu92vPgIr72POcgHMAgSY= -github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI= github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572/go.mod h1:9Pwr4B2jHnOSGXyyzV8ROjYa2ojvAY6HCGYYfMoC3Ls= @@ -478,13 +411,10 @@ github.com/godbus/dbus/v5 v5.1.0 h1:4KLkAxT3aOY8Li4FRJe/KvhoNFFxo0m6fNuFUO8QJUk= github.com/godbus/dbus/v5 v5.1.0/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/gofrs/flock v0.8.1 h1:+gYjHKf32LDeiEEFhQaotPbLuUXjY5ZqxKgXy7n59aw= github.com/gofrs/flock v0.8.1/go.mod h1:F1TvTiK9OcQqauNUHlbJvyl9Qa1QvF/gOUDKA14jxHU= -github.com/gogo/googleapis v1.1.0/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= github.com/gogo/googleapis v1.4.1 h1:1Yx4Myt7BxzvUr5ldGSbwYiZG6t9wGBZ+8/fX3Wvtq0= github.com/gogo/googleapis v1.4.1/go.mod h1:2lpHqI5OcWCtVElxXnPt+s8oJvMpySlOyM6xDCrzib4= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= -github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= -github.com/gogo/protobuf v1.3.0/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= @@ -493,9 +423,7 @@ github.com/gogo/status v1.1.1/go.mod h1:jpG3dM5QPcqu19Hg8lkUhBFBa3TcLs1DG7+2Jqci github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/glog v1.1.2 h1:DVjP2PbBOzHyzA+dn3WhHIq4NdVu3Q+pvivFICf/7fo= github.com/golang/glog v1.1.2/go.mod h1:zR+okUeTbrL6EL3xHUDxZuEtGv04p5shwip1+mL/rLQ= -github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20191027212112-611e8accdfc9/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= @@ -547,7 +475,6 @@ github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= @@ -556,7 +483,6 @@ github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeN github.com/google/go-github v17.0.0+incompatible/go.mod h1:zLgOLi98H3fifZn+44m+umXrS52loVEgC2AApnigrVQ= github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/gopacket v1.1.17/go.mod h1:UdDNZ1OO62aGYVnPhxT1U6aI7ukYtA/kB8vaU0diBUM= github.com/google/gopacket v1.1.19 h1:ves8RnFZPGiFnTS0uPQStjwru6uO6h+nlr9j6fL7kF8= github.com/google/gopacket v1.1.19/go.mod h1:iJ8V8n6KS+z2U1A8pUwu8bW5SyEMkXJB8Yo/Vo+TKTo= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= @@ -571,10 +497,8 @@ github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hf github.com/google/pprof v0.0.0-20240207164012-fb44976bdcd5 h1:E/LAvt58di64hlYjx7AsNS6C/ysHWYo+2qPCZKTQhRo= github.com/google/pprof v0.0.0-20240207164012-fb44976bdcd5/go.mod h1:czg5+yv1E0ZGTi6S6vVK1mke0fV+FaUhNGcd6VRS9Ik= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= -github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.2.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.5.0 h1:1p67kYwdtXjb0gL0BPiP1Av9wiZPo5A8z2cWkTZ+eyU= github.com/google/uuid v1.5.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go v2.0.0+incompatible/go.mod h1:SFVmujtThgffbyetf+mdk2eWhX2bMyUtNHzFKcPA9HY= @@ -586,55 +510,32 @@ github.com/gopherjs/gopherjs v0.0.0-20190430165422-3e4dfb77656c/go.mod h1:wJfORR github.com/gopherjs/gopherjs v0.0.0-20190812055157-5d271430af9f/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gopherjs/gopherjs v1.17.2 h1:fQnZVsXk8uxXIStYb0N4bGk7jeyTalG/wsZjQ25dO0g= github.com/gopherjs/gopherjs v1.17.2/go.mod h1:pRRIvn/QzFLrKfvEz3qUuEhtE/zLCWfreZ6J5gM2i+k= -github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= -github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= -github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= github.com/gorilla/mux v1.8.1 h1:TuBL49tXwgrFYWhqrNgrUNEY92u81SPhu7sTdzQEiWY= github.com/gorilla/mux v1.8.1/go.mod h1:AKf9I4AEqPTmMytcMc0KkNouC66V3BtZ4qD5fmWSiMQ= -github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= -github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= -github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/gorilla/websocket v1.5.1 h1:gmztn0JnHVt9JZquRuzLw3g4wouNVzKL15iLr/zn/QY= github.com/gorilla/websocket v1.5.1/go.mod h1:x3kM2JMyaluk02fnUJpQuwD2dCS5NDG2ZHL0uE0tcaY= github.com/gregdhill/go-openrpc v0.0.0-20220114144539-ae6f44720487 h1:NyaWOSkqFK1d9o+HLfnMIGzrHuUUPeBNIZyi5Zoe/lY= github.com/gregdhill/go-openrpc v0.0.0-20220114144539-ae6f44720487/go.mod h1:a1eRkbhd3DYpRH2lnuUsVG+QMTI+v0hGnsis8C9hMrA= github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= -github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 h1:UH//fgunKIs4JdUbpDl1VZCDaL56wXCB/5+wF6uHfaI= github.com/grpc-ecosystem/go-grpc-middleware v1.4.0/go.mod h1:g5qyo/la0ALbONm6Vbp88Yd8NsDy6rZz+RcrMPxvld8= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 h1:Ovs26xHkKqVztRpIrF/92BcuyuQ/YW4NSIpoGtfXNho= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= github.com/grpc-ecosystem/grpc-gateway v1.5.0/go.mod h1:RSKVYQBd5MCa4OVpNdGskqpgL2+G+NZTnrVHpWWfpdw= -github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/gxed/hashland/keccakpg v0.0.1/go.mod h1:kRzw3HkwxFU1mpmPP8v1WyQzwdGfmKFJ6tItnhQ67kU= github.com/gxed/hashland/murmur3 v0.0.1/go.mod h1:KjXop02n4/ckmZSnY2+HKcLud/tcmvhST0bie/0lS48= github.com/hako/durafmt v0.0.0-20200710122514-c0fb7b4da026 h1:BpJ2o0OR5FV7vrkDYfXYVJQeMNWa8RhklZOpW2ITAIQ= github.com/hako/durafmt v0.0.0-20200710122514-c0fb7b4da026/go.mod h1:5Scbynm8dF1XAPwIwkGPqzkM/shndPm79Jd1003hTjE= -github.com/hannahhoward/cbor-gen-for v0.0.0-20230214144701-5d17c9d5243c h1:iiD+p+U0M6n/FsO6XIZuOgobnNa48FxtyYFfWwLttUQ= -github.com/hannahhoward/cbor-gen-for v0.0.0-20230214144701-5d17c9d5243c/go.mod h1:jvfsLIxk0fY/2BKSQ1xf2406AKA5dwMmKKv0ADcOfN8= github.com/hannahhoward/go-pubsub v0.0.0-20200423002714-8d62886cc36e h1:3YKHER4nmd7b5qy5t0GWDTwSn4OyRgfAXSmo6VnryBY= github.com/hannahhoward/go-pubsub v0.0.0-20200423002714-8d62886cc36e/go.mod h1:I8h3MITA53gN9OnWGCgaMa0JWVRdXthWw4M3CPM54OY= -github.com/hashicorp/consul/api v1.3.0/go.mod h1:MmDNSzIMUjNpY/mQ398R4bk2FnqQLoPndWW5VkKPlCE= -github.com/hashicorp/consul/sdk v0.3.0/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I= github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= -github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= -github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= -github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= -github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo= github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= -github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= -github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= -github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= -github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= -github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= -github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= -github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= @@ -645,12 +546,7 @@ github.com/hashicorp/golang-lru/arc/v2 v2.0.5/go.mod h1:ny6zBSQZi2JxIeYcv7kt2sH2 github.com/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k= github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= -github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= -github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= -github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= -github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= -github.com/hudl/fargo v1.3.0/go.mod h1:y3CKSmjA+wD2gak7sUSXTAoopbhU08POFhmITJgmKTg= github.com/huin/goupnp v1.0.0/go.mod h1:n9v9KO1tAxYH82qOn+UTIFQDmx5n1Zxd/ClZDMX7Bnc= github.com/huin/goupnp v1.3.0 h1:UvLUlWDNpoUdYzb2TCn+MuTWtcjXKSza2n6CBdQ0xXc= github.com/huin/goupnp v1.3.0/go.mod h1:gnGPsThkYa7bFi/KWmEysQRf48l2dvR5bxr2OFckNX8= @@ -666,7 +562,6 @@ github.com/icza/mighty v0.0.0-20180919140131-cfd07d671de6 h1:8UsGZ2rr2ksmEru6lTo github.com/icza/mighty v0.0.0-20180919140131-cfd07d671de6/go.mod h1:xQig96I1VNBDIWGCdTt54nHt6EeI639SmHycLYL7FkA= github.com/imdario/mergo v0.3.7/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= -github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo= github.com/influxdata/influxdb1-client v0.0.0-20200827194710-b269163b24ab h1:HqW4xhhynfjrtEiiSGcQUd6vrK23iMam1FO8rI7mwig= github.com/influxdata/influxdb1-client v0.0.0-20200827194710-b269163b24ab/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo= github.com/invopop/jsonschema v0.12.0 h1:6ovsNSuvn9wEQVOyc72aycBMVQFKz7cPdMJn10CvzRI= @@ -680,7 +575,6 @@ github.com/ipfs/go-bitfield v1.1.0 h1:fh7FIo8bSwaJEh6DdTWbCeZ1eqOaOkKFI74SCnsWbG github.com/ipfs/go-bitfield v1.1.0/go.mod h1:paqf1wjq/D2BBmzfTVFlJQ9IlFOZpg422HL0HqsGWHU= github.com/ipfs/go-bitswap v0.1.0/go.mod h1:FFJEf18E9izuCqUtHxbWEvq+reg7o4CW5wSAE1wsxj0= github.com/ipfs/go-bitswap v0.1.2/go.mod h1:qxSWS4NXGs7jQ6zQvoPY3+NmOfHHG47mhkiLzBpJQIs= -github.com/ipfs/go-bitswap v0.5.1/go.mod h1:P+ckC87ri1xFLvk74NlXdP0Kj9RmWAh4+H78sC6Qopo= github.com/ipfs/go-bitswap v0.11.0 h1:j1WVvhDX1yhG32NTC9xfxnqycqYIlhzEzLXG/cU1HyQ= github.com/ipfs/go-bitswap v0.11.0/go.mod h1:05aE8H3XOU+LXpTedeAS0OZpcO1WFsj5niYQH9a1Tmk= github.com/ipfs/go-block-format v0.0.1/go.mod h1:DK/YYcsSUIVAFNwo/KZCdIIbpN0ROH/baNLgayt4pFc= @@ -689,7 +583,6 @@ github.com/ipfs/go-block-format v0.0.3/go.mod h1:4LmD4ZUw0mhO+JSKdpWwrzATiEfM7WW github.com/ipfs/go-block-format v0.2.0 h1:ZqrkxBA2ICbDRbK8KJs/u0O3dlp6gmAuuXUJNiW1Ycs= github.com/ipfs/go-block-format v0.2.0/go.mod h1:+jpL11nFx5A/SPpsoBn6Bzkra/zaArfSmsknbPMYgzM= github.com/ipfs/go-blockservice v0.1.0/go.mod h1:hzmMScl1kXHg3M2BjTymbVPjv627N7sYcvYaKbop39M= -github.com/ipfs/go-blockservice v0.2.1/go.mod h1:k6SiwmgyYgs4M/qt+ww6amPeUH9EISLRBnvUurKJhi8= github.com/ipfs/go-blockservice v0.5.1 h1:9pAtkyKAz/skdHTh0kH8VulzWp+qmSDD0aI17TYP/s0= github.com/ipfs/go-blockservice v0.5.1/go.mod h1:VpMblFEqG67A/H2sHKAemeH9vlURVavlysbdUI632yk= github.com/ipfs/go-cid v0.0.1/go.mod h1:GHWU/WuQdMPmIosc4Yn1bcCT7dSeX4lBafM7iqUPQvM= @@ -701,7 +594,6 @@ github.com/ipfs/go-cid v0.0.5/go.mod h1:plgt+Y5MnOey4vO4UlUazGqdbEXuFYitED67Fexh github.com/ipfs/go-cid v0.0.6-0.20200501230655-7c82f3b81c00/go.mod h1:plgt+Y5MnOey4vO4UlUazGqdbEXuFYitED67FexhXog= github.com/ipfs/go-cid v0.0.6/go.mod h1:6Ux9z5e+HpkQdckYoX1PG/6xqKspzlEIR5SDmgqgC/I= github.com/ipfs/go-cid v0.0.7/go.mod h1:6Ux9z5e+HpkQdckYoX1PG/6xqKspzlEIR5SDmgqgC/I= -github.com/ipfs/go-cid v0.1.0/go.mod h1:rH5/Xv83Rfy8Rw6xG+id3DYAMUVmem1MowoKwdXmN2o= github.com/ipfs/go-cid v0.2.0/go.mod h1:P+HXFDF4CVhaVayiEb4wkAy7zBHxBwsJyt0Y5U6MLro= github.com/ipfs/go-cid v0.3.2/go.mod h1:gQ8pKqT/sUxGY+tIwy1RPpAojYu7jAyCp5Tz1svoupw= github.com/ipfs/go-cid v0.4.1 h1:A/T3qGvxi4kpKWWcPC/PgbvDA2bjVLO7n4UeVwnbs/s= @@ -713,10 +605,6 @@ github.com/ipfs/go-datastore v0.0.5/go.mod h1:d4KVXhMt913cLBEI/PXAy6ko+W7e9AhyAK github.com/ipfs/go-datastore v0.1.0/go.mod h1:d4KVXhMt913cLBEI/PXAy6ko+W7e9AhyAKBGh803qeE= github.com/ipfs/go-datastore v0.1.1/go.mod h1:w38XXW9kVFNp57Zj5knbKWM2T+KOZCGDRVNdgPHtbHw= github.com/ipfs/go-datastore v0.3.1/go.mod h1:w38XXW9kVFNp57Zj5knbKWM2T+KOZCGDRVNdgPHtbHw= -github.com/ipfs/go-datastore v0.4.0/go.mod h1:SX/xMIKoCszPqp+z9JhPYCmoOoXTvaa13XEbGtsFUhA= -github.com/ipfs/go-datastore v0.4.1/go.mod h1:SX/xMIKoCszPqp+z9JhPYCmoOoXTvaa13XEbGtsFUhA= -github.com/ipfs/go-datastore v0.4.4/go.mod h1:SX/xMIKoCszPqp+z9JhPYCmoOoXTvaa13XEbGtsFUhA= -github.com/ipfs/go-datastore v0.4.5/go.mod h1:eXTcaaiN6uOlVCLS9GjJUJtlvJfM3xk23w3fyfrmmJs= github.com/ipfs/go-datastore v0.5.0/go.mod h1:9zhEApYMTl17C8YDp7JmU7sQZi2/wqiYh73hakZ90Bk= github.com/ipfs/go-datastore v0.5.1/go.mod h1:9zhEApYMTl17C8YDp7JmU7sQZi2/wqiYh73hakZ90Bk= github.com/ipfs/go-datastore v0.6.0 h1:JKyz+Gvz1QEZw0LsX1IBn+JFCJQH4SJVFtM4uWU0Myk= @@ -724,16 +612,11 @@ github.com/ipfs/go-datastore v0.6.0/go.mod h1:rt5M3nNbSO/8q1t4LNkLyUwRs8HupMeN/8 github.com/ipfs/go-detect-race v0.0.1 h1:qX/xay2W3E4Q1U7d9lNs1sU9nvguX0a7319XbyQ6cOk= github.com/ipfs/go-detect-race v0.0.1/go.mod h1:8BNT7shDZPo99Q74BpGMK+4D8Mn4j46UU0LZ723meps= github.com/ipfs/go-ds-badger v0.0.2/go.mod h1:Y3QpeSFWQf6MopLTiZD+VT6IC1yZqaGmjvRcKeSGij8= -github.com/ipfs/go-ds-badger v0.0.5/go.mod h1:g5AuuCGmr7efyzQhLL8MzwqcauPojGPUaHzfGTzuE3s= -github.com/ipfs/go-ds-badger v0.2.1/go.mod h1:Tx7l3aTph3FMFrRS838dcSJh+jjA7cX9DrGVwx/NOwE= -github.com/ipfs/go-ds-badger v0.2.3/go.mod h1:pEYw0rgg3FIrywKKnL+Snr+w/LjJZVMTBRn4FS6UHUk= github.com/ipfs/go-ds-badger v0.3.0 h1:xREL3V0EH9S219kFFueOYJJTcjgNSZ2HY1iSvN7U1Ro= github.com/ipfs/go-ds-badger v0.3.0/go.mod h1:1ke6mXNqeV8K3y5Ak2bAA0osoTfmxUdupVCGm4QUIek= github.com/ipfs/go-ds-badger2 v0.1.3 h1:Zo9JicXJ1DmXTN4KOw7oPXkspZ0AWHcAFCP1tQKnegg= github.com/ipfs/go-ds-badger2 v0.1.3/go.mod h1:TPhhljfrgewjbtuL/tczP8dNrBYwwk+SdPYbms/NO9w= github.com/ipfs/go-ds-leveldb v0.0.1/go.mod h1:feO8V3kubwsEF22n0YRQCffeb79OOYIykR4L04tMOYc= -github.com/ipfs/go-ds-leveldb v0.4.1/go.mod h1:jpbku/YqBSsBc1qgME8BkWS4AxzF2cEu1Ii2r79Hh9s= -github.com/ipfs/go-ds-leveldb v0.4.2/go.mod h1:jpbku/YqBSsBc1qgME8BkWS4AxzF2cEu1Ii2r79Hh9s= github.com/ipfs/go-ds-leveldb v0.5.0 h1:s++MEBbD3ZKc9/8/njrn4flZLnCuY9I79v94gBUNumo= github.com/ipfs/go-ds-leveldb v0.5.0/go.mod h1:d3XG9RUDzQ6V4SHi8+Xgj9j1XuEk1z82lquxrVbml/Q= github.com/ipfs/go-ds-measure v0.2.0 h1:sG4goQe0KDTccHMyT45CY1XyUbxe5VwTKpg2LjApYyQ= @@ -741,12 +624,8 @@ github.com/ipfs/go-ds-measure v0.2.0/go.mod h1:SEUD/rE2PwRa4IQEC5FuNAmjJCyYObZr9 github.com/ipfs/go-fs-lock v0.0.6/go.mod h1:OTR+Rj9sHiRubJh3dRhD15Juhd/+w6VPOY28L7zESmM= github.com/ipfs/go-fs-lock v0.0.7 h1:6BR3dajORFrFTkb5EpCUFIAypsoxpGpDSVUdFwzgL9U= github.com/ipfs/go-fs-lock v0.0.7/go.mod h1:Js8ka+FNYmgQRLrRXzU3CB/+Csr1BwrRilEcvYrHhhc= -github.com/ipfs/go-graphsync v0.17.0 h1:1gh10v94G/vSGzfApVtbZSvSKkK906Y+2sRqewjDTm4= -github.com/ipfs/go-graphsync v0.17.0/go.mod h1:HXHiTRIw3wrN3InMwdV+IzpBAtreEf/KqFlEibhfVgo= github.com/ipfs/go-ipfs-blockstore v0.0.1/go.mod h1:d3WClOmRQKFnJ0Jz/jj/zmksX0ma1gROTlovZKBmN08= github.com/ipfs/go-ipfs-blockstore v0.1.0/go.mod h1:5aD0AvHPi7mZc6Ci1WCAhiBQu2IsfTduLl+422H6Rqw= -github.com/ipfs/go-ipfs-blockstore v0.2.1/go.mod h1:jGesd8EtCM3/zPgx+qr0/feTXGUeRai6adgwC+Q+JvE= -github.com/ipfs/go-ipfs-blockstore v1.1.2/go.mod h1:w51tNR9y5+QXB0wkNcHt4O2aSZjTdqaEWaQdSxEyUOY= github.com/ipfs/go-ipfs-blockstore v1.2.0/go.mod h1:eh8eTFLiINYNSNawfZOC7HOxNTxpB1PFuA5E1m/7exE= github.com/ipfs/go-ipfs-blockstore v1.3.0 h1:m2EXaWgwTzAfsmt5UdJ7Is6l4gJcaM/A12XwJyvYvMM= github.com/ipfs/go-ipfs-blockstore v1.3.0/go.mod h1:KgtZyc9fq+P2xJUiCAzbRdhhqJHvsw8u2Dlqy2MyRTE= @@ -759,29 +638,21 @@ github.com/ipfs/go-ipfs-delay v0.0.0-20181109222059-70721b86a9a8/go.mod h1:8SP1Y github.com/ipfs/go-ipfs-delay v0.0.1 h1:r/UXYyRcddO6thwOnhiznIAiSvxMECGgtv35Xs1IeRQ= github.com/ipfs/go-ipfs-delay v0.0.1/go.mod h1:8SP1YXK1M1kXuc4KJZINY3TQQ03J2rwBG9QfXmbRPrw= github.com/ipfs/go-ipfs-ds-help v0.0.1/go.mod h1:gtP9xRaZXqIQRh1HRpp595KbBEdgqWFxefeVKOV8sxo= -github.com/ipfs/go-ipfs-ds-help v0.1.1/go.mod h1:SbBafGJuGsPI/QL3j9Fc5YPLeAu+SzOkI0gFwAg+mOs= github.com/ipfs/go-ipfs-ds-help v1.1.0 h1:yLE2w9RAsl31LtfMt91tRZcrx+e61O5mDxFRR994w4Q= github.com/ipfs/go-ipfs-ds-help v1.1.0/go.mod h1:YR5+6EaebOhfcqVCyqemItCLthrpVNot+rsOU/5IatU= github.com/ipfs/go-ipfs-exchange-interface v0.0.1/go.mod h1:c8MwfHjtQjPoDyiy9cFquVtVHkO9b9Ob3FG91qJnWCM= -github.com/ipfs/go-ipfs-exchange-interface v0.1.0/go.mod h1:ych7WPlyHqFvCi/uQI48zLZuAWVP5iTQPXEfVaw5WEI= github.com/ipfs/go-ipfs-exchange-interface v0.2.0 h1:8lMSJmKogZYNo2jjhUs0izT+dck05pqUw4mWNW9Pw6Y= github.com/ipfs/go-ipfs-exchange-interface v0.2.0/go.mod h1:z6+RhJuDQbqKguVyslSOuVDhqF9JtTrO3eptSAiW2/Y= github.com/ipfs/go-ipfs-exchange-offline v0.0.1/go.mod h1:WhHSFCVYX36H/anEKQboAzpUws3x7UeEGkzQc3iNkM0= -github.com/ipfs/go-ipfs-exchange-offline v0.1.1/go.mod h1:vTiBRIbzSwDD0OWm+i3xeT0mO7jG2cbJYatp3HPk5XY= github.com/ipfs/go-ipfs-exchange-offline v0.3.0 h1:c/Dg8GDPzixGd0MC8Jh6mjOwU57uYokgWRFidfvEkuA= github.com/ipfs/go-ipfs-exchange-offline v0.3.0/go.mod h1:MOdJ9DChbb5u37M1IcbrRB02e++Z7521fMxqCNRrz9s= github.com/ipfs/go-ipfs-files v0.0.3/go.mod h1:INEFm0LL2LWXBhNJ2PMIIb2w45hpXgPjNoE7yA8Y1d4= github.com/ipfs/go-ipfs-files v0.0.4/go.mod h1:INEFm0LL2LWXBhNJ2PMIIb2w45hpXgPjNoE7yA8Y1d4= -github.com/ipfs/go-ipfs-files v0.3.0 h1:fallckyc5PYjuMEitPNrjRfpwl7YFt69heCOUhsbGxQ= -github.com/ipfs/go-ipfs-files v0.3.0/go.mod h1:xAUtYMwB+iu/dtf6+muHNSFQCJG2dSiStR2P6sn9tIM= -github.com/ipfs/go-ipfs-posinfo v0.0.1 h1:Esoxj+1JgSjX0+ylc0hUmJCOv6V2vFoZiETLR6OtpRs= github.com/ipfs/go-ipfs-posinfo v0.0.1/go.mod h1:SwyeVP+jCwiDu0C313l/8jg6ZxM0qqtlt2a0vILTc1A= github.com/ipfs/go-ipfs-pq v0.0.1/go.mod h1:LWIqQpqfRG3fNc5XsnIhz/wQ2XXGyugQwls7BgUmUfY= -github.com/ipfs/go-ipfs-pq v0.0.2/go.mod h1:LWIqQpqfRG3fNc5XsnIhz/wQ2XXGyugQwls7BgUmUfY= github.com/ipfs/go-ipfs-pq v0.0.3 h1:YpoHVJB+jzK15mr/xsWC574tyDLkezVrDNeaalQBsTE= github.com/ipfs/go-ipfs-pq v0.0.3/go.mod h1:btNw5hsHBpRcSSgZtiNm/SLj5gYIZ18AKtv3kERkRb4= github.com/ipfs/go-ipfs-routing v0.1.0/go.mod h1:hYoUkJLyAUKhF58tysKpids8RNDPO42BVMgK5dNsoqY= -github.com/ipfs/go-ipfs-routing v0.2.1/go.mod h1:xiNNiwgjmLqPS1cimvAw6EyB9rkVDbiocA4yY+wRNLM= github.com/ipfs/go-ipfs-routing v0.3.0 h1:9W/W3N+g+y4ZDeffSgqhgo7BsBSJwPMcyssET9OWevc= github.com/ipfs/go-ipfs-routing v0.3.0/go.mod h1:dKqtTFIql7e1zYsEuWLyuOU+E0WJWW8JjbTPLParDWo= github.com/ipfs/go-ipfs-util v0.0.1/go.mod h1:spsl5z8KUnrve+73pOhSVZND1SIxPW5RyBCNzQxlJBc= @@ -803,24 +674,15 @@ github.com/ipfs/go-ipld-format v0.3.0/go.mod h1:co/SdBE8h99968X0hViiw1MNlh6fvxxn github.com/ipfs/go-ipld-format v0.4.0/go.mod h1:co/SdBE8h99968X0hViiw1MNlh6fvxxnHpvVLnH7jSM= github.com/ipfs/go-ipld-format v0.6.0 h1:VEJlA2kQ3LqFSIm5Vu6eIlSxD/Ze90xtc4Meten1F5U= github.com/ipfs/go-ipld-format v0.6.0/go.mod h1:g4QVMTn3marU3qXchwjpKPKgJv+zF+OlaKMyhJ4LHPg= -github.com/ipfs/go-ipld-legacy v0.1.0/go.mod h1:86f5P/srAmh9GcIcWQR9lfFLZPrIyyXQeVlOWeeWEuI= github.com/ipfs/go-ipld-legacy v0.2.1 h1:mDFtrBpmU7b//LzLSypVrXsD8QxkEWxu5qVxN99/+tk= github.com/ipfs/go-ipld-legacy v0.2.1/go.mod h1:782MOUghNzMO2DER0FlBR94mllfdCJCkTtDtPM51otM= -github.com/ipfs/go-libipfs v0.7.0 h1:Mi54WJTODaOL2/ZSm5loi3SwI3jI2OuFWUrQIkJ5cpM= -github.com/ipfs/go-libipfs v0.7.0/go.mod h1:KsIf/03CqhICzyRGyGo68tooiBE2iFbI/rXW7FhAYr0= github.com/ipfs/go-log v0.0.1/go.mod h1:kL1d2/hzSpI0thNYjiKfjanbVNU+IIGA/WnNESY9leM= github.com/ipfs/go-log v1.0.0/go.mod h1:JO7RzlMK6rA+CIxFMLOuB6Wf5b81GDiKElL7UPSIKjA= -github.com/ipfs/go-log v1.0.1/go.mod h1:HuWlQttfN6FWNHRhlY5yMk/lW7evQC0HHGOxEwMRR8I= -github.com/ipfs/go-log v1.0.2/go.mod h1:1MNjMxe0u6xvJZgeqbJ8vdo2TKaGwZ1a0Bpza+sr2Sk= -github.com/ipfs/go-log v1.0.3/go.mod h1:OsLySYkwIbiSUR/yBTdv1qPtcE4FW3WPWk/ewz9Ru+A= github.com/ipfs/go-log v1.0.4/go.mod h1:oDCg2FkjogeFOhqqb+N39l2RpTNPL6F/StPkB3kPgcs= github.com/ipfs/go-log v1.0.5 h1:2dOuUCB1Z7uoczMWgAyDck5JLb72zHzrMnGnCNNbvY8= github.com/ipfs/go-log v1.0.5/go.mod h1:j0b8ZoR+7+R99LD9jZ6+AJsrzkPbSXbZfGakb5JPtIo= github.com/ipfs/go-log/v2 v2.0.1/go.mod h1:O7P1lJt27vWHhOwQmcFEvlmo49ry2VY2+JfBWFaa9+0= -github.com/ipfs/go-log/v2 v2.0.2/go.mod h1:O7P1lJt27vWHhOwQmcFEvlmo49ry2VY2+JfBWFaa9+0= -github.com/ipfs/go-log/v2 v2.0.3/go.mod h1:O7P1lJt27vWHhOwQmcFEvlmo49ry2VY2+JfBWFaa9+0= github.com/ipfs/go-log/v2 v2.0.5/go.mod h1:eZs4Xt4ZUJQFM3DlanGhy7TkwwawCZcSByscwkWG+dw= -github.com/ipfs/go-log/v2 v2.1.1/go.mod h1:2v2nsGfZsvvAJz13SyFzf9ObaqwHiHxsPLEHntrv9KM= github.com/ipfs/go-log/v2 v2.1.2-0.20200626104915-0016c0b4b3e4/go.mod h1:2v2nsGfZsvvAJz13SyFzf9ObaqwHiHxsPLEHntrv9KM= github.com/ipfs/go-log/v2 v2.1.2/go.mod h1:2v2nsGfZsvvAJz13SyFzf9ObaqwHiHxsPLEHntrv9KM= github.com/ipfs/go-log/v2 v2.1.3/go.mod h1:/8d0SH3Su5Ooc31QlL1WysJhvyOTDCjcCZ9Axpmri6g= @@ -831,7 +693,6 @@ github.com/ipfs/go-log/v2 v2.5.1/go.mod h1:prSpmC1Gpllc9UYWxDiZDreBYw7zp4Iqp1kOL github.com/ipfs/go-merkledag v0.2.3/go.mod h1:SQiXrtSts3KGNmgOzMICy5c0POOpUNQLvB3ClKnBAlk= github.com/ipfs/go-merkledag v0.2.4/go.mod h1:SQiXrtSts3KGNmgOzMICy5c0POOpUNQLvB3ClKnBAlk= github.com/ipfs/go-merkledag v0.3.2/go.mod h1:fvkZNNZixVW6cKSZ/JfLlON5OlgTXNdRLz0p6QG/I2M= -github.com/ipfs/go-merkledag v0.5.1/go.mod h1:cLMZXx8J08idkp5+id62iVftUQV+HlYJ3PIhDfZsjA4= github.com/ipfs/go-merkledag v0.11.0 h1:DgzwK5hprESOzS4O1t/wi6JDpyVQdvm9Bs59N/jqfBY= github.com/ipfs/go-merkledag v0.11.0/go.mod h1:Q4f/1ezvBiJV0YCIXvt51W/9/kqJGH4I1LsA7+djsM4= github.com/ipfs/go-metrics-interface v0.0.1 h1:j+cpbjYvu4R8zbleSs36gvB7jR+wsL2fGD6n0jO4kdg= @@ -839,12 +700,9 @@ github.com/ipfs/go-metrics-interface v0.0.1/go.mod h1:6s6euYU4zowdslK0GKHmqaIZ3j github.com/ipfs/go-metrics-prometheus v0.0.2 h1:9i2iljLg12S78OhC6UAiXi176xvQGiZaGVF1CUVdE+s= github.com/ipfs/go-metrics-prometheus v0.0.2/go.mod h1:ELLU99AQQNi+zX6GCGm2lAgnzdSH3u5UVlCdqSXnEks= github.com/ipfs/go-peertaskqueue v0.1.0/go.mod h1:Jmk3IyCcfl1W3jTW3YpghSwSEC6IJ3Vzz/jUmWw8Z0U= -github.com/ipfs/go-peertaskqueue v0.7.0/go.mod h1:M/akTIE/z1jGNXMU7kFB4TeSEFvj68ow0Rrb04donIU= github.com/ipfs/go-peertaskqueue v0.8.1 h1:YhxAs1+wxb5jk7RvS0LHdyiILpNmRIRnZVztekOF0pg= github.com/ipfs/go-peertaskqueue v0.8.1/go.mod h1:Oxxd3eaK279FxeydSPPVGHzbwVeHjatZ2GA8XD+KbPU= github.com/ipfs/go-unixfs v0.2.2-0.20190827150610-868af2e9e5cb/go.mod h1:IwAAgul1UQIcNZzKPYZWOCijryFBeCV79cNubPzol+k= -github.com/ipfs/go-unixfs v0.4.5 h1:wj8JhxvV1G6CD7swACwSKYa+NgtdWC1RUit+gFnymDU= -github.com/ipfs/go-unixfs v0.4.5/go.mod h1:BIznJNvt/gEx/ooRMI4Us9K8+qeGO7vx1ohnbk8gjFg= github.com/ipfs/go-unixfsnode v1.9.0 h1:ubEhQhr22sPAKO2DNsyVBW7YB/zA8Zkif25aBvz8rc8= github.com/ipfs/go-unixfsnode v1.9.0/go.mod h1:HxRu9HYHOjK6HUqFBAi++7DVoWAHn0o4v/nZ/VA+0g8= github.com/ipfs/go-verifcid v0.0.1/go.mod h1:5Hrva5KBeIog4A+UpqlaIU+DEstipcJYQQZc0g37pY0= @@ -853,34 +711,24 @@ github.com/ipfs/go-verifcid v0.0.2/go.mod h1:40cD9x1y4OWnFXbLNJYRe7MpNvWlMn3LZAG github.com/ipld/go-car v0.1.0/go.mod h1:RCWzaUh2i4mOEkB3W45Vc+9jnS/M6Qay5ooytiBHl3g= github.com/ipld/go-car v0.6.1 h1:blWbEHf1j62JMWFIqWE//YR0m7k5ZMw0AuUOU5hjrH8= github.com/ipld/go-car v0.6.1/go.mod h1:oEGXdwp6bmxJCZ+rARSkDliTeYnVzv3++eXajZ+Bmr8= -github.com/ipld/go-car/v2 v2.1.1/go.mod h1:+2Yvf0Z3wzkv7NeI69i8tuZ+ft7jyjPYIWZzeVNeFcI= github.com/ipld/go-car/v2 v2.13.1 h1:KnlrKvEPEzr5IZHKTXLAEub+tPrzeAFQVRlSQvuxBO4= github.com/ipld/go-car/v2 v2.13.1/go.mod h1:QkdjjFNGit2GIkpQ953KBwowuoukoM75nP/JI1iDJdo= github.com/ipld/go-codec-dagpb v1.2.0/go.mod h1:6nBN7X7h8EOsEejZGqC7tej5drsdBAXbMHyBT+Fne5s= -github.com/ipld/go-codec-dagpb v1.3.0/go.mod h1:ga4JTU3abYApDC3pZ00BC2RSvC3qfBb9MSJkMLSwnhA= github.com/ipld/go-codec-dagpb v1.6.0 h1:9nYazfyu9B1p3NAgfVdpRco3Fs2nFC72DqVsMj6rOcc= github.com/ipld/go-codec-dagpb v1.6.0/go.mod h1:ANzFhfP2uMJxRBr8CE+WQWs5UsNa0pYtmKZ+agnUw9s= -github.com/ipld/go-ipld-adl-hamt v0.0.0-20220616142416-9004dbd839e0 h1:QAI/Ridj0+foHD6epbxmB4ugxz9B4vmNdYSmQLGa05E= -github.com/ipld/go-ipld-adl-hamt v0.0.0-20220616142416-9004dbd839e0/go.mod h1:odxGcpiQZLzP5+yGu84Ljo8y3EzCvNAQKEodHNsHLXA= github.com/ipld/go-ipld-prime v0.0.2-0.20191108012745-28a82f04c785/go.mod h1:bDDSvVz7vaK12FNvMeRYnpRFkSUPNQOiCYQezMD/P3w= github.com/ipld/go-ipld-prime v0.9.0/go.mod h1:KvBLMr4PX1gWptgkzRjVZCrLmSGcZCb/jioOQwCqZN8= -github.com/ipld/go-ipld-prime v0.9.1-0.20210324083106-dc342a9917db/go.mod h1:KvBLMr4PX1gWptgkzRjVZCrLmSGcZCb/jioOQwCqZN8= github.com/ipld/go-ipld-prime v0.10.0/go.mod h1:KvBLMr4PX1gWptgkzRjVZCrLmSGcZCb/jioOQwCqZN8= -github.com/ipld/go-ipld-prime v0.11.0/go.mod h1:+WIAkokurHmZ/KwzDOMUuoeJgaRQktHtEaLglS3ZeV8= -github.com/ipld/go-ipld-prime v0.14.0/go.mod h1:9ASQLwUFLptCov6lIYc70GRB4V7UTyLD0IJtrDJe6ZM= github.com/ipld/go-ipld-prime v0.19.0/go.mod h1:Q9j3BaVXwaA3o5JUDNvptDDr/x8+F7FG6XJ8WI3ILg4= github.com/ipld/go-ipld-prime v0.21.0 h1:n4JmcpOlPDIxBcY037SVfpd1G+Sj1nKZah0m6QH9C2E= github.com/ipld/go-ipld-prime v0.21.0/go.mod h1:3RLqy//ERg/y5oShXXdx5YIp50cFGOanyMctpPjsvxQ= github.com/ipld/go-ipld-prime-proto v0.0.0-20191113031812-e32bd156a1e5/go.mod h1:gcvzoEDBjwycpXt3LBE061wT9f46szXGHAmj9uoP6fU= -github.com/ipld/go-ipld-prime/storage/bsadapter v0.0.0-20211210234204-ce2a1c70cd73/go.mod h1:2PJ0JgxyB08t0b2WKrcuqI3di0V+5n6RS/LTUJhkoxY= github.com/ipld/go-ipld-prime/storage/bsadapter v0.0.0-20230102063945-1a409dc236dd h1:gMlw/MhNr2Wtp5RwGdsW23cs+yCuj9k2ON7i9MiJlRo= github.com/ipld/go-ipld-prime/storage/bsadapter v0.0.0-20230102063945-1a409dc236dd/go.mod h1:wZ8hH8UxeryOs4kJEJaiui/s00hDSbE37OKsL47g+Sw= github.com/ipld/go-ipld-selector-text-lite v0.0.1 h1:lNqFsQpBHc3p5xHob2KvEg/iM5dIFn6iw4L/Hh+kS1Y= github.com/ipld/go-ipld-selector-text-lite v0.0.1/go.mod h1:U2CQmFb+uWzfIEF3I1arrDa5rwtj00PrpiwwCO+k1RM= github.com/ipni/go-libipni v0.0.8 h1:0wLfZRSBG84swmZwmaLKul/iB/FlBkkl9ZcR1ub+Z+w= github.com/ipni/go-libipni v0.0.8/go.mod h1:paYP9U4N3/vOzGCuN9kU972vtvw9JUcQjOKyiCFGwRk= -github.com/ipni/index-provider v0.12.0 h1:R3F6dxxKNv4XkE4GJZNLOG0bDEbBQ/S5iztXwSD8jhQ= -github.com/ipni/index-provider v0.12.0/go.mod h1:GhyrADJp7n06fqoc1djzkvL4buZYHzV8SoWrlxEo5F4= github.com/ipsn/go-secp256k1 v0.0.0-20180726113642-9d62b9f0bc52 h1:QG4CGBqCeuBo6aZlGAamSkxWdgWfZGeE49eUOWJPA4c= github.com/ipsn/go-secp256k1 v0.0.0-20180726113642-9d62b9f0bc52/go.mod h1:fdg+/X9Gg4AsAIzWpEHwnqd+QY3b7lajxyjE1m4hkq4= github.com/jackc/pgerrcode v0.0.0-20220416144525-469b46aa5efa h1:s+4MhCQ6YrzisK6hFJUX53drDT4UsSW3DEhKn0ifuHw= @@ -899,7 +747,6 @@ github.com/jackpal/go-nat-pmp v1.0.2 h1:KzKSgb7qkJvOUTqYl9/Hg/me3pWgBmERKrTGD7Bd github.com/jackpal/go-nat-pmp v1.0.2/go.mod h1:QPH045xvCAeXUZOxsnwmrtiCoxIr9eob+4orBN1SBKc= github.com/jbenet/go-cienv v0.0.0-20150120210510-1bb1476777ec/go.mod h1:rGaEvXB4uRSZMmzKNLoXvTu1sfx+1kv/DojUlPrSZGs= github.com/jbenet/go-cienv v0.1.0/go.mod h1:TqNnHUmJgXau0nCzC7kXWeotg3J9W34CUv5Djy1+FlA= -github.com/jbenet/go-random v0.0.0-20190219211222-123a90aedc0c h1:uUx61FiAa1GI6ZmVd2wf2vULeQZIKG66eybjNXKYCz4= github.com/jbenet/go-random v0.0.0-20190219211222-123a90aedc0c/go.mod h1:sdx1xVM9UuLw1tXnhJWN3piypTUO3vCIHYmG15KE/dU= github.com/jbenet/go-temp-err-catcher v0.0.0-20150120210811-aac704a3f4f2/go.mod h1:8GXXJV31xl8whumTzdZsTt3RnUIiPqzkyf7mxToRCMs= github.com/jbenet/go-temp-err-catcher v0.1.0 h1:zpb3ZH6wIE8Shj2sKS+khgRvf7T7RABoLk/+KKHggpk= @@ -912,24 +759,19 @@ github.com/jellevandenhooff/dkim v0.0.0-20150330215556-f50fe3d243e1/go.mod h1:E0 github.com/jessevdk/go-flags v0.0.0-20141203071132-1679536dcc89/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jessevdk/go-flags v1.4.0 h1:4IU2WS7AumrZ/40jfhf4QVDMsQwqA7VEHozFRrGARJA= github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= -github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= github.com/jmoiron/sqlx v1.3.5 h1:vFFPA71p1o5gAeqtEAwLU4dnX2napprKtHr7PYIcN3g= github.com/jmoiron/sqlx v1.3.5/go.mod h1:nRVWtLre0KfCLJvgxzCsLVMogSvQ1zNJtpYr2Ccp0mQ= github.com/joeshaw/multierror v0.0.0-20140124173710-69b34d4ec901 h1:rp+c0RAYOWj8l6qbCUTSiRLG/iKnW3K3/QfPPuSsBt4= github.com/joeshaw/multierror v0.0.0-20140124173710-69b34d4ec901/go.mod h1:Z86h9688Y0wesXCyonoVr47MasHilkuLMqGhRZ4Hpak= github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg= -github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= github.com/jonboulle/clockwork v0.3.0 h1:9BSCMi8C+0qdApAp4auwX0RkLGUjs956h0EkuQymUhg= github.com/jonboulle/clockwork v0.3.0/go.mod h1:Pkfl5aHPm1nk2H9h0bjmnJD/BcgbGXUBGnn1kMkgxc8= github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= -github.com/jpillora/backoff v1.0.0 h1:uvFg412JmmHBHw7iwprIxkPMI+sGQ4kzOWsMeHnm2EA= github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= github.com/jrick/logrotate v1.0.0 h1:lQ1bL/n9mBNeIXoTUoYRlK4dHuNJVofX9oWqBtPnSzI= github.com/jrick/logrotate v1.0.0/go.mod h1:LNinyqDIJnpAur+b8yyulnQw/wDuN1+BYKlTRt3OuAQ= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= -github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= @@ -940,7 +782,6 @@ github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7 github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= -github.com/kami-zh/go-capturer v0.0.0-20171211120116-e492ea43421d/go.mod h1:P2viExyCEfeWGU259JnaQ34Inuec4R38JCyBx2edgD0= github.com/karrick/godirwalk v1.10.12/go.mod h1:RoGL9dQei4vP9ilrpETWE8CLOZ1kiN0LhBygSwrAsHA= github.com/kelseyhightower/envconfig v1.4.0 h1:Im6hONhd3pLkfDFsbRgu68RDNkGF1r3dvMUtDTo2cv8= github.com/kelseyhightower/envconfig v1.4.0/go.mod h1:cccZRl6mQpaq41TPp5QxidR+Sa3axMbJDNb//FQX6Gg= @@ -956,7 +797,6 @@ github.com/klauspost/compress v1.12.3/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8 github.com/klauspost/compress v1.17.6 h1:60eq2E/jlfwQXtvZEeBUYADs+BwKBWURIY+Gj2eRGjI= github.com/klauspost/compress v1.17.6/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM= github.com/klauspost/cpuid/v2 v2.0.4/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= -github.com/klauspost/cpuid/v2 v2.0.6/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= github.com/klauspost/cpuid/v2 v2.2.3/go.mod h1:RVVoqg1df56z8g3pUjL/3lE5UfnlrJX8tyFgg4nqhuY= github.com/klauspost/cpuid/v2 v2.2.7 h1:ZWSB3igEs+d0qvnxR/ZBzXVmxkgt8DdzP6m9pfuVLDM= @@ -967,7 +807,6 @@ github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxv github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/koron/go-ssdp v0.0.0-20180514024734-4a0ed625a78b/go.mod h1:5Ky9EC2xfoUKUor0Hjgi2BJhCSXJfMOFlmyYrVKGQMk= -github.com/koron/go-ssdp v0.0.0-20191105050749-2e1c40ed0b5d/go.mod h1:5Ky9EC2xfoUKUor0Hjgi2BJhCSXJfMOFlmyYrVKGQMk= github.com/koron/go-ssdp v0.0.4 h1:1IDwrghSKYM7yLf7XCzbByg2sJ/JcNOZRXS2jczTwz0= github.com/koron/go-ssdp v0.0.4/go.mod h1:oDXq+E5IL5q0U8uSBcoAXzTzInwy5lEgC91HoKtbmZk= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= @@ -988,7 +827,6 @@ github.com/leanovate/gopter v0.2.9/go.mod h1:U2L/78B+KVFIx2VmW6onHJQzXtFb+p5y3y2 github.com/lib/pq v1.10.9 h1:YXG7RB+JIjhP29X+OtkiDnYaXQwpS4JEWq7dtCCRUEw= github.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/libp2p/go-addr-util v0.0.1/go.mod h1:4ac6O7n9rIAKB1dnd+s8IbbMXkt+oBpzX4/+RACcnlQ= -github.com/libp2p/go-addr-util v0.0.2/go.mod h1:Ecd6Fb3yIuLzq4bD7VcywcVSBtefcAwnUISBM3WG15E= github.com/libp2p/go-buffer-pool v0.0.1/go.mod h1:xtyIz9PMobb13WaxR6Zo1Pd1zXJKYg0a8KiIvDp3TzQ= github.com/libp2p/go-buffer-pool v0.0.2/go.mod h1:MvaB6xw5vOrDl8rYZGLFdKAuk/hRoRZd1Vi32+RXyFM= github.com/libp2p/go-buffer-pool v0.1.0 h1:oK4mSFcQz7cTQIfqbe4MIj9gLW+mnanjyFtc6cdF0Y8= @@ -996,68 +834,23 @@ github.com/libp2p/go-buffer-pool v0.1.0/go.mod h1:N+vh8gMqimBzdKkSMVuydVDq+UV5QT github.com/libp2p/go-cidranger v1.1.0 h1:ewPN8EZ0dd1LSnrtuwd4709PXVcITVeuwbag38yPW7c= github.com/libp2p/go-cidranger v1.1.0/go.mod h1:KWZTfSr+r9qEo9OkI9/SIEeAtw+NNoU0dXIXt15Okic= github.com/libp2p/go-conn-security-multistream v0.1.0/go.mod h1:aw6eD7LOsHEX7+2hJkDxw1MteijaVcI+/eP2/x3J1xc= -github.com/libp2p/go-conn-security-multistream v0.2.0/go.mod h1:hZN4MjlNetKD3Rq5Jb/P5ohUnFLNzEAR4DLSzpn2QLU= -github.com/libp2p/go-conn-security-multistream v0.2.1/go.mod h1:cR1d8gA0Hr59Fj6NhaTpFhJZrjSYuNmhpT2r25zYR70= -github.com/libp2p/go-eventbus v0.1.0/go.mod h1:vROgu5cs5T7cv7POWlWxBaVLxfSegC5UGQf8A2eEmx4= -github.com/libp2p/go-eventbus v0.2.1/go.mod h1:jc2S4SoEVPP48H9Wpzm5aiGwUCBMfGhVhhBjyhhCJs8= github.com/libp2p/go-flow-metrics v0.0.1/go.mod h1:Iv1GH0sG8DtYN3SVJ2eG221wMiNpZxBdp967ls1g+k8= -github.com/libp2p/go-flow-metrics v0.0.3/go.mod h1:HeoSNUrOJVK1jEpDqVEiUOIXqhbnS27omG0uWU5slZs= github.com/libp2p/go-flow-metrics v0.1.0 h1:0iPhMI8PskQwzh57jB9WxIuIOQ0r+15PChFGkx3Q3WM= github.com/libp2p/go-flow-metrics v0.1.0/go.mod h1:4Xi8MX8wj5aWNDAZttg6UPmc0ZrnFNsMtpsYUClFtro= github.com/libp2p/go-libp2p v0.1.0/go.mod h1:6D/2OBauqLUoqcADOJpn9WbKqvaM07tDw68qHM0BxUM= github.com/libp2p/go-libp2p v0.1.1/go.mod h1:I00BRo1UuUSdpuc8Q2mN7yDF/oTUTRAX6JWpTiK9Rp8= -github.com/libp2p/go-libp2p v0.6.1/go.mod h1:CTFnWXogryAHjXAKEbOf1OWY+VeAP3lDMZkfEI5sT54= -github.com/libp2p/go-libp2p v0.7.0/go.mod h1:hZJf8txWeCduQRDC/WSqBGMxaTHCOYHt2xSU1ivxn0k= -github.com/libp2p/go-libp2p v0.7.4/go.mod h1:oXsBlTLF1q7pxr+9w6lqzS1ILpyHsaBPniVO7zIHGMw= -github.com/libp2p/go-libp2p v0.8.1/go.mod h1:QRNH9pwdbEBpx5DTJYg+qxcVaDMAz3Ee/qDKwXujH5o= -github.com/libp2p/go-libp2p v0.14.3/go.mod h1:d12V4PdKbpL0T1/gsUNN8DfgMuRPDX8bS2QxCZlwRH0= github.com/libp2p/go-libp2p v0.33.2 h1:vCdwnFxoGOXMKmaGHlDSnL4bM3fQeW8pgIa9DECnb40= github.com/libp2p/go-libp2p v0.33.2/go.mod h1:zTeppLuCvUIkT118pFVzA8xzP/p2dJYOMApCkFh0Yww= github.com/libp2p/go-libp2p-asn-util v0.4.1 h1:xqL7++IKD9TBFMgnLPZR6/6iYhawHKHl950SO9L6n94= github.com/libp2p/go-libp2p-asn-util v0.4.1/go.mod h1:d/NI6XZ9qxw67b4e+NgpQexCIiFYJjErASrYW4PFDN8= github.com/libp2p/go-libp2p-autonat v0.1.0/go.mod h1:1tLf2yXxiE/oKGtDwPYWTSYG3PtvYlJmg7NeVtPRqH8= -github.com/libp2p/go-libp2p-autonat v0.1.1/go.mod h1:OXqkeGOY2xJVWKAGV2inNF5aKN/djNA3fdpCWloIudE= -github.com/libp2p/go-libp2p-autonat v0.2.0/go.mod h1:DX+9teU4pEEoZUqR1PiMlqliONQdNbfzE1C718tcViI= -github.com/libp2p/go-libp2p-autonat v0.2.1/go.mod h1:MWtAhV5Ko1l6QBsHQNSuM6b1sRkXrpk0/LqCr+vCVxI= -github.com/libp2p/go-libp2p-autonat v0.2.2/go.mod h1:HsM62HkqZmHR2k1xgX34WuWDzk/nBwNHoeyyT4IWV6A= -github.com/libp2p/go-libp2p-autonat v0.4.2/go.mod h1:YxaJlpr81FhdOv3W3BTconZPfhaYivRdf53g+S2wobk= github.com/libp2p/go-libp2p-blankhost v0.1.1/go.mod h1:pf2fvdLJPsC1FsVrNP3DUUvMzUts2dsLLBEpo1vW1ro= -github.com/libp2p/go-libp2p-blankhost v0.1.4/go.mod h1:oJF0saYsAXQCSfDq254GMNmLNz6ZTHTOvtF4ZydUvwU= -github.com/libp2p/go-libp2p-blankhost v0.2.0/go.mod h1:eduNKXGTioTuQAUcZ5epXi9vMl+t4d8ugUBRQ4SqaNQ= github.com/libp2p/go-libp2p-circuit v0.1.0/go.mod h1:Ahq4cY3V9VJcHcn1SBXjr78AbFkZeIRmfunbA7pmFh8= -github.com/libp2p/go-libp2p-circuit v0.1.4/go.mod h1:CY67BrEjKNDhdTk8UgBX1Y/H5c3xkAcs3gnksxY7osU= -github.com/libp2p/go-libp2p-circuit v0.2.1/go.mod h1:BXPwYDN5A8z4OEY9sOfr2DUQMLQvKt/6oku45YUmjIo= -github.com/libp2p/go-libp2p-circuit v0.4.0/go.mod h1:t/ktoFIUzM6uLQ+o1G6NuBl2ANhBKN9Bc8jRIk31MoA= github.com/libp2p/go-libp2p-core v0.0.1/go.mod h1:g/VxnTZ/1ygHxH3dKok7Vno1VfpvGcGip57wjTU4fco= github.com/libp2p/go-libp2p-core v0.0.2/go.mod h1:9dAcntw/n46XycV4RnlBq3BpgrmyUi9LuoTNdPrbUco= github.com/libp2p/go-libp2p-core v0.0.3/go.mod h1:j+YQMNz9WNSkNezXOsahp9kwZBKBvxLpKD316QWSJXE= -github.com/libp2p/go-libp2p-core v0.0.4/go.mod h1:jyuCQP356gzfCFtRKyvAbNkyeuxb7OlyhWZ3nls5d2I= -github.com/libp2p/go-libp2p-core v0.2.0/go.mod h1:X0eyB0Gy93v0DZtSYbEM7RnMChm9Uv3j7yRXjO77xSI= -github.com/libp2p/go-libp2p-core v0.2.2/go.mod h1:8fcwTbsG2B+lTgRJ1ICZtiM5GWCWZVoVrLaDRvIRng0= -github.com/libp2p/go-libp2p-core v0.2.4/go.mod h1:STh4fdfa5vDYr0/SzYYeqnt+E6KfEV5VxfIrm0bcI0g= -github.com/libp2p/go-libp2p-core v0.3.0/go.mod h1:ACp3DmS3/N64c2jDzcV429ukDpicbL6+TrrxANBjPGw= -github.com/libp2p/go-libp2p-core v0.3.1/go.mod h1:thvWy0hvaSBhnVBaW37BvzgVV68OUhgJJLAa6almrII= -github.com/libp2p/go-libp2p-core v0.4.0/go.mod h1:49XGI+kc38oGVwqSBhDEwytaAxgZasHhFfQKibzTls0= -github.com/libp2p/go-libp2p-core v0.5.0/go.mod h1:49XGI+kc38oGVwqSBhDEwytaAxgZasHhFfQKibzTls0= -github.com/libp2p/go-libp2p-core v0.5.1/go.mod h1:uN7L2D4EvPCvzSH5SrhR72UWbnSGpt5/a35Sm4upn4Y= -github.com/libp2p/go-libp2p-core v0.5.4/go.mod h1:uN7L2D4EvPCvzSH5SrhR72UWbnSGpt5/a35Sm4upn4Y= -github.com/libp2p/go-libp2p-core v0.5.5/go.mod h1:vj3awlOr9+GMZJFH9s4mpt9RHHgGqeHCopzbYKZdRjM= -github.com/libp2p/go-libp2p-core v0.5.6/go.mod h1:txwbVEhHEXikXn9gfC7/UDDw7rkxuX0bJvM49Ykaswo= -github.com/libp2p/go-libp2p-core v0.5.7/go.mod h1:txwbVEhHEXikXn9gfC7/UDDw7rkxuX0bJvM49Ykaswo= -github.com/libp2p/go-libp2p-core v0.6.0/go.mod h1:txwbVEhHEXikXn9gfC7/UDDw7rkxuX0bJvM49Ykaswo= -github.com/libp2p/go-libp2p-core v0.7.0/go.mod h1:FfewUH/YpvWbEB+ZY9AQRQ4TAD8sJBt/G1rVvhz5XT8= -github.com/libp2p/go-libp2p-core v0.8.0/go.mod h1:FfewUH/YpvWbEB+ZY9AQRQ4TAD8sJBt/G1rVvhz5XT8= -github.com/libp2p/go-libp2p-core v0.8.1/go.mod h1:FfewUH/YpvWbEB+ZY9AQRQ4TAD8sJBt/G1rVvhz5XT8= -github.com/libp2p/go-libp2p-core v0.8.2/go.mod h1:FfewUH/YpvWbEB+ZY9AQRQ4TAD8sJBt/G1rVvhz5XT8= -github.com/libp2p/go-libp2p-core v0.8.5/go.mod h1:FfewUH/YpvWbEB+ZY9AQRQ4TAD8sJBt/G1rVvhz5XT8= -github.com/libp2p/go-libp2p-core v0.9.0/go.mod h1:ESsbz31oC3C1AvMJoGx26RTuCkNhmkSRCqZ0kQtJ2/8= github.com/libp2p/go-libp2p-crypto v0.1.0/go.mod h1:sPUokVISZiy+nNuTTH/TY+leRSxnFj/2GLjtOTW90hI= github.com/libp2p/go-libp2p-discovery v0.1.0/go.mod h1:4F/x+aldVHjHDHuX85x1zWoFTGElt8HnoDzwkFZm29g= -github.com/libp2p/go-libp2p-discovery v0.2.0/go.mod h1:s4VGaxYMbw4+4+tsoQTqh7wfxg97AEdo4GYBt6BadWg= -github.com/libp2p/go-libp2p-discovery v0.3.0/go.mod h1:o03drFnz9BVAZdzC/QUQ+NeQOu38Fu7LJGEOK2gQltw= -github.com/libp2p/go-libp2p-discovery v0.5.0/go.mod h1:+srtPIU9gDaBNu//UHvcdliKBIcr4SfDcm0/PfPJLug= -github.com/libp2p/go-libp2p-gostream v0.6.0 h1:QfAiWeQRce6pqnYfmIVWJFXNdDyfiR/qkCnjyaZUPYU= -github.com/libp2p/go-libp2p-gostream v0.6.0/go.mod h1:Nywu0gYZwfj7Jc91PQvbGU8dIpqbQQkjWgDuOrFaRdA= github.com/libp2p/go-libp2p-kad-dht v0.25.2 h1:FOIk9gHoe4YRWXTu8SY9Z1d0RILol0TrtApsMDPjAVQ= github.com/libp2p/go-libp2p-kad-dht v0.25.2/go.mod h1:6za56ncRHYXX4Nc2vn8z7CZK0P4QiMcrn77acKLM2Oo= github.com/libp2p/go-libp2p-kbucket v0.6.3 h1:p507271wWzpy2f1XxPzCQG9NiN6R6lHL9GiSErbQQo0= @@ -1065,145 +858,63 @@ github.com/libp2p/go-libp2p-kbucket v0.6.3/go.mod h1:RCseT7AH6eJWxxk2ol03xtP9pEH github.com/libp2p/go-libp2p-loggables v0.1.0/go.mod h1:EyumB2Y6PrYjr55Q3/tiJ/o3xoDasoRYM7nOzEpoa90= github.com/libp2p/go-libp2p-mplex v0.2.0/go.mod h1:Ejl9IyjvXJ0T9iqUTE1jpYATQ9NM3g+OtR+EMMODbKo= github.com/libp2p/go-libp2p-mplex v0.2.1/go.mod h1:SC99Rxs8Vuzrf/6WhmH41kNn13TiYdAWNYHrwImKLnE= -github.com/libp2p/go-libp2p-mplex v0.2.2/go.mod h1:74S9eum0tVQdAfFiKxAyKzNdSuLqw5oadDq7+L/FELo= -github.com/libp2p/go-libp2p-mplex v0.2.3/go.mod h1:CK3p2+9qH9x+7ER/gWWDYJ3QW5ZxWDkm+dVvjfuG3ek= -github.com/libp2p/go-libp2p-mplex v0.4.0/go.mod h1:yCyWJE2sc6TBTnFpjvLuEJgTSw/u+MamvzILKdX7asw= -github.com/libp2p/go-libp2p-mplex v0.4.1/go.mod h1:cmy+3GfqfM1PceHTLL7zQzAAYaryDu6iPSC+CIb094g= github.com/libp2p/go-libp2p-nat v0.0.4/go.mod h1:N9Js/zVtAXqaeT99cXgTV9e75KpnWCvVOiGzlcHmBbY= -github.com/libp2p/go-libp2p-nat v0.0.5/go.mod h1:1qubaE5bTZMJE+E/uu2URroMbzdubFz1ChgiN79yKPE= -github.com/libp2p/go-libp2p-nat v0.0.6/go.mod h1:iV59LVhB3IkFvS6S6sauVTSOrNEANnINbI/fkaLimiw= github.com/libp2p/go-libp2p-netutil v0.1.0/go.mod h1:3Qv/aDqtMLTUyQeundkKsA+YCThNdbQD54k3TqjpbFU= -github.com/libp2p/go-libp2p-noise v0.2.0/go.mod h1:IEbYhBBzGyvdLBoxxULL/SGbJARhUeqlO8lVSREYu2Q= github.com/libp2p/go-libp2p-peer v0.2.0/go.mod h1:RCffaCvUyW2CJmG2gAWVqwePwW7JMgxjsHm7+J5kjWY= github.com/libp2p/go-libp2p-peerstore v0.1.0/go.mod h1:2CeHkQsr8svp4fZ+Oi9ykN1HBb6u0MOvdJ7YIsmcwtY= -github.com/libp2p/go-libp2p-peerstore v0.1.3/go.mod h1:BJ9sHlm59/80oSkpWgr1MyY1ciXAXV397W6h1GH/uKI= -github.com/libp2p/go-libp2p-peerstore v0.2.0/go.mod h1:N2l3eVIeAitSg3Pi2ipSrJYnqhVnMNQZo9nkSCuAbnQ= -github.com/libp2p/go-libp2p-peerstore v0.2.1/go.mod h1:NQxhNjWxf1d4w6PihR8btWIRjwRLBr4TYKfNgrUkOPA= -github.com/libp2p/go-libp2p-peerstore v0.2.2/go.mod h1:NQxhNjWxf1d4w6PihR8btWIRjwRLBr4TYKfNgrUkOPA= -github.com/libp2p/go-libp2p-peerstore v0.2.6/go.mod h1:ss/TWTgHZTMpsU/oKVVPQCGuDHItOpf2W8RxAi50P2s= -github.com/libp2p/go-libp2p-peerstore v0.2.7/go.mod h1:ss/TWTgHZTMpsU/oKVVPQCGuDHItOpf2W8RxAi50P2s= -github.com/libp2p/go-libp2p-pnet v0.2.0/go.mod h1:Qqvq6JH/oMZGwqs3N1Fqhv8NVhrdYcO0BW4wssv21LA= github.com/libp2p/go-libp2p-pubsub v0.10.1 h1:/RqOZpEtAolsr8/9CC8KqROJSOZeu7lK7fPftn4MwNg= github.com/libp2p/go-libp2p-pubsub v0.10.1/go.mod h1:1OxbaT/pFRO5h+Dpze8hdHQ63R0ke55XTs6b6NwLLkw= -github.com/libp2p/go-libp2p-quic-transport v0.10.0/go.mod h1:RfJbZ8IqXIhxBRm5hqUEJqjiiY8xmEuq3HUDS993MkA= github.com/libp2p/go-libp2p-record v0.1.0/go.mod h1:ujNc8iuE5dlKWVy6wuL6dd58t0n7xI4hAIl8pE6wu5Q= github.com/libp2p/go-libp2p-record v0.2.0 h1:oiNUOCWno2BFuxt3my4i1frNrt7PerzB3queqa1NkQ0= github.com/libp2p/go-libp2p-record v0.2.0/go.mod h1:I+3zMkvvg5m2OcSdoL0KPljyJyvNDFGKX7QdlpYUcwk= github.com/libp2p/go-libp2p-routing-helpers v0.7.3 h1:u1LGzAMVRK9Nqq5aYDVOiq/HaB93U9WWczBzGyAC5ZY= github.com/libp2p/go-libp2p-routing-helpers v0.7.3/go.mod h1:cN4mJAD/7zfPKXBcs9ze31JGYAZgzdABEm+q/hkswb8= github.com/libp2p/go-libp2p-secio v0.1.0/go.mod h1:tMJo2w7h3+wN4pgU2LSYeiKPrfqBgkOsdiKK77hE7c8= -github.com/libp2p/go-libp2p-secio v0.2.0/go.mod h1:2JdZepB8J5V9mBp79BmwsaPQhRPNN2NrnB2lKQcdy6g= -github.com/libp2p/go-libp2p-secio v0.2.1/go.mod h1:cWtZpILJqkqrSkiYcDBh5lA3wbT2Q+hz3rJQq3iftD8= -github.com/libp2p/go-libp2p-secio v0.2.2/go.mod h1:wP3bS+m5AUnFA+OFO7Er03uO1mncHG0uVwGrwvjYlNY= github.com/libp2p/go-libp2p-swarm v0.1.0/go.mod h1:wQVsCdjsuZoc730CgOvh5ox6K8evllckjebkdiY5ta4= -github.com/libp2p/go-libp2p-swarm v0.2.2/go.mod h1:fvmtQ0T1nErXym1/aa1uJEyN7JzaTNyBcHImCxRpPKU= -github.com/libp2p/go-libp2p-swarm v0.2.3/go.mod h1:P2VO/EpxRyDxtChXz/VPVXyTnszHvokHKRhfkEgFKNM= -github.com/libp2p/go-libp2p-swarm v0.2.8/go.mod h1:JQKMGSth4SMqonruY0a8yjlPVIkb0mdNSwckW7OYziM= -github.com/libp2p/go-libp2p-swarm v0.3.0/go.mod h1:hdv95GWCTmzkgeJpP+GK/9D9puJegb7H57B5hWQR5Kk= -github.com/libp2p/go-libp2p-swarm v0.5.0/go.mod h1:sU9i6BoHE0Ve5SKz3y9WfKrh8dUat6JknzUehFx8xW4= github.com/libp2p/go-libp2p-testing v0.0.2/go.mod h1:gvchhf3FQOtBdr+eFUABet5a4MBLK8jM3V4Zghvmi+E= github.com/libp2p/go-libp2p-testing v0.0.3/go.mod h1:gvchhf3FQOtBdr+eFUABet5a4MBLK8jM3V4Zghvmi+E= github.com/libp2p/go-libp2p-testing v0.0.4/go.mod h1:gvchhf3FQOtBdr+eFUABet5a4MBLK8jM3V4Zghvmi+E= -github.com/libp2p/go-libp2p-testing v0.1.0/go.mod h1:xaZWMJrPUM5GlDBxCeGUi7kI4eqnjVyavGroI2nxEM0= -github.com/libp2p/go-libp2p-testing v0.1.1/go.mod h1:xaZWMJrPUM5GlDBxCeGUi7kI4eqnjVyavGroI2nxEM0= -github.com/libp2p/go-libp2p-testing v0.1.2-0.20200422005655-8775583591d8/go.mod h1:Qy8sAncLKpwXtS2dSnDOP8ktexIAHKu+J+pnZOFZLTc= -github.com/libp2p/go-libp2p-testing v0.3.0/go.mod h1:efZkql4UZ7OVsEfaxNHZPzIehtsBXMrXnCfJIgDti5g= -github.com/libp2p/go-libp2p-testing v0.4.0/go.mod h1:Q+PFXYoiYFN5CAEG2w3gLPEzotlKsNSbKQ/lImlOWF0= github.com/libp2p/go-libp2p-testing v0.12.0 h1:EPvBb4kKMWO29qP4mZGyhVzUyR25dvfUIK5WDu6iPUA= github.com/libp2p/go-libp2p-testing v0.12.0/go.mod h1:KcGDRXyN7sQCllucn1cOOS+Dmm7ujhfEyXQL5lvkcPg= -github.com/libp2p/go-libp2p-tls v0.1.3/go.mod h1:wZfuewxOndz5RTnCAxFliGjvYSDA40sKitV4c50uI1M= github.com/libp2p/go-libp2p-transport-upgrader v0.1.1/go.mod h1:IEtA6or8JUbsV07qPW4r01GnTenLW4oi3lOPbUMGJJA= -github.com/libp2p/go-libp2p-transport-upgrader v0.2.0/go.mod h1:mQcrHj4asu6ArfSoMuyojOdjx73Q47cYD7s5+gZOlns= -github.com/libp2p/go-libp2p-transport-upgrader v0.3.0/go.mod h1:i+SKzbRnvXdVbU3D1dwydnTmKRPXiAR/fyvi1dXuL4o= -github.com/libp2p/go-libp2p-transport-upgrader v0.4.2/go.mod h1:NR8ne1VwfreD5VIWIU62Agt/J18ekORFU/j1i2y8zvk= github.com/libp2p/go-libp2p-yamux v0.2.0/go.mod h1:Db2gU+XfLpm6E4rG5uGCFX6uXA8MEXOxFcRoXUODaK8= github.com/libp2p/go-libp2p-yamux v0.2.1/go.mod h1:1FBXiHDk1VyRM1C0aez2bCfHQ4vMZKkAQzZbkSQt5fI= -github.com/libp2p/go-libp2p-yamux v0.2.2/go.mod h1:lIohaR0pT6mOt0AZ0L2dFze9hds9Req3OfS+B+dv4qw= -github.com/libp2p/go-libp2p-yamux v0.2.5/go.mod h1:Zpgj6arbyQrmZ3wxSZxfBmbdnWtbZ48OpsfmQVTErwA= -github.com/libp2p/go-libp2p-yamux v0.2.7/go.mod h1:X28ENrBMU/nm4I3Nx4sZ4dgjZ6VhLEn0XhIoZ5viCwU= -github.com/libp2p/go-libp2p-yamux v0.2.8/go.mod h1:/t6tDqeuZf0INZMTgd0WxIRbtK2EzI2h7HbFm9eAKI4= -github.com/libp2p/go-libp2p-yamux v0.4.0/go.mod h1:+DWDjtFMzoAwYLVkNZftoucn7PelNoy5nm3tZ3/Zw30= -github.com/libp2p/go-libp2p-yamux v0.5.0/go.mod h1:AyR8k5EzyM2QN9Bbdg6X1SkVVuqLwTGf0L4DFq9g6po= -github.com/libp2p/go-libp2p-yamux v0.5.4/go.mod h1:tfrXbyaTqqSU654GTvK3ocnSZL3BuHoeTSqhcel1wsE= github.com/libp2p/go-maddr-filter v0.0.4/go.mod h1:6eT12kSQMA9x2pvFQa+xesMKUBlj9VImZbj3B9FBH/Q= -github.com/libp2p/go-maddr-filter v0.0.5/go.mod h1:Jk+36PMfIqCJhAnaASRH83bdAvfDRp/w6ENFaC9bG+M= github.com/libp2p/go-maddr-filter v0.1.0 h1:4ACqZKw8AqiuJfwFGq1CYDFugfXTOos+qQ3DETkhtCE= github.com/libp2p/go-maddr-filter v0.1.0/go.mod h1:VzZhTXkMucEGGEOSKddrwGiOv0tUhgnKqNEmIAz/bPU= github.com/libp2p/go-mplex v0.0.3/go.mod h1:pK5yMLmOoBR1pNCqDlA2GQrdAVTMkqFalaTWe7l4Yd0= github.com/libp2p/go-mplex v0.1.0/go.mod h1:SXgmdki2kwCUlCCbfGLEgHjC4pFqhTp0ZoV6aiKgxDU= -github.com/libp2p/go-mplex v0.1.1/go.mod h1:Xgz2RDCi3co0LeZfgjm4OgUF15+sVR8SRcu3SFXI1lk= -github.com/libp2p/go-mplex v0.1.2/go.mod h1:Xgz2RDCi3co0LeZfgjm4OgUF15+sVR8SRcu3SFXI1lk= -github.com/libp2p/go-mplex v0.2.0/go.mod h1:0Oy/A9PQlwBytDRp4wSkFnzHYDKcpLot35JQ6msjvYQ= -github.com/libp2p/go-mplex v0.3.0/go.mod h1:0Oy/A9PQlwBytDRp4wSkFnzHYDKcpLot35JQ6msjvYQ= github.com/libp2p/go-msgio v0.0.2/go.mod h1:63lBBgOTDKQL6EWazRMCwXsEeEeK9O2Cd+0+6OOuipQ= github.com/libp2p/go-msgio v0.0.3/go.mod h1:63lBBgOTDKQL6EWazRMCwXsEeEeK9O2Cd+0+6OOuipQ= -github.com/libp2p/go-msgio v0.0.4/go.mod h1:63lBBgOTDKQL6EWazRMCwXsEeEeK9O2Cd+0+6OOuipQ= -github.com/libp2p/go-msgio v0.0.6/go.mod h1:4ecVB6d9f4BDSL5fqvPiC4A3KivjWn+Venn/1ALLMWA= github.com/libp2p/go-msgio v0.3.0 h1:mf3Z8B1xcFN314sWX+2vOTShIE0Mmn2TXn3YCUQGNj0= github.com/libp2p/go-msgio v0.3.0/go.mod h1:nyRM819GmVaF9LX3l03RMh10QdOroF++NBbxAb0mmDM= github.com/libp2p/go-nat v0.0.3/go.mod h1:88nUEt0k0JD45Bk93NIwDqjlhiOwOoV36GchpcVc1yI= -github.com/libp2p/go-nat v0.0.4/go.mod h1:Nmw50VAvKuk38jUBcmNh6p9lUJLoODbJRvYAa/+KSDo= -github.com/libp2p/go-nat v0.0.5/go.mod h1:B7NxsVNPZmRLvMOwiEO1scOSyjA56zxYAGv1yQgRkEU= github.com/libp2p/go-nat v0.2.0 h1:Tyz+bUFAYqGyJ/ppPPymMGbIgNRH+WqC5QrT5fKrrGk= github.com/libp2p/go-nat v0.2.0/go.mod h1:3MJr+GRpRkyT65EpVPBstXLvOlAPzUVlG6Pwg9ohLJk= -github.com/libp2p/go-netroute v0.1.2/go.mod h1:jZLDV+1PE8y5XxBySEBgbuVAXbhtuHSdmLPL2n9MKbk= -github.com/libp2p/go-netroute v0.1.3/go.mod h1:jZLDV+1PE8y5XxBySEBgbuVAXbhtuHSdmLPL2n9MKbk= -github.com/libp2p/go-netroute v0.1.5/go.mod h1:V1SR3AaECRkEQCoFFzYwVYWvYIEtlxx89+O3qcpCl4A= -github.com/libp2p/go-netroute v0.1.6/go.mod h1:AqhkMh0VuWmfgtxKPp3Oc1LdU5QSWS7wl0QLhSZqXxQ= github.com/libp2p/go-netroute v0.2.1 h1:V8kVrpD8GK0Riv15/7VN6RbUQ3URNZVosw7H2v9tksU= github.com/libp2p/go-netroute v0.2.1/go.mod h1:hraioZr0fhBjG0ZRXJJ6Zj2IVEVNx6tDTFQfSmcq7mQ= -github.com/libp2p/go-openssl v0.0.2/go.mod h1:v8Zw2ijCSWBQi8Pq5GAixw6DbFfa9u6VIYDXnvOXkc0= -github.com/libp2p/go-openssl v0.0.3/go.mod h1:unDrJpgy3oFr+rqXsarWifmJuNnJR4chtO1HmaZjggc= -github.com/libp2p/go-openssl v0.0.4/go.mod h1:unDrJpgy3oFr+rqXsarWifmJuNnJR4chtO1HmaZjggc= -github.com/libp2p/go-openssl v0.0.5/go.mod h1:unDrJpgy3oFr+rqXsarWifmJuNnJR4chtO1HmaZjggc= -github.com/libp2p/go-openssl v0.0.7/go.mod h1:unDrJpgy3oFr+rqXsarWifmJuNnJR4chtO1HmaZjggc= github.com/libp2p/go-reuseport v0.0.1/go.mod h1:jn6RmB1ufnQwl0Q1f+YxAj8isJgDCQzaaxIFYDhcYEA= -github.com/libp2p/go-reuseport v0.0.2/go.mod h1:SPD+5RwGC7rcnzngoYC86GjPzjSywuQyMVAheVBD9nQ= github.com/libp2p/go-reuseport v0.4.0 h1:nR5KU7hD0WxXCJbmw7r2rhRYruNRl2koHw8fQscQm2s= github.com/libp2p/go-reuseport v0.4.0/go.mod h1:ZtI03j/wO5hZVDFo2jKywN6bYKWLOy8Se6DrI2E1cLU= github.com/libp2p/go-reuseport-transport v0.0.2/go.mod h1:YkbSDrvjUVDL6b8XqriyA20obEtsW9BLkuOUyQAOCbs= -github.com/libp2p/go-reuseport-transport v0.0.3/go.mod h1:Spv+MPft1exxARzP2Sruj2Wb5JSyHNncjf1Oi2dEbzM= -github.com/libp2p/go-reuseport-transport v0.0.4/go.mod h1:trPa7r/7TJK/d+0hdBLOCGvpQQVOU74OXbNCIMkufGw= -github.com/libp2p/go-sockaddr v0.0.2/go.mod h1:syPvOmNs24S3dFVGJA1/mrqdeijPxLV2Le3BRLKd68k= -github.com/libp2p/go-sockaddr v0.1.0/go.mod h1:syPvOmNs24S3dFVGJA1/mrqdeijPxLV2Le3BRLKd68k= -github.com/libp2p/go-sockaddr v0.1.1/go.mod h1:syPvOmNs24S3dFVGJA1/mrqdeijPxLV2Le3BRLKd68k= github.com/libp2p/go-stream-muxer v0.0.1/go.mod h1:bAo8x7YkSpadMTbtTaxGVHWUQsR/l5MEaHbKaliuT14= github.com/libp2p/go-stream-muxer-multistream v0.2.0/go.mod h1:j9eyPol/LLRqT+GPLSxvimPhNph4sfYfMoDPd7HkzIc= -github.com/libp2p/go-stream-muxer-multistream v0.3.0/go.mod h1:yDh8abSIzmZtqtOt64gFJUXEryejzNb0lisTt+fAMJA= github.com/libp2p/go-tcp-transport v0.1.0/go.mod h1:oJ8I5VXryj493DEJ7OsBieu8fcg2nHGctwtInJVpipc= -github.com/libp2p/go-tcp-transport v0.1.1/go.mod h1:3HzGvLbx6etZjnFlERyakbaYPdfjg2pWP97dFZworkY= -github.com/libp2p/go-tcp-transport v0.2.0/go.mod h1:vX2U0CnWimU4h0SGSEsg++AzvBcroCGYw28kh94oLe0= -github.com/libp2p/go-tcp-transport v0.2.3/go.mod h1:9dvr03yqrPyYGIEN6Dy5UvdJZjyPFvl1S/igQ5QD1SU= github.com/libp2p/go-testutil v0.1.0/go.mod h1:81b2n5HypcVyrCg/MJx4Wgfp/VHojytjVe/gLzZ2Ehc= github.com/libp2p/go-ws-transport v0.1.0/go.mod h1:rjw1MG1LU9YDC6gzmwObkPd/Sqwhw7yT74kj3raBFuo= -github.com/libp2p/go-ws-transport v0.2.0/go.mod h1:9BHJz/4Q5A9ludYWKoGCFC5gUElzlHoKzu0yY9p/klM= -github.com/libp2p/go-ws-transport v0.3.0/go.mod h1:bpgTJmRZAvVHrgHybCVyqoBmyLQ1fiZuEaBYusP5zsk= -github.com/libp2p/go-ws-transport v0.4.0/go.mod h1:EcIEKqf/7GDjth6ksuS/6p7R49V4CBY6/E7R/iyhYUA= github.com/libp2p/go-yamux v1.2.2/go.mod h1:FGTiPvoV/3DVdgWpX+tM0OW3tsM+W5bSE3gZwqQTcow= github.com/libp2p/go-yamux v1.2.3/go.mod h1:FGTiPvoV/3DVdgWpX+tM0OW3tsM+W5bSE3gZwqQTcow= -github.com/libp2p/go-yamux v1.3.0/go.mod h1:FGTiPvoV/3DVdgWpX+tM0OW3tsM+W5bSE3gZwqQTcow= -github.com/libp2p/go-yamux v1.3.3/go.mod h1:FGTiPvoV/3DVdgWpX+tM0OW3tsM+W5bSE3gZwqQTcow= -github.com/libp2p/go-yamux v1.3.5/go.mod h1:FGTiPvoV/3DVdgWpX+tM0OW3tsM+W5bSE3gZwqQTcow= -github.com/libp2p/go-yamux v1.3.7/go.mod h1:fr7aVgmdNGJK+N1g+b6DW6VxzbRCjCOejR/hkmpooHE= -github.com/libp2p/go-yamux v1.4.0/go.mod h1:fr7aVgmdNGJK+N1g+b6DW6VxzbRCjCOejR/hkmpooHE= -github.com/libp2p/go-yamux v1.4.1/go.mod h1:fr7aVgmdNGJK+N1g+b6DW6VxzbRCjCOejR/hkmpooHE= -github.com/libp2p/go-yamux/v2 v2.2.0/go.mod h1:3So6P6TV6r75R9jiBpiIKgU/66lOarCZjqROGxzPpPQ= github.com/libp2p/go-yamux/v4 v4.0.1 h1:FfDR4S1wj6Bw2Pqbc8Uz7pCxeRBPbwsBbEdfwiCypkQ= github.com/libp2p/go-yamux/v4 v4.0.1/go.mod h1:NWjl8ZTLOGlozrXSOZ/HlfG++39iKNnM5wwmtQP1YB4= -github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= -github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= -github.com/lucas-clemente/quic-go v0.19.3/go.mod h1:ADXpNbTQjq1hIzCpB+y/k5iz4n4z4IwqoLb94Kh5Hu8= github.com/lucasb-eyer/go-colorful v1.0.3/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0= github.com/lucasb-eyer/go-colorful v1.2.0 h1:1nnpGOrhyZZuNyfu1QjKiUICQ74+3FNCN69Aj6K7nkY= github.com/lucasb-eyer/go-colorful v1.2.0/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0= github.com/lunixbochs/vtclean v1.0.0/go.mod h1:pHhQNgMf3btfWnGBVipUOjRYhoOsdGqdm/+2c2E2WMI= -github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= github.com/magefile/mage v1.9.0 h1:t3AU2wNwehMCW97vuqQLtw6puppWXHO+O2MHo5a50XE= github.com/magefile/mage v1.9.0/go.mod h1:z5UZb/iS3GoOSn0JgWuiw7dxlurVYTu+/jHXqQg881A= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magik6k/reflink v1.0.2-patch1 h1:NXSgQugcESI8Z/jBtuAI83YsZuRauY9i9WOyOnJ7Vns= github.com/magik6k/reflink v1.0.2-patch1/go.mod h1:WGkTOKNjd1FsJKBw3mu4JvrPEDJyJJ+JPtxBkbPoCok= -github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.0.0-20190312143242-1de009706dbe/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= @@ -1213,9 +924,6 @@ github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0 github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= github.com/manifoldco/promptui v0.9.0 h1:3V4HzJk1TtXW1MTZMP7mdlwbBpIinw3HztaIlYthEiA= github.com/manifoldco/promptui v0.9.0/go.mod h1:ka04sppxSGFAtxX0qhlYQjISsg9mR4GWtQEhdbn6Pgg= -github.com/marten-seemann/qpack v0.2.1/go.mod h1:F7Gl5L1jIgN1D11ucXefiuJS9UMVP2opoCp2jDKb7wc= -github.com/marten-seemann/qtls v0.10.0/go.mod h1:UvMd1oaYDACI99/oZUYLzMCkBXQVT0aGm99sJhbT8hs= -github.com/marten-seemann/qtls-go1-15 v0.1.1/go.mod h1:GyFwywLKkRt+6mfU99csTEY1joMZz5vmB1WNZH3P81I= github.com/marten-seemann/tcp v0.0.0-20210406111302-dfbc87cc63fd h1:br0buuQ854V8u83wA0rVZ8ttrq5CpaPZdvrK0LP2lOk= github.com/marten-seemann/tcp v0.0.0-20210406111302-dfbc87cc63fd/go.mod h1:QuCEs1Nt24+FYQEqAAncTDPJIuGs+LxK1MCiFL25pMU= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= @@ -1225,7 +933,6 @@ github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVc github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= -github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.5/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.13/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= @@ -1233,7 +940,6 @@ github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27k github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= -github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/mattn/go-runewidth v0.0.7/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= github.com/mattn/go-runewidth v0.0.10/go.mod h1:RAqKPSqVFrSLVXbA8x7dzmKdmGzieGRCM46jaSJTDAk= github.com/mattn/go-runewidth v0.0.12/go.mod h1:RAqKPSqVFrSLVXbA8x7dzmKdmGzieGRCM46jaSJTDAk= @@ -1242,11 +948,8 @@ github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh github.com/mattn/go-sqlite3 v1.14.16 h1:yOQRA0RpS5PFz/oikGwBEqvAWhWg5ufRz4ETLjwpU1Y= github.com/mattn/go-sqlite3 v1.14.16/go.mod h1:2eHXhiwb8IkHr+BDWZGa96P6+rkvnG63S2DGjv9HUNg= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= -github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b/go.mod h1:01TrycV0kFyexm33Z7vhZRXopbI8J3TDReVlkTgMUxE= github.com/microcosm-cc/bluemonday v1.0.1/go.mod h1:hsXNsILzKxV+sX77C5b8FSuKF00vh2OMYv+xgHpAMF4= -github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= github.com/miekg/dns v1.1.12/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= -github.com/miekg/dns v1.1.28/go.mod h1:KNUDUusw/aVsxyTYZM1oqvCicbwhgbNgztCETuNZ7xM= github.com/miekg/dns v1.1.41/go.mod h1:p6aan82bvRIyn+zDIv9xYNUpwa73JcSh9BKwknJysuI= github.com/miekg/dns v1.1.58 h1:ca2Hdkz+cDg/7eNF6V56jjzuZ4aCAE+DbVkILdQWG/4= github.com/miekg/dns v1.1.58/go.mod h1:Ypv+3b/KadlvW9vJfXOTf300O4UqaHFzFCuHz+rPkBY= @@ -1266,14 +969,8 @@ github.com/minio/sha256-simd v0.1.1/go.mod h1:B5e1o+1/KgNmWrSQK08Y6Z1Vb5pwIktudl github.com/minio/sha256-simd v1.0.0/go.mod h1:OuYzVNI5vcoYIAmbIvHPl3N3jUzVedXbKy5RFepssQM= github.com/minio/sha256-simd v1.0.1 h1:6kaan5IFmwTNynnKKpDHe6FWHohJOHhCPchzK49dzMM= github.com/minio/sha256-simd v1.0.1/go.mod h1:Pz6AKMiUdngCLpeTL/RJY1M9rUuPMYujV5xJjtbRSN8= -github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= -github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= -github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= -github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg= -github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= -github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= @@ -1300,38 +997,23 @@ github.com/multiformats/go-base36 v0.2.0/go.mod h1:qvnKE++v+2MWCfePClUEjE78Z7P2a github.com/multiformats/go-multiaddr v0.0.1/go.mod h1:xKVEak1K9cS1VdmPZW3LSIb6lgmoS58qz/pzqmAxV44= github.com/multiformats/go-multiaddr v0.0.2/go.mod h1:xKVEak1K9cS1VdmPZW3LSIb6lgmoS58qz/pzqmAxV44= github.com/multiformats/go-multiaddr v0.0.4/go.mod h1:xKVEak1K9cS1VdmPZW3LSIb6lgmoS58qz/pzqmAxV44= -github.com/multiformats/go-multiaddr v0.1.0/go.mod h1:xKVEak1K9cS1VdmPZW3LSIb6lgmoS58qz/pzqmAxV44= github.com/multiformats/go-multiaddr v0.1.1/go.mod h1:aMKBKNEYmzmDmxfX88/vz+J5IU55txyt0p4aiWVohjo= github.com/multiformats/go-multiaddr v0.2.0/go.mod h1:0nO36NvPpyV4QzvTLi/lafl2y95ncPj0vFwVF6k6wJ4= -github.com/multiformats/go-multiaddr v0.2.1/go.mod h1:s/Apk6IyxfvMjDafnhJgJ3/46z7tZ04iMk5wP4QMGGE= github.com/multiformats/go-multiaddr v0.2.2/go.mod h1:NtfXiOtHvghW9KojvtySjH5y0u0xW5UouOmQQrn6a3Y= -github.com/multiformats/go-multiaddr v0.3.0/go.mod h1:dF9kph9wfJ+3VLAaeBqo9Of8x4fJxp6ggJGteB8HQTI= -github.com/multiformats/go-multiaddr v0.3.1/go.mod h1:uPbspcUPd5AfaP6ql3ujFY+QWzmBD8uLLL4bXW0XfGc= -github.com/multiformats/go-multiaddr v0.3.3/go.mod h1:lCKNGP1EQ1eZ35Za2wlqnabm9xQkib3fyB+nZXHLag0= github.com/multiformats/go-multiaddr v0.12.3 h1:hVBXvPRcKG0w80VinQ23P5t7czWgg65BmIvQKjDydU8= github.com/multiformats/go-multiaddr v0.12.3/go.mod h1:sBXrNzucqkFJhvKOiwwLyqamGa/P5EIXNPLovyhQCII= github.com/multiformats/go-multiaddr-dns v0.0.1/go.mod h1:9kWcqw/Pj6FwxAwW38n/9403szc57zJPs45fmnznu3Q= github.com/multiformats/go-multiaddr-dns v0.0.2/go.mod h1:9kWcqw/Pj6FwxAwW38n/9403szc57zJPs45fmnznu3Q= -github.com/multiformats/go-multiaddr-dns v0.2.0/go.mod h1:TJ5pr5bBO7Y1B18djPuRsVkduhQH2YqYSbxWJzYGdK0= github.com/multiformats/go-multiaddr-dns v0.3.1 h1:QgQgR+LQVt3NPTjbrLLpsaT2ufAA2y0Mkk+QRVJbW3A= github.com/multiformats/go-multiaddr-dns v0.3.1/go.mod h1:G/245BRQ6FJGmryJCrOuTdB37AMA5AMOVuO6NY3JwTk= github.com/multiformats/go-multiaddr-fmt v0.0.1/go.mod h1:aBYjqL4T/7j4Qx+R73XSv/8JsgnRFlf0w2KGLCmXl3Q= github.com/multiformats/go-multiaddr-fmt v0.1.0 h1:WLEFClPycPkp4fnIzoFoV9FVd49/eQsuaL3/CWe167E= github.com/multiformats/go-multiaddr-fmt v0.1.0/go.mod h1:hGtDIW4PU4BqJ50gW2quDuPVjyWNZxToGUh/HwTZYJo= github.com/multiformats/go-multiaddr-net v0.0.1/go.mod h1:nw6HSxNmCIQH27XPGBuX+d1tnvM7ihcFwHMSstNAVUU= -github.com/multiformats/go-multiaddr-net v0.1.0/go.mod h1:5JNbcfBOP4dnhoZOv10JJVkJO0pCCEf8mTnipAo2UZQ= -github.com/multiformats/go-multiaddr-net v0.1.1/go.mod h1:5JNbcfBOP4dnhoZOv10JJVkJO0pCCEf8mTnipAo2UZQ= -github.com/multiformats/go-multiaddr-net v0.1.2/go.mod h1:QsWt3XK/3hwvNxZJp92iMQKME1qHfpYmyIjFVsSOY6Y= -github.com/multiformats/go-multiaddr-net v0.1.3/go.mod h1:ilNnaM9HbmVFqsb/qcNysjCu4PVONlrBZpHIrw/qQuA= -github.com/multiformats/go-multiaddr-net v0.1.4/go.mod h1:ilNnaM9HbmVFqsb/qcNysjCu4PVONlrBZpHIrw/qQuA= -github.com/multiformats/go-multiaddr-net v0.1.5/go.mod h1:ilNnaM9HbmVFqsb/qcNysjCu4PVONlrBZpHIrw/qQuA= -github.com/multiformats/go-multiaddr-net v0.2.0/go.mod h1:gGdH3UXny6U3cKKYCvpXI5rnK7YaOIEOPVDI9tsJbEA= github.com/multiformats/go-multibase v0.0.1/go.mod h1:bja2MqRZ3ggyXtZSEDKpl0uO/gviWFaSteVbWT51qgs= github.com/multiformats/go-multibase v0.0.3/go.mod h1:5+1R4eQrT3PkYZ24C3W2Ue2tPwIdYQD509ZjSb5y9Oc= github.com/multiformats/go-multibase v0.2.0 h1:isdYCVLvksgWlMW9OZRYJEa9pZETFivncJHmHnnd87g= github.com/multiformats/go-multibase v0.2.0/go.mod h1:bFBZX4lKCA/2lyOFSAoKH5SS6oPyjtnzK/XTFDPkNuk= -github.com/multiformats/go-multicodec v0.3.0/go.mod h1:qGGaQmioCDh+TeFOnxrbU0DaIPw8yFgAZgFG0V7p1qQ= -github.com/multiformats/go-multicodec v0.3.1-0.20210902112759-1539a079fd61/go.mod h1:1Hj/eHRaVWSXiSNNfcEPcwZleTmdNP81xlxDLnWU9GQ= github.com/multiformats/go-multicodec v0.6.0/go.mod h1:GUC8upxSBE4oG+q3kWZRw/+6yC1BqO550bjhWsJbZlw= github.com/multiformats/go-multicodec v0.9.0 h1:pb/dlPnzee/Sxv/j4PmkDRxCOi3hXTz3IbPKOXWJkmg= github.com/multiformats/go-multicodec v0.9.0/go.mod h1:L3QTQvMIaVBkXOXXtVmYE+LI16i14xuaojr/H7Ai54k= @@ -1343,31 +1025,19 @@ github.com/multiformats/go-multihash v0.0.10/go.mod h1:YSLudS+Pi8NHE7o6tb3D8vrpK github.com/multiformats/go-multihash v0.0.13/go.mod h1:VdAWLKTwram9oKAatUcLxBNUjdtcVwxObEQBtRfuyjc= github.com/multiformats/go-multihash v0.0.14/go.mod h1:VdAWLKTwram9oKAatUcLxBNUjdtcVwxObEQBtRfuyjc= github.com/multiformats/go-multihash v0.0.15/go.mod h1:D6aZrWNLFTV/ynMpKsNtB40mJzmCl4jb1alC0OvHiHg= -github.com/multiformats/go-multihash v0.1.0/go.mod h1:RJlXsxt6vHGaia+S8We0ErjhojtKzPP2AH4+kYM7k84= github.com/multiformats/go-multihash v0.2.1/go.mod h1:WxoMcYG85AZVQUyRyo9s4wULvW5qrI9vb2Lt6evduFc= github.com/multiformats/go-multihash v0.2.3 h1:7Lyc8XfX/IY2jWb/gI7JP+o7JEq9hOa7BFvVU9RSh+U= github.com/multiformats/go-multihash v0.2.3/go.mod h1:dXgKXCXjBzdscBLk9JkjINiEsCKRVch90MdaGiKsvSM= github.com/multiformats/go-multistream v0.1.0/go.mod h1:fJTiDfXJVmItycydCnNx4+wSzZ5NwG2FEVAI30fiovg= -github.com/multiformats/go-multistream v0.1.1/go.mod h1:KmHZ40hzVxiaiwlj3MEbYgK9JFk2/9UktWZAF54Du38= -github.com/multiformats/go-multistream v0.2.1/go.mod h1:5GZPQZbkWOLOn3J2y4Y99vVW7vOfsAflxARk3x14o6k= -github.com/multiformats/go-multistream v0.2.2/go.mod h1:UIcnm7Zuo8HKG+HkWgfQsGL+/MIEhyTqbODbIUwSXKs= github.com/multiformats/go-multistream v0.5.0 h1:5htLSLl7lvJk3xx3qT/8Zm9J4K8vEOf/QGkvOGQAyiE= github.com/multiformats/go-multistream v0.5.0/go.mod h1:n6tMZiwiP2wUsR8DgfDWw1dydlEqV3l6N3/GBsX6ILA= github.com/multiformats/go-varint v0.0.1/go.mod h1:3Ls8CIEsrijN6+B7PbrXRPxHRPuXSrVKRY101jdMZYE= -github.com/multiformats/go-varint v0.0.2/go.mod h1:3Ls8CIEsrijN6+B7PbrXRPxHRPuXSrVKRY101jdMZYE= github.com/multiformats/go-varint v0.0.5/go.mod h1:3Ls8CIEsrijN6+B7PbrXRPxHRPuXSrVKRY101jdMZYE= github.com/multiformats/go-varint v0.0.6/go.mod h1:3Ls8CIEsrijN6+B7PbrXRPxHRPuXSrVKRY101jdMZYE= github.com/multiformats/go-varint v0.0.7 h1:sWSGR+f/eu5ABZA2ZpYKBILXTTs9JWpdEM/nEGOHFS8= github.com/multiformats/go-varint v0.0.7/go.mod h1:r8PUYw/fD/SjBCiKOoDlGF6QawOELpZAu9eioSos/OU= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= -github.com/nats-io/jwt v0.3.0/go.mod h1:fRYCDE99xlTsqUzISS1Bi75UBJ6ljOJQOAAu5VglpSg= -github.com/nats-io/jwt v0.3.2/go.mod h1:/euKqTS1ZD+zzjYrY7pseZrTtWQSjujC7xjPc8wL6eU= -github.com/nats-io/nats-server/v2 v2.1.2/go.mod h1:Afk+wRZqkMQs/p45uXdrVLuab3gwv3Z8C4HTBu8GD/k= -github.com/nats-io/nats.go v1.9.1/go.mod h1:ZjDU1L/7fJ09jvUSRVBR2e7+RnLiiIQyqyzEE/Zbp4w= -github.com/nats-io/nkeys v0.1.0/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= -github.com/nats-io/nkeys v0.1.3/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= -github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= github.com/neelance/astrewrite v0.0.0-20160511093645-99348263ae86/go.mod h1:kHJEU3ofeGjhHklVoIGuVj85JJwZ6kWPaJwCIxgnFmo= github.com/neelance/sourcemap v0.0.0-20151028013722-8c68805598ab/go.mod h1:Qr6/a/Q4r9LP1IltGz7tA7iOK1WonHEYhu1HRBA7ZiM= github.com/ngdinhtoan/glide-cleanup v0.2.0/go.mod h1:UQzsmiDOb8YV3nOsCxK/c9zPpCZVNoHScRE3EO9pVMM= @@ -1377,27 +1047,20 @@ github.com/nkovacs/streamquote v1.0.0 h1:PmVIV08Zlx2lZK5fFZlMZ04eHcDTIFJCv/5/0tw github.com/nkovacs/streamquote v1.0.0/go.mod h1:BN+NaZ2CmdKqUuTUXUEm9j95B2TRbpOWpxbJYzzgUsc= github.com/nxadm/tail v1.4.4 h1:DQuhQpB1tVlglWS2hLQ5OV6B5r8aGxSrPc5Qo6uTN78= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= -github.com/oklog/oklog v0.3.2/go.mod h1:FCV+B7mhrz4o+ueLpx+KqkyXRGMWOYEvfiXtdGtbWGs= -github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= -github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.8.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.12.0/go.mod h1:oUhWkIvk5aDxtKvDDuw8gItl8pKl42LzjC9KZE0HfGg= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= github.com/onsi/ginkgo v1.14.0 h1:2mOpI4JVVPBN+WQRa0WKH2eXR+Ey+uK4n7Zj0aYpIQA= github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= github.com/onsi/ginkgo/v2 v2.15.0 h1:79HwNRBAZHOEwrczrgSOPy+eFTTlIGELKy5as+ClttY= github.com/onsi/ginkgo/v2 v2.15.0/go.mod h1:HlxMHtYF57y6Dpf+mc5529KKmSq9h2FpCF+/ZkwUxKM= -github.com/onsi/gomega v1.4.1/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.5.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= -github.com/onsi/gomega v1.9.0/go.mod h1:Ho0h+IUsWyvy1OpqCwxlQ/21gkhVunqlU8fDGcoTdcA= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/onsi/gomega v1.30.0 h1:hvMK7xYz4D3HapigLTeGdId/NcfQx1VHMJc60ew99+8= github.com/onsi/gomega v1.30.0/go.mod h1:9sxs+SwGrKI0+PWe4Fxa9tFQQBG5xSsSbMXOI8PPpoQ= -github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk= github.com/open-rpc/meta-schema v0.0.0-20201029221707-1b72ef2ea333 h1:CznVS40zms0Dj5he4ERo+fRPtO0qxUk8lA8Xu3ddet0= github.com/open-rpc/meta-schema v0.0.0-20201029221707-1b72ef2ea333/go.mod h1:Ag6rSXkHIckQmjFBCweJEEt1mrTPBv8b9W4aU/NQWfI= github.com/opencontainers/runtime-spec v1.0.2/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= @@ -1405,35 +1068,22 @@ github.com/opencontainers/runtime-spec v1.2.0 h1:z97+pHb3uELt/yiAWD691HNHQIF07bE github.com/opencontainers/runtime-spec v1.2.0/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= github.com/opentracing-contrib/go-grpc v0.0.0-20210225150812-73cb765af46e h1:4cPxUYdgaGzZIT5/j0IfqOrrXmq6bG8AwvwisMXpdrg= github.com/opentracing-contrib/go-grpc v0.0.0-20210225150812-73cb765af46e/go.mod h1:DYR5Eij8rJl8h7gblRrOZ8g0kW1umSpKqYIBTgeDtLo= -github.com/opentracing-contrib/go-observer v0.0.0-20170622124052-a52f23424492/go.mod h1:Ngi6UdF0k5OKD5t5wlmGhe/EDKPoUM3BXZSSfIuJbis= github.com/opentracing-contrib/go-stdlib v1.0.0 h1:TBS7YuVotp8myLon4Pv7BtCBzOTo1DeZCld0Z63mW2w= github.com/opentracing-contrib/go-stdlib v1.0.0/go.mod h1:qtI1ogk+2JhVPIXVc6q+NHziSmy2W5GbdQZFUHADCBU= -github.com/opentracing/basictracer-go v1.0.0/go.mod h1:QfBfYuafItcjQuMwinw9GhYKwFXS9KnPs5lxoYwgW74= github.com/opentracing/opentracing-go v1.0.2/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= github.com/opentracing/opentracing-go v1.2.0 h1:uEJPy/1a5RIPAJ0Ov+OIO8OxWu77jEv+1B0VhjKrZUs= github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc= -github.com/openzipkin-contrib/zipkin-go-opentracing v0.4.5/go.mod h1:/wsWhb9smxSfWAKL3wpBW7V8scJMt8N8gnaMCS9E/cA= github.com/openzipkin/zipkin-go v0.1.1/go.mod h1:NtoC/o8u3JlF1lSlyPNswIbeQH9bJTmOf0Erfk+hxe8= -github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJc5AZX7/PBEpw= -github.com/openzipkin/zipkin-go v0.2.1/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= -github.com/openzipkin/zipkin-go v0.2.2/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= -github.com/pact-foundation/pact-go v1.0.4/go.mod h1:uExwJY4kCzNPcHRj+hCR/HBbOOIwwtUjcrb0b5/5kLM= -github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58 h1:onHthvaw9LFnH4t2DcNVpwGmV9E1BkGknEliJkfwQj0= github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58/go.mod h1:DXv8WO4yhMYhSNPKjeNKa5WY9YCIEBRbNzFFPJbWO6Y= -github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= -github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac= github.com/petar/GoLLRB v0.0.0-20210522233825-ae3b015fd3e9 h1:1/WtZae0yGtPq+TI6+Tv1WTxkukpXeMlviSxvL7SRgk= github.com/petar/GoLLRB v0.0.0-20210522233825-ae3b015fd3e9/go.mod h1:x3N5drFsm2uilKKuuYo6LdyD8vZAW55sH/9w+pbo1sw= -github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc= -github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/profile v1.2.1/go.mod h1:hJw3o1OdXxsrSjjVksARp5W95eeEaEfptyVZyv6JUPA= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/polydawn/refmt v0.0.0-20190221155625-df39d6c2d992/go.mod h1:uIp+gprXxxrWSjjklXD+mN4wed/tMfjMMmN/9+JsA9o= @@ -1443,15 +1093,11 @@ github.com/polydawn/refmt v0.0.0-20190809202753-05966cbd336a/go.mod h1:uIp+gprXx github.com/polydawn/refmt v0.0.0-20201211092308-30ac6d18308e/go.mod h1:uIp+gprXxxrWSjjklXD+mN4wed/tMfjMMmN/9+JsA9o= github.com/polydawn/refmt v0.89.0 h1:ADJTApkvkeBZsN0tBTx8QjpD9JkmxbKp0cxfr9qszm4= github.com/polydawn/refmt v0.89.0/go.mod h1:/zvteZs/GwLtCgZ4BL6CBsk9IKIlexP43ObX9AxTqTw= -github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= github.com/prometheus/client_golang v0.8.0/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.2/go.mod h1:OsXs2jCmiKlQ1lTBmv21f2mNfw4xf/QclQDMrYNZzcM= -github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829/go.mod h1:p2iRAGwDERtqlqzRXnrOVns+ignqQo//hLXqYxZYVNs= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= -github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeDPbaTKGT+JTgUa3og= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= -github.com/prometheus/client_golang v1.10.0/go.mod h1:WJM3cc3yu7XKBKa/I8WeZm+V3eltZnBwfENSU7mdogU= github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= github.com/prometheus/client_golang v1.12.1/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= github.com/prometheus/client_golang v1.12.2/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= @@ -1459,20 +1105,15 @@ github.com/prometheus/client_golang v1.13.0/go.mod h1:vTeo+zgvILHsnnj/39Ou/1fPN5 github.com/prometheus/client_golang v1.18.0 h1:HzFfmkOzH5Q8L8G+kSJKUx5dtG87sewO+FoDDqP5Tbk= github.com/prometheus/client_golang v1.18.0/go.mod h1:T+GXkCk5wSJyOqMIzVgvvjFDlkOQntgjkJWKrN5txjA= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= -github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.1.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.6.0 h1:k1v3CzpSRUTrKMppY35TLwPvxHqBu0bYgxZzqGIgaos= github.com/prometheus/client_model v0.6.0/go.mod h1:NTQHnmxFpouOD0DpvP4XujX3CdOAGQPoaGhyTchlyt8= github.com/prometheus/common v0.0.0-20180801064454-c7de2306084e/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= github.com/prometheus/common v0.0.0-20181126121408-4724e9255275/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= -github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= -github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt26CguLLsqA= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= -github.com/prometheus/common v0.18.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= github.com/prometheus/common v0.32.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= github.com/prometheus/common v0.35.0/go.mod h1:phzohg0JFMnBEFGxTDbfu3QyL5GI8gTQJFhYO5B3mfA= @@ -1482,10 +1123,8 @@ github.com/prometheus/common v0.47.0/go.mod h1:0/KsvlIEfPQCQ5I2iNSAWKPZziNCvRs5E github.com/prometheus/procfs v0.0.0-20180725123919-05ee40e3a273/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20181204211112-1dc9a6cbc91a/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= -github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190425082905-87a4384529e0/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= -github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= @@ -1506,29 +1145,22 @@ github.com/raulk/clock v1.1.0 h1:dpb29+UKMbLqiU/jqIJptgLR1nn23HLgMY0sTCDza5Y= github.com/raulk/clock v1.1.0/go.mod h1:3MpVxdZ/ODBQDxbN+kzshf5OSZwPjtMDx6BBXBmOeY0= github.com/raulk/go-watchdog v1.3.0 h1:oUmdlHxdkXRJlwfG0O9omj8ukerm8MEQavSiDTEtBsk= github.com/raulk/go-watchdog v1.3.0/go.mod h1:fIvOnLbF0b0ZwkB9YU4mOW9Did//4vPZtDqv66NfsMU= -github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/rivo/uniseg v0.1.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ= github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= -github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= github.com/rogpeppe/go-internal v1.1.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= -github.com/rs/xid v1.2.1/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ= -github.com/rs/zerolog v1.21.0/go.mod h1:ZPhntP/xmq1nnND05hhpAh2QMhSsA4UN3MGZ6O2J3hM= github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/rwcarlsen/goexif v0.0.0-20190401172101-9e8deecbddbd/go.mod h1:hPqNNc0+uJM6H+SuU8sEs5K5IQeKccPqeSjfgcKGgPk= -github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/samber/lo v1.39.0 h1:4gTz1wUhNYLhFSKl6O+8peW0v2F4BCY034GRpU9WnuA= github.com/samber/lo v1.39.0/go.mod h1:+m/ZKRl6ClXCE2Lgf3MsQlWfh4bn1bz6CXEOxnEXnEA= -github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da/go.mod h1:gi+0XIa01GRL2eRQVjQkKGqKF3SF9vZR/HnPullcV2E= -github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= github.com/sercand/kuberesolver/v4 v4.0.0 h1:frL7laPDG/lFm5n98ODmWnn+cvPpzlkf3LhzuPhcHP4= github.com/sercand/kuberesolver/v4 v4.0.0/go.mod h1:F4RGyuRmMAjeXHKL+w4P7AwUnPceEAPAhxUgXZjKgvM= github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= @@ -1561,7 +1193,6 @@ github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPx github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= -github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/sirupsen/logrus v1.9.2 h1:oxx1eChJGI6Uks2ZC4W1zpLlVgqB8ner4EuQwV4Ik1Y= github.com/sirupsen/logrus v1.9.2/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= @@ -1576,9 +1207,6 @@ github.com/smartystreets/goconvey v0.0.0-20190731233626-505e41936337/go.mod h1:s github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/smartystreets/goconvey v1.7.2 h1:9RBaZCeXEQ3UselpuwUQHltGVXvdwm6cv1hgR6gDIPg= github.com/smartystreets/goconvey v1.7.2/go.mod h1:Vw0tHAZW6lzCRk3xgdin6fKYcG+G3Pg9vgXWeJpQFMM= -github.com/smola/gocompat v0.2.0/go.mod h1:1B0MlxbmoZNo3h8guHp8HztB3BSYR5itql9qtVc0ypY= -github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= -github.com/sony/gobreaker v0.4.1/go.mod h1:ZKptC7FHNvhBz7dN2LGjPVBz2sZJmc0/PkyDJOjmxWY= github.com/sourcegraph/annotate v0.0.0-20160123013949-f4cad6c6324d/go.mod h1:UdhH50NIW0fCiwBSr0co2m7BnFLdv4fQTgdqdJTHFeE= github.com/sourcegraph/syntaxhighlight v0.0.0-20170531221838-bd320f5d308e/go.mod h1:HuIsMU8RRBOtsCgI77wP899iHVBQpCmg4ErYMZB+2IA= github.com/spacemonkeygo/openssl v0.0.0-20181017203307-c2dcc5cca94a/go.mod h1:7AyxJNCJ7SBZ1MfVQCWD6Uqo2oubI2Eq2y2eqf+A5r0= @@ -1588,16 +1216,10 @@ github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0b github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= -github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= -github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= -github.com/src-d/envconfig v1.0.0/go.mod h1:Q9YQZ7BKITldTBnoxsE5gOeB5y66RyPXeue/R4aaNBc= -github.com/streadway/amqp v0.0.0-20190404075320-75d898a42a94/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= -github.com/streadway/amqp v0.0.0-20190827072141-edfb9018d271/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= -github.com/streadway/handy v0.0.0-20190108123426-d5acb3125c2a/go.mod h1:qNTQ5P5JnDBl6z3cMAg/SywNDC5ABu5ApDIw6lUbRmI= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= @@ -1633,21 +1255,15 @@ github.com/tidwall/match v1.1.1/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JT github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= github.com/tidwall/pretty v1.2.0 h1:RWIZEg2iJ8/g6fDDYzMpobmaoGh5OLl4AXtGUGPcqCs= github.com/tidwall/pretty v1.2.0/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU= -github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/triplewz/poseidon v0.0.0-20230828015038-79d8165c88ed h1:C8H2ql+vCBhEi7d3vMBBbdCAKv9s/thfPyLEuSvFpMU= github.com/triplewz/poseidon v0.0.0-20230828015038-79d8165c88ed/go.mod h1:QYG1d0B4YZD7TgF6qZndTTu4rxUGFCCZAQRDanDj+9c= -github.com/twmb/murmur3 v1.1.6 h1:mqrRot1BRxm+Yct+vavLMou2/iJt0tNVTTC0QoIjaZg= -github.com/twmb/murmur3 v1.1.6/go.mod h1:Qq/R7NUyOfr65zD+6Q5IHKsJLwP7exErjN6lyyq3OSQ= github.com/uber/jaeger-client-go v2.30.0+incompatible h1:D6wyKGCecFaSRUpo8lCVbaOOb6ThwMmTEbhRwtKR97o= github.com/uber/jaeger-client-go v2.30.0+incompatible/go.mod h1:WVhlPFC8FDjOFMMWRy2pZqQJSXxYSwNYOkTr/Z6d3Kk= github.com/uber/jaeger-lib v2.4.1+incompatible h1:td4jdvLcExb4cBISKIpHuGoVXh+dVKhn2Um6rjCsSsg= github.com/uber/jaeger-lib v2.4.1+incompatible/go.mod h1:ComeNDZlWwrWnDv8aPp0Ba6+uUTzImX/AauajbLI56U= github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= -github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= -github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= github.com/urfave/cli v1.22.2/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= github.com/urfave/cli v1.22.10/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= -github.com/urfave/cli/v2 v2.0.0/go.mod h1:SE9GqnLQmjVa0iPEY0f1w3ygNIYcIJ0OKPMoW2caLfQ= github.com/urfave/cli/v2 v2.25.5 h1:d0NIAyhh5shGscroL7ek/Ya9QYQE0KNabJgiUinIQkc= github.com/urfave/cli/v2 v2.25.5/go.mod h1:GHupkWPMM0M/sj1a2b4wUrWBPzazNrIjouW6fmdJLxc= github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw= @@ -1656,7 +1272,6 @@ github.com/valyala/fasttemplate v1.0.1 h1:tY9CJiPnMXf1ERmG2EyK7gNUd+c6RKGD0IfU8W github.com/valyala/fasttemplate v1.0.1/go.mod h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPUpymEIMZ47gx8= github.com/viant/assertly v0.4.8/go.mod h1:aGifi++jvCrUaklKEKT0BU95igDNaqkvz+49uaYMPRU= github.com/viant/toolbox v0.24.0/go.mod h1:OxMCG57V0PXuIP2HNQrtJf2CjqdmbrOx5EkMILuUhzM= -github.com/warpfork/go-testmark v0.3.0/go.mod h1:jhEf8FVxd+F17juRubpmut64NEG6I2rgkUhlcqqXwE0= github.com/warpfork/go-testmark v0.10.0/go.mod h1:jhEf8FVxd+F17juRubpmut64NEG6I2rgkUhlcqqXwE0= github.com/warpfork/go-testmark v0.12.1 h1:rMgCpJfwy1sJ50x0M0NgyphxYYPMOODIJHhsXyEHU0s= github.com/warpfork/go-testmark v0.12.1/go.mod h1:kHwy7wfvGSPh1rQJYKayD4AbtNaeyZdcGi9tNJTaa5Y= @@ -1677,13 +1292,11 @@ github.com/whyrusleeping/cbor-gen v0.0.0-20191216205031-b047b6acb3c0/go.mod h1:x github.com/whyrusleeping/cbor-gen v0.0.0-20200123233031-1cdf64d27158/go.mod h1:Xj/M2wWU+QdTdRbu/L/1dIZY8/Wb2K9pAhtroQuxJJI= github.com/whyrusleeping/cbor-gen v0.0.0-20200414195334-429a0b5e922e/go.mod h1:Xj/M2wWU+QdTdRbu/L/1dIZY8/Wb2K9pAhtroQuxJJI= github.com/whyrusleeping/cbor-gen v0.0.0-20200504204219-64967432584d/go.mod h1:W5MvapuoHRP8rz4vxjwCK1pDqF1aQcWsV5PZ+AHbqdg= -github.com/whyrusleeping/cbor-gen v0.0.0-20200710004633-5379fc63235d/go.mod h1:fgkXqYy7bV2cFeIEOkVTZS/WjXARfBqSH6Q2qHL33hQ= github.com/whyrusleeping/cbor-gen v0.0.0-20200715143311-227fab5a2377/go.mod h1:fgkXqYy7bV2cFeIEOkVTZS/WjXARfBqSH6Q2qHL33hQ= github.com/whyrusleeping/cbor-gen v0.0.0-20200723185710-6a3894a6352b/go.mod h1:fgkXqYy7bV2cFeIEOkVTZS/WjXARfBqSH6Q2qHL33hQ= github.com/whyrusleeping/cbor-gen v0.0.0-20200806213330-63aa96ca5488/go.mod h1:fgkXqYy7bV2cFeIEOkVTZS/WjXARfBqSH6Q2qHL33hQ= github.com/whyrusleeping/cbor-gen v0.0.0-20200810223238-211df3b9e24c/go.mod h1:fgkXqYy7bV2cFeIEOkVTZS/WjXARfBqSH6Q2qHL33hQ= github.com/whyrusleeping/cbor-gen v0.0.0-20200812213548-958ddffe352c/go.mod h1:fgkXqYy7bV2cFeIEOkVTZS/WjXARfBqSH6Q2qHL33hQ= -github.com/whyrusleeping/cbor-gen v0.0.0-20200826160007-0b9f6c5fb163/go.mod h1:fgkXqYy7bV2cFeIEOkVTZS/WjXARfBqSH6Q2qHL33hQ= github.com/whyrusleeping/cbor-gen v0.0.0-20210118024343-169e9d70c0c2/go.mod h1:fgkXqYy7bV2cFeIEOkVTZS/WjXARfBqSH6Q2qHL33hQ= github.com/whyrusleeping/cbor-gen v0.0.0-20210303213153-67a261a1d291/go.mod h1:fgkXqYy7bV2cFeIEOkVTZS/WjXARfBqSH6Q2qHL33hQ= github.com/whyrusleeping/cbor-gen v0.0.0-20220323183124-98fa8256a799/go.mod h1:fgkXqYy7bV2cFeIEOkVTZS/WjXARfBqSH6Q2qHL33hQ= @@ -1695,23 +1308,19 @@ github.com/whyrusleeping/chunker v0.0.0-20181014151217-fe64bd25879f/go.mod h1:p9 github.com/whyrusleeping/go-keyspace v0.0.0-20160322163242-5b898ac5add1 h1:EKhdznlJHPMoKr0XTrX+IlJs1LH3lyx2nfr1dOlZ79k= github.com/whyrusleeping/go-keyspace v0.0.0-20160322163242-5b898ac5add1/go.mod h1:8UvriyWtv5Q5EOgjHaSseUEdkQfvwFv1I/In/O2M9gc= github.com/whyrusleeping/go-logging v0.0.0-20170515211332-0457bb6b88fc/go.mod h1:bopw91TMyo8J3tvftk8xmU2kPmlrt4nScJQZU2hE5EM= -github.com/whyrusleeping/go-logging v0.0.1/go.mod h1:lDPYj54zutzG1XYfHAhcc7oNXEburHQBn+Iqd4yS4vE= github.com/whyrusleeping/go-notifier v0.0.0-20170827234753-097c5d47330f/go.mod h1:cZNvX9cFybI01GriPRMXDtczuvUhgbcYr9iCGaNlRv8= github.com/whyrusleeping/mafmt v1.2.8/go.mod h1:faQJFPbLSxzD9xpA02ttW/tS9vZykNvXwGvqIpk20FA= github.com/whyrusleeping/mdns v0.0.0-20180901202407-ef14215e6b30/go.mod h1:j4l84WPFclQPj320J9gp0XwNKBb3U0zt5CBqjPp22G4= -github.com/whyrusleeping/mdns v0.0.0-20190826153040-b9b60ed33aa9/go.mod h1:j4l84WPFclQPj320J9gp0XwNKBb3U0zt5CBqjPp22G4= github.com/whyrusleeping/multiaddr-filter v0.0.0-20160516205228-e903e4adabd7 h1:E9S12nwJwEOXe2d6gT6qxdvqMnNq+VnSsKPgm2ZZNds= github.com/whyrusleeping/multiaddr-filter v0.0.0-20160516205228-e903e4adabd7/go.mod h1:X2c0RVCI1eSUFI8eLcY3c0423ykwiUdxLJtkDvruhjI= github.com/wk8/go-ordered-map/v2 v2.1.8 h1:5h/BUHu93oj4gIdvHHHGsScSTMijfx5PeYkE/fJgbpc= github.com/wk8/go-ordered-map/v2 v2.1.8/go.mod h1:5nJHM5DyteebpVlHnWMV0rPz6Zp7+xBAnxjb1X5vnTw= -github.com/x-cray/logrus-prefixed-formatter v0.5.2/go.mod h1:2duySbKsL6M18s5GU7VPsoEPHyzalCE06qoARUCeBBE= github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f h1:J9EGpcZtP0E/raorCMxlFGSTBrsSlaDGf3jU/qvAE2c= github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 h1:EzJWgHovont7NscjpAxXsDA8S8BMYve8Y5+7cuRE7R0= github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ= github.com/xeipuuv/gojsonschema v1.2.0 h1:LhYJRs+L4fBtjZUfuSZIKGeVu0QRy8e5Xi7D17UxZ74= github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y= -github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= github.com/xorcare/golden v0.6.0/go.mod h1:7T39/ZMvaSEZlBPoYfVFmsBLmUl3uz9IuzWj/U6FtvQ= github.com/xorcare/golden v0.6.1-0.20191112154924-b87f686d7542 h1:oWgZJmC1DorFZDpfMfWg7xk29yEOZiXmo/wZl+utTI8= github.com/xorcare/golden v0.6.1-0.20191112154924-b87f686d7542/go.mod h1:7T39/ZMvaSEZlBPoYfVFmsBLmUl3uz9IuzWj/U6FtvQ= @@ -1738,42 +1347,31 @@ go.dedis.ch/fixbuf v1.0.3 h1:hGcV9Cd/znUxlusJ64eAlExS+5cJDIyTyEG+otu5wQs= go.dedis.ch/fixbuf v1.0.3/go.mod h1:yzJMt34Wa5xD37V5RTdmp38cz3QhMagdGoem9anUalw= go.dedis.ch/protobuf v1.0.11 h1:FTYVIEzY/bfl37lu3pR4lIj+F9Vp1jE8oh91VmxKgLo= go.dedis.ch/protobuf v1.0.11/go.mod h1:97QR256dnkimeNdfmURz0wAMNVbd1VmLXhG1CrTYrJ4= -go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/bbolt v1.3.7 h1:j+zJOnnEjF/kyHlDDgGnVL/AIqIJPq8UoB2GSNfkUfQ= go.etcd.io/bbolt v1.3.7/go.mod h1:N9Mkw9X8x5fupy0IKsmuqVtoGDyxsaDlbk4Rd05IAQw= -go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738/go.mod h1:dnLIgRNXwCJa5e+c6mIZCrds/GIG4ncV9HhK5PX7jPg= go.opencensus.io v0.18.0/go.mod h1:vKdFvxhtzZ9onBp9VKHK8z/sRpBMnKAsufL7wlDrCOA= -go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= -go.opencensus.io v0.20.2/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= -go.opencensus.io v0.22.1/go.mod h1:Ap50jQcDJrx6rB6VgeeFPtuPIf3wMRvRfrfYDO6+BmA= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= -go.opentelemetry.io/otel v0.20.0/go.mod h1:Y3ugLH2oa81t5QO+Lty+zXf8zC9L26ax4Nzoxm/dooo= go.opentelemetry.io/otel v1.21.0 h1:hzLeKBZEL7Okw2mGzZ0cc4k/A7Fta0uoPgaJCr8fsFc= go.opentelemetry.io/otel v1.21.0/go.mod h1:QZzNPQPm1zLX4gZK4cMi+71eaorMSGT3A4znnUvNNEo= go.opentelemetry.io/otel/bridge/opencensus v0.39.0 h1:YHivttTaDhbZIHuPlg1sWsy2P5gj57vzqPfkHItgbwQ= go.opentelemetry.io/otel/bridge/opencensus v0.39.0/go.mod h1:vZ4537pNjFDXEx//WldAR6Ro2LC8wwmFC76njAXwNPE= go.opentelemetry.io/otel/exporters/jaeger v1.14.0 h1:CjbUNd4iN2hHmWekmOqZ+zSCU+dzZppG8XsV+A3oc8Q= go.opentelemetry.io/otel/exporters/jaeger v1.14.0/go.mod h1:4Ay9kk5vELRrbg5z4cpP9EtmQRFap2Wb0woPG4lujZA= -go.opentelemetry.io/otel/metric v0.20.0/go.mod h1:598I5tYlH1vzBjn+BTuhzTCSb/9debfNp6R3s7Pr1eU= go.opentelemetry.io/otel/metric v1.21.0 h1:tlYWfeo+Bocx5kLEloTjbcDwBuELRrIFxwdQ36PlJu4= go.opentelemetry.io/otel/metric v1.21.0/go.mod h1:o1p3CA8nNHW8j5yuQLdc1eeqEaPfzug24uvsyIEJRWM= -go.opentelemetry.io/otel/oteltest v0.20.0/go.mod h1:L7bgKf9ZB7qCwT9Up7i9/pn0PWIa9FqQ2IQ8LoxiGnw= -go.opentelemetry.io/otel/sdk v0.20.0/go.mod h1:g/IcepuwNsoiX5Byy2nNV0ySUF1em498m7hBWC279Yc= go.opentelemetry.io/otel/sdk v1.21.0 h1:FTt8qirL1EysG6sTQRZ5TokkU8d0ugCj8htOgThZXQ8= go.opentelemetry.io/otel/sdk v1.21.0/go.mod h1:Nna6Yv7PWTdgJHVRD9hIYywQBRx7pbox6nwBnZIxl/E= go.opentelemetry.io/otel/sdk/metric v0.39.0 h1:Kun8i1eYf48kHH83RucG93ffz0zGV1sh46FAScOTuDI= go.opentelemetry.io/otel/sdk/metric v0.39.0/go.mod h1:piDIRgjcK7u0HCL5pCA4e74qpK/jk3NiUoAHATVAmiI= -go.opentelemetry.io/otel/trace v0.20.0/go.mod h1:6GjCW8zgDjwGHGa6GkyeB8+/5vjT16gUEi0Nf1iBdgw= go.opentelemetry.io/otel/trace v1.21.0 h1:WD9i5gzvoUPuXIXH24ZNBudiarZDKuekPqi/E8fpfLc= go.opentelemetry.io/otel/trace v1.21.0/go.mod h1:LGbsEB0f9LGjN+OZaQQ26sohbOmiMR+BaslueVtS/qQ= -go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= @@ -1784,25 +1382,20 @@ go.uber.org/dig v1.17.1 h1:Tga8Lz8PcYNsWsyHMZ1Vm0OQOUaJNDyvPImgbAu9YSc= go.uber.org/dig v1.17.1/go.mod h1:Us0rSJiThwCv2GteUN0Q7OKvU7n5J4dxZ9JKUXozFdE= go.uber.org/fx v1.20.1 h1:zVwVQGS8zYvhh9Xxcu4w1M6ESyeMzebzj2NbSayZ4Mk= go.uber.org/fx v1.20.1/go.mod h1:iSYNbHf2y55acNCwCXKx7LbWb5WG1Bnue5RDXz1OREg= -go.uber.org/goleak v1.0.0/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A= go.uber.org/goleak v1.1.11-0.20210813005559-691160354723/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/mock v0.4.0 h1:VcM4ZOtdbR4f6VXfiOpwpVJDL6lCReaZ6mw31wqh7KU= go.uber.org/mock v0.4.0/go.mod h1:a6FSlNadKUHUa9IP5Vyt1zh4fC7uAwxMutEAscFbkZc= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= -go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= go.uber.org/multierr v1.4.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU= go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= -go.uber.org/multierr v1.7.0/go.mod h1:7EAYxJLBy9rStEaz58O2t4Uvip6FSURkq8/ppBp95ak= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= -go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= go.uber.org/zap v1.14.1/go.mod h1:Mb2vm2krFEG5DV0W9qcHBYFtp/Wku1cvYaqPsS/WYfc= -go.uber.org/zap v1.15.0/go.mod h1:Mb2vm2krFEG5DV0W9qcHBYFtp/Wku1cvYaqPsS/WYfc= go.uber.org/zap v1.16.0/go.mod h1:MA8QOfq0BHJwdXa996Y4dYkAqRKB8/1K1QMMZVaNZjQ= go.uber.org/zap v1.19.1/go.mod h1:j3DNczoxDZroyBnOT1L/Q79cfUMGZxlv/9dzN7SM1rI= go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8= @@ -1814,7 +1407,6 @@ go4.org v0.0.0-20230225012048-214862532bf5/go.mod h1:F57wTi5Lrj6WLyswp5EYV1ncrEb golang.org/x/build v0.0.0-20190111050920-041ab4dc3f9d/go.mod h1:OWs+y06UdEOHN4y+MfF/py+xQ/tYqIWW03b70/CG9Rw= golang.org/x/crypto v0.0.0-20170930174604-9419663f5a44/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181030102418-4d3f4d9ffa16/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190211182817-74369b46fc67/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= @@ -1827,22 +1419,14 @@ golang.org/x/crypto v0.0.0-20190513172903-22d7a77e9e5f/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20190530122614-20be4c3c3ed5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190618222545-ea8f1a30c443/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190621222207-cc06ce4a13d4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190927123631-a832865fa7ad/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20200115085410-6d4e4cb37c7d/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200221231518-2aa609cf4a9d/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200510223506-06a226fb4e37/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200602180216-279210d13fed/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210506145944-38f3c27a63bf/go.mod h1:P+XmwS30IXTQdn5tA2iutPOUgjI07+tq3H3K9MVA1s8= -golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a/go.mod h1:P+XmwS30IXTQdn5tA2iutPOUgjI07+tq3H3K9MVA1s8= -golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw= @@ -1852,7 +1436,6 @@ golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOM golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= -golang.org/x/exp v0.0.0-20190731235908-ec7cb31e5a56/go.mod h1:JhuoJpWY28nO4Vef9tZUw9qufEGTyX1+7lmHxV5q5G4= golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= @@ -1860,8 +1443,6 @@ golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= -golang.org/x/exp v0.0.0-20210615023648-acb5c1269671/go.mod h1:DVyR6MI7P4kEQgvZJSj1fQGrWIi2RzIrfYWycwheUAc= -golang.org/x/exp v0.0.0-20210714144626-1041f73d31d8/go.mod h1:DVyR6MI7P4kEQgvZJSj1fQGrWIi2RzIrfYWycwheUAc= golang.org/x/exp v0.0.0-20240213143201-ec583247a57a h1:HinSgX1tJRX3KsL//Gxynpw5CTOAIPhgL4W8PNiIpVE= golang.org/x/exp v0.0.0-20240213143201-ec583247a57a/go.mod h1:CxmFvTBINI24O/j8iY7H1xHzx2i4OsyguNBmN/uPtqc= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= @@ -1879,12 +1460,10 @@ golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPI golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= -golang.org/x/mobile v0.0.0-20201217150744-e6ae53a27f4f/go.mod h1:skQtrUTUwhdJvXM/2KKJzY8pDgNr9I/FOMqDVRPBUS4= golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= -golang.org/x/mod v0.1.1-0.20191209134235-331c550502dd/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= @@ -1892,19 +1471,15 @@ golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91 golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.15.0 h1:SernR4v+D55NyBH2QiEQrlBAnj1ECL6AGrA5+dPaMY8= golang.org/x/mod v0.15.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= -golang.org/x/net v0.0.0-20180719180050-a680a1efc54d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181011144130-49bb7cea24b1/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181029044818-c44066c5c816/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181106065722-10aee1819953/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190125091013-d26f9f9a57f3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190227160552-c95aed5357e7/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= @@ -1919,9 +1494,7 @@ golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -1943,9 +1516,7 @@ golang.org/x/net v0.0.0-20201022231255-08b38378de70/go.mod h1:sp8m0HH+o8qH0wwXwY golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= -golang.org/x/net v0.0.0-20210423184538-5f58ad60dda6/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= @@ -1985,13 +1556,10 @@ golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180202135801-37707fdb30a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180810173357-98c5dad5d1a0/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181029174526-d69651ed3497/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -2002,14 +1570,12 @@ golang.org/x/sys v0.0.0-20190228124157-a34e9553db1e/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20190302025703-b6889370fb10/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190316082340-a2f829d7f35f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190405154228-4b34438f7a67/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190515120540-06a5c4944438/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190524122548-abf6ff778158/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190526052359-791d8a0f4d09/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190610200419-93c9922d18ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190616124812-15dcb6c0061f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -2019,14 +1585,12 @@ golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190924154521-2837fb4f24fe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191025021431-6c3a3bfe00ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191220142924-d4481acd189f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -2052,18 +1616,12 @@ golang.org/x/sys v0.0.0-20200814200057-3d37ad5750ed/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201101102859-da207088b7d1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210303074136-134d130e1a04/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210309074719-68d13333faf2/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210317225723-c4fcb01b228e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210331175145-43e1dd70ce54/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210426080607-c94f62235c83/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210514084401-e8d321eab015/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -2118,7 +1676,6 @@ golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGm golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20181030000716-a0a13e073c7b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20181130052023-1c3d964395ce/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= @@ -2138,17 +1695,13 @@ golang.org/x/tools v0.0.0-20190927191325-030b2cf1153e/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191108193012-7d206e10da11/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191216052735-49a3e744a425/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200103221440-774c71fcf114/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200117012304-6edc0a871e69/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= @@ -2169,7 +1722,6 @@ golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= @@ -2187,7 +1739,6 @@ gonum.org/v1/gonum v0.14.0/go.mod h1:AoWeoz0becf9QMWtE8iWXNXc27fK4fNeHNf/oMejGfU google.golang.org/api v0.0.0-20180910000450-7ca32eb868bf/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0= google.golang.org/api v0.0.0-20181030000543-1d582fd0359e/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0= google.golang.org/api v0.1.0/go.mod h1:UGEZY7KEX120AnNLIHFMKIo4obdJhkp2tPbaPlQx13Y= -google.golang.org/api v0.3.1/go.mod h1:6wY9I6uQWHQ8EM57III9mq/AjF+i8G65rmVagqKMtkk= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= @@ -2221,7 +1772,6 @@ google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRn google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190530194941-fb225487d101/go.mod h1:z3L6/3dTEVtUr6QSP8miRzeRqwQOioJ9I66odjN4I7s= google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= @@ -2256,23 +1806,17 @@ google.golang.org/grpc v1.14.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmE google.golang.org/grpc v1.16.0/go.mod h1:0JHn/cJsOMiMfNA9+DeHDlAU7KAAB5GDlYFpa9MZMio= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= -google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= -google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= -google.golang.org/grpc v1.22.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= -google.golang.org/grpc v1.23.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= -google.golang.org/grpc v1.28.1/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= google.golang.org/grpc v1.60.1 h1:26+wFr+cNqSGFcOXcabYC0lUVJVRa2Sb2ortSK7VrEU= google.golang.org/grpc v1.60.1/go.mod h1:OlCHIeLYqSSsLi6i49B5QGdzaMZK9+M7LXN2FKz4eGM= @@ -2288,7 +1832,6 @@ google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGj google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= @@ -2299,20 +1842,13 @@ gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8 gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= -gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= gopkg.in/cheggaaa/pb.v1 v1.0.28 h1:n1tBJnnK2r7g9OW2btFH91V92STTUevLXYFb8gy9EMk= gopkg.in/cheggaaa/pb.v1 v1.0.28/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= -gopkg.in/gcfg.v1 v1.2.3/go.mod h1:yesOnuUOFQAhST5vPY4nbZsb/huCgGGXlipJsBn0b3o= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= -gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= -gopkg.in/src-d/go-cli.v0 v0.0.0-20181105080154-d492247bbc0d/go.mod h1:z+K8VcOYVYcSwSjGebuDL6176A1XskgbtNl64NSg+n8= -gopkg.in/src-d/go-log.v1 v1.0.1/go.mod h1:GN34hKP0g305ysm2/hctJ0Y8nWP3zxXXJ8GFabTyABE= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= -gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI= -gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= @@ -2337,7 +1873,6 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -honnef.co/go/tools v0.1.3/go.mod h1:NgwopIslSNH47DimFoV78dnkksY2EFtX0ajyb3K/las= howett.net/plist v0.0.0-20181124034731-591f970eefbb h1:jhnBjNi9UFpfpl8YZhA9CrOqpnJdvzuiHsl/dnxl11M= howett.net/plist v0.0.0-20181124034731-591f970eefbb/go.mod h1:vMygbs4qMhSZSc4lCUl2OEE+rDiIIJAIdR4m7MiMcm0= lukechampine.com/blake3 v1.1.6/go.mod h1:tkKEOtDkNtklkXtLNEOGNq5tcV90tJiA1vAA12R78LA= @@ -2347,7 +1882,5 @@ lukechampine.com/blake3 v1.2.1/go.mod h1:0OFRp7fBtAylGVCO40o87sbupkyIGgbpv1+M1k1 rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= -sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= -sourcegraph.com/sourcegraph/appdash v0.0.0-20190731080439-ebfcffb1b5c0/go.mod h1:hI742Nqp5OhwiqlzhgfbWU4mW4yO10fP+LoT9WOswdU= sourcegraph.com/sourcegraph/go-diff v0.5.0/go.mod h1:kuch7UrkMzY0X+p9CRK03kfuPQ2zzQcaEFbx8wA8rck= sourcegraph.com/sqs/pbtypes v0.0.0-20180604144634-d3ebe8f20ae4/go.mod h1:ketZ/q3QxT9HOBeFhu6RdvsftgpsbFHBF5Cas6cDKZ0= diff --git a/itests/batch_deal_test.go b/itests/batch_deal_test.go deleted file mode 100644 index 21db9f08d0e..00000000000 --- a/itests/batch_deal_test.go +++ /dev/null @@ -1,147 +0,0 @@ -// stm: #integration -package itests - -import ( - "context" - "fmt" - "sort" - "testing" - "time" - - "github.com/stretchr/testify/require" - - "github.com/filecoin-project/go-state-types/abi" - "github.com/filecoin-project/go-state-types/big" - - "github.com/filecoin-project/lotus/itests/kit" - "github.com/filecoin-project/lotus/markets/storageadapter" - "github.com/filecoin-project/lotus/node" - "github.com/filecoin-project/lotus/node/config" - "github.com/filecoin-project/lotus/node/modules" - "github.com/filecoin-project/lotus/node/modules/dtypes" - "github.com/filecoin-project/lotus/storage/pipeline/sealiface" -) - -func TestBatchDealInput(t *testing.T) { - //stm: @MINER_SECTOR_STATUS_001, @MINER_SECTOR_LIST_001 - kit.QuietMiningLogs() - - var ( - blockTime = 10 * time.Millisecond - - // For these tests where the block time is artificially short, just use - // a deal start epoch that is guaranteed to be far enough in the future - // so that the deal starts sealing in time - dealStartEpoch = abi.ChainEpoch(2 << 12) - ) - - run := func(piece, deals, expectSectors int) func(t *testing.T) { - return func(t *testing.T) { - t.Logf("batchtest start") - - ctx := context.Background() - - publishPeriod := 10 * time.Second - maxDealsPerMsg := uint64(deals) - - // Set max deals per publish deals message to maxDealsPerMsg - opts := kit.ConstructorOpts(node.Options( - node.Override( - new(*storageadapter.DealPublisher), - storageadapter.NewDealPublisher(nil, storageadapter.PublishMsgConfig{ - Period: publishPeriod, - MaxDealsPerMsg: maxDealsPerMsg, - })), - node.Override(new(dtypes.GetSealingConfigFunc), func() (dtypes.GetSealingConfigFunc, error) { - return func() (sealiface.Config, error) { - cfg := config.DefaultStorageMiner() - sc := modules.ToSealingConfig(cfg.Dealmaking, cfg.Sealing) - sc.MaxWaitDealsSectors = 2 - sc.MaxSealingSectors = 1 - sc.MaxSealingSectorsForDeals = 3 - sc.AlwaysKeepUnsealedCopy = true - sc.WaitDealsDelay = time.Hour - sc.AggregateCommits = false - - return sc, nil - }, nil - }), - )) - client, miner, ens := kit.EnsembleMinimal(t, kit.MockProofs(), opts, kit.ThroughRPC()) - ens.InterconnectAll().BeginMining(blockTime) - dh := kit.NewDealHarness(t, client, miner, miner) - - err := miner.MarketSetAsk(ctx, big.Zero(), big.Zero(), 200, 128, 32<<30) - require.NoError(t, err) - - t.Logf("batchtest ask set") - - checkNoPadding := func() { - sl, err := miner.SectorsListNonGenesis(ctx) - require.NoError(t, err) - - sort.Slice(sl, func(i, j int) bool { - return sl[i] < sl[j] - }) - - for _, snum := range sl { - si, err := miner.SectorsStatus(ctx, snum, false) - require.NoError(t, err) - - // fmt.Printf("S %d: %+v %s\n", snum, si.Deals, si.State) - - for _, deal := range si.Deals { - if deal == 0 { - fmt.Printf("sector %d had a padding piece!\n", snum) - } - } - } - } - - // Starts a deal and waits until it's published - runDealTillSeal := func(rseed int) { - res, _, _, err := kit.CreateImportFile(ctx, client, rseed, piece) - require.NoError(t, err) - - dp := dh.DefaultStartDealParams() - dp.Data.Root = res.Root - dp.DealStartEpoch = dealStartEpoch - - deal := dh.StartDeal(ctx, dp) - dh.WaitDealSealed(ctx, deal, false, true, checkNoPadding) - } - - // Run maxDealsPerMsg deals in parallel - done := make(chan struct{}, maxDealsPerMsg) - for rseed := 0; rseed < int(maxDealsPerMsg); rseed++ { - rseed := rseed - go func() { - runDealTillSeal(rseed) - done <- struct{}{} - }() - } - - t.Logf("batchtest deals started") - - // Wait for maxDealsPerMsg of the deals to be published - for i := 0; i < int(maxDealsPerMsg); i++ { - <-done - } - - t.Logf("batchtest deals published") - - checkNoPadding() - - t.Logf("batchtest no padding") - - sl, err := miner.SectorsListNonGenesis(ctx) - require.NoError(t, err) - require.Equal(t, len(sl), expectSectors) - - t.Logf("batchtest done") - } - } - - t.Run("4-p1600B", run(1600, 4, 4)) - t.Run("4-p513B", run(513, 4, 2)) -} diff --git a/itests/cli_test.go b/itests/cli_test.go deleted file mode 100644 index d2a0876356b..00000000000 --- a/itests/cli_test.go +++ /dev/null @@ -1,27 +0,0 @@ -// stm: #integration -package itests - -import ( - "os" - "testing" - "time" - - "github.com/filecoin-project/lotus/cli/clicommands" - "github.com/filecoin-project/lotus/itests/kit" -) - -// TestClient does a basic test to exercise the client CLI commands. -func TestClient(t *testing.T) { - //stm: @CHAIN_SYNCER_LOAD_GENESIS_001, @CHAIN_SYNCER_FETCH_TIPSET_001, - //stm: @CHAIN_SYNCER_START_001, @CHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01 - //stm: @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001 - //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 - //stm: @CHAIN_INCOMING_HANDLE_INCOMING_BLOCKS_001, @CHAIN_INCOMING_VALIDATE_BLOCK_PUBSUB_001, @CHAIN_INCOMING_VALIDATE_MESSAGE_PUBSUB_001 - _ = os.Setenv("BELLMAN_NO_GPU", "1") - kit.QuietMiningLogs() - - blockTime := 5 * time.Millisecond - client, _, ens := kit.EnsembleMinimal(t, kit.MockProofs(), kit.ThroughRPC()) - ens.InterconnectAll().BeginMining(blockTime) - kit.RunClientTest(t, clicommands.Commands, client) -} diff --git a/itests/deals_512mb_test.go b/itests/deals_512mb_test.go deleted file mode 100644 index 7b55204d910..00000000000 --- a/itests/deals_512mb_test.go +++ /dev/null @@ -1,51 +0,0 @@ -// stm: #integration -package itests - -import ( - "context" - "testing" - "time" - - "github.com/stretchr/testify/require" - - "github.com/filecoin-project/go-state-types/abi" - - "github.com/filecoin-project/lotus/itests/kit" -) - -func TestStorageDealMissingBlock(t *testing.T) { - //stm: @CHAIN_SYNCER_LOAD_GENESIS_001, @CHAIN_SYNCER_FETCH_TIPSET_001, - //stm: @CHAIN_SYNCER_START_001, @CHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01 - //stm: @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001 - //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 - - //stm: @CHAIN_INCOMING_HANDLE_INCOMING_BLOCKS_001, @CHAIN_INCOMING_VALIDATE_BLOCK_PUBSUB_001, @CHAIN_INCOMING_VALIDATE_MESSAGE_PUBSUB_001 - //stm: @CLIENT_STORAGE_DEALS_LIST_IMPORTS_001 - ctx := context.Background() - - kit.QuietMiningLogs() - - client, miner, ens := kit.EnsembleMinimal(t, - kit.MockProofs(), - kit.SectorSize(512<<20), // 512MiB sectors. - ) - ens.InterconnectAll().BeginMining(50 * time.Millisecond) - - dh := kit.NewDealHarness(t, client, miner, miner) - - client.WaitTillChain(ctx, kit.HeightAtLeast(5)) - - res, _ := client.CreateImportFile(ctx, 0, 64<<20) // 64MiB file. - list, err := client.ClientListImports(ctx) - require.NoError(t, err) - require.Len(t, list, 1) - require.Equal(t, res.Root, *list[0].Root) - - dp := dh.DefaultStartDealParams() - dp.Data.Root = res.Root - dp.FastRetrieval = true - dp.EpochPrice = abi.NewTokenAmount(62500000) // minimum asking price. - deal := dh.StartDeal(ctx, dp) - - dh.WaitDealSealed(ctx, deal, false, false, nil) -} diff --git a/itests/deals_anycid_test.go b/itests/deals_anycid_test.go deleted file mode 100644 index c17441090b1..00000000000 --- a/itests/deals_anycid_test.go +++ /dev/null @@ -1,162 +0,0 @@ -package itests - -import ( - "bufio" - "context" - "os" - "testing" - "time" - - dag "github.com/ipfs/boxo/ipld/merkledag" - "github.com/ipfs/go-cid" - ipldcbor "github.com/ipfs/go-ipld-cbor" - format "github.com/ipfs/go-ipld-format" - "github.com/ipld/go-car" - "github.com/ipld/go-car/v2/blockstore" - selectorparse "github.com/ipld/go-ipld-prime/traversal/selector/parse" - "github.com/stretchr/testify/require" - - "github.com/filecoin-project/go-fil-markets/storagemarket" - "github.com/filecoin-project/go-state-types/abi" - - "github.com/filecoin-project/lotus/api" - "github.com/filecoin-project/lotus/itests/kit" - "github.com/filecoin-project/lotus/node" - "github.com/filecoin-project/lotus/node/modules" - "github.com/filecoin-project/lotus/node/modules/dtypes" -) - -func TestDealRetrieveByAnyCid(t *testing.T) { - if testing.Short() { - t.Skip("skipping test in short mode") - } - - ctx := context.Background() - - kit.QuietMiningLogs() - - // For these tests where the block time is artificially short, just use - // a deal start epoch that is guaranteed to be far enough in the future - // so that the deal starts sealing in time - startEpoch := abi.ChainEpoch(2 << 12) - - // Override the dependency injection for the blockstore accessor, so that - // we can get a reference to the blockstore containing our deal later in - // the test - var bsa storagemarket.BlockstoreAccessor - bsaFn := func(importmgr dtypes.ClientImportMgr) storagemarket.BlockstoreAccessor { - bsa = modules.StorageBlockstoreAccessor(importmgr) - return bsa - } - bsaOpt := kit.ConstructorOpts(node.Override(new(storagemarket.BlockstoreAccessor), bsaFn)) - - // Allow 8MB sectors - eightMBSectorsOpt := kit.SectorSize(8 << 20) - - // Create a client, and a miner with its own full node - _, client, miner, ens := kit.EnsembleTwoOne(t, kit.MockProofs(), bsaOpt, eightMBSectorsOpt) - ens.InterconnectAll().BeginMining(250 * time.Millisecond) - - dh := kit.NewDealHarness(t, client, miner, miner) - - // Generate a DAG with multiple levels, so that we can test the case where - // the client requests a CID for a block which is not the root block but - // does have a subtree below it in the DAG - dagOpts := kit.GeneratedDAGOpts{ - // Max size of a block - ChunkSize: 1024, - // Max links from a block to other blocks - Maxlinks: 10, - } - carv1FilePath, _ := kit.CreateRandomCARv1(t, 5, 100*1024, dagOpts) - res, err := client.ClientImport(ctx, api.FileRef{Path: carv1FilePath, IsCAR: true}) - require.NoError(t, err) - - // Get the blockstore for the file - bs, err := bsa.Get(res.Root) - require.NoError(t, err) - - // Get all CIDs from the file - sc := car.NewSelectiveCar(ctx, bs, []car.Dag{{Root: res.Root, Selector: selectorparse.CommonSelector_ExploreAllRecursively}}) - prepared, err := sc.Prepare() - require.NoError(t, err) - - reg := format.Registry{} - reg.Register(cid.DagProtobuf, dag.DecodeProtobufBlock) - reg.Register(cid.DagCBOR, ipldcbor.DecodeBlock) - reg.Register(cid.Raw, dag.DecodeRawBlock) - - cids := prepared.Cids() - for i, c := range cids { - blk, err := bs.Get(ctx, c) - require.NoError(t, err) - - nd, err := reg.Decode(blk) - require.NoError(t, err) - - t.Log(i, c, len(nd.Links())) - } - - // Create a storage deal - dp := dh.DefaultStartDealParams() - dp.Data.Root = res.Root - dp.DealStartEpoch = startEpoch - dp.EpochPrice = abi.NewTokenAmount(62500000) // minimum asking price - dealCid := dh.StartDeal(ctx, dp) - - // Wait for the deal to be sealed - dh.WaitDealSealed(ctx, dealCid, false, false, nil) - - ask, err := miner.MarketGetRetrievalAsk(ctx) - require.NoError(t, err) - ask.PricePerByte = abi.NewTokenAmount(0) - ask.UnsealPrice = abi.NewTokenAmount(0) - err = miner.MarketSetRetrievalAsk(ctx, ask) - require.NoError(t, err) - - // Fetch the deal data - info, err := client.ClientGetDealInfo(ctx, *dealCid) - require.NoError(t, err) - - // Make retrievals against CIDs at different levels in the DAG - cidIndices := []int{1, 11, 27, 32, 47} - for _, val := range cidIndices { - t.Logf("performing retrieval for cid at index %d", val) - - targetCid := cids[val] - offer, err := client.ClientMinerQueryOffer(ctx, miner.ActorAddr, targetCid, &info.PieceCID) - require.NoError(t, err) - require.Empty(t, offer.Err) - - // retrieve in a CAR file and ensure roots match - outputCar := dh.PerformRetrieval(ctx, dealCid, targetCid, true, offer) - _, err = os.Stat(outputCar) - require.NoError(t, err) - f, err := os.Open(outputCar) - require.NoError(t, err) - ch, err := car.ReadHeader(bufio.NewReader(f)) - require.NoError(t, err) - require.EqualValues(t, ch.Roots[0], targetCid) - require.NoError(t, f.Close()) - - // create CAR from original file starting at targetCid and ensure it matches the retrieved CAR file. - tmp, err := os.CreateTemp(t.TempDir(), "randcarv1") - require.NoError(t, err) - rd, err := blockstore.OpenReadOnly(carv1FilePath, blockstore.UseWholeCIDs(true)) - require.NoError(t, err) - err = car.NewSelectiveCar( - ctx, - rd, - []car.Dag{{ - Root: targetCid, - Selector: selectorparse.CommonSelector_ExploreAllRecursively, - }}, - ).Write(tmp) - require.NoError(t, err) - require.NoError(t, tmp.Close()) - require.NoError(t, rd.Close()) - - kit.AssertFilesEqual(t, tmp.Name(), outputCar) - t.Log("car files match") - } -} diff --git a/itests/deals_concurrent_test.go b/itests/deals_concurrent_test.go deleted file mode 100644 index a106836bdd1..00000000000 --- a/itests/deals_concurrent_test.go +++ /dev/null @@ -1,212 +0,0 @@ -// stm: #integration -package itests - -import ( - "context" - "fmt" - "sync" - "testing" - "time" - - provider "github.com/ipni/index-provider" - "github.com/stretchr/testify/require" - - datatransfer "github.com/filecoin-project/go-data-transfer/v2" - "github.com/filecoin-project/go-fil-markets/shared_testutil" - "github.com/filecoin-project/go-state-types/abi" - - "github.com/filecoin-project/lotus/api" - "github.com/filecoin-project/lotus/itests/kit" - "github.com/filecoin-project/lotus/node" - "github.com/filecoin-project/lotus/node/modules" - "github.com/filecoin-project/lotus/node/modules/dtypes" - "github.com/filecoin-project/lotus/node/repo" -) - -// TestDealWithMarketAndMinerNode is running concurrently a number of storage and retrieval deals towards a miner -// architecture where the `mining/sealing/proving` node is a separate process from the `markets` node -func TestDealWithMarketAndMinerNode(t *testing.T) { - //stm: @CHAIN_SYNCER_LOAD_GENESIS_001, @CHAIN_SYNCER_FETCH_TIPSET_001, - //stm: @CHAIN_SYNCER_START_001, @CHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01 - //stm: @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001 - //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 - if testing.Short() { - t.Skip("skipping test in short mode") - } - - t.Skip("skipping due to flakiness: see #6956") - - kit.QuietMiningLogs() - - // For these tests where the block time is artificially short, just use - // a deal start epoch that is guaranteed to be far enough in the future - // so that the deal starts sealing in time - startEpoch := abi.ChainEpoch(8 << 10) - - runTest := func(t *testing.T, n int, fastRetrieval bool, carExport bool) { - api.RunningNodeType = api.NodeMiner // TODO(anteva): fix me - - idxProv := shared_testutil.NewMockIndexProvider() - idxProvOpt := kit.ConstructorOpts(node.Override(new(provider.Interface), idxProv)) - client, main, market, _ := kit.EnsembleWithMinerAndMarketNodes(t, kit.ThroughRPC(), idxProvOpt) - - dh := kit.NewDealHarness(t, client, main, market) - - dh.RunConcurrentDeals(kit.RunConcurrentDealsOpts{ - N: n, - FastRetrieval: fastRetrieval, - CarExport: carExport, - StartEpoch: startEpoch, - IndexProvider: idxProv, - }) - } - - // this test is expensive because we don't use mock proofs; do a single cycle. - cycles := []int{4} - for _, n := range cycles { - n := n - ns := fmt.Sprintf("%d", n) - t.Run(ns+"-fastretrieval-CAR", func(t *testing.T) { runTest(t, n, true, true) }) - t.Run(ns+"-fastretrieval-NoCAR", func(t *testing.T) { runTest(t, n, true, false) }) - t.Run(ns+"-stdretrieval-CAR", func(t *testing.T) { runTest(t, n, false, true) }) - t.Run(ns+"-stdretrieval-NoCAR", func(t *testing.T) { runTest(t, n, false, false) }) - } -} - -func TestDealCyclesConcurrent(t *testing.T) { - //stm: @CHAIN_SYNCER_LOAD_GENESIS_001, @CHAIN_SYNCER_FETCH_TIPSET_001, - //stm: @CHAIN_SYNCER_START_001, @CHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01 - //stm: @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001 - //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 - - //stm: @CHAIN_INCOMING_HANDLE_INCOMING_BLOCKS_001, @CHAIN_INCOMING_VALIDATE_BLOCK_PUBSUB_001, @CHAIN_INCOMING_VALIDATE_MESSAGE_PUBSUB_001 - if testing.Short() { - t.Skip("skipping test in short mode") - } - - kit.QuietMiningLogs() - - // For these tests where the block time is artificially short, just use - // a deal start epoch that is guaranteed to be far enough in the future - // so that the deal starts sealing in time - startEpoch := abi.ChainEpoch(2 << 12) - - runTest := func(t *testing.T, n int, fastRetrieval bool, carExport bool) { - client, miner, ens := kit.EnsembleMinimal(t, kit.MockProofs()) - ens.InterconnectAll().BeginMining(250 * time.Millisecond) - dh := kit.NewDealHarness(t, client, miner, miner) - - dh.RunConcurrentDeals(kit.RunConcurrentDealsOpts{ - N: n, - FastRetrieval: fastRetrieval, - CarExport: carExport, - StartEpoch: startEpoch, - }) - } - - // this test is cheap because we use mock proofs, do various cycles - cycles := []int{2, 4, 8, 16} - for _, n := range cycles { - n := n - ns := fmt.Sprintf("%d", n) - t.Run(ns+"-fastretrieval-CAR", func(t *testing.T) { runTest(t, n, true, true) }) - t.Run(ns+"-fastretrieval-NoCAR", func(t *testing.T) { runTest(t, n, true, false) }) - t.Run(ns+"-stdretrieval-CAR", func(t *testing.T) { runTest(t, n, false, true) }) - t.Run(ns+"-stdretrieval-NoCAR", func(t *testing.T) { runTest(t, n, false, false) }) - } -} - -func TestSimultanenousTransferLimit(t *testing.T) { - //stm: @CHAIN_SYNCER_LOAD_GENESIS_001, @CHAIN_SYNCER_FETCH_TIPSET_001, - //stm: @CHAIN_SYNCER_START_001, @CHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01 - //stm: @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001 - //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 - t.Skip("skipping as flaky #7152") - - if testing.Short() { - t.Skip("skipping test in short mode") - } - - kit.QuietMiningLogs() - - // For these tests where the block time is artificially short, just use - // a deal start epoch that is guaranteed to be far enough in the future - // so that the deal starts sealing in time - startEpoch := abi.ChainEpoch(2 << 12) - - const ( - graphsyncThrottle = 2 - concurrency = 20 - ) - runTest := func(t *testing.T) { - client, miner, ens := kit.EnsembleMinimal(t, kit.MockProofs(), kit.ConstructorOpts( - node.ApplyIf(node.IsType(repo.StorageMiner), node.Override(new(dtypes.StagingGraphsync), modules.StagingGraphsync(graphsyncThrottle, 0, graphsyncThrottle))), - node.Override(new(dtypes.Graphsync), modules.Graphsync(graphsyncThrottle, graphsyncThrottle)), - )) - ens.InterconnectAll().BeginMining(250 * time.Millisecond) - dh := kit.NewDealHarness(t, client, miner, miner) - - ctx, cancel := context.WithCancel(context.Background()) - - du, err := miner.MarketDataTransferUpdates(ctx) - require.NoError(t, err) - - var maxOngoing int - var wg sync.WaitGroup - wg.Add(1) - go func() { - defer wg.Done() - - ongoing := map[datatransfer.TransferID]struct{}{} - - for { - select { - case u := <-du: - t.Logf("%d - %s", u.TransferID, datatransfer.Statuses[u.Status]) - if u.Status == datatransfer.Ongoing && u.Transferred > 0 { - ongoing[u.TransferID] = struct{}{} - } else { - delete(ongoing, u.TransferID) - } - - if len(ongoing) > maxOngoing { - maxOngoing = len(ongoing) - } - case <-ctx.Done(): - return - } - } - }() - - t.Logf("running concurrent deals: %d", concurrency) - - dh.RunConcurrentDeals(kit.RunConcurrentDealsOpts{ - N: concurrency, - FastRetrieval: true, - StartEpoch: startEpoch, - }) - - t.Logf("all deals finished") - - cancel() - wg.Wait() - - // The eventing systems across go-data-transfer and go-graphsync - // are racy, and that's why we can't enforce graphsyncThrottle exactly, - // without making this test racy. - // - // Essentially what could happen is that the graphsync layer starts the - // next transfer before the go-data-transfer FSM has the opportunity to - // move the previously completed transfer to the next stage, thus giving - // the appearance that more than graphsyncThrottle transfers are - // in progress. - // - // Concurrency (20) is x10 higher than graphsyncThrottle (2), so if all - // 20 transfers are not happening at once, we know the throttle is - // in effect. Thus we are a little bit lenient here to account for the - // above races and allow up to graphsyncThrottle*2. - require.LessOrEqual(t, maxOngoing, graphsyncThrottle*2) - } - - runTest(t) -} diff --git a/itests/deals_max_staging_deals_test.go b/itests/deals_max_staging_deals_test.go deleted file mode 100644 index 738a1e2fed3..00000000000 --- a/itests/deals_max_staging_deals_test.go +++ /dev/null @@ -1,70 +0,0 @@ -// stm: #integration -package itests - -import ( - "context" - "testing" - "time" - - "github.com/stretchr/testify/require" - - "github.com/filecoin-project/go-state-types/abi" - - "github.com/filecoin-project/lotus/itests/kit" -) - -func TestMaxStagingDeals(t *testing.T) { - //stm: @CHAIN_SYNCER_LOAD_GENESIS_001, @CHAIN_SYNCER_FETCH_TIPSET_001, - //stm: @CHAIN_SYNCER_START_001, @CHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01 - //stm: @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001 - //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 - - //stm: @CHAIN_INCOMING_HANDLE_INCOMING_BLOCKS_001, @CHAIN_INCOMING_VALIDATE_BLOCK_PUBSUB_001, @CHAIN_INCOMING_VALIDATE_MESSAGE_PUBSUB_001 - //stm: @CLIENT_STORAGE_DEALS_LIST_IMPORTS_001 - ctx := context.Background() - - kit.QuietMiningLogs() - - client, miner, ens := kit.EnsembleMinimal(t, - kit.MockProofs(), - kit.WithMaxStagingDealsBytes(8192), // max 8KB staging deals - kit.SectorSize(512<<20), // 512MiB sectors. - ) - ens.InterconnectAll().BeginMining(200 * time.Millisecond) - - dh := kit.NewDealHarness(t, client, miner, miner) - - client.WaitTillChain(ctx, kit.HeightAtLeast(5)) - - res, _ := client.CreateImportFile(ctx, 0, 8192) // 8KB file - list, err := client.ClientListImports(ctx) - require.NoError(t, err) - require.Len(t, list, 1) - - res2, _ := client.CreateImportFile(ctx, 0, 4096) - list, err = client.ClientListImports(ctx) - require.NoError(t, err) - require.Len(t, list, 2) - - // first deal stays in staging area, and is not yet passed to the sealing subsystem - dp := dh.DefaultStartDealParams() - dp.Data.Root = res.Root - dp.FastRetrieval = true - dp.EpochPrice = abi.NewTokenAmount(62500000) // minimum asking price. - deal := dh.StartDeal(ctx, dp) - - time.Sleep(1 * time.Second) - - // expecting second deal to fail since staging area is full - dp.Data.Root = res2.Root - dp.FastRetrieval = true - dp.EpochPrice = abi.NewTokenAmount(62500000) // minimum asking price. - deal2 := dh.StartDeal(ctx, dp) - - _ = deal - - err = dh.ExpectDealFailure(ctx, deal2, "cannot accept deal as miner is overloaded at the moment") - if err != nil { - t.Fatal(err) - } -} diff --git a/itests/deals_offline_test.go b/itests/deals_offline_test.go deleted file mode 100644 index 997d7723aa6..00000000000 --- a/itests/deals_offline_test.go +++ /dev/null @@ -1,107 +0,0 @@ -// stm: #integration -package itests - -import ( - "context" - "path/filepath" - "testing" - "time" - - "github.com/stretchr/testify/require" - - commcid "github.com/filecoin-project/go-fil-commcid" - commp "github.com/filecoin-project/go-fil-commp-hashhash" - "github.com/filecoin-project/go-fil-markets/storagemarket" - "github.com/filecoin-project/go-state-types/abi" - - lapi "github.com/filecoin-project/lotus/api" - "github.com/filecoin-project/lotus/itests/kit" -) - -func TestOfflineDealFlow(t *testing.T) { - //stm: @CHAIN_SYNCER_LOAD_GENESIS_001, @CHAIN_SYNCER_FETCH_TIPSET_001, - //stm: @CHAIN_SYNCER_START_001, @CHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01 - //stm: @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001 - //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 - - //stm: @CHAIN_INCOMING_HANDLE_INCOMING_BLOCKS_001, @CHAIN_INCOMING_VALIDATE_BLOCK_PUBSUB_001, @CHAIN_INCOMING_VALIDATE_MESSAGE_PUBSUB_001 - //stm: @CLIENT_DATA_CALCULATE_COMMP_001, @CLIENT_DATA_GENERATE_CAR_001, @CLIENT_DATA_GET_DEAL_PIECE_CID_001, @CLIENT_DATA_GET_DEAL_PIECE_CID_001 - runTest := func(t *testing.T, fastRet bool, upscale abi.PaddedPieceSize) { - ctx := context.Background() - client, miner, ens := kit.EnsembleMinimal(t, kit.WithAllSubsystems()) // no mock proofs - ens.InterconnectAll().BeginMining(250 * time.Millisecond) - - dh := kit.NewDealHarness(t, client, miner, miner) - - // Create a random file and import on the client. - res, inFile := client.CreateImportFile(ctx, 1, 200) - - // Get the piece size and commP - rootCid := res.Root - pieceInfo, err := client.ClientDealPieceCID(ctx, rootCid) - require.NoError(t, err) - t.Log("FILE CID:", rootCid) - - // test whether padding works as intended - if upscale > 0 { - newRawCp, err := commp.PadCommP( - pieceInfo.PieceCID.Hash()[len(pieceInfo.PieceCID.Hash())-32:], - uint64(pieceInfo.PieceSize), - uint64(upscale), - ) - require.NoError(t, err) - - pieceInfo.PieceSize = upscale - pieceInfo.PieceCID, err = commcid.DataCommitmentV1ToCID(newRawCp) - require.NoError(t, err) - } - - dp := dh.DefaultStartDealParams() - dp.DealStartEpoch = abi.ChainEpoch(4 << 10) - dp.FastRetrieval = fastRet - // Replace with params for manual storage deal (offline deal) - dp.Data = &storagemarket.DataRef{ - TransferType: storagemarket.TTManual, - Root: rootCid, - PieceCid: &pieceInfo.PieceCID, - PieceSize: pieceInfo.PieceSize.Unpadded(), - } - - proposalCid := dh.StartDeal(ctx, dp) - - //stm: @CLIENT_STORAGE_DEALS_GET_001 - // Wait for the deal to reach StorageDealCheckForAcceptance on the client - cd, err := client.ClientGetDealInfo(ctx, *proposalCid) - require.NoError(t, err) - require.Eventually(t, func() bool { - cd, _ := client.ClientGetDealInfo(ctx, *proposalCid) - return cd.State == storagemarket.StorageDealCheckForAcceptance - }, 30*time.Second, 1*time.Second, "actual deal status is %s", storagemarket.DealStates[cd.State]) - - // Create a CAR file from the raw file - carFileDir := t.TempDir() - carFilePath := filepath.Join(carFileDir, "out.car") - err = client.ClientGenCar(ctx, lapi.FileRef{Path: inFile}, carFilePath) - require.NoError(t, err) - - // Import the CAR file on the miner - this is the equivalent to - // transferring the file across the wire in a normal (non-offline) deal - err = miner.DealsImportData(ctx, *proposalCid, carFilePath) - require.NoError(t, err) - - // Wait for the deal to be published - dh.WaitDealPublished(ctx, proposalCid) - - t.Logf("deal published, retrieving") - - // Retrieve the deal - outFile := dh.PerformRetrieval(ctx, proposalCid, rootCid, false) - - kit.AssertFilesEqual(t, inFile, outFile) - - } - - t.Run("stdretrieval", func(t *testing.T) { runTest(t, false, 0) }) - t.Run("fastretrieval", func(t *testing.T) { runTest(t, true, 0) }) - t.Run("fastretrieval", func(t *testing.T) { runTest(t, true, 1024) }) -} diff --git a/itests/deals_padding_test.go b/itests/deals_padding_test.go deleted file mode 100644 index aaca4536069..00000000000 --- a/itests/deals_padding_test.go +++ /dev/null @@ -1,84 +0,0 @@ -// stm: #integration -package itests - -import ( - "context" - "testing" - "time" - - "github.com/stretchr/testify/require" - - commcid "github.com/filecoin-project/go-fil-commcid" - commp "github.com/filecoin-project/go-fil-commp-hashhash" - "github.com/filecoin-project/go-state-types/abi" - - "github.com/filecoin-project/lotus/itests/kit" -) - -func TestDealPadding(t *testing.T) { - //stm: @CHAIN_SYNCER_LOAD_GENESIS_001, @CHAIN_SYNCER_FETCH_TIPSET_001, - //stm: @CHAIN_SYNCER_START_001, @CHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01 - //stm: @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001 - //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 - - //stm: @CHAIN_INCOMING_HANDLE_INCOMING_BLOCKS_001, @CHAIN_INCOMING_VALIDATE_BLOCK_PUBSUB_001, @CHAIN_INCOMING_VALIDATE_MESSAGE_PUBSUB_001 - //stm: @CLIENT_DATA_GET_DEAL_PIECE_CID_001 - kit.QuietMiningLogs() - - var blockTime = 250 * time.Millisecond - startEpoch := abi.ChainEpoch(2 << 12) - - client, miner, ens := kit.EnsembleMinimal(t, kit.ThroughRPC(), kit.WithAllSubsystems()) // no mock proofs. - ens.InterconnectAll().BeginMining(blockTime) - dh := kit.NewDealHarness(t, client, miner, miner) - - ctx := context.Background() - client.WaitTillChain(ctx, kit.BlocksMinedByAll(miner.ActorAddr)) - - // Create a random file, would originally be a 256-byte sector - res, inFile := client.CreateImportFile(ctx, 1, 200) - - // Get the piece size and commP - pieceInfo, err := client.ClientDealPieceCID(ctx, res.Root) - require.NoError(t, err) - t.Log("FILE CID:", res.Root) - - runTest := func(t *testing.T, upscale abi.PaddedPieceSize) { - // test whether padding works as intended - newRawCp, err := commp.PadCommP( - pieceInfo.PieceCID.Hash()[len(pieceInfo.PieceCID.Hash())-32:], - uint64(pieceInfo.PieceSize), - uint64(upscale), - ) - require.NoError(t, err) - - pcid, err := commcid.DataCommitmentV1ToCID(newRawCp) - require.NoError(t, err) - - dp := dh.DefaultStartDealParams() - dp.Data.Root = res.Root - dp.Data.PieceCid = &pcid - dp.Data.PieceSize = upscale.Unpadded() - dp.DealStartEpoch = startEpoch - proposalCid := dh.StartDeal(ctx, dp) - - // TODO: this sleep is only necessary because deals don't immediately get logged in the dealstore, we should fix this - time.Sleep(time.Second) - - //stm: @CLIENT_STORAGE_DEALS_GET_001 - di, err := client.ClientGetDealInfo(ctx, *proposalCid) - require.NoError(t, err) - require.True(t, di.PieceCID.Equals(pcid)) - - dh.WaitDealSealed(ctx, proposalCid, false, false, nil) - - // Retrieve the deal - outFile := dh.PerformRetrieval(ctx, proposalCid, res.Root, false) - - kit.AssertFilesEqual(t, inFile, outFile) - } - - t.Run("padQuarterSector", func(t *testing.T) { runTest(t, 512) }) - t.Run("padHalfSector", func(t *testing.T) { runTest(t, 1024) }) - t.Run("padFullSector", func(t *testing.T) { runTest(t, 2048) }) -} diff --git a/itests/deals_partial_retrieval_dm-level_test.go b/itests/deals_partial_retrieval_dm-level_test.go deleted file mode 100644 index c03d07aac53..00000000000 --- a/itests/deals_partial_retrieval_dm-level_test.go +++ /dev/null @@ -1,267 +0,0 @@ -// stm: #integration -package itests - -import ( - "context" - "fmt" - "io" - "os" - "testing" - "time" - - blocks "github.com/ipfs/go-block-format" - "github.com/ipfs/go-cid" - "github.com/ipld/go-car" - textselector "github.com/ipld/go-ipld-selector-text-lite" - "github.com/stretchr/testify/require" - - "github.com/filecoin-project/go-fil-markets/storagemarket" - "github.com/filecoin-project/go-state-types/abi" - - "github.com/filecoin-project/lotus/api" - api0 "github.com/filecoin-project/lotus/api/v0api" - "github.com/filecoin-project/lotus/itests/kit" -) - -// please talk to @ribasushi or @mikeal before modifying these test: there are -// downstream dependencies on ADL-less operation -var ( - adlFixtureCar = "fixtures/adl_test.car" - adlFixtureRoot, _ = cid.Parse("bafybeiaigxwanoxyeuzyiknhrg6io6kobfbm37ozcips6qdwumub2gaomy") - adlFixtureCommp, _ = cid.Parse("baga6ea4seaqjnmnrv4qsfz2rnda54mvo5al22dwpguhn2pmep63gl7bbqqqraai") - adlFixturePieceSize = abi.PaddedPieceSize(1024) - dmSelector = api.Selector("Links/0/Hash") - dmTextSelector = textselector.Expression(dmSelector) - dmExpectedResult = "NO ADL" - dmExpectedCarBlockCount = 4 - dmDagSpec = []api.DagSpec{{DataSelector: &dmSelector, ExportMerkleProof: true}} -) - -func TestDMLevelPartialRetrieval(t *testing.T) { - //stm: @CHAIN_SYNCER_LOAD_GENESIS_001, @CHAIN_SYNCER_FETCH_TIPSET_001, - //stm: @CHAIN_SYNCER_START_001, @CHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01 - //stm: @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001 - //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 - - //stm: @CHAIN_INCOMING_HANDLE_INCOMING_BLOCKS_001, @CHAIN_INCOMING_VALIDATE_BLOCK_PUBSUB_001, @CHAIN_INCOMING_VALIDATE_MESSAGE_PUBSUB_001 - //stm: @CLIENT_RETRIEVAL_RETRIEVE_001, @CLIENT_RETRIEVAL_FIND_001 - ctx := context.Background() - - kit.QuietMiningLogs() - client, miner, ens := kit.EnsembleMinimal(t, kit.ThroughRPC()) - dh := kit.NewDealHarness(t, client, miner, miner) - ens.InterconnectAll().BeginMiningMustPost(50 * time.Millisecond) - - _, err := client.ClientImport(ctx, api.FileRef{Path: adlFixtureCar, IsCAR: true}) - require.NoError(t, err) - - caddr, err := client.WalletDefaultAddress(ctx) - require.NoError(t, err) - - // - // test retrieval from local car 1st - require.NoError(t, testDMExportAsCar( - ctx, client, api.ExportRef{ - FromLocalCAR: adlFixtureCar, - Root: adlFixtureRoot, - DAGs: dmDagSpec, - }, t.TempDir(), - )) - require.NoError(t, testDMExportAsFile( - ctx, client, api.ExportRef{ - FromLocalCAR: adlFixtureCar, - Root: adlFixtureRoot, - DAGs: dmDagSpec, - }, t.TempDir(), - )) - - // - // ensure V0 continues functioning as expected - require.NoError(t, tesV0RetrievalAsCar( - ctx, client, api0.RetrievalOrder{ - FromLocalCAR: adlFixtureCar, - Root: adlFixtureRoot, - DatamodelPathSelector: &dmTextSelector, - }, t.TempDir(), - )) - require.NoError(t, testV0RetrievalAsFile( - ctx, client, api0.RetrievalOrder{ - FromLocalCAR: adlFixtureCar, - Root: adlFixtureRoot, - DatamodelPathSelector: &dmTextSelector, - }, t.TempDir(), - )) - - // - // now perform a storage/retrieval deal as well, and retest - dp := dh.DefaultStartDealParams() - dp.Data = &storagemarket.DataRef{ - Root: adlFixtureRoot, - PieceCid: &adlFixtureCommp, - PieceSize: adlFixturePieceSize.Unpadded(), - } - proposalCid := dh.StartDeal(ctx, dp) - - // Wait for the deal to reach StorageDealCheckForAcceptance on the client - cd, err := client.ClientGetDealInfo(ctx, *proposalCid) - require.NoError(t, err) - require.Eventually(t, func() bool { - cd, _ := client.ClientGetDealInfo(ctx, *proposalCid) - return cd.State == storagemarket.StorageDealCheckForAcceptance - }, 30*time.Second, 1*time.Second, "actual deal status is %s", storagemarket.DealStates[cd.State]) - - dh.WaitDealSealed(ctx, proposalCid, false, false, nil) - - offers, err := client.ClientFindData(ctx, adlFixtureRoot, nil) - require.NoError(t, err) - require.NotEmpty(t, offers, "no offers") - - retOrder := offers[0].Order(caddr) - retOrder.DataSelector = &dmSelector - - rr, err := client.ClientRetrieve(ctx, retOrder) - require.NoError(t, err) - - err = client.ClientRetrieveWait(ctx, rr.DealID) - require.NoError(t, err) - - require.NoError(t, testDMExportAsCar( - ctx, client, api.ExportRef{ - DealID: rr.DealID, - Root: adlFixtureRoot, - DAGs: dmDagSpec, - }, t.TempDir(), - )) - require.NoError(t, testDMExportAsFile( - ctx, client, api.ExportRef{ - DealID: rr.DealID, - Root: adlFixtureRoot, - DAGs: dmDagSpec, - }, t.TempDir(), - )) - -} - -func testDMExportAsFile(ctx context.Context, client *kit.TestFullNode, expDirective api.ExportRef, tempDir string) error { - out := tempDir + string(os.PathSeparator) + "exp-test" + expDirective.Root.String() - - fileDest := api.FileRef{ - Path: out, - } - err := client.ClientExport(ctx, expDirective, fileDest) - if err != nil { - return err - } - - f, err := os.Open(out) - if err != nil { - return err - } - - defer f.Close() //nolint:errcheck - - return validateDMUnixFile(f) -} -func testV0RetrievalAsFile(ctx context.Context, client *kit.TestFullNode, retOrder api0.RetrievalOrder, tempDir string) error { - out := tempDir + string(os.PathSeparator) + "exp-test" + retOrder.Root.String() - - cv0 := &api0.WrapperV1Full{FullNode: client.FullNode} - err := cv0.ClientRetrieve(ctx, retOrder, &api.FileRef{ - Path: out, - }) - if err != nil { - return err - } - - f, err := os.Open(out) - if err != nil { - return err - } - - defer f.Close() //nolint:errcheck - - return validateDMUnixFile(f) -} -func validateDMUnixFile(r io.Reader) error { - data, err := io.ReadAll(r) - if err != nil { - return err - } - if string(data) != dmExpectedResult { - return fmt.Errorf("retrieved data mismatch: expected '%s' got '%s'", dmExpectedResult, data) - } - - return nil -} - -func testDMExportAsCar(ctx context.Context, client *kit.TestFullNode, expDirective api.ExportRef, tempDir string) error { - out, err := os.CreateTemp(tempDir, "exp-test") - if err != nil { - return err - } - defer out.Close() //nolint:errcheck - - carDest := api.FileRef{ - IsCAR: true, - Path: out.Name(), - } - err = client.ClientExport(ctx, expDirective, carDest) - if err != nil { - return err - } - - return validateDMCar(out) -} -func tesV0RetrievalAsCar(ctx context.Context, client *kit.TestFullNode, retOrder api0.RetrievalOrder, tempDir string) error { - out, err := os.CreateTemp(tempDir, "exp-test") - if err != nil { - return err - } - defer out.Close() //nolint:errcheck - - cv0 := &api0.WrapperV1Full{FullNode: client.FullNode} - err = cv0.ClientRetrieve(ctx, retOrder, &api.FileRef{ - Path: out.Name(), - IsCAR: true, - }) - if err != nil { - return err - } - - return validateDMCar(out) -} -func validateDMCar(r io.Reader) error { - cr, err := car.NewCarReader(r) - if err != nil { - return err - } - - if len(cr.Header.Roots) != 1 { - return fmt.Errorf("expected a single root in result car, got %d", len(cr.Header.Roots)) - } else if cr.Header.Roots[0].String() != adlFixtureRoot.String() { - return fmt.Errorf("expected root cid '%s', got '%s'", adlFixtureRoot.String(), cr.Header.Roots[0].String()) - } - - blks := make([]blocks.Block, 0) - for { - b, err := cr.Next() - if err == io.EOF { - break - } else if err != nil { - return err - } - - blks = append(blks, b) - } - - if len(blks) != dmExpectedCarBlockCount { - return fmt.Errorf("expected a car file with %d blocks, got one with %d instead", dmExpectedCarBlockCount, len(blks)) - } - - data := fmt.Sprintf("%s%s", blks[2].RawData(), blks[3].RawData()) - if data != dmExpectedResult { - return fmt.Errorf("retrieved data mismatch: expected '%s' got '%s'", dmExpectedResult, data) - } - - return nil -} diff --git a/itests/deals_partial_retrieval_test.go b/itests/deals_partial_retrieval_test.go deleted file mode 100644 index 0bbf23da054..00000000000 --- a/itests/deals_partial_retrieval_test.go +++ /dev/null @@ -1,256 +0,0 @@ -// stm: #integration -package itests - -import ( - "context" - "fmt" - "io" - "os" - "testing" - "time" - - blocks "github.com/ipfs/go-block-format" - "github.com/ipfs/go-cid" - "github.com/ipld/go-car" - "github.com/stretchr/testify/require" - "golang.org/x/xerrors" - - "github.com/filecoin-project/go-fil-markets/storagemarket" - "github.com/filecoin-project/go-state-types/abi" - "github.com/filecoin-project/go-state-types/big" - - "github.com/filecoin-project/lotus/api" - "github.com/filecoin-project/lotus/itests/kit" -) - -// use the mainnet carfile as text fixture: it will always be here -// https://dweb.link/ipfs/bafy2bzacecnamqgqmifpluoeldx7zzglxcljo6oja4vrmtj7432rphldpdmm2/8/1/8/1/0/1/0 -var ( - sourceCar = "../build/genesis/mainnet.car" - carRoot, _ = cid.Parse("bafy2bzacecnamqgqmifpluoeldx7zzglxcljo6oja4vrmtj7432rphldpdmm2") - carCommp, _ = cid.Parse("baga6ea4seaqmrivgzei3fmx5qxtppwankmtou6zvigyjaveu3z2zzwhysgzuina") - selectedCid, _ = cid.Parse("bafkqaetgnfwc6mjpon2g64tbm5sxa33xmvza") - carPieceSize = abi.PaddedPieceSize(2097152) - textSelector = api.Selector("8/1/8/1/0/1/0") - textSelectorNonLink = api.Selector("8/1/8/1/0/1") - textSelectorNonexistent = api.Selector("42") - expectedResult = "fil/1/storagepower" -) - -func TestPartialRetrieval(t *testing.T) { - //stm: @CHAIN_SYNCER_LOAD_GENESIS_001, @CHAIN_SYNCER_FETCH_TIPSET_001, - //stm: @CHAIN_SYNCER_START_001, @CHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01 - //stm: @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001 - //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 - - //stm: @CHAIN_INCOMING_HANDLE_INCOMING_BLOCKS_001, @CHAIN_INCOMING_VALIDATE_BLOCK_PUBSUB_001, @CHAIN_INCOMING_VALIDATE_MESSAGE_PUBSUB_001 - //stm: @CLIENT_RETRIEVAL_RETRIEVE_001 - ctx := context.Background() - - kit.QuietMiningLogs() - client, miner, ens := kit.EnsembleMinimal(t, kit.ThroughRPC(), kit.MockProofs(), kit.SectorSize(512<<20)) - dh := kit.NewDealHarness(t, client, miner, miner) - ens.InterconnectAll().BeginMining(50 * time.Millisecond) - - _, err := client.ClientImport(ctx, api.FileRef{Path: sourceCar, IsCAR: true}) - require.NoError(t, err) - - caddr, err := client.WalletDefaultAddress(ctx) - require.NoError(t, err) - - // first test retrieval from local car, then do an actual deal - for _, exportMerkleProof := range []bool{false, true} { - for _, fullCycle := range []bool{false, true} { - - var retOrder api.RetrievalOrder - var eref api.ExportRef - - if !fullCycle { - eref.FromLocalCAR = sourceCar - } else { - dp := dh.DefaultStartDealParams() - dp.Data = &storagemarket.DataRef{ - // FIXME: figure out how to do this with an online partial transfer - TransferType: storagemarket.TTManual, - Root: carRoot, - PieceCid: &carCommp, - PieceSize: carPieceSize.Unpadded(), - } - proposalCid := dh.StartDeal(ctx, dp) - - // Wait for the deal to reach StorageDealCheckForAcceptance on the client - cd, err := client.ClientGetDealInfo(ctx, *proposalCid) - require.NoError(t, err) - require.Eventually(t, func() bool { - cd, _ := client.ClientGetDealInfo(ctx, *proposalCid) - return cd.State == storagemarket.StorageDealCheckForAcceptance - }, 30*time.Second, 1*time.Second, "actual deal status is %s", storagemarket.DealStates[cd.State]) - - err = miner.DealsImportData(ctx, *proposalCid, sourceCar) - require.NoError(t, err) - - // Wait for the deal to be published, we should be able to start retrieval right away - dh.WaitDealPublished(ctx, proposalCid) - - offers, err := client.ClientFindData(ctx, carRoot, nil) - require.NoError(t, err) - require.NotEmpty(t, offers, "no offers") - - retOrder = offers[0].Order(caddr) - } - - retOrder.DataSelector = &textSelector - eref.DAGs = append(eref.DAGs, api.DagSpec{ - DataSelector: &textSelector, - ExportMerkleProof: exportMerkleProof, - }) - eref.Root = carRoot - - // test retrieval of either data or constructing a partial selective-car - for _, retrieveAsCar := range []bool{false, true} { - outFile := t.TempDir() + string(os.PathSeparator) + "ret-file" + retOrder.Root.String() - - require.NoError(t, testGenesisRetrieval( - ctx, - client, - retOrder, - eref, - &api.FileRef{ - Path: outFile, - IsCAR: retrieveAsCar, - }, - )) - - // UGH if I do not sleep here, I get things like: - /* - retrieval failed: Retrieve failed: there is an active retrieval deal with peer 12D3KooWK9fB9a3HZ4PQLVmEQ6pweMMn5CAyKtumB71CPTnuBDi6 for payload CID bafy2bzacecnamqgqmifpluoeldx7zzglxcljo6oja4vrmtj7432rphldpdmm2 (retrieval deal ID 1631259332180384709, state DealStatusFinalizingBlockstore) - existing deal must be cancelled before starting a new retrieval deal: - github.com/filecoin-project/lotus/node/impl/client.(*API).ClientRetrieve - /home/circleci/project/node/impl/client/client.go:774 - */ - time.Sleep(time.Second) - } - } - } - - // ensure non-existent paths fail - require.EqualError( - t, - testGenesisRetrieval( - ctx, - client, - api.RetrievalOrder{ - Root: carRoot, - DataSelector: &textSelectorNonexistent, - }, - api.ExportRef{ - Root: carRoot, - FromLocalCAR: sourceCar, - DAGs: []api.DagSpec{{DataSelector: &textSelectorNonexistent}}, - }, - &api.FileRef{}, - ), - fmt.Sprintf("parsing dag spec: path selection does not match a node within %s", carRoot), - ) - - // ensure non-boundary retrievals fail - require.EqualError( - t, - testGenesisRetrieval( - ctx, - client, - api.RetrievalOrder{ - Root: carRoot, - DataSelector: &textSelectorNonLink, - }, - api.ExportRef{ - Root: carRoot, - FromLocalCAR: sourceCar, - DAGs: []api.DagSpec{{DataSelector: &textSelectorNonLink}}, - }, - &api.FileRef{}, - ), - fmt.Sprintf("parsing dag spec: error while locating partial retrieval sub-root: unsupported selection path '%s' does not correspond to a block boundary (a.k.a. CID link)", textSelectorNonLink), - ) -} - -func testGenesisRetrieval(ctx context.Context, client *kit.TestFullNode, retOrder api.RetrievalOrder, eref api.ExportRef, retRef *api.FileRef) error { - - if retOrder.Total.Nil() { - retOrder.Total = big.Zero() - } - if retOrder.UnsealPrice.Nil() { - retOrder.UnsealPrice = big.Zero() - } - - if eref.FromLocalCAR == "" { - rr, err := client.ClientRetrieve(ctx, retOrder) - if err != nil { - return err - } - eref.DealID = rr.DealID - - if err := client.ClientRetrieveWait(ctx, rr.DealID); err != nil { - return xerrors.Errorf("retrieval wait: %w", err) - } - } - - err := client.ClientExport(ctx, eref, *retRef) - if err != nil { - return err - } - - outFile, err := os.Open(retRef.Path) - if err != nil { - return err - } - - defer outFile.Close() //nolint:errcheck - - var data []byte - if !retRef.IsCAR { - - data, err = io.ReadAll(outFile) - if err != nil { - return err - } - - } else { - - cr, err := car.NewCarReader(outFile) - if err != nil { - return err - } - - if len(cr.Header.Roots) != 1 { - return fmt.Errorf("expected a single root in result car, got %d", len(cr.Header.Roots)) - } else if eref.DAGs[0].ExportMerkleProof && cr.Header.Roots[0].String() != carRoot.String() { - return fmt.Errorf("expected root cid '%s', got '%s'", carRoot.String(), cr.Header.Roots[0].String()) - } else if !eref.DAGs[0].ExportMerkleProof && cr.Header.Roots[0].String() != selectedCid.String() { - return fmt.Errorf("expected root cid '%s', got '%s'", selectedCid.String(), cr.Header.Roots[0].String()) - } - - blks := make([]blocks.Block, 0) - for { - b, err := cr.Next() - if err == io.EOF { - break - } else if err != nil { - return err - } - - blks = append(blks, b) - } - - if (eref.DAGs[0].ExportMerkleProof && len(blks) != 3) || (!eref.DAGs[0].ExportMerkleProof && len(blks) != 1) { - return fmt.Errorf("expected a car file with 3/1 blocks, got one with %d instead", len(blks)) - } - - data = blks[len(blks)-1].RawData() - } - - if string(data) != expectedResult { - return fmt.Errorf("retrieved data mismatch: expected '%s' got '%s'", expectedResult, data) - } - - return nil -} diff --git a/itests/deals_power_test.go b/itests/deals_power_test.go deleted file mode 100644 index 57483cde716..00000000000 --- a/itests/deals_power_test.go +++ /dev/null @@ -1,70 +0,0 @@ -// stm: #integration -package itests - -import ( - "context" - "testing" - "time" - - "github.com/filecoin-project/lotus/itests/kit" -) - -func TestFirstDealEnablesMining(t *testing.T) { - //stm: @CHAIN_SYNCER_LOAD_GENESIS_001, @CHAIN_SYNCER_FETCH_TIPSET_001, - //stm: @CHAIN_SYNCER_START_001, @CHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01 - //stm: @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001 - //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 - - //stm: @CHAIN_INCOMING_HANDLE_INCOMING_BLOCKS_001, @CHAIN_INCOMING_VALIDATE_BLOCK_PUBSUB_001, @CHAIN_INCOMING_VALIDATE_MESSAGE_PUBSUB_001 - // test making a deal with a fresh miner, and see if it starts to mine. - if testing.Short() { - t.Skip("skipping test in short mode") - } - - kit.QuietMiningLogs() - - var ( - client kit.TestFullNode - genMiner kit.TestMiner // bootstrap - provider kit.TestMiner // no sectors, will need to create one - ) - - ens := kit.NewEnsemble(t, kit.MockProofs()) - ens.FullNode(&client) - ens.Miner(&genMiner, &client, kit.WithAllSubsystems()) - ens.Miner(&provider, &client, kit.WithAllSubsystems(), kit.PresealSectors(0)) - ens.Start().InterconnectAll().BeginMining(50 * time.Millisecond) - - ctx := context.Background() - - dh := kit.NewDealHarness(t, &client, &provider, &provider) - - ref, _ := client.CreateImportFile(ctx, 5, 0) - - t.Log("FILE CID:", ref.Root) - - ctx, cancel := context.WithCancel(ctx) - defer cancel() - - // start a goroutine to monitor head changes from the client - // once the provider has mined a block, thanks to the power acquired from the deal, - // we pass the test. - providerMined := make(chan struct{}) - - go func() { - _ = client.WaitTillChain(ctx, kit.BlocksMinedByAll(provider.ActorAddr)) - close(providerMined) - }() - - // now perform the deal. - dp := dh.DefaultStartDealParams() - dp.Data.Root = ref.Root - deal := dh.StartDeal(ctx, dp) - - // TODO: this sleep is only necessary because deals don't immediately get logged in the dealstore, we should fix this - time.Sleep(time.Second) - - dh.WaitDealSealed(ctx, deal, false, false, nil) - - <-providerMined -} diff --git a/itests/deals_pricing_test.go b/itests/deals_pricing_test.go deleted file mode 100644 index f2301eee8dc..00000000000 --- a/itests/deals_pricing_test.go +++ /dev/null @@ -1,150 +0,0 @@ -// stm: #integration -package itests - -import ( - "context" - "testing" - "time" - - "github.com/stretchr/testify/require" - - "github.com/filecoin-project/go-state-types/abi" - - "github.com/filecoin-project/lotus/itests/kit" - "github.com/filecoin-project/lotus/storage/sealer/storiface" -) - -func TestQuotePriceForUnsealedRetrieval(t *testing.T) { - //stm: @CHAIN_SYNCER_LOAD_GENESIS_001, @CHAIN_SYNCER_FETCH_TIPSET_001, - //stm: @CHAIN_SYNCER_START_001, @CHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01 - //stm: @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001 - //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 - - //stm: @CHAIN_INCOMING_HANDLE_INCOMING_BLOCKS_001, @CHAIN_INCOMING_VALIDATE_BLOCK_PUBSUB_001, @CHAIN_INCOMING_VALIDATE_MESSAGE_PUBSUB_001 - var ( - ctx = context.Background() - blocktime = 50 * time.Millisecond - ) - - kit.QuietMiningLogs() - - client, miner, ens := kit.EnsembleMinimal(t) - ens.InterconnectAll().BeginMiningMustPost(blocktime) - - var ( - ppb = int64(1) - unsealPrice = int64(77) - ) - - // Set unsealed price to non-zero - ask, err := miner.MarketGetRetrievalAsk(ctx) - require.NoError(t, err) - ask.PricePerByte = abi.NewTokenAmount(ppb) - ask.UnsealPrice = abi.NewTokenAmount(unsealPrice) - err = miner.MarketSetRetrievalAsk(ctx, ask) - require.NoError(t, err) - - dh := kit.NewDealHarness(t, client, miner, miner) - - deal1, res1, _ := dh.MakeOnlineDeal(ctx, kit.MakeFullDealParams{Rseed: 6}) - - // one more storage deal for the same data - _, res2, _ := dh.MakeOnlineDeal(ctx, kit.MakeFullDealParams{Rseed: 6}) - require.Equal(t, res1.Root, res2.Root) - - //stm: @CLIENT_STORAGE_DEALS_GET_001 - // Retrieval - dealInfo, err := client.ClientGetDealInfo(ctx, *deal1) - require.NoError(t, err) - - //stm: @CLIENT_RETRIEVAL_FIND_001 - // fetch quote -> zero for unsealed price since unsealed file already exists. - offers, err := client.ClientFindData(ctx, res1.Root, &dealInfo.PieceCID) - require.NoError(t, err) - require.Len(t, offers, 2) - require.Equal(t, offers[0], offers[1]) - require.Equal(t, uint64(0), offers[0].UnsealPrice.Uint64()) - require.Equal(t, dealInfo.Size*uint64(ppb), offers[0].MinPrice.Uint64()) - - // remove ONLY one unsealed file - //stm: @STORAGE_LIST_001, @MINER_SECTOR_LIST_001 - ss, err := miner.StorageList(context.Background()) - require.NoError(t, err) - _, err = miner.SectorsListNonGenesis(ctx) - require.NoError(t, err) - - //stm: @STORAGE_DROP_SECTOR_001, @STORAGE_LIST_001 -iLoop: - for storeID, sd := range ss { - for _, sector := range sd { - err := miner.StorageDropSector(ctx, storeID, sector.SectorID, storiface.FTUnsealed) - require.NoError(t, err) - break iLoop // remove ONLY one - } - } - - //stm: @CLIENT_RETRIEVAL_FIND_001 - // get retrieval quote -> zero for unsealed price as unsealed file exists. - offers, err = client.ClientFindData(ctx, res1.Root, &dealInfo.PieceCID) - require.NoError(t, err) - require.Len(t, offers, 2) - require.Equal(t, offers[0], offers[1]) - require.Equal(t, uint64(0), offers[0].UnsealPrice.Uint64()) - require.Equal(t, dealInfo.Size*uint64(ppb), offers[0].MinPrice.Uint64()) - - // remove the other unsealed file as well - ss, err = miner.StorageList(context.Background()) - require.NoError(t, err) - _, err = miner.SectorsListNonGenesis(ctx) - require.NoError(t, err) - for storeID, sd := range ss { - for _, sector := range sd { - require.NoError(t, miner.StorageDropSector(ctx, storeID, sector.SectorID, storiface.FTUnsealed)) - } - } - - //stm: @CLIENT_RETRIEVAL_FIND_001 - // fetch quote -> non-zero for unseal price as we no more unsealed files. - offers, err = client.ClientFindData(ctx, res1.Root, &dealInfo.PieceCID) - require.NoError(t, err) - require.Len(t, offers, 2) - require.Equal(t, offers[0], offers[1]) - require.Equal(t, uint64(unsealPrice), offers[0].UnsealPrice.Uint64()) - total := (dealInfo.Size * uint64(ppb)) + uint64(unsealPrice) - require.Equal(t, total, offers[0].MinPrice.Uint64()) -} - -func TestZeroPricePerByteRetrieval(t *testing.T) { - //stm: @CHAIN_SYNCER_LOAD_GENESIS_001, @CHAIN_SYNCER_FETCH_TIPSET_001, - //stm: @CHAIN_SYNCER_START_001, @CHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01 - //stm: @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001 - //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 - if testing.Short() { - t.Skip("skipping test in short mode") - } - - kit.QuietMiningLogs() - - var ( - blockTime = 10 * time.Millisecond - startEpoch = abi.ChainEpoch(2 << 12) - ) - - client, miner, ens := kit.EnsembleMinimal(t, kit.MockProofs()) - ens.InterconnectAll().BeginMiningMustPost(blockTime) - - ctx := context.Background() - - ask, err := miner.MarketGetRetrievalAsk(ctx) - require.NoError(t, err) - - ask.PricePerByte = abi.NewTokenAmount(0) - err = miner.MarketSetRetrievalAsk(ctx, ask) - require.NoError(t, err) - - dh := kit.NewDealHarness(t, client, miner, miner) - dh.RunConcurrentDeals(kit.RunConcurrentDealsOpts{ - N: 1, - StartEpoch: startEpoch, - }) -} diff --git a/itests/deals_publish_test.go b/itests/deals_publish_test.go deleted file mode 100644 index 43f4eeb0500..00000000000 --- a/itests/deals_publish_test.go +++ /dev/null @@ -1,143 +0,0 @@ -// stm: #integration -package itests - -import ( - "bytes" - "context" - "testing" - "time" - - "github.com/stretchr/testify/require" - - "github.com/filecoin-project/go-fil-markets/storagemarket" - "github.com/filecoin-project/go-state-types/abi" - market2 "github.com/filecoin-project/specs-actors/v2/actors/builtin/market" - - "github.com/filecoin-project/lotus/api" - "github.com/filecoin-project/lotus/chain/actors/builtin/market" - "github.com/filecoin-project/lotus/chain/types" - "github.com/filecoin-project/lotus/chain/wallet/key" - "github.com/filecoin-project/lotus/itests/kit" - "github.com/filecoin-project/lotus/markets/storageadapter" - "github.com/filecoin-project/lotus/node" - "github.com/filecoin-project/lotus/node/config" - "github.com/filecoin-project/lotus/node/modules" - "github.com/filecoin-project/lotus/storage/ctladdr" -) - -func TestPublishDealsBatching(t *testing.T) { - //stm: @CHAIN_SYNCER_LOAD_GENESIS_001, @CHAIN_SYNCER_FETCH_TIPSET_001, - //stm: @CHAIN_SYNCER_START_001, @CHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01 - //stm: @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001 - //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 - - //stm: @CHAIN_INCOMING_HANDLE_INCOMING_BLOCKS_001, @CHAIN_INCOMING_VALIDATE_BLOCK_PUBSUB_001, @CHAIN_INCOMING_VALIDATE_MESSAGE_PUBSUB_001 - var ( - ctx = context.Background() - publishPeriod = 10 * time.Second - maxDealsPerMsg = uint64(2) // Set max deals per publish deals message to 2 - startEpoch = abi.ChainEpoch(2 << 12) - ) - - kit.QuietMiningLogs() - - publisherKey, err := key.GenerateKey(types.KTSecp256k1) - require.NoError(t, err) - - opts := node.Options( - node.Override(new(*storageadapter.DealPublisher), - storageadapter.NewDealPublisher(nil, storageadapter.PublishMsgConfig{ - Period: publishPeriod, - MaxDealsPerMsg: maxDealsPerMsg, - }), - ), - node.Override(new(*ctladdr.AddressSelector), modules.AddressSelector(&config.MinerAddressConfig{ - DealPublishControl: []string{ - publisherKey.Address.String(), - }, - DisableOwnerFallback: true, - DisableWorkerFallback: true, - })), - ) - - client, miner, ens := kit.EnsembleMinimal(t, kit.Account(publisherKey, types.FromFil(10)), kit.MockProofs(), kit.ConstructorOpts(opts)) - ens.InterconnectAll().BeginMining(10 * time.Millisecond) - - _, err = client.WalletImport(ctx, &publisherKey.KeyInfo) - require.NoError(t, err) - - miner.SetControlAddresses(publisherKey.Address) - - dh := kit.NewDealHarness(t, client, miner, miner) - - // Starts a deal and waits until it's published - runDealTillPublish := func(rseed int) { - res, _ := client.CreateImportFile(ctx, rseed, 0) - - upds, err := client.ClientGetDealUpdates(ctx) - require.NoError(t, err) - - dp := dh.DefaultStartDealParams() - dp.Data.Root = res.Root - dp.DealStartEpoch = startEpoch - dh.StartDeal(ctx, dp) - - // TODO: this sleep is only necessary because deals don't immediately get logged in the dealstore, we should fix this - time.Sleep(time.Second) - - done := make(chan struct{}) - go func() { - for upd := range upds { - if upd.DataRef.Root == res.Root && upd.State == storagemarket.StorageDealAwaitingPreCommit { - done <- struct{}{} - } - } - }() - <-done - } - - // Run three deals in parallel - done := make(chan struct{}, maxDealsPerMsg+1) - for rseed := 1; rseed <= 3; rseed++ { - rseed := rseed - go func() { - runDealTillPublish(rseed) - done <- struct{}{} - }() - } - - // Wait for two of the deals to be published - for i := 0; i < int(maxDealsPerMsg); i++ { - <-done - } - - // Expect a single PublishStorageDeals message that includes the first two deals - //stm: @CHAIN_STATE_LIST_MESSAGES_001 - msgCids, err := client.StateListMessages(ctx, &api.MessageMatch{To: market.Address}, types.EmptyTSK, 1) - require.NoError(t, err) - count := 0 - for _, msgCid := range msgCids { - msg, err := client.ChainGetMessage(ctx, msgCid) - require.NoError(t, err) - - if msg.Method == market.Methods.PublishStorageDeals { - count++ - var pubDealsParams market2.PublishStorageDealsParams - err = pubDealsParams.UnmarshalCBOR(bytes.NewReader(msg.Params)) - require.NoError(t, err) - require.Len(t, pubDealsParams.Deals, int(maxDealsPerMsg)) - require.Equal(t, publisherKey.Address.String(), msg.From.String()) - } - } - require.Equal(t, 1, count) - - // The third deal should be published once the publish period expires. - // Allow a little padding as it takes a moment for the state change to - // be noticed by the client. - padding := 10 * time.Second - select { - case <-time.After(publishPeriod + padding): - require.Fail(t, "Expected 3rd deal to be published once publish period elapsed") - case <-done: // Success - } -} diff --git a/itests/deals_remote_retrieval_test.go b/itests/deals_remote_retrieval_test.go deleted file mode 100644 index c0a37e69e33..00000000000 --- a/itests/deals_remote_retrieval_test.go +++ /dev/null @@ -1,104 +0,0 @@ -package itests - -import ( - "bytes" - "context" - "fmt" - "io" - "net/url" - "os" - "path" - "testing" - "time" - - "github.com/google/uuid" - "github.com/gorilla/websocket" - "github.com/ipld/go-car" - "github.com/stretchr/testify/require" - - "github.com/filecoin-project/go-address" - "github.com/filecoin-project/go-state-types/abi" - - "github.com/filecoin-project/lotus/api" - bstore "github.com/filecoin-project/lotus/blockstore" - "github.com/filecoin-project/lotus/itests/kit" -) - -func TestNetStoreRetrieval(t *testing.T) { - kit.QuietMiningLogs() - - blocktime := 5 * time.Millisecond - ctx := context.Background() - - full, miner, ens := kit.EnsembleMinimal(t, kit.MockProofs(), kit.ThroughRPC()) - ens.InterconnectAll().BeginMining(blocktime) - - time.Sleep(5 * time.Second) - - // For these tests where the block time is artificially short, just use - // a deal start epoch that is guaranteed to be far enough in the future - // so that the deal starts sealing in time - dealStartEpoch := abi.ChainEpoch(2 << 12) - - rseed := 7 - - dh := kit.NewDealHarness(t, full, miner, miner) - dealCid, res, _ := dh.MakeOnlineDeal(context.Background(), kit.MakeFullDealParams{ - Rseed: rseed, - StartEpoch: dealStartEpoch, - UseCARFileForStorageDeal: true, - }) - - // create deal store - id := uuid.New() - rstore := bstore.NewMemorySync() - - au, err := url.Parse(full.ListenURL) - require.NoError(t, err) - - switch au.Scheme { - case "http": - au.Scheme = "ws" - case "https": - au.Scheme = "wss" - } - - au.Path = path.Join(au.Path, "/rest/v0/store/"+id.String()) - - conn, _, err := websocket.DefaultDialer.Dial(au.String(), nil) - require.NoError(t, err) - - _ = bstore.HandleNetBstoreWS(ctx, rstore, conn) - - dh.PerformRetrievalWithOrder(ctx, dealCid, res.Root, false, func(offer api.QueryOffer, address address.Address) api.RetrievalOrder { - order := offer.Order(address) - - order.RemoteStore = &id - - return order - }) - - // check blockstore blocks - carv1FilePath, _ := kit.CreateRandomCARv1(t, rseed, 200) - cb, err := os.ReadFile(carv1FilePath) - require.NoError(t, err) - - cr, err := car.NewCarReader(bytes.NewReader(cb)) - require.NoError(t, err) - - var blocks int - for { - cb, err := cr.Next() - if err == io.EOF { - fmt.Println("blocks: ", blocks) - return - } - require.NoError(t, err) - - sb, err := rstore.Get(ctx, cb.Cid()) - require.NoError(t, err) - require.EqualValues(t, cb.RawData(), sb.RawData()) - - blocks++ - } -} diff --git a/itests/deals_retry_deal_no_funds_test.go b/itests/deals_retry_deal_no_funds_test.go deleted file mode 100644 index 650b2436e0e..00000000000 --- a/itests/deals_retry_deal_no_funds_test.go +++ /dev/null @@ -1,188 +0,0 @@ -// stm: #integration -package itests - -import ( - "context" - "testing" - "time" - - "github.com/stretchr/testify/require" - - "github.com/filecoin-project/go-state-types/abi" - - "github.com/filecoin-project/lotus/chain/types" - "github.com/filecoin-project/lotus/chain/wallet/key" - "github.com/filecoin-project/lotus/itests/kit" - "github.com/filecoin-project/lotus/markets/storageadapter" - "github.com/filecoin-project/lotus/node" - "github.com/filecoin-project/lotus/node/config" - "github.com/filecoin-project/lotus/node/modules" - "github.com/filecoin-project/lotus/storage/ctladdr" -) - -var ( - publishPeriod = 1 * time.Second - maxDealsPerMsg = uint64(2) // Set max deals per publish deals message to 2 - - blockTime = 3 * time.Millisecond -) - -func TestDealsRetryLackOfFunds(t *testing.T) { - t.Run("cover-gas", func(t *testing.T) { - testDealsRetryLackOfFunds(t, types.NewInt(1020000000000)) - }) - t.Run("empty", func(t *testing.T) { - testDealsRetryLackOfFunds(t, types.NewInt(1)) - }) -} - -func testDealsRetryLackOfFunds(t *testing.T, publishStorageAccountFunds abi.TokenAmount) { - //stm: @CHAIN_SYNCER_LOAD_GENESIS_001, @CHAIN_SYNCER_FETCH_TIPSET_001, - //stm: @CHAIN_SYNCER_START_001, @CHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01 - //stm: @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001 - //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 - - //stm: @CHAIN_INCOMING_HANDLE_INCOMING_BLOCKS_001, @CHAIN_INCOMING_VALIDATE_BLOCK_PUBSUB_001, @CHAIN_INCOMING_VALIDATE_MESSAGE_PUBSUB_001 - //stm: @CLIENT_STORAGE_DEALS_LIST_IMPORTS_001 - ctx := context.Background() - - kit.QuietMiningLogs() - - // Allow 8MB sectors - eightMBSectorsOpt := kit.SectorSize(8 << 20) - - publishStorageDealKey, err := key.GenerateKey(types.KTSecp256k1) - require.NoError(t, err) - - opts := node.Options( - node.Override(new(*storageadapter.DealPublisher), - storageadapter.NewDealPublisher(nil, storageadapter.PublishMsgConfig{ - Period: publishPeriod, - MaxDealsPerMsg: maxDealsPerMsg, - }), - ), - node.Override(new(*ctladdr.AddressSelector), modules.AddressSelector(&config.MinerAddressConfig{ - DealPublishControl: []string{ - publishStorageDealKey.Address.String(), - }, - DisableOwnerFallback: true, - DisableWorkerFallback: true, - })), - ) - - minerFullNode, clientFullNode, miner, ens := kit.EnsembleTwoOne(t, kit.Account(publishStorageDealKey, publishStorageAccountFunds), kit.ConstructorOpts(opts), kit.MockProofs(), eightMBSectorsOpt) - - kit.QuietMiningLogs() - - ens. - Start(). - InterconnectAll(). - BeginMining(blockTime) - - _, err = minerFullNode.WalletImport(ctx, &publishStorageDealKey.KeyInfo) - require.NoError(t, err) - - miner.SetControlAddresses(publishStorageDealKey.Address) - - dh := kit.NewDealHarness(t, clientFullNode, miner, miner) - - res, _ := clientFullNode.CreateImportFile(ctx, 0, 4<<20) // 4MiB file. - list, err := clientFullNode.ClientListImports(ctx) - require.NoError(t, err) - require.Len(t, list, 1) - require.Equal(t, res.Root, *list[0].Root) - - dp := dh.DefaultStartDealParams() - dp.Data.Root = res.Root - dp.FastRetrieval = true - dp.EpochPrice = abi.NewTokenAmount(62500000) // minimum asking price. - deal := dh.StartDeal(ctx, dp) - - propcid := *deal - - go func() { - time.Sleep(30 * time.Second) - - kit.SendFunds(ctx, t, minerFullNode, publishStorageDealKey.Address, types.FromFil(1)) - - err := miner.MarketRetryPublishDeal(ctx, propcid) - if err != nil { - panic(err) - } - }() - - dh.WaitDealSealed(ctx, deal, false, false, nil) -} - -func TestDealsRetryLackOfFunds_blockInPublishDeal(t *testing.T) { - //stm: @CHAIN_SYNCER_LOAD_GENESIS_001, @CHAIN_SYNCER_FETCH_TIPSET_001, - //stm: @CHAIN_SYNCER_START_001, @CHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01 - //stm: @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001 - //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 - //stm: @CLIENT_STORAGE_DEALS_LIST_IMPORTS_001 - ctx := context.Background() - kit.QuietMiningLogs() - - // Allow 8MB sectors - eightMBSectorsOpt := kit.SectorSize(8 << 20) - - publishStorageDealKey, err := key.GenerateKey(types.KTSecp256k1) - require.NoError(t, err) - - opts := node.Options( - node.Override(new(*storageadapter.DealPublisher), - storageadapter.NewDealPublisher(nil, storageadapter.PublishMsgConfig{ - Period: publishPeriod, - MaxDealsPerMsg: maxDealsPerMsg, - }), - ), - node.Override(new(*ctladdr.AddressSelector), modules.AddressSelector(&config.MinerAddressConfig{ - DealPublishControl: []string{ - publishStorageDealKey.Address.String(), - }, - DisableOwnerFallback: true, - DisableWorkerFallback: true, - })), - ) - - publishStorageAccountFunds := types.NewInt(1020000000000) - minerFullNode, clientFullNode, miner, ens := kit.EnsembleTwoOne(t, kit.Account(publishStorageDealKey, publishStorageAccountFunds), kit.ConstructorOpts(opts), kit.MockProofs(), eightMBSectorsOpt) - - kit.QuietMiningLogs() - - ens. - Start(). - InterconnectAll(). - BeginMining(blockTime) - - _, err = minerFullNode.WalletImport(ctx, &publishStorageDealKey.KeyInfo) - require.NoError(t, err) - - miner.SetControlAddresses(publishStorageDealKey.Address) - - dh := kit.NewDealHarness(t, clientFullNode, miner, miner) - - res, _ := clientFullNode.CreateImportFile(ctx, 0, 4<<20) // 4MiB file. - list, err := clientFullNode.ClientListImports(ctx) - require.NoError(t, err) - require.Len(t, list, 1) - require.Equal(t, res.Root, *list[0].Root) - - dp := dh.DefaultStartDealParams() - dp.Data.Root = res.Root - dp.FastRetrieval = true - dp.EpochPrice = abi.NewTokenAmount(62500000) // minimum asking price. - deal := dh.StartDeal(ctx, dp) - - dealSealed := make(chan struct{}) - go func() { - dh.WaitDealSealedQuiet(ctx, deal, false, false, nil) - dealSealed <- struct{}{} - }() - - select { - case <-dealSealed: - t.Fatal("deal shouldn't have sealed") - case <-time.After(time.Second * 15): - } -} diff --git a/itests/deals_test.go b/itests/deals_test.go deleted file mode 100644 index a6953d07e69..00000000000 --- a/itests/deals_test.go +++ /dev/null @@ -1,45 +0,0 @@ -// stm: #integration -package itests - -import ( - "testing" - "time" - - "github.com/filecoin-project/lotus/itests/kit" -) - -func TestDealsWithSealingAndRPC(t *testing.T) { - //stm: @CHAIN_SYNCER_LOAD_GENESIS_001, @CHAIN_SYNCER_FETCH_TIPSET_001, - //stm: @CHAIN_SYNCER_START_001, @CHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01 - //stm: @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001 - //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 - - //stm: @CHAIN_INCOMING_HANDLE_INCOMING_BLOCKS_001, @CHAIN_INCOMING_VALIDATE_BLOCK_PUBSUB_001, @CHAIN_INCOMING_VALIDATE_MESSAGE_PUBSUB_001 - if testing.Short() { - t.Skip("skipping test in short mode") - } - - kit.QuietMiningLogs() - - client, miner, ens := kit.EnsembleMinimal(t, kit.ThroughRPC(), kit.WithAllSubsystems()) // no mock proofs. - ens.InterconnectAll().BeginMiningMustPost(250 * time.Millisecond) - dh := kit.NewDealHarness(t, client, miner, miner) - - t.Run("stdretrieval", func(t *testing.T) { - dh.RunConcurrentDeals(kit.RunConcurrentDealsOpts{N: 1}) - }) - - t.Run("fastretrieval", func(t *testing.T) { - dh.RunConcurrentDeals(kit.RunConcurrentDealsOpts{N: 1, FastRetrieval: true}) - }) - - t.Run("fastretrieval-twodeals-sequential", func(t *testing.T) { - dh.RunConcurrentDeals(kit.RunConcurrentDealsOpts{N: 1, FastRetrieval: true}) - dh.RunConcurrentDeals(kit.RunConcurrentDealsOpts{N: 1, FastRetrieval: true}) - }) - - t.Run("stdretrieval-carv1", func(t *testing.T) { - dh.RunConcurrentDeals(kit.RunConcurrentDealsOpts{N: 1, UseCARFileForStorageDeal: true}) - }) - -} diff --git a/itests/gateway_test.go b/itests/gateway_test.go index 2dc4e1034d5..b994d6de3c8 100644 --- a/itests/gateway_test.go +++ b/itests/gateway_test.go @@ -24,7 +24,6 @@ import ( "github.com/filecoin-project/lotus/api/client" "github.com/filecoin-project/lotus/chain/stmgr" "github.com/filecoin-project/lotus/chain/types" - "github.com/filecoin-project/lotus/cli/clicommands" "github.com/filecoin-project/lotus/gateway" "github.com/filecoin-project/lotus/itests/kit" "github.com/filecoin-project/lotus/itests/multisig" @@ -194,46 +193,6 @@ func TestGatewayMsigCLI(t *testing.T) { multisig.RunMultisigTests(t, lite) } -func TestGatewayDealFlow(t *testing.T) { - //stm: @CHAIN_SYNCER_LOAD_GENESIS_001, @CHAIN_SYNCER_FETCH_TIPSET_001, - //stm: @CHAIN_SYNCER_START_001, @CHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01 - //stm: @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001 - //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 - kit.QuietMiningLogs() - - blocktime := 5 * time.Millisecond - ctx := context.Background() - nodes := startNodesWithFunds(ctx, t, blocktime, maxLookbackCap, maxStateWaitLookbackLimit) - - time.Sleep(5 * time.Second) - - // For these tests where the block time is artificially short, just use - // a deal start epoch that is guaranteed to be far enough in the future - // so that the deal starts sealing in time - dealStartEpoch := abi.ChainEpoch(2 << 12) - - dh := kit.NewDealHarness(t, nodes.lite, nodes.miner, nodes.miner) - dealCid, res, _ := dh.MakeOnlineDeal(context.Background(), kit.MakeFullDealParams{ - Rseed: 6, - StartEpoch: dealStartEpoch, - }) - dh.PerformRetrieval(ctx, dealCid, res.Root, false) -} - -func TestGatewayCLIDealFlow(t *testing.T) { - //stm: @CHAIN_SYNCER_LOAD_GENESIS_001, @CHAIN_SYNCER_FETCH_TIPSET_001, - //stm: @CHAIN_SYNCER_START_001, @CHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01 - //stm: @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001 - //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 - kit.QuietMiningLogs() - - blocktime := 5 * time.Millisecond - ctx := context.Background() - nodes := startNodesWithFunds(ctx, t, blocktime, maxLookbackCap, maxStateWaitLookbackLimit) - - kit.RunClientTest(t, clicommands.Commands, nodes.lite) -} - type testNodes struct { lite *kit.TestFullNode full *kit.TestFullNode diff --git a/itests/kit/client.go b/itests/kit/client.go deleted file mode 100644 index 18e4259e4e8..00000000000 --- a/itests/kit/client.go +++ /dev/null @@ -1,161 +0,0 @@ -package kit - -import ( - "context" - "fmt" - "math/rand" - "os" - "path/filepath" - "regexp" - "strings" - "testing" - "time" - - "github.com/stretchr/testify/require" - lcli "github.com/urfave/cli/v2" - - "github.com/filecoin-project/specs-actors/v2/actors/builtin" - - "github.com/filecoin-project/lotus/api" - "github.com/filecoin-project/lotus/build" - "github.com/filecoin-project/lotus/chain/types" -) - -// RunClientTest exercises some of the Client CLI commands -func RunClientTest(t *testing.T, cmds []*lcli.Command, clientNode *TestFullNode) { - ctx, cancel := context.WithTimeout(context.Background(), time.Minute) - defer cancel() - - // Create mock CLI - mockCLI := NewMockCLI(ctx, t, cmds, api.NodeFull) - clientCLI := mockCLI.Client(clientNode.ListenAddr) - - // Get the Miner address - addrs, err := clientNode.StateListMiners(ctx, types.EmptyTSK) - require.NoError(t, err) - require.Len(t, addrs, 1) - - minerAddr := addrs[0] - fmt.Println("Miner:", minerAddr) - - // client query-ask - out := clientCLI.RunCmd("client", "query-ask", minerAddr.String()) - require.Regexp(t, regexp.MustCompile("Ask:"), out) - - // Create a deal (non-interactive) - // client deal --start-epoch= 1000000attofil - res, _, _, err := CreateImportFile(ctx, clientNode, 1, 0) - - require.NoError(t, err) - startEpoch := fmt.Sprintf("--start-epoch=%d", 2<<12) - dataCid := res.Root - price := "1000000attofil" - duration := fmt.Sprintf("%d", build.MinDealDuration) - out = clientCLI.RunCmd("client", "deal", startEpoch, dataCid.String(), minerAddr.String(), price, duration) - fmt.Println("client deal", out) - - // Create a deal (interactive) - // client deal - // - // (in days) - // - // "no" (verified Client) - // "yes" (confirm deal) - res, _, _, err = CreateImportFile(ctx, clientNode, 2, 0) - require.NoError(t, err) - dataCid2 := res.Root - duration = fmt.Sprintf("%d", build.MinDealDuration/builtin.EpochsInDay) - cmd := []string{"client", "deal"} - interactiveCmds := []string{ - dataCid2.String(), - duration, - minerAddr.String(), - "no", - "yes", - } - out = clientCLI.RunInteractiveCmd(cmd, interactiveCmds) - fmt.Println("client deal:\n", out) - - // Wait for provider to start sealing deal - dealStatus := "" - for { - // client list-deals - out = clientCLI.RunCmd("client", "list-deals", "--show-failed") - fmt.Println("list-deals:\n", out) - - lines := strings.Split(out, "\n") - require.GreaterOrEqual(t, len(lines), 2) - re := regexp.MustCompile(`\s+`) - parts := re.Split(lines[1], -1) - if len(parts) < 4 { - require.Fail(t, "bad list-deals output format") - } - dealStatus = parts[3] - fmt.Println(" Deal status:", dealStatus) - - st := CategorizeDealState(dealStatus) - require.NotEqual(t, TestDealStateFailed, st) - if st == TestDealStateComplete { - break - } - - time.Sleep(time.Second) - } - - // client retrieval-ask --size=1 - out = clientCLI.RunCmd("client", "retrieval-ask", "--size=1", minerAddr.String(), dataCid.String()) - require.Regexp(t, regexp.MustCompile("Ask:"), out) - fmt.Println("retrieval ask:\n", out) - - // Retrieve the first file from the Miner - // client retrieve - tmpdir, err := os.MkdirTemp(os.TempDir(), "test-cli-client") - require.NoError(t, err) - path := filepath.Join(tmpdir, "outfile.dat") - - // Wait for client retrieve to succeed. - for { - out = clientCLI.RunCmd("client", "retrieve", dataCid.String(), path) - fmt.Println("retrieve:\n", out) - if strings.Contains(out, "Success") { - break - } - } -} - -func CreateImportFile(ctx context.Context, client api.FullNode, rseed int, size int) (res *api.ImportRes, path string, data []byte, err error) { - data, path, err = createRandomFile(rseed, size) - if err != nil { - return nil, "", nil, err - } - - res, err = client.ClientImport(ctx, api.FileRef{Path: path}) - if err != nil { - return nil, "", nil, err - } - return res, path, data, nil -} - -func createRandomFile(rseed, size int) ([]byte, string, error) { - if size == 0 { - size = 1600 - } - data := make([]byte, size) - _, err := rand.New(rand.NewSource(int64(rseed))).Read(data) - if err != nil { - return nil, "", err - } - - dir, err := os.MkdirTemp(os.TempDir(), "test-make-deal-") - if err != nil { - return nil, "", err - } - - path := filepath.Join(dir, "sourcefile.dat") - err = os.WriteFile(path, data, 0644) - if err != nil { - return nil, "", err - } - - return data, path, nil -} diff --git a/itests/kit/deals.go b/itests/kit/deals.go deleted file mode 100644 index eb6b58667dc..00000000000 --- a/itests/kit/deals.go +++ /dev/null @@ -1,483 +0,0 @@ -package kit - -import ( - "context" - "errors" - "fmt" - "os" - "strings" - "testing" - "time" - - "github.com/ipfs/boxo/files" - dag "github.com/ipfs/boxo/ipld/merkledag" - dstest "github.com/ipfs/boxo/ipld/merkledag/test" - unixfile "github.com/ipfs/boxo/ipld/unixfs/file" - "github.com/ipfs/go-cid" - ipldcbor "github.com/ipfs/go-ipld-cbor" - ipld "github.com/ipfs/go-ipld-format" - "github.com/ipld/go-car" - _ "github.com/ipld/go-ipld-prime/codec/dagcbor" - "github.com/stretchr/testify/require" - "golang.org/x/sync/errgroup" - - "github.com/filecoin-project/go-address" - "github.com/filecoin-project/go-fil-markets/retrievalmarket" - "github.com/filecoin-project/go-fil-markets/shared_testutil" - "github.com/filecoin-project/go-fil-markets/storagemarket" - "github.com/filecoin-project/go-state-types/abi" - - "github.com/filecoin-project/lotus/api" - "github.com/filecoin-project/lotus/build" - "github.com/filecoin-project/lotus/chain/types" - sealing "github.com/filecoin-project/lotus/storage/pipeline" -) - -type DealHarness struct { - t *testing.T - client *TestFullNode - main *TestMiner - market *TestMiner -} - -type MakeFullDealParams struct { - Rseed int - FastRet bool - StartEpoch abi.ChainEpoch - UseCARFileForStorageDeal bool - - // SuspendUntilCryptoeconStable suspends deal-making, until cryptoecon - // parameters are stabilised. This affects projected collateral, and tests - // will fail in network version 13 and higher if deals are started too soon - // after network birth. - // - // The reason is that the formula for collateral calculation takes - // circulating supply into account: - // - // [portion of power this deal will be] * [~1% of tokens]. - // - // In the first epochs after genesis, the total circulating supply is - // changing dramatically in percentual terms. Therefore, if the deal is - // proposed too soon, by the time it gets published on chain, the quoted - // provider collateral will no longer be valid. - // - // The observation is that deals fail with: - // - // GasEstimateMessageGas error: estimating gas used: message execution - // failed: exit 16, reason: Provider collateral out of bounds. (RetCode=16) - // - // Enabling this will suspend deal-making until the network has reached a - // height of 300. - SuspendUntilCryptoeconStable bool -} - -// NewDealHarness creates a test harness that contains testing utilities for deals. -func NewDealHarness(t *testing.T, client *TestFullNode, main *TestMiner, market *TestMiner) *DealHarness { - return &DealHarness{ - t: t, - client: client, - main: main, - market: market, - } -} - -// MakeOnlineDeal makes an online deal, generating a random file with the -// supplied seed, and setting the specified fast retrieval flag and start epoch -// on the storage deal. It returns when the deal is sealed. -// -// TODO: convert input parameters to struct, and add size as an input param. -func (dh *DealHarness) MakeOnlineDeal(ctx context.Context, params MakeFullDealParams) (deal *cid.Cid, res *api.ImportRes, path string) { - deal, res, path = dh.StartRandomDeal(ctx, params) - - fmt.Printf("WAIT DEAL SEALEDS START\n") - dh.WaitDealSealed(ctx, deal, false, false, nil) - fmt.Printf("WAIT DEAL SEALEDS END\n") - return deal, res, path -} - -func (dh *DealHarness) StartRandomDeal(ctx context.Context, params MakeFullDealParams) (deal *cid.Cid, res *api.ImportRes, path string) { - if params.UseCARFileForStorageDeal { - res, _, path = dh.client.ClientImportCARFile(ctx, params.Rseed, 200) - } else { - res, path = dh.client.CreateImportFile(ctx, params.Rseed, 0) - } - - dh.t.Logf("FILE CID: %s", res.Root) - - if params.SuspendUntilCryptoeconStable { - dh.t.Logf("deal-making suspending until cryptecon parameters have stabilised") - ts := dh.client.WaitTillChain(ctx, HeightAtLeast(300)) - dh.t.Logf("deal-making continuing; current height is %d", ts.Height()) - } - - dp := dh.DefaultStartDealParams() - dp.Data.Root = res.Root - dp.DealStartEpoch = params.StartEpoch - dp.FastRetrieval = params.FastRet - deal = dh.StartDeal(ctx, dp) - - return deal, res, path -} - -func (dh *DealHarness) DefaultStartDealParams() api.StartDealParams { - dp := api.StartDealParams{ - Data: &storagemarket.DataRef{TransferType: storagemarket.TTGraphsync}, - EpochPrice: types.NewInt(1000000), - MinBlocksDuration: uint64(build.MinDealDuration), - } - - var err error - dp.Miner, err = dh.main.ActorAddress(context.Background()) - require.NoError(dh.t, err) - - dp.Wallet, err = dh.client.WalletDefaultAddress(context.Background()) - require.NoError(dh.t, err) - - return dp -} - -// StartDeal starts a storage deal between the client and the miner. -func (dh *DealHarness) StartDeal(ctx context.Context, dealParams api.StartDealParams) *cid.Cid { - dealProposalCid, err := dh.client.ClientStartDeal(ctx, &dealParams) - require.NoError(dh.t, err) - return dealProposalCid -} - -// WaitDealSealed waits until the deal is sealed. -func (dh *DealHarness) WaitDealSealed(ctx context.Context, deal *cid.Cid, noseal, noSealStart bool, cb func()) { -loop: - for { - di, err := dh.client.ClientGetDealInfo(ctx, *deal) - require.NoError(dh.t, err) - - switch di.State { - case storagemarket.StorageDealAwaitingPreCommit, storagemarket.StorageDealSealing: - if noseal { - return - } - if !noSealStart { - dh.StartSealingWaiting(ctx) - } - case storagemarket.StorageDealProposalRejected: - dh.t.Fatal("deal rejected") - case storagemarket.StorageDealFailing: - dh.t.Fatal("deal failed") - case storagemarket.StorageDealError: - dh.t.Fatal("deal errored", di.Message) - case storagemarket.StorageDealActive: - dh.t.Log("COMPLETE", di) - break loop - } - - mds, err := dh.market.MarketListIncompleteDeals(ctx) - require.NoError(dh.t, err) - - var minerState storagemarket.StorageDealStatus - for _, md := range mds { - if md.DealID == di.DealID { - minerState = md.State - break - } - } - - dh.t.Logf("Deal %d state: client:%s provider:%s\n", di.DealID, storagemarket.DealStates[di.State], storagemarket.DealStates[minerState]) - time.Sleep(time.Second / 2) - if cb != nil { - cb() - } - } - fmt.Printf("WAIT DEAL SEALED LOOP BROKEN\n") -} - -// WaitDealSealedQuiet waits until the deal is sealed, without logging anything. -func (dh *DealHarness) WaitDealSealedQuiet(ctx context.Context, deal *cid.Cid, noseal, noSealStart bool, cb func()) { -loop: - for { - di, err := dh.client.ClientGetDealInfo(ctx, *deal) - require.NoError(dh.t, err) - - switch di.State { - case storagemarket.StorageDealAwaitingPreCommit, storagemarket.StorageDealSealing: - if noseal { - return - } - if !noSealStart { - dh.StartSealingWaiting(ctx) - } - case storagemarket.StorageDealProposalRejected: - dh.t.Fatal("deal rejected") - case storagemarket.StorageDealFailing: - dh.t.Fatal("deal failed") - case storagemarket.StorageDealError: - dh.t.Fatal("deal errored", di.Message) - case storagemarket.StorageDealActive: - break loop - } - - _, err = dh.market.MarketListIncompleteDeals(ctx) - require.NoError(dh.t, err) - - time.Sleep(time.Second / 2) - if cb != nil { - cb() - } - } -} - -func (dh *DealHarness) ExpectDealFailure(ctx context.Context, deal *cid.Cid, errs string) error { - for { - di, err := dh.client.ClientGetDealInfo(ctx, *deal) - require.NoError(dh.t, err) - - switch di.State { - case storagemarket.StorageDealAwaitingPreCommit, storagemarket.StorageDealSealing: - return fmt.Errorf("deal is sealing, and we expected an error: %s", errs) - case storagemarket.StorageDealProposalRejected: - if strings.Contains(di.Message, errs) { - return nil - } - return fmt.Errorf("unexpected error: %s ; expected: %s", di.Message, errs) - case storagemarket.StorageDealFailing: - if strings.Contains(di.Message, errs) { - return nil - } - return fmt.Errorf("unexpected error: %s ; expected: %s", di.Message, errs) - case storagemarket.StorageDealError: - if strings.Contains(di.Message, errs) { - return nil - } - return fmt.Errorf("unexpected error: %s ; expected: %s", di.Message, errs) - case storagemarket.StorageDealActive: - return errors.New("expected to get an error, but didn't get one") - } - - mds, err := dh.market.MarketListIncompleteDeals(ctx) - require.NoError(dh.t, err) - - var minerState storagemarket.StorageDealStatus - for _, md := range mds { - if md.DealID == di.DealID { - minerState = md.State - break - } - } - - dh.t.Logf("Deal %d state: client:%s provider:%s\n", di.DealID, storagemarket.DealStates[di.State], storagemarket.DealStates[minerState]) - time.Sleep(time.Second / 2) - } -} - -// WaitDealPublished waits until the deal is published. -func (dh *DealHarness) WaitDealPublished(ctx context.Context, deal *cid.Cid) { - subCtx, cancel := context.WithCancel(ctx) - defer cancel() - - updates, err := dh.market.MarketGetDealUpdates(subCtx) - require.NoError(dh.t, err) - - for { - select { - case <-ctx.Done(): - dh.t.Fatal("context timeout") - case di := <-updates: - if deal.Equals(di.ProposalCid) { - switch di.State { - case storagemarket.StorageDealProposalRejected: - dh.t.Fatal("deal rejected") - case storagemarket.StorageDealFailing: - dh.t.Fatal("deal failed") - case storagemarket.StorageDealError: - dh.t.Fatal("deal errored", di.Message) - case storagemarket.StorageDealFinalizing, storagemarket.StorageDealAwaitingPreCommit, storagemarket.StorageDealSealing, storagemarket.StorageDealActive: - dh.t.Log("COMPLETE", di) - return - } - dh.t.Log("Deal state: ", storagemarket.DealStates[di.State]) - } - } - } -} - -func (dh *DealHarness) StartSealingWaiting(ctx context.Context) { - snums, err := dh.main.SectorsListNonGenesis(ctx) - require.NoError(dh.t, err) - for _, snum := range snums { - si, err := dh.main.SectorsStatus(ctx, snum, false) - require.NoError(dh.t, err) - - dh.t.Logf("Sector state <%d>-[%d]:, %s", snum, si.SealProof, si.State) - if si.State == api.SectorState(sealing.WaitDeals) { - require.NoError(dh.t, dh.main.SectorStartSealing(ctx, snum)) - } - - dh.main.FlushSealingBatches(ctx) - } -} - -func (dh *DealHarness) PerformRetrieval(ctx context.Context, deal *cid.Cid, root cid.Cid, carExport bool, offers ...api.QueryOffer) (path string) { - return dh.PerformRetrievalWithOrder(ctx, deal, root, carExport, func(offer api.QueryOffer, a address.Address) api.RetrievalOrder { - return offer.Order(a) - }, offers...) -} - -func (dh *DealHarness) PerformRetrievalWithOrder(ctx context.Context, deal *cid.Cid, root cid.Cid, carExport bool, makeOrder func(api.QueryOffer, address.Address) api.RetrievalOrder, offers ...api.QueryOffer) (path string) { - var offer api.QueryOffer - if len(offers) == 0 { - // perform retrieval. - info, err := dh.client.ClientGetDealInfo(ctx, *deal) - require.NoError(dh.t, err) - - offers, err := dh.client.ClientFindData(ctx, root, &info.PieceCID) - require.NoError(dh.t, err) - require.NotEmpty(dh.t, offers, "no offers") - offer = offers[0] - } else { - offer = offers[0] - } - - carFile := dh.t.TempDir() + string(os.PathSeparator) + "ret-car-" + root.String() - - caddr, err := dh.client.WalletDefaultAddress(ctx) - require.NoError(dh.t, err) - - updatesCtx, cancel := context.WithCancel(ctx) - updates, err := dh.client.ClientGetRetrievalUpdates(updatesCtx) - require.NoError(dh.t, err) - - order := makeOrder(offer, caddr) - - retrievalRes, err := dh.client.ClientRetrieve(ctx, order) - require.NoError(dh.t, err) -consumeEvents: - for { - var evt api.RetrievalInfo - select { - case <-updatesCtx.Done(): - dh.t.Fatal("Retrieval Timed Out") - case evt = <-updates: - if evt.ID != retrievalRes.DealID { - continue - } - } - switch evt.Status { - case retrievalmarket.DealStatusCompleted: - break consumeEvents - case retrievalmarket.DealStatusRejected: - dh.t.Fatalf("Retrieval Proposal Rejected: %s", evt.Message) - case - retrievalmarket.DealStatusDealNotFound, - retrievalmarket.DealStatusErrored: - dh.t.Fatalf("Retrieval Error: %s", evt.Message) - } - } - cancel() - - if order.RemoteStore != nil { - // if we're retrieving into a remote store, skip export - return "" - } - - require.NoError(dh.t, dh.client.ClientExport(ctx, - api.ExportRef{ - Root: root, - DealID: retrievalRes.DealID, - }, - api.FileRef{ - Path: carFile, - IsCAR: carExport, - })) - - ret := carFile - - return ret -} - -func (dh *DealHarness) ExtractFileFromCAR(ctx context.Context, file *os.File) string { - bserv := dstest.Bserv() - ch, err := car.LoadCar(ctx, bserv.Blockstore(), file) - require.NoError(dh.t, err) - - blk, err := bserv.GetBlock(ctx, ch.Roots[0]) - require.NoError(dh.t, err) - - reg := ipld.Registry{} - reg.Register(cid.DagProtobuf, dag.DecodeProtobufBlock) - reg.Register(cid.DagCBOR, ipldcbor.DecodeBlock) - reg.Register(cid.Raw, dag.DecodeRawBlock) - - nd, err := reg.Decode(blk) - require.NoError(dh.t, err) - - dserv := dag.NewDAGService(bserv) - - fil, err := unixfile.NewUnixfsFile(ctx, dserv, nd) - require.NoError(dh.t, err) - - tmpfile := dh.t.TempDir() + string(os.PathSeparator) + "file-in-car" + nd.Cid().String() - - err = files.WriteTo(fil, tmpfile) - require.NoError(dh.t, err) - - return tmpfile -} - -type RunConcurrentDealsOpts struct { - N int - FastRetrieval bool - CarExport bool - StartEpoch abi.ChainEpoch - UseCARFileForStorageDeal bool - IndexProvider *shared_testutil.MockIndexProvider -} - -func (dh *DealHarness) RunConcurrentDeals(opts RunConcurrentDealsOpts) { - ctx := context.Background() - errgrp, _ := errgroup.WithContext(context.Background()) - for i := 0; i < opts.N; i++ { - i := i - errgrp.Go(func() (err error) { - defer dh.t.Logf("finished concurrent deal %d/%d", i, opts.N) - defer func() { - // This is necessary because golang can't deal with test - // failures being reported from children goroutines ¯\_(ツ)_/¯ - if r := recover(); r != nil { - err = fmt.Errorf("deal failed: %s", r) - } - }() - - dh.t.Logf("making storage deal %d/%d", i, opts.N) - - deal, res, inPath := dh.MakeOnlineDeal(context.Background(), MakeFullDealParams{ - Rseed: 5 + i, - FastRet: opts.FastRetrieval, - StartEpoch: opts.StartEpoch, - UseCARFileForStorageDeal: opts.UseCARFileForStorageDeal, - }) - - // Check that the storage provider announced the deal to indexers - if opts.IndexProvider != nil { - notifs := opts.IndexProvider.GetNotifs() - _, ok := notifs[string(deal.Bytes())] - require.True(dh.t, ok) - } - - dh.t.Logf("retrieving deal %d/%d", i, opts.N) - - outPath := dh.PerformRetrieval(context.Background(), deal, res.Root, opts.CarExport) - - if opts.CarExport { - f, err := os.Open(outPath) - require.NoError(dh.t, err) - actualFile := dh.ExtractFileFromCAR(ctx, f) - require.NoError(dh.t, f.Close()) - - AssertFilesEqual(dh.t, inPath, actualFile) - } else { - AssertFilesEqual(dh.t, inPath, outPath) - } - - return nil - }) - } - require.NoError(dh.t, errgrp.Wait()) -} diff --git a/itests/kit/ensemble.go b/itests/kit/ensemble.go index 207ccef59af..462456eac4f 100644 --- a/itests/kit/ensemble.go +++ b/itests/kit/ensemble.go @@ -54,8 +54,6 @@ import ( "github.com/filecoin-project/lotus/gateway" "github.com/filecoin-project/lotus/genesis" "github.com/filecoin-project/lotus/lib/harmony/harmonydb" - "github.com/filecoin-project/lotus/markets/idxprov" - "github.com/filecoin-project/lotus/markets/idxprov/idxprov_test" lotusminer "github.com/filecoin-project/lotus/miner" "github.com/filecoin-project/lotus/node" "github.com/filecoin-project/lotus/node/config" @@ -124,17 +122,19 @@ type Ensemble struct { options *ensembleOpts inactive struct { - fullnodes []*TestFullNode - providernodes []*TestCurioNode - miners []*TestMiner - workers []*TestWorker + fullnodes []*TestFullNode + providernodes []*TestCurioNode + miners []*TestMiner + unmanagedMiners []*TestUnmanagedMiner + workers []*TestWorker } active struct { - fullnodes []*TestFullNode - providernodes []*TestCurioNode - miners []*TestMiner - workers []*TestWorker - bms map[*TestMiner]*BlockMiner + fullnodes []*TestFullNode + providernodes []*TestCurioNode + miners []*TestMiner + unmanagedMiners []*TestUnmanagedMiner + workers []*TestWorker + bms map[*TestMiner]*BlockMiner } genesis struct { version network.Version @@ -261,9 +261,7 @@ func (n *Ensemble) MinerEnroll(minerNode *TestMiner, full *TestFullNode, opts .. tdir, err := os.MkdirTemp("", "preseal-memgen") require.NoError(n.t, err) - minerCnt := len(n.inactive.miners) + len(n.active.miners) - - actorAddr, err := address.NewIDAddress(genesis2.MinerStart + uint64(minerCnt)) + actorAddr, err := address.NewIDAddress(genesis2.MinerStart + n.minerCount()) require.NoError(n.t, err) if options.mainMiner != nil { @@ -282,7 +280,7 @@ func (n *Ensemble) MinerEnroll(minerNode *TestMiner, full *TestFullNode, opts .. ) // Will use 2KiB sectors by default (default value of sectorSize). - proofType, err := miner.SealProofTypeFromSectorSize(options.sectorSize, n.genesis.version, false) + proofType, err := miner.SealProofTypeFromSectorSize(options.sectorSize, n.genesis.version, miner.SealProofVariant_Standard) require.NoError(n.t, err) // Create the preseal commitment. @@ -331,16 +329,59 @@ func (n *Ensemble) MinerEnroll(minerNode *TestMiner, full *TestFullNode, opts .. return n } +func (n *Ensemble) UnmanagedMinerEnroll(minerNode *TestUnmanagedMiner, full *TestFullNode, opts ...NodeOpt) *Ensemble { + require.NotNil(n.t, full, "full node required when instantiating miner") + + options := DefaultNodeOpts + for _, o := range opts { + err := o(&options) + require.NoError(n.t, err) + } + + privkey, _, err := libp2pcrypto.GenerateEd25519Key(rand.Reader) + require.NoError(n.t, err) + + peerId, err := peer.IDFromPrivateKey(privkey) + require.NoError(n.t, err) + + actorAddr, err := address.NewIDAddress(genesis2.MinerStart + n.minerCount()) + require.NoError(n.t, err) + + require.NotNil(n.t, options.ownerKey, "manual miner key can't be null if initializing a miner after genesis") + + *minerNode = TestUnmanagedMiner{ + t: n.t, + options: options, + ActorAddr: actorAddr, + OwnerKey: options.ownerKey, + FullNode: full, + } + minerNode.Libp2p.PeerID = peerId + minerNode.Libp2p.PrivKey = privkey + + return n +} + func (n *Ensemble) AddInactiveMiner(m *TestMiner) { n.inactive.miners = append(n.inactive.miners, m) } +func (n *Ensemble) AddInactiveUnmanagedMiner(m *TestUnmanagedMiner) { + n.inactive.unmanagedMiners = append(n.inactive.unmanagedMiners, m) +} + func (n *Ensemble) Miner(minerNode *TestMiner, full *TestFullNode, opts ...NodeOpt) *Ensemble { n.MinerEnroll(minerNode, full, opts...) n.AddInactiveMiner(minerNode) return n } +func (n *Ensemble) UnmanagedMiner(minerNode *TestUnmanagedMiner, full *TestFullNode, opts ...NodeOpt) *Ensemble { + n.UnmanagedMinerEnroll(minerNode, full, opts...) + n.AddInactiveUnmanagedMiner(minerNode) + return n +} + // Worker enrolls a new worker, using the provided full node for chain // interactions. func (n *Ensemble) Worker(minerNode *TestMiner, worker *TestWorker, opts ...NodeOpt) *Ensemble { @@ -623,12 +664,11 @@ func (n *Ensemble) Start() *Ensemble { n.t.Fatalf("invalid config from repo, got: %T", c) } cfg.Common.API.RemoteListenAddress = m.RemoteListener.Addr().String() - cfg.Subsystems.EnableMarkets = m.options.subsystems.Has(SMarkets) cfg.Subsystems.EnableMining = m.options.subsystems.Has(SMining) cfg.Subsystems.EnableSealing = m.options.subsystems.Has(SSealing) cfg.Subsystems.EnableSectorStorage = m.options.subsystems.Has(SSectorStorage) cfg.Subsystems.EnableSectorIndexDB = m.options.subsystems.Has(SHarmony) - cfg.Dealmaking.MaxStagingDealsBytes = m.options.maxStagingDealsBytes + cfg.EnableLibp2p = true if m.options.mainMiner != nil { token, err := m.options.mainMiner.FullNode.AuthNew(ctx, api.AllPermissions) @@ -714,7 +754,7 @@ func (n *Ensemble) Start() *Ensemble { m.FullNode = &minerCopy opts := []node.Option{ - node.StorageMiner(&m.StorageMiner, cfg.Subsystems), + node.StorageMiner(&m.StorageMiner, true), node.Base(), node.Repo(r), node.Test(), @@ -757,13 +797,6 @@ func (n *Ensemble) Start() *Ensemble { } }), } - - if m.options.subsystems.Has(SMarkets) { - opts = append(opts, - node.Override(new(idxprov.MeshCreator), idxprov_test.NewNoopMeshCreator), - ) - } - // append any node builder options. opts = append(opts, m.options.extraNodeOpts...) @@ -836,6 +869,79 @@ func (n *Ensemble) Start() *Ensemble { // to active, so clear the slice. n.inactive.miners = n.inactive.miners[:0] + // Create all inactive manual miners. + for _, m := range n.inactive.unmanagedMiners { + proofType, err := miner.WindowPoStProofTypeFromSectorSize(m.options.sectorSize, n.genesis.version) + require.NoError(n.t, err) + + params, aerr := actors.SerializeParams(&power3.CreateMinerParams{ + Owner: m.OwnerKey.Address, + Worker: m.OwnerKey.Address, + WindowPoStProofType: proofType, + Peer: abi.PeerID(m.Libp2p.PeerID), + }) + require.NoError(n.t, aerr) + + createStorageMinerMsg := &types.Message{ + From: m.OwnerKey.Address, + To: power.Address, + Value: big.Zero(), + + Method: power.Methods.CreateMiner, + Params: params, + } + signed, err := m.FullNode.FullNode.MpoolPushMessage(ctx, createStorageMinerMsg, &api.MessageSendSpec{ + MsgUuid: uuid.New(), + }) + require.NoError(n.t, err) + + mw, err := m.FullNode.FullNode.StateWaitMsg(ctx, signed.Cid(), build.MessageConfidence, api.LookbackNoLimit, true) + require.NoError(n.t, err) + require.Equal(n.t, exitcode.Ok, mw.Receipt.ExitCode) + + var retval power3.CreateMinerReturn + err = retval.UnmarshalCBOR(bytes.NewReader(mw.Receipt.Return)) + require.NoError(n.t, err, "failed to create miner") + + m.ActorAddr = retval.IDAddress + + has, err := m.FullNode.WalletHas(ctx, m.OwnerKey.Address) + require.NoError(n.t, err) + + // Only import the owner's full key into our companion full node, if we + // don't have it still. + if !has { + _, err = m.FullNode.WalletImport(ctx, &m.OwnerKey.KeyInfo) + require.NoError(n.t, err) + } + + enc, err := actors.SerializeParams(&miner2.ChangePeerIDParams{NewID: abi.PeerID(m.Libp2p.PeerID)}) + require.NoError(n.t, err) + + msg := &types.Message{ + From: m.OwnerKey.Address, + To: m.ActorAddr, + Method: builtin.MethodsMiner.ChangePeerID, + Params: enc, + Value: types.NewInt(0), + } + + _, err2 := m.FullNode.MpoolPushMessage(ctx, msg, &api.MessageSendSpec{ + MsgUuid: uuid.New(), + }) + require.NoError(n.t, err2) + + minerCopy := *m.FullNode + minerCopy.FullNode = modules.MakeUuidWrapper(minerCopy.FullNode) + m.FullNode = &minerCopy + + n.active.unmanagedMiners = append(n.active.unmanagedMiners, m) + } + + // If we are here, we have processed all inactive manual miners and moved them + // to active, so clear the slice. + n.inactive.unmanagedMiners = n.inactive.unmanagedMiners[:0] + // --------------------- // WORKERS // --------------------- @@ -1065,6 +1171,10 @@ func (n *Ensemble) BeginMining(blocktime time.Duration, miners ...*TestMiner) [] return bms } +func (n *Ensemble) minerCount() uint64 { + return uint64(len(n.inactive.miners) + len(n.active.miners) + len(n.inactive.unmanagedMiners) + len(n.active.unmanagedMiners)) +} + func (n *Ensemble) generateGenesis() *genesis.Template { var verifRoot = gen.DefaultVerifregRootkeyActor if k := n.options.verifiedRoot.key; k != nil { diff --git a/itests/kit/ensemble_presets.go b/itests/kit/ensemble_presets.go index 10a83be7dd5..8748ac6ad3e 100644 --- a/itests/kit/ensemble_presets.go +++ b/itests/kit/ensemble_presets.go @@ -2,7 +2,6 @@ package kit import ( "testing" - "time" ) // EnsembleMinimal creates and starts an Ensemble with a single full node and a single miner. @@ -37,29 +36,6 @@ func EnsembleWorker(t *testing.T, opts ...interface{}) (*TestFullNode, *TestMine return &full, &miner, &worker, ens } -func EnsembleWithMinerAndMarketNodes(t *testing.T, opts ...interface{}) (*TestFullNode, *TestMiner, *TestMiner, *Ensemble) { - eopts, nopts := siftOptions(t, opts) - - var ( - fullnode TestFullNode - main, market TestMiner - ) - - mainNodeOpts := []NodeOpt{WithSubsystems(SSealing, SSectorStorage, SMining), DisableLibp2p()} - mainNodeOpts = append(mainNodeOpts, nopts...) - - blockTime := 100 * time.Millisecond - ens := NewEnsemble(t, eopts...).FullNode(&fullnode, nopts...).Miner(&main, &fullnode, mainNodeOpts...).Start() - ens.BeginMining(blockTime) - - marketNodeOpts := []NodeOpt{OwnerAddr(fullnode.DefaultKey), MainMiner(&main), WithSubsystems(SMarkets)} - marketNodeOpts = append(marketNodeOpts, nopts...) - - ens.Miner(&market, &fullnode, marketNodeOpts...).Start().Connect(market, fullnode) - - return &fullnode, &main, &market, ens -} - // EnsembleTwoOne creates and starts an Ensemble with two full nodes and one miner. // It does not interconnect nodes nor does it begin mining. // diff --git a/itests/kit/node_full.go b/itests/kit/node_full.go index d44d691dd35..abcd8aea43f 100644 --- a/itests/kit/node_full.go +++ b/itests/kit/node_full.go @@ -86,22 +86,6 @@ func (f TestFullNode) Shutdown(ctx context.Context) error { return f.Stop(ctx) } -func (f *TestFullNode) ClientImportCARFile(ctx context.Context, rseed int, size int) (res *api.ImportRes, carv1FilePath string, origFilePath string) { - carv1FilePath, origFilePath = CreateRandomCARv1(f.t, rseed, size) - res, err := f.ClientImport(ctx, api.FileRef{Path: carv1FilePath, IsCAR: true}) - require.NoError(f.t, err) - return res, carv1FilePath, origFilePath -} - -// CreateImportFile creates a random file with the specified seed and size, and -// imports it into the full node. -func (f *TestFullNode) CreateImportFile(ctx context.Context, rseed int, size int) (res *api.ImportRes, path string) { - path = CreateRandomFile(f.t, rseed, size) - res, err := f.ClientImport(ctx, api.FileRef{Path: path}) - require.NoError(f.t, err) - return res, path -} - // WaitTillChain waits until a specified chain condition is met. It returns // the first tipset where the condition is met. func (f *TestFullNode) WaitTillChain(ctx context.Context, pred ChainPredicate) *types.TipSet { diff --git a/itests/kit/node_miner.go b/itests/kit/node_miner.go index ee2ee3eaae2..2e6a2b80a20 100644 --- a/itests/kit/node_miner.go +++ b/itests/kit/node_miner.go @@ -32,8 +32,7 @@ import ( type MinerSubsystem int const ( - SMarkets MinerSubsystem = 1 << iota - SMining + SMining MinerSubsystem = 1 << iota SSealing SSectorStorage diff --git a/itests/kit/node_opts.go b/itests/kit/node_opts.go index 1f4f9f6a4db..acffbdf036e 100644 --- a/itests/kit/node_opts.go +++ b/itests/kit/node_opts.go @@ -25,6 +25,7 @@ import ( const DefaultPresealsPerBootstrapMiner = 2 const TestSpt = abi.RegisteredSealProof_StackedDrg2KiBV1_1 +const TestSptNi = abi.RegisteredSealProof_StackedDrg2KiBV1_2_Feat_NiPoRep // nodeOpts is an options accumulating struct, where functional options are // merged into. @@ -84,7 +85,6 @@ type NodeOpt func(opts *nodeOpts) error func WithAllSubsystems() NodeOpt { return func(opts *nodeOpts) error { - opts.subsystems = opts.subsystems.Add(SMarkets) opts.subsystems = opts.subsystems.Add(SMining) opts.subsystems = opts.subsystems.Add(SSealing) opts.subsystems = opts.subsystems.Add(SSectorStorage) diff --git a/itests/kit/node_unmanaged.go b/itests/kit/node_unmanaged.go new file mode 100644 index 00000000000..0f27052406d --- /dev/null +++ b/itests/kit/node_unmanaged.go @@ -0,0 +1,26 @@ +package kit + +import ( + "testing" + + "github.com/filecoin-project/go-address" + "github.com/filecoin-project/lotus/chain/wallet/key" + libp2pcrypto "github.com/libp2p/go-libp2p/core/crypto" + "github.com/libp2p/go-libp2p/core/peer" +) + +// TestUnmanagedMiner is a miner that's not managed by the storage/ +// infrastructure, all tasks must be manually executed, managed and scheduled by +// the test or test kit. +type TestUnmanagedMiner struct { + t *testing.T + options nodeOpts + + ActorAddr address.Address + OwnerKey *key.Key + FullNode *TestFullNode + Libp2p struct { + PeerID peer.ID + PrivKey libp2pcrypto.PrivKey + } +} diff --git a/itests/manual_onboarding_test.go b/itests/manual_onboarding_test.go new file mode 100644 index 00000000000..a923b13c34e --- /dev/null +++ b/itests/manual_onboarding_test.go @@ -0,0 +1,896 @@ +package itests + +import ( + "bytes" + "context" + "fmt" + "os" + "path/filepath" + "strings" + "testing" + "time" + + "github.com/ipfs/go-cid" + "github.com/stretchr/testify/require" + cbg "github.com/whyrusleeping/cbor-gen" + + ffi "github.com/filecoin-project/filecoin-ffi" + "github.com/filecoin-project/go-address" + "github.com/filecoin-project/go-state-types/abi" + "github.com/filecoin-project/go-state-types/builtin" + miner14 "github.com/filecoin-project/go-state-types/builtin/v14/miner" + "github.com/filecoin-project/go-state-types/crypto" + "github.com/filecoin-project/go-state-types/proof" + + "github.com/filecoin-project/lotus/api" + "github.com/filecoin-project/lotus/build" + "github.com/filecoin-project/lotus/chain/actors" + "github.com/filecoin-project/lotus/chain/actors/builtin/miner" + "github.com/filecoin-project/lotus/chain/actors/policy" + "github.com/filecoin-project/lotus/chain/types" + "github.com/filecoin-project/lotus/itests/kit" +) + +const sectorSize = abi.SectorSize(2 << 10) // 2KiB + +// Manually onboard CC sectors, bypassing lotus-miner onboarding pathways +func TestManualCCOnboarding(t *testing.T) { + req := require.New(t) + + for _, withMockProofs := range []bool{true, false} { + testName := "WithRealProofs" + if withMockProofs { + testName = "WithMockProofs" + } + t.Run(testName, func(t *testing.T) { + kit.QuietMiningLogs() + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + + var ( + blocktime = 2 * time.Millisecond + + client kit.TestFullNode + minerA kit.TestMiner // A is a standard genesis miner + minerB kit.TestUnmanagedMiner // B is a CC miner we will onboard manually + minerC kit.TestUnmanagedMiner // C is a CC miner we will onboard manually with NI-PoRep + + // TODO: single sector per miner for now, but this isn't going to scale when refactored into + // TestUnmanagedMiner - they'll need their own list of sectors and their own copy of each of + // the things below, including per-sector maps of some of these too. + // + // Misc thoughts: + // Each TestUnmanagedMiner should have its own temp dir, within which it can have a cache dir + // and a place to put sealed and unsealed sectors. We can't share these between miners. + // We should have a way to "add" CC sectors, which will setup the sealed and unsealed files + // and can move many of the manualOnboarding*() methods into the TestUnmanagedMiner struct. + // + // The manualOnboardingRunWindowPost() Go routine should be owned by TestUnmanagedMiner and + // a simple "miner.StartWindowPost()" should suffice to make it observe all of the sectors + // it knows about and start posting for them. We should be able to ignore most (all?) of the + // special cases that lotus-miner currently has to deal with. + + // sector numbers, make them unique for each miner so our maps work + bSectorNum = abi.SectorNumber(22) + cSectorNum = abi.SectorNumber(33) + + tmpDir = t.TempDir() + + cacheDirPath = map[abi.SectorNumber]string{} // can't share a cacheDir between miners + unsealedSectorPath, sealedSectorPath = map[abi.SectorNumber]string{}, map[abi.SectorNumber]string{} + sealedCid, unsealedCid = map[abi.SectorNumber]cid.Cid{}, map[abi.SectorNumber]cid.Cid{} + + // note we'll use the same randEpoch for both miners + sealRandEpoch = policy.SealRandomnessLookback + sealTickets = map[abi.SectorNumber]abi.SealRandomness{} + ) + + // Setup and begin mining with a single miner (A) + + kitOpts := []kit.EnsembleOpt{} + if withMockProofs { + kitOpts = append(kitOpts, kit.MockProofs()) + } + nodeOpts := []kit.NodeOpt{kit.SectorSize(sectorSize), kit.WithAllSubsystems()} + ens := kit.NewEnsemble(t, kitOpts...). + FullNode(&client, nodeOpts...). + Miner(&minerA, &client, nodeOpts...). + Start(). + InterconnectAll() + ens.BeginMining(blocktime) + + nodeOpts = append(nodeOpts, kit.OwnerAddr(client.DefaultKey)) + ens.UnmanagedMiner(&minerB, &client, nodeOpts...).Start() + ens.UnmanagedMiner(&minerC, &client, nodeOpts...).Start() + + build.Clock.Sleep(time.Second) + + nv, err := client.StateNetworkVersion(ctx, types.EmptyTSK) + req.NoError(err) + sealProofType, err := miner.SealProofTypeFromSectorSize(sectorSize, nv, miner.SealProofVariant_Standard) + req.NoError(err) + nonInteractiveSealProofType, err := miner.SealProofTypeFromSectorSize(sectorSize, nv, miner.SealProofVariant_NonInteractive) + req.NoError(err) + + head, err := client.ChainHead(ctx) + req.NoError(err) + + t.Log("Checking initial power ...") + + // Miner A should have power + p, err := client.StateMinerPower(ctx, minerA.ActorAddr, head.Key()) + req.NoError(err) + t.Logf("MinerA RBP: %v, QaP: %v", p.MinerPower.QualityAdjPower.String(), p.MinerPower.RawBytePower.String()) + + // Miner B should have no power + p, err = client.StateMinerPower(ctx, minerB.ActorAddr, head.Key()) + req.NoError(err) + t.Logf("MinerB RBP: %v, QaP: %v", p.MinerPower.QualityAdjPower.String(), p.MinerPower.RawBytePower.String()) + req.True(p.MinerPower.RawBytePower.IsZero()) + + // Miner C should have no power + p, err = client.StateMinerPower(ctx, minerC.ActorAddr, head.Key()) + req.NoError(err) + t.Logf("MinerC RBP: %v, QaP: %v", p.MinerPower.QualityAdjPower.String(), p.MinerPower.RawBytePower.String()) + req.True(p.MinerPower.RawBytePower.IsZero()) + + // Run precommit for a sector on miner B + + t.Logf("Waiting for at least epoch %d for seal randomness (current epoch %d) ...", sealRandEpoch+5, head.Height()) + client.WaitTillChain(ctx, kit.HeightAtLeast(sealRandEpoch+5)) + + if withMockProofs { + sealedCid[bSectorNum] = cid.MustParse("bagboea4b5abcatlxechwbp7kjpjguna6r6q7ejrhe6mdp3lf34pmswn27pkkiekz") + } else { + cacheDirPath[bSectorNum] = filepath.Join(tmpDir, "cacheb") + unsealedSectorPath[bSectorNum] = filepath.Join(tmpDir, "unsealedb") + sealedSectorPath[bSectorNum] = filepath.Join(tmpDir, "sealedb") + + sealTickets[bSectorNum], sealedCid[bSectorNum], unsealedCid[bSectorNum] = manualOnboardingGeneratePreCommit( + ctx, + t, + client, + cacheDirPath[bSectorNum], + unsealedSectorPath[bSectorNum], + sealedSectorPath[bSectorNum], + minerB.ActorAddr, + bSectorNum, + sealRandEpoch, + sealProofType, + ) + } + + t.Log("Submitting MinerB PreCommitSector ...") + + r, err := manualOnboardingSubmitMessage(ctx, client, minerB, &miner14.PreCommitSectorBatchParams2{ + Sectors: []miner14.SectorPreCommitInfo{{ + Expiration: 2880 * 300, + SectorNumber: bSectorNum, + SealProof: sealProofType, + SealedCID: sealedCid[bSectorNum], + SealRandEpoch: sealRandEpoch, + }}, + }, 1, builtin.MethodsMiner.PreCommitSectorBatch2) + req.NoError(err) + req.True(r.Receipt.ExitCode.IsSuccess()) + + preCommitInfo, err := client.StateSectorPreCommitInfo(ctx, minerB.ActorAddr, bSectorNum, r.TipSet) + req.NoError(err) + + // Run prove commit for the sector on miner B + + seedRandomnessHeight := preCommitInfo.PreCommitEpoch + policy.GetPreCommitChallengeDelay() + t.Logf("Waiting %d epochs for seed randomness at epoch %d (current epoch %d)...", seedRandomnessHeight-r.Height, seedRandomnessHeight, r.Height) + client.WaitTillChain(ctx, kit.HeightAtLeast(seedRandomnessHeight+5)) + + var sectorProof []byte + if withMockProofs { + sectorProof = []byte{0xde, 0xad, 0xbe, 0xef} + } else { + sectorProof = manualOnboardingGenerateProveCommit( + ctx, + t, + client, + cacheDirPath[bSectorNum], + sealedSectorPath[bSectorNum], + minerB.ActorAddr, + bSectorNum, + sealedCid[bSectorNum], + unsealedCid[bSectorNum], + sealTickets[bSectorNum], + sealProofType, + ) + } + + t.Log("Submitting MinerB ProveCommitSector ...") + + r, err = manualOnboardingSubmitMessage(ctx, client, minerB, &miner14.ProveCommitSectors3Params{ + SectorActivations: []miner14.SectorActivationManifest{{SectorNumber: bSectorNum}}, + SectorProofs: [][]byte{sectorProof}, + RequireActivationSuccess: true, + }, 0, builtin.MethodsMiner.ProveCommitSectors3) + req.NoError(err) + req.True(r.Receipt.ExitCode.IsSuccess()) + + // Check power after proving, should still be zero until the PoSt is submitted + p, err = client.StateMinerPower(ctx, minerB.ActorAddr, r.TipSet) + req.NoError(err) + t.Logf("MinerB RBP: %v, QaP: %v", p.MinerPower.QualityAdjPower.String(), p.MinerPower.RawBytePower.String()) + req.True(p.MinerPower.RawBytePower.IsZero()) + + // start a background PoST scheduler for miner B + bFirstCh, bErrCh := manualOnboardingRunWindowPost( + ctx, + withMockProofs, + client, + minerB, + bSectorNum, + cacheDirPath[bSectorNum], + sealedSectorPath[bSectorNum], + sealedCid[bSectorNum], + sealProofType, + ) + + // NI-PoRep + + actorIdNum, err := address.IDFromAddress(minerC.ActorAddr) + req.NoError(err) + actorId := abi.ActorID(actorIdNum) + + if withMockProofs { + sectorProof = []byte{0xde, 0xad, 0xbe, 0xef} + sealedCid[cSectorNum] = cid.MustParse("bagboea4b5abcatlxechwbp7kjpjguna6r6q7ejrhe6mdp3lf34pmswn27pkkiekz") + } else { + // NI-PoRep compresses precommit and commit into one step + cacheDirPath[cSectorNum] = filepath.Join(tmpDir, "cachec") + unsealedSectorPath[cSectorNum] = filepath.Join(tmpDir, "unsealedc") + sealedSectorPath[cSectorNum] = filepath.Join(tmpDir, "sealedc") + + sealTickets[cSectorNum], sealedCid[cSectorNum], unsealedCid[cSectorNum] = manualOnboardingGeneratePreCommit( + ctx, + t, + client, + cacheDirPath[cSectorNum], + unsealedSectorPath[cSectorNum], + sealedSectorPath[cSectorNum], + minerC.ActorAddr, + cSectorNum, + sealRandEpoch, + nonInteractiveSealProofType, + ) + + sectorProofCircuits := manualOnboardingGenerateProveCommit( + ctx, + t, + client, + cacheDirPath[cSectorNum], + sealedSectorPath[cSectorNum], + minerC.ActorAddr, + cSectorNum, + sealedCid[cSectorNum], + unsealedCid[cSectorNum], + sealTickets[cSectorNum], + nonInteractiveSealProofType, + ) + + sectorProof, err = ffi.AggregateSealProofs(proof.AggregateSealVerifyProofAndInfos{ + Miner: actorId, + SealProof: nonInteractiveSealProofType, + AggregateProof: abi.RegisteredAggregationProof_SnarkPackV2, + Infos: []proof.AggregateSealVerifyInfo{{ + Number: cSectorNum, + Randomness: sealTickets[cSectorNum], + InteractiveRandomness: nil, + SealedCID: sealedCid[cSectorNum], + UnsealedCID: unsealedCid[cSectorNum], + }}, + }, [][]byte{sectorProofCircuits}) + req.NoError(err) + } + + t.Log("Submitting MinerC ProveCommitSectorsNI ...") + + r, err = manualOnboardingSubmitMessage(ctx, client, minerC, &miner14.ProveCommitSectorsNIParams{ + Sectors: []miner14.SectorNIActivationInfo{{ + SealingNumber: cSectorNum, + SealerID: actorId, + SectorNumber: cSectorNum, + SealedCID: sealedCid[cSectorNum], + SealRandEpoch: sealRandEpoch, + Expiration: 2880 * 300, + }}, + SealProofType: nonInteractiveSealProofType, + SectorProofs: [][]byte{sectorProof}, + RequireActivationSuccess: true, + }, 1, builtin.MethodsMiner.ProveCommitSectorsNI) + req.NoError(err) + req.True(r.Receipt.ExitCode.IsSuccess()) + + // start a background PoST scheduler for miner C + cFirstCh, cErrCh := manualOnboardingRunWindowPost( + ctx, + withMockProofs, + client, + minerC, + cSectorNum, + cacheDirPath[cSectorNum], + sealedSectorPath[cSectorNum], + sealedCid[cSectorNum], + nonInteractiveSealProofType, + ) + + checkPostSchedulers := func() { + t.Helper() + select { + case err, ok := <-bErrCh: + if ok { + t.Fatalf("Received error from Miner B PoST scheduler: %v", err) + } + case err, ok := <-cErrCh: + if ok { + t.Fatalf("Received error from Miner C PoST scheduler: %v", err) + } + default: + } + } + + isClosed := func(ch <-chan struct{}) bool { + select { + case <-ch: + return true + default: + } + return false + } + + for ctx.Err() == nil { + checkPostSchedulers() + // wait till the first PoST is submitted for both by checking if both bFirstCh and cFirstCh are closed, if so, break, otherwise sleep for 500ms and check again + if isClosed(bFirstCh) && isClosed(cFirstCh) { + break + } + t.Log("Waiting for first PoST to be submitted for all miners ...") + select { + case <-time.After(2 * time.Second): + case <-ctx.Done(): + t.Fatal("Context cancelled") + } + } + + // Fetch on-chain sector properties + + soi, err := client.StateSectorGetInfo(ctx, minerB.ActorAddr, bSectorNum, r.TipSet) + req.NoError(err) + t.Logf("Miner B SectorOnChainInfo %d: %+v", bSectorNum, soi) + soi, err = client.StateSectorGetInfo(ctx, minerC.ActorAddr, cSectorNum, r.TipSet) + req.NoError(err) + t.Logf("Miner C SectorOnChainInfo %d: %+v", cSectorNum, soi) + + head, err = client.ChainHead(ctx) + req.NoError(err) + + head = client.WaitTillChain(ctx, kit.HeightAtLeast(head.Height()+5)) + + checkPostSchedulers() + + t.Log("Checking power after PoSt ...") + + // Miner B should now have power + p, err = client.StateMinerPower(ctx, minerB.ActorAddr, head.Key()) + req.NoError(err) + t.Logf("MinerB RBP: %v, QaP: %v", p.MinerPower.QualityAdjPower.String(), p.MinerPower.RawBytePower.String()) + req.Equal(uint64(2<<10), p.MinerPower.RawBytePower.Uint64()) // 2kiB RBP + req.Equal(uint64(2<<10), p.MinerPower.QualityAdjPower.Uint64()) // 2kiB QaP + + // Miner C should now have power + p, err = client.StateMinerPower(ctx, minerC.ActorAddr, head.Key()) + req.NoError(err) + t.Logf("MinerC RBP: %v, QaP: %v", p.MinerPower.QualityAdjPower.String(), p.MinerPower.RawBytePower.String()) + req.Equal(uint64(2<<10), p.MinerPower.RawBytePower.Uint64()) // 2kiB RBP + req.Equal(uint64(2<<10), p.MinerPower.QualityAdjPower.Uint64()) // 2kiB QaP + + checkPostSchedulers() + }) + } +} + +func manualOnboardingGeneratePreCommit( + ctx context.Context, + t *testing.T, + client api.FullNode, + cacheDirPath, + unsealedSectorPath, + sealedSectorPath string, + minerAddr address.Address, + sectorNumber abi.SectorNumber, + sealRandEpoch abi.ChainEpoch, + proofType abi.RegisteredSealProof, +) (abi.SealRandomness, cid.Cid, cid.Cid) { + + req := require.New(t) + t.Logf("Generating proof type %d PreCommit ...", proofType) + + _ = os.Mkdir(cacheDirPath, 0755) + unsealedSize := abi.PaddedPieceSize(sectorSize).Unpadded() + req.NoError(os.WriteFile(unsealedSectorPath, make([]byte, unsealedSize), 0644)) + req.NoError(os.WriteFile(sealedSectorPath, make([]byte, sectorSize), 0644)) + + t.Logf("Wrote unsealed sector to %s", unsealedSectorPath) + t.Logf("Wrote sealed sector to %s", sealedSectorPath) + + head, err := client.ChainHead(ctx) + req.NoError(err) + + minerAddrBytes := new(bytes.Buffer) + req.NoError(minerAddr.MarshalCBOR(minerAddrBytes)) + + rand, err := client.StateGetRandomnessFromTickets(ctx, crypto.DomainSeparationTag_SealRandomness, sealRandEpoch, minerAddrBytes.Bytes(), head.Key()) + req.NoError(err) + sealTickets := abi.SealRandomness(rand) + + t.Logf("Running proof type %d SealPreCommitPhase1 for sector %d...", proofType, sectorNumber) + + actorIdNum, err := address.IDFromAddress(minerAddr) + req.NoError(err) + actorId := abi.ActorID(actorIdNum) + + pc1, err := ffi.SealPreCommitPhase1( + proofType, + cacheDirPath, + unsealedSectorPath, + sealedSectorPath, + sectorNumber, + actorId, + sealTickets, + []abi.PieceInfo{}, + ) + req.NoError(err) + req.NotNil(pc1) + + t.Logf("Running proof type %d SealPreCommitPhase2 for sector %d...", proofType, sectorNumber) + + sealedCid, unsealedCid, err := ffi.SealPreCommitPhase2( + pc1, + cacheDirPath, + sealedSectorPath, + ) + req.NoError(err) + + t.Logf("Unsealed CID: %s", unsealedCid) + t.Logf("Sealed CID: %s", sealedCid) + + return sealTickets, sealedCid, unsealedCid +} + +func manualOnboardingGenerateProveCommit( + ctx context.Context, + t *testing.T, + client api.FullNode, + cacheDirPath, + sealedSectorPath string, + minerAddr address.Address, + sectorNumber abi.SectorNumber, + sealedCid, unsealedCid cid.Cid, + sealTickets abi.SealRandomness, + proofType abi.RegisteredSealProof, +) []byte { + req := require.New(t) + + t.Logf("Generating proof type %d Sector Proof ...", proofType) + + head, err := client.ChainHead(ctx) + req.NoError(err) + + var seedRandomnessHeight abi.ChainEpoch + + if proofType.IsNonInteractive() { + // this just needs to be somewhere between 6 months and chain finality for NI-PoRep, + // and there's no PreCommitInfo because it's non-interactive! + seedRandomnessHeight = head.Height() - policy.ChainFinality + } else { + preCommitInfo, err := client.StateSectorPreCommitInfo(ctx, minerAddr, sectorNumber, head.Key()) + req.NoError(err) + seedRandomnessHeight = preCommitInfo.PreCommitEpoch + policy.GetPreCommitChallengeDelay() + } + + minerAddrBytes := new(bytes.Buffer) + req.NoError(minerAddr.MarshalCBOR(minerAddrBytes)) + + rand, err := client.StateGetRandomnessFromBeacon(ctx, crypto.DomainSeparationTag_InteractiveSealChallengeSeed, seedRandomnessHeight, minerAddrBytes.Bytes(), head.Key()) + req.NoError(err) + seedRandomness := abi.InteractiveSealRandomness(rand) + + actorIdNum, err := address.IDFromAddress(minerAddr) + req.NoError(err) + actorId := abi.ActorID(actorIdNum) + + t.Logf("Running proof type %d SealCommitPhase1 for sector %d...", proofType, sectorNumber) + + scp1, err := ffi.SealCommitPhase1( + proofType, + sealedCid, + unsealedCid, + cacheDirPath, + sealedSectorPath, + sectorNumber, + actorId, + sealTickets, + seedRandomness, + []abi.PieceInfo{}, + ) + req.NoError(err) + + t.Logf("Running proof type %d SealCommitPhase2 for sector %d...", proofType, sectorNumber) + + var sectorProof []byte + if proofType.IsNonInteractive() { + sectorProof, err = ffi.SealCommitPhase2CircuitProofs(scp1, sectorNumber) + req.NoError(err) + } else { + sectorProof, err = ffi.SealCommitPhase2(scp1, sectorNumber, actorId) + req.NoError(err) + } + + t.Logf("Got proof type %d sector proof of length %d", proofType, len(sectorProof)) + + return sectorProof +} + +func manualOnboardingGenerateWindowPost( + ctx context.Context, + client api.FullNode, + cacheDirPath string, + sealedSectorPath string, + minerAddr address.Address, + sectorNumber abi.SectorNumber, + sealedCid cid.Cid, + proofType abi.RegisteredSealProof, +) ([]byte, error) { + + head, err := client.ChainHead(ctx) + if err != nil { + return nil, fmt.Errorf("failed to get chain head: %w", err) + } + + minerInfo, err := client.StateMinerInfo(ctx, minerAddr, head.Key()) + if err != nil { + return nil, fmt.Errorf("failed to get miner info: %w", err) + } + + di, err := client.StateMinerProvingDeadline(ctx, minerAddr, types.EmptyTSK) + if err != nil { + return nil, fmt.Errorf("failed to get proving deadline: %w", err) + } + + minerAddrBytes := new(bytes.Buffer) + if err := minerAddr.MarshalCBOR(minerAddrBytes); err != nil { + return nil, fmt.Errorf("failed to marshal miner address: %w", err) + } + + rand, err := client.StateGetRandomnessFromBeacon(ctx, crypto.DomainSeparationTag_WindowedPoStChallengeSeed, di.Challenge, minerAddrBytes.Bytes(), head.Key()) + if err != nil { + return nil, fmt.Errorf("failed to get randomness: %w", err) + } + postRand := abi.PoStRandomness(rand) + postRand[31] &= 0x3f // make fr32 compatible + + privateSectorInfo := ffi.PrivateSectorInfo{ + SectorInfo: proof.SectorInfo{ + SealProof: proofType, + SectorNumber: sectorNumber, + SealedCID: sealedCid, + }, + CacheDirPath: cacheDirPath, + PoStProofType: minerInfo.WindowPoStProofType, + SealedSectorPath: sealedSectorPath, + } + + actorIdNum, err := address.IDFromAddress(minerAddr) + if err != nil { + return nil, fmt.Errorf("failed to get actor ID: %w", err) + } + actorId := abi.ActorID(actorIdNum) + + windowProofs, faultySectors, err := ffi.GenerateWindowPoSt(actorId, ffi.NewSortedPrivateSectorInfo(privateSectorInfo), postRand) + if err != nil { + return nil, fmt.Errorf("failed to generate window post: %w", err) + } + if len(faultySectors) > 0 { + return nil, fmt.Errorf("post failed for sectors: %v", faultySectors) + } + if len(windowProofs) != 1 { + return nil, fmt.Errorf("expected 1 proof, got %d", len(windowProofs)) + } + if windowProofs[0].PoStProof != minerInfo.WindowPoStProofType { + return nil, fmt.Errorf("expected proof type %d, got %d", minerInfo.WindowPoStProofType, windowProofs[0].PoStProof) + } + proofBytes := windowProofs[0].ProofBytes + + info := proof.WindowPoStVerifyInfo{ + Randomness: postRand, + Proofs: []proof.PoStProof{{PoStProof: minerInfo.WindowPoStProofType, ProofBytes: proofBytes}}, + ChallengedSectors: []proof.SectorInfo{{SealProof: proofType, SectorNumber: sectorNumber, SealedCID: sealedCid}}, + Prover: actorId, + } + + verified, err := ffi.VerifyWindowPoSt(info) + if err != nil { + return nil, fmt.Errorf("failed to verify window post: %w", err) + } + if !verified { + return nil, fmt.Errorf("window post verification failed") + } + + return proofBytes, nil +} + +func manualOnboardingDisputeWindowPost( + ctx context.Context, + client kit.TestFullNode, + miner kit.TestUnmanagedMiner, + sectorNumber abi.SectorNumber, +) error { + + head, err := client.ChainHead(ctx) + if err != nil { + return fmt.Errorf("failed to get chain head: %w", err) + } + + sp, err := client.StateSectorPartition(ctx, miner.ActorAddr, sectorNumber, head.Key()) + if err != nil { + return fmt.Errorf("failed to get sector partition: %w", err) + } + + di, err := client.StateMinerProvingDeadline(ctx, miner.ActorAddr, head.Key()) + if err != nil { + return fmt.Errorf("failed to get proving deadline: %w", err) + } + + disputeEpoch := di.Close + 5 + fmt.Printf("WindowPoST(%d): Dispute: Waiting %d until epoch %d to submit dispute\n", sectorNumber, disputeEpoch-head.Height(), disputeEpoch) + + client.WaitTillChain(ctx, kit.HeightAtLeast(disputeEpoch)) + + fmt.Printf("WindowPoST(%d): Dispute: Disputing WindowedPoSt to confirm validity...\n", sectorNumber) + + _, err = manualOnboardingSubmitMessage(ctx, client, miner, &miner14.DisputeWindowedPoStParams{ + Deadline: sp.Deadline, + PoStIndex: 0, + }, 0, builtin.MethodsMiner.DisputeWindowedPoSt) + if err == nil { + return fmt.Errorf("expected dispute to fail") + } + if !strings.Contains(err.Error(), "failed to dispute valid post") { + return fmt.Errorf("expected dispute to fail with 'failed to dispute valid post', got: %w", err) + } + if !strings.Contains(err.Error(), "(RetCode=16)") { + return fmt.Errorf("expected dispute to fail with RetCode=16, got: %w", err) + } + return nil +} + +func manualOnboardingSubmitMessage( + ctx context.Context, + client api.FullNode, + from kit.TestUnmanagedMiner, + params cbg.CBORMarshaler, + value uint64, + method abi.MethodNum, +) (*api.MsgLookup, error) { + + enc, aerr := actors.SerializeParams(params) + if aerr != nil { + return nil, fmt.Errorf("failed to serialize params: %w", aerr) + } + + m, err := client.MpoolPushMessage(ctx, &types.Message{ + To: from.ActorAddr, + From: from.OwnerKey.Address, + Value: types.FromFil(value), + Method: method, + Params: enc, + }, nil) + if err != nil { + return nil, fmt.Errorf("failed to push message: %w", err) + } + + return client.StateWaitMsg(ctx, m.Cid(), 2, api.LookbackNoLimit, true) +} + +// manualOnboardingCalculateNextPostEpoch calculates the first epoch of the deadline proving window +// that we want for the given sector for the given miner. +func manualOnboardingCalculateNextPostEpoch( + ctx context.Context, + client api.FullNode, + minerAddr address.Address, + sectorNumber abi.SectorNumber, +) (abi.ChainEpoch, abi.ChainEpoch, error) { + + head, err := client.ChainHead(ctx) + if err != nil { + return 0, 0, fmt.Errorf("failed to get chain head: %w", err) + } + + sp, err := client.StateSectorPartition(ctx, minerAddr, sectorNumber, head.Key()) + if err != nil { + return 0, 0, fmt.Errorf("failed to get sector partition: %w", err) + } + + fmt.Printf("WindowPoST(%d): SectorPartition: %+v\n", sectorNumber, sp) + + di, err := client.StateMinerProvingDeadline(ctx, minerAddr, head.Key()) + if err != nil { + return 0, 0, fmt.Errorf("failed to get proving deadline: %w", err) + } + + fmt.Printf("WindowPoST(%d): ProvingDeadline: %+v\n", sectorNumber, di) + + // periodStart tells us the first epoch of the current proving period (24h) + // although it may be in the future if we don't need to submit post in this period + periodStart := di.PeriodStart + if di.PeriodStart < di.CurrentEpoch && sp.Deadline <= di.Index { + // the deadline we want has past in this current proving period, so wait till the next one + periodStart += di.WPoStProvingPeriod + } + provingEpoch := periodStart + (di.WPoStProvingPeriod/abi.ChainEpoch(di.WPoStPeriodDeadlines))*abi.ChainEpoch(sp.Deadline) + + return di.CurrentEpoch, provingEpoch, nil +} + +func manualOnboardingSubmitWindowPost( + ctx context.Context, + withMockProofs bool, + client kit.TestFullNode, + miner kit.TestUnmanagedMiner, + sectorNumber abi.SectorNumber, + cacheDirPath, sealedSectorPath string, + sealedCid cid.Cid, + proofType abi.RegisteredSealProof, +) error { + fmt.Printf("WindowPoST(%d): Running WindowPoSt ...\n", sectorNumber) + + head, err := client.ChainHead(ctx) + if err != nil { + return fmt.Errorf("failed to get chain head: %w", err) + } + + sp, err := client.StateSectorPartition(ctx, miner.ActorAddr, sectorNumber, head.Key()) + if err != nil { + return fmt.Errorf("failed to get sector partition: %w", err) + } + + // We should be up to the deadline we care about + di, err := client.StateMinerProvingDeadline(ctx, miner.ActorAddr, head.Key()) + if err != nil { + return fmt.Errorf("failed to get proving deadline: %w", err) + } + fmt.Printf("WindowPoST(%d): SectorPartition: %+v, ProvingDeadline: %+v\n", sectorNumber, sp, di) + if di.Index != sp.Deadline { + return fmt.Errorf("sector %d is not in the deadline %d, but %d", sectorNumber, sp.Deadline, di.Index) + } + + var proofBytes []byte + if withMockProofs { + proofBytes = []byte{0xde, 0xad, 0xbe, 0xef} + } else { + proofBytes, err = manualOnboardingGenerateWindowPost(ctx, client, cacheDirPath, sealedSectorPath, miner.ActorAddr, sectorNumber, sealedCid, proofType) + if err != nil { + return fmt.Errorf("failed to generate window post: %w", err) + } + } + + fmt.Printf("WindowedPoSt(%d) Submitting ...\n", sectorNumber) + + chainRandomnessEpoch := di.Challenge + chainRandomness, err := client.StateGetRandomnessFromTickets(ctx, crypto.DomainSeparationTag_PoStChainCommit, chainRandomnessEpoch, nil, head.Key()) + if err != nil { + return fmt.Errorf("failed to get chain randomness: %w", err) + } + + minerInfo, err := client.StateMinerInfo(ctx, miner.ActorAddr, head.Key()) + if err != nil { + return fmt.Errorf("failed to get miner info: %w", err) + } + + r, err := manualOnboardingSubmitMessage(ctx, client, miner, &miner14.SubmitWindowedPoStParams{ + ChainCommitEpoch: chainRandomnessEpoch, + ChainCommitRand: chainRandomness, + Deadline: sp.Deadline, + Partitions: []miner14.PoStPartition{{Index: sp.Partition}}, + Proofs: []proof.PoStProof{{PoStProof: minerInfo.WindowPoStProofType, ProofBytes: proofBytes}}, + }, 0, builtin.MethodsMiner.SubmitWindowedPoSt) + if err != nil { + return fmt.Errorf("failed to submit PoSt: %w", err) + } + if !r.Receipt.ExitCode.IsSuccess() { + return fmt.Errorf("submitting PoSt failed: %s", r.Receipt.ExitCode) + } + + if !withMockProofs { + // Dispute the PoSt to confirm the validity of the PoSt since PoSt acceptance is optimistic + if err := manualOnboardingDisputeWindowPost(ctx, client, miner, sectorNumber); err != nil { + return fmt.Errorf("failed to run PoSt dispute: %w", err) + } + } + return nil +} + +// manualOnboardingRunWindowPost runs a goroutine to continually submit PoSTs for the given sector +// and miner. It will wait until the next proving period for the sector and then submit the PoSt. +// It will continue to do this until the context is cancelled. +// It returns a channel that will be closed when the first PoSt is submitted and a channel that will +// receive any errors that occur. +func manualOnboardingRunWindowPost( + ctx context.Context, + withMockProofs bool, + client kit.TestFullNode, + miner kit.TestUnmanagedMiner, + sectorNumber abi.SectorNumber, + cacheDirPath, + sealedSectorPath string, + sealedCid cid.Cid, + proofType abi.RegisteredSealProof, +) (chan struct{}, chan error) { + + first := make(chan struct{}) + errCh := make(chan error) + + go func() { + for ctx.Err() == nil { + currentEpoch, nextPost, err := manualOnboardingCalculateNextPostEpoch(ctx, client, miner.ActorAddr, sectorNumber) + if err != nil { + errCh <- err + return + } + if ctx.Err() != nil { + return + } + nextPost += 5 // give a little buffer + fmt.Printf("WindowPoST(%d) Waiting %d until epoch %d to submit PoSt\n", sectorNumber, nextPost-currentEpoch, nextPost) + + // Create channel to listen for chain head + heads, err := client.ChainNotify(ctx) + if err != nil { + errCh <- err + return + } + // Wait for nextPost epoch + for chg := range heads { + var ts *types.TipSet + for _, c := range chg { + if c.Type != "apply" { + continue + } + ts = c.Val + if ts.Height() >= nextPost { + break + } + } + if ctx.Err() != nil { + return + } + if ts != nil && ts.Height() >= nextPost { + break + } + } + if ctx.Err() != nil { + return + } + + err = manualOnboardingSubmitWindowPost(ctx, withMockProofs, client, miner, sectorNumber, cacheDirPath, sealedSectorPath, sealedCid, proofType) + if err != nil { + errCh <- err + return + } + + // signal first post is done + select { + case <-first: + default: + close(first) + } + } + }() + + return first, errCh +} diff --git a/itests/migration_test.go b/itests/migration_test.go index e19aaf45f74..c0c61d010d2 100644 --- a/itests/migration_test.go +++ b/itests/migration_test.go @@ -302,7 +302,7 @@ func TestMigrationNV17(t *testing.T) { minerInfo, err := testClient.StateMinerInfo(ctx, testMiner.ActorAddr, types.EmptyTSK) require.NoError(t, err) - spt, err := miner.SealProofTypeFromSectorSize(minerInfo.SectorSize, network.Version17, false) + spt, err := miner.SealProofTypeFromSectorSize(minerInfo.SectorSize, network.Version17, miner.SealProofVariant_Standard) require.NoError(t, err) preCommitParams := miner9.PreCommitSectorParams{ diff --git a/itests/path_type_filters_test.go b/itests/path_type_filters_test.go deleted file mode 100644 index a2e2049323b..00000000000 --- a/itests/path_type_filters_test.go +++ /dev/null @@ -1,200 +0,0 @@ -package itests - -import ( - "context" - "strings" - "testing" - "time" - - logging "github.com/ipfs/go-log/v2" - "github.com/stretchr/testify/require" - - "github.com/filecoin-project/lotus/itests/kit" - "github.com/filecoin-project/lotus/storage/sealer/sealtasks" - "github.com/filecoin-project/lotus/storage/sealer/storiface" -) - -func TestPathTypeFilters(t *testing.T) { - kit.QuietMiningLogs() - - runTest := func(t *testing.T, name string, asserts func(t *testing.T, ctx context.Context, miner *kit.TestMiner, run func())) { - t.Run(name, func(t *testing.T) { - ctx, cancel := context.WithCancel(context.Background()) - defer cancel() - - _ = logging.SetLogLevel("storageminer", "INFO") - - var ( - client kit.TestFullNode - miner kit.TestMiner - wiw, wdw kit.TestWorker - ) - ens := kit.NewEnsemble(t, kit.LatestActorsAt(-1)). - FullNode(&client, kit.ThroughRPC()). - Miner(&miner, &client, kit.WithAllSubsystems(), kit.ThroughRPC(), kit.PresealSectors(2), kit.NoStorage()). - Worker(&miner, &wiw, kit.ThroughRPC(), kit.NoStorage(), kit.WithTaskTypes([]sealtasks.TaskType{sealtasks.TTGenerateWinningPoSt})). - Worker(&miner, &wdw, kit.ThroughRPC(), kit.NoStorage(), kit.WithTaskTypes([]sealtasks.TaskType{sealtasks.TTGenerateWindowPoSt})). - Start() - - ens.InterconnectAll().BeginMiningMustPost(2 * time.Millisecond) - - asserts(t, ctx, &miner, func() { - dh := kit.NewDealHarness(t, &client, &miner, &miner) - dh.RunConcurrentDeals(kit.RunConcurrentDealsOpts{N: 1}) - }) - }) - } - - runTest(t, "invalid-type-alert", func(t *testing.T, ctx context.Context, miner *kit.TestMiner, run func()) { - slU := miner.AddStorage(ctx, t, func(meta *storiface.LocalStorageMeta) { - meta.CanSeal = true - meta.AllowTypes = []string{"unsealed", "seeled"} - }) - - storlist, err := miner.StorageList(ctx) - require.NoError(t, err) - - require.Len(t, storlist, 2) // 1 path we've added + preseal - - si, err := miner.StorageInfo(ctx, slU) - require.NoError(t, err) - - // check that bad entries are filtered - require.Len(t, si.DenyTypes, 0) - require.Len(t, si.AllowTypes, 1) - require.Equal(t, "unsealed", si.AllowTypes[0]) - - as, err := miner.LogAlerts(ctx) - require.NoError(t, err) - - var found bool - for _, a := range as { - if a.Active && a.Type.System == "sector-index" && strings.HasPrefix(a.Type.Subsystem, "pathconf-") { - require.False(t, found) - require.Contains(t, string(a.LastActive.Message), "unknown sector file type 'seeled'") - found = true - } - } - require.True(t, found) - }) - - runTest(t, "seal-to-stor-unseal-allowdeny", func(t *testing.T, ctx context.Context, miner *kit.TestMiner, run func()) { - // allow all types in the sealing path - sealScratch := miner.AddStorage(ctx, t, func(meta *storiface.LocalStorageMeta) { - meta.CanSeal = true - }) - - // unsealed storage - unsStor := miner.AddStorage(ctx, t, func(meta *storiface.LocalStorageMeta) { - meta.CanStore = true - meta.AllowTypes = []string{"unsealed"} - }) - - // other storage - sealStor := miner.AddStorage(ctx, t, func(meta *storiface.LocalStorageMeta) { - meta.CanStore = true - meta.DenyTypes = []string{"unsealed"} - }) - - storlist, err := miner.StorageList(ctx) - require.NoError(t, err) - - require.Len(t, storlist, 4) // 3 paths we've added + preseal - - run() - - storlist, err = miner.StorageList(ctx) - require.NoError(t, err) - - require.Len(t, storlist[sealScratch], 0) - require.Len(t, storlist[unsStor], 1) - require.Len(t, storlist[sealStor], 1) - - require.Equal(t, storiface.FTUnsealed, storlist[unsStor][0].SectorFileType) - require.Equal(t, storiface.FTSealed|storiface.FTCache, storlist[sealStor][0].SectorFileType) - }) - - runTest(t, "sealstor-unseal-allowdeny", func(t *testing.T, ctx context.Context, miner *kit.TestMiner, run func()) { - // unsealed storage - unsStor := miner.AddStorage(ctx, t, func(meta *storiface.LocalStorageMeta) { - meta.CanStore = true - meta.CanSeal = true - meta.AllowTypes = []string{"unsealed"} - }) - - // other storage - sealStor := miner.AddStorage(ctx, t, func(meta *storiface.LocalStorageMeta) { - meta.CanStore = true - meta.CanSeal = true - meta.DenyTypes = []string{"unsealed"} - }) - - storlist, err := miner.StorageList(ctx) - require.NoError(t, err) - - require.Len(t, storlist, 3) // 2 paths we've added + preseal - - run() - - storlist, err = miner.StorageList(ctx) - require.NoError(t, err) - - require.Len(t, storlist[unsStor], 1) - require.Len(t, storlist[sealStor], 1) - - require.Equal(t, storiface.FTUnsealed, storlist[unsStor][0].SectorFileType) - require.Equal(t, storiface.FTSealed|storiface.FTCache, storlist[sealStor][0].SectorFileType) - }) - - runTest(t, "seal-store-allseparate", func(t *testing.T, ctx context.Context, miner *kit.TestMiner, run func()) { - // sealing stores - slU := miner.AddStorage(ctx, t, func(meta *storiface.LocalStorageMeta) { - meta.CanSeal = true - meta.AllowTypes = []string{"unsealed"} - }) - slS := miner.AddStorage(ctx, t, func(meta *storiface.LocalStorageMeta) { - meta.CanSeal = true - meta.AllowTypes = []string{"sealed"} - }) - slC := miner.AddStorage(ctx, t, func(meta *storiface.LocalStorageMeta) { - meta.CanSeal = true - meta.AllowTypes = []string{"cache"} - }) - - // storage stores - stU := miner.AddStorage(ctx, t, func(meta *storiface.LocalStorageMeta) { - meta.CanStore = true - meta.AllowTypes = []string{"unsealed"} - }) - stS := miner.AddStorage(ctx, t, func(meta *storiface.LocalStorageMeta) { - meta.CanStore = true - meta.AllowTypes = []string{"sealed"} - }) - stC := miner.AddStorage(ctx, t, func(meta *storiface.LocalStorageMeta) { - meta.CanStore = true - meta.AllowTypes = []string{"cache"} - }) - - storlist, err := miner.StorageList(ctx) - require.NoError(t, err) - - require.Len(t, storlist, 7) // 6 paths we've added + preseal - - run() - - storlist, err = miner.StorageList(ctx) - require.NoError(t, err) - - require.Len(t, storlist[slU], 0) - require.Len(t, storlist[slS], 0) - require.Len(t, storlist[slC], 0) - - require.Len(t, storlist[stU], 1) - require.Len(t, storlist[stS], 1) - require.Len(t, storlist[stC], 1) - - require.Equal(t, storiface.FTUnsealed, storlist[stU][0].SectorFileType) - require.Equal(t, storiface.FTSealed, storlist[stS][0].SectorFileType) - require.Equal(t, storiface.FTCache, storlist[stC][0].SectorFileType) - }) -} diff --git a/itests/sector_finalize_early_test.go b/itests/sector_finalize_early_test.go deleted file mode 100644 index 1b8fcb346f9..00000000000 --- a/itests/sector_finalize_early_test.go +++ /dev/null @@ -1,72 +0,0 @@ -// stm: #integration -package itests - -import ( - "context" - "fmt" - "testing" - "time" - - "github.com/stretchr/testify/require" - - "github.com/filecoin-project/lotus/itests/kit" - "github.com/filecoin-project/lotus/node/config" - "github.com/filecoin-project/lotus/storage/sealer/storiface" -) - -func TestDealsWithFinalizeEarly(t *testing.T) { - //stm: @CHAIN_SYNCER_LOAD_GENESIS_001, @CHAIN_SYNCER_FETCH_TIPSET_001, - //stm: @CHAIN_SYNCER_START_001, @CHAIN_SYNCER_SYNC_001, @BLOCKCHAIN_BEACON_VALIDATE_BLOCK_VALUES_01 - //stm: @CHAIN_SYNCER_COLLECT_CHAIN_001, @CHAIN_SYNCER_COLLECT_HEADERS_001, @CHAIN_SYNCER_VALIDATE_TIPSET_001 - //stm: @CHAIN_SYNCER_NEW_PEER_HEAD_001, @CHAIN_SYNCER_VALIDATE_MESSAGE_META_001, @CHAIN_SYNCER_STOP_001 - - //stm: @CHAIN_INCOMING_HANDLE_INCOMING_BLOCKS_001, @CHAIN_INCOMING_VALIDATE_BLOCK_PUBSUB_001, @CHAIN_INCOMING_VALIDATE_MESSAGE_PUBSUB_001 - //stm: @STORAGE_INFO_001 - if testing.Short() { - t.Skip("skipping test in short mode") - } - - kit.QuietMiningLogs() - - var blockTime = 50 * time.Millisecond - - // We use two miners so that in case the actively tested miner misses PoSt, we still have a blockchain - client, miner, poster, ens := kit.EnsembleOneTwo(t, kit.ThroughRPC(), kit.MutateSealingConfig(func(sc *config.SealingConfig) { sc.FinalizeEarly = true })) // no mock proofs. - ens.InterconnectAll().BeginMiningMustPost(blockTime, poster) - dh := kit.NewDealHarness(t, client, miner, miner) - - ctx := context.Background() - - miner.AddStorage(ctx, t, func(meta *storiface.LocalStorageMeta) { - meta.Weight = 1000000000 - meta.CanSeal = true - }) - miner.AddStorage(ctx, t, func(meta *storiface.LocalStorageMeta) { - meta.Weight = 1000000000 - meta.CanStore = true - }) - - //stm: @STORAGE_LIST_001 - sl, err := miner.StorageList(ctx) - require.NoError(t, err) - for si, d := range sl { - i, err := miner.StorageInfo(ctx, si) - require.NoError(t, err) - - fmt.Printf("stor d:%d %+v\n", len(d), i) - } - - t.Run("single", func(t *testing.T) { - dh.RunConcurrentDeals(kit.RunConcurrentDealsOpts{N: 1}) - }) - - //stm: @STORAGE_LIST_001 - sl, err = miner.StorageList(ctx) - require.NoError(t, err) - for si, d := range sl { - i, err := miner.StorageInfo(ctx, si) - require.NoError(t, err) - - fmt.Printf("stor d:%d %+v\n", len(d), i) - } -} diff --git a/itests/worker_test.go b/itests/worker_test.go index 31ec40b5937..b3b8edd7632 100644 --- a/itests/worker_test.go +++ b/itests/worker_test.go @@ -585,82 +585,3 @@ waitForProof: require.NoError(t, params.UnmarshalCBOR(bytes.NewBuffer(slmsg.Params))) require.Equal(t, abi.RegisteredPoStProof_StackedDrgWindow2KiBV1_1, params.Proofs[0].PoStProof) } - -func TestWorkerPledgeExpireCommit(t *testing.T) { - kit.QuietMiningLogs() - _ = logging.SetLogLevel("sectors", "debug") - - var tasksNoC2 = kit.WithTaskTypes([]sealtasks.TaskType{sealtasks.TTAddPiece, sealtasks.TTDataCid, sealtasks.TTPreCommit1, sealtasks.TTPreCommit2, sealtasks.TTCommit2, - sealtasks.TTUnseal, sealtasks.TTFetch, sealtasks.TTCommit1, sealtasks.TTFinalize, sealtasks.TTFinalizeUnsealed}) - - fc := config.DefaultStorageMiner().Fees - fc.MaxCommitGasFee = types.FIL(abi.NewTokenAmount(10000)) // 10000 attofil, way too low for anything to land - - ctx := context.Background() - client, miner, worker, ens := kit.EnsembleWorker(t, kit.WithAllSubsystems(), kit.ThroughRPC(), kit.WithNoLocalSealing(true), - kit.MutateSealingConfig(func(sc *config.SealingConfig) { - sc.AggregateCommits = true - }), - kit.ConstructorOpts( - node.Override(new(*sealing.Sealing), modules.SealingPipeline(fc)), - ), - kit.SplitstoreDisable(), // disable splitstore because messages which take a long time may get dropped - tasksNoC2) // no mock proofs - - ens.InterconnectAll().BeginMiningMustPost(2 * time.Millisecond) - - e, err := worker.Enabled(ctx) - require.NoError(t, err) - require.True(t, e) - - dh := kit.NewDealHarness(t, client, miner, miner) - - startEpoch := abi.ChainEpoch(4 << 10) - - dh.StartRandomDeal(ctx, kit.MakeFullDealParams{ - Rseed: 7, - StartEpoch: startEpoch, - }) - - var sn abi.SectorNumber - - require.Eventually(t, func() bool { - s, err := miner.SectorsListNonGenesis(ctx) - require.NoError(t, err) - if len(s) == 0 { - return false - } - if len(s) > 1 { - t.Fatalf("expected 1 sector, got %d", len(s)) - } - sn = s[0] - return true - }, 30*time.Second, 1*time.Second) - - t.Log("sector", sn) - - t.Log("sector committing") - - // wait until after startEpoch - client.WaitTillChain(ctx, kit.HeightAtLeast(startEpoch+20)) - - t.Log("after start") - - sstate, err := miner.SectorsStatus(ctx, sn, false) - require.NoError(t, err) - require.Equal(t, api.SectorState(sealing.SubmitCommitAggregate), sstate.State) - - _, err = miner.SectorCommitFlush(ctx) - require.NoError(t, err) - - require.Eventually(t, func() bool { - sstate, err := miner.SectorsStatus(ctx, sn, false) - require.NoError(t, err) - - t.Logf("sector state: %s", sstate.State) - - return sstate.State == api.SectorState(sealing.Removed) - }, 30*time.Second, 1*time.Second) - - t.Log("sector removed") -} diff --git a/itests/worker_upgrade_test.go b/itests/worker_upgrade_test.go deleted file mode 100644 index b253a26a577..00000000000 --- a/itests/worker_upgrade_test.go +++ /dev/null @@ -1,170 +0,0 @@ -package itests - -import ( - "context" - "fmt" - "testing" - "time" - - "github.com/stretchr/testify/require" - - "github.com/filecoin-project/lotus/api" - "github.com/filecoin-project/lotus/itests/kit" - "github.com/filecoin-project/lotus/node/config" - sealing "github.com/filecoin-project/lotus/storage/pipeline" - "github.com/filecoin-project/lotus/storage/sealer/sealtasks" - "github.com/filecoin-project/lotus/storage/sealer/storiface" -) - -func TestWorkerUpgradeAbortCleanup(t *testing.T) { - ctx := context.Background() - blockTime := 1 * time.Millisecond - kit.QuietMiningLogs() - - client, miner, ens := kit.EnsembleMinimal(t, kit.WithAllSubsystems(), kit.ThroughRPC(), kit.WithNoLocalSealing(true), - kit.NoStorage(), // no storage to have better control over path settings - kit.MutateSealingConfig(func(sc *config.SealingConfig) { sc.FinalizeEarly = true })) // no mock proofs - - var worker kit.TestWorker - ens.Worker(miner, &worker, kit.ThroughRPC(), kit.NoStorage(), // no storage to have better control over path settings - kit.WithTaskTypes([]sealtasks.TaskType{ - sealtasks.TTFetch, sealtasks.TTAddPiece, - sealtasks.TTCommit1, sealtasks.TTFinalize, sealtasks.TTFinalizeUnsealed, sealtasks.TTPreCommit1, sealtasks.TTPreCommit2, sealtasks.TTCommit2, - sealtasks.TTReplicaUpdate, // only first update step, later steps will not run and we'll abort - }), - ) - - ens.Start().InterconnectAll().BeginMiningMustPost(blockTime) - - maddr, err := miner.ActorAddress(ctx) - if err != nil { - t.Fatal(err) - } - - // get storage paths - - // store-only path on the miner - miner.AddStorage(ctx, t, func(cfg *storiface.LocalStorageMeta) { - cfg.CanSeal = false - cfg.CanStore = true - }) - - mlocal, err := miner.StorageLocal(ctx) - require.NoError(t, err) - require.Len(t, mlocal, 2) // genesis and one local - - // we want a seal-only path on the worker disconnected from miner path - worker.AddStorage(ctx, t, func(cfg *storiface.LocalStorageMeta) { - cfg.CanSeal = true - cfg.CanStore = false - }) - - wpaths, err := worker.Paths(ctx) - require.NoError(t, err) - require.Len(t, wpaths, 1) - - // check sectors in paths - checkSectors := func(miners, workers storiface.SectorFileType) { - paths, err := miner.StorageList(ctx) - require.NoError(t, err) - require.Len(t, paths, 3) // genesis, miner, worker - - // first loop for debugging - for id, decls := range paths { - pinfo, err := miner.StorageInfo(ctx, id) - require.NoError(t, err) - - switch { - case id == wpaths[0].ID: // worker path - fmt.Println("Worker Decls ", len(decls), decls) - case !pinfo.CanStore && !pinfo.CanSeal: // genesis path - fmt.Println("Genesis Decls ", len(decls), decls) - default: // miner path - fmt.Println("Miner Decls ", len(decls), decls) - } - } - - for id, decls := range paths { - pinfo, err := miner.StorageInfo(ctx, id) - require.NoError(t, err) - - switch { - case id == wpaths[0].ID: // worker path - if workers != storiface.FTNone { - require.Len(t, decls, 1) - require.EqualValues(t, workers.Strings(), decls[0].SectorFileType.Strings()) - } else { - require.Len(t, decls, 0) - } - case !pinfo.CanStore && !pinfo.CanSeal: // genesis path - require.Len(t, decls, kit.DefaultPresealsPerBootstrapMiner) - default: // miner path - if miners != storiface.FTNone { - require.Len(t, decls, 1) - require.EqualValues(t, miners.Strings(), decls[0].SectorFileType.Strings()) - } else { - require.Len(t, decls, 0) - } - } - } - } - checkSectors(storiface.FTNone, storiface.FTNone) - - // get a sector for upgrading - miner.PledgeSectors(ctx, 1, 0, nil) - sl, err := miner.SectorsListNonGenesis(ctx) - require.NoError(t, err) - require.Len(t, sl, 1, "expected 1 sector") - - snum := sl[0] - - checkSectors(storiface.FTCache|storiface.FTSealed, storiface.FTNone) - - client.WaitForSectorActive(ctx, t, snum, maddr) - - // make available - err = miner.SectorMarkForUpgrade(ctx, snum, true) - require.NoError(t, err) - - // Start a deal - - dh := kit.NewDealHarness(t, client, miner, miner) - res, _ := client.CreateImportFile(ctx, 123, 0) - dp := dh.DefaultStartDealParams() - dp.Data.Root = res.Root - deal := dh.StartDeal(ctx, dp) - - // wait for the deal to be in a sector - dh.WaitDealSealed(ctx, deal, true, false, nil) - - // wait for replica update to happen - require.Eventually(t, func() bool { - sstate, err := miner.SectorsStatus(ctx, snum, false) - require.NoError(t, err) - return sstate.State == api.SectorState(sealing.ProveReplicaUpdate) - }, 10*time.Second, 50*time.Millisecond) - - // check that the sector was copied to the worker - checkSectors(storiface.FTCache|storiface.FTSealed, storiface.FTCache|storiface.FTSealed|storiface.FTUnsealed|storiface.FTUpdate|storiface.FTUpdateCache) - - // abort upgrade - err = miner.SectorAbortUpgrade(ctx, snum) - require.NoError(t, err) - - // the task is stuck in scheduler, so manually abort the task to get the sector fsm moving - si := miner.SchedInfo(ctx) - err = miner.SealingRemoveRequest(ctx, si.SchedInfo.Requests[0].SchedId) - require.NoError(t, err) - - var lastState api.SectorState - require.Eventually(t, func() bool { - sstate, err := miner.SectorsStatus(ctx, snum, false) - require.NoError(t, err) - lastState = sstate.State - - return sstate.State == api.SectorState(sealing.Proving) - }, 10*time.Second, 50*time.Millisecond, "last state was %s", &lastState) - - // check that nothing was left on the worker - checkSectors(storiface.FTCache|storiface.FTSealed, storiface.FTNone) -} diff --git a/lib/unixfs/filestore.go b/lib/unixfs/filestore.go deleted file mode 100644 index f50e933b68f..00000000000 --- a/lib/unixfs/filestore.go +++ /dev/null @@ -1,159 +0,0 @@ -package unixfs - -import ( - "context" - "fmt" - "io" - "os" - - "github.com/ipfs/boxo/blockservice" - bstore "github.com/ipfs/boxo/blockstore" - chunker "github.com/ipfs/boxo/chunker" - offline "github.com/ipfs/boxo/exchange/offline" - "github.com/ipfs/boxo/files" - "github.com/ipfs/boxo/ipld/merkledag" - "github.com/ipfs/boxo/ipld/unixfs/importer/balanced" - ihelper "github.com/ipfs/boxo/ipld/unixfs/importer/helpers" - "github.com/ipfs/go-cid" - "github.com/ipfs/go-cidutil" - ipld "github.com/ipfs/go-ipld-format" - mh "github.com/multiformats/go-multihash" - "golang.org/x/xerrors" - - "github.com/filecoin-project/go-fil-markets/stores" - - "github.com/filecoin-project/lotus/build" -) - -var DefaultHashFunction = uint64(mh.BLAKE2B_MIN + 31) - -func CidBuilder() (cid.Builder, error) { - prefix, err := merkledag.PrefixForCidVersion(1) - if err != nil { - return nil, fmt.Errorf("failed to initialize UnixFS CID Builder: %w", err) - } - prefix.MhType = DefaultHashFunction - b := cidutil.InlineBuilder{ - Builder: prefix, - Limit: 126, - } - return b, nil -} - -// CreateFilestore takes a standard file whose path is src, forms a UnixFS DAG, and -// writes a CARv2 file with positional mapping (backed by the go-filestore library). -func CreateFilestore(ctx context.Context, srcPath string, dstPath string) (cid.Cid, error) { - // This method uses a two-phase approach with a staging CAR blockstore and - // a final CAR blockstore. - // - // This is necessary because of https://github.com/ipld/go-car/issues/196 - // - // TODO: do we need to chunk twice? Isn't the first output already in the - // right order? Can't we just copy the CAR file and replace the header? - - src, err := os.Open(srcPath) - if err != nil { - return cid.Undef, xerrors.Errorf("failed to open input file: %w", err) - } - defer src.Close() //nolint:errcheck - - stat, err := src.Stat() - if err != nil { - return cid.Undef, xerrors.Errorf("failed to stat file :%w", err) - } - - file, err := files.NewReaderPathFile(srcPath, src, stat) - if err != nil { - return cid.Undef, xerrors.Errorf("failed to create reader path file: %w", err) - } - - f, err := os.CreateTemp("", "") - if err != nil { - return cid.Undef, xerrors.Errorf("failed to create temp file: %w", err) - } - _ = f.Close() // close; we only want the path. - - tmp := f.Name() - defer os.Remove(tmp) //nolint:errcheck - - // Step 1. Compute the UnixFS DAG and write it to a CARv2 file to get - // the root CID of the DAG. - fstore, err := stores.ReadWriteFilestore(tmp) - if err != nil { - return cid.Undef, xerrors.Errorf("failed to create temporary filestore: %w", err) - } - - finalRoot1, err := Build(ctx, file, fstore, true) - if err != nil { - _ = fstore.Close() - return cid.Undef, xerrors.Errorf("failed to import file to store to compute root: %w", err) - } - - if err := fstore.Close(); err != nil { - return cid.Undef, xerrors.Errorf("failed to finalize car filestore: %w", err) - } - - // Step 2. We now have the root of the UnixFS DAG, and we can write the - // final CAR for real under `dst`. - bs, err := stores.ReadWriteFilestore(dstPath, finalRoot1) - if err != nil { - return cid.Undef, xerrors.Errorf("failed to create a carv2 read/write filestore: %w", err) - } - - // rewind file to the beginning. - if _, err := src.Seek(0, 0); err != nil { - return cid.Undef, xerrors.Errorf("failed to rewind file: %w", err) - } - - finalRoot2, err := Build(ctx, file, bs, true) - if err != nil { - _ = bs.Close() - return cid.Undef, xerrors.Errorf("failed to create UnixFS DAG with carv2 blockstore: %w", err) - } - - if err := bs.Close(); err != nil { - return cid.Undef, xerrors.Errorf("failed to finalize car blockstore: %w", err) - } - - if finalRoot1 != finalRoot2 { - return cid.Undef, xerrors.New("roots do not match") - } - - return finalRoot1, nil -} - -// Build builds a UnixFS DAG out of the supplied reader, -// and imports the DAG into the supplied service. -func Build(ctx context.Context, reader io.Reader, into bstore.Blockstore, filestore bool) (cid.Cid, error) { - b, err := CidBuilder() - if err != nil { - return cid.Undef, err - } - - bsvc := blockservice.New(into, offline.Exchange(into)) - dags := merkledag.NewDAGService(bsvc) - bufdag := ipld.NewBufferedDAG(ctx, dags) - - params := ihelper.DagBuilderParams{ - Maxlinks: build.UnixfsLinksPerLevel, - RawLeaves: true, - CidBuilder: b, - Dagserv: bufdag, - NoCopy: filestore, - } - - db, err := params.New(chunker.NewSizeSplitter(reader, int64(build.UnixfsChunkSize))) - if err != nil { - return cid.Undef, err - } - nd, err := balanced.Layout(db) - if err != nil { - return cid.Undef, err - } - - if err := bufdag.Commit(); err != nil { - return cid.Undef, err - } - - return nd.Cid(), nil -} diff --git a/lib/unixfs/filestore_test.go b/lib/unixfs/filestore_test.go deleted file mode 100644 index 868698bced3..00000000000 --- a/lib/unixfs/filestore_test.go +++ /dev/null @@ -1,128 +0,0 @@ -// stm: #unit -package unixfs - -import ( - "bytes" - "context" - "io" - "os" - "strings" - "testing" - - "github.com/ipfs/boxo/blockservice" - offline "github.com/ipfs/boxo/exchange/offline" - "github.com/ipfs/boxo/files" - "github.com/ipfs/boxo/ipld/merkledag" - unixfile "github.com/ipfs/boxo/ipld/unixfs/file" - "github.com/ipfs/go-cid" - carv2 "github.com/ipld/go-car/v2" - "github.com/ipld/go-car/v2/blockstore" - "github.com/stretchr/testify/require" - - "github.com/filecoin-project/go-fil-markets/stores" -) - -// This test uses a full "dense" CARv2, and not a filestore (positional mapping). -func TestRoundtripUnixFS_Dense(t *testing.T) { - // stm: @CLIENT_DATA_IMPORT_002 - ctx := context.Background() - - inputPath, inputContents := genInputFile(t) - defer os.Remove(inputPath) //nolint:errcheck - - carv2File := newTmpFile(t) - defer os.Remove(carv2File) //nolint:errcheck - - // import a file to a Unixfs DAG using a CARv2 read/write blockstore. - bs, err := blockstore.OpenReadWrite(carv2File, nil, - carv2.ZeroLengthSectionAsEOF(true), - blockstore.UseWholeCIDs(true)) - require.NoError(t, err) - - root, err := Build(ctx, bytes.NewBuffer(inputContents), bs, false) - require.NoError(t, err) - require.NotEqual(t, cid.Undef, root) - require.NoError(t, bs.Finalize()) - - // reconstruct the file. - readOnly, err := blockstore.OpenReadOnly(carv2File, - carv2.ZeroLengthSectionAsEOF(true), - blockstore.UseWholeCIDs(true)) - require.NoError(t, err) - defer readOnly.Close() //nolint:errcheck - - dags := merkledag.NewDAGService(blockservice.New(readOnly, offline.Exchange(readOnly))) - - nd, err := dags.Get(ctx, root) - require.NoError(t, err) - - file, err := unixfile.NewUnixfsFile(ctx, dags, nd) - require.NoError(t, err) - - tmpOutput := newTmpFile(t) - defer os.Remove(tmpOutput) //nolint:errcheck - require.NoError(t, files.WriteTo(file, tmpOutput)) - - // ensure contents of the initial input file and the output file are identical. - fo, err := os.Open(tmpOutput) - require.NoError(t, err) - bz2, err := io.ReadAll(fo) - require.NoError(t, err) - require.NoError(t, fo.Close()) - require.Equal(t, inputContents, bz2) -} - -func TestRoundtripUnixFS_Filestore(t *testing.T) { - // stm: @CLIENT_DATA_IMPORT_001 - ctx := context.Background() - - inputPath, inputContents := genInputFile(t) - defer os.Remove(inputPath) //nolint:errcheck - - dst := newTmpFile(t) - defer os.Remove(dst) //nolint:errcheck - - root, err := CreateFilestore(ctx, inputPath, dst) - require.NoError(t, err) - require.NotEqual(t, cid.Undef, root) - - // convert the CARv2 to a normal file again and ensure the contents match - fs, err := stores.ReadOnlyFilestore(dst) - require.NoError(t, err) - defer fs.Close() //nolint:errcheck - - dags := merkledag.NewDAGService(blockservice.New(fs, offline.Exchange(fs))) - - nd, err := dags.Get(ctx, root) - require.NoError(t, err) - - file, err := unixfile.NewUnixfsFile(ctx, dags, nd) - require.NoError(t, err) - - tmpOutput := newTmpFile(t) - defer os.Remove(tmpOutput) //nolint:errcheck - require.NoError(t, files.WriteTo(file, tmpOutput)) - - // ensure contents of the initial input file and the output file are identical. - fo, err := os.Open(tmpOutput) - require.NoError(t, err) - bz2, err := io.ReadAll(fo) - require.NoError(t, err) - require.NoError(t, fo.Close()) - require.Equal(t, inputContents, bz2) -} - -// creates a new tempdir each time, guaranteeing uniqueness -func newTmpFile(t *testing.T) string { - return t.TempDir() + string(os.PathSeparator) + "tmp" -} - -func genInputFile(t *testing.T) (filepath string, contents []byte) { - s := strings.Repeat("abcde", 100) - tmp, err := os.CreateTemp("", "") - require.NoError(t, err) - _, err = io.Copy(tmp, strings.NewReader(s)) - require.NoError(t, err) - require.NoError(t, tmp.Close()) - return tmp.Name(), []byte(s) -} diff --git a/markets/dagstore/blockstore.go b/markets/dagstore/blockstore.go deleted file mode 100644 index 0ba68f549f9..00000000000 --- a/markets/dagstore/blockstore.go +++ /dev/null @@ -1,34 +0,0 @@ -package dagstore - -import ( - "context" - "io" - - bstore "github.com/ipfs/boxo/blockstore" - blocks "github.com/ipfs/go-block-format" - "github.com/ipfs/go-cid" - "golang.org/x/xerrors" - - "github.com/filecoin-project/dagstore" -) - -// Blockstore promotes a dagstore.ReadBlockstore to a full closeable Blockstore, -// stubbing out the write methods with erroring implementations. -type Blockstore struct { - dagstore.ReadBlockstore - io.Closer -} - -var _ bstore.Blockstore = (*Blockstore)(nil) - -func (b *Blockstore) DeleteBlock(context.Context, cid.Cid) error { - return xerrors.Errorf("DeleteBlock called but not implemented") -} - -func (b *Blockstore) Put(context.Context, blocks.Block) error { - return xerrors.Errorf("Put called but not implemented") -} - -func (b *Blockstore) PutMany(context.Context, []blocks.Block) error { - return xerrors.Errorf("PutMany called but not implemented") -} diff --git a/markets/dagstore/fixtures/sample-rw-bs-v2.car b/markets/dagstore/fixtures/sample-rw-bs-v2.car deleted file mode 100644 index 9f7b56df358..00000000000 Binary files a/markets/dagstore/fixtures/sample-rw-bs-v2.car and /dev/null differ diff --git a/markets/dagstore/miner_api.go b/markets/dagstore/miner_api.go deleted file mode 100644 index 773654af8ed..00000000000 --- a/markets/dagstore/miner_api.go +++ /dev/null @@ -1,205 +0,0 @@ -package dagstore - -import ( - "context" - "fmt" - - "github.com/ipfs/go-cid" - "golang.org/x/xerrors" - - "github.com/filecoin-project/dagstore/mount" - "github.com/filecoin-project/dagstore/throttle" - "github.com/filecoin-project/go-fil-markets/piecestore" - "github.com/filecoin-project/go-fil-markets/retrievalmarket" - "github.com/filecoin-project/go-fil-markets/shared" - "github.com/filecoin-project/go-state-types/abi" -) - -//go:generate go run github.com/golang/mock/mockgen -destination=mocks/mock_lotus_accessor.go -package=mock_dagstore . MinerAPI - -type MinerAPI interface { - FetchUnsealedPiece(ctx context.Context, pieceCid cid.Cid) (mount.Reader, error) - GetUnpaddedCARSize(ctx context.Context, pieceCid cid.Cid) (uint64, error) - IsUnsealed(ctx context.Context, pieceCid cid.Cid) (bool, error) - Start(ctx context.Context) error -} - -type SectorAccessor interface { - retrievalmarket.SectorAccessor - - UnsealSectorAt(ctx context.Context, sectorID abi.SectorNumber, pieceOffset abi.UnpaddedPieceSize, length abi.UnpaddedPieceSize) (mount.Reader, error) -} - -type minerAPI struct { - pieceStore piecestore.PieceStore - sa SectorAccessor - throttle throttle.Throttler - unsealThrottle throttle.Throttler - readyMgr *shared.ReadyManager -} - -var _ MinerAPI = (*minerAPI)(nil) - -func NewMinerAPI(store piecestore.PieceStore, sa SectorAccessor, concurrency int, unsealConcurrency int) MinerAPI { - var unsealThrottle throttle.Throttler - if unsealConcurrency == 0 { - unsealThrottle = throttle.Noop() - } else { - unsealThrottle = throttle.Fixed(unsealConcurrency) - } - return &minerAPI{ - pieceStore: store, - sa: sa, - throttle: throttle.Fixed(concurrency), - unsealThrottle: unsealThrottle, - readyMgr: shared.NewReadyManager(), - } -} - -func (m *minerAPI) Start(_ context.Context) error { - return m.readyMgr.FireReady(nil) -} - -func (m *minerAPI) IsUnsealed(ctx context.Context, pieceCid cid.Cid) (bool, error) { - err := m.readyMgr.AwaitReady() - if err != nil { - return false, xerrors.Errorf("failed while waiting for accessor to start: %w", err) - } - - var pieceInfo piecestore.PieceInfo - err = m.throttle.Do(ctx, func(ctx context.Context) (err error) { - pieceInfo, err = m.pieceStore.GetPieceInfo(pieceCid) - return err - }) - - if err != nil { - return false, xerrors.Errorf("failed to fetch pieceInfo for piece %s: %w", pieceCid, err) - } - - if len(pieceInfo.Deals) == 0 { - return false, xerrors.Errorf("no storage deals found for piece %s", pieceCid) - } - - // check if we have an unsealed deal for the given piece in any of the unsealed sectors. - for _, deal := range pieceInfo.Deals { - deal := deal - - var isUnsealed bool - // Throttle this path to avoid flooding the storage subsystem. - err := m.throttle.Do(ctx, func(ctx context.Context) (err error) { - isUnsealed, err = m.sa.IsUnsealed(ctx, deal.SectorID, deal.Offset.Unpadded(), deal.Length.Unpadded()) - if err != nil { - return fmt.Errorf("failed to check if sector %d for deal %d was unsealed: %w", deal.SectorID, deal.DealID, err) - } - return nil - }) - - if err != nil { - log.Warnf("failed to check/retrieve unsealed sector: %s", err) - continue // move on to the next match. - } - - if isUnsealed { - return true, nil - } - } - - // we don't have an unsealed sector containing the piece - return false, nil -} - -func (m *minerAPI) FetchUnsealedPiece(ctx context.Context, pieceCid cid.Cid) (mount.Reader, error) { - err := m.readyMgr.AwaitReady() - if err != nil { - return nil, err - } - - // Throttle this path to avoid flooding the storage subsystem. - var pieceInfo piecestore.PieceInfo - err = m.throttle.Do(ctx, func(ctx context.Context) (err error) { - pieceInfo, err = m.pieceStore.GetPieceInfo(pieceCid) - return err - }) - - if err != nil { - return nil, xerrors.Errorf("failed to fetch pieceInfo for piece %s: %w", pieceCid, err) - } - - if len(pieceInfo.Deals) == 0 { - return nil, xerrors.Errorf("no storage deals found for piece %s", pieceCid) - } - - // prefer an unsealed sector containing the piece if one exists - for _, deal := range pieceInfo.Deals { - deal := deal - - // Throttle this path to avoid flooding the storage subsystem. - var reader mount.Reader - err := m.throttle.Do(ctx, func(ctx context.Context) (err error) { - isUnsealed, err := m.sa.IsUnsealed(ctx, deal.SectorID, deal.Offset.Unpadded(), deal.Length.Unpadded()) - if err != nil { - return fmt.Errorf("failed to check if sector %d for deal %d was unsealed: %w", deal.SectorID, deal.DealID, err) - } - if !isUnsealed { - return nil - } - // Because we know we have an unsealed copy, this UnsealSector call will actually not perform any unsealing. - reader, err = m.sa.UnsealSectorAt(ctx, deal.SectorID, deal.Offset.Unpadded(), deal.Length.Unpadded()) - return err - }) - - if err != nil { - log.Warnf("failed to check/retrieve unsealed sector: %s", err) - continue // move on to the next match. - } - - if reader != nil { - // we were able to obtain a reader for an already unsealed piece - return reader, nil - } - } - - lastErr := xerrors.New("no sectors found to unseal from") - - // if there is no unsealed sector containing the piece, just read the piece from the first sector we are able to unseal. - for _, deal := range pieceInfo.Deals { - // Note that if the deal data is not already unsealed, unsealing may - // block for a long time with the current PoRep - var reader mount.Reader - deal := deal - err := m.throttle.Do(ctx, func(ctx context.Context) (err error) { - // Because we know we have an unsealed copy, this UnsealSector call will actually not perform any unsealing. - reader, err = m.sa.UnsealSectorAt(ctx, deal.SectorID, deal.Offset.Unpadded(), deal.Length.Unpadded()) - return err - }) - - if err != nil { - lastErr = xerrors.Errorf("failed to unseal deal %d: %w", deal.DealID, err) - log.Warn(lastErr.Error()) - continue - } - - // Successfully fetched the deal data so return a reader over the data - return reader, nil - } - - return nil, lastErr -} - -func (m *minerAPI) GetUnpaddedCARSize(ctx context.Context, pieceCid cid.Cid) (uint64, error) { - err := m.readyMgr.AwaitReady() - if err != nil { - return 0, err - } - - pieceInfo, err := m.pieceStore.GetPieceInfo(pieceCid) - if err != nil { - return 0, xerrors.Errorf("failed to fetch pieceInfo for piece %s: %w", pieceCid, err) - } - - if len(pieceInfo.Deals) == 0 { - return 0, xerrors.Errorf("no storage deals found for piece %s", pieceCid) - } - - return uint64(pieceInfo.Deals[0].Length), nil -} diff --git a/markets/dagstore/miner_api_test.go b/markets/dagstore/miner_api_test.go deleted file mode 100644 index d13b098fc7f..00000000000 --- a/markets/dagstore/miner_api_test.go +++ /dev/null @@ -1,252 +0,0 @@ -// stm: #unit -package dagstore - -import ( - "bytes" - "context" - "io" - "sync" - "sync/atomic" - "testing" - "time" - - "github.com/ipfs/go-cid" - ds "github.com/ipfs/go-datastore" - ds_sync "github.com/ipfs/go-datastore/sync" - "github.com/stretchr/testify/require" - "golang.org/x/sync/errgroup" - - "github.com/filecoin-project/dagstore/mount" - "github.com/filecoin-project/go-address" - "github.com/filecoin-project/go-fil-markets/piecestore" - piecestoreimpl "github.com/filecoin-project/go-fil-markets/piecestore/impl" - "github.com/filecoin-project/go-fil-markets/retrievalmarket" - "github.com/filecoin-project/go-fil-markets/shared" - "github.com/filecoin-project/go-state-types/abi" - paychtypes "github.com/filecoin-project/go-state-types/builtin/v8/paych" -) - -const unsealedSectorID = abi.SectorNumber(1) -const sealedSectorID = abi.SectorNumber(2) - -func TestLotusAccessorFetchUnsealedPiece(t *testing.T) { - ctx := context.Background() - - cid1, err := cid.Parse("bafkqaaa") - require.NoError(t, err) - - unsealedSectorData := "unsealed" - sealedSectorData := "sealed" - mockData := map[abi.SectorNumber]string{ - unsealedSectorID: unsealedSectorData, - sealedSectorID: sealedSectorData, - } - - testCases := []struct { - name string - deals []abi.SectorNumber - fetchedData string - isUnsealed bool - - expectErr bool - }{{ - // Expect error if there is no deal info for piece CID - name: "no deals", - expectErr: true, - }, { - // Expect the API to always fetch the unsealed deal (because it's - // cheaper than fetching the sealed deal) - name: "prefer unsealed deal", - deals: []abi.SectorNumber{unsealedSectorID, sealedSectorID}, - fetchedData: unsealedSectorData, - isUnsealed: true, - }, { - // Expect the API to unseal the data if there are no unsealed deals - name: "unseal if necessary", - deals: []abi.SectorNumber{sealedSectorID}, - fetchedData: sealedSectorData, - isUnsealed: false, - }} - - for _, tc := range testCases { - tc := tc - t.Run(tc.name, func(t *testing.T) { - ps := getPieceStore(t) - rpn := &mockRPN{ - sectors: mockData, - } - api := NewMinerAPI(ps, rpn, 100, 5) - require.NoError(t, api.Start(ctx)) - - // Add deals to piece store - for _, sectorID := range tc.deals { - dealInfo := piecestore.DealInfo{ - SectorID: sectorID, - } - err = ps.AddDealForPiece(cid1, cid.Undef, dealInfo) - require.NoError(t, err) - } - - // Fetch the piece - //stm: @MARKET_DAGSTORE_FETCH_UNSEALED_PIECE_001 - r, err := api.FetchUnsealedPiece(ctx, cid1) - if tc.expectErr { - require.Error(t, err) - return - } - - // Check that the returned reader is for the correct piece - require.NoError(t, err) - bz, err := io.ReadAll(r) - require.NoError(t, err) - - require.Equal(t, tc.fetchedData, string(bz)) - - //stm: @MARKET_DAGSTORE_IS_PIECE_UNSEALED_001 - uns, err := api.IsUnsealed(ctx, cid1) - require.NoError(t, err) - require.Equal(t, tc.isUnsealed, uns) - }) - } -} - -func TestLotusAccessorGetUnpaddedCARSize(t *testing.T) { - ctx := context.Background() - cid1, err := cid.Parse("bafkqaaa") - require.NoError(t, err) - - ps := getPieceStore(t) - rpn := &mockRPN{} - api := NewMinerAPI(ps, rpn, 100, 5) - require.NoError(t, api.Start(ctx)) - - // Add a deal with data Length 10 - dealInfo := piecestore.DealInfo{ - Length: 10, - } - err = ps.AddDealForPiece(cid1, cid.Undef, dealInfo) - require.NoError(t, err) - - // Check that the data length is correct - //stm: @MARKET_DAGSTORE_GET_UNPADDED_CAR_SIZE_001 - l, err := api.GetUnpaddedCARSize(ctx, cid1) - require.NoError(t, err) - require.EqualValues(t, 10, l) -} - -func TestThrottle(t *testing.T) { - ctx := context.Background() - cid1, err := cid.Parse("bafkqaaa") - require.NoError(t, err) - - ps := getPieceStore(t) - rpn := &mockRPN{ - sectors: map[abi.SectorNumber]string{ - unsealedSectorID: "foo", - }, - } - api := NewMinerAPI(ps, rpn, 3, 5) - require.NoError(t, api.Start(ctx)) - - // Add a deal with data Length 10 - dealInfo := piecestore.DealInfo{ - SectorID: unsealedSectorID, - Length: 10, - } - err = ps.AddDealForPiece(cid1, cid.Undef, dealInfo) - require.NoError(t, err) - - // hold the lock to block. - rpn.lk.Lock() - - // fetch the piece concurrently. - errgrp, ctx := errgroup.WithContext(context.Background()) - for i := 0; i < 10; i++ { - errgrp.Go(func() error { - //stm: @MARKET_DAGSTORE_FETCH_UNSEALED_PIECE_001 - r, err := api.FetchUnsealedPiece(ctx, cid1) - if err == nil { - _ = r.Close() - } - return err - }) - } - - time.Sleep(500 * time.Millisecond) - require.EqualValues(t, 3, atomic.LoadInt32(&rpn.calls)) // throttled - - // allow to proceed. - rpn.lk.Unlock() - - // allow all to finish. - err = errgrp.Wait() - require.NoError(t, err) - - require.EqualValues(t, 10, atomic.LoadInt32(&rpn.calls)) // throttled - -} - -func getPieceStore(t *testing.T) piecestore.PieceStore { - ps, err := piecestoreimpl.NewPieceStore(ds_sync.MutexWrap(ds.NewMapDatastore())) - require.NoError(t, err) - - ch := make(chan struct{}, 1) - ps.OnReady(func(_ error) { - ch <- struct{}{} - }) - - err = ps.Start(context.Background()) - require.NoError(t, err) - <-ch - return ps -} - -type mockRPN struct { - calls int32 // guarded by atomic - lk sync.RWMutex // lock to simulate blocks. - sectors map[abi.SectorNumber]string -} - -func (m *mockRPN) UnsealSector(ctx context.Context, sectorID abi.SectorNumber, offset abi.UnpaddedPieceSize, length abi.UnpaddedPieceSize) (io.ReadCloser, error) { - return m.UnsealSectorAt(ctx, sectorID, offset, length) -} - -func (m *mockRPN) UnsealSectorAt(ctx context.Context, sectorID abi.SectorNumber, pieceOffset abi.UnpaddedPieceSize, length abi.UnpaddedPieceSize) (mount.Reader, error) { - atomic.AddInt32(&m.calls, 1) - m.lk.RLock() - defer m.lk.RUnlock() - - data, ok := m.sectors[sectorID] - if !ok { - panic("sector not found") - } - return struct { - io.ReadCloser - io.ReaderAt - io.Seeker - }{ - ReadCloser: io.NopCloser(bytes.NewBuffer([]byte(data[:]))), - }, nil -} - -func (m *mockRPN) IsUnsealed(ctx context.Context, sectorID abi.SectorNumber, offset abi.UnpaddedPieceSize, length abi.UnpaddedPieceSize) (bool, error) { - return sectorID == unsealedSectorID, nil -} - -func (m *mockRPN) GetChainHead(ctx context.Context) (shared.TipSetToken, abi.ChainEpoch, error) { - panic("implement me") -} - -func (m *mockRPN) GetMinerWorkerAddress(ctx context.Context, miner address.Address, tok shared.TipSetToken) (address.Address, error) { - panic("implement me") -} - -func (m *mockRPN) SavePaymentVoucher(ctx context.Context, paymentChannel address.Address, voucher *paychtypes.SignedVoucher, proof []byte, expectedAmount abi.TokenAmount, tok shared.TipSetToken) (abi.TokenAmount, error) { - panic("implement me") -} - -func (m *mockRPN) GetRetrievalPricingInput(ctx context.Context, pieceCID cid.Cid, storageDeals []abi.DealID) (retrievalmarket.PricingInput, error) { - panic("implement me") -} - -var _ retrievalmarket.RetrievalProviderNode = (*mockRPN)(nil) diff --git a/markets/dagstore/mocks/mock_lotus_accessor.go b/markets/dagstore/mocks/mock_lotus_accessor.go deleted file mode 100644 index 3910512cf2e..00000000000 --- a/markets/dagstore/mocks/mock_lotus_accessor.go +++ /dev/null @@ -1,97 +0,0 @@ -// Code generated by MockGen. DO NOT EDIT. -// Source: github.com/filecoin-project/lotus/markets/dagstore (interfaces: MinerAPI) - -// Package mock_dagstore is a generated GoMock package. -package mock_dagstore - -import ( - context "context" - reflect "reflect" - - gomock "github.com/golang/mock/gomock" - cid "github.com/ipfs/go-cid" - - mount "github.com/filecoin-project/dagstore/mount" -) - -// MockMinerAPI is a mock of MinerAPI interface. -type MockMinerAPI struct { - ctrl *gomock.Controller - recorder *MockMinerAPIMockRecorder -} - -// MockMinerAPIMockRecorder is the mock recorder for MockMinerAPI. -type MockMinerAPIMockRecorder struct { - mock *MockMinerAPI -} - -// NewMockMinerAPI creates a new mock instance. -func NewMockMinerAPI(ctrl *gomock.Controller) *MockMinerAPI { - mock := &MockMinerAPI{ctrl: ctrl} - mock.recorder = &MockMinerAPIMockRecorder{mock} - return mock -} - -// EXPECT returns an object that allows the caller to indicate expected use. -func (m *MockMinerAPI) EXPECT() *MockMinerAPIMockRecorder { - return m.recorder -} - -// FetchUnsealedPiece mocks base method. -func (m *MockMinerAPI) FetchUnsealedPiece(arg0 context.Context, arg1 cid.Cid) (mount.Reader, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "FetchUnsealedPiece", arg0, arg1) - ret0, _ := ret[0].(mount.Reader) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// FetchUnsealedPiece indicates an expected call of FetchUnsealedPiece. -func (mr *MockMinerAPIMockRecorder) FetchUnsealedPiece(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FetchUnsealedPiece", reflect.TypeOf((*MockMinerAPI)(nil).FetchUnsealedPiece), arg0, arg1) -} - -// GetUnpaddedCARSize mocks base method. -func (m *MockMinerAPI) GetUnpaddedCARSize(arg0 context.Context, arg1 cid.Cid) (uint64, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetUnpaddedCARSize", arg0, arg1) - ret0, _ := ret[0].(uint64) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// GetUnpaddedCARSize indicates an expected call of GetUnpaddedCARSize. -func (mr *MockMinerAPIMockRecorder) GetUnpaddedCARSize(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetUnpaddedCARSize", reflect.TypeOf((*MockMinerAPI)(nil).GetUnpaddedCARSize), arg0, arg1) -} - -// IsUnsealed mocks base method. -func (m *MockMinerAPI) IsUnsealed(arg0 context.Context, arg1 cid.Cid) (bool, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "IsUnsealed", arg0, arg1) - ret0, _ := ret[0].(bool) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// IsUnsealed indicates an expected call of IsUnsealed. -func (mr *MockMinerAPIMockRecorder) IsUnsealed(arg0, arg1 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsUnsealed", reflect.TypeOf((*MockMinerAPI)(nil).IsUnsealed), arg0, arg1) -} - -// Start mocks base method. -func (m *MockMinerAPI) Start(arg0 context.Context) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Start", arg0) - ret0, _ := ret[0].(error) - return ret0 -} - -// Start indicates an expected call of Start. -func (mr *MockMinerAPIMockRecorder) Start(arg0 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Start", reflect.TypeOf((*MockMinerAPI)(nil).Start), arg0) -} diff --git a/markets/dagstore/mount.go b/markets/dagstore/mount.go deleted file mode 100644 index 0ecdc98082c..00000000000 --- a/markets/dagstore/mount.go +++ /dev/null @@ -1,91 +0,0 @@ -package dagstore - -import ( - "context" - "net/url" - - "github.com/ipfs/go-cid" - "golang.org/x/xerrors" - - "github.com/filecoin-project/dagstore/mount" -) - -const lotusScheme = "lotus" - -var _ mount.Mount = (*LotusMount)(nil) - -// mountTemplate returns a templated LotusMount containing the supplied API. -// -// It is called when registering a mount type with the mount registry -// of the DAG store. It is used to reinstantiate mounts after a restart. -// -// When the registry needs to deserialize a mount it clones the template then -// calls Deserialize on the cloned instance, which will have a reference to the -// lotus mount API supplied here. -func mountTemplate(api MinerAPI) *LotusMount { - return &LotusMount{API: api} -} - -// LotusMount is a DAGStore mount implementation that fetches deal data -// from a PieceCID. -type LotusMount struct { - API MinerAPI - PieceCid cid.Cid -} - -func NewLotusMount(pieceCid cid.Cid, api MinerAPI) (*LotusMount, error) { - return &LotusMount{ - PieceCid: pieceCid, - API: api, - }, nil -} - -func (l *LotusMount) Serialize() *url.URL { - return &url.URL{ - Host: l.PieceCid.String(), - } -} - -func (l *LotusMount) Deserialize(u *url.URL) error { - pieceCid, err := cid.Decode(u.Host) - if err != nil { - return xerrors.Errorf("failed to parse PieceCid from host '%s': %w", u.Host, err) - } - l.PieceCid = pieceCid - return nil -} - -func (l *LotusMount) Fetch(ctx context.Context) (mount.Reader, error) { - return l.API.FetchUnsealedPiece(ctx, l.PieceCid) -} - -func (l *LotusMount) Info() mount.Info { - return mount.Info{ - Kind: mount.KindRemote, - AccessSequential: true, - AccessSeek: true, - AccessRandom: true, - } -} - -func (l *LotusMount) Close() error { - return nil -} - -func (l *LotusMount) Stat(ctx context.Context) (mount.Stat, error) { - size, err := l.API.GetUnpaddedCARSize(ctx, l.PieceCid) - if err != nil { - return mount.Stat{}, xerrors.Errorf("failed to fetch piece size for piece %s: %w", l.PieceCid, err) - } - isUnsealed, err := l.API.IsUnsealed(ctx, l.PieceCid) - if err != nil { - return mount.Stat{}, xerrors.Errorf("failed to verify if we have the unsealed piece %s: %w", l.PieceCid, err) - } - - // TODO Mark false when storage deal expires. - return mount.Stat{ - Exists: true, - Size: int64(size), - Ready: isUnsealed, - }, nil -} diff --git a/markets/dagstore/mount_test.go b/markets/dagstore/mount_test.go deleted file mode 100644 index d415f8d8856..00000000000 --- a/markets/dagstore/mount_test.go +++ /dev/null @@ -1,151 +0,0 @@ -// stm: @unit -package dagstore - -import ( - "context" - "io" - "net/url" - "strings" - "testing" - - "github.com/golang/mock/gomock" - blocksutil "github.com/ipfs/go-ipfs-blocksutil" - "github.com/stretchr/testify/require" - - "github.com/filecoin-project/dagstore/mount" - - mock_dagstore "github.com/filecoin-project/lotus/markets/dagstore/mocks" -) - -func TestLotusMount(t *testing.T) { - //stm: @MARKET_DAGSTORE_FETCH_UNSEALED_PIECE_001, @MARKET_DAGSTORE_GET_UNPADDED_CAR_SIZE_001 - //stm: @MARKET_DAGSTORE_IS_PIECE_UNSEALED_001 - ctx := context.Background() - bgen := blocksutil.NewBlockGenerator() - cid := bgen.Next().Cid() - - mockCtrl := gomock.NewController(t) - // when test is done, assert expectations on all mock objects. - defer mockCtrl.Finish() - - // create a mock lotus api that returns the reader we want - mockLotusMountAPI := mock_dagstore.NewMockMinerAPI(mockCtrl) - - mockLotusMountAPI.EXPECT().IsUnsealed(gomock.Any(), cid).Return(true, nil).Times(1) - - mr1 := struct { - io.ReadCloser - io.ReaderAt - io.Seeker - }{ - ReadCloser: io.NopCloser(strings.NewReader("testing")), - ReaderAt: nil, - Seeker: nil, - } - mr2 := struct { - io.ReadCloser - io.ReaderAt - io.Seeker - }{ - ReadCloser: io.NopCloser(strings.NewReader("testing")), - ReaderAt: nil, - Seeker: nil, - } - - mockLotusMountAPI.EXPECT().FetchUnsealedPiece(gomock.Any(), cid).Return(mr1, nil).Times(1) - mockLotusMountAPI.EXPECT().FetchUnsealedPiece(gomock.Any(), cid).Return(mr2, nil).Times(1) - mockLotusMountAPI.EXPECT().GetUnpaddedCARSize(ctx, cid).Return(uint64(100), nil).Times(1) - - mnt, err := NewLotusMount(cid, mockLotusMountAPI) - require.NoError(t, err) - info := mnt.Info() - require.Equal(t, info.Kind, mount.KindRemote) - - // fetch and assert success - rd, err := mnt.Fetch(context.Background()) - require.NoError(t, err) - - bz, err := io.ReadAll(rd) - require.NoError(t, err) - require.NoError(t, rd.Close()) - require.Equal(t, []byte("testing"), bz) - - stat, err := mnt.Stat(ctx) - require.NoError(t, err) - require.EqualValues(t, 100, stat.Size) - - // serialize url then deserialize from mount template -> should get back - // the same mount - url := mnt.Serialize() - mnt2 := mountTemplate(mockLotusMountAPI) - err = mnt2.Deserialize(url) - require.NoError(t, err) - - // fetching on this mount should get us back the same data. - rd, err = mnt2.Fetch(context.Background()) - require.NoError(t, err) - bz, err = io.ReadAll(rd) - require.NoError(t, err) - require.NoError(t, rd.Close()) - require.Equal(t, []byte("testing"), bz) -} - -func TestLotusMountDeserialize(t *testing.T) { - //stm: @MARKET_DAGSTORE_DESERIALIZE_CID_001 - api := &minerAPI{} - - bgen := blocksutil.NewBlockGenerator() - cid := bgen.Next().Cid() - - // success - us := lotusScheme + "://" + cid.String() - u, err := url.Parse(us) - require.NoError(t, err) - - mnt := mountTemplate(api) - err = mnt.Deserialize(u) - require.NoError(t, err) - - require.Equal(t, cid, mnt.PieceCid) - require.Equal(t, api, mnt.API) - - // fails if cid is not valid - us = lotusScheme + "://" + "rand" - u, err = url.Parse(us) - require.NoError(t, err) - err = mnt.Deserialize(u) - require.Error(t, err) - require.Contains(t, err.Error(), "failed to parse PieceCid") -} - -func TestLotusMountRegistration(t *testing.T) { - //stm: @MARKET_DAGSTORE_FETCH_UNSEALED_PIECE_001, @MARKET_DAGSTORE_GET_UNPADDED_CAR_SIZE_001 - //stm: @MARKET_DAGSTORE_IS_PIECE_UNSEALED_001 - ctx := context.Background() - bgen := blocksutil.NewBlockGenerator() - cid := bgen.Next().Cid() - - // success - us := lotusScheme + "://" + cid.String() - u, err := url.Parse(us) - require.NoError(t, err) - - mockCtrl := gomock.NewController(t) - // when test is done, assert expectations on all mock objects. - defer mockCtrl.Finish() - - mockLotusMountAPI := mock_dagstore.NewMockMinerAPI(mockCtrl) - registry := mount.NewRegistry() - err = registry.Register(lotusScheme, mountTemplate(mockLotusMountAPI)) - require.NoError(t, err) - - mnt, err := registry.Instantiate(u) - require.NoError(t, err) - - mockLotusMountAPI.EXPECT().IsUnsealed(ctx, cid).Return(true, nil) - mockLotusMountAPI.EXPECT().GetUnpaddedCARSize(ctx, cid).Return(uint64(100), nil).Times(1) - stat, err := mnt.Stat(context.Background()) - require.NoError(t, err) - require.EqualValues(t, 100, stat.Size) - require.True(t, stat.Ready) -} diff --git a/markets/dagstore/wrapper.go b/markets/dagstore/wrapper.go deleted file mode 100644 index a929ad1fc93..00000000000 --- a/markets/dagstore/wrapper.go +++ /dev/null @@ -1,436 +0,0 @@ -package dagstore - -import ( - "context" - "errors" - "fmt" - "math" - "os" - "path/filepath" - "sync" - "time" - - "github.com/ipfs/go-cid" - ds "github.com/ipfs/go-datastore" - levelds "github.com/ipfs/go-ds-leveldb" - measure "github.com/ipfs/go-ds-measure" - logging "github.com/ipfs/go-log/v2" - carindex "github.com/ipld/go-car/v2/index" - "github.com/libp2p/go-libp2p/core/host" - ldbopts "github.com/syndtr/goleveldb/leveldb/opt" - "golang.org/x/xerrors" - - "github.com/filecoin-project/dagstore" - "github.com/filecoin-project/dagstore/index" - "github.com/filecoin-project/dagstore/mount" - "github.com/filecoin-project/dagstore/shard" - "github.com/filecoin-project/go-fil-markets/storagemarket" - "github.com/filecoin-project/go-fil-markets/storagemarket/impl/providerstates" - "github.com/filecoin-project/go-fil-markets/stores" - "github.com/filecoin-project/go-statemachine/fsm" - - "github.com/filecoin-project/lotus/node/config" -) - -const ( - maxRecoverAttempts = 1 - shardRegMarker = ".shard-registration-complete" -) - -var log = logging.Logger("dagstore") - -type Wrapper struct { - ctx context.Context - cancel context.CancelFunc - backgroundWg sync.WaitGroup - - cfg config.DAGStoreConfig - dagst dagstore.Interface - minerAPI MinerAPI - failureCh chan dagstore.ShardResult - gcInterval time.Duration -} - -var _ stores.DAGStoreWrapper = (*Wrapper)(nil) - -func NewDAGStore(cfg config.DAGStoreConfig, minerApi MinerAPI, h host.Host) (*dagstore.DAGStore, *Wrapper, error) { - // construct the DAG Store. - registry := mount.NewRegistry() - if err := registry.Register(lotusScheme, mountTemplate(minerApi)); err != nil { - return nil, nil, xerrors.Errorf("failed to create registry: %w", err) - } - - // The dagstore will write Shard failures to the `failureCh` here. - failureCh := make(chan dagstore.ShardResult, 1) - - var ( - transientsDir = filepath.Join(cfg.RootDir, "transients") - datastoreDir = filepath.Join(cfg.RootDir, "datastore") - indexDir = filepath.Join(cfg.RootDir, "index") - ) - - dstore, err := newDatastore(datastoreDir) - if err != nil { - return nil, nil, xerrors.Errorf("failed to create dagstore datastore in %s: %w", datastoreDir, err) - } - - irepo, err := index.NewFSRepo(indexDir) - if err != nil { - return nil, nil, xerrors.Errorf("failed to initialise dagstore index repo: %w", err) - } - - topIndex := index.NewInverted(dstore) - dcfg := dagstore.Config{ - TransientsDir: transientsDir, - IndexRepo: irepo, - Datastore: dstore, - MountRegistry: registry, - FailureCh: failureCh, - TopLevelIndex: topIndex, - // not limiting fetches globally, as the Lotus mount does - // conditional throttling. - MaxConcurrentIndex: cfg.MaxConcurrentIndex, - MaxConcurrentReadyFetches: cfg.MaxConcurrentReadyFetches, - RecoverOnStart: dagstore.RecoverOnAcquire, - } - - dagst, err := dagstore.NewDAGStore(dcfg) - if err != nil { - return nil, nil, xerrors.Errorf("failed to create DAG store: %w", err) - } - - w := &Wrapper{ - cfg: cfg, - dagst: dagst, - minerAPI: minerApi, - failureCh: failureCh, - gcInterval: time.Duration(cfg.GCInterval), - } - - return dagst, w, nil -} - -// newDatastore creates a datastore under the given base directory -// for dagstore metadata. -func newDatastore(dir string) (ds.Batching, error) { - // Create the datastore directory if it doesn't exist yet. - if err := os.MkdirAll(dir, 0755); err != nil { - return nil, xerrors.Errorf("failed to create directory %s for DAG store datastore: %w", dir, err) - } - - // Create a new LevelDB datastore - dstore, err := levelds.NewDatastore(dir, &levelds.Options{ - Compression: ldbopts.NoCompression, - NoSync: false, - Strict: ldbopts.StrictAll, - ReadOnly: false, - }) - if err != nil { - return nil, xerrors.Errorf("failed to open datastore for DAG store: %w", err) - } - // Keep statistics about the datastore - mds := measure.New("measure.", dstore) - return mds, nil -} - -func (w *Wrapper) Start(ctx context.Context) error { - w.ctx, w.cancel = context.WithCancel(ctx) - - // Run a go-routine to do DagStore GC. - w.backgroundWg.Add(1) - go w.gcLoop() - - // Run a go-routine for shard recovery - if dss, ok := w.dagst.(*dagstore.DAGStore); ok { - w.backgroundWg.Add(1) - go dagstore.RecoverImmediately(w.ctx, dss, w.failureCh, maxRecoverAttempts, w.backgroundWg.Done) - } - - return w.dagst.Start(ctx) -} - -func (w *Wrapper) gcLoop() { - defer w.backgroundWg.Done() - - ticker := time.NewTicker(w.gcInterval) - defer ticker.Stop() - - for w.ctx.Err() == nil { - select { - // GC the DAG store on every tick - case <-ticker.C: - _, _ = w.dagst.GC(w.ctx) - - // Exit when the DAG store wrapper is shutdown - case <-w.ctx.Done(): - return - } - } -} - -func (w *Wrapper) LoadShard(ctx context.Context, pieceCid cid.Cid) (stores.ClosableBlockstore, error) { - log.Debugf("acquiring shard for piece CID %s", pieceCid) - - key := shard.KeyFromCID(pieceCid) - resch := make(chan dagstore.ShardResult, 1) - err := w.dagst.AcquireShard(ctx, key, resch, dagstore.AcquireOpts{}) - log.Debugf("sent message to acquire shard for piece CID %s", pieceCid) - - if err != nil { - if !errors.Is(err, dagstore.ErrShardUnknown) { - return nil, xerrors.Errorf("failed to schedule acquire shard for piece CID %s: %w", pieceCid, err) - } - - // if the DAGStore does not know about the Shard -> register it and then try to acquire it again. - log.Warnw("failed to load shard as shard is not registered, will re-register", "pieceCID", pieceCid) - // The path of a transient file that we can ask the DAG Store to use - // to perform the Indexing rather than fetching it via the Mount if - // we already have a transient file. However, we don't have it here - // and therefore we pass an empty file path. - carPath := "" - if err := stores.RegisterShardSync(ctx, w, pieceCid, carPath, false); err != nil { - return nil, xerrors.Errorf("failed to re-register shard during loading piece CID %s: %w", pieceCid, err) - } - log.Warnw("successfully re-registered shard", "pieceCID", pieceCid) - - resch = make(chan dagstore.ShardResult, 1) - if err := w.dagst.AcquireShard(ctx, key, resch, dagstore.AcquireOpts{}); err != nil { - return nil, xerrors.Errorf("failed to acquire Shard for piece CID %s after re-registering: %w", pieceCid, err) - } - } - - // TODO: The context is not yet being actively monitored by the DAG store, - // so we need to select against ctx.Done() until the following issue is - // implemented: - // https://github.com/filecoin-project/dagstore/issues/39 - var res dagstore.ShardResult - select { - case <-ctx.Done(): - return nil, ctx.Err() - case res = <-resch: - if res.Error != nil { - return nil, xerrors.Errorf("failed to acquire shard for piece CID %s: %w", pieceCid, res.Error) - } - } - - bs, err := res.Accessor.Blockstore() - if err != nil { - return nil, err - } - - log.Debugf("successfully loaded blockstore for piece CID %s", pieceCid) - return &Blockstore{ReadBlockstore: bs, Closer: res.Accessor}, nil -} - -func (w *Wrapper) RegisterShard(ctx context.Context, pieceCid cid.Cid, carPath string, eagerInit bool, resch chan dagstore.ShardResult) error { - // Create a lotus mount with the piece CID - key := shard.KeyFromCID(pieceCid) - mt, err := NewLotusMount(pieceCid, w.minerAPI) - if err != nil { - return xerrors.Errorf("failed to create lotus mount for piece CID %s: %w", pieceCid, err) - } - - // Register the shard - opts := dagstore.RegisterOpts{ - ExistingTransient: carPath, - LazyInitialization: !eagerInit, - } - err = w.dagst.RegisterShard(ctx, key, mt, resch, opts) - if err != nil { - return xerrors.Errorf("failed to schedule register shard for piece CID %s: %w", pieceCid, err) - } - log.Debugf("successfully submitted Register Shard request for piece CID %s with eagerInit=%t", pieceCid, eagerInit) - - return nil -} - -func (w *Wrapper) DestroyShard(ctx context.Context, pieceCid cid.Cid, resch chan dagstore.ShardResult) error { - key := shard.KeyFromCID(pieceCid) - - opts := dagstore.DestroyOpts{} - - err := w.dagst.DestroyShard(ctx, key, resch, opts) - - if err != nil { - return xerrors.Errorf("failed to schedule destroy shard for piece CID %s: %w", pieceCid, err) - } - log.Debugf("successfully submitted destroy Shard request for piece CID %s", pieceCid) - - return nil - -} - -func (w *Wrapper) MigrateDeals(ctx context.Context, deals []storagemarket.MinerDeal) (bool, error) { - log := log.Named("migrator") - - // Check if all deals have already been registered as shards - isComplete, err := w.registrationComplete() - if err != nil { - return false, xerrors.Errorf("failed to get dagstore migration status: %w", err) - } - if isComplete { - // All deals have been registered as shards, bail out - log.Info("no shard migration necessary; already marked complete") - return false, nil - } - - log.Infow("registering shards for all active deals in sealing subsystem", "count", len(deals)) - - inSealingSubsystem := make(map[fsm.StateKey]struct{}, len(providerstates.StatesKnownBySealingSubsystem)) - for _, s := range providerstates.StatesKnownBySealingSubsystem { - inSealingSubsystem[s] = struct{}{} - } - - // channel where results will be received, and channel where the total - // number of registered shards will be sent. - resch := make(chan dagstore.ShardResult, 32) - totalCh := make(chan int) - doneCh := make(chan struct{}) - - // Start making progress consuming results. We won't know how many to - // actually consume until we register all shards. - // - // If there are any problems registering shards, just log an error - go func() { - defer close(doneCh) - - var total = math.MaxInt64 - var res dagstore.ShardResult - for rcvd := 0; rcvd < total; { - select { - case total = <-totalCh: - // we now know the total number of registered shards - // nullify so that we no longer consume from it after closed. - close(totalCh) - totalCh = nil - case res = <-resch: - rcvd++ - if res.Error == nil { - log.Infow("async shard registration completed successfully", "shard_key", res.Key) - } else { - log.Warnw("async shard registration failed", "shard_key", res.Key, "error", res.Error) - } - } - } - }() - - // Filter for deals that are handed off. - // - // If the deal has not yet been handed off to the sealing subsystem, we - // don't need to call RegisterShard in this migration; RegisterShard will - // be called in the new code once the deal reaches the state where it's - // handed off to the sealing subsystem. - var registered int - for _, deal := range deals { - pieceCid := deal.Proposal.PieceCID - - // enrich log statements in this iteration with deal ID and piece CID. - log := log.With("deal_id", deal.DealID, "piece_cid", pieceCid) - - // Filter for deals that have been handed off to the sealing subsystem - if _, ok := inSealingSubsystem[deal.State]; !ok { - log.Infow("deal not ready; skipping") - continue - } - - log.Infow("registering deal in dagstore with lazy init") - - // Register the deal as a shard with the DAG store with lazy initialization. - // The index will be populated the first time the deal is retrieved, or - // through the bulk initialization script. - err = w.RegisterShard(ctx, pieceCid, "", false, resch) - if err != nil { - log.Warnw("failed to register shard", "error", err) - continue - } - registered++ - } - - log.Infow("finished registering all shards", "total", registered) - totalCh <- registered - <-doneCh - - log.Infow("confirmed registration of all shards") - - // Completed registering all shards, so mark the migration as complete - err = w.markRegistrationComplete() - if err != nil { - log.Errorf("failed to mark shards as registered: %s", err) - } else { - log.Info("successfully marked migration as complete") - } - - log.Infow("dagstore migration complete") - - return true, nil -} - -// Check for the existence of a "marker" file indicating that the migration -// has completed -func (w *Wrapper) registrationComplete() (bool, error) { - path := filepath.Join(w.cfg.RootDir, shardRegMarker) - _, err := os.Stat(path) - if os.IsNotExist(err) { - return false, nil - } - if err != nil { - return false, err - } - return true, nil -} - -// Create a "marker" file indicating that the migration has completed -func (w *Wrapper) markRegistrationComplete() error { - path := filepath.Join(w.cfg.RootDir, shardRegMarker) - file, err := os.Create(path) - if err != nil { - return err - } - return file.Close() -} - -// Get all the pieces that contain a block -func (w *Wrapper) GetPiecesContainingBlock(blockCID cid.Cid) ([]cid.Cid, error) { - // Pieces are stored as "shards" in the DAG store - shardKeys, err := w.dagst.ShardsContainingMultihash(w.ctx, blockCID.Hash()) - if err != nil { - return nil, xerrors.Errorf("getting pieces containing block %s: %w", blockCID, err) - } - - // Convert from shard key to cid - pieceCids := make([]cid.Cid, 0, len(shardKeys)) - for _, k := range shardKeys { - c, err := cid.Parse(k.String()) - if err != nil { - prefix := fmt.Sprintf("getting pieces containing block %s:", blockCID) - return nil, xerrors.Errorf("%s converting shard key %s to piece cid: %w", prefix, k, err) - } - - pieceCids = append(pieceCids, c) - } - - return pieceCids, nil -} - -func (w *Wrapper) GetIterableIndexForPiece(pieceCid cid.Cid) (carindex.IterableIndex, error) { - return w.dagst.GetIterableIndex(shard.KeyFromCID(pieceCid)) -} - -func (w *Wrapper) Close() error { - // Cancel the context - w.cancel() - - // Close the DAG store - log.Info("will close the dagstore") - if err := w.dagst.Close(); err != nil { - return xerrors.Errorf("failed to close dagstore: %w", err) - } - log.Info("dagstore closed") - - // Wait for the background go routine to exit - log.Info("waiting for dagstore background wrapper goroutines to exit") - w.backgroundWg.Wait() - log.Info("exited dagstore background wrapper goroutines") - - return nil -} diff --git a/markets/dagstore/wrapper_migration_test.go b/markets/dagstore/wrapper_migration_test.go deleted file mode 100644 index db2c9768b1a..00000000000 --- a/markets/dagstore/wrapper_migration_test.go +++ /dev/null @@ -1,153 +0,0 @@ -// stm: #integration -package dagstore - -import ( - "context" - "io" - "testing" - - mocknet "github.com/libp2p/go-libp2p/p2p/net/mock" - "github.com/stretchr/testify/require" - - "github.com/filecoin-project/dagstore" - "github.com/filecoin-project/dagstore/mount" - "github.com/filecoin-project/go-fil-markets/retrievalmarket" - "github.com/filecoin-project/go-fil-markets/retrievalmarket/impl/testnodes" - tut "github.com/filecoin-project/go-fil-markets/shared_testutil" - "github.com/filecoin-project/go-fil-markets/storagemarket" - "github.com/filecoin-project/go-state-types/abi" - markettypes "github.com/filecoin-project/go-state-types/builtin/v9/market" - - "github.com/filecoin-project/lotus/node/config" -) - -func TestShardRegistration(t *testing.T) { - ps := tut.NewTestPieceStore() - sa := testnodes.NewTestSectorAccessor() - - ctx := context.Background() - cids := tut.GenerateCids(4) - pieceCidUnsealed := cids[0] - pieceCidSealed := cids[1] - pieceCidUnsealed2 := cids[2] - pieceCidUnsealed3 := cids[3] - - sealedSector := abi.SectorNumber(1) - unsealedSector1 := abi.SectorNumber(2) - unsealedSector2 := abi.SectorNumber(3) - unsealedSector3 := abi.SectorNumber(4) - - // ps.ExpectPiece(pieceCidUnsealed, piecestore.PieceInfo{ - // PieceCID: pieceCidUnsealed, - // Deals: []piecestore.DealInfo{ - // { - // SectorID: unsealedSector1, - // }, - // }, - // }) - // - // ps.ExpectPiece(pieceCidSealed, piecestore.PieceInfo{ - // PieceCID: pieceCidSealed, - // Deals: []piecestore.DealInfo{ - // { - // SectorID: sealedSector, - // }, - // }, - // }) - - deals := []storagemarket.MinerDeal{{ - // Should be registered - //stm: @MARKET_DAGSTORE_MIGRATE_DEALS_001 - State: storagemarket.StorageDealSealing, - SectorNumber: unsealedSector1, - ClientDealProposal: markettypes.ClientDealProposal{ - Proposal: markettypes.DealProposal{ - PieceCID: pieceCidUnsealed, - }, - }, - }, { - // Should be registered with lazy registration (because sector is sealed) - State: storagemarket.StorageDealSealing, - SectorNumber: sealedSector, - ClientDealProposal: markettypes.ClientDealProposal{ - Proposal: markettypes.DealProposal{ - PieceCID: pieceCidSealed, - }, - }, - }, { - // Should be ignored because deal is no longer active - //stm: @MARKET_DAGSTORE_MIGRATE_DEALS_003 - State: storagemarket.StorageDealError, - SectorNumber: unsealedSector2, - ClientDealProposal: markettypes.ClientDealProposal{ - Proposal: markettypes.DealProposal{ - PieceCID: pieceCidUnsealed2, - }, - }, - }, { - // Should be ignored because deal is not yet sealing - State: storagemarket.StorageDealFundsReserved, - SectorNumber: unsealedSector3, - ClientDealProposal: markettypes.ClientDealProposal{ - Proposal: markettypes.DealProposal{ - PieceCID: pieceCidUnsealed3, - }, - }, - }} - - cfg := config.DefaultStorageMiner().DAGStore - cfg.RootDir = t.TempDir() - - h, err := mocknet.New().GenPeer() - require.NoError(t, err) - - mapi := NewMinerAPI(ps, &wrappedSA{sa}, 10, 5) - dagst, w, err := NewDAGStore(cfg, mapi, h) - require.NoError(t, err) - require.NotNil(t, dagst) - require.NotNil(t, w) - - err = dagst.Start(context.Background()) - require.NoError(t, err) - - migrated, err := w.MigrateDeals(ctx, deals) - require.True(t, migrated) - require.NoError(t, err) - - //stm: @MARKET_DAGSTORE_GET_ALL_SHARDS_001 - info := dagst.AllShardsInfo() - require.Len(t, info, 2) - for _, i := range info { - require.Equal(t, dagstore.ShardStateNew, i.ShardState) - } - - // Run register shard migration again - //stm: @MARKET_DAGSTORE_MIGRATE_DEALS_002 - migrated, err = w.MigrateDeals(ctx, deals) - require.False(t, migrated) - require.NoError(t, err) - - // ps.VerifyExpectations(t) -} - -type wrappedSA struct { - retrievalmarket.SectorAccessor -} - -func (w *wrappedSA) UnsealSectorAt(ctx context.Context, sectorID abi.SectorNumber, pieceOffset abi.UnpaddedPieceSize, length abi.UnpaddedPieceSize) (mount.Reader, error) { - r, err := w.UnsealSector(ctx, sectorID, pieceOffset, length) - if err != nil { - return nil, err - } - return struct { - io.ReadCloser - io.Seeker - io.ReaderAt - }{ - ReadCloser: r, - Seeker: nil, - ReaderAt: nil, - }, err -} - -var _ SectorAccessor = &wrappedSA{} diff --git a/markets/dagstore/wrapper_test.go b/markets/dagstore/wrapper_test.go deleted file mode 100644 index f3b5e1b52c0..00000000000 --- a/markets/dagstore/wrapper_test.go +++ /dev/null @@ -1,262 +0,0 @@ -// stm: #unit -package dagstore - -import ( - "bytes" - "context" - "os" - "testing" - "time" - - "github.com/ipfs/go-cid" - carindex "github.com/ipld/go-car/v2/index" - mocknet "github.com/libp2p/go-libp2p/p2p/net/mock" - mh "github.com/multiformats/go-multihash" - "github.com/stretchr/testify/require" - "golang.org/x/xerrors" - - "github.com/filecoin-project/dagstore" - "github.com/filecoin-project/dagstore/mount" - "github.com/filecoin-project/dagstore/shard" - - "github.com/filecoin-project/lotus/node/config" -) - -// TestWrapperAcquireRecovery verifies that if acquire shard returns a "not found" -// error, the wrapper will attempt to register the shard then reacquire -func TestWrapperAcquireRecoveryDestroy(t *testing.T) { - ctx := context.Background() - pieceCid, err := cid.Parse("bafkqaaa") - require.NoError(t, err) - - h, err := mocknet.New().GenPeer() - require.NoError(t, err) - // Create a DAG store wrapper - dagst, w, err := NewDAGStore(config.DAGStoreConfig{ - RootDir: t.TempDir(), - GCInterval: config.Duration(1 * time.Millisecond), - }, mockLotusMount{}, h) - require.NoError(t, err) - - defer dagst.Close() //nolint:errcheck - - // Return an error from acquire shard the first time - acquireShardErr := make(chan error, 1) - acquireShardErr <- xerrors.Errorf("unknown shard: %w", dagstore.ErrShardUnknown) - - // Create a mock DAG store in place of the real DAG store - mock := &mockDagStore{ - acquireShardErr: acquireShardErr, - acquireShardRes: dagstore.ShardResult{ - Accessor: getShardAccessor(t), - }, - register: make(chan shard.Key, 1), - destroy: make(chan shard.Key, 1), - } - w.dagst = mock - - //stm: @MARKET_DAGSTORE_ACQUIRE_SHARD_002 - mybs, err := w.LoadShard(ctx, pieceCid) - require.NoError(t, err) - - // Expect the wrapper to try to recover from the error returned from - // acquire shard by calling register shard with the same key - tctx, cancel := context.WithTimeout(ctx, time.Second) - defer cancel() - select { - case <-tctx.Done(): - require.Fail(t, "failed to call register") - case k := <-mock.register: - require.Equal(t, k.String(), pieceCid.String()) - } - - // Verify that we can get things from the acquired blockstore - var count int - ch, err := mybs.AllKeysChan(ctx) - require.NoError(t, err) - for range ch { - count++ - } - require.Greater(t, count, 0) - - // Destroy the shard - dr := make(chan dagstore.ShardResult, 1) - err = w.DestroyShard(ctx, pieceCid, dr) - require.NoError(t, err) - - dctx, cancel := context.WithTimeout(ctx, time.Second) - defer cancel() - select { - case <-dctx.Done(): - require.Fail(t, "failed to call destroy") - case k := <-mock.destroy: - require.Equal(t, k.String(), pieceCid.String()) - } - - var dcount int - dch, err := mybs.AllKeysChan(ctx) - require.NoError(t, err) - for range dch { - count++ - } - require.Equal(t, dcount, 0) -} - -// TestWrapperBackground verifies the behaviour of the background go routine -func TestWrapperBackground(t *testing.T) { - ctx := context.Background() - h, err := mocknet.New().GenPeer() - require.NoError(t, err) - - // Create a DAG store wrapper - dagst, w, err := NewDAGStore(config.DAGStoreConfig{ - RootDir: t.TempDir(), - GCInterval: config.Duration(1 * time.Millisecond), - }, mockLotusMount{}, h) - require.NoError(t, err) - - defer dagst.Close() //nolint:errcheck - - // Create a mock DAG store in place of the real DAG store - mock := &mockDagStore{ - gc: make(chan struct{}, 1), - recover: make(chan shard.Key, 1), - close: make(chan struct{}, 1), - } - w.dagst = mock - - // Start up the wrapper - //stm: @MARKET_DAGSTORE_START_001 - err = w.Start(ctx) - require.NoError(t, err) - - // Expect GC to be called automatically - //stm: @MARKET_DAGSTORE_START_002 - tctx, cancel := context.WithTimeout(ctx, time.Second) - defer cancel() - select { - case <-tctx.Done(): - require.Fail(t, "failed to call GC") - case <-mock.gc: - } - - // Expect that when the wrapper is closed it will call close on the - // DAG store - //stm: @MARKET_DAGSTORE_CLOSE_001 - err = w.Close() - require.NoError(t, err) - - tctx, cancel3 := context.WithTimeout(ctx, time.Second) - defer cancel3() - select { - case <-tctx.Done(): - require.Fail(t, "failed to call close") - case <-mock.close: - } -} - -type mockDagStore struct { - acquireShardErr chan error - acquireShardRes dagstore.ShardResult - register chan shard.Key - - gc chan struct{} - recover chan shard.Key - destroy chan shard.Key - close chan struct{} -} - -func (m *mockDagStore) GetIterableIndex(key shard.Key) (carindex.IterableIndex, error) { - return nil, nil -} - -func (m *mockDagStore) ShardsContainingMultihash(ctx context.Context, h mh.Multihash) ([]shard.Key, error) { - return nil, nil -} - -func (m *mockDagStore) GetShardKeysForCid(c cid.Cid) ([]shard.Key, error) { - panic("implement me") -} - -func (m *mockDagStore) DestroyShard(ctx context.Context, key shard.Key, out chan dagstore.ShardResult, _ dagstore.DestroyOpts) error { - m.destroy <- key - out <- dagstore.ShardResult{Key: key} - return nil -} - -func (m *mockDagStore) GetShardInfo(k shard.Key) (dagstore.ShardInfo, error) { - panic("implement me") -} - -func (m *mockDagStore) AllShardsInfo() dagstore.AllShardsInfo { - panic("implement me") -} - -func (m *mockDagStore) Start(_ context.Context) error { - return nil -} - -func (m *mockDagStore) RegisterShard(ctx context.Context, key shard.Key, mnt mount.Mount, out chan dagstore.ShardResult, opts dagstore.RegisterOpts) error { - m.register <- key - out <- dagstore.ShardResult{Key: key} - return nil -} - -func (m *mockDagStore) AcquireShard(ctx context.Context, key shard.Key, out chan dagstore.ShardResult, _ dagstore.AcquireOpts) error { - select { - case err := <-m.acquireShardErr: - return err - default: - } - - out <- m.acquireShardRes - return nil -} - -func (m *mockDagStore) RecoverShard(ctx context.Context, key shard.Key, out chan dagstore.ShardResult, _ dagstore.RecoverOpts) error { - m.recover <- key - return nil -} - -func (m *mockDagStore) GC(ctx context.Context) (*dagstore.GCResult, error) { - select { - case m.gc <- struct{}{}: - default: - } - - return nil, nil -} - -func (m *mockDagStore) Close() error { - m.close <- struct{}{} - return nil -} - -type mockLotusMount struct { -} - -func (m mockLotusMount) Start(ctx context.Context) error { - return nil -} - -func (m mockLotusMount) FetchUnsealedPiece(context.Context, cid.Cid) (mount.Reader, error) { - panic("implement me") -} - -func (m mockLotusMount) GetUnpaddedCARSize(ctx context.Context, pieceCid cid.Cid) (uint64, error) { - panic("implement me") -} - -func (m mockLotusMount) IsUnsealed(ctx context.Context, pieceCid cid.Cid) (bool, error) { - panic("implement me") -} - -func getShardAccessor(t *testing.T) *dagstore.ShardAccessor { - data, err := os.ReadFile("./fixtures/sample-rw-bs-v2.car") - require.NoError(t, err) - buff := bytes.NewReader(data) - reader := &mount.NopCloser{Reader: buff, ReaderAt: buff, Seeker: buff} - shardAccessor, err := dagstore.NewShardAccessor(reader, nil, nil) - require.NoError(t, err) - return shardAccessor -} diff --git a/markets/dealfilter/cli.go b/markets/dealfilter/cli.go deleted file mode 100644 index af832bfa08a..00000000000 --- a/markets/dealfilter/cli.go +++ /dev/null @@ -1,62 +0,0 @@ -package dealfilter - -import ( - "bytes" - "context" - "encoding/json" - "os/exec" - - "github.com/filecoin-project/go-fil-markets/retrievalmarket" - "github.com/filecoin-project/go-fil-markets/storagemarket" - - "github.com/filecoin-project/lotus/node/modules/dtypes" -) - -func CliStorageDealFilter(cmd string) dtypes.StorageDealFilter { - return func(ctx context.Context, deal storagemarket.MinerDeal) (bool, string, error) { - d := struct { - storagemarket.MinerDeal - DealType string - }{ - MinerDeal: deal, - DealType: "storage", - } - return runDealFilter(ctx, cmd, d) - } -} - -func CliRetrievalDealFilter(cmd string) dtypes.RetrievalDealFilter { - return func(ctx context.Context, deal retrievalmarket.ProviderDealState) (bool, string, error) { - d := struct { - retrievalmarket.ProviderDealState - DealType string - }{ - ProviderDealState: deal, - DealType: "retrieval", - } - return runDealFilter(ctx, cmd, d) - } -} - -func runDealFilter(ctx context.Context, cmd string, deal interface{}) (bool, string, error) { - j, err := json.MarshalIndent(deal, "", " ") - if err != nil { - return false, "", err - } - - var out bytes.Buffer - - c := exec.Command("sh", "-c", cmd) - c.Stdin = bytes.NewReader(j) - c.Stdout = &out - c.Stderr = &out - - switch err := c.Run().(type) { - case nil: - return true, "", nil - case *exec.ExitError: - return false, out.String(), nil - default: - return false, "filter cmd run error", err - } -} diff --git a/markets/idxprov/idxprov_test/noop.go b/markets/idxprov/idxprov_test/noop.go deleted file mode 100644 index 535c13d2522..00000000000 --- a/markets/idxprov/idxprov_test/noop.go +++ /dev/null @@ -1,16 +0,0 @@ -package idxprov_test - -import ( - "context" -) - -type NoopMeshCreator struct { -} - -func NewNoopMeshCreator() *NoopMeshCreator { - return &NoopMeshCreator{} -} - -func (mc NoopMeshCreator) Connect(ctx context.Context) error { - return nil -} diff --git a/markets/idxprov/mesh.go b/markets/idxprov/mesh.go deleted file mode 100644 index e69e213adab..00000000000 --- a/markets/idxprov/mesh.go +++ /dev/null @@ -1,59 +0,0 @@ -package idxprov - -import ( - "context" - "fmt" - - logging "github.com/ipfs/go-log/v2" - "github.com/libp2p/go-libp2p/core/host" - "github.com/libp2p/go-libp2p/core/peer" - - "github.com/filecoin-project/lotus/api/v1api" -) - -var log = logging.Logger("idxprov") - -const protectTag = "index-provider-gossipsub" - -type MeshCreator interface { - Connect(ctx context.Context) error -} - -type Libp2pMeshCreator struct { - fullnodeApi v1api.FullNode - marketsHost host.Host -} - -func (mc Libp2pMeshCreator) Connect(ctx context.Context) error { - - // Add the markets host ID to list of daemon's protected peers first, before any attempt to - // connect to full node over libp2p. - marketsPeerID := mc.marketsHost.ID() - if err := mc.fullnodeApi.NetProtectAdd(ctx, []peer.ID{marketsPeerID}); err != nil { - return fmt.Errorf("failed to call NetProtectAdd on the full node, err: %w", err) - } - - faddrs, err := mc.fullnodeApi.NetAddrsListen(ctx) - if err != nil { - return fmt.Errorf("failed to fetch full node listen addrs, err: %w", err) - } - - // Connect from the full node, ask it to protect the connection and protect the connection on - // markets end too. Connection is initiated form full node to avoid the need to expose libp2p port on full node - if err := mc.fullnodeApi.NetConnect(ctx, peer.AddrInfo{ - ID: mc.marketsHost.ID(), - Addrs: mc.marketsHost.Addrs(), - }); err != nil { - return fmt.Errorf("failed to connect to index provider host from full node: %w", err) - } - mc.marketsHost.ConnManager().Protect(faddrs.ID, protectTag) - - log.Debugw("successfully connected to full node and asked it protect indexer provider peer conn", "fullNodeInfo", faddrs.String(), - "peerId", marketsPeerID) - - return nil -} - -func NewMeshCreator(fullnodeApi v1api.FullNode, marketsHost host.Host) MeshCreator { - return Libp2pMeshCreator{fullnodeApi, marketsHost} -} diff --git a/markets/journal.go b/markets/journal.go deleted file mode 100644 index 9c9c5be9c42..00000000000 --- a/markets/journal.go +++ /dev/null @@ -1,76 +0,0 @@ -package markets - -import ( - "github.com/filecoin-project/go-fil-markets/retrievalmarket" - "github.com/filecoin-project/go-fil-markets/storagemarket" - - "github.com/filecoin-project/lotus/journal" -) - -type StorageClientEvt struct { - Event string - Deal storagemarket.ClientDeal -} - -type StorageProviderEvt struct { - Event string - Deal storagemarket.MinerDeal -} - -type RetrievalClientEvt struct { - Event string - Deal retrievalmarket.ClientDealState -} - -type RetrievalProviderEvt struct { - Event string - Deal retrievalmarket.ProviderDealState -} - -// StorageClientJournaler records journal events from the storage client. -func StorageClientJournaler(j journal.Journal, evtType journal.EventType) func(event storagemarket.ClientEvent, deal storagemarket.ClientDeal) { - return func(event storagemarket.ClientEvent, deal storagemarket.ClientDeal) { - j.RecordEvent(evtType, func() interface{} { - return StorageClientEvt{ - Event: storagemarket.ClientEvents[event], - Deal: deal, - } - }) - } -} - -// StorageProviderJournaler records journal events from the storage provider. -func StorageProviderJournaler(j journal.Journal, evtType journal.EventType) func(event storagemarket.ProviderEvent, deal storagemarket.MinerDeal) { - return func(event storagemarket.ProviderEvent, deal storagemarket.MinerDeal) { - j.RecordEvent(evtType, func() interface{} { - return StorageProviderEvt{ - Event: storagemarket.ProviderEvents[event], - Deal: deal, - } - }) - } -} - -// RetrievalClientJournaler records journal events from the retrieval client. -func RetrievalClientJournaler(j journal.Journal, evtType journal.EventType) func(event retrievalmarket.ClientEvent, deal retrievalmarket.ClientDealState) { - return func(event retrievalmarket.ClientEvent, deal retrievalmarket.ClientDealState) { - j.RecordEvent(evtType, func() interface{} { - return RetrievalClientEvt{ - Event: retrievalmarket.ClientEvents[event], - Deal: deal, - } - }) - } -} - -// RetrievalProviderJournaler records journal events from the retrieval provider. -func RetrievalProviderJournaler(j journal.Journal, evtType journal.EventType) func(event retrievalmarket.ProviderEvent, deal retrievalmarket.ProviderDealState) { - return func(event retrievalmarket.ProviderEvent, deal retrievalmarket.ProviderDealState) { - j.RecordEvent(evtType, func() interface{} { - return RetrievalProviderEvt{ - Event: retrievalmarket.ProviderEvents[event], - Deal: deal, - } - }) - } -} diff --git a/markets/loggers/loggers.go b/markets/loggers/loggers.go deleted file mode 100644 index e066c984399..00000000000 --- a/markets/loggers/loggers.go +++ /dev/null @@ -1,76 +0,0 @@ -package marketevents - -import ( - logging "github.com/ipfs/go-log/v2" - - datatransfer "github.com/filecoin-project/go-data-transfer/v2" - "github.com/filecoin-project/go-fil-markets/retrievalmarket" - "github.com/filecoin-project/go-fil-markets/storagemarket" - "github.com/filecoin-project/go-state-types/abi" -) - -var log = logging.Logger("markets") - -// StorageClientLogger logs events from the storage client -func StorageClientLogger(event storagemarket.ClientEvent, deal storagemarket.ClientDeal) { - log.Infow("storage client event", "name", storagemarket.ClientEvents[event], "proposal CID", deal.ProposalCid, "state", storagemarket.DealStates[deal.State], "message", deal.Message) -} - -// StorageProviderLogger logs events from the storage provider -func StorageProviderLogger(event storagemarket.ProviderEvent, deal storagemarket.MinerDeal) { - log.Infow("storage provider event", "name", storagemarket.ProviderEvents[event], "proposal CID", deal.ProposalCid, "state", storagemarket.DealStates[deal.State], "message", deal.Message) -} - -// RetrievalClientLogger logs events from the retrieval client -func RetrievalClientLogger(event retrievalmarket.ClientEvent, deal retrievalmarket.ClientDealState) { - method := log.Infow - if event == retrievalmarket.ClientEventBlocksReceived { - method = log.Debugw - } - method("retrieval client event", "name", retrievalmarket.ClientEvents[event], "deal ID", deal.ID, "state", retrievalmarket.DealStatuses[deal.Status], "message", deal.Message) -} - -// RetrievalProviderLogger logs events from the retrieval provider -func RetrievalProviderLogger(event retrievalmarket.ProviderEvent, deal retrievalmarket.ProviderDealState) { - method := log.Infow - if event == retrievalmarket.ProviderEventBlockSent { - method = log.Debugw - } - method("retrieval provider event", "name", retrievalmarket.ProviderEvents[event], "deal ID", deal.ID, "receiver", deal.Receiver, "state", retrievalmarket.DealStatuses[deal.Status], "message", deal.Message) -} - -// DataTransferLogger logs events from the data transfer module -func DataTransferLogger(event datatransfer.Event, state datatransfer.ChannelState) { - log.Debugw("data transfer event", - "name", datatransfer.Events[event.Code], - "status", datatransfer.Statuses[state.Status()], - "transfer ID", state.TransferID(), - "channel ID", state.ChannelID(), - "sent", state.Sent(), - "received", state.Received(), - "queued", state.Queued(), - "received count", state.ReceivedCidsTotal(), - "total size", state.TotalSize(), - "remote peer", state.OtherPeer(), - "event message", event.Message, - "channel message", state.Message()) -} - -// ReadyLogger returns a function to log the results of module initialization -func ReadyLogger(module string) func(error) { - return func(err error) { - if err != nil { - log.Errorw("module initialization error", "module", module, "err", err) - } else { - log.Infow("module ready", "module", module) - } - } -} - -type RetrievalEvent struct { - Event retrievalmarket.ClientEvent - Status retrievalmarket.DealStatus - BytesReceived uint64 - FundsSpent abi.TokenAmount - Err string -} diff --git a/markets/pricing/cli.go b/markets/pricing/cli.go deleted file mode 100644 index 48f56628fae..00000000000 --- a/markets/pricing/cli.go +++ /dev/null @@ -1,50 +0,0 @@ -package pricing - -import ( - "bytes" - "context" - "encoding/json" - "os/exec" - - "golang.org/x/xerrors" - - "github.com/filecoin-project/go-fil-markets/retrievalmarket" - - "github.com/filecoin-project/lotus/node/modules/dtypes" -) - -func ExternalRetrievalPricingFunc(cmd string) dtypes.RetrievalPricingFunc { - return func(ctx context.Context, pricingInput retrievalmarket.PricingInput) (retrievalmarket.Ask, error) { - return runPricingFunc(ctx, cmd, pricingInput) - } -} - -func runPricingFunc(_ context.Context, cmd string, params interface{}) (retrievalmarket.Ask, error) { - j, err := json.Marshal(params) - if err != nil { - return retrievalmarket.Ask{}, err - } - - var out bytes.Buffer - var errb bytes.Buffer - - c := exec.Command("sh", "-c", cmd) - c.Stdin = bytes.NewReader(j) - c.Stdout = &out - c.Stderr = &errb - - switch err := c.Run().(type) { - case nil: - bz := out.Bytes() - resp := retrievalmarket.Ask{} - - if err := json.Unmarshal(bz, &resp); err != nil { - return resp, xerrors.Errorf("failed to parse pricing output %s, err=%w", string(bz), err) - } - return resp, nil - case *exec.ExitError: - return retrievalmarket.Ask{}, xerrors.Errorf("pricing func exited with error: %s", errb.String()) - default: - return retrievalmarket.Ask{}, xerrors.Errorf("pricing func cmd run error: %w", err) - } -} diff --git a/markets/retrievaladapter/client.go b/markets/retrievaladapter/client.go deleted file mode 100644 index 34bc2489624..00000000000 --- a/markets/retrievaladapter/client.go +++ /dev/null @@ -1,127 +0,0 @@ -package retrievaladapter - -import ( - "context" - - "github.com/ipfs/go-cid" - "github.com/multiformats/go-multiaddr" - - "github.com/filecoin-project/go-address" - "github.com/filecoin-project/go-fil-markets/retrievalmarket" - "github.com/filecoin-project/go-fil-markets/shared" - "github.com/filecoin-project/go-state-types/abi" - paychtypes "github.com/filecoin-project/go-state-types/builtin/v8/paych" - - "github.com/filecoin-project/lotus/api" - "github.com/filecoin-project/lotus/chain/types" - "github.com/filecoin-project/lotus/node/impl/full" - payapi "github.com/filecoin-project/lotus/node/impl/paych" -) - -type retrievalClientNode struct { - forceOffChain bool - - chainAPI full.ChainAPI - payAPI payapi.PaychAPI - stateAPI full.StateAPI -} - -// NewRetrievalClientNode returns a new node adapter for a retrieval client that talks to the -// Lotus Node -func NewRetrievalClientNode(forceOffChain bool, payAPI payapi.PaychAPI, chainAPI full.ChainAPI, stateAPI full.StateAPI) retrievalmarket.RetrievalClientNode { - return &retrievalClientNode{ - forceOffChain: forceOffChain, - chainAPI: chainAPI, - payAPI: payAPI, - stateAPI: stateAPI, - } -} - -// GetOrCreatePaymentChannel sets up a new payment channel if one does not exist -// between a client and a miner and ensures the client has the given amount of -// funds available in the channel. -func (rcn *retrievalClientNode) GetOrCreatePaymentChannel(ctx context.Context, clientAddress address.Address, minerAddress address.Address, clientFundsAvailable abi.TokenAmount, tok shared.TipSetToken) (address.Address, cid.Cid, error) { - // TODO: respect the provided TipSetToken (a serialized TipSetKey) when - // querying the chain - ci, err := rcn.payAPI.PaychGet(ctx, clientAddress, minerAddress, clientFundsAvailable, api.PaychGetOpts{ - OffChain: rcn.forceOffChain, - }) - if err != nil { - log.Errorw("paych get failed", "error", err) - return address.Undef, cid.Undef, err - } - - return ci.Channel, ci.WaitSentinel, nil -} - -// Allocate late creates a lane within a payment channel so that calls to -// CreatePaymentVoucher will automatically make vouchers only for the difference -// in total -func (rcn *retrievalClientNode) AllocateLane(ctx context.Context, paymentChannel address.Address) (uint64, error) { - return rcn.payAPI.PaychAllocateLane(ctx, paymentChannel) -} - -// CreatePaymentVoucher creates a new payment voucher in the given lane for a -// given payment channel so that all the payment vouchers in the lane add up -// to the given amount (so the payment voucher will be for the difference) -func (rcn *retrievalClientNode) CreatePaymentVoucher(ctx context.Context, paymentChannel address.Address, amount abi.TokenAmount, lane uint64, tok shared.TipSetToken) (*paychtypes.SignedVoucher, error) { - // TODO: respect the provided TipSetToken (a serialized TipSetKey) when - // querying the chain - voucher, err := rcn.payAPI.PaychVoucherCreate(ctx, paymentChannel, amount, lane) - if err != nil { - return nil, err - } - if voucher.Voucher == nil { - return nil, retrievalmarket.NewShortfallError(voucher.Shortfall) - } - return voucher.Voucher, nil -} - -func (rcn *retrievalClientNode) GetChainHead(ctx context.Context) (shared.TipSetToken, abi.ChainEpoch, error) { - head, err := rcn.chainAPI.ChainHead(ctx) - if err != nil { - return nil, 0, err - } - - return head.Key().Bytes(), head.Height(), nil -} - -func (rcn *retrievalClientNode) WaitForPaymentChannelReady(ctx context.Context, messageCID cid.Cid) (address.Address, error) { - return rcn.payAPI.PaychGetWaitReady(ctx, messageCID) -} - -func (rcn *retrievalClientNode) CheckAvailableFunds(ctx context.Context, paymentChannel address.Address) (retrievalmarket.ChannelAvailableFunds, error) { - - channelAvailableFunds, err := rcn.payAPI.PaychAvailableFunds(ctx, paymentChannel) - if err != nil { - return retrievalmarket.ChannelAvailableFunds{}, err - } - return retrievalmarket.ChannelAvailableFunds{ - ConfirmedAmt: channelAvailableFunds.ConfirmedAmt, - PendingAmt: channelAvailableFunds.PendingAmt, - PendingWaitSentinel: channelAvailableFunds.PendingWaitSentinel, - QueuedAmt: channelAvailableFunds.QueuedAmt, - VoucherReedeemedAmt: channelAvailableFunds.VoucherReedeemedAmt, - }, nil -} - -func (rcn *retrievalClientNode) GetKnownAddresses(ctx context.Context, p retrievalmarket.RetrievalPeer, encodedTs shared.TipSetToken) ([]multiaddr.Multiaddr, error) { - tsk, err := types.TipSetKeyFromBytes(encodedTs) - if err != nil { - return nil, err - } - mi, err := rcn.stateAPI.StateMinerInfo(ctx, p.Address, tsk) - if err != nil { - return nil, err - } - multiaddrs := make([]multiaddr.Multiaddr, 0, len(mi.Multiaddrs)) - for _, a := range mi.Multiaddrs { - maddr, err := multiaddr.NewMultiaddrBytes(a) - if err != nil { - return nil, err - } - multiaddrs = append(multiaddrs, maddr) - } - - return multiaddrs, nil -} diff --git a/markets/retrievaladapter/client_blockstore.go b/markets/retrievaladapter/client_blockstore.go deleted file mode 100644 index 30fc5c73a5b..00000000000 --- a/markets/retrievaladapter/client_blockstore.go +++ /dev/null @@ -1,166 +0,0 @@ -package retrievaladapter - -import ( - "fmt" - "path/filepath" - "sync" - - bstore "github.com/ipfs/boxo/blockstore" - "github.com/ipfs/go-cid" - "github.com/ipld/go-car/v2/blockstore" - "golang.org/x/xerrors" - - "github.com/filecoin-project/go-fil-markets/retrievalmarket" - - "github.com/filecoin-project/lotus/api" - lbstore "github.com/filecoin-project/lotus/blockstore" -) - -// ProxyBlockstoreAccessor is an accessor that returns a fixed blockstore. -// To be used in combination with IPFS integration. -type ProxyBlockstoreAccessor struct { - Blockstore bstore.Blockstore -} - -var _ retrievalmarket.BlockstoreAccessor = (*ProxyBlockstoreAccessor)(nil) - -func NewFixedBlockstoreAccessor(bs bstore.Blockstore) retrievalmarket.BlockstoreAccessor { - return &ProxyBlockstoreAccessor{Blockstore: bs} -} - -func (p *ProxyBlockstoreAccessor) Get(_ retrievalmarket.DealID, _ retrievalmarket.PayloadCID) (bstore.Blockstore, error) { - return p.Blockstore, nil -} - -func (p *ProxyBlockstoreAccessor) Done(_ retrievalmarket.DealID) error { - return nil -} - -func NewAPIBlockstoreAdapter(sub retrievalmarket.BlockstoreAccessor) *APIBlockstoreAccessor { - return &APIBlockstoreAccessor{ - sub: sub, - retrStores: map[retrievalmarket.DealID]api.RemoteStoreID{}, - remoteStores: map[api.RemoteStoreID]bstore.Blockstore{}, - } -} - -// APIBlockstoreAccessor adds support to API-specified remote blockstores -type APIBlockstoreAccessor struct { - sub retrievalmarket.BlockstoreAccessor - - retrStores map[retrievalmarket.DealID]api.RemoteStoreID - remoteStores map[api.RemoteStoreID]bstore.Blockstore - - accessLk sync.Mutex -} - -func (a *APIBlockstoreAccessor) Get(id retrievalmarket.DealID, payloadCID retrievalmarket.PayloadCID) (bstore.Blockstore, error) { - a.accessLk.Lock() - defer a.accessLk.Unlock() - - as, has := a.retrStores[id] - if !has { - return a.sub.Get(id, payloadCID) - } - - return a.remoteStores[as], nil -} - -func (a *APIBlockstoreAccessor) Done(id retrievalmarket.DealID) error { - a.accessLk.Lock() - defer a.accessLk.Unlock() - - if _, has := a.retrStores[id]; has { - delete(a.retrStores, id) - return nil - } - return a.sub.Done(id) -} - -func (a *APIBlockstoreAccessor) RegisterDealToRetrievalStore(id retrievalmarket.DealID, sid api.RemoteStoreID) error { - a.accessLk.Lock() - defer a.accessLk.Unlock() - - if _, has := a.retrStores[id]; has { - return xerrors.Errorf("apistore for deal %d already registered", id) - } - if _, has := a.remoteStores[sid]; !has { - return xerrors.Errorf("remote store not found") - } - - a.retrStores[id] = sid - return nil -} - -func (a *APIBlockstoreAccessor) RegisterApiStore(sid api.RemoteStoreID, st *lbstore.NetworkStore) error { - a.accessLk.Lock() - defer a.accessLk.Unlock() - - if _, has := a.remoteStores[sid]; has { - return xerrors.Errorf("remote store already registered with this uuid") - } - - a.remoteStores[sid] = st - - st.OnClose(func() { - a.accessLk.Lock() - defer a.accessLk.Unlock() - - if _, has := a.remoteStores[sid]; has { - delete(a.remoteStores, sid) - } - }) - return nil -} - -var _ retrievalmarket.BlockstoreAccessor = &APIBlockstoreAccessor{} - -type CARBlockstoreAccessor struct { - rootdir string - lk sync.Mutex - open map[retrievalmarket.DealID]*blockstore.ReadWrite -} - -var _ retrievalmarket.BlockstoreAccessor = (*CARBlockstoreAccessor)(nil) - -func NewCARBlockstoreAccessor(rootdir string) *CARBlockstoreAccessor { - return &CARBlockstoreAccessor{ - rootdir: rootdir, - open: make(map[retrievalmarket.DealID]*blockstore.ReadWrite), - } -} - -func (c *CARBlockstoreAccessor) Get(id retrievalmarket.DealID, payloadCid retrievalmarket.PayloadCID) (bstore.Blockstore, error) { - c.lk.Lock() - defer c.lk.Unlock() - - bs, ok := c.open[id] - if ok { - return bs, nil - } - - path := c.PathFor(id) - bs, err := blockstore.OpenReadWrite(path, []cid.Cid{payloadCid}, blockstore.UseWholeCIDs(true)) - if err != nil { - return nil, err - } - c.open[id] = bs - return bs, nil -} - -func (c *CARBlockstoreAccessor) Done(id retrievalmarket.DealID) error { - c.lk.Lock() - defer c.lk.Unlock() - - bs, ok := c.open[id] - if !ok { - return nil - } - - delete(c.open, id) - return bs.Finalize() -} - -func (c *CARBlockstoreAccessor) PathFor(id retrievalmarket.DealID) string { - return filepath.Join(c.rootdir, fmt.Sprintf("%d.car", id)) -} diff --git a/markets/retrievaladapter/provider.go b/markets/retrievaladapter/provider.go deleted file mode 100644 index 453474d4e6e..00000000000 --- a/markets/retrievaladapter/provider.go +++ /dev/null @@ -1,108 +0,0 @@ -package retrievaladapter - -import ( - "context" - - "github.com/hashicorp/go-multierror" - "github.com/ipfs/go-cid" - logging "github.com/ipfs/go-log/v2" - "golang.org/x/xerrors" - - "github.com/filecoin-project/go-address" - "github.com/filecoin-project/go-fil-markets/retrievalmarket" - "github.com/filecoin-project/go-fil-markets/shared" - "github.com/filecoin-project/go-state-types/abi" - paychtypes "github.com/filecoin-project/go-state-types/builtin/v8/paych" - - "github.com/filecoin-project/lotus/api/v1api" - "github.com/filecoin-project/lotus/chain/types" -) - -var log = logging.Logger("retrievaladapter") - -type retrievalProviderNode struct { - full v1api.FullNode -} - -var _ retrievalmarket.RetrievalProviderNode = (*retrievalProviderNode)(nil) - -// NewRetrievalProviderNode returns a new node adapter for a retrieval provider that talks to the -// Lotus Node -func NewRetrievalProviderNode(full v1api.FullNode) retrievalmarket.RetrievalProviderNode { - return &retrievalProviderNode{full: full} -} - -func (rpn *retrievalProviderNode) GetMinerWorkerAddress(ctx context.Context, miner address.Address, tok shared.TipSetToken) (address.Address, error) { - tsk, err := types.TipSetKeyFromBytes(tok) - if err != nil { - return address.Undef, err - } - - mi, err := rpn.full.StateMinerInfo(ctx, miner, tsk) - return mi.Worker, err -} - -func (rpn *retrievalProviderNode) SavePaymentVoucher(ctx context.Context, paymentChannel address.Address, voucher *paychtypes.SignedVoucher, proof []byte, expectedAmount abi.TokenAmount, tok shared.TipSetToken) (abi.TokenAmount, error) { - // TODO: respect the provided TipSetToken (a serialized TipSetKey) when - // querying the chain - added, err := rpn.full.PaychVoucherAdd(ctx, paymentChannel, voucher, proof, expectedAmount) - return added, err -} - -func (rpn *retrievalProviderNode) GetChainHead(ctx context.Context) (shared.TipSetToken, abi.ChainEpoch, error) { - head, err := rpn.full.ChainHead(ctx) - if err != nil { - return nil, 0, err - } - - return head.Key().Bytes(), head.Height(), nil -} - -// GetRetrievalPricingInput takes a set of candidate storage deals that can serve a retrieval request, -// and returns an minimally populated PricingInput. This PricingInput should be enhanced -// with more data, and passed to the pricing function to determine the final quoted price. -func (rpn *retrievalProviderNode) GetRetrievalPricingInput(ctx context.Context, pieceCID cid.Cid, storageDeals []abi.DealID) (retrievalmarket.PricingInput, error) { - resp := retrievalmarket.PricingInput{} - - head, err := rpn.full.ChainHead(ctx) - if err != nil { - return resp, xerrors.Errorf("failed to get chain head: %w", err) - } - tsk := head.Key() - - var mErr error - - for _, dealID := range storageDeals { - ds, err := rpn.full.StateMarketStorageDeal(ctx, dealID, tsk) - if err != nil { - log.Warnf("failed to look up deal %d on chain: err=%w", dealID, err) - mErr = multierror.Append(mErr, err) - continue - } - if ds.Proposal.VerifiedDeal { - resp.VerifiedDeal = true - } - - if ds.Proposal.PieceCID.Equals(pieceCID) { - resp.PieceSize = ds.Proposal.PieceSize.Unpadded() - } - - // If we've discovered a verified deal with the required PieceCID, we don't need - // to lookup more deals and we're done. - if resp.VerifiedDeal && resp.PieceSize != 0 { - break - } - } - - // Note: The piece size can never actually be zero. We only use it to here - // to assert that we didn't find a matching piece. - if resp.PieceSize == 0 { - if mErr == nil { - return resp, xerrors.New("failed to find matching piece") - } - - return resp, xerrors.Errorf("failed to fetch storage deal state: %w", mErr) - } - - return resp, nil -} diff --git a/markets/retrievaladapter/provider_test.go b/markets/retrievaladapter/provider_test.go deleted file mode 100644 index b7b5039d674..00000000000 --- a/markets/retrievaladapter/provider_test.go +++ /dev/null @@ -1,206 +0,0 @@ -// stm: #unit -package retrievaladapter - -import ( - "context" - "testing" - - "github.com/golang/mock/gomock" - "github.com/ipfs/go-cid" - "github.com/stretchr/testify/require" - "golang.org/x/xerrors" - - "github.com/filecoin-project/go-fil-markets/retrievalmarket" - testnet "github.com/filecoin-project/go-fil-markets/shared_testutil" - "github.com/filecoin-project/go-state-types/abi" - - "github.com/filecoin-project/lotus/api" - "github.com/filecoin-project/lotus/api/mocks" - "github.com/filecoin-project/lotus/chain/actors/builtin/market" - "github.com/filecoin-project/lotus/chain/types" -) - -func TestGetPricingInput(t *testing.T) { - //stm: @CHAIN_STATE_MARKET_STORAGE_DEAL_001 - ctx := context.Background() - tsk := &types.TipSet{} - key := tsk.Key() - - pcid := testnet.GenerateCids(1)[0] - deals := []abi.DealID{1, 2} - paddedSize := abi.PaddedPieceSize(128) - unpaddedSize := paddedSize.Unpadded() - - tcs := map[string]struct { - pieceCid cid.Cid - deals []abi.DealID - fFnc func(node *mocks.MockFullNode) - - expectedErrorStr string - expectedVerified bool - expectedPieceSize abi.UnpaddedPieceSize - }{ - "error when fails to fetch chain head": { - fFnc: func(n *mocks.MockFullNode) { - n.EXPECT().ChainHead(gomock.Any()).Return(tsk, xerrors.New("chain head error")).Times(1) - }, - expectedErrorStr: "chain head error", - }, - - "error when no piece matches": { - fFnc: func(n *mocks.MockFullNode) { - out1 := &api.MarketDeal{ - Proposal: market.DealProposal{ - PieceCID: testnet.GenerateCids(1)[0], - }, - } - out2 := &api.MarketDeal{ - Proposal: market.DealProposal{ - PieceCID: testnet.GenerateCids(1)[0], - }, - } - - n.EXPECT().ChainHead(gomock.Any()).Return(tsk, nil).Times(1) - gomock.InOrder( - n.EXPECT().StateMarketStorageDeal(gomock.Any(), deals[0], key).Return(out1, nil), - n.EXPECT().StateMarketStorageDeal(gomock.Any(), deals[1], key).Return(out2, nil), - ) - - }, - expectedErrorStr: "failed to find matching piece", - }, - - "error when fails to fetch deal state": { - fFnc: func(n *mocks.MockFullNode) { - out1 := &api.MarketDeal{ - Proposal: market.DealProposal{ - PieceCID: pcid, - PieceSize: paddedSize, - }, - } - out2 := &api.MarketDeal{ - Proposal: market.DealProposal{ - PieceCID: testnet.GenerateCids(1)[0], - VerifiedDeal: true, - }, - } - - n.EXPECT().ChainHead(gomock.Any()).Return(tsk, nil).Times(1) - gomock.InOrder( - n.EXPECT().StateMarketStorageDeal(gomock.Any(), deals[0], key).Return(out1, xerrors.New("error 1")), - n.EXPECT().StateMarketStorageDeal(gomock.Any(), deals[1], key).Return(out2, xerrors.New("error 2")), - ) - - }, - expectedErrorStr: "failed to fetch storage deal state", - }, - - "verified is true even if one deal is verified and we get the correct piecesize": { - fFnc: func(n *mocks.MockFullNode) { - out1 := &api.MarketDeal{ - Proposal: market.DealProposal{ - PieceCID: pcid, - PieceSize: paddedSize, - }, - } - out2 := &api.MarketDeal{ - Proposal: market.DealProposal{ - PieceCID: testnet.GenerateCids(1)[0], - VerifiedDeal: true, - }, - } - - n.EXPECT().ChainHead(gomock.Any()).Return(tsk, nil).Times(1) - gomock.InOrder( - n.EXPECT().StateMarketStorageDeal(gomock.Any(), deals[0], key).Return(out1, nil), - n.EXPECT().StateMarketStorageDeal(gomock.Any(), deals[1], key).Return(out2, nil), - ) - - }, - expectedPieceSize: unpaddedSize, - expectedVerified: true, - }, - - "success even if one deal state fetch errors out but the other deal is verified and has the required piececid": { - fFnc: func(n *mocks.MockFullNode) { - out1 := &api.MarketDeal{ - Proposal: market.DealProposal{ - PieceCID: testnet.GenerateCids(1)[0], - }, - } - out2 := &api.MarketDeal{ - Proposal: market.DealProposal{ - PieceCID: pcid, - PieceSize: paddedSize, - VerifiedDeal: true, - }, - } - - n.EXPECT().ChainHead(gomock.Any()).Return(tsk, nil).Times(1) - gomock.InOrder( - n.EXPECT().StateMarketStorageDeal(gomock.Any(), deals[0], key).Return(out1, xerrors.New("some error")), - n.EXPECT().StateMarketStorageDeal(gomock.Any(), deals[1], key).Return(out2, nil), - ) - - }, - expectedPieceSize: unpaddedSize, - expectedVerified: true, - }, - - "verified is false if both deals are unverified and we get the correct piece size": { - fFnc: func(n *mocks.MockFullNode) { - out1 := &api.MarketDeal{ - Proposal: market.DealProposal{ - PieceCID: pcid, - PieceSize: paddedSize, - VerifiedDeal: false, - }, - } - out2 := &api.MarketDeal{ - Proposal: market.DealProposal{ - PieceCID: testnet.GenerateCids(1)[0], - VerifiedDeal: false, - }, - } - - n.EXPECT().ChainHead(gomock.Any()).Return(tsk, nil).Times(1) - gomock.InOrder( - n.EXPECT().StateMarketStorageDeal(gomock.Any(), deals[0], key).Return(out1, nil), - n.EXPECT().StateMarketStorageDeal(gomock.Any(), deals[1], key).Return(out2, nil), - ) - - }, - expectedPieceSize: unpaddedSize, - expectedVerified: false, - }, - } - - for name, tc := range tcs { - tc := tc - t.Run(name, func(t *testing.T) { - mockCtrl := gomock.NewController(t) - // when test is done, assert expectations on all mock objects. - defer mockCtrl.Finish() - - mockFull := mocks.NewMockFullNode(mockCtrl) - rpn := &retrievalProviderNode{ - full: mockFull, - } - if tc.fFnc != nil { - tc.fFnc(mockFull) - } - - resp, err := rpn.GetRetrievalPricingInput(ctx, pcid, deals) - - if tc.expectedErrorStr != "" { - require.Error(t, err) - require.Contains(t, err.Error(), tc.expectedErrorStr) - require.Equal(t, retrievalmarket.PricingInput{}, resp) - } else { - require.NoError(t, err) - require.Equal(t, tc.expectedPieceSize, resp.PieceSize) - require.Equal(t, tc.expectedVerified, resp.VerifiedDeal) - } - }) - } -} diff --git a/markets/sectoraccessor/sectoraccessor.go b/markets/sectoraccessor/sectoraccessor.go deleted file mode 100644 index 9b709d3b5ff..00000000000 --- a/markets/sectoraccessor/sectoraccessor.go +++ /dev/null @@ -1,136 +0,0 @@ -package sectoraccessor - -import ( - "context" - "io" - - "github.com/ipfs/go-cid" - logging "github.com/ipfs/go-log/v2" - "golang.org/x/xerrors" - - "github.com/filecoin-project/dagstore/mount" - "github.com/filecoin-project/go-address" - "github.com/filecoin-project/go-fil-markets/retrievalmarket" - "github.com/filecoin-project/go-state-types/abi" - - "github.com/filecoin-project/lotus/api" - "github.com/filecoin-project/lotus/api/v1api" - "github.com/filecoin-project/lotus/chain/types" - "github.com/filecoin-project/lotus/markets/dagstore" - "github.com/filecoin-project/lotus/node/modules/dtypes" - "github.com/filecoin-project/lotus/storage/sealer" - "github.com/filecoin-project/lotus/storage/sealer/storiface" - "github.com/filecoin-project/lotus/storage/sectorblocks" -) - -var log = logging.Logger("sectoraccessor") - -type sectorAccessor struct { - maddr address.Address - secb sectorblocks.SectorBuilder - pp sealer.PieceProvider - full v1api.FullNode -} - -var _ retrievalmarket.SectorAccessor = (*sectorAccessor)(nil) - -func NewSectorAccessor(maddr dtypes.MinerAddress, secb sectorblocks.SectorBuilder, pp sealer.PieceProvider, full v1api.FullNode) dagstore.SectorAccessor { - return §orAccessor{address.Address(maddr), secb, pp, full} -} - -func (sa *sectorAccessor) UnsealSector(ctx context.Context, sectorID abi.SectorNumber, pieceOffset abi.UnpaddedPieceSize, length abi.UnpaddedPieceSize) (io.ReadCloser, error) { - return sa.UnsealSectorAt(ctx, sectorID, pieceOffset, length) -} - -func (sa *sectorAccessor) UnsealSectorAt(ctx context.Context, sectorID abi.SectorNumber, pieceOffset abi.UnpaddedPieceSize, length abi.UnpaddedPieceSize) (mount.Reader, error) { - log.Debugf("get sector %d, pieceOffset %d, length %d", sectorID, pieceOffset, length) - si, err := sa.sectorsStatus(ctx, sectorID, false) - if err != nil { - return nil, err - } - - mid, err := address.IDFromAddress(sa.maddr) - if err != nil { - return nil, err - } - - ref := storiface.SectorRef{ - ID: abi.SectorID{ - Miner: abi.ActorID(mid), - Number: sectorID, - }, - ProofType: si.SealProof, - } - - var commD cid.Cid - if si.CommD != nil { - commD = *si.CommD - } - - // Get a reader for the piece, unsealing the piece if necessary - log.Debugf("read piece in sector %d, pieceOffset %d, length %d from miner %d", sectorID, pieceOffset, length, mid) - r, unsealed, err := sa.pp.ReadPiece(ctx, ref, storiface.UnpaddedByteIndex(pieceOffset), length, si.Ticket.Value, commD) - if err != nil { - return nil, xerrors.Errorf("failed to unseal piece from sector %d: %w", sectorID, err) - } - _ = unsealed // todo: use - - return r, nil -} - -func (sa *sectorAccessor) IsUnsealed(ctx context.Context, sectorID abi.SectorNumber, offset abi.UnpaddedPieceSize, length abi.UnpaddedPieceSize) (bool, error) { - si, err := sa.sectorsStatus(ctx, sectorID, true) - if err != nil { - return false, xerrors.Errorf("failed to get sector info: %w", err) - } - - mid, err := address.IDFromAddress(sa.maddr) - if err != nil { - return false, err - } - - ref := storiface.SectorRef{ - ID: abi.SectorID{ - Miner: abi.ActorID(mid), - Number: sectorID, - }, - ProofType: si.SealProof, - } - - log.Debugf("will call IsUnsealed now sector=%+v, offset=%d, size=%d", sectorID, offset, length) - return sa.pp.IsUnsealed(ctx, ref, storiface.UnpaddedByteIndex(offset), length) -} - -func (sa *sectorAccessor) sectorsStatus(ctx context.Context, sid abi.SectorNumber, showOnChainInfo bool) (api.SectorInfo, error) { - sInfo, err := sa.secb.SectorsStatus(ctx, sid, false) - if err != nil { - return api.SectorInfo{}, err - } - - if !showOnChainInfo { - return sInfo, nil - } - - onChainInfo, err := sa.full.StateSectorGetInfo(ctx, sa.maddr, sid, types.EmptyTSK) - if err != nil { - return sInfo, err - } - if onChainInfo == nil { - return sInfo, nil - } - sInfo.SealProof = onChainInfo.SealProof - sInfo.Activation = onChainInfo.Activation - sInfo.Expiration = onChainInfo.Expiration - sInfo.DealWeight = onChainInfo.DealWeight - sInfo.VerifiedDealWeight = onChainInfo.VerifiedDealWeight - sInfo.InitialPledge = onChainInfo.InitialPledge - - ex, err := sa.full.StateSectorExpiration(ctx, sa.maddr, sid, types.EmptyTSK) - if err != nil { - return sInfo, nil - } - sInfo.OnTime = ex.OnTime - sInfo.Early = ex.Early - - return sInfo, nil -} diff --git a/markets/storageadapter/api.go b/markets/storageadapter/api.go deleted file mode 100644 index b93ffdfbb16..00000000000 --- a/markets/storageadapter/api.go +++ /dev/null @@ -1,55 +0,0 @@ -package storageadapter - -import ( - "context" - - blocks "github.com/ipfs/go-block-format" - "github.com/ipfs/go-cid" - cbor "github.com/ipfs/go-ipld-cbor" - "golang.org/x/xerrors" - - "github.com/filecoin-project/go-address" - - "github.com/filecoin-project/lotus/blockstore" - "github.com/filecoin-project/lotus/chain/actors/adt" - "github.com/filecoin-project/lotus/chain/actors/builtin/miner" - "github.com/filecoin-project/lotus/chain/types" -) - -type apiWrapper struct { - api interface { - StateGetActor(ctx context.Context, actor address.Address, tsk types.TipSetKey) (*types.Actor, error) - ChainReadObj(context.Context, cid.Cid) ([]byte, error) - ChainHasObj(context.Context, cid.Cid) (bool, error) - ChainPutObj(context.Context, blocks.Block) error - } -} - -func (ca *apiWrapper) diffPreCommits(ctx context.Context, actor address.Address, pre, cur types.TipSetKey) (*miner.PreCommitChanges, error) { - store := adt.WrapStore(ctx, cbor.NewCborStore(blockstore.NewAPIBlockstore(ca.api))) - - preAct, err := ca.api.StateGetActor(ctx, actor, pre) - if err != nil { - return nil, xerrors.Errorf("getting pre actor: %w", err) - } - curAct, err := ca.api.StateGetActor(ctx, actor, cur) - if err != nil { - return nil, xerrors.Errorf("getting cur actor: %w", err) - } - - preSt, err := miner.Load(store, preAct) - if err != nil { - return nil, xerrors.Errorf("loading miner actor: %w", err) - } - curSt, err := miner.Load(store, curAct) - if err != nil { - return nil, xerrors.Errorf("loading miner actor: %w", err) - } - - diff, err := miner.DiffPreCommits(preSt, curSt) - if err != nil { - return nil, xerrors.Errorf("diff precommits: %w", err) - } - - return diff, err -} diff --git a/markets/storageadapter/client.go b/markets/storageadapter/client.go deleted file mode 100644 index eaff4e166a3..00000000000 --- a/markets/storageadapter/client.go +++ /dev/null @@ -1,446 +0,0 @@ -package storageadapter - -// this file implements storagemarket.StorageClientNode - -import ( - "bytes" - "context" - - "github.com/ipfs/go-cid" - "go.uber.org/fx" - "golang.org/x/xerrors" - - "github.com/filecoin-project/go-address" - cborutil "github.com/filecoin-project/go-cbor-util" - "github.com/filecoin-project/go-fil-markets/shared" - "github.com/filecoin-project/go-fil-markets/storagemarket" - "github.com/filecoin-project/go-state-types/abi" - "github.com/filecoin-project/go-state-types/big" - markettypes "github.com/filecoin-project/go-state-types/builtin/v9/market" - "github.com/filecoin-project/go-state-types/crypto" - "github.com/filecoin-project/go-state-types/exitcode" - builtin6 "github.com/filecoin-project/specs-actors/v6/actors/builtin" - - "github.com/filecoin-project/lotus/api" - "github.com/filecoin-project/lotus/build" - marketactor "github.com/filecoin-project/lotus/chain/actors/builtin/market" - "github.com/filecoin-project/lotus/chain/events" - "github.com/filecoin-project/lotus/chain/events/state" - "github.com/filecoin-project/lotus/chain/market" - "github.com/filecoin-project/lotus/chain/types" - "github.com/filecoin-project/lotus/lib/sigs" - "github.com/filecoin-project/lotus/markets/utils" - "github.com/filecoin-project/lotus/node/impl/full" - "github.com/filecoin-project/lotus/node/modules/helpers" -) - -type ClientNodeAdapter struct { - *clientApi - - fundmgr *market.FundManager - ev *events.Events - dsMatcher *dealStateMatcher - scMgr *SectorCommittedManager -} - -type clientApi struct { - full.ChainAPI - full.StateAPI - full.MpoolAPI -} - -func NewClientNodeAdapter(mctx helpers.MetricsCtx, lc fx.Lifecycle, stateapi full.StateAPI, chain full.ChainAPI, mpool full.MpoolAPI, fundmgr *market.FundManager) (storagemarket.StorageClientNode, error) { - capi := &clientApi{chain, stateapi, mpool} - ctx := helpers.LifecycleCtx(mctx, lc) - - ev, err := events.NewEvents(ctx, capi) - if err != nil { - return nil, err - } - a := &ClientNodeAdapter{ - clientApi: capi, - - fundmgr: fundmgr, - ev: ev, - dsMatcher: newDealStateMatcher(state.NewStatePredicates(state.WrapFastAPI(capi))), - } - a.scMgr = NewSectorCommittedManager(ev, a, &apiWrapper{api: capi}) - return a, nil -} - -func (c *ClientNodeAdapter) ListStorageProviders(ctx context.Context, encodedTs shared.TipSetToken) ([]*storagemarket.StorageProviderInfo, error) { - tsk, err := types.TipSetKeyFromBytes(encodedTs) - if err != nil { - return nil, err - } - - addresses, err := c.StateListMiners(ctx, tsk) - if err != nil { - return nil, err - } - - var out []*storagemarket.StorageProviderInfo - - for _, addr := range addresses { - mi, err := c.GetMinerInfo(ctx, addr, encodedTs) - if err != nil { - return nil, err - } - - out = append(out, mi) - } - - return out, nil -} - -func (c *ClientNodeAdapter) VerifySignature(ctx context.Context, sig crypto.Signature, addr address.Address, input []byte, encodedTs shared.TipSetToken) (bool, error) { - addr, err := c.StateAccountKey(ctx, addr, types.EmptyTSK) - if err != nil { - return false, err - } - - err = sigs.Verify(&sig, addr, input) - return err == nil, err -} - -// Adds funds with the StorageMinerActor for a storage participant. Used by both providers and clients. -func (c *ClientNodeAdapter) AddFunds(ctx context.Context, addr address.Address, amount abi.TokenAmount) (cid.Cid, error) { - // (Provider Node API) - smsg, err := c.MpoolPushMessage(ctx, &types.Message{ - To: marketactor.Address, - From: addr, - Value: amount, - Method: builtin6.MethodsMarket.AddBalance, - }, nil) - if err != nil { - return cid.Undef, err - } - - return smsg.Cid(), nil -} - -func (c *ClientNodeAdapter) ReserveFunds(ctx context.Context, wallet, addr address.Address, amt abi.TokenAmount) (cid.Cid, error) { - return c.fundmgr.Reserve(ctx, wallet, addr, amt) -} - -func (c *ClientNodeAdapter) ReleaseFunds(ctx context.Context, addr address.Address, amt abi.TokenAmount) error { - return c.fundmgr.Release(addr, amt) -} - -func (c *ClientNodeAdapter) GetBalance(ctx context.Context, addr address.Address, encodedTs shared.TipSetToken) (storagemarket.Balance, error) { - tsk, err := types.TipSetKeyFromBytes(encodedTs) - if err != nil { - return storagemarket.Balance{}, err - } - - bal, err := c.StateMarketBalance(ctx, addr, tsk) - if err != nil { - return storagemarket.Balance{}, err - } - - return utils.ToSharedBalance(bal), nil -} - -// ValidatePublishedDeal validates that the provided deal has appeared on chain and references the same ClientDeal -// returns the Deal id if there is no error -// TODO: Don't return deal ID -func (c *ClientNodeAdapter) ValidatePublishedDeal(ctx context.Context, deal storagemarket.ClientDeal) (abi.DealID, error) { - log.Infow("DEAL ACCEPTED!") - - pubmsg, err := c.ChainGetMessage(ctx, *deal.PublishMessage) - if err != nil { - return 0, xerrors.Errorf("getting deal publish message: %w", err) - } - - mi, err := c.StateMinerInfo(ctx, deal.Proposal.Provider, types.EmptyTSK) - if err != nil { - return 0, xerrors.Errorf("getting miner worker failed: %w", err) - } - - fromid, err := c.StateLookupID(ctx, pubmsg.From, types.EmptyTSK) - if err != nil { - return 0, xerrors.Errorf("failed to resolve from msg ID addr: %w", err) - } - - var pubOk bool - pubAddrs := append([]address.Address{mi.Worker, mi.Owner}, mi.ControlAddresses...) - for _, a := range pubAddrs { - if fromid == a { - pubOk = true - break - } - } - - if !pubOk { - return 0, xerrors.Errorf("deal wasn't published by storage provider: from=%s, provider=%s,%+v", pubmsg.From, deal.Proposal.Provider, pubAddrs) - } - - if pubmsg.To != marketactor.Address { - return 0, xerrors.Errorf("deal publish message wasn't set to StorageMarket actor (to=%s)", pubmsg.To) - } - - if pubmsg.Method != builtin6.MethodsMarket.PublishStorageDeals { - return 0, xerrors.Errorf("deal publish message called incorrect method (method=%s)", pubmsg.Method) - } - - var params markettypes.PublishStorageDealsParams - if err := params.UnmarshalCBOR(bytes.NewReader(pubmsg.Params)); err != nil { - return 0, err - } - - dealIdx := -1 - for i, storageDeal := range params.Deals { - // TODO: make it less hacky - sd := storageDeal - eq, err := cborutil.Equals(&deal.ClientDealProposal, &sd) - if err != nil { - return 0, err - } - if eq { - dealIdx = i - break - } - } - - if dealIdx == -1 { - return 0, xerrors.Errorf("deal publish didn't contain our deal (message cid: %s)", deal.PublishMessage) - } - - // TODO: timeout - ret, err := c.StateWaitMsg(ctx, *deal.PublishMessage, build.MessageConfidence, api.LookbackNoLimit, true) - if err != nil { - return 0, xerrors.Errorf("waiting for deal publish message: %w", err) - } - if ret.Receipt.ExitCode != 0 { - return 0, xerrors.Errorf("deal publish failed: exit=%d", ret.Receipt.ExitCode) - } - - nv, err := c.StateNetworkVersion(ctx, ret.TipSet) - if err != nil { - return 0, xerrors.Errorf("getting network version: %w", err) - } - - res, err := marketactor.DecodePublishStorageDealsReturn(ret.Receipt.Return, nv) - if err != nil { - return 0, xerrors.Errorf("decoding deal publish return: %w", err) - } - - dealIDs, err := res.DealIDs() - if err != nil { - return 0, xerrors.Errorf("getting dealIDs: %w", err) - } - - if dealIdx >= len(params.Deals) { - return 0, xerrors.Errorf( - "deal index %d out of bounds of deals (len %d) in publish deals message %s", - dealIdx, len(params.Deals), pubmsg.Cid()) - } - - valid, outIdx, err := res.IsDealValid(uint64(dealIdx)) - if err != nil { - return 0, xerrors.Errorf("determining deal validity: %w", err) - } - - if !valid { - return 0, xerrors.New("deal was invalid at publication") - } - - return dealIDs[outIdx], nil -} - -var clientOverestimation = struct { - numerator int64 - denominator int64 -}{ - numerator: 12, - denominator: 10, -} - -func (c *ClientNodeAdapter) DealProviderCollateralBounds(ctx context.Context, size abi.PaddedPieceSize, isVerified bool) (abi.TokenAmount, abi.TokenAmount, error) { - bounds, err := c.StateDealProviderCollateralBounds(ctx, size, isVerified, types.EmptyTSK) - if err != nil { - return abi.TokenAmount{}, abi.TokenAmount{}, err - } - - min := big.Mul(bounds.Min, big.NewInt(clientOverestimation.numerator)) - min = big.Div(min, big.NewInt(clientOverestimation.denominator)) - return min, bounds.Max, nil -} - -// TODO: Remove dealID parameter, change publishCid to be cid.Cid (instead of pointer) -func (c *ClientNodeAdapter) OnDealSectorPreCommitted(ctx context.Context, provider address.Address, dealID abi.DealID, proposal markettypes.DealProposal, publishCid *cid.Cid, cb storagemarket.DealSectorPreCommittedCallback) error { - return c.scMgr.OnDealSectorPreCommitted(ctx, provider, proposal, *publishCid, cb) -} - -// TODO: Remove dealID parameter, change publishCid to be cid.Cid (instead of pointer) -func (c *ClientNodeAdapter) OnDealSectorCommitted(ctx context.Context, provider address.Address, dealID abi.DealID, sectorNumber abi.SectorNumber, proposal markettypes.DealProposal, publishCid *cid.Cid, cb storagemarket.DealSectorCommittedCallback) error { - return c.scMgr.OnDealSectorCommitted(ctx, provider, sectorNumber, proposal, *publishCid, cb) -} - -// TODO: Replace dealID parameter with DealProposal -func (c *ClientNodeAdapter) OnDealExpiredOrSlashed(ctx context.Context, dealID abi.DealID, onDealExpired storagemarket.DealExpiredCallback, onDealSlashed storagemarket.DealSlashedCallback) error { - head, err := c.ChainHead(ctx) - if err != nil { - return xerrors.Errorf("client: failed to get chain head: %w", err) - } - - sd, err := c.StateMarketStorageDeal(ctx, dealID, head.Key()) - if err != nil { - return xerrors.Errorf("client: failed to look up deal %d on chain: %w", dealID, err) - } - - // Called immediately to check if the deal has already expired or been slashed - checkFunc := func(ctx context.Context, ts *types.TipSet) (done bool, more bool, err error) { - if ts == nil { - // keep listening for events - return false, true, nil - } - - // Check if the deal has already expired - if sd.Proposal.EndEpoch <= ts.Height() { - onDealExpired(nil) - return true, false, nil - } - - // If there is no deal assume it's already been slashed - if sd.State.SectorStartEpoch < 0 { - onDealSlashed(ts.Height(), nil) - return true, false, nil - } - - // No events have occurred yet, so return - // done: false, more: true (keep listening for events) - return false, true, nil - } - - // Called when there was a match against the state change we're looking for - // and the chain has advanced to the confidence height - stateChanged := func(ts *types.TipSet, ts2 *types.TipSet, states events.StateChange, h abi.ChainEpoch) (more bool, err error) { - // Check if the deal has already expired - if ts2 == nil || sd.Proposal.EndEpoch <= ts2.Height() { - onDealExpired(nil) - return false, nil - } - - // Timeout waiting for state change - if states == nil { - log.Error("timed out waiting for deal expiry") - return false, nil - } - - changedDeals, ok := states.(state.ChangedDeals) - if !ok { - panic("Expected state.ChangedDeals") - } - - deal, ok := changedDeals[dealID] - if !ok { - // No change to deal - return true, nil - } - - // Deal was slashed - if deal.To == nil { - onDealSlashed(ts2.Height(), nil) - return false, nil - } - - return true, nil - } - - // Called when there was a chain reorg and the state change was reverted - revert := func(ctx context.Context, ts *types.TipSet) error { - // TODO: Is it ok to just ignore this? - log.Warn("deal state reverted; TODO: actually handle this!") - return nil - } - - // Watch for state changes to the deal - match := c.dsMatcher.matcher(ctx, dealID) - - // Wait until after the end epoch for the deal and then timeout - timeout := (sd.Proposal.EndEpoch - head.Height()) + 1 - if err := c.ev.StateChanged(checkFunc, stateChanged, revert, int(build.MessageConfidence)+1, timeout, match); err != nil { - return xerrors.Errorf("failed to set up state changed handler: %w", err) - } - - return nil -} - -func (c *ClientNodeAdapter) SignProposal(ctx context.Context, signer address.Address, proposal markettypes.DealProposal) (*markettypes.ClientDealProposal, error) { - // TODO: output spec signed proposal - buf, err := cborutil.Dump(&proposal) - if err != nil { - return nil, err - } - - signer, err = c.StateAccountKey(ctx, signer, types.EmptyTSK) - if err != nil { - return nil, err - } - - sig, err := c.Wallet.WalletSign(ctx, signer, buf, api.MsgMeta{ - Type: api.MTDealProposal, - }) - if err != nil { - return nil, err - } - - return &markettypes.ClientDealProposal{ - Proposal: proposal, - ClientSignature: *sig, - }, nil -} - -func (c *ClientNodeAdapter) GetDefaultWalletAddress(ctx context.Context) (address.Address, error) { - addr, err := c.DefWallet.GetDefault() - return addr, err -} - -func (c *ClientNodeAdapter) GetChainHead(ctx context.Context) (shared.TipSetToken, abi.ChainEpoch, error) { - head, err := c.ChainHead(ctx) - if err != nil { - return nil, 0, err - } - - return head.Key().Bytes(), head.Height(), nil -} - -func (c *ClientNodeAdapter) WaitForMessage(ctx context.Context, mcid cid.Cid, cb func(code exitcode.ExitCode, bytes []byte, finalCid cid.Cid, err error) error) error { - receipt, err := c.StateWaitMsg(ctx, mcid, build.MessageConfidence, api.LookbackNoLimit, true) - if err != nil { - return cb(0, nil, cid.Undef, err) - } - return cb(receipt.Receipt.ExitCode, receipt.Receipt.Return, receipt.Message, nil) -} - -func (c *ClientNodeAdapter) GetMinerInfo(ctx context.Context, addr address.Address, encodedTs shared.TipSetToken) (*storagemarket.StorageProviderInfo, error) { - tsk, err := types.TipSetKeyFromBytes(encodedTs) - if err != nil { - return nil, err - } - mi, err := c.StateMinerInfo(ctx, addr, tsk) - if err != nil { - return nil, err - } - - out := utils.NewStorageProviderInfo(addr, mi.Worker, mi.SectorSize, *mi.PeerId, mi.Multiaddrs) - return &out, nil -} - -func (c *ClientNodeAdapter) SignBytes(ctx context.Context, signer address.Address, b []byte) (*crypto.Signature, error) { - signer, err := c.StateAccountKey(ctx, signer, types.EmptyTSK) - if err != nil { - return nil, err - } - - localSignature, err := c.Wallet.WalletSign(ctx, signer, b, api.MsgMeta{ - Type: api.MTUnknown, // TODO: pass type here - }) - if err != nil { - return nil, err - } - return localSignature, nil -} - -var _ storagemarket.StorageClientNode = &ClientNodeAdapter{} diff --git a/markets/storageadapter/client_blockstore.go b/markets/storageadapter/client_blockstore.go deleted file mode 100644 index dc7e3f82a62..00000000000 --- a/markets/storageadapter/client_blockstore.go +++ /dev/null @@ -1,102 +0,0 @@ -package storageadapter - -import ( - "sync" - - blockstore "github.com/ipfs/boxo/blockstore" - "github.com/ipfs/go-cid" - "golang.org/x/xerrors" - - "github.com/filecoin-project/go-fil-markets/storagemarket" - "github.com/filecoin-project/go-fil-markets/stores" - - "github.com/filecoin-project/lotus/node/repo/imports" -) - -// ProxyBlockstoreAccessor is an accessor that returns a fixed blockstore. -// To be used in combination with IPFS integration. -type ProxyBlockstoreAccessor struct { - Blockstore blockstore.Blockstore -} - -var _ storagemarket.BlockstoreAccessor = (*ProxyBlockstoreAccessor)(nil) - -func NewFixedBlockstoreAccessor(bs blockstore.Blockstore) storagemarket.BlockstoreAccessor { - return &ProxyBlockstoreAccessor{Blockstore: bs} -} - -func (p *ProxyBlockstoreAccessor) Get(cid storagemarket.PayloadCID) (blockstore.Blockstore, error) { - return p.Blockstore, nil -} - -func (p *ProxyBlockstoreAccessor) Done(cid storagemarket.PayloadCID) error { - return nil -} - -// ImportsBlockstoreAccessor is a blockstore accessor backed by the -// imports.Manager. -type ImportsBlockstoreAccessor struct { - m *imports.Manager - lk sync.Mutex - open map[cid.Cid]struct { - st stores.ClosableBlockstore - refs int - } -} - -var _ storagemarket.BlockstoreAccessor = (*ImportsBlockstoreAccessor)(nil) - -func NewImportsBlockstoreAccessor(importmgr *imports.Manager) *ImportsBlockstoreAccessor { - return &ImportsBlockstoreAccessor{ - m: importmgr, - open: make(map[cid.Cid]struct { - st stores.ClosableBlockstore - refs int - }), - } -} - -func (s *ImportsBlockstoreAccessor) Get(payloadCID storagemarket.PayloadCID) (blockstore.Blockstore, error) { - s.lk.Lock() - defer s.lk.Unlock() - - e, ok := s.open[payloadCID] - if ok { - e.refs++ - return e.st, nil - } - - path, err := s.m.CARPathFor(payloadCID) - if err != nil { - return nil, xerrors.Errorf("failed to get client blockstore for root %s: %w", payloadCID, err) - } - if path == "" { - return nil, xerrors.Errorf("no client blockstore for root %s", payloadCID) - } - ret, err := stores.ReadOnlyFilestore(path) - if err != nil { - return nil, err - } - e.st = ret - s.open[payloadCID] = e - return ret, nil -} - -func (s *ImportsBlockstoreAccessor) Done(payloadCID storagemarket.PayloadCID) error { - s.lk.Lock() - defer s.lk.Unlock() - - e, ok := s.open[payloadCID] - if !ok { - return nil - } - - e.refs-- - if e.refs == 0 { - if err := e.st.Close(); err != nil { - log.Warnf("failed to close blockstore: %s", err) - } - delete(s.open, payloadCID) - } - return nil -} diff --git a/markets/storageadapter/dealpublisher.go b/markets/storageadapter/dealpublisher.go deleted file mode 100644 index 6a274e593f4..00000000000 --- a/markets/storageadapter/dealpublisher.go +++ /dev/null @@ -1,466 +0,0 @@ -package storageadapter - -import ( - "context" - "fmt" - "strings" - "sync" - "time" - - "github.com/ipfs/go-cid" - "go.uber.org/fx" - "golang.org/x/xerrors" - - "github.com/filecoin-project/go-address" - "github.com/filecoin-project/go-state-types/abi" - "github.com/filecoin-project/go-state-types/big" - "github.com/filecoin-project/go-state-types/builtin" - "github.com/filecoin-project/go-state-types/builtin/v9/market" - "github.com/filecoin-project/go-state-types/exitcode" - - "github.com/filecoin-project/lotus/api" - "github.com/filecoin-project/lotus/build" - "github.com/filecoin-project/lotus/chain/actors" - "github.com/filecoin-project/lotus/chain/types" - "github.com/filecoin-project/lotus/node/config" - "github.com/filecoin-project/lotus/storage/ctladdr" -) - -type dealPublisherAPI interface { - ChainHead(context.Context) (*types.TipSet, error) - MpoolPushMessage(ctx context.Context, msg *types.Message, spec *api.MessageSendSpec) (*types.SignedMessage, error) - StateMinerInfo(context.Context, address.Address, types.TipSetKey) (api.MinerInfo, error) - - WalletBalance(context.Context, address.Address) (types.BigInt, error) - WalletHas(context.Context, address.Address) (bool, error) - StateAccountKey(context.Context, address.Address, types.TipSetKey) (address.Address, error) - StateLookupID(context.Context, address.Address, types.TipSetKey) (address.Address, error) - StateCall(context.Context, *types.Message, types.TipSetKey) (*api.InvocResult, error) -} - -// DealPublisher batches deal publishing so that many deals can be included in -// a single publish message. This saves gas for miners that publish deals -// frequently. -// When a deal is submitted, the DealPublisher waits a configurable amount of -// time for other deals to be submitted before sending the publish message. -// There is a configurable maximum number of deals that can be included in one -// message. When the limit is reached the DealPublisher immediately submits a -// publish message with all deals in the queue. -type DealPublisher struct { - api dealPublisherAPI - as *ctladdr.AddressSelector - - ctx context.Context - Shutdown context.CancelFunc - - maxDealsPerPublishMsg uint64 - publishPeriod time.Duration - publishSpec *api.MessageSendSpec - - lk sync.Mutex - pending []*pendingDeal - cancelWaitForMoreDeals context.CancelFunc - publishPeriodStart time.Time - startEpochSealingBuffer abi.ChainEpoch -} - -// A deal that is queued to be published -type pendingDeal struct { - ctx context.Context - deal market.ClientDealProposal - Result chan publishResult -} - -// The result of publishing a deal -type publishResult struct { - msgCid cid.Cid - err error -} - -func newPendingDeal(ctx context.Context, deal market.ClientDealProposal) *pendingDeal { - return &pendingDeal{ - ctx: ctx, - deal: deal, - Result: make(chan publishResult), - } -} - -type PublishMsgConfig struct { - // The amount of time to wait for more deals to arrive before - // publishing - Period time.Duration - // The maximum number of deals to include in a single PublishStorageDeals - // message - MaxDealsPerMsg uint64 - // Minimum start epoch buffer to give time for sealing of sector with deal - StartEpochSealingBuffer uint64 -} - -func NewDealPublisher( - feeConfig *config.MinerFeeConfig, - publishMsgCfg PublishMsgConfig, -) func(lc fx.Lifecycle, full api.FullNode, as *ctladdr.AddressSelector) *DealPublisher { - return func(lc fx.Lifecycle, full api.FullNode, as *ctladdr.AddressSelector) *DealPublisher { - maxFee := abi.NewTokenAmount(0) - if feeConfig != nil { - maxFee = abi.TokenAmount(feeConfig.MaxPublishDealsFee) - } - publishSpec := &api.MessageSendSpec{MaxFee: maxFee} - dp := newDealPublisher(full, as, publishMsgCfg, publishSpec) - lc.Append(fx.Hook{ - OnStop: func(ctx context.Context) error { - dp.Shutdown() - return nil - }, - }) - return dp - } -} - -func newDealPublisher( - dpapi dealPublisherAPI, - as *ctladdr.AddressSelector, - publishMsgCfg PublishMsgConfig, - publishSpec *api.MessageSendSpec, -) *DealPublisher { - ctx, cancel := context.WithCancel(context.Background()) - return &DealPublisher{ - api: dpapi, - as: as, - ctx: ctx, - Shutdown: cancel, - maxDealsPerPublishMsg: publishMsgCfg.MaxDealsPerMsg, - publishPeriod: publishMsgCfg.Period, - startEpochSealingBuffer: abi.ChainEpoch(publishMsgCfg.StartEpochSealingBuffer), - publishSpec: publishSpec, - } -} - -// PendingDeals returns the list of deals that are queued up to be published -func (p *DealPublisher) PendingDeals() api.PendingDealInfo { - p.lk.Lock() - defer p.lk.Unlock() - - // Filter out deals whose context has been cancelled - deals := make([]*pendingDeal, 0, len(p.pending)) - for _, dl := range p.pending { - if dl.ctx.Err() == nil { - deals = append(deals, dl) - } - } - - pending := make([]market.ClientDealProposal, len(deals)) - for i, deal := range deals { - pending[i] = deal.deal - } - - return api.PendingDealInfo{ - Deals: pending, - PublishPeriodStart: p.publishPeriodStart, - PublishPeriod: p.publishPeriod, - } -} - -// ForcePublishPendingDeals publishes all pending deals without waiting for -// the publish period to elapse -func (p *DealPublisher) ForcePublishPendingDeals() { - p.lk.Lock() - defer p.lk.Unlock() - - log.Infof("force publishing deals") - p.publishAllDeals() -} - -func (p *DealPublisher) Publish(ctx context.Context, deal market.ClientDealProposal) (cid.Cid, error) { - pdeal := newPendingDeal(ctx, deal) - - // Add the deal to the queue - p.processNewDeal(pdeal) - - // Wait for the deal to be submitted - select { - case <-ctx.Done(): - return cid.Undef, ctx.Err() - case res := <-pdeal.Result: - return res.msgCid, res.err - } -} - -func (p *DealPublisher) processNewDeal(pdeal *pendingDeal) { - p.lk.Lock() - defer p.lk.Unlock() - - // Filter out any cancelled deals - p.filterCancelledDeals() - - // If all deals have been cancelled, clear the wait-for-deals timer - if len(p.pending) == 0 && p.cancelWaitForMoreDeals != nil { - p.cancelWaitForMoreDeals() - p.cancelWaitForMoreDeals = nil - } - - // Make sure the new deal hasn't been cancelled - if pdeal.ctx.Err() != nil { - return - } - - pdealPropCid, err := pdeal.deal.Proposal.Cid() - if err != nil { - log.Warn("failed to calculate proposal CID for new pending Deal with piece cid %s", pdeal.deal.Proposal.PieceCID) - return - } - - // Sanity check that new deal isn't already in the queue - for _, pd := range p.pending { - pdPropCid, err := pd.deal.Proposal.Cid() - if err != nil { - log.Warn("failed to calculate proposal CID for pending Deal already in publish queue with piece cid %s", pd.deal.Proposal.PieceCID) - return - } - - if pdPropCid.Equals(pdealPropCid) { - log.Warn("tried to process new pending deal with piece CID %s that is already in publish queue; returning", pdeal.deal.Proposal.PieceCID) - return - } - } - - // Add the new deal to the queue - p.pending = append(p.pending, pdeal) - log.Infof("add deal with piece CID %s to publish deals queue - %d deals in queue (max queue size %d)", - pdeal.deal.Proposal.PieceCID, len(p.pending), p.maxDealsPerPublishMsg) - - // If the maximum number of deals per message has been reached or we're not batching, send a - // publish message - if uint64(len(p.pending)) >= p.maxDealsPerPublishMsg || p.publishPeriod == 0 { - log.Infof("publish deals queue has reached max size of %d, publishing deals", p.maxDealsPerPublishMsg) - p.publishAllDeals() - return - } - - // Otherwise wait for more deals to arrive or the timeout to be reached - p.waitForMoreDeals() -} - -func (p *DealPublisher) waitForMoreDeals() { - // Check if we're already waiting for deals - if !p.publishPeriodStart.IsZero() { - elapsed := build.Clock.Since(p.publishPeriodStart) - log.Infof("%s elapsed of / %s until publish deals queue is published", - elapsed, p.publishPeriod) - return - } - - // Set a timeout to wait for more deals to arrive - log.Infof("waiting publish deals queue period of %s before publishing", p.publishPeriod) - ctx, cancel := context.WithCancel(p.ctx) - - // Create the timer _before_ taking the current time so publishPeriod+timeout is always >= - // the actual timer timeout. - timer := build.Clock.Timer(p.publishPeriod) - - p.publishPeriodStart = build.Clock.Now() - p.cancelWaitForMoreDeals = cancel - - go func() { - select { - case <-ctx.Done(): - timer.Stop() - case <-timer.C: - p.lk.Lock() - defer p.lk.Unlock() - - // The timeout has expired so publish all pending deals - log.Infof("publish deals queue period of %s has expired, publishing deals", p.publishPeriod) - p.publishAllDeals() - } - }() -} - -func (p *DealPublisher) publishAllDeals() { - // If the timeout hasn't yet been cancelled, cancel it - if p.cancelWaitForMoreDeals != nil { - p.cancelWaitForMoreDeals() - p.cancelWaitForMoreDeals = nil - p.publishPeriodStart = time.Time{} - } - - // Filter out any deals that have been cancelled - p.filterCancelledDeals() - deals := p.pending - p.pending = nil - - // Send the publish message - go p.publishReady(deals) -} - -func (p *DealPublisher) publishReady(ready []*pendingDeal) { - if len(ready) == 0 { - return - } - - // onComplete is called when the publish message has been sent or there - // was an error - onComplete := func(pd *pendingDeal, msgCid cid.Cid, err error) { - // Send the publish result on the pending deal's Result channel - res := publishResult{ - msgCid: msgCid, - err: err, - } - select { - case <-p.ctx.Done(): - case <-pd.ctx.Done(): - case pd.Result <- res: - } - } - - // Validate each deal to make sure it can be published - validated := make([]*pendingDeal, 0, len(ready)) - deals := make([]market.ClientDealProposal, 0, len(ready)) - for _, pd := range ready { - // Validate the deal - if err := p.validateDeal(pd.deal); err != nil { - // Validation failed, complete immediately with an error - go onComplete(pd, cid.Undef, xerrors.Errorf("publish validation failed: %w", err)) - continue - } - - validated = append(validated, pd) - deals = append(deals, pd.deal) - } - - // Send the publish message - msgCid, err := p.publishDealProposals(deals) - - // Signal that each deal has been published - for _, pd := range validated { - go onComplete(pd, msgCid, err) - } -} - -// validateDeal checks that the deal proposal start epoch hasn't already -// elapsed -func (p *DealPublisher) validateDeal(deal market.ClientDealProposal) error { - start := time.Now() - - pcid, err := deal.Proposal.Cid() - if err != nil { - return xerrors.Errorf("computing proposal cid: %w", err) - } - - head, err := p.api.ChainHead(p.ctx) - if err != nil { - return err - } - if head.Height()+p.startEpochSealingBuffer > deal.Proposal.StartEpoch { - return xerrors.Errorf( - "cannot publish deal with piece CID %s: current epoch %d has passed deal proposal start epoch %d", - deal.Proposal.PieceCID, head.Height(), deal.Proposal.StartEpoch) - } - - mi, err := p.api.StateMinerInfo(p.ctx, deal.Proposal.Provider, types.EmptyTSK) - if err != nil { - return xerrors.Errorf("getting provider info: %w", err) - } - - params, err := actors.SerializeParams(&market.PublishStorageDealsParams{ - Deals: []market.ClientDealProposal{deal}, - }) - if err != nil { - return xerrors.Errorf("serializing PublishStorageDeals params failed: %w", err) - } - - addr, _, err := p.as.AddressFor(p.ctx, p.api, mi, api.DealPublishAddr, big.Zero(), big.Zero()) - if err != nil { - return xerrors.Errorf("selecting address for publishing deals: %w", err) - } - - res, err := p.api.StateCall(p.ctx, &types.Message{ - To: builtin.StorageMarketActorAddr, - From: addr, - Value: types.NewInt(0), - Method: builtin.MethodsMarket.PublishStorageDeals, - Params: params, - }, head.Key()) - if err != nil { - return xerrors.Errorf("simulating deal publish message: %w", err) - } - if res.MsgRct.ExitCode != exitcode.Ok { - return xerrors.Errorf("simulating deal publish message: non-zero exitcode %s; message: %s", res.MsgRct.ExitCode, res.Error) - } - - took := time.Now().Sub(start) - log.Infow("validating deal", "took", took, "proposal", pcid) - - return nil -} - -// Sends the publish message -func (p *DealPublisher) publishDealProposals(deals []market.ClientDealProposal) (cid.Cid, error) { - if len(deals) == 0 { - return cid.Undef, nil - } - - log.Infof("publishing %d deals in publish deals queue with piece CIDs: %s", len(deals), pieceCids(deals)) - - provider := deals[0].Proposal.Provider - for _, dl := range deals { - if dl.Proposal.Provider != provider { - msg := fmt.Sprintf("publishing %d deals failed: ", len(deals)) + - "not all deals are for same provider: " + - fmt.Sprintf("deal with piece CID %s is for provider %s ", deals[0].Proposal.PieceCID, deals[0].Proposal.Provider) + - fmt.Sprintf("but deal with piece CID %s is for provider %s", dl.Proposal.PieceCID, dl.Proposal.Provider) - return cid.Undef, xerrors.Errorf(msg) - } - } - - mi, err := p.api.StateMinerInfo(p.ctx, provider, types.EmptyTSK) - if err != nil { - return cid.Undef, err - } - - params, err := actors.SerializeParams(&market.PublishStorageDealsParams{ - Deals: deals, - }) - - if err != nil { - return cid.Undef, xerrors.Errorf("serializing PublishStorageDeals params failed: %w", err) - } - - addr, _, err := p.as.AddressFor(p.ctx, p.api, mi, api.DealPublishAddr, big.Zero(), big.Zero()) - if err != nil { - return cid.Undef, xerrors.Errorf("selecting address for publishing deals: %w", err) - } - - smsg, err := p.api.MpoolPushMessage(p.ctx, &types.Message{ - To: builtin.StorageMarketActorAddr, - From: addr, - Value: types.NewInt(0), - Method: builtin.MethodsMarket.PublishStorageDeals, - Params: params, - }, p.publishSpec) - - if err != nil { - return cid.Undef, err - } - return smsg.Cid(), nil -} - -func pieceCids(deals []market.ClientDealProposal) string { - cids := make([]string, 0, len(deals)) - for _, dl := range deals { - cids = append(cids, dl.Proposal.PieceCID.String()) - } - return strings.Join(cids, ", ") -} - -// filter out deals that have been cancelled -func (p *DealPublisher) filterCancelledDeals() { - filtered := p.pending[:0] - for _, pd := range p.pending { - if pd.ctx.Err() != nil { - continue - } - filtered = append(filtered, pd) - } - p.pending = filtered -} diff --git a/markets/storageadapter/dealpublisher_test.go b/markets/storageadapter/dealpublisher_test.go deleted file mode 100644 index 35169bf41b9..00000000000 --- a/markets/storageadapter/dealpublisher_test.go +++ /dev/null @@ -1,423 +0,0 @@ -// stm: #unit -package storageadapter - -import ( - "bytes" - "context" - "testing" - "time" - - "github.com/ipfs/go-cid" - "github.com/raulk/clock" - "github.com/stretchr/testify/require" - "golang.org/x/xerrors" - - "github.com/filecoin-project/go-address" - "github.com/filecoin-project/go-state-types/abi" - markettypes "github.com/filecoin-project/go-state-types/builtin/v9/market" - "github.com/filecoin-project/go-state-types/crypto" - "github.com/filecoin-project/go-state-types/exitcode" - tutils "github.com/filecoin-project/specs-actors/v2/support/testing" - - "github.com/filecoin-project/lotus/api" - "github.com/filecoin-project/lotus/build" - "github.com/filecoin-project/lotus/chain/actors/builtin/market" - "github.com/filecoin-project/lotus/chain/types" -) - -func TestDealPublisher(t *testing.T) { - //stm: @MARKET_DEAL_PUBLISHER_PUBLISH_001, @MARKET_DEAL_PUBLISHER_GET_PENDING_DEALS_001 - oldClock := build.Clock - t.Cleanup(func() { build.Clock = oldClock }) - mc := clock.NewMock() - build.Clock = mc - - testCases := []struct { - name string - publishPeriod time.Duration - maxDealsPerMsg uint64 - dealCountWithinPublishPeriod int - ctxCancelledWithinPublishPeriod int - expiredDeals int - dealCountAfterPublishPeriod int - expectedDealsPerMsg []int - failOne bool - }{{ - name: "publish one deal within publish period", - publishPeriod: 10 * time.Millisecond, - maxDealsPerMsg: 5, - dealCountWithinPublishPeriod: 1, - dealCountAfterPublishPeriod: 0, - expectedDealsPerMsg: []int{1}, - }, { - name: "publish two deals within publish period", - publishPeriod: 10 * time.Millisecond, - maxDealsPerMsg: 5, - dealCountWithinPublishPeriod: 2, - dealCountAfterPublishPeriod: 0, - expectedDealsPerMsg: []int{2}, - }, { - name: "publish one deal within publish period, and one after", - publishPeriod: 10 * time.Millisecond, - maxDealsPerMsg: 5, - dealCountWithinPublishPeriod: 1, - dealCountAfterPublishPeriod: 1, - expectedDealsPerMsg: []int{1, 1}, - }, { - name: "publish deals that exceed max deals per message within publish period, and one after", - publishPeriod: 10 * time.Millisecond, - maxDealsPerMsg: 2, - dealCountWithinPublishPeriod: 3, - dealCountAfterPublishPeriod: 1, - expectedDealsPerMsg: []int{2, 1, 1}, - }, { - name: "ignore deals with cancelled context", - publishPeriod: 10 * time.Millisecond, - maxDealsPerMsg: 5, - dealCountWithinPublishPeriod: 2, - ctxCancelledWithinPublishPeriod: 2, - dealCountAfterPublishPeriod: 1, - expectedDealsPerMsg: []int{2, 1}, - }, { - name: "ignore expired deals", - publishPeriod: 10 * time.Millisecond, - maxDealsPerMsg: 5, - dealCountWithinPublishPeriod: 2, - expiredDeals: 2, - dealCountAfterPublishPeriod: 1, - expectedDealsPerMsg: []int{2, 1}, - }, { - name: "zero config", - publishPeriod: 0, - maxDealsPerMsg: 0, - dealCountWithinPublishPeriod: 2, - ctxCancelledWithinPublishPeriod: 0, - dealCountAfterPublishPeriod: 2, - expectedDealsPerMsg: []int{1, 1, 1, 1}, - }, { - name: "one deal failing doesn't fail the entire batch", - publishPeriod: 10 * time.Millisecond, - maxDealsPerMsg: 5, - dealCountWithinPublishPeriod: 2, - dealCountAfterPublishPeriod: 0, - failOne: true, - expectedDealsPerMsg: []int{1}, - }} - - for _, tc := range testCases { - tc := tc - t.Run(tc.name, func(t *testing.T) { - mc.Set(time.Now()) - dpapi := newDPAPI(t) - - // Create a deal publisher - dp := newDealPublisher(dpapi, nil, PublishMsgConfig{ - Period: tc.publishPeriod, - MaxDealsPerMsg: tc.maxDealsPerMsg, - }, &api.MessageSendSpec{MaxFee: abi.NewTokenAmount(1)}) - - // Keep a record of the deals that were submitted to be published - var dealsToPublish []markettypes.ClientDealProposal - - // Publish deals within publish period - for i := 0; i < tc.dealCountWithinPublishPeriod; i++ { - if tc.failOne && i == 1 { - publishDeal(t, dp, i, false, false) - } else { - deal := publishDeal(t, dp, 0, false, false) - dealsToPublish = append(dealsToPublish, deal) - } - } - for i := 0; i < tc.ctxCancelledWithinPublishPeriod; i++ { - publishDeal(t, dp, 0, true, false) - } - for i := 0; i < tc.expiredDeals; i++ { - publishDeal(t, dp, 0, false, true) - } - - // Wait until publish period has elapsed - if tc.publishPeriod > 0 { - // If we expect deals to get stuck in the queue, wait until that happens - if tc.maxDealsPerMsg != 0 && tc.dealCountWithinPublishPeriod%int(tc.maxDealsPerMsg) != 0 { - require.Eventually(t, func() bool { - dp.lk.Lock() - defer dp.lk.Unlock() - return !dp.publishPeriodStart.IsZero() - }, time.Second, time.Millisecond, "failed to queue deals") - } - - // Then wait to send - require.Eventually(t, func() bool { - dp.lk.Lock() - defer dp.lk.Unlock() - - // Advance if necessary. - if mc.Since(dp.publishPeriodStart) <= tc.publishPeriod { - dp.lk.Unlock() - mc.Set(dp.publishPeriodStart.Add(tc.publishPeriod + 1)) - dp.lk.Lock() - } - - return len(dp.pending) == 0 - }, time.Second, time.Millisecond, "failed to send pending messages") - } - - // Publish deals after publish period - for i := 0; i < tc.dealCountAfterPublishPeriod; i++ { - deal := publishDeal(t, dp, 0, false, false) - dealsToPublish = append(dealsToPublish, deal) - } - - if tc.publishPeriod > 0 && tc.dealCountAfterPublishPeriod > 0 { - require.Eventually(t, func() bool { - dp.lk.Lock() - defer dp.lk.Unlock() - if mc.Since(dp.publishPeriodStart) <= tc.publishPeriod { - dp.lk.Unlock() - mc.Set(dp.publishPeriodStart.Add(tc.publishPeriod + 1)) - dp.lk.Lock() - } - return len(dp.pending) == 0 - }, time.Second, time.Millisecond, "failed to send pending messages") - } - - checkPublishedDeals(t, dpapi, dealsToPublish, tc.expectedDealsPerMsg) - }) - } -} - -func TestForcePublish(t *testing.T) { - //stm: @MARKET_DEAL_PUBLISHER_PUBLISH_001, @MARKET_DEAL_PUBLISHER_GET_PENDING_DEALS_001 - //stm: @MARKET_DEAL_PUBLISHER_FORCE_PUBLISH_ALL_001 - dpapi := newDPAPI(t) - - // Create a deal publisher - start := build.Clock.Now() - publishPeriod := time.Hour - dp := newDealPublisher(dpapi, nil, PublishMsgConfig{ - Period: publishPeriod, - MaxDealsPerMsg: 10, - }, &api.MessageSendSpec{MaxFee: abi.NewTokenAmount(1)}) - - // Queue three deals for publishing, one with a cancelled context - var dealsToPublish []markettypes.ClientDealProposal - // 1. Regular deal - deal := publishDeal(t, dp, 0, false, false) - dealsToPublish = append(dealsToPublish, deal) - // 2. Deal with cancelled context - publishDeal(t, dp, 0, true, false) - // 3. Regular deal - deal = publishDeal(t, dp, 0, false, false) - dealsToPublish = append(dealsToPublish, deal) - - // Allow a moment for them to be queued - build.Clock.Sleep(10 * time.Millisecond) - - // Should be two deals in the pending deals list - // (deal with cancelled context is ignored) - pendingInfo := dp.PendingDeals() - require.Len(t, pendingInfo.Deals, 2) - require.Equal(t, publishPeriod, pendingInfo.PublishPeriod) - require.True(t, pendingInfo.PublishPeriodStart.After(start)) - require.True(t, pendingInfo.PublishPeriodStart.Before(build.Clock.Now())) - - // Force publish all pending deals - dp.ForcePublishPendingDeals() - - // Should be no pending deals - pendingInfo = dp.PendingDeals() - require.Len(t, pendingInfo.Deals, 0) - - // Make sure the expected deals were published - checkPublishedDeals(t, dpapi, dealsToPublish, []int{2}) -} - -func publishDeal(t *testing.T, dp *DealPublisher, invalid int, ctxCancelled bool, expired bool) markettypes.ClientDealProposal { - ctx, cancel := context.WithCancel(context.Background()) - t.Cleanup(cancel) - - pctx := ctx - if ctxCancelled { - pctx, cancel = context.WithCancel(ctx) - cancel() - } - - startEpoch := abi.ChainEpoch(20) - if expired { - startEpoch = abi.ChainEpoch(5) - } - deal := markettypes.ClientDealProposal{ - Proposal: markettypes.DealProposal{ - PieceCID: generateCids(1)[0], - Client: getClientActor(t), - Provider: getProviderActor(t), - StartEpoch: startEpoch, - EndEpoch: abi.ChainEpoch(120), - PieceSize: abi.PaddedPieceSize(invalid), // pass invalid into StateCall below - }, - ClientSignature: crypto.Signature{ - Type: crypto.SigTypeSecp256k1, - Data: []byte("signature data"), - }, - } - - go func() { - _, err := dp.Publish(pctx, deal) - - // If the test has completed just bail out without checking for errors - if ctx.Err() != nil { - return - } - - if ctxCancelled || expired || invalid == 1 { - require.Error(t, err) - } else { - require.NoError(t, err) - } - }() - - return deal -} - -func checkPublishedDeals(t *testing.T, dpapi *dpAPI, dealsToPublish []markettypes.ClientDealProposal, expectedDealsPerMsg []int) { - // For each message that was expected to be sent - var publishedDeals []markettypes.ClientDealProposal - for _, expectedDealsInMsg := range expectedDealsPerMsg { - // Should have called StateMinerInfo with the provider address - stateMinerInfoAddr := <-dpapi.stateMinerInfoCalls - require.Equal(t, getProviderActor(t), stateMinerInfoAddr) - - // Check the fields of the message that was sent - msg := <-dpapi.pushedMsgs - require.Equal(t, getWorkerActor(t), msg.From) - require.Equal(t, market.Address, msg.To) - require.Equal(t, market.Methods.PublishStorageDeals, msg.Method) - - // Check that the expected number of deals was included in the message - var params markettypes.PublishStorageDealsParams - err := params.UnmarshalCBOR(bytes.NewReader(msg.Params)) - require.NoError(t, err) - require.Len(t, params.Deals, expectedDealsInMsg) - - // Keep track of the deals that were sent - for _, d := range params.Deals { - publishedDeals = append(publishedDeals, d) - } - } - - // Verify that all deals that were submitted to be published were - // sent out (we do this by ensuring all the piece CIDs are present) - require.True(t, matchPieceCids(publishedDeals, dealsToPublish)) -} - -func matchPieceCids(sent []markettypes.ClientDealProposal, exp []markettypes.ClientDealProposal) bool { - cidsA := dealPieceCids(sent) - cidsB := dealPieceCids(exp) - - if len(cidsA) != len(cidsB) { - return false - } - - s1 := cid.NewSet() - for _, c := range cidsA { - s1.Add(c) - } - - for _, c := range cidsB { - if !s1.Has(c) { - return false - } - } - - return true -} - -func dealPieceCids(deals []markettypes.ClientDealProposal) []cid.Cid { - cids := make([]cid.Cid, 0, len(deals)) - for _, dl := range deals { - cids = append(cids, dl.Proposal.PieceCID) - } - return cids -} - -type dpAPI struct { - t *testing.T - worker address.Address - - stateMinerInfoCalls chan address.Address - pushedMsgs chan *types.Message -} - -func newDPAPI(t *testing.T) *dpAPI { - return &dpAPI{ - t: t, - worker: getWorkerActor(t), - stateMinerInfoCalls: make(chan address.Address, 128), - pushedMsgs: make(chan *types.Message, 128), - } -} - -func (d *dpAPI) ChainHead(ctx context.Context) (*types.TipSet, error) { - dummyCid, err := cid.Parse("bafkqaaa") - require.NoError(d.t, err) - return types.NewTipSet([]*types.BlockHeader{{ - Miner: tutils.NewActorAddr(d.t, "miner"), - Height: abi.ChainEpoch(10), - ParentStateRoot: dummyCid, - Messages: dummyCid, - ParentMessageReceipts: dummyCid, - BlockSig: &crypto.Signature{Type: crypto.SigTypeBLS}, - BLSAggregate: &crypto.Signature{Type: crypto.SigTypeBLS}, - }}) -} - -func (d *dpAPI) StateMinerInfo(ctx context.Context, address address.Address, key types.TipSetKey) (api.MinerInfo, error) { - d.stateMinerInfoCalls <- address - return api.MinerInfo{Worker: d.worker}, nil -} - -func (d *dpAPI) MpoolPushMessage(ctx context.Context, msg *types.Message, spec *api.MessageSendSpec) (*types.SignedMessage, error) { - d.pushedMsgs <- msg - return &types.SignedMessage{Message: *msg}, nil -} - -func (d *dpAPI) WalletBalance(ctx context.Context, a address.Address) (types.BigInt, error) { - panic("don't call me") -} - -func (d *dpAPI) WalletHas(ctx context.Context, a address.Address) (bool, error) { - panic("don't call me") -} - -func (d *dpAPI) StateAccountKey(ctx context.Context, a address.Address, key types.TipSetKey) (address.Address, error) { - panic("don't call me") -} - -func (d *dpAPI) StateLookupID(ctx context.Context, a address.Address, key types.TipSetKey) (address.Address, error) { - panic("don't call me") -} - -func (d *dpAPI) StateCall(ctx context.Context, message *types.Message, key types.TipSetKey) (*api.InvocResult, error) { - var p markettypes.PublishStorageDealsParams - if err := p.UnmarshalCBOR(bytes.NewReader(message.Params)); err != nil { - return nil, xerrors.Errorf("unmarshal market params: %w", err) - } - - exit := exitcode.Ok - if p.Deals[0].Proposal.PieceSize == 1 { - exit = exitcode.ErrIllegalState - } - return &api.InvocResult{MsgRct: &types.MessageReceipt{ExitCode: exit}}, nil -} - -func getClientActor(t *testing.T) address.Address { - return tutils.NewActorAddr(t, "client") -} - -func getWorkerActor(t *testing.T) address.Address { - return tutils.NewActorAddr(t, "worker") -} - -func getProviderActor(t *testing.T) address.Address { - return tutils.NewActorAddr(t, "provider") -} diff --git a/markets/storageadapter/dealstatematcher.go b/markets/storageadapter/dealstatematcher.go deleted file mode 100644 index 8d5598eae01..00000000000 --- a/markets/storageadapter/dealstatematcher.go +++ /dev/null @@ -1,85 +0,0 @@ -package storageadapter - -import ( - "context" - "sync" - - "github.com/filecoin-project/go-state-types/abi" - - actorsmarket "github.com/filecoin-project/lotus/chain/actors/builtin/market" - "github.com/filecoin-project/lotus/chain/events" - "github.com/filecoin-project/lotus/chain/events/state" - "github.com/filecoin-project/lotus/chain/types" -) - -// dealStateMatcher caches the DealStates for the most recent -// old/new tipset combination -type dealStateMatcher struct { - preds *state.StatePredicates - - lk sync.Mutex - oldTsk types.TipSetKey - newTsk types.TipSetKey - oldDealStateRoot actorsmarket.DealStates - newDealStateRoot actorsmarket.DealStates -} - -func newDealStateMatcher(preds *state.StatePredicates) *dealStateMatcher { - return &dealStateMatcher{preds: preds} -} - -// matcher returns a function that checks if the state of the given dealID -// has changed. -// It caches the DealStates for the most recent old/new tipset combination. -func (mc *dealStateMatcher) matcher(ctx context.Context, dealID abi.DealID) events.StateMatchFunc { - // The function that is called to check if the deal state has changed for - // the target deal ID - dealStateChangedForID := mc.preds.DealStateChangedForIDs([]abi.DealID{dealID}) - - // The match function is called by the events API to check if there's - // been a state change for the deal with the target deal ID - match := func(oldTs, newTs *types.TipSet) (bool, events.StateChange, error) { - mc.lk.Lock() - defer mc.lk.Unlock() - - // Check if we've already fetched the DealStates for the given tipsets - if mc.oldTsk == oldTs.Key() && mc.newTsk == newTs.Key() { - // If we fetch the DealStates and there is no difference between - // them, they are stored as nil. So we can just bail out. - if mc.oldDealStateRoot == nil || mc.newDealStateRoot == nil { - return false, nil, nil - } - - // Check if the deal state has changed for the target ID - return dealStateChangedForID(ctx, mc.oldDealStateRoot, mc.newDealStateRoot) - } - - // We haven't already fetched the DealStates for the given tipsets, so - // do so now - - // Replace dealStateChangedForID with a function that records the - // DealStates so that we can cache them - var oldDealStateRootSaved, newDealStateRootSaved actorsmarket.DealStates - recorder := func(ctx context.Context, oldDealStateRoot, newDealStateRoot actorsmarket.DealStates) (changed bool, user state.UserData, err error) { - // Record DealStates - oldDealStateRootSaved = oldDealStateRoot - newDealStateRootSaved = newDealStateRoot - - return dealStateChangedForID(ctx, oldDealStateRoot, newDealStateRoot) - } - - // Call the match function - dealDiff := mc.preds.OnStorageMarketActorChanged( - mc.preds.OnDealStateChanged(recorder)) - matched, data, err := dealDiff(ctx, oldTs.Key(), newTs.Key()) - - // Save the recorded DealStates for the tipsets - mc.oldTsk = oldTs.Key() - mc.newTsk = newTs.Key() - mc.oldDealStateRoot = oldDealStateRootSaved - mc.newDealStateRoot = newDealStateRootSaved - - return matched, data, err - } - return match -} diff --git a/markets/storageadapter/dealstatematcher_test.go b/markets/storageadapter/dealstatematcher_test.go deleted file mode 100644 index 9a46e4af917..00000000000 --- a/markets/storageadapter/dealstatematcher_test.go +++ /dev/null @@ -1,155 +0,0 @@ -// stm: #unit -package storageadapter - -import ( - "context" - "testing" - - "github.com/ipfs/go-cid" - cbornode "github.com/ipfs/go-ipld-cbor" - "github.com/stretchr/testify/require" - "golang.org/x/sync/errgroup" - - "github.com/filecoin-project/go-address" - "github.com/filecoin-project/go-state-types/abi" - builtin2 "github.com/filecoin-project/specs-actors/v2/actors/builtin" - market2 "github.com/filecoin-project/specs-actors/v2/actors/builtin/market" - adt2 "github.com/filecoin-project/specs-actors/v2/actors/util/adt" - - bstore "github.com/filecoin-project/lotus/blockstore" - "github.com/filecoin-project/lotus/chain/events" - "github.com/filecoin-project/lotus/chain/events/state" - test "github.com/filecoin-project/lotus/chain/events/state/mock" - "github.com/filecoin-project/lotus/chain/types" -) - -func TestDealStateMatcher(t *testing.T) { - //stm: @CHAIN_STATE_GET_ACTOR_001 - ctx := context.Background() - bs := bstore.NewMemorySync() - store := adt2.WrapStore(ctx, cbornode.NewCborStore(bs)) - - deal1 := &market2.DealState{ - SectorStartEpoch: 1, - LastUpdatedEpoch: 2, - } - deal2 := &market2.DealState{ - SectorStartEpoch: 4, - LastUpdatedEpoch: 5, - } - deal3 := &market2.DealState{ - SectorStartEpoch: 7, - LastUpdatedEpoch: 8, - } - deals1 := map[abi.DealID]*market2.DealState{ - abi.DealID(1): deal1, - } - deals2 := map[abi.DealID]*market2.DealState{ - abi.DealID(1): deal2, - } - deals3 := map[abi.DealID]*market2.DealState{ - abi.DealID(1): deal3, - } - - deal1StateC := createMarketState(ctx, t, store, deals1) - deal2StateC := createMarketState(ctx, t, store, deals2) - deal3StateC := createMarketState(ctx, t, store, deals3) - - minerAddr, err := address.NewFromString("t00") - require.NoError(t, err) - ts1, err := test.MockTipset(minerAddr, 1) - require.NoError(t, err) - ts2, err := test.MockTipset(minerAddr, 2) - require.NoError(t, err) - ts3, err := test.MockTipset(minerAddr, 3) - require.NoError(t, err) - - api := test.NewMockAPI(bs) - api.SetActor(ts1.Key(), &types.Actor{Code: builtin2.StorageMarketActorCodeID, Head: deal1StateC}) - api.SetActor(ts2.Key(), &types.Actor{Code: builtin2.StorageMarketActorCodeID, Head: deal2StateC}) - api.SetActor(ts3.Key(), &types.Actor{Code: builtin2.StorageMarketActorCodeID, Head: deal3StateC}) - - t.Run("caching", func(t *testing.T) { - dsm := newDealStateMatcher(state.NewStatePredicates(api)) - matcher := dsm.matcher(ctx, abi.DealID(1)) - - // Call matcher with tipsets that have the same state - ok, stateChange, err := matcher(ts1, ts1) - require.NoError(t, err) - require.False(t, ok) - require.Nil(t, stateChange) - // Should call StateGetActor once for each tipset - require.Equal(t, 2, api.StateGetActorCallCount()) - - // Call matcher with tipsets that have different state - api.ResetCallCounts() - ok, stateChange, err = matcher(ts1, ts2) - require.NoError(t, err) - require.True(t, ok) - require.NotNil(t, stateChange) - // Should call StateGetActor once for each tipset - require.Equal(t, 2, api.StateGetActorCallCount()) - - // Call matcher again with the same tipsets as above, should be cached - api.ResetCallCounts() - ok, stateChange, err = matcher(ts1, ts2) - require.NoError(t, err) - require.True(t, ok) - require.NotNil(t, stateChange) - // Should not call StateGetActor (because it should hit the cache) - require.Equal(t, 0, api.StateGetActorCallCount()) - - // Call matcher with different tipsets, should not be cached - api.ResetCallCounts() - ok, stateChange, err = matcher(ts2, ts3) - require.NoError(t, err) - require.True(t, ok) - require.NotNil(t, stateChange) - // Should call StateGetActor once for each tipset - require.Equal(t, 2, api.StateGetActorCallCount()) - }) - - t.Run("parallel", func(t *testing.T) { - api.ResetCallCounts() - dsm := newDealStateMatcher(state.NewStatePredicates(api)) - matcher := dsm.matcher(ctx, abi.DealID(1)) - - // Call matcher with lots of go-routines in parallel - var eg errgroup.Group - res := make([]struct { - ok bool - stateChange events.StateChange - }, 20) - for i := 0; i < len(res); i++ { - i := i - eg.Go(func() error { - ok, stateChange, err := matcher(ts1, ts2) - res[i].ok = ok - res[i].stateChange = stateChange - return err - }) - } - err := eg.Wait() - require.NoError(t, err) - - // All go-routines should have got the same (cached) result - for i := 1; i < len(res); i++ { - require.Equal(t, res[i].ok, res[i-1].ok) - require.Equal(t, res[i].stateChange, res[i-1].stateChange) - } - - // Only one go-routine should have called StateGetActor - // (once for each tipset) - require.Equal(t, 2, api.StateGetActorCallCount()) - }) -} - -func createMarketState(ctx context.Context, t *testing.T, store adt2.Store, deals map[abi.DealID]*market2.DealState) cid.Cid { - dealRootCid := test.CreateDealAMT(ctx, t, store, deals) - state := test.CreateEmptyMarketState(t, store) - state.States = dealRootCid - - stateC, err := store.Put(ctx, state) - require.NoError(t, err) - return stateC -} diff --git a/markets/storageadapter/ondealsectorcommitted.go b/markets/storageadapter/ondealsectorcommitted.go deleted file mode 100644 index 54ddb73b334..00000000000 --- a/markets/storageadapter/ondealsectorcommitted.go +++ /dev/null @@ -1,418 +0,0 @@ -package storageadapter - -import ( - "bytes" - "context" - "sync" - - "github.com/ipfs/go-cid" - "golang.org/x/xerrors" - - "github.com/filecoin-project/go-address" - "github.com/filecoin-project/go-bitfield" - "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" - - "github.com/filecoin-project/lotus/build" - lminer "github.com/filecoin-project/lotus/chain/actors/builtin/miner" - "github.com/filecoin-project/lotus/chain/events" - "github.com/filecoin-project/lotus/chain/types" - pipeline "github.com/filecoin-project/lotus/storage/pipeline" -) - -type eventsCalledAPI interface { - Called(ctx context.Context, check events.CheckFunc, msgHnd events.MsgHandler, rev events.RevertHandler, confidence int, timeout abi.ChainEpoch, mf events.MsgMatchFunc) error -} - -type dealInfoAPI interface { - GetCurrentDealInfo(ctx context.Context, tsk types.TipSetKey, proposal *market.DealProposal, publishCid cid.Cid) (pipeline.CurrentDealInfo, error) -} - -type diffPreCommitsAPI interface { - diffPreCommits(ctx context.Context, actor address.Address, pre, cur types.TipSetKey) (*lminer.PreCommitChanges, error) -} - -type SectorCommittedManager struct { - ev eventsCalledAPI - dealInfo dealInfoAPI - dpc diffPreCommitsAPI -} - -func NewSectorCommittedManager(ev eventsCalledAPI, tskAPI pipeline.CurrentDealInfoAPI, dpcAPI diffPreCommitsAPI) *SectorCommittedManager { - dim := &pipeline.CurrentDealInfoManager{ - CDAPI: tskAPI, - } - return newSectorCommittedManager(ev, dim, dpcAPI) -} - -func newSectorCommittedManager(ev eventsCalledAPI, dealInfo dealInfoAPI, dpcAPI diffPreCommitsAPI) *SectorCommittedManager { - return &SectorCommittedManager{ - ev: ev, - dealInfo: dealInfo, - dpc: dpcAPI, - } -} - -func (mgr *SectorCommittedManager) OnDealSectorPreCommitted(ctx context.Context, provider address.Address, proposal market.DealProposal, publishCid cid.Cid, callback storagemarket.DealSectorPreCommittedCallback) error { - // Ensure callback is only called once - var once sync.Once - cb := func(sectorNumber abi.SectorNumber, isActive bool, err error) { - once.Do(func() { - callback(sectorNumber, isActive, err) - }) - } - - // First check if the deal is already active, and if so, bail out - checkFunc := func(ctx context.Context, ts *types.TipSet) (done bool, more bool, err error) { - dealInfo, isActive, err := mgr.checkIfDealAlreadyActive(ctx, ts, &proposal, publishCid) - if err != nil { - // Note: the error returned from here will end up being returned - // from OnDealSectorPreCommitted so no need to call the callback - // with the error - return false, false, xerrors.Errorf("failed to check deal activity: %w", err) - } - - if isActive { - // Deal is already active, bail out - cb(0, true, nil) - return true, false, nil - } - - // Check that precommits which landed between when the deal was published - // and now don't already contain the deal we care about. - // (this can happen when the precommit lands vary quickly (in tests), or - // when the client node was down after the deal was published, and when - // the precommit containing it landed on chain) - - diff, err := mgr.dpc.diffPreCommits(ctx, provider, dealInfo.PublishMsgTipSet, ts.Key()) - if err != nil { - return false, false, xerrors.Errorf("failed to diff precommits: %w", err) - } - - for _, info := range diff.Added { - for _, d := range info.Info.DealIDs { - if d == dealInfo.DealID { - cb(info.Info.SectorNumber, false, nil) - return true, false, nil - } - } - } - - // Not yet active, start matching against incoming messages - return false, true, nil - } - - // 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.PreCommitSectorBatch2 || - msg.Method == builtin.MethodsMiner.ProveReplicaUpdates) - return matched, nil - } - - // The deal must be accepted by the deal proposal start epoch, so timeout - // if the chain reaches that epoch - timeoutEpoch := proposal.StartEpoch + 1 - - // Check if the message params included the deal ID we're looking for. - called := func(msg *types.Message, rec *types.MessageReceipt, ts *types.TipSet, curH abi.ChainEpoch) (more bool, err error) { - defer func() { - if err != nil { - cb(0, false, xerrors.Errorf("handling applied event: %w", err)) - } - }() - - // If the deal hasn't been activated by the proposed start epoch, the - // deal will timeout (when msg == nil it means the timeout epoch was reached) - if msg == nil { - err = xerrors.Errorf("deal with piece CID %s was not activated by proposed deal start epoch %d", proposal.PieceCID, proposal.StartEpoch) - return false, err - } - - // Ignore the pre-commit message if it was not executed successfully - if rec.ExitCode != 0 { - return true, nil - } - - // When there is a reorg, the deal ID may change, so get the - // current deal ID from the publish message CID - res, err := mgr.dealInfo.GetCurrentDealInfo(ctx, ts.Key(), &proposal, publishCid) - if err != nil { - return false, xerrors.Errorf("failed to get dealinfo: %w", err) - } - - // If this is a replica update method that succeeded the deal is active - if msg.Method == builtin.MethodsMiner.ProveReplicaUpdates { - sn, err := dealSectorInReplicaUpdateSuccess(msg, rec, res) - if err != nil { - return false, err - } - if sn != nil { - cb(*sn, true, nil) - return false, nil - } - // Didn't find the deal ID in this message, so keep looking - return true, nil - } - - // Extract the message parameters - sn, err := dealSectorInPreCommitMsg(msg, res) - if err != nil { - return false, xerrors.Errorf("failed to extract message params: %w", err) - } - - if sn != nil { - cb(*sn, false, nil) - } - - // Didn't find the deal ID in this message, so keep looking - return true, nil - } - - revert := func(ctx context.Context, ts *types.TipSet) error { - log.Warn("deal pre-commit reverted; TODO: actually handle this!") - // TODO: Just go back to DealSealing? - return nil - } - - if err := mgr.ev.Called(ctx, checkFunc, called, revert, int(build.MessageConfidence+1), timeoutEpoch, matchEvent); err != nil { - return xerrors.Errorf("failed to set up called handler: %w", err) - } - - return nil -} - -func (mgr *SectorCommittedManager) OnDealSectorCommitted(ctx context.Context, provider address.Address, sectorNumber abi.SectorNumber, proposal market.DealProposal, publishCid cid.Cid, callback storagemarket.DealSectorCommittedCallback) error { - // Ensure callback is only called once - var once sync.Once - cb := func(err error) { - once.Do(func() { - callback(err) - }) - } - - // First check if the deal is already active, and if so, bail out - checkFunc := func(ctx context.Context, ts *types.TipSet) (done bool, more bool, err error) { - _, isActive, err := mgr.checkIfDealAlreadyActive(ctx, ts, &proposal, publishCid) - if err != nil { - // Note: the error returned from here will end up being returned - // from OnDealSectorCommitted so no need to call the callback - // with the error - return false, false, err - } - - if isActive { - // Deal is already active, bail out - cb(nil) - return true, false, nil - } - - // Not yet active, start matching against incoming messages - return false, true, nil - } - - // Match a prove-commit sent to the provider with the given sector number - matchEvent := func(msg *types.Message) (matched bool, err error) { - if msg.To != provider { - return false, nil - } - - return sectorInCommitMsg(msg, sectorNumber) - } - - // The deal must be accepted by the deal proposal start epoch, so timeout - // if the chain reaches that epoch - timeoutEpoch := proposal.StartEpoch + 1 - - called := func(msg *types.Message, rec *types.MessageReceipt, ts *types.TipSet, curH abi.ChainEpoch) (more bool, err error) { - defer func() { - if err != nil { - cb(xerrors.Errorf("handling applied event: %w", err)) - } - }() - - // If the deal hasn't been activated by the proposed start epoch, the - // deal will timeout (when msg == nil it means the timeout epoch was reached) - if msg == nil { - err := xerrors.Errorf("deal with piece CID %s was not activated by proposed deal start epoch %d", proposal.PieceCID, proposal.StartEpoch) - return false, err - } - - // Ignore the prove-commit message if it was not executed successfully - if rec.ExitCode != 0 { - return true, nil - } - - // Get the deal info - res, err := mgr.dealInfo.GetCurrentDealInfo(ctx, ts.Key(), &proposal, publishCid) - if err != nil { - return false, xerrors.Errorf("failed to look up deal on chain: %w", err) - } - - // Make sure the deal is active - if res.MarketDeal.State.SectorStartEpoch < 1 { - return false, xerrors.Errorf("deal wasn't active: deal=%d, parentState=%s, h=%d", res.DealID, ts.ParentState(), ts.Height()) - } - - log.Infof("Storage deal %d activated at epoch %d", res.DealID, res.MarketDeal.State.SectorStartEpoch) - - cb(nil) - - return false, nil - } - - revert := func(ctx context.Context, ts *types.TipSet) error { - log.Warn("deal activation reverted; TODO: actually handle this!") - // TODO: Just go back to DealSealing? - return nil - } - - if err := mgr.ev.Called(ctx, checkFunc, called, revert, int(build.MessageConfidence+1), timeoutEpoch, matchEvent); err != nil { - return xerrors.Errorf("failed to set up called handler: %w", err) - } - - return nil -} - -func dealSectorInReplicaUpdateSuccess(msg *types.Message, rec *types.MessageReceipt, res pipeline.CurrentDealInfo) (*abi.SectorNumber, error) { - var params miner.ProveReplicaUpdatesParams - if err := params.UnmarshalCBOR(bytes.NewReader(msg.Params)); err != nil { - return nil, xerrors.Errorf("unmarshal prove replica update: %w", err) - } - - var seekUpdate miner.ReplicaUpdate - var found bool - for _, update := range params.Updates { - for _, did := range update.Deals { - if did == res.DealID { - seekUpdate = update - found = true - break - } - } - } - if !found { - return nil, nil - } - - // check that this update passed validation steps - var successBf bitfield.BitField - if err := successBf.UnmarshalCBOR(bytes.NewReader(rec.Return)); err != nil { - return nil, xerrors.Errorf("unmarshal return value: %w", err) - } - success, err := successBf.IsSet(uint64(seekUpdate.SectorID)) - if err != nil { - return nil, xerrors.Errorf("failed to check success of replica update: %w", err) - } - if !success { - return nil, xerrors.Errorf("replica update %d failed", seekUpdate.SectorID) - } - return &seekUpdate.SectorID, nil -} - -// dealSectorInPreCommitMsg tries to find a sector containing the specified deal -func dealSectorInPreCommitMsg(msg *types.Message, res pipeline.CurrentDealInfo) (*abi.SectorNumber, error) { - switch msg.Method { - case builtin.MethodsMiner.PreCommitSector: - var params miner.SectorPreCommitInfo - if err := params.UnmarshalCBOR(bytes.NewReader(msg.Params)); err != nil { - return nil, xerrors.Errorf("unmarshal pre commit: %w", err) - } - - // Check through the deal IDs associated with this message - for _, did := range params.DealIDs { - if did == res.DealID { - // Found the deal ID in this message. Callback with the sector ID. - return ¶ms.SectorNumber, nil - } - } - case builtin.MethodsMiner.PreCommitSectorBatch: - var params miner.PreCommitSectorBatchParams - 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 { - 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 { - if did == res.DealID { - // Found the deal ID in this message. Callback with the sector ID. - return &precommit.SectorNumber, nil - } - } - } - default: - return nil, xerrors.Errorf("unexpected method %d", msg.Method) - } - - return nil, nil -} - -// sectorInCommitMsg checks if the provided message commits specified sector -func sectorInCommitMsg(msg *types.Message, sectorNumber abi.SectorNumber) (bool, error) { - switch msg.Method { - case builtin.MethodsMiner.ProveCommitSector: - var params miner.ProveCommitSectorParams - if err := params.UnmarshalCBOR(bytes.NewReader(msg.Params)); err != nil { - return false, xerrors.Errorf("failed to unmarshal prove commit sector params: %w", err) - } - - return params.SectorNumber == sectorNumber, nil - - case builtin.MethodsMiner.ProveCommitAggregate: - var params miner.ProveCommitAggregateParams - if err := params.UnmarshalCBOR(bytes.NewReader(msg.Params)); err != nil { - return false, xerrors.Errorf("failed to unmarshal prove commit sector params: %w", err) - } - - set, err := params.SectorNumbers.IsSet(uint64(sectorNumber)) - if err != nil { - return false, xerrors.Errorf("checking if sectorNumber is set in commit aggregate message: %w", err) - } - - return set, nil - - default: - return false, nil - } -} - -func (mgr *SectorCommittedManager) checkIfDealAlreadyActive(ctx context.Context, ts *types.TipSet, proposal *market.DealProposal, publishCid cid.Cid) (pipeline.CurrentDealInfo, bool, error) { - res, err := mgr.dealInfo.GetCurrentDealInfo(ctx, ts.Key(), proposal, publishCid) - if err != nil { - // TODO: This may be fine for some errors - return res, false, xerrors.Errorf("failed to look up deal on chain: %w", err) - } - - // Sector was slashed - if res.MarketDeal.State.SlashEpoch > 0 { - return res, false, xerrors.Errorf("deal %d was slashed at epoch %d", res.DealID, res.MarketDeal.State.SlashEpoch) - } - - // Sector with deal is already active - if res.MarketDeal.State.SectorStartEpoch > 0 { - return res, true, nil - } - - return res, false, nil -} diff --git a/markets/storageadapter/ondealsectorcommitted_test.go b/markets/storageadapter/ondealsectorcommitted_test.go deleted file mode 100644 index e3d3187809a..00000000000 --- a/markets/storageadapter/ondealsectorcommitted_test.go +++ /dev/null @@ -1,583 +0,0 @@ -// stm: #unit -package storageadapter - -import ( - "bytes" - "context" - "errors" - "fmt" - "math/rand" - "testing" - "time" - - blocks "github.com/ipfs/go-block-format" - "github.com/ipfs/go-cid" - "github.com/stretchr/testify/require" - "golang.org/x/xerrors" - - "github.com/filecoin-project/go-address" - "github.com/filecoin-project/go-state-types/abi" - "github.com/filecoin-project/go-state-types/builtin" - markettypes "github.com/filecoin-project/go-state-types/builtin/v9/market" - minertypes "github.com/filecoin-project/go-state-types/builtin/v9/miner" - "github.com/filecoin-project/go-state-types/cbor" - tutils "github.com/filecoin-project/specs-actors/v2/support/testing" - - "github.com/filecoin-project/lotus/api" - "github.com/filecoin-project/lotus/chain/actors/builtin/market" - "github.com/filecoin-project/lotus/chain/actors/builtin/miner" - "github.com/filecoin-project/lotus/chain/events" - test "github.com/filecoin-project/lotus/chain/events/state/mock" - "github.com/filecoin-project/lotus/chain/types" - pipeline "github.com/filecoin-project/lotus/storage/pipeline" -) - -func TestOnDealSectorPreCommitted(t *testing.T) { - label, err := markettypes.NewLabelFromString("success") - require.NoError(t, err) - - provider := address.TestAddress - ctx := context.Background() - publishCid := generateCids(1)[0] - sealedCid := generateCids(1)[0] - pieceCid := generateCids(1)[0] - dealID := abi.DealID(rand.Uint64()) - sectorNumber := abi.SectorNumber(rand.Uint64()) - proposal := market.DealProposal{ - PieceCID: pieceCid, - PieceSize: abi.PaddedPieceSize(rand.Uint64()), - Client: tutils.NewActorAddr(t, "client"), - Provider: tutils.NewActorAddr(t, "provider"), - StoragePricePerEpoch: abi.NewTokenAmount(1), - ProviderCollateral: abi.NewTokenAmount(1), - ClientCollateral: abi.NewTokenAmount(1), - Label: label, - } - unfinishedDeal := &api.MarketDeal{ - Proposal: proposal, - State: api.MarketDealState{ - SectorStartEpoch: -1, - LastUpdatedEpoch: 2, - }, - } - activeDeal := &api.MarketDeal{ - Proposal: proposal, - State: api.MarketDealState{ - SectorStartEpoch: 1, - LastUpdatedEpoch: 2, - }, - } - slashedDeal := &api.MarketDeal{ - Proposal: proposal, - State: api.MarketDealState{ - SectorStartEpoch: 1, - LastUpdatedEpoch: 2, - SlashEpoch: 2, - }, - } - type testCase struct { - currentDealInfo pipeline.CurrentDealInfo - currentDealInfoErr error - currentDealInfoErr2 error - preCommitDiff *miner.PreCommitChanges - matchStates []matchState - dealStartEpochTimeout bool - expectedCBCallCount uint64 - expectedCBSectorNumber abi.SectorNumber - expectedCBIsActive bool - expectedCBError error - expectedError error - } - testCases := map[string]testCase{ - "normal sequence": { - currentDealInfo: pipeline.CurrentDealInfo{ - DealID: dealID, - MarketDeal: unfinishedDeal, - }, - matchStates: []matchState{ - { - msg: makeMessage(t, provider, builtin.MethodsMiner.PreCommitSector, &minertypes.PreCommitSectorParams{ - SectorNumber: sectorNumber, - SealedCID: sealedCid, - DealIDs: []abi.DealID{dealID}, - }), - }, - }, - expectedCBCallCount: 1, - expectedCBIsActive: false, - expectedCBSectorNumber: sectorNumber, - }, - "ignores unsuccessful pre-commit message": { - currentDealInfo: pipeline.CurrentDealInfo{ - DealID: dealID, - MarketDeal: unfinishedDeal, - }, - matchStates: []matchState{ - { - msg: makeMessage(t, provider, builtin.MethodsMiner.PreCommitSector, &minertypes.PreCommitSectorParams{ - SectorNumber: sectorNumber, - SealedCID: sealedCid, - DealIDs: []abi.DealID{dealID}, - }), - // non-zero exit code indicates unsuccessful pre-commit message - receipt: &types.MessageReceipt{ExitCode: 1}, - }, - }, - expectedCBCallCount: 0, - }, - "deal already pre-committed": { - currentDealInfo: pipeline.CurrentDealInfo{ - DealID: dealID, - MarketDeal: unfinishedDeal, - }, - preCommitDiff: &miner.PreCommitChanges{ - Added: []minertypes.SectorPreCommitOnChainInfo{{ - Info: minertypes.SectorPreCommitInfo{ - SectorNumber: sectorNumber, - DealIDs: []abi.DealID{dealID}, - }, - }}, - }, - expectedCBCallCount: 1, - expectedCBIsActive: false, - expectedCBSectorNumber: sectorNumber, - }, - "error getting current deal info in check func": { - currentDealInfoErr: errors.New("something went wrong"), - expectedCBCallCount: 0, - expectedError: xerrors.Errorf("failed to set up called handler: failed to check deal activity: failed to look up deal on chain: something went wrong"), - }, - "sector already active": { - currentDealInfo: pipeline.CurrentDealInfo{ - DealID: dealID, - MarketDeal: activeDeal, - }, - expectedCBCallCount: 1, - expectedCBIsActive: true, - }, - "sector was slashed": { - currentDealInfo: pipeline.CurrentDealInfo{ - DealID: dealID, - MarketDeal: slashedDeal, - PublishMsgTipSet: types.EmptyTSK, - }, - expectedCBCallCount: 0, - expectedError: xerrors.Errorf("failed to set up called handler: failed to check deal activity: deal %d was slashed at epoch %d", dealID, slashedDeal.State.SlashEpoch), - }, - "error getting current deal info in called func": { - currentDealInfo: pipeline.CurrentDealInfo{ - DealID: dealID, - MarketDeal: unfinishedDeal, - }, - currentDealInfoErr2: errors.New("something went wrong"), - matchStates: []matchState{ - { - msg: makeMessage(t, provider, builtin.MethodsMiner.PreCommitSector, &minertypes.PreCommitSectorParams{ - SectorNumber: sectorNumber, - SealedCID: sealedCid, - DealIDs: []abi.DealID{dealID}, - }), - }, - }, - expectedCBCallCount: 1, - expectedCBError: errors.New("handling applied event: failed to get dealinfo: something went wrong"), - }, - "proposed deal epoch timeout": { - currentDealInfo: pipeline.CurrentDealInfo{ - DealID: dealID, - MarketDeal: activeDeal, - }, - dealStartEpochTimeout: true, - expectedCBCallCount: 1, - expectedCBError: xerrors.Errorf("handling applied event: deal with piece CID %s was not activated by proposed deal start epoch 0", unfinishedDeal.Proposal.PieceCID), - }, - } - runTestCase := func(testCase string, data testCase) { - t.Run(testCase, func(t *testing.T) { - checkTs, err := test.MockTipset(provider, rand.Uint64()) - require.NoError(t, err) - matchMessages := make([]matchMessage, len(data.matchStates)) - for i, ms := range data.matchStates { - matchTs, err := test.MockTipset(provider, rand.Uint64()) - require.NoError(t, err) - matchMessages[i] = matchMessage{ - curH: 5, - msg: ms.msg, - msgReceipt: ms.receipt, - ts: matchTs, - } - } - eventsAPI := &fakeEvents{ - Ctx: ctx, - CheckTs: checkTs, - MatchMessages: matchMessages, - DealStartEpochTimeout: data.dealStartEpochTimeout, - } - cbCallCount := uint64(0) - var cbSectorNumber abi.SectorNumber - var cbIsActive bool - var cbError error - cb := func(secNum abi.SectorNumber, isActive bool, err error) { - cbCallCount++ - cbSectorNumber = secNum - cbIsActive = isActive - cbError = err - } - - mockPCAPI := &mockPreCommitsAPI{ - PCChanges: data.preCommitDiff, - } - mockDIAPI := &mockDealInfoAPI{ - CurrentDealInfo: data.currentDealInfo, - CurrentDealInfo2: data.currentDealInfo, - Err: data.currentDealInfoErr, - Err2: data.currentDealInfoErr2, - } - scm := newSectorCommittedManager(eventsAPI, mockDIAPI, mockPCAPI) - //stm: @MARKET_ADAPTER_ON_SECTOR_PRE_COMMIT_001 - err = scm.OnDealSectorPreCommitted(ctx, provider, proposal, publishCid, cb) - if data.expectedError == nil { - require.NoError(t, err) - } else { - require.EqualError(t, err, data.expectedError.Error()) - } - require.Equal(t, data.expectedCBSectorNumber, cbSectorNumber) - require.Equal(t, data.expectedCBIsActive, cbIsActive) - require.Equal(t, data.expectedCBCallCount, cbCallCount) - if data.expectedCBError == nil { - require.NoError(t, cbError) - } else { - require.EqualError(t, cbError, data.expectedCBError.Error()) - } - }) - } - for testCase, data := range testCases { - runTestCase(testCase, data) - } -} - -func TestOnDealSectorCommitted(t *testing.T) { - label, err := markettypes.NewLabelFromString("success") - require.NoError(t, err) - - provider := address.TestAddress - publishCid := generateCids(1)[0] - pieceCid := generateCids(1)[0] - dealID := abi.DealID(rand.Uint64()) - sectorNumber := abi.SectorNumber(rand.Uint64()) - proposal := market.DealProposal{ - PieceCID: pieceCid, - PieceSize: abi.PaddedPieceSize(rand.Uint64()), - Client: tutils.NewActorAddr(t, "client"), - Provider: tutils.NewActorAddr(t, "provider"), - StoragePricePerEpoch: abi.NewTokenAmount(1), - ProviderCollateral: abi.NewTokenAmount(1), - ClientCollateral: abi.NewTokenAmount(1), - Label: label, - } - unfinishedDeal := &api.MarketDeal{ - Proposal: proposal, - State: api.MarketDealState{ - SectorStartEpoch: -1, - LastUpdatedEpoch: 2, - }, - } - activeDeal := &api.MarketDeal{ - Proposal: proposal, - State: api.MarketDealState{ - SectorStartEpoch: 1, - LastUpdatedEpoch: 2, - }, - } - slashedDeal := &api.MarketDeal{ - Proposal: proposal, - State: api.MarketDealState{ - SectorStartEpoch: 1, - LastUpdatedEpoch: 2, - SlashEpoch: 2, - }, - } - type testCase struct { - currentDealInfo pipeline.CurrentDealInfo - currentDealInfoErr error - currentDealInfo2 pipeline.CurrentDealInfo - currentDealInfoErr2 error - matchStates []matchState - dealStartEpochTimeout bool - expectedCBCallCount uint64 - expectedCBError error - expectedError error - } - testCases := map[string]testCase{ - "normal sequence": { - currentDealInfo: pipeline.CurrentDealInfo{ - DealID: dealID, - MarketDeal: unfinishedDeal, - }, - currentDealInfo2: pipeline.CurrentDealInfo{ - DealID: dealID, - MarketDeal: activeDeal, - }, - matchStates: []matchState{ - { - msg: makeMessage(t, provider, builtin.MethodsMiner.ProveCommitSector, &minertypes.ProveCommitSectorParams{ - SectorNumber: sectorNumber, - }), - }, - }, - expectedCBCallCount: 1, - }, - "ignores unsuccessful prove-commit message": { - currentDealInfo: pipeline.CurrentDealInfo{ - DealID: dealID, - MarketDeal: unfinishedDeal, - }, - currentDealInfo2: pipeline.CurrentDealInfo{ - DealID: dealID, - MarketDeal: activeDeal, - }, - matchStates: []matchState{ - { - msg: makeMessage(t, provider, builtin.MethodsMiner.ProveCommitSector, &minertypes.ProveCommitSectorParams{ - SectorNumber: sectorNumber, - }), - // Exit-code 1 means the prove-commit was unsuccessful - receipt: &types.MessageReceipt{ExitCode: 1}, - }, - }, - expectedCBCallCount: 0, - }, - "error getting current deal info in check func": { - currentDealInfoErr: errors.New("something went wrong"), - expectedCBCallCount: 0, - expectedError: xerrors.Errorf("failed to set up called handler: failed to look up deal on chain: something went wrong"), - }, - "sector already active": { - currentDealInfo: pipeline.CurrentDealInfo{ - DealID: dealID, - MarketDeal: activeDeal, - }, - expectedCBCallCount: 1, - }, - "sector was slashed": { - currentDealInfo: pipeline.CurrentDealInfo{ - DealID: dealID, - MarketDeal: slashedDeal, - }, - expectedCBCallCount: 0, - expectedError: xerrors.Errorf("failed to set up called handler: deal %d was slashed at epoch %d", dealID, slashedDeal.State.SlashEpoch), - }, - "error getting current deal info in called func": { - currentDealInfo: pipeline.CurrentDealInfo{ - DealID: dealID, - MarketDeal: unfinishedDeal, - }, - currentDealInfoErr2: errors.New("something went wrong"), - matchStates: []matchState{ - { - msg: makeMessage(t, provider, builtin.MethodsMiner.ProveCommitSector, &minertypes.ProveCommitSectorParams{ - SectorNumber: sectorNumber, - }), - }, - }, - expectedCBCallCount: 1, - expectedCBError: xerrors.Errorf("handling applied event: failed to look up deal on chain: something went wrong"), - }, - "proposed deal epoch timeout": { - currentDealInfo: pipeline.CurrentDealInfo{ - DealID: dealID, - MarketDeal: unfinishedDeal, - }, - dealStartEpochTimeout: true, - expectedCBCallCount: 1, - expectedCBError: xerrors.Errorf("handling applied event: deal with piece CID %s was not activated by proposed deal start epoch 0", unfinishedDeal.Proposal.PieceCID), - }, - "got prove-commit but deal not active": { - currentDealInfo: pipeline.CurrentDealInfo{ - DealID: dealID, - MarketDeal: unfinishedDeal, - }, - currentDealInfo2: pipeline.CurrentDealInfo{ - DealID: dealID, - MarketDeal: unfinishedDeal, - }, - matchStates: []matchState{ - { - msg: makeMessage(t, provider, builtin.MethodsMiner.ProveCommitSector, &minertypes.ProveCommitSectorParams{ - SectorNumber: sectorNumber, - }), - }, - }, - expectedCBCallCount: 1, - expectedCBError: xerrors.Errorf("handling applied event: deal wasn't active: deal=%d, parentState=bafkqaaa, h=5", dealID), - }, - } - runTestCase := func(testCase string, data testCase) { - t.Run(testCase, func(t *testing.T) { - ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second) - defer cancel() - checkTs, err := test.MockTipset(provider, rand.Uint64()) - require.NoError(t, err) - matchMessages := make([]matchMessage, len(data.matchStates)) - for i, ms := range data.matchStates { - matchTs, err := test.MockTipset(provider, rand.Uint64()) - require.NoError(t, err) - matchMessages[i] = matchMessage{ - curH: 5, - msg: ms.msg, - msgReceipt: ms.receipt, - ts: matchTs, - } - } - eventsAPI := &fakeEvents{ - Ctx: ctx, - CheckTs: checkTs, - MatchMessages: matchMessages, - DealStartEpochTimeout: data.dealStartEpochTimeout, - } - cbCallCount := uint64(0) - var cbError error - cb := func(err error) { - cbCallCount++ - cbError = err - } - mockPCAPI := &mockPreCommitsAPI{} - mockDIAPI := &mockDealInfoAPI{ - CurrentDealInfo: data.currentDealInfo, - CurrentDealInfo2: data.currentDealInfo2, - Err: data.currentDealInfoErr, - Err2: data.currentDealInfoErr2, - } - scm := newSectorCommittedManager(eventsAPI, mockDIAPI, mockPCAPI) - //stm: @MARKET_ADAPTER_ON_SECTOR_COMMIT_001 - err = scm.OnDealSectorCommitted(ctx, provider, sectorNumber, proposal, publishCid, cb) - if data.expectedError == nil { - require.NoError(t, err) - } else { - require.EqualError(t, err, data.expectedError.Error()) - } - require.Equal(t, data.expectedCBCallCount, cbCallCount) - if data.expectedCBError == nil { - require.NoError(t, cbError) - } else { - require.EqualError(t, cbError, data.expectedCBError.Error()) - } - }) - } - for testCase, data := range testCases { - runTestCase(testCase, data) - } -} - -type matchState struct { - msg *types.Message - receipt *types.MessageReceipt -} - -type matchMessage struct { - curH abi.ChainEpoch - msg *types.Message - msgReceipt *types.MessageReceipt - ts *types.TipSet - doesRevert bool -} -type fakeEvents struct { - Ctx context.Context - CheckTs *types.TipSet - MatchMessages []matchMessage - DealStartEpochTimeout bool -} - -func (fe *fakeEvents) Called(ctx context.Context, check events.CheckFunc, msgHnd events.MsgHandler, rev events.RevertHandler, confidence int, timeout abi.ChainEpoch, mf events.MsgMatchFunc) error { - if fe.DealStartEpochTimeout { - msgHnd(nil, nil, nil, 100) // nolint:errcheck - return nil - } - - _, more, err := check(ctx, fe.CheckTs) - if err != nil { - return err - } - if !more { - return nil - } - for _, matchMessage := range fe.MatchMessages { - matched, err := mf(matchMessage.msg) - if err != nil { - return err - } - if matched { - receipt := matchMessage.msgReceipt - if receipt == nil { - receipt = &types.MessageReceipt{ExitCode: 0} - } - more, err := msgHnd(matchMessage.msg, receipt, matchMessage.ts, matchMessage.curH) - if err != nil { - // error is handled through a callback rather than being returned - return nil - } - if matchMessage.doesRevert { - err := rev(ctx, matchMessage.ts) - if err != nil { - return err - } - } - if !more { - return nil - } - } - } - return nil -} - -func makeMessage(t *testing.T, to address.Address, method abi.MethodNum, params cbor.Marshaler) *types.Message { - buf := new(bytes.Buffer) - err := params.MarshalCBOR(buf) - require.NoError(t, err) - return &types.Message{ - To: to, - Method: method, - Params: buf.Bytes(), - } -} - -var seq int - -func generateCids(n int) []cid.Cid { - cids := make([]cid.Cid, 0, n) - for i := 0; i < n; i++ { - c := blocks.NewBlock([]byte(fmt.Sprint(seq))).Cid() - seq++ - cids = append(cids, c) - } - return cids -} - -type mockPreCommitsAPI struct { - PCChanges *miner.PreCommitChanges - Err error -} - -func (m *mockPreCommitsAPI) diffPreCommits(ctx context.Context, actor address.Address, pre, cur types.TipSetKey) (*miner.PreCommitChanges, error) { - pcc := &miner.PreCommitChanges{} - if m.PCChanges != nil { - pcc = m.PCChanges - } - return pcc, m.Err -} - -type mockDealInfoAPI struct { - count int - CurrentDealInfo pipeline.CurrentDealInfo - Err error - CurrentDealInfo2 pipeline.CurrentDealInfo - Err2 error -} - -func (m *mockDealInfoAPI) GetCurrentDealInfo(ctx context.Context, tsk types.TipSetKey, proposal *market.DealProposal, publishCid cid.Cid) (pipeline.CurrentDealInfo, error) { - m.count++ - if m.count == 2 { - return m.CurrentDealInfo2, m.Err2 - } - return m.CurrentDealInfo, m.Err -} diff --git a/markets/storageadapter/provider.go b/markets/storageadapter/provider.go deleted file mode 100644 index 11742c879f6..00000000000 --- a/markets/storageadapter/provider.go +++ /dev/null @@ -1,441 +0,0 @@ -package storageadapter - -// this file implements storagemarket.StorageProviderNode - -import ( - "context" - "time" - - "github.com/ipfs/go-cid" - logging "github.com/ipfs/go-log/v2" - "go.uber.org/fx" - "golang.org/x/xerrors" - - "github.com/filecoin-project/go-address" - "github.com/filecoin-project/go-fil-markets/shared" - "github.com/filecoin-project/go-fil-markets/storagemarket" - "github.com/filecoin-project/go-state-types/abi" - markettypes "github.com/filecoin-project/go-state-types/builtin/v9/market" - "github.com/filecoin-project/go-state-types/crypto" - "github.com/filecoin-project/go-state-types/exitcode" - - "github.com/filecoin-project/lotus/api" - "github.com/filecoin-project/lotus/api/v1api" - "github.com/filecoin-project/lotus/build" - "github.com/filecoin-project/lotus/chain/actors/builtin/market" - "github.com/filecoin-project/lotus/chain/actors/builtin/miner" - "github.com/filecoin-project/lotus/chain/events" - "github.com/filecoin-project/lotus/chain/events/state" - "github.com/filecoin-project/lotus/chain/types" - "github.com/filecoin-project/lotus/lib/sigs" - "github.com/filecoin-project/lotus/markets/utils" - "github.com/filecoin-project/lotus/node/config" - "github.com/filecoin-project/lotus/node/modules/helpers" - pipeline "github.com/filecoin-project/lotus/storage/pipeline" - "github.com/filecoin-project/lotus/storage/pipeline/piece" - "github.com/filecoin-project/lotus/storage/sectorblocks" -) - -var addPieceRetryWait = 5 * time.Minute -var addPieceRetryTimeout = 6 * time.Hour -var defaultMaxProviderCollateralMultiplier = uint64(2) -var log = logging.Logger("storageadapter") - -type ProviderNodeAdapter struct { - v1api.FullNode - - secb *sectorblocks.SectorBlocks - ev *events.Events - - dealPublisher *DealPublisher - - addBalanceSpec *api.MessageSendSpec - maxDealCollateralMultiplier uint64 - dsMatcher *dealStateMatcher - scMgr *SectorCommittedManager -} - -func NewProviderNodeAdapter(fc *config.MinerFeeConfig, dc *config.DealmakingConfig) func(mctx helpers.MetricsCtx, lc fx.Lifecycle, secb *sectorblocks.SectorBlocks, full v1api.FullNode, dealPublisher *DealPublisher) (storagemarket.StorageProviderNode, error) { - return func(mctx helpers.MetricsCtx, lc fx.Lifecycle, secb *sectorblocks.SectorBlocks, full v1api.FullNode, dealPublisher *DealPublisher) (storagemarket.StorageProviderNode, error) { - ctx := helpers.LifecycleCtx(mctx, lc) - - ev, err := events.NewEvents(ctx, full) - if err != nil { - return nil, err - } - na := &ProviderNodeAdapter{ - FullNode: full, - - secb: secb, - ev: ev, - dealPublisher: dealPublisher, - dsMatcher: newDealStateMatcher(state.NewStatePredicates(state.WrapFastAPI(full))), - } - if fc != nil { - na.addBalanceSpec = &api.MessageSendSpec{MaxFee: abi.TokenAmount(fc.MaxMarketBalanceAddFee)} - } - na.maxDealCollateralMultiplier = defaultMaxProviderCollateralMultiplier - if dc != nil { - na.maxDealCollateralMultiplier = dc.MaxProviderCollateralMultiplier - } - na.scMgr = NewSectorCommittedManager(ev, na, &apiWrapper{api: full}) - - return na, nil - } -} - -func (n *ProviderNodeAdapter) PublishDeals(ctx context.Context, deal storagemarket.MinerDeal) (cid.Cid, error) { - return n.dealPublisher.Publish(ctx, deal.ClientDealProposal) -} - -func (n *ProviderNodeAdapter) OnDealComplete(ctx context.Context, deal storagemarket.MinerDeal, pieceSize abi.UnpaddedPieceSize, pieceData shared.ReadSeekStarter) (*storagemarket.PackingResult, error) { - if deal.PublishCid == nil { - return nil, xerrors.Errorf("deal.PublishCid can't be nil") - } - - sdInfo := piece.PieceDealInfo{ - DealID: deal.DealID, - DealProposal: &deal.Proposal, - PublishCid: deal.PublishCid, - DealSchedule: piece.DealSchedule{ - StartEpoch: deal.ClientDealProposal.Proposal.StartEpoch, - EndEpoch: deal.ClientDealProposal.Proposal.EndEpoch, - }, - KeepUnsealed: deal.FastRetrieval, - } - - // Attempt to add the piece to the sector - p, offset, err := n.secb.AddPiece(ctx, pieceSize, pieceData, sdInfo) - curTime := build.Clock.Now() - for build.Clock.Since(curTime) < addPieceRetryTimeout { - // Check if there was an error because of too many sectors being sealed - if !xerrors.Is(err, pipeline.ErrTooManySectorsSealing) { - if err != nil { - log.Errorf("failed to addPiece for deal %d, err: %v", deal.DealID, err) - } - - // There was either a fatal error or no error. In either case - // don't retry AddPiece - break - } - - // The piece could not be added to the sector because there are too - // many sectors being sealed, back-off for a while before trying again - select { - case <-build.Clock.After(addPieceRetryWait): - // Reset the reader to the start - err = pieceData.SeekStart() - if err != nil { - return nil, xerrors.Errorf("failed to reset piece reader to start before retrying AddPiece for deal %d: %w", deal.DealID, err) - } - - // Attempt to add the piece again - p, offset, err = n.secb.AddPiece(ctx, pieceSize, pieceData, sdInfo) - case <-ctx.Done(): - return nil, xerrors.New("context expired while waiting to retry AddPiece") - } - } - - if err != nil { - return nil, xerrors.Errorf("AddPiece failed: %s", err) - } - log.Warnf("New Deal: deal %d", deal.DealID) - - return &storagemarket.PackingResult{ - SectorNumber: p, - Offset: offset, - Size: pieceSize.Padded(), - }, nil -} - -func (n *ProviderNodeAdapter) VerifySignature(ctx context.Context, sig crypto.Signature, addr address.Address, input []byte, encodedTs shared.TipSetToken) (bool, error) { - addr, err := n.StateAccountKey(ctx, addr, types.EmptyTSK) - if err != nil { - return false, err - } - - err = sigs.Verify(&sig, addr, input) - return err == nil, err -} - -func (n *ProviderNodeAdapter) GetMinerWorkerAddress(ctx context.Context, maddr address.Address, tok shared.TipSetToken) (address.Address, error) { - tsk, err := types.TipSetKeyFromBytes(tok) - if err != nil { - return address.Undef, err - } - - mi, err := n.StateMinerInfo(ctx, maddr, tsk) - if err != nil { - return address.Address{}, err - } - return mi.Worker, nil -} - -func (n *ProviderNodeAdapter) GetProofType(ctx context.Context, maddr address.Address, tok shared.TipSetToken) (abi.RegisteredSealProof, error) { - tsk, err := types.TipSetKeyFromBytes(tok) - if err != nil { - return 0, err - } - - mi, err := n.StateMinerInfo(ctx, maddr, tsk) - if err != nil { - return 0, err - } - - nver, err := n.StateNetworkVersion(ctx, tsk) - if err != nil { - return 0, err - } - - // false because this variance is not consumed. - const configWantSynthetic = false - - return miner.PreferredSealProofTypeFromWindowPoStType(nver, mi.WindowPoStProofType, configWantSynthetic) -} - -func (n *ProviderNodeAdapter) SignBytes(ctx context.Context, signer address.Address, b []byte) (*crypto.Signature, error) { - signer, err := n.StateAccountKey(ctx, signer, types.EmptyTSK) - if err != nil { - return nil, err - } - - localSignature, err := n.WalletSign(ctx, signer, b) - if err != nil { - return nil, err - } - return localSignature, nil -} - -func (n *ProviderNodeAdapter) ReserveFunds(ctx context.Context, wallet, addr address.Address, amt abi.TokenAmount) (cid.Cid, error) { - return n.MarketReserveFunds(ctx, wallet, addr, amt) -} - -func (n *ProviderNodeAdapter) ReleaseFunds(ctx context.Context, addr address.Address, amt abi.TokenAmount) error { - return n.MarketReleaseFunds(ctx, addr, amt) -} - -// Adds funds with the StorageMinerActor for a storage participant. Used by both providers and clients. -func (n *ProviderNodeAdapter) AddFunds(ctx context.Context, addr address.Address, amount abi.TokenAmount) (cid.Cid, error) { - // (Provider Node API) - smsg, err := n.MpoolPushMessage(ctx, &types.Message{ - To: market.Address, - From: addr, - Value: amount, - Method: market.Methods.AddBalance, - }, n.addBalanceSpec) - if err != nil { - return cid.Undef, err - } - - return smsg.Cid(), nil -} - -func (n *ProviderNodeAdapter) GetBalance(ctx context.Context, addr address.Address, encodedTs shared.TipSetToken) (storagemarket.Balance, error) { - tsk, err := types.TipSetKeyFromBytes(encodedTs) - if err != nil { - return storagemarket.Balance{}, err - } - - bal, err := n.StateMarketBalance(ctx, addr, tsk) - if err != nil { - return storagemarket.Balance{}, err - } - - return utils.ToSharedBalance(bal), nil -} - -// TODO: why doesnt this method take in a sector ID? -func (n *ProviderNodeAdapter) LocatePieceForDealWithinSector(ctx context.Context, dealID abi.DealID, encodedTs shared.TipSetToken) (sectorID abi.SectorNumber, offset abi.PaddedPieceSize, length abi.PaddedPieceSize, err error) { - refs, err := n.secb.GetRefs(ctx, dealID) - if err != nil { - return 0, 0, 0, err - } - if len(refs) == 0 { - return 0, 0, 0, xerrors.New("no sector information for deal ID") - } - - // TODO: better strategy (e.g. look for already unsealed) - var best api.SealedRef - var bestSi api.SectorInfo - for _, r := range refs { - si, err := n.secb.SectorBuilder.SectorsStatus(ctx, r.SectorID, false) - if err != nil { - return 0, 0, 0, xerrors.Errorf("getting sector info: %w", err) - } - if si.State == api.SectorState(pipeline.Proving) { - best = r - bestSi = si - break - } - } - if bestSi.State == api.SectorState(pipeline.UndefinedSectorState) { - return 0, 0, 0, xerrors.New("no sealed sector found") - } - return best.SectorID, best.Offset, best.Size.Padded(), nil -} - -func (n *ProviderNodeAdapter) DealProviderCollateralBounds(ctx context.Context, size abi.PaddedPieceSize, isVerified bool) (abi.TokenAmount, abi.TokenAmount, error) { - bounds, err := n.StateDealProviderCollateralBounds(ctx, size, isVerified, types.EmptyTSK) - if err != nil { - return abi.TokenAmount{}, abi.TokenAmount{}, err - } - - // The maximum amount of collateral that the provider will put into escrow - // for a deal is calculated as a multiple of the minimum bounded amount - max := types.BigMul(bounds.Min, types.NewInt(n.maxDealCollateralMultiplier)) - - return bounds.Min, max, nil -} - -// TODO: Remove dealID parameter, change publishCid to be cid.Cid (instead of pointer) -func (n *ProviderNodeAdapter) OnDealSectorPreCommitted(ctx context.Context, provider address.Address, dealID abi.DealID, proposal markettypes.DealProposal, publishCid *cid.Cid, cb storagemarket.DealSectorPreCommittedCallback) error { - return n.scMgr.OnDealSectorPreCommitted(ctx, provider, proposal, *publishCid, cb) -} - -// TODO: Remove dealID parameter, change publishCid to be cid.Cid (instead of pointer) -func (n *ProviderNodeAdapter) OnDealSectorCommitted(ctx context.Context, provider address.Address, dealID abi.DealID, sectorNumber abi.SectorNumber, proposal markettypes.DealProposal, publishCid *cid.Cid, cb storagemarket.DealSectorCommittedCallback) error { - return n.scMgr.OnDealSectorCommitted(ctx, provider, sectorNumber, proposal, *publishCid, cb) -} - -func (n *ProviderNodeAdapter) GetChainHead(ctx context.Context) (shared.TipSetToken, abi.ChainEpoch, error) { - head, err := n.ChainHead(ctx) - if err != nil { - return nil, 0, err - } - - return head.Key().Bytes(), head.Height(), nil -} - -func (n *ProviderNodeAdapter) WaitForMessage(ctx context.Context, mcid cid.Cid, cb func(code exitcode.ExitCode, bytes []byte, finalCid cid.Cid, err error) error) error { - receipt, err := n.StateWaitMsg(ctx, mcid, 2*build.MessageConfidence, api.LookbackNoLimit, true) - if err != nil { - return cb(0, nil, cid.Undef, err) - } - return cb(receipt.Receipt.ExitCode, receipt.Receipt.Return, receipt.Message, nil) -} - -func (n *ProviderNodeAdapter) WaitForPublishDeals(ctx context.Context, publishCid cid.Cid, proposal markettypes.DealProposal) (*storagemarket.PublishDealsWaitResult, error) { - // Wait for deal to be published (plus additional time for confidence) - receipt, err := n.StateWaitMsg(ctx, publishCid, 2*build.MessageConfidence, api.LookbackNoLimit, true) - if err != nil { - return nil, xerrors.Errorf("WaitForPublishDeals errored: %w", err) - } - if receipt.Receipt.ExitCode != exitcode.Ok { - return nil, xerrors.Errorf("WaitForPublishDeals exit code: %s", receipt.Receipt.ExitCode) - } - - // The deal ID may have changed since publish if there was a reorg, so - // get the current deal ID - head, err := n.ChainHead(ctx) - if err != nil { - return nil, xerrors.Errorf("WaitForPublishDeals failed to get chain head: %w", err) - } - - res, err := n.scMgr.dealInfo.GetCurrentDealInfo(ctx, head.Key(), &proposal, publishCid) - if err != nil { - return nil, xerrors.Errorf("WaitForPublishDeals getting deal info errored: %w", err) - } - - return &storagemarket.PublishDealsWaitResult{DealID: res.DealID, FinalCid: receipt.Message}, nil -} - -func (n *ProviderNodeAdapter) GetDataCap(ctx context.Context, addr address.Address, encodedTs shared.TipSetToken) (*abi.StoragePower, error) { - tsk, err := types.TipSetKeyFromBytes(encodedTs) - if err != nil { - return nil, err - } - - sp, err := n.StateVerifiedClientStatus(ctx, addr, tsk) - return sp, err -} - -func (n *ProviderNodeAdapter) OnDealExpiredOrSlashed(ctx context.Context, dealID abi.DealID, onDealExpired storagemarket.DealExpiredCallback, onDealSlashed storagemarket.DealSlashedCallback) error { - head, err := n.ChainHead(ctx) - if err != nil { - return xerrors.Errorf("client: failed to get chain head: %w", err) - } - - sd, err := n.StateMarketStorageDeal(ctx, dealID, head.Key()) - if err != nil { - return xerrors.Errorf("client: failed to look up deal %d on chain: %w", dealID, err) - } - - // Called immediately to check if the deal has already expired or been slashed - checkFunc := func(ctx context.Context, ts *types.TipSet) (done bool, more bool, err error) { - if ts == nil { - // keep listening for events - return false, true, nil - } - - // Check if the deal has already expired - if sd.Proposal.EndEpoch <= ts.Height() { - onDealExpired(nil) - return true, false, nil - } - - // If there is no deal assume it's already been slashed - if sd.State.SectorStartEpoch < 0 { - onDealSlashed(ts.Height(), nil) - return true, false, nil - } - - // No events have occurred yet, so return - // done: false, more: true (keep listening for events) - return false, true, nil - } - - // Called when there was a match against the state change we're looking for - // and the chain has advanced to the confidence height - stateChanged := func(ts *types.TipSet, ts2 *types.TipSet, states events.StateChange, h abi.ChainEpoch) (more bool, err error) { - // Check if the deal has already expired - if ts2 == nil || sd.Proposal.EndEpoch <= ts2.Height() { - onDealExpired(nil) - return false, nil - } - - // Timeout waiting for state change - if states == nil { - log.Error("timed out waiting for deal expiry") - return false, nil - } - - changedDeals, ok := states.(state.ChangedDeals) - if !ok { - panic("Expected state.ChangedDeals") - } - - deal, ok := changedDeals[dealID] - if !ok { - // No change to deal - return true, nil - } - - // Deal was slashed - if deal.To == nil { - onDealSlashed(ts2.Height(), nil) - return false, nil - } - - return true, nil - } - - // Called when there was a chain reorg and the state change was reverted - revert := func(ctx context.Context, ts *types.TipSet) error { - // TODO: Is it ok to just ignore this? - log.Warn("deal state reverted; TODO: actually handle this!") - return nil - } - - // Watch for state changes to the deal - match := n.dsMatcher.matcher(ctx, dealID) - - // Wait until after the end epoch for the deal and then timeout - timeout := (sd.Proposal.EndEpoch - head.Height()) + 1 - if err := n.ev.StateChanged(checkFunc, stateChanged, revert, int(build.MessageConfidence)+1, timeout, match); err != nil { - return xerrors.Errorf("failed to set up state changed handler: %w", err) - } - - return nil -} - -var _ storagemarket.StorageProviderNode = &ProviderNodeAdapter{} diff --git a/markets/utils/converters.go b/markets/utils/converters.go deleted file mode 100644 index 9562de695fc..00000000000 --- a/markets/utils/converters.go +++ /dev/null @@ -1,39 +0,0 @@ -package utils - -import ( - "github.com/libp2p/go-libp2p/core/peer" - "github.com/multiformats/go-multiaddr" - - "github.com/filecoin-project/go-address" - "github.com/filecoin-project/go-fil-markets/storagemarket" - "github.com/filecoin-project/go-state-types/abi" - "github.com/filecoin-project/go-state-types/big" - - "github.com/filecoin-project/lotus/api" -) - -func NewStorageProviderInfo(address address.Address, miner address.Address, sectorSize abi.SectorSize, peer peer.ID, addrs []abi.Multiaddrs) storagemarket.StorageProviderInfo { - multiaddrs := make([]multiaddr.Multiaddr, 0, len(addrs)) - for _, a := range addrs { - maddr, err := multiaddr.NewMultiaddrBytes(a) - if err != nil { - return storagemarket.StorageProviderInfo{} - } - multiaddrs = append(multiaddrs, maddr) - } - - return storagemarket.StorageProviderInfo{ - Address: address, - Worker: miner, - SectorSize: uint64(sectorSize), - PeerID: peer, - Addrs: multiaddrs, - } -} - -func ToSharedBalance(bal api.MarketBalance) storagemarket.Balance { - return storagemarket.Balance{ - Locked: bal.Locked, - Available: big.Sub(bal.Escrow, bal.Locked), - } -} diff --git a/markets/utils/selectors.go b/markets/utils/selectors.go deleted file mode 100644 index 1b8a62401dd..00000000000 --- a/markets/utils/selectors.go +++ /dev/null @@ -1,98 +0,0 @@ -package utils - -import ( - "bytes" - "context" - "fmt" - "io" - - // must be imported to init() raw-codec support - _ "github.com/ipld/go-ipld-prime/codec/raw" - - "github.com/ipfs/go-cid" - mdagipld "github.com/ipfs/go-ipld-format" - "github.com/ipfs/go-unixfsnode" - dagpb "github.com/ipld/go-codec-dagpb" - "github.com/ipld/go-ipld-prime" - cidlink "github.com/ipld/go-ipld-prime/linking/cid" - basicnode "github.com/ipld/go-ipld-prime/node/basic" - "github.com/ipld/go-ipld-prime/traversal" - "github.com/ipld/go-ipld-prime/traversal/selector" - selectorparse "github.com/ipld/go-ipld-prime/traversal/selector/parse" -) - -func TraverseDag( - ctx context.Context, - ds mdagipld.DAGService, - startFrom cid.Cid, - optionalSelector ipld.Node, - onOpen func(node mdagipld.Node) error, - visitCallback traversal.AdvVisitFn, -) error { - - if optionalSelector == nil { - optionalSelector = selectorparse.CommonSelector_MatchAllRecursively - } - - parsedSelector, err := selector.ParseSelector(optionalSelector) - if err != nil { - return err - } - - // not sure what this is for TBH: we also provide ctx in &traversal.Config{} - linkContext := ipld.LinkContext{Ctx: ctx} - - // this is what allows us to understand dagpb - nodePrototypeChooser := dagpb.AddSupportToChooser( - func(ipld.Link, ipld.LinkContext) (ipld.NodePrototype, error) { - return basicnode.Prototype.Any, nil - }, - ) - - // this is how we implement GETs - linkSystem := cidlink.DefaultLinkSystem() - linkSystem.StorageReadOpener = func(lctx ipld.LinkContext, lnk ipld.Link) (io.Reader, error) { - cl, isCid := lnk.(cidlink.Link) - if !isCid { - return nil, fmt.Errorf("unexpected link type %#v", lnk) - } - - node, err := ds.Get(lctx.Ctx, cl.Cid) - if err != nil { - return nil, err - } - - if onOpen != nil { - if err := onOpen(node); err != nil { - return nil, err - } - } - - return bytes.NewBuffer(node.RawData()), nil - } - unixfsnode.AddUnixFSReificationToLinkSystem(&linkSystem) - - // this is how we pull the start node out of the DS - startLink := cidlink.Link{Cid: startFrom} - startNodePrototype, err := nodePrototypeChooser(startLink, linkContext) - if err != nil { - return err - } - startNode, err := linkSystem.Load( - linkContext, - startLink, - startNodePrototype, - ) - if err != nil { - return err - } - - // this is the actual execution, invoking the supplied callback - return traversal.Progress{ - Cfg: &traversal.Config{ - Ctx: ctx, - LinkSystem: linkSystem, - LinkTargetNodePrototypeChooser: nodePrototypeChooser, - }, - }.WalkAdv(startNode, parsedSelector, visitCallback) -} diff --git a/node/builder.go b/node/builder.go index 1cd4823d533..5eca9c498b9 100644 --- a/node/builder.go +++ b/node/builder.go @@ -33,7 +33,6 @@ import ( _ "github.com/filecoin-project/lotus/lib/sigs/bls" _ "github.com/filecoin-project/lotus/lib/sigs/delegated" _ "github.com/filecoin-project/lotus/lib/sigs/secp" - "github.com/filecoin-project/lotus/markets/storageadapter" "github.com/filecoin-project/lotus/node/config" "github.com/filecoin-project/lotus/node/impl/common" "github.com/filecoin-project/lotus/node/impl/net" @@ -69,9 +68,7 @@ var ( AutoNATSvcKey = special{10} // Libp2p option BandwidthReporterKey = special{11} // Libp2p option ConnGaterKey = special{12} // Libp2p option - DAGStoreKey = special{13} // constructor returns multiple values ResourceManagerKey = special{14} // Libp2p option - UserAgentKey = special{15} // Libp2p option ) type invoke int @@ -91,7 +88,6 @@ const ( CheckFDLimit CheckFvmConcurrency CheckUDPBufferSize - LegacyMarketsEOL // libp2p PstoreAddSelfKeysKey @@ -396,7 +392,6 @@ func Test() Option { Unset(RunPeerMgrKey), Unset(new(*peermgr.PeerMgr)), Override(new(beacon.Schedule), testing.RandomBeacon), - Override(new(*storageadapter.DealPublisher), storageadapter.NewDealPublisher(nil, storageadapter.PublishMsgConfig{})), Override(new(index.MsgIndex), modules.DummyMsgIndex), ) } diff --git a/node/builder_chain.go b/node/builder_chain.go index 0b40e4530c4..7720dab6dd9 100644 --- a/node/builder_chain.go +++ b/node/builder_chain.go @@ -6,11 +6,6 @@ import ( "go.uber.org/fx" "golang.org/x/xerrors" - "github.com/filecoin-project/go-fil-markets/discovery" - discoveryimpl "github.com/filecoin-project/go-fil-markets/discovery/impl" - "github.com/filecoin-project/go-fil-markets/retrievalmarket" - "github.com/filecoin-project/go-fil-markets/storagemarket" - "github.com/filecoin-project/lotus/api" "github.com/filecoin-project/lotus/chain" "github.com/filecoin-project/lotus/chain/beacon" @@ -32,8 +27,6 @@ import ( ledgerwallet "github.com/filecoin-project/lotus/chain/wallet/ledger" "github.com/filecoin-project/lotus/chain/wallet/remotewallet" "github.com/filecoin-project/lotus/lib/peermgr" - "github.com/filecoin-project/lotus/markets/retrievaladapter" - "github.com/filecoin-project/lotus/markets/storageadapter" "github.com/filecoin-project/lotus/node/config" "github.com/filecoin-project/lotus/node/hello" "github.com/filecoin-project/lotus/node/impl" @@ -104,9 +97,6 @@ var ChainNode = Options( Override(new(*messagepool.MessagePool), modules.MessagePool), Override(new(*dtypes.MpoolLocker), new(dtypes.MpoolLocker)), - // Shared graphsync (markets, serving chain) - Override(new(dtypes.Graphsync), modules.Graphsync(config.DefaultFullNode().Client.SimultaneousTransfersForStorage, config.DefaultFullNode().Client.SimultaneousTransfersForRetrieval)), - // Service: Wallet Override(new(*messagesigner.MessageSigner), messagesigner.NewMessageSigner), Override(new(messagesigner.MsgSigner), func(ms *messagesigner.MessageSigner) *messagesigner.MessageSigner { return ms }), @@ -121,22 +111,8 @@ var ChainNode = Options( Override(HandlePaymentChannelManagerKey, modules.HandlePaychManager), Override(SettlePaymentChannelsKey, settler.SettlePaymentChannels), - // Markets (common) - Override(new(*discoveryimpl.Local), modules.NewLocalDiscovery), - - // Markets (retrieval) - Override(new(discovery.PeerResolver), modules.RetrievalResolver), - Override(new(retrievalmarket.BlockstoreAccessor), modules.RetrievalBlockstoreAccessor), - Override(new(retrievalmarket.RetrievalClient), modules.RetrievalClient(false)), - Override(new(dtypes.ClientDataTransfer), modules.NewClientGraphsyncDataTransfer), - // Markets (storage) Override(new(*market.FundManager), market.NewFundManager), - Override(new(dtypes.ClientDatastore), modules.NewClientDatastore), - Override(new(storagemarket.BlockstoreAccessor), modules.StorageBlockstoreAccessor), - Override(new(*retrievaladapter.APIBlockstoreAccessor), retrievaladapter.NewAPIBlockstoreAdapter), - Override(new(storagemarket.StorageClient), modules.StorageClient), - Override(new(storagemarket.StorageClientNode), storageadapter.NewClientNodeAdapter), Override(HandleMigrateClientFundsKey, modules.HandleMigrateClientFunds), Override(new(*full.GasPriceCache), full.NewGasPriceCache), @@ -224,14 +200,6 @@ func ConfigFullNode(c interface{}) Option { // as it enables us to serve logs in eth_getTransactionReceipt. If(cfg.Fevm.EnableEthRPC || cfg.Events.EnableActorEventsAPI, Override(StoreEventsKey, modules.EnableStoringEvents)), - Override(new(dtypes.ClientImportMgr), modules.ClientImportMgr), - - Override(new(dtypes.ClientBlockstore), modules.ClientBlockstore), - - Override(new(dtypes.Graphsync), modules.Graphsync(cfg.Client.SimultaneousTransfersForStorage, cfg.Client.SimultaneousTransfersForRetrieval)), - - Override(new(retrievalmarket.RetrievalClient), modules.RetrievalClient(cfg.Client.OffChainRetrieval)), - If(cfg.Wallet.RemoteBackend != "", Override(new(*remotewallet.RemoteWallet), remotewallet.SetupRemoteWallet(cfg.Wallet.RemoteBackend)), ), diff --git a/node/builder_miner.go b/node/builder_miner.go index 08c71ba1976..9f2ef30633b 100644 --- a/node/builder_miner.go +++ b/node/builder_miner.go @@ -2,16 +2,10 @@ package node import ( "errors" - "time" - provider "github.com/ipni/index-provider" "go.uber.org/fx" "golang.org/x/xerrors" - "github.com/filecoin-project/go-fil-markets/retrievalmarket" - rmnet "github.com/filecoin-project/go-fil-markets/retrievalmarket/network" - "github.com/filecoin-project/go-fil-markets/storagemarket" - "github.com/filecoin-project/go-fil-markets/storagemarket/impl/storedask" "github.com/filecoin-project/go-state-types/abi" "github.com/filecoin-project/lotus/api" @@ -20,12 +14,6 @@ import ( "github.com/filecoin-project/lotus/chain/gen" "github.com/filecoin-project/lotus/chain/gen/slashfilter" "github.com/filecoin-project/lotus/lib/harmony/harmonydb" - "github.com/filecoin-project/lotus/markets/dagstore" - "github.com/filecoin-project/lotus/markets/dealfilter" - "github.com/filecoin-project/lotus/markets/idxprov" - "github.com/filecoin-project/lotus/markets/retrievaladapter" - "github.com/filecoin-project/lotus/markets/sectoraccessor" - "github.com/filecoin-project/lotus/markets/storageadapter" "github.com/filecoin-project/lotus/miner" "github.com/filecoin-project/lotus/node/config" "github.com/filecoin-project/lotus/node/impl" @@ -62,21 +50,6 @@ func ConfigStorageMiner(c interface{}) Option { return Error(xerrors.Errorf("invalid config from repo, got: %T", c)) } - pricingConfig := cfg.Dealmaking.RetrievalPricing - if pricingConfig.Strategy == config.RetrievalPricingExternalMode { - if pricingConfig.External == nil { - return Error(xerrors.New("retrieval pricing policy has been to set to external but external policy config is nil")) - } - - if pricingConfig.External.Path == "" { - return Error(xerrors.New("retrieval pricing policy has been to set to external but external script path is empty")) - } - } else if pricingConfig.Strategy != config.RetrievalPricingDefaultMode { - return Error(xerrors.New("retrieval pricing policy must be either default or external")) - } - - enableLibp2pNode := cfg.Subsystems.EnableMarkets // we enable libp2p nodes if the storage market subsystem is enabled, otherwise we don't - return Options( Override(new(v1api.FullNode), modules.MakeUuidWrapper), @@ -84,7 +57,7 @@ func ConfigStorageMiner(c interface{}) Option { Override(new(dtypes.DrandSchedule), modules.BuiltinDrandConfig), Override(new(dtypes.BootstrapPeers), modules.BuiltinBootstrap), Override(new(dtypes.DrandBootstrap), modules.DrandBootstrap), - ConfigCommon(&cfg.Common, enableLibp2pNode), + ConfigCommon(&cfg.Common, cfg.EnableLibp2p), Override(CheckFDLimit, modules.CheckFdLimit(build.MinerFDLimit)), // recommend at least 100k FD limit to miners @@ -93,7 +66,6 @@ func ConfigStorageMiner(c interface{}) Option { Override(new(*paths.Local), modules.LocalStorage), Override(new(*paths.Remote), modules.RemoteStorage), Override(new(paths.Store), From(new(*paths.Remote))), - Override(new(dtypes.RetrievalPricingFunc), modules.RetrievalPricingFunc(cfg.Dealmaking)), If(cfg.Subsystems.EnableMining || cfg.Subsystems.EnableSealing, Override(GetParamsKey, modules.GetParams(!cfg.Proving.DisableBuiltinWindowPoSt || !cfg.Proving.DisableBuiltinWinningPoSt || cfg.Storage.AllowCommit || cfg.Storage.AllowProveReplicaUpdate2)), @@ -164,88 +136,6 @@ func ConfigStorageMiner(c interface{}) Option { Override(new(paths.SectorIndex), From(new(modules.MinerSealingService))), ), - If(cfg.Subsystems.EnableMarkets, - - // Alert that legacy-markets is being deprecated - Override(LegacyMarketsEOL, modules.LegacyMarketsEOL), - - // Markets - Override(new(dtypes.StagingBlockstore), modules.StagingBlockstore), - Override(new(dtypes.StagingGraphsync), modules.StagingGraphsync(cfg.Dealmaking.SimultaneousTransfersForStorage, cfg.Dealmaking.SimultaneousTransfersForStoragePerClient, cfg.Dealmaking.SimultaneousTransfersForRetrieval)), - Override(new(dtypes.ProviderPieceStore), modules.NewProviderPieceStore), - Override(new(*sectorblocks.SectorBlocks), sectorblocks.NewSectorBlocks), - - // Markets (retrieval deps) - Override(new(sectorstorage.PieceProvider), sectorstorage.NewPieceProvider), - Override(new(dtypes.RetrievalPricingFunc), modules.RetrievalPricingFunc(config.DealmakingConfig{ - RetrievalPricing: &config.RetrievalPricing{ - Strategy: config.RetrievalPricingDefaultMode, - Default: &config.RetrievalPricingDefault{}, - }, - })), - Override(new(dtypes.RetrievalPricingFunc), modules.RetrievalPricingFunc(cfg.Dealmaking)), - - // DAG Store - Override(new(dagstore.MinerAPI), modules.NewMinerAPI(cfg.DAGStore)), - Override(DAGStoreKey, modules.DAGStore(cfg.DAGStore)), - - // Markets (retrieval) - Override(new(dagstore.SectorAccessor), sectoraccessor.NewSectorAccessor), - Override(new(retrievalmarket.SectorAccessor), From(new(dagstore.SectorAccessor))), - Override(new(retrievalmarket.RetrievalProviderNode), retrievaladapter.NewRetrievalProviderNode), - Override(new(rmnet.RetrievalMarketNetwork), modules.RetrievalNetwork), - Override(new(retrievalmarket.RetrievalProvider), modules.RetrievalProvider), - Override(new(dtypes.RetrievalDealFilter), modules.RetrievalDealFilter(nil)), - Override(HandleRetrievalKey, modules.HandleRetrieval), - - // Markets (storage) - Override(new(dtypes.ProviderTransferNetwork), modules.NewProviderTransferNetwork), - Override(new(dtypes.ProviderTransport), modules.NewProviderTransport), - Override(new(dtypes.ProviderDataTransfer), modules.NewProviderDataTransfer), - Override(new(idxprov.MeshCreator), idxprov.NewMeshCreator), - Override(new(provider.Interface), modules.IndexProvider(cfg.IndexProvider)), - Override(new(*storedask.StoredAsk), modules.NewStorageAsk), - Override(new(dtypes.StorageDealFilter), modules.BasicDealFilter(cfg.Dealmaking, nil)), - Override(new(storagemarket.StorageProvider), modules.StorageProvider), - Override(new(*storageadapter.DealPublisher), storageadapter.NewDealPublisher(nil, storageadapter.PublishMsgConfig{})), - Override(HandleMigrateProviderFundsKey, modules.HandleMigrateProviderFunds), - Override(HandleDealsKey, modules.HandleDeals), - - // Config (todo: get a real property system) - Override(new(dtypes.ConsiderOnlineStorageDealsConfigFunc), modules.NewConsiderOnlineStorageDealsConfigFunc), - Override(new(dtypes.SetConsiderOnlineStorageDealsConfigFunc), modules.NewSetConsideringOnlineStorageDealsFunc), - Override(new(dtypes.ConsiderOnlineRetrievalDealsConfigFunc), modules.NewConsiderOnlineRetrievalDealsConfigFunc), - Override(new(dtypes.SetConsiderOnlineRetrievalDealsConfigFunc), modules.NewSetConsiderOnlineRetrievalDealsConfigFunc), - Override(new(dtypes.StorageDealPieceCidBlocklistConfigFunc), modules.NewStorageDealPieceCidBlocklistConfigFunc), - Override(new(dtypes.SetStorageDealPieceCidBlocklistConfigFunc), modules.NewSetStorageDealPieceCidBlocklistConfigFunc), - Override(new(dtypes.ConsiderOfflineStorageDealsConfigFunc), modules.NewConsiderOfflineStorageDealsConfigFunc), - Override(new(dtypes.SetConsiderOfflineStorageDealsConfigFunc), modules.NewSetConsideringOfflineStorageDealsFunc), - Override(new(dtypes.ConsiderOfflineRetrievalDealsConfigFunc), modules.NewConsiderOfflineRetrievalDealsConfigFunc), - Override(new(dtypes.SetConsiderOfflineRetrievalDealsConfigFunc), modules.NewSetConsiderOfflineRetrievalDealsConfigFunc), - Override(new(dtypes.ConsiderVerifiedStorageDealsConfigFunc), modules.NewConsiderVerifiedStorageDealsConfigFunc), - Override(new(dtypes.SetConsiderVerifiedStorageDealsConfigFunc), modules.NewSetConsideringVerifiedStorageDealsFunc), - Override(new(dtypes.ConsiderUnverifiedStorageDealsConfigFunc), modules.NewConsiderUnverifiedStorageDealsConfigFunc), - Override(new(dtypes.SetConsiderUnverifiedStorageDealsConfigFunc), modules.NewSetConsideringUnverifiedStorageDealsFunc), - Override(new(dtypes.SetExpectedSealDurationFunc), modules.NewSetExpectedSealDurationFunc), - Override(new(dtypes.GetExpectedSealDurationFunc), modules.NewGetExpectedSealDurationFunc), - Override(new(dtypes.SetMaxDealStartDelayFunc), modules.NewSetMaxDealStartDelayFunc), - Override(new(dtypes.GetMaxDealStartDelayFunc), modules.NewGetMaxDealStartDelayFunc), - - If(cfg.Dealmaking.Filter != "", - Override(new(dtypes.StorageDealFilter), modules.BasicDealFilter(cfg.Dealmaking, dealfilter.CliStorageDealFilter(cfg.Dealmaking.Filter))), - ), - - If(cfg.Dealmaking.RetrievalFilter != "", - Override(new(dtypes.RetrievalDealFilter), modules.RetrievalDealFilter(dealfilter.CliRetrievalDealFilter(cfg.Dealmaking.RetrievalFilter))), - ), - Override(new(*storageadapter.DealPublisher), storageadapter.NewDealPublisher(&cfg.Fees, storageadapter.PublishMsgConfig{ - Period: time.Duration(cfg.Dealmaking.PublishMsgPeriod), - MaxDealsPerMsg: cfg.Dealmaking.MaxDealsPerPublishMsg, - StartEpochSealingBuffer: cfg.Dealmaking.StartEpochSealingBuffer, - })), - Override(new(storagemarket.StorageProviderNode), storageadapter.NewProviderNodeAdapter(&cfg.Fees, &cfg.Dealmaking)), - ), - Override(new(config.SealerConfig), cfg.Storage), Override(new(config.ProvingConfig), cfg.Proving), Override(new(config.HarmonyDB), cfg.HarmonyDB), @@ -254,7 +144,7 @@ func ConfigStorageMiner(c interface{}) Option { ) } -func StorageMiner(out *api.StorageMiner, subsystemsCfg config.MinerSubsystemConfig) Option { +func StorageMiner(out *api.StorageMiner, enableLibp2pNode bool) Option { return Options( ApplyIf(func(s *Settings) bool { return s.Config }, Error(errors.New("the StorageMiner option must be set before Config option")), @@ -262,7 +152,7 @@ func StorageMiner(out *api.StorageMiner, subsystemsCfg config.MinerSubsystemConf func(s *Settings) error { s.nodeType = repo.StorageMiner - s.enableLibp2pNode = subsystemsCfg.EnableMarkets + s.enableLibp2pNode = enableLibp2pNode return nil }, diff --git a/node/config/def.go b/node/config/def.go index d2aa7e19859..caf55604a74 100644 --- a/node/config/def.go +++ b/node/config/def.go @@ -2,12 +2,8 @@ package config import ( "encoding" - "os" - "strconv" "time" - "github.com/ipfs/go-cid" - "github.com/filecoin-project/go-state-types/abi" "github.com/filecoin-project/go-state-types/big" "github.com/filecoin-project/go-state-types/network" @@ -18,24 +14,6 @@ import ( "github.com/filecoin-project/lotus/chain/types" ) -const ( - // RetrievalPricingDefault configures the node to use the default retrieval pricing policy. - RetrievalPricingDefaultMode = "default" - // RetrievalPricingExternal configures the node to use the external retrieval pricing script - // configured by the user. - RetrievalPricingExternalMode = "external" -) - -// MaxTraversalLinks configures the maximum number of links to traverse in a DAG while calculating -// CommP and traversing a DAG with graphsync; invokes a budget on DAG depth and density. -var MaxTraversalLinks uint64 = 32 * (1 << 20) - -func init() { - if envMaxTraversal, err := strconv.ParseUint(os.Getenv("LOTUS_MAX_TRAVERSAL_LINKS"), 10, 64); err == nil { - MaxTraversalLinks = envMaxTraversal - } -} - func (b *BatchFeeConfig) FeeForSectors(nSectors int) abi.TokenAmount { return big.Add(big.Int(b.Base), big.Mul(big.NewInt(int64(nSectors)), big.Int(b.PerSector))) } @@ -77,8 +55,6 @@ func defCommon() Common { } } -var DefaultSimultaneousTransfers = uint64(20) - func DefaultDefaultMaxFee() types.FIL { return types.MustParseFIL("0.07") } @@ -90,10 +66,7 @@ func DefaultFullNode() *FullNode { Fees: FeeConfig{ DefaultMaxFee: DefaultDefaultMaxFee(), }, - Client: Client{ - SimultaneousTransfersForStorage: DefaultSimultaneousTransfers, - SimultaneousTransfersForRetrieval: DefaultSimultaneousTransfers, - }, + Chainstore: Chainstore{ EnableSplitstore: true, Splitstore: Splitstore{ @@ -193,55 +166,18 @@ func DefaultStorageMiner() *StorageMiner { }, Dealmaking: DealmakingConfig{ - ConsiderOnlineStorageDeals: true, - ConsiderOfflineStorageDeals: true, - ConsiderOnlineRetrievalDeals: true, - ConsiderOfflineRetrievalDeals: true, - ConsiderVerifiedStorageDeals: true, - ConsiderUnverifiedStorageDeals: true, - PieceCidBlocklist: []cid.Cid{}, - // TODO: It'd be nice to set this based on sector size - MaxDealStartDelay: Duration(time.Hour * 24 * 14), - ExpectedSealDuration: Duration(time.Hour * 24), - PublishMsgPeriod: Duration(time.Hour), - MaxDealsPerPublishMsg: 8, - MaxProviderCollateralMultiplier: 2, - - SimultaneousTransfersForStorage: DefaultSimultaneousTransfers, - SimultaneousTransfersForStoragePerClient: 0, - SimultaneousTransfersForRetrieval: DefaultSimultaneousTransfers, - StartEpochSealingBuffer: 480, // 480 epochs buffer == 4 hours from adding deal to sector to sector being sealed - - RetrievalPricing: &RetrievalPricing{ - Strategy: RetrievalPricingDefaultMode, - Default: &RetrievalPricingDefault{ - VerifiedDealsFreeTransfer: true, - }, - External: &RetrievalPricingExternal{ - Path: "", - }, - }, - }, - - IndexProvider: IndexProviderConfig{ - Enable: true, - EntriesCacheCapacity: 1024, - EntriesChunkSize: 16384, - // The default empty TopicName means it is inferred from network name, in the following - // format: "/indexer/ingest/" - TopicName: "", - PurgeCacheOnStart: false, }, Subsystems: MinerSubsystemConfig{ EnableMining: true, EnableSealing: true, EnableSectorStorage: true, - EnableMarkets: false, EnableSectorIndexDB: false, }, + EnableLibp2p: false, + Fees: MinerFeeConfig{ MaxPreCommitGasFee: types.MustParseFIL("0.025"), MaxCommitGasFee: types.MustParseFIL("0.05"), @@ -270,12 +206,6 @@ func DefaultStorageMiner() *StorageMiner { DealPublishControl: []string{}, }, - DAGStore: DAGStoreConfig{ - MaxConcurrentIndex: 5, - MaxConcurrencyStorageCalls: 100, - MaxConcurrentUnseals: 5, - GCInterval: Duration(1 * time.Minute), - }, HarmonyDB: HarmonyDB{ Hosts: []string{"127.0.0.1"}, Username: "yugabyte", diff --git a/node/config/def_test.go b/node/config/def_test.go index 627b65a5631..2edcce2b59f 100644 --- a/node/config/def_test.go +++ b/node/config/def_test.go @@ -79,9 +79,3 @@ func TestDefaultMinerRoundtrip(t *testing.T) { fmt.Println(c2) require.True(t, reflect.DeepEqual(c, c2)) } - -func TestDefaultStorageMiner_IsEmpty(t *testing.T) { - subject := DefaultStorageMiner() - require.True(t, subject.IndexProvider.Enable) - require.Equal(t, "", subject.IndexProvider.TopicName) -} diff --git a/node/config/doc_gen.go b/node/config/doc_gen.go index 0b6d3758443..027a11a24a3 100644 --- a/node/config/doc_gen.go +++ b/node/config/doc_gen.go @@ -85,30 +85,6 @@ your node if metadata log is disabled`, Comment: ``, }, }, - "Client": { - { - Name: "SimultaneousTransfersForStorage", - Type: "uint64", - - Comment: `The maximum number of simultaneous data transfers between the client -and storage providers for storage deals`, - }, - { - Name: "SimultaneousTransfersForRetrieval", - Type: "uint64", - - Comment: `The maximum number of simultaneous data transfers between the client -and storage providers for retrieval deals`, - }, - { - Name: "OffChainRetrieval", - Type: "bool", - - Comment: `Require that retrievals perform no on-chain operations. Paid retrievals -without existing payment channels with available funds will fail instead -of automatically performing on-chain operations.`, - }, - }, "Common": { { Name: "API", @@ -644,197 +620,13 @@ only need to be run on a single machine in the cluster.`, Comment: `The address that should listen for Web GUI requests.`, }, }, - "DAGStoreConfig": { - { - Name: "RootDir", - Type: "string", - - Comment: `Path to the dagstore root directory. This directory contains three -subdirectories, which can be symlinked to alternative locations if -need be: -- ./transients: caches unsealed deals that have been fetched from the -storage subsystem for serving retrievals. -- ./indices: stores shard indices. -- ./datastore: holds the KV store tracking the state of every shard -known to the DAG store. -Default value: /dagstore (split deployment) or -/dagstore (monolith deployment)`, - }, - { - Name: "MaxConcurrentIndex", - Type: "int", - - Comment: `The maximum amount of indexing jobs that can run simultaneously. -0 means unlimited. -Default value: 5.`, - }, - { - Name: "MaxConcurrentReadyFetches", - Type: "int", - - Comment: `The maximum amount of unsealed deals that can be fetched simultaneously -from the storage subsystem. 0 means unlimited. -Default value: 0 (unlimited).`, - }, - { - Name: "MaxConcurrentUnseals", - Type: "int", - - Comment: `The maximum amount of unseals that can be processed simultaneously -from the storage subsystem. 0 means unlimited. -Default value: 0 (unlimited).`, - }, - { - Name: "MaxConcurrencyStorageCalls", - Type: "int", - - Comment: `The maximum number of simultaneous inflight API calls to the storage -subsystem. -Default value: 100.`, - }, - { - Name: "GCInterval", - Type: "Duration", - - Comment: `The time between calls to periodic dagstore GC, in time.Duration string -representation, e.g. 1m, 5m, 1h. -Default value: 1 minute.`, - }, - }, "DealmakingConfig": { - { - Name: "ConsiderOnlineStorageDeals", - Type: "bool", - - Comment: `When enabled, the miner can accept online deals`, - }, - { - Name: "ConsiderOfflineStorageDeals", - Type: "bool", - - Comment: `When enabled, the miner can accept offline deals`, - }, - { - Name: "ConsiderOnlineRetrievalDeals", - Type: "bool", - - Comment: `When enabled, the miner can accept retrieval deals`, - }, - { - Name: "ConsiderOfflineRetrievalDeals", - Type: "bool", - - Comment: `When enabled, the miner can accept offline retrieval deals`, - }, - { - Name: "ConsiderVerifiedStorageDeals", - Type: "bool", - - Comment: `When enabled, the miner can accept verified deals`, - }, - { - Name: "ConsiderUnverifiedStorageDeals", - Type: "bool", - - Comment: `When enabled, the miner can accept unverified deals`, - }, - { - Name: "PieceCidBlocklist", - Type: "[]cid.Cid", - - Comment: `A list of Data CIDs to reject when making deals`, - }, - { - Name: "ExpectedSealDuration", - Type: "Duration", - - Comment: `Maximum expected amount of time getting the deal into a sealed sector will take -This includes the time the deal will need to get transferred and published -before being assigned to a sector`, - }, - { - Name: "MaxDealStartDelay", - Type: "Duration", - - Comment: `Maximum amount of time proposed deal StartEpoch can be in future`, - }, - { - Name: "PublishMsgPeriod", - Type: "Duration", - - Comment: `When a deal is ready to publish, the amount of time to wait for more -deals to be ready to publish before publishing them all as a batch`, - }, - { - Name: "MaxDealsPerPublishMsg", - Type: "uint64", - - Comment: `The maximum number of deals to include in a single PublishStorageDeals -message`, - }, - { - Name: "MaxProviderCollateralMultiplier", - Type: "uint64", - - Comment: `The maximum collateral that the provider will put up against a deal, -as a multiplier of the minimum collateral bound`, - }, - { - Name: "MaxStagingDealsBytes", - Type: "int64", - - Comment: `The maximum allowed disk usage size in bytes of staging deals not yet -passed to the sealing node by the markets service. 0 is unlimited.`, - }, - { - Name: "SimultaneousTransfersForStorage", - Type: "uint64", - - Comment: `The maximum number of parallel online data transfers for storage deals`, - }, - { - Name: "SimultaneousTransfersForStoragePerClient", - Type: "uint64", - - Comment: `The maximum number of simultaneous data transfers from any single client -for storage deals. -Unset by default (0), and values higher than SimultaneousTransfersForStorage -will have no effect; i.e. the total number of simultaneous data transfers -across all storage clients is bound by SimultaneousTransfersForStorage -regardless of this number.`, - }, - { - Name: "SimultaneousTransfersForRetrieval", - Type: "uint64", - - Comment: `The maximum number of parallel online data transfers for retrieval deals`, - }, { Name: "StartEpochSealingBuffer", Type: "uint64", Comment: `Minimum start epoch buffer to give time for sealing of sector with deal.`, }, - { - Name: "Filter", - Type: "string", - - Comment: `A command used for fine-grained evaluation of storage deals -see https://lotus.filecoin.io/storage-providers/advanced-configurations/market/#using-filters-for-fine-grained-storage-and-retrieval-deal-acceptance for more details`, - }, - { - Name: "RetrievalFilter", - Type: "string", - - Comment: `A command used for fine-grained evaluation of retrieval deals -see https://lotus.filecoin.io/storage-providers/advanced-configurations/market/#using-filters-for-fine-grained-storage-and-retrieval-deal-acceptance for more details`, - }, - { - Name: "RetrievalPricing", - Type: "*RetrievalPricing", - - Comment: ``, - }, }, "EventsConfig": { { @@ -957,12 +749,6 @@ Set to 0 to keep all mappings`, }, }, "FullNode": { - { - Name: "Client", - Type: "Client", - - Comment: ``, - }, { Name: "Wallet", Type: "Wallet", @@ -1048,51 +834,6 @@ in a cluster. Only 1 is required`, EnableMsgIndex enables indexing of messages on chain.`, }, }, - "IndexProviderConfig": { - { - Name: "Enable", - Type: "bool", - - Comment: `Enable set whether to enable indexing announcement to the network and expose endpoints that -allow indexer nodes to process announcements. Enabled by default.`, - }, - { - Name: "EntriesCacheCapacity", - Type: "int", - - Comment: `EntriesCacheCapacity sets the maximum capacity to use for caching the indexing advertisement -entries. Defaults to 1024 if not specified. The cache is evicted using LRU policy. The -maximum storage used by the cache is a factor of EntriesCacheCapacity, EntriesChunkSize and -the length of multihashes being advertised. For example, advertising 128-bit long multihashes -with the default EntriesCacheCapacity, and EntriesChunkSize means the cache size can grow to -256MiB when full.`, - }, - { - Name: "EntriesChunkSize", - Type: "int", - - Comment: `EntriesChunkSize sets the maximum number of multihashes to include in a single entries chunk. -Defaults to 16384 if not specified. Note that chunks are chained together for indexing -advertisements that include more multihashes than the configured EntriesChunkSize.`, - }, - { - Name: "TopicName", - Type: "string", - - Comment: `TopicName sets the topic name on which the changes to the advertised content are announced. -If not explicitly specified, the topic name is automatically inferred from the network name -in following format: '/indexer/ingest/' -Defaults to empty, which implies the topic name is inferred from network name.`, - }, - { - Name: "PurgeCacheOnStart", - Type: "bool", - - Comment: `PurgeCacheOnStart sets whether to clear any cached entries chunks when the provider engine -starts. By default, the cache is rehydrated from previously cached entries stored in -datastore if any is present.`, - }, - }, "JournalConfig": { { Name: "DisabledEvents", @@ -1293,12 +1034,6 @@ over the worker address if this flag is set.`, Comment: ``, }, - { - Name: "EnableMarkets", - Type: "bool", - - Comment: ``, - }, { Name: "EnableSectorIndexDB", Type: "bool", @@ -1529,46 +1264,6 @@ This property is used only if ElasticSearchTracer propery is set.`, Comment: `Auth token that will be passed with logs to elasticsearch - used for weighted peers score.`, }, }, - "RetrievalPricing": { - { - Name: "Strategy", - Type: "string", - - Comment: ``, - }, - { - Name: "Default", - Type: "*RetrievalPricingDefault", - - Comment: ``, - }, - { - Name: "External", - Type: "*RetrievalPricingExternal", - - Comment: ``, - }, - }, - "RetrievalPricingDefault": { - { - Name: "VerifiedDealsFreeTransfer", - Type: "bool", - - Comment: `VerifiedDealsFreeTransfer configures zero fees for data transfer for a retrieval deal -of a payloadCid that belongs to a verified storage deal. -This parameter is ONLY applicable if the retrieval pricing policy strategy has been configured to "default". -default value is true`, - }, - }, - "RetrievalPricingExternal": { - { - Name: "Path", - Type: "string", - - Comment: `Path of the external script that will be run to price a retrieval deal. -This parameter is ONLY applicable if the retrieval pricing policy strategy has been configured to "external".`, - }, - }, "SealerConfig": { { Name: "ParallelFetchLimit", @@ -1986,12 +1681,6 @@ HotstoreMaxSpaceTarget - HotstoreMaxSpaceSafetyBuffer`, Comment: ``, }, - { - Name: "IndexProvider", - Type: "IndexProviderConfig", - - Comment: ``, - }, { Name: "Proving", Type: "ProvingConfig", @@ -2023,14 +1712,14 @@ HotstoreMaxSpaceTarget - HotstoreMaxSpaceSafetyBuffer`, Comment: ``, }, { - Name: "DAGStore", - Type: "DAGStoreConfig", + Name: "HarmonyDB", + Type: "HarmonyDB", Comment: ``, }, { - Name: "HarmonyDB", - Type: "HarmonyDB", + Name: "EnableLibp2p", + Type: "bool", Comment: ``, }, diff --git a/node/config/types.go b/node/config/types.go index 6912839f847..7889ebb6e25 100644 --- a/node/config/types.go +++ b/node/config/types.go @@ -1,8 +1,6 @@ package config import ( - "github.com/ipfs/go-cid" - "github.com/filecoin-project/lotus/chain/types" ) @@ -22,7 +20,6 @@ type Common struct { // FullNode is a full node config type FullNode struct { Common - Client Client Wallet Wallet Fees FeeConfig Chainstore Chainstore @@ -53,17 +50,15 @@ type Logging struct { type StorageMiner struct { Common - Subsystems MinerSubsystemConfig - Dealmaking DealmakingConfig - IndexProvider IndexProviderConfig - Proving ProvingConfig - Sealing SealingConfig - Storage SealerConfig - Fees MinerFeeConfig - Addresses MinerAddressConfig - DAGStore DAGStoreConfig - - HarmonyDB HarmonyDB + Subsystems MinerSubsystemConfig + Dealmaking DealmakingConfig + Proving ProvingConfig + Sealing SealingConfig + Storage SealerConfig + Fees MinerFeeConfig + Addresses MinerAddressConfig + HarmonyDB HarmonyDB + EnableLibp2p bool } type CurioConfig struct { @@ -229,50 +224,10 @@ type CurioSubsystemsConfig struct { GuiAddress string } -type DAGStoreConfig struct { - // Path to the dagstore root directory. This directory contains three - // subdirectories, which can be symlinked to alternative locations if - // need be: - // - ./transients: caches unsealed deals that have been fetched from the - // storage subsystem for serving retrievals. - // - ./indices: stores shard indices. - // - ./datastore: holds the KV store tracking the state of every shard - // known to the DAG store. - // Default value: /dagstore (split deployment) or - // /dagstore (monolith deployment) - RootDir string - - // The maximum amount of indexing jobs that can run simultaneously. - // 0 means unlimited. - // Default value: 5. - MaxConcurrentIndex int - - // The maximum amount of unsealed deals that can be fetched simultaneously - // from the storage subsystem. 0 means unlimited. - // Default value: 0 (unlimited). - MaxConcurrentReadyFetches int - - // The maximum amount of unseals that can be processed simultaneously - // from the storage subsystem. 0 means unlimited. - // Default value: 0 (unlimited). - MaxConcurrentUnseals int - - // The maximum number of simultaneous inflight API calls to the storage - // subsystem. - // Default value: 100. - MaxConcurrencyStorageCalls int - - // The time between calls to periodic dagstore GC, in time.Duration string - // representation, e.g. 1m, 5m, 1h. - // Default value: 1 minute. - GCInterval Duration -} - type MinerSubsystemConfig struct { EnableMining bool EnableSealing bool EnableSectorStorage bool - EnableMarkets bool // When enabled, the sector index will reside in an external database // as opposed to the local KV store in the miner process @@ -303,111 +258,8 @@ type MinerSubsystemConfig struct { } type DealmakingConfig struct { - // When enabled, the miner can accept online deals - ConsiderOnlineStorageDeals bool - // When enabled, the miner can accept offline deals - ConsiderOfflineStorageDeals bool - // When enabled, the miner can accept retrieval deals - ConsiderOnlineRetrievalDeals bool - // When enabled, the miner can accept offline retrieval deals - ConsiderOfflineRetrievalDeals bool - // When enabled, the miner can accept verified deals - ConsiderVerifiedStorageDeals bool - // When enabled, the miner can accept unverified deals - ConsiderUnverifiedStorageDeals bool - // A list of Data CIDs to reject when making deals - PieceCidBlocklist []cid.Cid - // Maximum expected amount of time getting the deal into a sealed sector will take - // This includes the time the deal will need to get transferred and published - // before being assigned to a sector - ExpectedSealDuration Duration - // Maximum amount of time proposed deal StartEpoch can be in future - MaxDealStartDelay Duration - // When a deal is ready to publish, the amount of time to wait for more - // deals to be ready to publish before publishing them all as a batch - PublishMsgPeriod Duration - // The maximum number of deals to include in a single PublishStorageDeals - // message - MaxDealsPerPublishMsg uint64 - // The maximum collateral that the provider will put up against a deal, - // as a multiplier of the minimum collateral bound - MaxProviderCollateralMultiplier uint64 - // The maximum allowed disk usage size in bytes of staging deals not yet - // passed to the sealing node by the markets service. 0 is unlimited. - MaxStagingDealsBytes int64 - // The maximum number of parallel online data transfers for storage deals - SimultaneousTransfersForStorage uint64 - // The maximum number of simultaneous data transfers from any single client - // for storage deals. - // Unset by default (0), and values higher than SimultaneousTransfersForStorage - // will have no effect; i.e. the total number of simultaneous data transfers - // across all storage clients is bound by SimultaneousTransfersForStorage - // regardless of this number. - SimultaneousTransfersForStoragePerClient uint64 - // The maximum number of parallel online data transfers for retrieval deals - SimultaneousTransfersForRetrieval uint64 // Minimum start epoch buffer to give time for sealing of sector with deal. StartEpochSealingBuffer uint64 - - // A command used for fine-grained evaluation of storage deals - // see https://lotus.filecoin.io/storage-providers/advanced-configurations/market/#using-filters-for-fine-grained-storage-and-retrieval-deal-acceptance for more details - Filter string - // A command used for fine-grained evaluation of retrieval deals - // see https://lotus.filecoin.io/storage-providers/advanced-configurations/market/#using-filters-for-fine-grained-storage-and-retrieval-deal-acceptance for more details - RetrievalFilter string - - RetrievalPricing *RetrievalPricing -} - -type IndexProviderConfig struct { - // Enable set whether to enable indexing announcement to the network and expose endpoints that - // allow indexer nodes to process announcements. Enabled by default. - Enable bool - - // EntriesCacheCapacity sets the maximum capacity to use for caching the indexing advertisement - // entries. Defaults to 1024 if not specified. The cache is evicted using LRU policy. The - // maximum storage used by the cache is a factor of EntriesCacheCapacity, EntriesChunkSize and - // the length of multihashes being advertised. For example, advertising 128-bit long multihashes - // with the default EntriesCacheCapacity, and EntriesChunkSize means the cache size can grow to - // 256MiB when full. - EntriesCacheCapacity int - - // EntriesChunkSize sets the maximum number of multihashes to include in a single entries chunk. - // Defaults to 16384 if not specified. Note that chunks are chained together for indexing - // advertisements that include more multihashes than the configured EntriesChunkSize. - EntriesChunkSize int - - // TopicName sets the topic name on which the changes to the advertised content are announced. - // If not explicitly specified, the topic name is automatically inferred from the network name - // in following format: '/indexer/ingest/' - // Defaults to empty, which implies the topic name is inferred from network name. - TopicName string - - // PurgeCacheOnStart sets whether to clear any cached entries chunks when the provider engine - // starts. By default, the cache is rehydrated from previously cached entries stored in - // datastore if any is present. - PurgeCacheOnStart bool -} - -type RetrievalPricing struct { - Strategy string // possible values: "default", "external" - - Default *RetrievalPricingDefault - External *RetrievalPricingExternal -} - -type RetrievalPricingExternal struct { - // Path of the external script that will be run to price a retrieval deal. - // This parameter is ONLY applicable if the retrieval pricing policy strategy has been configured to "external". - Path string -} - -type RetrievalPricingDefault struct { - // VerifiedDealsFreeTransfer configures zero fees for data transfer for a retrieval deal - // of a payloadCid that belongs to a verified storage deal. - // This parameter is ONLY applicable if the retrieval pricing policy strategy has been configured to "default". - // default value is true - VerifiedDealsFreeTransfer bool } type ProvingConfig struct { @@ -966,20 +818,6 @@ type Splitstore struct { } // // Full Node -type Client struct { - // The maximum number of simultaneous data transfers between the client - // and storage providers for storage deals - SimultaneousTransfersForStorage uint64 - // The maximum number of simultaneous data transfers between the client - // and storage providers for retrieval deals - SimultaneousTransfersForRetrieval uint64 - - // Require that retrievals perform no on-chain operations. Paid retrievals - // without existing payment channels with available funds will fail instead - // of automatically performing on-chain operations. - OffChainRetrieval bool -} - type Wallet struct { RemoteBackend string EnableLedger bool diff --git a/node/impl/client/car_helpers.go b/node/impl/client/car_helpers.go deleted file mode 100644 index c638b4bef81..00000000000 --- a/node/impl/client/car_helpers.go +++ /dev/null @@ -1,91 +0,0 @@ -package client - -import ( - "fmt" - "io" - - "github.com/ipfs/go-cid" - cbor "github.com/ipfs/go-ipld-cbor" - "github.com/ipld/go-car/util" - "github.com/multiformats/go-varint" -) - -// ————————————————————————————————————————————————————————— -// -// This code is temporary, and should be deleted when -// https://github.com/ipld/go-car/issues/196 is resolved. -// -// ————————————————————————————————————————————————————————— - -func init() { - cbor.RegisterCborType(CarHeader{}) -} - -type CarHeader struct { - Roots []cid.Cid - Version uint64 -} - -func readHeader(r io.Reader) (*CarHeader, error) { - hb, err := ldRead(r, false) - if err != nil { - return nil, err - } - - var ch CarHeader - if err := cbor.DecodeInto(hb, &ch); err != nil { - return nil, fmt.Errorf("invalid header: %v", err) - } - - return &ch, nil -} - -func writeHeader(h *CarHeader, w io.Writer) error { - hb, err := cbor.DumpObject(h) - if err != nil { - return err - } - - return util.LdWrite(w, hb) -} - -func ldRead(r io.Reader, zeroLenAsEOF bool) ([]byte, error) { - l, err := varint.ReadUvarint(toByteReader(r)) - if err != nil { - // If the length of bytes read is non-zero when the error is EOF then signal an unclean EOF. - if l > 0 && err == io.EOF { - return nil, io.ErrUnexpectedEOF - } - return nil, err - } else if l == 0 && zeroLenAsEOF { - return nil, io.EOF - } - - buf := make([]byte, l) - if _, err := io.ReadFull(r, buf); err != nil { - return nil, err - } - - return buf, nil -} - -type readerPlusByte struct { - io.Reader -} - -func (rb readerPlusByte) ReadByte() (byte, error) { - return readByte(rb) -} - -func readByte(r io.Reader) (byte, error) { - var p [1]byte - _, err := io.ReadFull(r, p[:]) - return p[0], err -} - -func toByteReader(r io.Reader) io.ByteReader { - if br, ok := r.(io.ByteReader); ok { - return br - } - return &readerPlusByte{r} -} diff --git a/node/impl/client/client.go b/node/impl/client/client.go deleted file mode 100644 index c7bb252a10a..00000000000 --- a/node/impl/client/client.go +++ /dev/null @@ -1,1536 +0,0 @@ -package client - -import ( - "bufio" - "bytes" - "context" - "errors" - "fmt" - "io" - "os" - "sort" - "strings" - "sync" - "time" - - "github.com/ipfs/boxo/blockservice" - bstore "github.com/ipfs/boxo/blockstore" - offline "github.com/ipfs/boxo/exchange/offline" - "github.com/ipfs/boxo/files" - "github.com/ipfs/boxo/ipld/merkledag" - unixfile "github.com/ipfs/boxo/ipld/unixfs/file" - "github.com/ipfs/go-cid" - format "github.com/ipfs/go-ipld-format" - logging "github.com/ipfs/go-log/v2" - "github.com/ipld/go-car" - "github.com/ipld/go-car/util" - carv2 "github.com/ipld/go-car/v2" - carv2bs "github.com/ipld/go-car/v2/blockstore" - "github.com/ipld/go-ipld-prime" - "github.com/ipld/go-ipld-prime/datamodel" - cidlink "github.com/ipld/go-ipld-prime/linking/cid" - basicnode "github.com/ipld/go-ipld-prime/node/basic" - "github.com/ipld/go-ipld-prime/traversal" - "github.com/ipld/go-ipld-prime/traversal/selector" - "github.com/ipld/go-ipld-prime/traversal/selector/builder" - selectorparse "github.com/ipld/go-ipld-prime/traversal/selector/parse" - textselector "github.com/ipld/go-ipld-selector-text-lite" - "github.com/libp2p/go-libp2p/core/host" - "github.com/libp2p/go-libp2p/core/peer" - "github.com/multiformats/go-multibase" - "go.uber.org/fx" - "golang.org/x/xerrors" - - "github.com/filecoin-project/go-address" - cborutil "github.com/filecoin-project/go-cbor-util" - "github.com/filecoin-project/go-commp-utils/writer" - datatransfer "github.com/filecoin-project/go-data-transfer/v2" - "github.com/filecoin-project/go-fil-markets/discovery" - rm "github.com/filecoin-project/go-fil-markets/retrievalmarket" - "github.com/filecoin-project/go-fil-markets/storagemarket" - "github.com/filecoin-project/go-fil-markets/storagemarket/network" - "github.com/filecoin-project/go-fil-markets/stores" - "github.com/filecoin-project/go-padreader" - "github.com/filecoin-project/go-state-types/abi" - "github.com/filecoin-project/go-state-types/big" - markettypes "github.com/filecoin-project/go-state-types/builtin/v9/market" - "github.com/filecoin-project/go-state-types/dline" - - "github.com/filecoin-project/lotus/api" - "github.com/filecoin-project/lotus/build" - "github.com/filecoin-project/lotus/chain/actors/builtin/miner" - "github.com/filecoin-project/lotus/chain/store" - "github.com/filecoin-project/lotus/chain/types" - "github.com/filecoin-project/lotus/lib/unixfs" - "github.com/filecoin-project/lotus/markets/retrievaladapter" - "github.com/filecoin-project/lotus/markets/storageadapter" - "github.com/filecoin-project/lotus/markets/utils" - "github.com/filecoin-project/lotus/node/config" - "github.com/filecoin-project/lotus/node/impl/full" - "github.com/filecoin-project/lotus/node/impl/paych" - "github.com/filecoin-project/lotus/node/modules/dtypes" - "github.com/filecoin-project/lotus/node/repo" - "github.com/filecoin-project/lotus/node/repo/imports" -) - -var log = logging.Logger("client") - -var DefaultHashFunction = unixfs.DefaultHashFunction - -// 8 days ~= SealDuration + PreCommit + MaxProveCommitDuration + 8 hour buffer -const dealStartBufferHours uint64 = 8 * 24 -const DefaultDAGStoreDir = "dagstore" - -type API struct { - fx.In - - full.ChainAPI - full.WalletAPI - paych.PaychAPI - full.StateAPI - - SMDealClient storagemarket.StorageClient - RetDiscovery discovery.PeerResolver - Retrieval rm.RetrievalClient - Chain *store.ChainStore - - // accessors for imports and retrievals. - Imports dtypes.ClientImportMgr - StorageBlockstoreAccessor storagemarket.BlockstoreAccessor - RtvlBlockstoreAccessor rm.BlockstoreAccessor - ApiBlockstoreAccessor *retrievaladapter.APIBlockstoreAccessor - - DataTransfer dtypes.ClientDataTransfer - Host host.Host - - Repo repo.LockedRepo -} - -func calcDealExpiration(minDuration uint64, md *dline.Info, startEpoch abi.ChainEpoch) abi.ChainEpoch { - // Make sure we give some time for the miner to seal - minExp := startEpoch + abi.ChainEpoch(minDuration) - - // Align on miners ProvingPeriodBoundary - exp := minExp + md.WPoStProvingPeriod - (minExp % md.WPoStProvingPeriod) + (md.PeriodStart % md.WPoStProvingPeriod) - 1 - // Should only be possible for miners created around genesis - for exp < minExp { - exp += md.WPoStProvingPeriod - } - - return exp -} - -// importManager converts the injected type to the required type. -func (a *API) importManager() *imports.Manager { - return a.Imports -} - -func (a *API) ClientStartDeal(ctx context.Context, params *api.StartDealParams) (*cid.Cid, error) { - return a.dealStarter(ctx, params, false) -} - -func (a *API) ClientStatelessDeal(ctx context.Context, params *api.StartDealParams) (*cid.Cid, error) { - return a.dealStarter(ctx, params, true) -} - -func (a *API) dealStarter(ctx context.Context, params *api.StartDealParams, isStateless bool) (*cid.Cid, error) { - if isStateless { - if params.Data.TransferType != storagemarket.TTManual { - return nil, xerrors.Errorf("invalid transfer type %s for stateless storage deal", params.Data.TransferType) - } - if !params.EpochPrice.IsZero() { - return nil, xerrors.New("stateless storage deals can only be initiated with storage price of 0") - } - } else if params.Data.TransferType == storagemarket.TTGraphsync { - bs, onDone, err := a.dealBlockstore(params.Data.Root) - if err != nil { - return nil, xerrors.Errorf("failed to find blockstore for root CID: %w", err) - } - if has, err := bs.Has(ctx, params.Data.Root); err != nil { - return nil, xerrors.Errorf("failed to query blockstore for root CID: %w", err) - } else if !has { - return nil, xerrors.Errorf("failed to find root CID in blockstore: %w", err) - } - onDone() - } - - walletKey, err := a.StateAccountKey(ctx, params.Wallet, types.EmptyTSK) - if err != nil { - return nil, xerrors.Errorf("failed resolving params.Wallet addr (%s): %w", params.Wallet, err) - } - - exist, err := a.WalletHas(ctx, walletKey) - if err != nil { - return nil, xerrors.Errorf("failed getting addr from wallet (%s): %w", params.Wallet, err) - } - if !exist { - return nil, xerrors.Errorf("provided address doesn't exist in wallet") - } - - mi, err := a.StateMinerInfo(ctx, params.Miner, types.EmptyTSK) - if err != nil { - return nil, xerrors.Errorf("failed getting peer ID: %w", err) - } - - md, err := a.StateMinerProvingDeadline(ctx, params.Miner, types.EmptyTSK) - if err != nil { - return nil, xerrors.Errorf("failed getting miner's deadline info: %w", err) - } - - if uint64(params.Data.PieceSize.Padded()) > uint64(mi.SectorSize) { - return nil, xerrors.New("data doesn't fit in a sector") - } - - dealStart := params.DealStartEpoch - if dealStart <= 0 { // unset, or explicitly 'epoch undefined' - ts, err := a.ChainHead(ctx) - if err != nil { - return nil, xerrors.Errorf("failed getting chain height: %w", err) - } - - blocksPerHour := 60 * 60 / build.BlockDelaySecs - dealStart = ts.Height() + abi.ChainEpoch(dealStartBufferHours*blocksPerHour) // TODO: Get this from storage ask - } - - networkVersion, err := a.StateNetworkVersion(ctx, types.EmptyTSK) - if err != nil { - return nil, xerrors.Errorf("failed to get network version: %w", err) - } - - st, err := miner.PreferredSealProofTypeFromWindowPoStType(networkVersion, mi.WindowPoStProofType, false) - if err != nil { - return nil, xerrors.Errorf("failed to get seal proof type: %w", err) - } - - // regular flow - if !isStateless { - providerInfo := utils.NewStorageProviderInfo(params.Miner, mi.Worker, mi.SectorSize, *mi.PeerId, mi.Multiaddrs) - - result, err := a.SMDealClient.ProposeStorageDeal(ctx, storagemarket.ProposeStorageDealParams{ - Addr: params.Wallet, - Info: &providerInfo, - Data: params.Data, - StartEpoch: dealStart, - EndEpoch: calcDealExpiration(params.MinBlocksDuration, md, dealStart), - Price: params.EpochPrice, - Collateral: params.ProviderCollateral, - Rt: st, - FastRetrieval: params.FastRetrieval, - VerifiedDeal: params.VerifiedDeal, - }) - - if err != nil { - return nil, xerrors.Errorf("failed to start deal: %w", err) - } - - return &result.ProposalCid, nil - } - - // - // stateless flow from here to the end - // - - label, err := markettypes.NewLabelFromString(params.Data.Root.Encode(multibase.MustNewEncoder('u'))) - if err != nil { - return nil, xerrors.Errorf("failed to encode label: %w", err) - } - - dealProposal := &markettypes.DealProposal{ - PieceCID: *params.Data.PieceCid, - PieceSize: params.Data.PieceSize.Padded(), - Client: walletKey, - Provider: params.Miner, - Label: label, - StartEpoch: dealStart, - EndEpoch: calcDealExpiration(params.MinBlocksDuration, md, dealStart), - StoragePricePerEpoch: big.Zero(), - ProviderCollateral: params.ProviderCollateral, - ClientCollateral: big.Zero(), - VerifiedDeal: params.VerifiedDeal, - } - - if dealProposal.ProviderCollateral.IsZero() { - networkCollateral, err := a.StateDealProviderCollateralBounds(ctx, params.Data.PieceSize.Padded(), params.VerifiedDeal, types.EmptyTSK) - if err != nil { - return nil, xerrors.Errorf("failed to determine minimum provider collateral: %w", err) - } - dealProposal.ProviderCollateral = networkCollateral.Min - } - - dealProposalSerialized, err := cborutil.Dump(dealProposal) - if err != nil { - return nil, xerrors.Errorf("failed to serialize deal proposal: %w", err) - } - - dealProposalSig, err := a.WalletSign(ctx, walletKey, dealProposalSerialized) - if err != nil { - return nil, xerrors.Errorf("failed to sign proposal : %w", err) - } - - dealProposalSigned := &markettypes.ClientDealProposal{ - Proposal: *dealProposal, - ClientSignature: *dealProposalSig, - } - dStream, err := network.NewFromLibp2pHost(a.Host, - // params duplicated from .../node/modules/client.go - // https://github.com/filecoin-project/lotus/pull/5961#discussion_r629768011 - network.RetryParameters(time.Second, 5*time.Minute, 15, 5), - ).NewDealStream(ctx, *mi.PeerId) - if err != nil { - return nil, xerrors.Errorf("opening dealstream to %s/%s failed: %w", params.Miner, *mi.PeerId, err) - } - - if err = dStream.WriteDealProposal(network.Proposal{ - FastRetrieval: true, - DealProposal: dealProposalSigned, - Piece: &storagemarket.DataRef{ - TransferType: storagemarket.TTManual, - Root: params.Data.Root, - PieceCid: params.Data.PieceCid, - PieceSize: params.Data.PieceSize, - }, - }); err != nil { - return nil, xerrors.Errorf("sending deal proposal failed: %w", err) - } - - resp, _, err := dStream.ReadDealResponse() - if err != nil { - return nil, xerrors.Errorf("reading proposal response failed: %w", err) - } - - dealProposalIpld, err := cborutil.AsIpld(dealProposalSigned) - if err != nil { - return nil, xerrors.Errorf("serializing proposal node failed: %w", err) - } - - if !dealProposalIpld.Cid().Equals(resp.Response.Proposal) { - return nil, xerrors.Errorf("provider returned proposal cid %s but we expected %s", resp.Response.Proposal, dealProposalIpld.Cid()) - } - - if resp.Response.State != storagemarket.StorageDealWaitingForData { - return nil, xerrors.Errorf("provider returned unexpected state %d for proposal %s, with message: %s", resp.Response.State, resp.Response.Proposal, resp.Response.Message) - } - - return &resp.Response.Proposal, nil -} - -func (a *API) ClientListDeals(ctx context.Context) ([]api.DealInfo, error) { - deals, err := a.SMDealClient.ListLocalDeals(ctx) - if err != nil { - return nil, err - } - - // Get a map of transfer ID => DataTransfer - dataTransfersByID, err := a.transfersByID(ctx) - if err != nil { - return nil, err - } - - out := make([]api.DealInfo, len(deals)) - for k, v := range deals { - // Find the data transfer associated with this deal - var transferCh *api.DataTransferChannel - if v.TransferChannelID != nil { - if ch, ok := dataTransfersByID[*v.TransferChannelID]; ok { - transferCh = &ch - } - } - - out[k] = a.newDealInfoWithTransfer(transferCh, v) - } - - return out, nil -} - -func (a *API) transfersByID(ctx context.Context) (map[datatransfer.ChannelID]api.DataTransferChannel, error) { - inProgressChannels, err := a.DataTransfer.InProgressChannels(ctx) - if err != nil { - return nil, err - } - - dataTransfersByID := make(map[datatransfer.ChannelID]api.DataTransferChannel, len(inProgressChannels)) - for id, channelState := range inProgressChannels { - ch := api.NewDataTransferChannel(a.Host.ID(), channelState) - dataTransfersByID[id] = ch - } - return dataTransfersByID, nil -} - -func (a *API) ClientGetDealInfo(ctx context.Context, d cid.Cid) (*api.DealInfo, error) { - v, err := a.SMDealClient.GetLocalDeal(ctx, d) - if err != nil { - return nil, err - } - - di := a.newDealInfo(ctx, v) - return &di, nil -} - -func (a *API) ClientGetDealUpdates(ctx context.Context) (<-chan api.DealInfo, error) { - updates := make(chan api.DealInfo) - - unsub := a.SMDealClient.SubscribeToEvents(func(_ storagemarket.ClientEvent, deal storagemarket.ClientDeal) { - updates <- a.newDealInfo(ctx, deal) - }) - - go func() { - defer unsub() - <-ctx.Done() - }() - - return updates, nil -} - -func (a *API) newDealInfo(ctx context.Context, v storagemarket.ClientDeal) api.DealInfo { - // Find the data transfer associated with this deal - var transferCh *api.DataTransferChannel - if v.TransferChannelID != nil { - state, err := a.DataTransfer.ChannelState(ctx, *v.TransferChannelID) - - // Note: If there was an error just ignore it, as the data transfer may - // be not found if it's no longer active - if err == nil { - ch := api.NewDataTransferChannel(a.Host.ID(), state) - ch.Stages = state.Stages() - transferCh = &ch - } - } - - di := a.newDealInfoWithTransfer(transferCh, v) - di.DealStages = v.DealStages - return di -} - -func (a *API) newDealInfoWithTransfer(transferCh *api.DataTransferChannel, v storagemarket.ClientDeal) api.DealInfo { - return api.DealInfo{ - ProposalCid: v.ProposalCid, - DataRef: v.DataRef, - State: v.State, - Message: v.Message, - Provider: v.Proposal.Provider, - PieceCID: v.Proposal.PieceCID, - Size: uint64(v.Proposal.PieceSize.Unpadded()), - PricePerEpoch: v.Proposal.StoragePricePerEpoch, - Duration: uint64(v.Proposal.Duration()), - DealID: v.DealID, - CreationTime: v.CreationTime.Time(), - Verified: v.Proposal.VerifiedDeal, - TransferChannelID: v.TransferChannelID, - DataTransfer: transferCh, - } -} - -func (a *API) ClientHasLocal(_ context.Context, root cid.Cid) (bool, error) { - _, onDone, err := a.dealBlockstore(root) - if err != nil { - return false, err - } - onDone() - return true, nil -} - -func (a *API) ClientFindData(ctx context.Context, root cid.Cid, piece *cid.Cid) ([]api.QueryOffer, error) { - peers, err := a.RetDiscovery.GetPeers(root) - if err != nil { - return nil, err - } - - out := make([]api.QueryOffer, 0, len(peers)) - for _, p := range peers { - if piece != nil && !piece.Equals(*p.PieceCID) { - continue - } - - // do not rely on local data with respect to peer id - // fetch an up-to-date miner peer id from chain - mi, err := a.StateMinerInfo(ctx, p.Address, types.EmptyTSK) - if err != nil { - return nil, err - } - pp := rm.RetrievalPeer{ - Address: p.Address, - ID: *mi.PeerId, - } - - out = append(out, a.makeRetrievalQuery(ctx, pp, root, piece, rm.QueryParams{})) - } - - return out, nil -} - -func (a *API) ClientMinerQueryOffer(ctx context.Context, miner address.Address, root cid.Cid, piece *cid.Cid) (api.QueryOffer, error) { - mi, err := a.StateMinerInfo(ctx, miner, types.EmptyTSK) - if err != nil { - return api.QueryOffer{}, err - } - rp := rm.RetrievalPeer{ - Address: miner, - ID: *mi.PeerId, - } - return a.makeRetrievalQuery(ctx, rp, root, piece, rm.QueryParams{}), nil -} - -func (a *API) makeRetrievalQuery(ctx context.Context, rp rm.RetrievalPeer, payload cid.Cid, piece *cid.Cid, qp rm.QueryParams) api.QueryOffer { - queryResponse, err := a.Retrieval.Query(ctx, rp, payload, qp) - if err != nil { - return api.QueryOffer{Err: err.Error(), Miner: rp.Address, MinerPeer: rp} - } - var errStr string - switch queryResponse.Status { - case rm.QueryResponseAvailable: - errStr = "" - case rm.QueryResponseUnavailable: - errStr = fmt.Sprintf("retrieval query offer was unavailable: %s", queryResponse.Message) - case rm.QueryResponseError: - errStr = fmt.Sprintf("retrieval query offer errored: %s", queryResponse.Message) - } - - return api.QueryOffer{ - Root: payload, - Piece: piece, - Size: queryResponse.Size, - MinPrice: queryResponse.PieceRetrievalPrice(), - UnsealPrice: queryResponse.UnsealPrice, - PricePerByte: queryResponse.MinPricePerByte, - PaymentInterval: queryResponse.MaxPaymentInterval, - PaymentIntervalIncrease: queryResponse.MaxPaymentIntervalIncrease, - Miner: queryResponse.PaymentAddress, // TODO: check - MinerPeer: rp, - Err: errStr, - } -} - -func (a *API) ClientImport(ctx context.Context, ref api.FileRef) (res *api.ImportRes, err error) { - var ( - imgr = a.importManager() - id imports.ID - root cid.Cid - carPath string - ) - - id, err = imgr.CreateImport() - if err != nil { - return nil, xerrors.Errorf("failed to create import: %w", err) - } - - if ref.IsCAR { - // user gave us a CAR file, use it as-is - // validate that it's either a carv1 or carv2, and has one root. - f, err := os.Open(ref.Path) - if err != nil { - return nil, xerrors.Errorf("failed to open CAR file: %w", err) - } - defer f.Close() //nolint:errcheck - - hd, err := car.ReadHeader(bufio.NewReader(f)) - if err != nil { - return nil, xerrors.Errorf("failed to read CAR header: %w", err) - } - if len(hd.Roots) != 1 { - return nil, xerrors.New("car file can have one and only one root") - } - if hd.Version != 1 && hd.Version != 2 { - return nil, xerrors.Errorf("car version must be 1 or 2, is %d", hd.Version) - } - - carPath = ref.Path - root = hd.Roots[0] - } else { - carPath, err = imgr.AllocateCAR(id) - if err != nil { - return nil, xerrors.Errorf("failed to create car path for import: %w", err) - } - - // remove the import if something went wrong. - defer func() { - if err != nil { - _ = os.Remove(carPath) - _ = imgr.Remove(id) - } - }() - - // perform the unixfs chunking. - root, err = unixfs.CreateFilestore(ctx, ref.Path, carPath) - if err != nil { - return nil, xerrors.Errorf("failed to import file using unixfs: %w", err) - } - } - - if err = imgr.AddLabel(id, imports.LSource, "import"); err != nil { - return nil, err - } - if err = imgr.AddLabel(id, imports.LFileName, ref.Path); err != nil { - return nil, err - } - if err = imgr.AddLabel(id, imports.LCARPath, carPath); err != nil { - return nil, err - } - if err = imgr.AddLabel(id, imports.LRootCid, root.String()); err != nil { - return nil, err - } - return &api.ImportRes{ - Root: root, - ImportID: id, - }, nil -} - -func (a *API) ClientRemoveImport(ctx context.Context, id imports.ID) error { - info, err := a.importManager().Info(id) - if err != nil { - return xerrors.Errorf("failed to get import metadata: %w", err) - } - - owner := info.Labels[imports.LCAROwner] - path := info.Labels[imports.LCARPath] - - // CARv2 file was not provided by the user, delete it. - if path != "" && owner == imports.CAROwnerImportMgr { - _ = os.Remove(path) - } - - return a.importManager().Remove(id) -} - -// ClientImportLocal imports a standard file into this node as a UnixFS payload, -// storing it in a CARv2 file. Note that this method is NOT integrated with the -// IPFS blockstore. That is, if client-side IPFS integration is enabled, this -// method won't import the file into that -func (a *API) ClientImportLocal(ctx context.Context, r io.Reader) (cid.Cid, error) { - file := files.NewReaderFile(r) - - // write payload to temp file - id, err := a.importManager().CreateImport() - if err != nil { - return cid.Undef, err - } - if err := a.importManager().AddLabel(id, imports.LSource, "import-local"); err != nil { - return cid.Undef, err - } - - path, err := a.importManager().AllocateCAR(id) - if err != nil { - return cid.Undef, err - } - - // writing a carv2 requires knowing the root ahead of time, which makes - // streaming cases impossible. - // https://github.com/ipld/go-car/issues/196 - // we work around this limitation by informing a placeholder root CID of the - // same length as our unixfs chunking strategy will generate. - // once the DAG is formed and the root is calculated, we overwrite the - // inner carv1 header with the final root. - - b, err := unixfs.CidBuilder() - if err != nil { - return cid.Undef, err - } - - // placeholder payload needs to be larger than inline CID threshold; 256 - // bytes is a safe value. - placeholderRoot, err := b.Sum(make([]byte, 256)) - if err != nil { - return cid.Undef, xerrors.Errorf("failed to calculate placeholder root: %w", err) - } - - bs, err := carv2bs.OpenReadWrite(path, []cid.Cid{placeholderRoot}, carv2bs.UseWholeCIDs(true)) - if err != nil { - return cid.Undef, xerrors.Errorf("failed to create carv2 read/write blockstore: %w", err) - } - - root, err := unixfs.Build(ctx, file, bs, false) - if err != nil { - return cid.Undef, xerrors.Errorf("failed to build unixfs dag: %w", err) - } - - err = bs.Finalize() - if err != nil { - return cid.Undef, xerrors.Errorf("failed to finalize carv2 read/write blockstore: %w", err) - } - - // record the root in the import manager. - if err := a.importManager().AddLabel(id, imports.LRootCid, root.String()); err != nil { - return cid.Undef, xerrors.Errorf("failed to record root CID in import manager: %w", err) - } - - // now go ahead and overwrite the root in the carv1 header. - reader, err := carv2.OpenReader(path) - if err != nil { - return cid.Undef, xerrors.Errorf("failed to create car reader: %w", err) - } - - // save the header offset. - headerOff := reader.Header.DataOffset - - // read the old header. - dr, err := reader.DataReader() - if err != nil { - return cid.Undef, fmt.Errorf("failed to get car data reader: %w", err) - } - header, err := readHeader(dr) - if err != nil { - return cid.Undef, xerrors.Errorf("failed to read car reader: %w", err) - } - _ = reader.Close() // close the CAR reader. - - // write the old header into a buffer. - var oldBuf bytes.Buffer - if err = writeHeader(header, &oldBuf); err != nil { - return cid.Undef, xerrors.Errorf("failed to write header into buffer: %w", err) - } - - // replace the root. - header.Roots = []cid.Cid{root} - - // write the new header into a buffer. - var newBuf bytes.Buffer - err = writeHeader(header, &newBuf) - if err != nil { - return cid.Undef, xerrors.Errorf("failed to write header into buffer: %w", err) - } - - // verify the length matches. - if newBuf.Len() != oldBuf.Len() { - return cid.Undef, xerrors.Errorf("failed to replace carv1 header; length mismatch (old: %d, new: %d)", oldBuf.Len(), newBuf.Len()) - } - - // open the file again, seek to the header position, and write. - f, err := os.OpenFile(path, os.O_WRONLY, 0755) - if err != nil { - return cid.Undef, xerrors.Errorf("failed to open car: %w", err) - } - defer f.Close() //nolint:errcheck - - n, err := f.WriteAt(newBuf.Bytes(), int64(headerOff)) - if err != nil { - return cid.Undef, xerrors.Errorf("failed to write new header to car (bytes written: %d): %w", n, err) - } - return root, nil -} - -func (a *API) ClientListImports(_ context.Context) ([]api.Import, error) { - ids, err := a.importManager().List() - if err != nil { - return nil, xerrors.Errorf("failed to fetch imports: %w", err) - } - - out := make([]api.Import, len(ids)) - for i, id := range ids { - info, err := a.importManager().Info(id) - if err != nil { - out[i] = api.Import{ - Key: id, - Err: xerrors.Errorf("getting info: %w", err).Error(), - } - continue - } - - ai := api.Import{ - Key: id, - Source: info.Labels[imports.LSource], - FilePath: info.Labels[imports.LFileName], - CARPath: info.Labels[imports.LCARPath], - } - - if info.Labels[imports.LRootCid] != "" { - c, err := cid.Parse(info.Labels[imports.LRootCid]) - if err != nil { - ai.Err = err.Error() - } else { - ai.Root = &c - } - } - - out[i] = ai - } - - return out, nil -} - -func (a *API) ClientCancelRetrievalDeal(ctx context.Context, dealID rm.DealID) error { - cerr := make(chan error) - go func() { - err := a.Retrieval.CancelDeal(dealID) - - select { - case cerr <- err: - case <-ctx.Done(): - } - }() - - select { - case err := <-cerr: - if err != nil { - return xerrors.Errorf("failed to cancel retrieval deal: %w", err) - } - - return nil - case <-ctx.Done(): - return xerrors.Errorf("context timeout while canceling retrieval deal: %w", ctx.Err()) - } -} - -func getDataSelector(dps *api.Selector, matchPath bool) (datamodel.Node, error) { - sel := selectorparse.CommonSelector_ExploreAllRecursively - if dps != nil { - - if strings.HasPrefix(string(*dps), "{") { - var err error - sel, err = selectorparse.ParseJSONSelector(string(*dps)) - if err != nil { - return nil, xerrors.Errorf("failed to parse json-selector '%s': %w", *dps, err) - } - } else { - ssb := builder.NewSelectorSpecBuilder(basicnode.Prototype.Any) - - selspec, err := textselector.SelectorSpecFromPath( - textselector.Expression(*dps), matchPath, - - ssb.ExploreRecursive( - selector.RecursionLimitNone(), - ssb.ExploreUnion(ssb.Matcher(), ssb.ExploreAll(ssb.ExploreRecursiveEdge())), - ), - ) - if err != nil { - return nil, xerrors.Errorf("failed to parse text-selector '%s': %w", *dps, err) - } - - sel = selspec.Node() - log.Infof("partial retrieval of datamodel-path-selector %s/*", *dps) - } - } - - return sel, nil -} - -func (a *API) ClientRetrieve(ctx context.Context, params api.RetrievalOrder) (*api.RestrievalRes, error) { - sel, err := getDataSelector(params.DataSelector, false) - if err != nil { - return nil, err - } - - di, err := a.doRetrieval(ctx, params, sel) - if err != nil { - return nil, err - } - - return &api.RestrievalRes{ - DealID: di, - }, nil -} - -func (a *API) doRetrieval(ctx context.Context, order api.RetrievalOrder, sel datamodel.Node) (rm.DealID, error) { - if order.MinerPeer == nil || order.MinerPeer.ID == "" { - mi, err := a.StateMinerInfo(ctx, order.Miner, types.EmptyTSK) - if err != nil { - return 0, err - } - - order.MinerPeer = &rm.RetrievalPeer{ - ID: *mi.PeerId, - Address: order.Miner, - } - } - - if order.Total.Int == nil { - return 0, xerrors.Errorf("cannot make retrieval deal for null total") - } - - if order.Size == 0 { - return 0, xerrors.Errorf("cannot make retrieval deal for zero bytes") - } - - ppb := types.BigDiv(big.Sub(order.Total, order.UnsealPrice), types.NewInt(order.Size)) - - params, err := rm.NewParamsV1(ppb, order.PaymentInterval, order.PaymentIntervalIncrease, sel, order.Piece, order.UnsealPrice) - if err != nil { - return 0, xerrors.Errorf("Error in retrieval params: %s", err) - } - - id := a.Retrieval.NextID() - - if order.RemoteStore != nil { - if err := a.ApiBlockstoreAccessor.RegisterDealToRetrievalStore(id, *order.RemoteStore); err != nil { - return 0, xerrors.Errorf("registering api store: %w", err) - } - } - - id, err = a.Retrieval.Retrieve( - ctx, - id, - order.Root, - params, - order.Total, - *order.MinerPeer, - order.Client, - order.Miner, - ) - - if err != nil { - return 0, xerrors.Errorf("Retrieve failed: %w", err) - } - - return id, nil -} - -func (a *API) ClientRetrieveWait(ctx context.Context, deal rm.DealID) error { - ctx, cancel := context.WithCancel(ctx) - defer cancel() - - subscribeEvents := make(chan rm.ClientDealState, 1) - - unsubscribe := a.Retrieval.SubscribeToEvents(func(event rm.ClientEvent, state rm.ClientDealState) { - // We'll check the deal IDs inside consumeAllEvents. - if state.ID != deal { - return - } - select { - case <-ctx.Done(): - case subscribeEvents <- state: - } - }) - defer unsubscribe() - - { - state, err := a.Retrieval.GetDeal(deal) - if err != nil { - return xerrors.Errorf("getting deal state: %w", err) - } - select { - case subscribeEvents <- state: - default: // already have an event queued from the subscription - } - } - - for { - select { - case <-ctx.Done(): - return xerrors.New("Retrieval Timed Out") - case state := <-subscribeEvents: - switch state.Status { - case rm.DealStatusCompleted: - return nil - case rm.DealStatusRejected: - return xerrors.Errorf("Retrieval Proposal Rejected: %s", state.Message) - case rm.DealStatusCancelled: - return xerrors.Errorf("Retrieval was cancelled externally: %s", state.Message) - case - rm.DealStatusDealNotFound, - rm.DealStatusErrored: - return xerrors.Errorf("Retrieval Error: %s", state.Message) - } - } - } -} - -type ExportDest struct { - Writer io.Writer - Path string -} - -func (ed *ExportDest) doWrite(cb func(io.Writer) error) error { - if ed.Writer != nil { - return cb(ed.Writer) - } - - f, err := os.OpenFile(ed.Path, os.O_CREATE|os.O_WRONLY, 0644) - if err != nil { - return err - } - - if err := cb(f); err != nil { - _ = f.Close() - return err - } - - return f.Close() -} - -func (a *API) ClientExport(ctx context.Context, exportRef api.ExportRef, ref api.FileRef) error { - return a.ClientExportInto(ctx, exportRef, ref.IsCAR, ExportDest{Path: ref.Path}) -} - -func (a *API) ClientExportInto(ctx context.Context, exportRef api.ExportRef, car bool, dest ExportDest) error { - proxyBss, retrieveIntoIPFS := a.RtvlBlockstoreAccessor.(*retrievaladapter.ProxyBlockstoreAccessor) - carBss, retrieveIntoCAR := a.RtvlBlockstoreAccessor.(*retrievaladapter.CARBlockstoreAccessor) - carPath := exportRef.FromLocalCAR - - if carPath == "" { - if !retrieveIntoIPFS && !retrieveIntoCAR { - return xerrors.Errorf("unsupported retrieval blockstore accessor") - } - - if retrieveIntoCAR { - carPath = carBss.PathFor(exportRef.DealID) - } - } - - var retrievalBs bstore.Blockstore - if retrieveIntoIPFS { - retrievalBs = proxyBss.Blockstore - } else { - cbs, err := stores.ReadOnlyFilestore(carPath) - if err != nil { - return err - } - defer cbs.Close() //nolint:errcheck - retrievalBs = cbs - } - - dserv := merkledag.NewDAGService(blockservice.New(retrievalBs, offline.Exchange(retrievalBs))) - - // Are we outputting a CAR? - if car { - // not IPFS and we do full selection - just extract the CARv1 from the CARv2 we stored the retrieval in - if !retrieveIntoIPFS && len(exportRef.DAGs) == 0 && dest.Writer == nil { - return carv2.ExtractV1File(carPath, dest.Path) - } - } - - roots, err := parseDagSpec(ctx, exportRef.Root, exportRef.DAGs, dserv, car) - if err != nil { - return xerrors.Errorf("parsing dag spec: %w", err) - } - if car { - return a.outputCAR(ctx, dserv, retrievalBs, exportRef.Root, roots, dest) - } - - if len(roots) != 1 { - return xerrors.Errorf("unixfs retrieval requires one root node, got %d", len(roots)) - } - - return a.outputUnixFS(ctx, roots[0].root, dserv, dest) -} - -func (a *API) outputCAR(ctx context.Context, ds format.DAGService, bs bstore.Blockstore, root cid.Cid, dags []dagSpec, dest ExportDest) error { - // generating a CARv1 from the configured blockstore - roots := make([]cid.Cid, len(dags)) - for i, dag := range dags { - roots[i] = dag.root - } - - var lk sync.Mutex - - return dest.doWrite(func(w io.Writer) error { - - if err := car.WriteHeader(&car.CarHeader{ - Roots: roots, - Version: 1, - }, w); err != nil { - return fmt.Errorf("failed to write car header: %s", err) - } - - cs := cid.NewSet() - - for _, dagSpec := range dags { - dagSpec := dagSpec - - if err := utils.TraverseDag( - ctx, - ds, - root, - dagSpec.selector, - func(node format.Node) error { - // if we're exporting merkle proofs for this dag, export all nodes read by the traversal - if dagSpec.exportAll { - lk.Lock() - defer lk.Unlock() - if cs.Visit(node.Cid()) { - err := util.LdWrite(w, node.Cid().Bytes(), node.RawData()) - if err != nil { - return xerrors.Errorf("writing block data: %w", err) - } - } - } - return nil - }, - func(p traversal.Progress, n ipld.Node, r traversal.VisitReason) error { - if !dagSpec.exportAll && r == traversal.VisitReason_SelectionMatch { - var c cid.Cid - if p.LastBlock.Link == nil { - c = root - } else { - cidLnk, castOK := p.LastBlock.Link.(cidlink.Link) - if !castOK { - return xerrors.Errorf("cidlink cast unexpectedly failed on '%s'", p.LastBlock.Link) - } - - c = cidLnk.Cid - } - - if cs.Visit(c) { - nb, err := bs.Get(ctx, c) - if err != nil { - return xerrors.Errorf("getting block data: %w", err) - } - - err = util.LdWrite(w, c.Bytes(), nb.RawData()) - if err != nil { - return xerrors.Errorf("writing block data: %w", err) - } - } - - return nil - } - return nil - }, - ); err != nil { - return xerrors.Errorf("error while traversing car dag: %w", err) - } - } - - return nil - }) -} - -func (a *API) outputUnixFS(ctx context.Context, root cid.Cid, ds format.DAGService, dest ExportDest) error { - nd, err := ds.Get(ctx, root) - if err != nil { - return xerrors.Errorf("ClientRetrieve: %w", err) - } - file, err := unixfile.NewUnixfsFile(ctx, ds, nd) - if err != nil { - return xerrors.Errorf("ClientRetrieve: %w", err) - } - - if dest.Writer == nil { - return files.WriteTo(file, dest.Path) - } - - switch f := file.(type) { - case files.File: - _, err = io.Copy(dest.Writer, f) - if err != nil { - return err - } - return nil - default: - return fmt.Errorf("file type %T is not supported", nd) - } -} - -type dagSpec struct { - root cid.Cid - selector ipld.Node - exportAll bool -} - -func parseDagSpec(ctx context.Context, root cid.Cid, dsp []api.DagSpec, ds format.DAGService, car bool) ([]dagSpec, error) { - if len(dsp) == 0 { - return []dagSpec{ - { - root: root, - selector: nil, - }, - }, nil - } - - out := make([]dagSpec, len(dsp)) - for i, spec := range dsp { - out[i].exportAll = spec.ExportMerkleProof - - if spec.DataSelector == nil { - return nil, xerrors.Errorf("invalid DagSpec at position %d: `DataSelector` can not be nil", i) - } - - // reify selector - var err error - out[i].selector, err = getDataSelector(spec.DataSelector, car && spec.ExportMerkleProof) - if err != nil { - return nil, err - } - - // find the pointed-at root node within the containing ds - var rsn ipld.Node - - if strings.HasPrefix(string(*spec.DataSelector), "{") { - var err error - rsn, err = selectorparse.ParseJSONSelector(string(*spec.DataSelector)) - if err != nil { - return nil, xerrors.Errorf("failed to parse json-selector '%s': %w", *spec.DataSelector, err) - } - } else { - selspec, _ := textselector.SelectorSpecFromPath(textselector.Expression(*spec.DataSelector), car && spec.ExportMerkleProof, nil) //nolint:errcheck - rsn = selspec.Node() - } - - var newRoot cid.Cid - var errHalt = errors.New("halt walk") - if err := utils.TraverseDag( - ctx, - ds, - root, - rsn, - nil, - func(p traversal.Progress, n ipld.Node, r traversal.VisitReason) error { - if r == traversal.VisitReason_SelectionMatch { - if !car && p.LastBlock.Path.String() != p.Path.String() { - return xerrors.Errorf("unsupported selection path '%s' does not correspond to a block boundary (a.k.a. CID link)", p.Path.String()) - } - - if p.LastBlock.Link == nil { - // this is likely the root node that we've matched here - newRoot = root - return errHalt - } - - cidLnk, castOK := p.LastBlock.Link.(cidlink.Link) - if !castOK { - return xerrors.Errorf("cidlink cast unexpectedly failed on '%s'", p.LastBlock.Link) - } - - newRoot = cidLnk.Cid - - return errHalt - } - return nil - }, - ); err != nil && err != errHalt { - return nil, xerrors.Errorf("error while locating partial retrieval sub-root: %w", err) - } - - if newRoot == cid.Undef { - return nil, xerrors.Errorf("path selection does not match a node within %s", root) - } - - out[i].root = newRoot - } - - return out, nil -} - -func (a *API) ClientListRetrievals(ctx context.Context) ([]api.RetrievalInfo, error) { - deals, err := a.Retrieval.ListDeals() - if err != nil { - return nil, err - } - dataTransfersByID, err := a.transfersByID(ctx) - if err != nil { - return nil, err - } - out := make([]api.RetrievalInfo, 0, len(deals)) - for _, v := range deals { - // Find the data transfer associated with this deal - var transferCh *api.DataTransferChannel - if v.ChannelID != nil { - if ch, ok := dataTransfersByID[*v.ChannelID]; ok { - transferCh = &ch - } - } - out = append(out, a.newRetrievalInfoWithTransfer(transferCh, v)) - } - sort.Slice(out, func(a, b int) bool { - return out[a].ID < out[b].ID - }) - return out, nil -} - -func (a *API) ClientGetRetrievalUpdates(ctx context.Context) (<-chan api.RetrievalInfo, error) { - updates := make(chan api.RetrievalInfo) - - unsub := a.Retrieval.SubscribeToEvents(func(evt rm.ClientEvent, deal rm.ClientDealState) { - update := a.newRetrievalInfo(ctx, deal) - update.Event = &evt - select { - case updates <- update: - case <-ctx.Done(): - } - }) - - go func() { - defer unsub() - <-ctx.Done() - }() - - return updates, nil -} - -func (a *API) newRetrievalInfoWithTransfer(ch *api.DataTransferChannel, deal rm.ClientDealState) api.RetrievalInfo { - return api.RetrievalInfo{ - PayloadCID: deal.PayloadCID, - ID: deal.ID, - PieceCID: deal.PieceCID, - PricePerByte: deal.PricePerByte, - UnsealPrice: deal.UnsealPrice, - Status: deal.Status, - Message: deal.Message, - Provider: deal.Sender, - BytesReceived: deal.TotalReceived, - BytesPaidFor: deal.BytesPaidFor, - TotalPaid: deal.FundsSpent, - TransferChannelID: deal.ChannelID, - DataTransfer: ch, - } -} - -func (a *API) newRetrievalInfo(ctx context.Context, v rm.ClientDealState) api.RetrievalInfo { - // Find the data transfer associated with this deal - var transferCh *api.DataTransferChannel - if v.ChannelID != nil { - state, err := a.DataTransfer.ChannelState(ctx, *v.ChannelID) - - // Note: If there was an error just ignore it, as the data transfer may - // be not found if it's no longer active - if err == nil { - ch := api.NewDataTransferChannel(a.Host.ID(), state) - ch.Stages = state.Stages() - transferCh = &ch - } - } - - return a.newRetrievalInfoWithTransfer(transferCh, v) -} - -const dealProtoPrefix = "/fil/storage/mk/" - -func (a *API) ClientQueryAsk(ctx context.Context, p peer.ID, miner address.Address) (*api.StorageAsk, error) { - mi, err := a.StateMinerInfo(ctx, miner, types.EmptyTSK) - if err != nil { - return nil, xerrors.Errorf("failed getting miner info: %w", err) - } - - info := utils.NewStorageProviderInfo(miner, mi.Worker, mi.SectorSize, p, mi.Multiaddrs) - ask, err := a.SMDealClient.GetAsk(ctx, info) - if err != nil { - return nil, err - } - res := &api.StorageAsk{ - Response: ask, - } - - ps, err := a.Host.Peerstore().GetProtocols(p) - if err != nil { - return nil, err - } - for _, s := range ps { - if strings.HasPrefix(string(s), dealProtoPrefix) { - res.DealProtocols = append(res.DealProtocols, string(s)) - } - } - sort.Strings(res.DealProtocols) - - return res, nil -} - -func (a *API) ClientCalcCommP(ctx context.Context, inpath string) (*api.CommPRet, error) { - rdr, err := os.Open(inpath) - if err != nil { - return nil, err - } - defer rdr.Close() //nolint:errcheck - - // check that the data is a car file; if it's not, retrieval won't work - _, err = car.ReadHeader(bufio.NewReader(rdr)) - if err != nil { - return nil, xerrors.Errorf("not a car file: %w", err) - } - - if _, err := rdr.Seek(0, io.SeekStart); err != nil { - return nil, xerrors.Errorf("seek to start: %w", err) - } - - w := &writer.Writer{} - _, err = io.CopyBuffer(w, rdr, make([]byte, writer.CommPBuf)) - if err != nil { - return nil, xerrors.Errorf("copy into commp writer: %w", err) - } - - commp, err := w.Sum() - if err != nil { - return nil, xerrors.Errorf("computing commP failed: %w", err) - } - - return &api.CommPRet{ - Root: commp.PieceCID, - Size: commp.PieceSize.Unpadded(), - }, nil -} - -type lenWriter int64 - -func (w *lenWriter) Write(p []byte) (n int, err error) { - *w += lenWriter(len(p)) - return len(p), nil -} - -func (a *API) ClientDealSize(ctx context.Context, root cid.Cid) (api.DataSize, error) { - bs, onDone, err := a.dealBlockstore(root) - if err != nil { - return api.DataSize{}, err - } - defer onDone() - - dag := merkledag.NewDAGService(blockservice.New(bs, offline.Exchange(bs))) - - var w lenWriter - err = car.WriteCar(ctx, dag, []cid.Cid{root}, &w) - if err != nil { - return api.DataSize{}, err - } - - up := padreader.PaddedSize(uint64(w)) - - return api.DataSize{ - PayloadSize: int64(w), - PieceSize: up.Padded(), - }, nil -} - -func (a *API) ClientDealPieceCID(ctx context.Context, root cid.Cid) (api.DataCIDSize, error) { - bs, onDone, err := a.dealBlockstore(root) - if err != nil { - return api.DataCIDSize{}, err - } - defer onDone() - - dag := merkledag.NewDAGService(blockservice.New(bs, offline.Exchange(bs))) - w := &writer.Writer{} - bw := bufio.NewWriterSize(w, int(writer.CommPBuf)) - - err = car.WriteCar(ctx, dag, []cid.Cid{root}, w) - if err != nil { - return api.DataCIDSize{}, err - } - - if err := bw.Flush(); err != nil { - return api.DataCIDSize{}, err - } - - dataCIDSize, err := w.Sum() - return api.DataCIDSize(dataCIDSize), err -} - -func (a *API) ClientGenCar(ctx context.Context, ref api.FileRef, outputPath string) error { - // create a temporary import to represent this job and obtain a staging CAR. - id, err := a.importManager().CreateImport() - if err != nil { - return xerrors.Errorf("failed to create temporary import: %w", err) - } - defer a.importManager().Remove(id) //nolint:errcheck - - tmp, err := a.importManager().AllocateCAR(id) - if err != nil { - return xerrors.Errorf("failed to allocate temporary CAR: %w", err) - } - defer os.Remove(tmp) //nolint:errcheck - - // generate and import the UnixFS DAG into a filestore (positional reference) CAR. - root, err := unixfs.CreateFilestore(ctx, ref.Path, tmp) - if err != nil { - return xerrors.Errorf("failed to import file using unixfs: %w", err) - } - - // open the positional reference CAR as a filestore. - fs, err := stores.ReadOnlyFilestore(tmp) - if err != nil { - return xerrors.Errorf("failed to open filestore from carv2 in path %s: %w", tmp, err) - } - defer fs.Close() //nolint:errcheck - - f, err := os.Create(outputPath) - if err != nil { - return err - } - - // build a dense deterministic CAR (dense = containing filled leaves) - if err := car.NewSelectiveCar( - ctx, - fs, - []car.Dag{{ - Root: root, - Selector: selectorparse.CommonSelector_ExploreAllRecursively, - }}, - car.MaxTraversalLinks(config.MaxTraversalLinks), - ).Write( - f, - ); err != nil { - return xerrors.Errorf("failed to write CAR to output file: %w", err) - } - - return f.Close() -} - -func (a *API) ClientListDataTransfers(ctx context.Context) ([]api.DataTransferChannel, error) { - inProgressChannels, err := a.DataTransfer.InProgressChannels(ctx) - if err != nil { - return nil, err - } - - apiChannels := make([]api.DataTransferChannel, 0, len(inProgressChannels)) - for _, channelState := range inProgressChannels { - apiChannels = append(apiChannels, api.NewDataTransferChannel(a.Host.ID(), channelState)) - } - - return apiChannels, nil -} - -func (a *API) ClientDataTransferUpdates(ctx context.Context) (<-chan api.DataTransferChannel, error) { - channels := make(chan api.DataTransferChannel) - - unsub := a.DataTransfer.SubscribeToEvents(func(evt datatransfer.Event, channelState datatransfer.ChannelState) { - channel := api.NewDataTransferChannel(a.Host.ID(), channelState) - select { - case <-ctx.Done(): - case channels <- channel: - } - }) - - go func() { - defer unsub() - <-ctx.Done() - }() - - return channels, nil -} - -func (a *API) ClientRestartDataTransfer(ctx context.Context, transferID datatransfer.TransferID, otherPeer peer.ID, isInitiator bool) error { - selfPeer := a.Host.ID() - if isInitiator { - return a.DataTransfer.RestartDataTransferChannel(ctx, datatransfer.ChannelID{Initiator: selfPeer, Responder: otherPeer, ID: transferID}) - } - return a.DataTransfer.RestartDataTransferChannel(ctx, datatransfer.ChannelID{Initiator: otherPeer, Responder: selfPeer, ID: transferID}) -} - -func (a *API) ClientCancelDataTransfer(ctx context.Context, transferID datatransfer.TransferID, otherPeer peer.ID, isInitiator bool) error { - selfPeer := a.Host.ID() - if isInitiator { - return a.DataTransfer.CloseDataTransferChannel(ctx, datatransfer.ChannelID{Initiator: selfPeer, Responder: otherPeer, ID: transferID}) - } - return a.DataTransfer.CloseDataTransferChannel(ctx, datatransfer.ChannelID{Initiator: otherPeer, Responder: selfPeer, ID: transferID}) -} - -func (a *API) ClientRetrieveTryRestartInsufficientFunds(ctx context.Context, paymentChannel address.Address) error { - return a.Retrieval.TryRestartInsufficientFunds(paymentChannel) -} - -func (a *API) ClientGetDealStatus(ctx context.Context, statusCode uint64) (string, error) { - ststr, ok := storagemarket.DealStates[statusCode] - if !ok { - return "", fmt.Errorf("no such deal state %d", statusCode) - } - - return ststr, nil -} - -// dealBlockstore picks the source blockstore for a storage deal; either the -// IPFS blockstore, or an import CARv2 file. It also returns a function that -// must be called when done. -func (a *API) dealBlockstore(root cid.Cid) (bstore.Blockstore, func(), error) { - switch acc := a.StorageBlockstoreAccessor.(type) { - case *storageadapter.ImportsBlockstoreAccessor: - bs, err := acc.Get(root) - if err != nil { - return nil, nil, xerrors.Errorf("no import found for root %s: %w", root, err) - } - - doneFn := func() { - _ = acc.Done(root) //nolint:errcheck - } - return bs, doneFn, nil - - case *storageadapter.ProxyBlockstoreAccessor: - return acc.Blockstore, func() {}, nil - - default: - return nil, nil, xerrors.Errorf("unsupported blockstore accessor type: %T", acc) - } -} diff --git a/node/impl/client/client_test.go b/node/impl/client/client_test.go deleted file mode 100644 index 67a35013166..00000000000 --- a/node/impl/client/client_test.go +++ /dev/null @@ -1,136 +0,0 @@ -// stm: #unit -package client - -import ( - "bytes" - "context" - "embed" - "os" - "path/filepath" - "strings" - "testing" - - "github.com/ipfs/boxo/blockservice" - blockstore "github.com/ipfs/boxo/blockstore" - offline "github.com/ipfs/boxo/exchange/offline" - "github.com/ipfs/boxo/files" - "github.com/ipfs/boxo/ipld/merkledag" - unixfile "github.com/ipfs/boxo/ipld/unixfs/file" - "github.com/ipfs/go-cid" - "github.com/ipfs/go-datastore" - dssync "github.com/ipfs/go-datastore/sync" - "github.com/ipld/go-car" - carv2 "github.com/ipld/go-car/v2" - "github.com/stretchr/testify/require" - - "github.com/filecoin-project/lotus/api" - "github.com/filecoin-project/lotus/markets/storageadapter" - "github.com/filecoin-project/lotus/node/repo/imports" -) - -//go:embed testdata/* -var testdata embed.FS - -func TestImportLocal(t *testing.T) { - // stm: @CLIENT_STORAGE_DEALS_IMPORT_LOCAL_001, @CLIENT_RETRIEVAL_FIND_001 - ds := dssync.MutexWrap(datastore.NewMapDatastore()) - dir := t.TempDir() - im := imports.NewManager(ds, dir) - ctx := context.Background() - - a := &API{ - Imports: im, - StorageBlockstoreAccessor: storageadapter.NewImportsBlockstoreAccessor(im), - } - - b, err := testdata.ReadFile("testdata/payload.txt") - require.NoError(t, err) - - // stm: @CLIENT_STORAGE_DEALS_LIST_IMPORTS_001 - root, err := a.ClientImportLocal(ctx, bytes.NewReader(b)) - require.NoError(t, err) - require.NotEqual(t, cid.Undef, root) - - list, err := a.ClientListImports(ctx) - require.NoError(t, err) - require.Len(t, list, 1) - - it := list[0] - require.Equal(t, root, *it.Root) - require.True(t, strings.HasPrefix(it.CARPath, dir)) - - // stm: @CLIENT_DATA_HAS_LOCAL_001 - local, err := a.ClientHasLocal(ctx, root) - require.NoError(t, err) - require.True(t, local) - - order := api.ExportRef{ - Root: root, - FromLocalCAR: it.CARPath, - } - - // retrieve as UnixFS. - out1 := filepath.Join(dir, "retrieval1.data") // as unixfs - out2 := filepath.Join(dir, "retrieval2.data") // as car - err = a.ClientExport(ctx, order, api.FileRef{ - Path: out1, - }) - require.NoError(t, err) - - outBytes, err := os.ReadFile(out1) - require.NoError(t, err) - require.Equal(t, b, outBytes) - - err = a.ClientExport(ctx, order, api.FileRef{ - Path: out2, - IsCAR: true, - }) - require.NoError(t, err) - - // open the CARv2 being custodied by the import manager - orig, err := carv2.OpenReader(it.CARPath) - require.NoError(t, err) - - // open the CARv1 we just exported - exported, err := carv2.OpenReader(out2) - require.NoError(t, err) - - require.EqualValues(t, 1, exported.Version) - require.EqualValues(t, 2, orig.Version) - - origRoots, err := orig.Roots() - require.NoError(t, err) - require.Len(t, origRoots, 1) - - exportedRoots, err := exported.Roots() - require.NoError(t, err) - require.Len(t, exportedRoots, 1) - - require.EqualValues(t, origRoots, exportedRoots) - - // recreate the unixfs dag, and see if it matches the original file byte by byte - // import the car into a memory blockstore, then export the unixfs file. - bs := blockstore.NewBlockstore(datastore.NewMapDatastore()) - r, err := exported.DataReader() - require.NoError(t, err) - _, err = car.LoadCar(ctx, bs, r) - require.NoError(t, err) - - dag := merkledag.NewDAGService(blockservice.New(bs, offline.Exchange(bs))) - - nd, err := dag.Get(ctx, exportedRoots[0]) - require.NoError(t, err) - - file, err := unixfile.NewUnixfsFile(ctx, dag, nd) - require.NoError(t, err) - - exportedPath := filepath.Join(dir, "exported.data") - err = files.WriteTo(file, exportedPath) - require.NoError(t, err) - - exportedBytes, err := os.ReadFile(exportedPath) - require.NoError(t, err) - - // compare original file to recreated unixfs file. - require.Equal(t, b, exportedBytes) -} diff --git a/node/impl/client/testdata/duplicate_blocks.txt b/node/impl/client/testdata/duplicate_blocks.txt deleted file mode 100644 index 53695d7b95f..00000000000 --- a/node/impl/client/testdata/duplicate_blocks.txt +++ /dev/null @@ -1 +0,0 @@ -aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccdddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd \ No newline at end of file diff --git a/node/impl/client/testdata/payload.txt b/node/impl/client/testdata/payload.txt deleted file mode 100644 index fd4a2f3c1ff..00000000000 --- a/node/impl/client/testdata/payload.txt +++ /dev/null @@ -1,49 +0,0 @@ -Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Vitae semper quis lectus nulla at volutpat diam ut venenatis. Ac tortor dignissim convallis aenean et tortor at. Faucibus ornare suspendisse sed nisi lacus sed. Commodo ullamcorper a lacus vestibulum sed arcu non. Est pellentesque elit ullamcorper dignissim. Quam quisque id diam vel quam. Pretium aenean pharetra magna ac. In nulla posuere sollicitudin aliquam ultrices. Sed arcu non odio euismod lacinia at. Suspendisse ultrices gravida dictum fusce ut placerat orci nulla pellentesque. Feugiat vivamus at augue eget arcu. - -Pellentesque nec nam aliquam sem et tortor. Vitae tortor condimentum lacinia quis vel. Cras pulvinar mattis nunc sed. In massa tempor nec feugiat. Ornare arcu odio ut sem nulla. Diam maecenas sed enim ut sem. Pretium vulputate sapien nec sagittis. Bibendum arcu vitae elementum curabitur vitae nunc sed velit dignissim. Duis ut diam quam nulla porttitor massa. Viverra mauris in aliquam sem fringilla ut morbi. Ullamcorper eget nulla facilisi etiam dignissim. Vulputate mi sit amet mauris commodo quis imperdiet massa tincidunt. Nunc consequat interdum varius sit. Nunc mi ipsum faucibus vitae aliquet nec ullamcorper. Nunc sed augue lacus viverra. Lobortis scelerisque fermentum dui faucibus in ornare quam. Urna neque viverra justo nec ultrices. Varius vel pharetra vel turpis nunc eget lorem dolor sed. - -Feugiat nisl pretium fusce id velit ut tortor pretium. Lorem dolor sed viverra ipsum nunc aliquet bibendum. Ultrices vitae auctor eu augue ut lectus. Pharetra massa massa ultricies mi quis. Nibh cras pulvinar mattis nunc sed blandit libero. Ac felis donec et odio pellentesque diam volutpat. Lectus proin nibh nisl condimentum id venenatis. Quis vel eros donec ac odio. Commodo sed egestas egestas fringilla phasellus faucibus scelerisque eleifend donec. Adipiscing diam donec adipiscing tristique. - -Tempus imperdiet nulla malesuada pellentesque elit eget gravida cum sociis. Libero nunc consequat interdum varius sit. Et pharetra pharetra massa massa. Feugiat pretium nibh ipsum consequat. Amet commodo nulla facilisi nullam vehicula. Ornare arcu dui vivamus arcu felis bibendum ut tristique. At erat pellentesque adipiscing commodo elit at imperdiet dui. Auctor neque vitae tempus quam pellentesque nec nam aliquam sem. Eget velit aliquet sagittis id consectetur. Enim diam vulputate ut pharetra sit amet aliquam id diam. Eget velit aliquet sagittis id consectetur purus ut faucibus pulvinar. Amet porttitor eget dolor morbi. Felis eget velit aliquet sagittis id. Facilisis magna etiam tempor orci eu. Lacus suspendisse faucibus interdum posuere lorem. Pharetra et ultrices neque ornare aenean euismod. Platea dictumst quisque sagittis purus. - -Quis varius quam quisque id diam vel quam elementum. Augue mauris augue neque gravida in fermentum et sollicitudin. Sapien nec sagittis aliquam malesuada bibendum arcu. Urna duis convallis convallis tellus id interdum velit. Tellus in hac habitasse platea dictumst vestibulum. Fames ac turpis egestas maecenas pharetra convallis. Diam volutpat commodo sed egestas egestas fringilla phasellus faucibus. Placerat orci nulla pellentesque dignissim enim sit amet venenatis. Sed adipiscing diam donec adipiscing. Praesent elementum facilisis leo vel fringilla est. Sed enim ut sem viverra aliquet eget sit amet tellus. Proin sagittis nisl rhoncus mattis rhoncus urna neque viverra. Turpis egestas pretium aenean pharetra magna ac placerat vestibulum. Massa id neque aliquam vestibulum morbi blandit cursus risus. Vitae congue eu consequat ac. Egestas erat imperdiet sed euismod nisi porta lorem mollis aliquam. Dolor purus non enim praesent elementum facilisis. Ultrices mi tempus imperdiet nulla malesuada pellentesque elit. In est ante in nibh. - -Facilisis gravida neque convallis a. Urna nunc id cursus metus aliquam eleifend mi. Lacus luctus accumsan tortor posuere ac. Molestie nunc non blandit massa. Iaculis urna id volutpat lacus laoreet non. Cursus vitae congue mauris rhoncus aenean. Nunc vel risus commodo viverra maecenas. A pellentesque sit amet porttitor eget dolor morbi. Leo vel orci porta non pulvinar neque laoreet suspendisse. Sit amet facilisis magna etiam tempor. Consectetur a erat nam at lectus urna duis convallis convallis. Vestibulum morbi blandit cursus risus at ultrices. Dolor purus non enim praesent elementum. Adipiscing elit pellentesque habitant morbi tristique senectus et netus et. Et odio pellentesque diam volutpat commodo sed egestas egestas fringilla. Leo vel fringilla est ullamcorper eget nulla. Dui ut ornare lectus sit amet. Erat pellentesque adipiscing commodo elit at imperdiet dui accumsan sit. - -Tristique senectus et netus et. Pellentesque diam volutpat commodo sed egestas egestas fringilla. Mauris pharetra et ultrices neque ornare aenean. Amet tellus cras adipiscing enim. Convallis aenean et tortor at risus viverra adipiscing at. Proin sagittis nisl rhoncus mattis rhoncus urna neque viverra justo. Dictumst vestibulum rhoncus est pellentesque elit. Fringilla ut morbi tincidunt augue interdum velit euismod in pellentesque. Dictum at tempor commodo ullamcorper a lacus vestibulum. Sed viverra tellus in hac habitasse platea. Sed id semper risus in hendrerit. In hendrerit gravida rutrum quisque non tellus orci ac. Sit amet risus nullam eget. Sit amet est placerat in egestas erat imperdiet sed. In nisl nisi scelerisque eu ultrices. Sit amet mattis vulputate enim nulla aliquet. - -Dignissim suspendisse in est ante in nibh mauris cursus. Vitae proin sagittis nisl rhoncus. Id leo in vitae turpis massa sed elementum. Lobortis elementum nibh tellus molestie nunc non blandit massa enim. Arcu dictum varius duis at consectetur. Suspendisse faucibus interdum posuere lorem ipsum dolor sit amet consectetur. Imperdiet nulla malesuada pellentesque elit eget gravida cum sociis. Sed adipiscing diam donec adipiscing. Purus sit amet volutpat consequat mauris nunc congue nisi vitae. Elementum nisi quis eleifend quam adipiscing vitae proin sagittis nisl. Mattis ullamcorper velit sed ullamcorper morbi tincidunt ornare massa. Sit amet nisl purus in mollis nunc sed. Turpis tincidunt id aliquet risus feugiat in ante. Id diam maecenas ultricies mi eget mauris pharetra et ultrices. - -Aliquam purus sit amet luctus venenatis lectus magna fringilla urna. Id diam vel quam elementum pulvinar. Elementum sagittis vitae et leo duis. Viverra aliquet eget sit amet tellus cras adipiscing enim eu. Et tortor at risus viverra adipiscing at in tellus integer. Purus in massa tempor nec feugiat. Augue neque gravida in fermentum et sollicitudin ac orci. Sodales ut eu sem integer vitae justo eget magna fermentum. Netus et malesuada fames ac. Augue interdum velit euismod in. Sed elementum tempus egestas sed sed risus pretium. Mattis vulputate enim nulla aliquet porttitor lacus luctus. Dui vivamus arcu felis bibendum ut tristique et egestas quis. - -Viverra justo nec ultrices dui sapien. Quisque egestas diam in arcu cursus euismod quis viverra nibh. Nam libero justo laoreet sit amet cursus sit amet. Lacus sed viverra tellus in hac habitasse. Blandit aliquam etiam erat velit scelerisque in. Ut sem nulla pharetra diam sit amet nisl suscipit adipiscing. Diam sollicitudin tempor id eu nisl nunc. Eget duis at tellus at urna condimentum mattis. Urna porttitor rhoncus dolor purus non enim praesent elementum facilisis. Sed turpis tincidunt id aliquet risus feugiat. Est velit egestas dui id ornare arcu odio ut sem. Nibh sit amet commodo nulla facilisi nullam vehicula. Sit amet consectetur adipiscing elit duis tristique sollicitudin. Eu facilisis sed odio morbi. Massa id neque aliquam vestibulum morbi. In eu mi bibendum neque egestas congue quisque egestas. Massa sed elementum tempus egestas sed sed risus. Quam elementum pulvinar etiam non. At augue eget arcu dictum varius duis at consectetur lorem. - -Penatibus et magnis dis parturient montes nascetur ridiculus. Dictumst quisque sagittis purus sit amet volutpat consequat. Bibendum at varius vel pharetra. Sed adipiscing diam donec adipiscing tristique risus nec feugiat in. Phasellus faucibus scelerisque eleifend donec pretium. Vitae tortor condimentum lacinia quis vel eros. Ac tincidunt vitae semper quis lectus nulla at volutpat diam. Eget sit amet tellus cras adipiscing. Morbi tristique senectus et netus. Nullam vehicula ipsum a arcu cursus vitae congue mauris rhoncus. Auctor urna nunc id cursus metus aliquam eleifend. Ultrices vitae auctor eu augue. Eu non diam phasellus vestibulum lorem sed risus ultricies. Fames ac turpis egestas sed tempus. Volutpat blandit aliquam etiam erat. Dictum varius duis at consectetur lorem. Sit amet volutpat consequat mauris nunc congue. Volutpat sed cras ornare arcu dui vivamus arcu felis. - -Scelerisque fermentum dui faucibus in ornare quam viverra. Interdum velit laoreet id donec ultrices tincidunt arcu. Netus et malesuada fames ac. Netus et malesuada fames ac turpis. Suscipit tellus mauris a diam maecenas sed enim ut sem. Id velit ut tortor pretium. Neque aliquam vestibulum morbi blandit cursus risus at. Cum sociis natoque penatibus et magnis dis parturient. Lobortis elementum nibh tellus molestie nunc non blandit. Ipsum dolor sit amet consectetur adipiscing elit duis tristique. Amet nisl purus in mollis. Amet massa vitae tortor condimentum lacinia quis vel eros donec. Proin sagittis nisl rhoncus mattis rhoncus urna neque viverra justo. - -Nullam ac tortor vitae purus faucibus. Dis parturient montes nascetur ridiculus mus mauris. Molestie at elementum eu facilisis sed odio morbi. Scelerisque felis imperdiet proin fermentum leo vel orci porta. Lectus proin nibh nisl condimentum id venenatis a. Eget nullam non nisi est sit amet facilisis. Hendrerit gravida rutrum quisque non tellus orci ac auctor. Ut faucibus pulvinar elementum integer enim. Rhoncus dolor purus non enim praesent elementum facilisis. Enim sed faucibus turpis in eu mi bibendum. Faucibus nisl tincidunt eget nullam. - -Cursus risus at ultrices mi tempus imperdiet nulla malesuada pellentesque. Pretium nibh ipsum consequat nisl vel pretium lectus quam. Semper viverra nam libero justo laoreet sit amet cursus sit. Augue eget arcu dictum varius duis at consectetur lorem donec. Et malesuada fames ac turpis. Erat nam at lectus urna duis convallis convallis. Dictum sit amet justo donec enim. Urna condimentum mattis pellentesque id nibh tortor id. Morbi tempus iaculis urna id. Lectus proin nibh nisl condimentum id venenatis a condimentum. Nibh sit amet commodo nulla facilisi nullam vehicula. Dui faucibus in ornare quam. Gravida arcu ac tortor dignissim convallis aenean. Consectetur adipiscing elit pellentesque habitant morbi tristique. Pulvinar elementum integer enim neque volutpat ac tincidunt vitae. Pharetra pharetra massa massa ultricies mi quis hendrerit. Dictum at tempor commodo ullamcorper a lacus vestibulum sed. Mattis pellentesque id nibh tortor id. Ultricies integer quis auctor elit sed vulputate. Pretium vulputate sapien nec sagittis aliquam malesuada. - -Auctor augue mauris augue neque gravida. Porttitor lacus luctus accumsan tortor posuere ac ut. Urna neque viverra justo nec ultrices dui. Sit amet est placerat in egestas. Urna nec tincidunt praesent semper feugiat nibh sed pulvinar. Tincidunt eget nullam non nisi est sit amet facilisis magna. Elementum tempus egestas sed sed risus pretium quam vulputate dignissim. Fermentum posuere urna nec tincidunt praesent semper feugiat nibh sed. Porttitor eget dolor morbi non arcu risus quis. Non quam lacus suspendisse faucibus interdum. Venenatis cras sed felis eget velit aliquet sagittis id. Arcu ac tortor dignissim convallis aenean et. Morbi tincidunt ornare massa eget egestas purus. Ac feugiat sed lectus vestibulum mattis ullamcorper velit sed ullamcorper. Vestibulum morbi blandit cursus risus at ultrices. Volutpat blandit aliquam etiam erat velit scelerisque. - -Et egestas quis ipsum suspendisse. Amet consectetur adipiscing elit duis. Purus ut faucibus pulvinar elementum integer enim neque. Cursus vitae congue mauris rhoncus aenean vel elit scelerisque mauris. Tincidunt eget nullam non nisi est. Aliquam purus sit amet luctus. Dui ut ornare lectus sit amet est placerat in. Fringilla ut morbi tincidunt augue interdum velit euismod in. Felis eget nunc lobortis mattis aliquam faucibus purus in. Suspendisse interdum consectetur libero id faucibus nisl. - -Scelerisque fermentum dui faucibus in ornare quam. Lectus proin nibh nisl condimentum id venenatis a condimentum vitae. Fames ac turpis egestas integer eget aliquet nibh praesent tristique. Arcu non sodales neque sodales ut etiam sit. Pharetra convallis posuere morbi leo urna. Nec dui nunc mattis enim ut tellus. Nunc sed augue lacus viverra vitae. Consequat id porta nibh venenatis cras sed felis. Dolor sit amet consectetur adipiscing. Tellus rutrum tellus pellentesque eu tincidunt tortor aliquam nulla. - -Metus aliquam eleifend mi in nulla posuere. Blandit massa enim nec dui nunc mattis enim. Aliquet nibh praesent tristique magna. In aliquam sem fringilla ut. Magna fermentum iaculis eu non. Eget aliquet nibh praesent tristique magna sit amet purus. Ultrices gravida dictum fusce ut placerat orci. Fermentum posuere urna nec tincidunt praesent. Enim tortor at auctor urna nunc. Ridiculus mus mauris vitae ultricies leo integer malesuada nunc vel. Sed id semper risus in hendrerit gravida rutrum. Vestibulum lectus mauris ultrices eros in cursus turpis. Et sollicitudin ac orci phasellus egestas tellus rutrum. Pellentesque elit ullamcorper dignissim cras tincidunt lobortis feugiat vivamus at. Metus vulputate eu scelerisque felis imperdiet proin fermentum leo. Porta non pulvinar neque laoreet suspendisse. Suscipit adipiscing bibendum est ultricies integer quis auctor elit sed. Euismod in pellentesque massa placerat duis ultricies lacus sed. Pellentesque adipiscing commodo elit at imperdiet dui accumsan sit amet. - -Pellentesque eu tincidunt tortor aliquam nulla facilisi. Commodo nulla facilisi nullam vehicula ipsum a arcu. Commodo quis imperdiet massa tincidunt nunc pulvinar sapien et. Faucibus purus in massa tempor. Purus semper eget duis at tellus at urna condimentum. Vivamus at augue eget arcu dictum. Lacus vel facilisis volutpat est velit egestas dui id. Malesuada fames ac turpis egestas maecenas pharetra. Nunc faucibus a pellentesque sit amet porttitor eget dolor. Ultricies tristique nulla aliquet enim. Vel risus commodo viverra maecenas accumsan lacus vel facilisis volutpat. Dignissim diam quis enim lobortis scelerisque. Donec ultrices tincidunt arcu non sodales neque sodales ut etiam. - -Vitae proin sagittis nisl rhoncus mattis rhoncus urna neque. Fermentum leo vel orci porta non. At elementum eu facilisis sed. Quis enim lobortis scelerisque fermentum. Fermentum odio eu feugiat pretium nibh ipsum consequat. Habitant morbi tristique senectus et netus et. Enim praesent elementum facilisis leo vel fringilla est ullamcorper. Egestas quis ipsum suspendisse ultrices gravida dictum. Nam libero justo laoreet sit amet cursus sit amet. Viverra tellus in hac habitasse platea dictumst vestibulum. Varius vel pharetra vel turpis nunc eget. Nullam non nisi est sit amet facilisis magna. Ullamcorper eget nulla facilisi etiam dignissim diam. Ante metus dictum at tempor commodo ullamcorper a lacus. - -Etiam non quam lacus suspendisse. Ut venenatis tellus in metus vulputate eu scelerisque felis. Pulvinar sapien et ligula ullamcorper malesuada proin libero. Consequat interdum varius sit amet mattis. Nunc eget lorem dolor sed viverra ipsum nunc aliquet. Potenti nullam ac tortor vitae purus faucibus ornare. Urna et pharetra pharetra massa massa ultricies mi quis hendrerit. Purus in mollis nunc sed id. Pharetra vel turpis nunc eget lorem dolor sed viverra. Et netus et malesuada fames ac turpis. Libero id faucibus nisl tincidunt eget nullam non nisi. Cursus sit amet dictum sit amet. Porttitor lacus luctus accumsan tortor. - -Volutpat diam ut venenatis tellus in metus vulputate eu scelerisque. Sed viverra tellus in hac habitasse. Aliquam sem et tortor consequat id. Pellentesque habitant morbi tristique senectus et netus et. Consectetur purus ut faucibus pulvinar elementum. Aliquam malesuada bibendum arcu vitae elementum curabitur vitae nunc sed. Malesuada bibendum arcu vitae elementum curabitur vitae nunc sed. Sollicitudin tempor id eu nisl nunc mi ipsum. Fringilla phasellus faucibus scelerisque eleifend donec pretium vulputate sapien nec. Quis eleifend quam adipiscing vitae proin sagittis nisl rhoncus. Bibendum neque egestas congue quisque egestas. A iaculis at erat pellentesque adipiscing commodo elit at imperdiet. Pulvinar etiam non quam lacus. Adipiscing commodo elit at imperdiet. Scelerisque eu ultrices vitae auctor. Sed cras ornare arcu dui vivamus arcu felis bibendum ut. Ornare lectus sit amet est. - -Consequat semper viverra nam libero justo laoreet sit. Imperdiet sed euismod nisi porta lorem mollis aliquam ut porttitor. Cras sed felis eget velit aliquet sagittis id consectetur. Dolor morbi non arcu risus quis. Adipiscing tristique risus nec feugiat in fermentum posuere urna. Dolor magna eget est lorem ipsum dolor. Mauris pharetra et ultrices neque ornare aenean euismod. Nulla facilisi etiam dignissim diam quis. Ultrices tincidunt arcu non sodales. Fames ac turpis egestas maecenas pharetra convallis posuere morbi leo. Interdum varius sit amet mattis vulputate. Tincidunt praesent semper feugiat nibh sed pulvinar. Quisque sagittis purus sit amet volutpat. - -Sed vulputate odio ut enim blandit. Vitae auctor eu augue ut lectus arcu bibendum. Consectetur adipiscing elit pellentesque habitant morbi tristique senectus et. Scelerisque eu ultrices vitae auctor eu augue. Etiam dignissim diam quis enim lobortis scelerisque fermentum dui faucibus. Tellus integer feugiat scelerisque varius. Vulputate enim nulla aliquet porttitor lacus luctus accumsan tortor. Amet nisl purus in mollis. Scelerisque viverra mauris in aliquam sem fringilla ut morbi tincidunt. Semper eget duis at tellus at. Erat velit scelerisque in dictum non consectetur a erat nam. Gravida rutrum quisque non tellus orci. Morbi blandit cursus risus at. Mauris sit amet massa vitae. Non odio euismod lacinia at quis risus sed vulputate. Fermentum posuere urna nec tincidunt praesent. Ut eu sem integer vitae justo eget magna fermentum iaculis. Ullamcorper velit sed ullamcorper morbi tincidunt ornare massa. Arcu cursus euismod quis viverra nibh. Arcu dui vivamus arcu felis bibendum. - -Eros in cursus turpis massa tincidunt dui ut. Urna condimentum mattis pellentesque id nibh tortor id aliquet lectus. Nibh venenatis cras sed felis. Ac felis donec et odio pellentesque diam. Ultricies lacus sed turpis tincidunt id aliquet risus. Diam volutpat commodo sed egestas. Dignissim sodales ut eu sem integer vitae. Pellentesque eu tincidunt tortor aliquam nulla facilisi. Et tortor consequat id porta nibh venenatis cras sed. \ No newline at end of file diff --git a/node/impl/client/testdata/payload2.txt b/node/impl/client/testdata/payload2.txt deleted file mode 100644 index 16fb150f5b2..00000000000 --- a/node/impl/client/testdata/payload2.txt +++ /dev/null @@ -1,49 +0,0 @@ -Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Vitae semper quis lectus nulla at volutpat diam ut venenatis. Ac tortor dignissim convallis aenean et tortor at. Faucibus ornare suspendisse sed nisi lacus sed. Commodo ullamcorper a lacus vestibulum sed arcu non. Est pellentesque elit ullamcorper dignissim. Quam quisque id diam vel quam. Pretium aenean pharetra magna ac. In nulla posuere sollicitudin aliquam ultrices. Sed arcu non odio euismod lacinia at. Suspendisse ultrices gravida dictum fusce ut placerat orci nulla pellentesque. Feugiat vivamus at augue eget arcu. - -Pellentesque nec nam aliquam sem et tortor. Vitae tortor condimentum lacinia quis vel. Cras pulvinar mattis nunc sed. In massa tempor nec feugiat. Ornare arcu odio ut sem nulla. Diam maecenas sed enim ut sem. Pretium vulputate sapien nec sagittis. Bibendum arcu vitae elementum curabitur vitae nunc sed velit dignissim. Duis ut diam quam nulla porttitor massa. Viverra mauris in aliquam sem fringilla ut morbi. Ullamcorper eget nulla facilisi etiam dignissim. Vulputate mi sit amet mauris commodo quis imperdiet massa tincidunt. Nunc consequat interdum varius sit. Nunc mi ipsum faucibus vitae aliquet nec ullamcorper. Nunc sed augue lacus viverra. Lobortis scelerisque fermentum dui faucibus in ornare quam. Urna neque viverra justo nec ultrices. Varius vel pharetra vel turpis nunc eget lorem dolor sed. - -Feugiat nisl pretium fusce id velit ut tortor pretium. Lorem dolor sed viverra ipsum nunc aliquet bibendum. Ultrices vitae auctor eu augue ut lectus. Pharetra massa massa ultricies mi quis. Nibh cras pulvinar mattis nunc sed blandit libero. Ac felis donec et odio pellentesque diam volutpat. Lectus proin nibh nisl condimentum id venenatis. Quis vel eros donec ac odio. Commodo sed egestas egestas fringilla phasellus faucibus scelerisque eleifend donec. Adipiscing diam donec adipiscing tristique. - -Tempus imperdiet nulla malesuada pellentesque elit eget gravida cum sociis. Libero nunc consequat interdum varius sit. Et pharetra pharetra massa massa. Feugiat pretium nibh ipsum consequat. Amet commodo nulla facilisi nullam vehicula. Ornare arcu dui vivamus arcu felis bibendum ut tristique. At erat pellentesque adipiscing commodo elit at imperdiet dui. Auctor neque vitae tempus quam pellentesque nec nam aliquam sem. Eget velit aliquet sagittis id consectetur. Enim diam vulputate ut pharetra sit amet aliquam id diam. Eget velit aliquet sagittis id consectetur purus ut faucibus pulvinar. Amet porttitor eget dolor morbi. Felis eget velit aliquet sagittis id. Facilisis magna etiam tempor orci eu. Lacus suspendisse faucibus interdum posuere lorem. Pharetra et ultrices neque ornare aenean euismod. Platea dictumst quisque sagittis purus. - -Quis varius quam quisque id diam vel quam elementum. Augue mauris augue neque gravida in fermentum et sollicitudin. Sapien nec sagittis aliquam malesuada bibendum arcu. Urna duis convallis convallis tellus id interdum velit. Tellus in hac habitasse platea dictumst vestibulum. Fames ac turpis egestas maecenas pharetra convallis. Diam volutpat commodo sed egestas egestas fringilla phasellus faucibus. Placerat orci nulla pellentesque dignissim enim sit amet venenatis. Sed adipiscing diam donec adipiscing. Praesent elementum facilisis leo vel fringilla est. Sed enim ut sem viverra aliquet eget sit amet tellus. Proin sagittis nisl rhoncus mattis rhoncus urna neque viverra. Turpis egestas pretium aenean pharetra magna ac placerat vestibulum. Massa id neque aliquam vestibulum morbi blandit cursus risus. Vitae congue eu consequat ac. Egestas erat imperdiet sed euismod nisi porta lorem mollis aliquam. Dolor purus non enim praesent elementum facilisis. Ultrices mi tempus imperdiet nulla malesuada pellentesque elit. In est ante in nibh. - -Facilisis gravida neque convallis a. Urna nunc id cursus metus aliquam eleifend mi. Lacus luctus accumsan tortor posuere ac. Molestie nunc non blandit massa. Iaculis urna id volutpat lacus laoreet non. Cursus vitae congue mauris rhoncus aenean. Nunc vel risus commodo viverra maecenas. A pellentesque sit amet porttitor eget dolor morbi. Leo vel orci porta non pulvinar neque laoreet suspendisse. Sit amet facilisis magna etiam tempor. Consectetur a erat nam at lectus urna duis convallis convallis. Vestibulum morbi blandit cursus risus at ultrices. Dolor purus non enim praesent elementum. Adipiscing elit pellentesque habitant morbi tristique senectus et netus et. Et odio pellentesque diam volutpat commodo sed egestas egestas fringilla. Leo vel fringilla est ullamcorper eget nulla. Dui ut ornare lectus sit amet. Erat pellentesque adipiscing commodo elit at imperdiet dui accumsan sit. - -Tristique senectus et netus et. Pellentesque diam volutpat commodo sed egestas egestas fringilla. Mauris pharetra et ultrices neque ornare aenean. Amet tellus cras adipiscing enim. Convallis aenean et tortor at risus viverra adipiscing at. Proin sagittis nisl rhoncus mattis rhoncus urna neque viverra justo. Dictumst vestibulum rhoncus est pellentesque elit. Fringilla ut morbi tincidunt augue interdum velit euismod in pellentesque. Dictum at tempor commodo ullamcorper a lacus vestibulum. Sed viverra tellus in hac habitasse platea. Sed id semper risus in hendrerit. In hendrerit gravida rutrum quisque non tellus orci ac. Sit amet risus nullam eget. Sit amet est placerat in egestas erat imperdiet sed. In nisl nisi scelerisque eu ultrices. Sit amet mattis vulputate enim nulla aliquet. - -Dignissim suspendisse in est ante in nibh mauris cursus. Vitae proin sagittis nisl rhoncus. Id leo in vitae turpis massa sed elementum. Lobortis elementum nibh tellus molestie nunc non blandit massa enim. Arcu dictum varius duis at consectetur. Suspendisse faucibus interdum posuere lorem ipsum dolor sit amet consectetur. Imperdiet nulla malesuada pellentesque elit eget gravida cum sociis. Sed adipiscing diam donec adipiscing. Purus sit amet volutpat consequat mauris nunc congue nisi vitae. Elementum nisi quis eleifend quam adipiscing vitae proin sagittis nisl. Mattis ullamcorper velit sed ullamcorper morbi tincidunt ornare massa. Sit amet nisl purus in mollis nunc sed. Turpis tincidunt id aliquet risus feugiat in ante. Id diam maecenas ultricies mi eget mauris pharetra et ultrices. - -Aliquam purus sit amet luctus venenatis lectus magna fringilla urna. Id diam vel quam elementum pulvinar. Elementum sagittis vitae et leo duis. Viverra aliquet eget sit amet tellus cras adipiscing enim eu. Et tortor at risus viverra adipiscing at in tellus integer. Purus in massa tempor nec feugiat. Augue neque gravida in fermentum et sollicitudin ac orci. Sodales ut eu sem integer vitae justo eget magna fermentum. Netus et malesuada fames ac. Augue interdum velit euismod in. Sed elementum tempus egestas sed sed risus pretium. Mattis vulputate enim nulla aliquet porttitor lacus luctus. Dui vivamus arcu felis bibendum ut tristique et egestas quis. - -Viverra justo nec ultrices dui sapien. Quisque egestas diam in arcu cursus euismod quis viverra nibh. Nam libero justo laoreet sit amet cursus sit amet. Lacus sed viverra tellus in hac habitasse. Blandit aliquam etiam erat velit scelerisque in. Ut sem nulla pharetra diam sit amet nisl suscipit adipiscing. Diam sollicitudin tempor id eu nisl nunc. Eget duis at tellus at urna condimentum mattis. Urna porttitor rhoncus dolor purus non enim praesent elementum facilisis. Sed turpis tincidunt id aliquet risus feugiat. Est velit egestas dui id ornare arcu odio ut sem. Nibh sit amet commodo nulla facilisi nullam vehicula. Sit amet consectetur adipiscing elit duis tristique sollicitudin. Eu facilisis sed odio morbi. Massa id neque aliquam vestibulum morbi. In eu mi bibendum neque egestas congue quisque egestas. Massa sed elementum tempus egestas sed sed risus. Quam elementum pulvinar etiam non. At augue eget arcu dictum varius duis at consectetur lorem. - -Penatibus et magnis dis parturient montes nascetur ridiculus. Dictumst quisque sagittis purus sit amet volutpat consequat. Bibendum at varius vel pharetra. Sed adipiscing diam donec adipiscing tristique risus nec feugiat in. Phasellus faucibus scelerisque eleifend donec pretium. Vitae tortor condimentum lacinia quis vel eros. Ac tincidunt vitae semper quis lectus nulla at volutpat diam. Eget sit amet tellus cras adipiscing. Morbi tristique senectus et netus. Nullam vehicula ipsum a arcu cursus vitae congue mauris rhoncus. Auctor urna nunc id cursus metus aliquam eleifend. Ultrices vitae auctor eu augue. Eu non diam phasellus vestibulum lorem sed risus ultricies. Fames ac turpis egestas sed tempus. Volutpat blandit aliquam etiam erat. Dictum varius duis at consectetur lorem. Sit amet volutpat consequat mauris nunc congue. Volutpat sed cras ornare arcu dui vivamus arcu felis. - -Scelerisque fermentum dui faucibus in ornare quam viverra. Interdum velit laoreet id donec ultrices tincidunt arcu. Netus et malesuada fames ac. Netus et malesuada fames ac turpis. Suscipit tellus mauris a diam maecenas sed enim ut sem. Id velit ut tortor pretium. Neque aliquam vestibulum morbi blandit cursus risus at. Cum sociis natoque penatibus et magnis dis parturient. Lobortis elementum nibh tellus molestie nunc non blandit. Ipsum dolor sit amet consectetur adipiscing elit duis tristique. Amet nisl purus in mollis. Amet massa vitae tortor condimentum lacinia quis vel eros donec. Proin sagittis nisl rhoncus mattis rhoncus urna neque viverra justo. - -Nullam ac tortor vitae purus faucibus. Dis parturient montes nascetur ridiculus mus mauris. Molestie at elementum eu facilisis sed odio morbi. Scelerisque felis imperdiet proin fermentum leo vel orci porta. Lectus proin nibh nisl condimentum id venenatis a. Eget nullam non nisi est sit amet facilisis. Hendrerit gravida rutrum quisque non tellus orci ac auctor. Ut faucibus pulvinar elementum integer enim. Rhoncus dolor purus non enim praesent elementum facilisis. Enim sed faucibus turpis in eu mi bibendum. Faucibus nisl tincidunt eget nullam. - -Cursus risus at ultrices mi tempus imperdiet nulla malesuada pellentesque. Pretium nibh ipsum consequat nisl vel pretium lectus quam. Semper viverra nam libero justo laoreet sit amet cursus sit. Augue eget arcu dictum varius duis at consectetur lorem donec. Et malesuada fames ac turpis. Erat nam at lectus urna duis convallis convallis. Dictum sit amet justo donec enim. Urna condimentum mattis pellentesque id nibh tortor id. Morbi tempus iaculis urna id. Lectus proin nibh nisl condimentum id venenatis a condimentum. Nibh sit amet commodo nulla facilisi nullam vehicula. Dui faucibus in ornare quam. Gravida arcu ac tortor dignissim convallis aenean. Consectetur adipiscing elit pellentesque habitant morbi tristique. Pulvinar elementum integer enim neque volutpat ac tincidunt vitae. Pharetra pharetra massa massa ultricies mi quis hendrerit. Dictum at tempor commodo ullamcorper a lacus vestibulum sed. Mattis pellentesque id nibh tortor id. Ultricies integer quis auctor elit sed vulputate. Pretium vulputate sapien nec sagittis aliquam malesuada. - -Auctor augue mauris augue neque gravida. Porttitor lacus luctus accumsan tortor posuere ac ut. Urna neque viverra justo nec ultrices dui. Sit amet est placerat in egestas. Urna nec tincidunt praesent semper feugiat nibh sed pulvinar. Tincidunt eget nullam non nisi est sit amet facilisis magna. Elementum tempus egestas sed sed risus pretium quam vulputate dignissim. Fermentum posuere urna nec tincidunt praesent semper feugiat nibh sed. Porttitor eget dolor morbi non arcu risus quis. Non quam lacus suspendisse faucibus interdum. Venenatis cras sed felis eget velit aliquet sagittis id. Arcu ac tortor dignissim convallis aenean et. Morbi tincidunt ornare massa eget egestas purus. Ac feugiat sed lectus vestibulum mattis ullamcorper velit sed ullamcorper. Vestibulum morbi blandit cursus risus at ultrices. Volutpat blandit aliquam etiam erat velit scelerisque. - -Et egestas quis ipsum suspendisse. Amet consectetur adipiscing elit duis. Purus ut faucibus pulvinar elementum integer enim neque. Cursus vitae congue mauris rhoncus aenean vel elit scelerisque mauris. Tincidunt eget nullam non nisi est. Aliquam purus sit amet luctus. Dui ut ornare lectus sit amet est placerat in. Fringilla ut morbi tincidunt augue interdum velit euismod in. Felis eget nunc lobortis mattis aliquam faucibus purus in. Suspendisse interdum consectetur libero id faucibus nisl. - -Scelerisque fermentum dui faucibus in ornare quam. Lectus proin nibh nisl condimentum id venenatis a condimentum vitae. Fames ac turpis egestas integer eget aliquet nibh praesent tristique. Arcu non sodales neque sodales ut etiam sit. Pharetra convallis posuere morbi leo urna. Nec dui nunc mattis enim ut tellus. Nunc sed augue lacus viverra vitae. Consequat id porta nibh venenatis cras sed felis. Dolor sit amet consectetur adipiscing. Tellus rutrum tellus pellentesque eu tincidunt tortor aliquam nulla. - -Metus aliquam eleifend mi in nulla posuere. Blandit massa enim nec dui nunc mattis enim. Aliquet nibh praesent tristique magna. In aliquam sem fringilla ut. Magna fermentum iaculis eu non. Eget aliquet nibh praesent tristique magna sit amet purus. Ultrices gravida dictum fusce ut placerat orci. Fermentum posuere urna nec tincidunt praesent. Enim tortor at auctor urna nunc. Ridiculus mus mauris vitae ultricies leo integer malesuada nunc vel. Sed id semper risus in hendrerit gravida rutrum. Vestibulum lectus mauris ultrices eros in cursus turpis. Et sollicitudin ac orci phasellus egestas tellus rutrum. Pellentesque elit ullamcorper dignissim cras tincidunt lobortis feugiat vivamus at. Metus vulputate eu scelerisque felis imperdiet proin fermentum leo. Porta non pulvinar neque laoreet suspendisse. Suscipit adipiscing bibendum est ultricies integer quis auctor elit sed. Euismod in pellentesque massa placerat duis ultricies lacus sed. Pellentesque adipiscing commodo elit at imperdiet dui accumsan sit amet. - -Pellentesque eu tincidunt tortor aliquam nulla facilisi. Commodo nulla facilisi nullam vehicula ipsum a arcu. Commodo quis imperdiet massa tincidunt nunc pulvinar sapien et. Faucibus purus in massa tempor. Purus semper eget duis at tellus at urna condimentum. Vivamus at augue eget arcu dictum. Lacus vel facilisis volutpat est velit egestas dui id. Malesuada fames ac turpis egestas maecenas pharetra. Nunc faucibus a pellentesque sit amet porttitor eget dolor. Ultricies tristique nulla aliquet enim. Vel risus commodo viverra maecenas accumsan lacus vel facilisis volutpat. Dignissim diam quis enim lobortis scelerisque. Donec ultrices tincidunt arcu non sodales neque sodales ut etiam. - -Vitae proin sagittis nisl rhoncus mattis rhoncus urna neque. Fermentum leo vel orci porta non. At elementum eu facilisis sed. Quis enim lobortis scelerisque fermentum. Fermentum odio eu feugiat pretium nibh ipsum consequat. Habitant morbi tristique senectus et netus et. Enim praesent elementum facilisis leo vel fringilla est ullamcorper. Egestas quis ipsum suspendisse ultrices gravida dictum. Nam libero justo laoreet sit amet cursus sit amet. Viverra tellus in hac habitasse platea dictumst vestibulum. Varius vel pharetra vel turpis nunc eget. Nullam non nisi est sit amet facilisis magna. Ullamcorper eget nulla facilisi etiam dignissim diam. Ante metus dictum at tempor commodo ullamcorper a lacus. - -Etiam non quam lacus suspendisse. Ut venenatis tellus in metus vulputate eu scelerisque felis. Pulvinar sapien et ligula ullamcorper malesuada proin libero. Consequat interdum varius sit amet mattis. Nunc eget lorem dolor sed viverra ipsum nunc aliquet. Potenti nullam ac tortor vitae purus faucibus ornare. Urna et pharetra pharetra massa massa ultricies mi quis hendrerit. Purus in mollis nunc sed id. Pharetra vel turpis nunc eget lorem dolor sed viverra. Et netus et malesuada fames ac turpis. Libero id faucibus nisl tincidunt eget nullam non nisi. Cursus sit amet dictum sit amet. Porttitor lacus luctus accumsan tortor. - -Volutpat diam ut venenatis tellus in metus vulputate eu scelerisque. Sed viverra tellus in hac habitasse. Aliquam sem et tortor consequat id. Pellentesque habitant morbi tristique senectus et netus et. Consectetur purus ut faucibus pulvinar elementum. Aliquam malesuada bibendum arcu vitae elementum curabitur vitae nunc sed. Malesuada bibendum arcu vitae elementum curabitur vitae nunc sed. Sollicitudin tempor id eu nisl nunc mi ipsum. Fringilla phasellus faucibus scelerisque eleifend donec pretium vulputate sapien nec. Quis eleifend quam adipiscing vitae proin sagittis nisl rhoncus. Bibendum neque egestas congue quisque egestas. A iaculis at erat pellentesque adipiscing commodo elit at imperdiet. Pulvinar etiam non quam lacus. Adipiscing commodo elit at imperdiet. Scelerisque eu ultrices vitae auctor. Sed cras ornare arcu dui vivamus arcu felis bibendum ut. Ornare lectus sit amet est. - -Consequat semper viverra nam libero justo laoreet sit. Imperdiet sed euismod nisi porta lorem mollis aliquam ut porttitor. Cras sed felis eget velit aliquet sagittis id consectetur. Dolor morbi non arcu risus quis. Adipiscing tristique risus nec feugiat in fermentum posuere urna. Dolor magna eget est lorem ipsum dolor. Mauris pharetra et ultrices neque ornare aenean euismod. Nulla facilisi etiam dignissim diam quis. Ultrices tincidunt arcu non sodales. Fames ac turpis egestas maecenas pharetra convallis posuere morbi leo. Interdum varius sit amet mattis vulputate. Tincidunt praesent semper feugiat nibh sed pulvinar. Quisque sagittis purus sit amet volutpat. - -Sed vulputate odio ut enim blandit. Vitae auctor eu augue ut lectus arcu bibendum. Consectetur adipiscing elit pellentesque habitant morbi tristique senectus et. Scelerisque eu ultrices vitae auctor eu augue. Etiam dignissim diam quis enim lobortis scelerisque fermentum dui faucibus. Tellus integer feugiat scelerisque varius. Vulputate enim nulla aliquet porttitor lacus luctus accumsan tortor. Amet nisl purus in mollis. Scelerisque viverra mauris in aliquam sem fringilla ut morbi tincidunt. Semper eget duis at tellus at. Erat velit scelerisque in dictum non consectetur a erat nam. Gravida rutrum quisque non tellus orci. Morbi blandit cursus risus at. Mauris sit amet massa vitae. Non odio euismod lacinia at quis risus sed vulputate. Fermentum posuere urna nec tincidunt praesent. Ut eu sem integer vitae justo eget magna fermentum iaculis. Ullamcorper velit sed ullamcorper morbi tincidunt ornare massa. Arcu cursus euismod quis viverra nibh. Arcu dui vivamus arcu felis bibendum. - -Eros in cursus turpis massa tincidunt dui ut. Aarsh shah is simply an amazing person. Urna condimentum mattis pellentesque id nibh tortor id aliquet lectus. Nibh venenatis cras sed felis. Ac felis donec et odio pellentesque diam. Ultricies lacus sed turpis tincidunt id aliquet risus. Diam volutpat commodo sed egestas. Dignissim sodales ut eu sem integer vitae. Pellentesque eu tincidunt tortor aliquam nulla facilisi. Et tortor consequat id porta nibh venenatis cras sed. \ No newline at end of file diff --git a/node/impl/full.go b/node/impl/full.go index 527a5538436..aef7a75cb2a 100644 --- a/node/impl/full.go +++ b/node/impl/full.go @@ -9,7 +9,6 @@ import ( "github.com/filecoin-project/lotus/api" "github.com/filecoin-project/lotus/build" - "github.com/filecoin-project/lotus/node/impl/client" "github.com/filecoin-project/lotus/node/impl/common" "github.com/filecoin-project/lotus/node/impl/full" "github.com/filecoin-project/lotus/node/impl/market" @@ -25,7 +24,6 @@ type FullNodeAPI struct { common.CommonAPI net.NetAPI full.ChainAPI - client.API full.MpoolAPI full.GasAPI market.MarketAPI diff --git a/node/impl/storminer.go b/node/impl/storminer.go index bd482494017..44fa4840fc1 100644 --- a/node/impl/storminer.go +++ b/node/impl/storminer.go @@ -3,34 +3,18 @@ package impl import ( "context" "encoding/json" - "errors" "fmt" "net/http" - "os" - "sort" "strconv" "time" "github.com/google/uuid" "github.com/ipfs/go-cid" - "github.com/ipfs/go-graphsync" - gsimpl "github.com/ipfs/go-graphsync/impl" - "github.com/ipfs/go-graphsync/peerstate" - "github.com/libp2p/go-libp2p/core/host" - "github.com/libp2p/go-libp2p/core/peer" "go.uber.org/fx" "golang.org/x/xerrors" - "github.com/filecoin-project/dagstore" - "github.com/filecoin-project/dagstore/shard" "github.com/filecoin-project/go-address" "github.com/filecoin-project/go-bitfield" - datatransfer "github.com/filecoin-project/go-data-transfer/v2" - gst "github.com/filecoin-project/go-data-transfer/v2/transport/graphsync" - "github.com/filecoin-project/go-fil-markets/piecestore" - "github.com/filecoin-project/go-fil-markets/retrievalmarket" - "github.com/filecoin-project/go-fil-markets/storagemarket" - filmktsstore "github.com/filecoin-project/go-fil-markets/stores" "github.com/filecoin-project/go-jsonrpc/auth" "github.com/filecoin-project/go-state-types/abi" "github.com/filecoin-project/go-state-types/big" @@ -46,8 +30,6 @@ import ( "github.com/filecoin-project/lotus/chain/gen" "github.com/filecoin-project/lotus/chain/types" "github.com/filecoin-project/lotus/lib/harmony/harmonydb" - mktsdagstore "github.com/filecoin-project/lotus/markets/dagstore" - "github.com/filecoin-project/lotus/markets/storageadapter" "github.com/filecoin-project/lotus/miner" "github.com/filecoin-project/lotus/node/modules" "github.com/filecoin-project/lotus/node/modules/dtypes" @@ -76,18 +58,7 @@ type StorageMinerAPI struct { RemoteStore *paths.Remote // Markets - PieceStore dtypes.ProviderPieceStore `optional:"true"` - StorageProvider storagemarket.StorageProvider `optional:"true"` - RetrievalProvider retrievalmarket.RetrievalProvider `optional:"true"` - SectorAccessor retrievalmarket.SectorAccessor `optional:"true"` - DataTransfer dtypes.ProviderDataTransfer `optional:"true"` - StagingGraphsync dtypes.StagingGraphsync `optional:"true"` - Transport dtypes.ProviderTransport `optional:"true"` - DealPublisher *storageadapter.DealPublisher `optional:"true"` - SectorBlocks *sectorblocks.SectorBlocks `optional:"true"` - Host host.Host `optional:"true"` - DAGStore *dagstore.DAGStore `optional:"true"` - DAGStoreWrapper *mktsdagstore.Wrapper `optional:"true"` + SectorBlocks *sectorblocks.SectorBlocks `optional:"true"` // Miner / storage Miner *sealing.Sealing `optional:"true"` @@ -106,24 +77,10 @@ type StorageMinerAPI struct { // StorageService is populated when we're not the main storage node (e.g. we're a markets node) StorageService modules.MinerStorageService `optional:"true"` - ConsiderOnlineStorageDealsConfigFunc dtypes.ConsiderOnlineStorageDealsConfigFunc `optional:"true"` - SetConsiderOnlineStorageDealsConfigFunc dtypes.SetConsiderOnlineStorageDealsConfigFunc `optional:"true"` - ConsiderOnlineRetrievalDealsConfigFunc dtypes.ConsiderOnlineRetrievalDealsConfigFunc `optional:"true"` - SetConsiderOnlineRetrievalDealsConfigFunc dtypes.SetConsiderOnlineRetrievalDealsConfigFunc `optional:"true"` - StorageDealPieceCidBlocklistConfigFunc dtypes.StorageDealPieceCidBlocklistConfigFunc `optional:"true"` - SetStorageDealPieceCidBlocklistConfigFunc dtypes.SetStorageDealPieceCidBlocklistConfigFunc `optional:"true"` - ConsiderOfflineStorageDealsConfigFunc dtypes.ConsiderOfflineStorageDealsConfigFunc `optional:"true"` - SetConsiderOfflineStorageDealsConfigFunc dtypes.SetConsiderOfflineStorageDealsConfigFunc `optional:"true"` - ConsiderOfflineRetrievalDealsConfigFunc dtypes.ConsiderOfflineRetrievalDealsConfigFunc `optional:"true"` - SetConsiderOfflineRetrievalDealsConfigFunc dtypes.SetConsiderOfflineRetrievalDealsConfigFunc `optional:"true"` - ConsiderVerifiedStorageDealsConfigFunc dtypes.ConsiderVerifiedStorageDealsConfigFunc `optional:"true"` - SetConsiderVerifiedStorageDealsConfigFunc dtypes.SetConsiderVerifiedStorageDealsConfigFunc `optional:"true"` - ConsiderUnverifiedStorageDealsConfigFunc dtypes.ConsiderUnverifiedStorageDealsConfigFunc `optional:"true"` - SetConsiderUnverifiedStorageDealsConfigFunc dtypes.SetConsiderUnverifiedStorageDealsConfigFunc `optional:"true"` - SetSealingConfigFunc dtypes.SetSealingConfigFunc `optional:"true"` - GetSealingConfigFunc dtypes.GetSealingConfigFunc `optional:"true"` - GetExpectedSealDurationFunc dtypes.GetExpectedSealDurationFunc `optional:"true"` - SetExpectedSealDurationFunc dtypes.SetExpectedSealDurationFunc `optional:"true"` + SetSealingConfigFunc dtypes.SetSealingConfigFunc `optional:"true"` + GetSealingConfigFunc dtypes.GetSealingConfigFunc `optional:"true"` + GetExpectedSealDurationFunc dtypes.GetExpectedSealDurationFunc `optional:"true"` + SetExpectedSealDurationFunc dtypes.SetExpectedSealDurationFunc `optional:"true"` HarmonyDB *harmonydb.DB `optional:"true"` } @@ -533,16 +490,6 @@ func (sm *StorageMinerAPI) SealingRemoveRequest(ctx context.Context, schedId uui return sm.StorageMgr.RemoveSchedRequest(ctx, schedId) } -func (sm *StorageMinerAPI) MarketImportDealData(ctx context.Context, propCid cid.Cid, path string) error { - fi, err := os.Open(path) - if err != nil { - return xerrors.Errorf("failed to open file: %w", err) - } - defer fi.Close() //nolint:errcheck - - return sm.StorageProvider.ImportDataForDeal(ctx, propCid, fi) -} - func (sm *StorageMinerAPI) listDeals(ctx context.Context) ([]*api.MarketDeal, error) { ts, err := sm.Full.ChainHead(ctx) if err != nil { @@ -569,671 +516,10 @@ func (sm *StorageMinerAPI) MarketListDeals(ctx context.Context) ([]*api.MarketDe return sm.listDeals(ctx) } -func (sm *StorageMinerAPI) MarketListRetrievalDeals(ctx context.Context) ([]struct{}, error) { - return []struct{}{}, nil -} - -func (sm *StorageMinerAPI) MarketGetDealUpdates(ctx context.Context) (<-chan storagemarket.MinerDeal, error) { - results := make(chan storagemarket.MinerDeal) - unsub := sm.StorageProvider.SubscribeToEvents(func(evt storagemarket.ProviderEvent, deal storagemarket.MinerDeal) { - select { - case results <- deal: - case <-ctx.Done(): - } - }) - go func() { - <-ctx.Done() - unsub() - close(results) - }() - return results, nil -} - -func (sm *StorageMinerAPI) MarketListIncompleteDeals(ctx context.Context) ([]storagemarket.MinerDeal, error) { - return sm.StorageProvider.ListLocalDeals() -} - -func (sm *StorageMinerAPI) MarketSetAsk(ctx context.Context, price types.BigInt, verifiedPrice types.BigInt, duration abi.ChainEpoch, minPieceSize abi.PaddedPieceSize, maxPieceSize abi.PaddedPieceSize) error { - options := []storagemarket.StorageAskOption{ - storagemarket.MinPieceSize(minPieceSize), - storagemarket.MaxPieceSize(maxPieceSize), - } - - return sm.StorageProvider.SetAsk(price, verifiedPrice, duration, options...) -} - -func (sm *StorageMinerAPI) MarketGetAsk(ctx context.Context) (*storagemarket.SignedStorageAsk, error) { - return sm.StorageProvider.GetAsk(), nil -} - -func (sm *StorageMinerAPI) MarketSetRetrievalAsk(ctx context.Context, rask *retrievalmarket.Ask) error { - sm.RetrievalProvider.SetAsk(rask) - return nil -} - -func (sm *StorageMinerAPI) MarketGetRetrievalAsk(ctx context.Context) (*retrievalmarket.Ask, error) { - return sm.RetrievalProvider.GetAsk(), nil -} - -func (sm *StorageMinerAPI) MarketListDataTransfers(ctx context.Context) ([]api.DataTransferChannel, error) { - inProgressChannels, err := sm.DataTransfer.InProgressChannels(ctx) - if err != nil { - return nil, err - } - - apiChannels := make([]api.DataTransferChannel, 0, len(inProgressChannels)) - for _, channelState := range inProgressChannels { - apiChannels = append(apiChannels, api.NewDataTransferChannel(sm.Host.ID(), channelState)) - } - - return apiChannels, nil -} - -func (sm *StorageMinerAPI) MarketRestartDataTransfer(ctx context.Context, transferID datatransfer.TransferID, otherPeer peer.ID, isInitiator bool) error { - selfPeer := sm.Host.ID() - if isInitiator { - return sm.DataTransfer.RestartDataTransferChannel(ctx, datatransfer.ChannelID{Initiator: selfPeer, Responder: otherPeer, ID: transferID}) - } - return sm.DataTransfer.RestartDataTransferChannel(ctx, datatransfer.ChannelID{Initiator: otherPeer, Responder: selfPeer, ID: transferID}) -} - -func (sm *StorageMinerAPI) MarketCancelDataTransfer(ctx context.Context, transferID datatransfer.TransferID, otherPeer peer.ID, isInitiator bool) error { - selfPeer := sm.Host.ID() - if isInitiator { - return sm.DataTransfer.CloseDataTransferChannel(ctx, datatransfer.ChannelID{Initiator: selfPeer, Responder: otherPeer, ID: transferID}) - } - return sm.DataTransfer.CloseDataTransferChannel(ctx, datatransfer.ChannelID{Initiator: otherPeer, Responder: selfPeer, ID: transferID}) -} - -func (sm *StorageMinerAPI) MarketDataTransferUpdates(ctx context.Context) (<-chan api.DataTransferChannel, error) { - channels := make(chan api.DataTransferChannel) - - unsub := sm.DataTransfer.SubscribeToEvents(func(evt datatransfer.Event, channelState datatransfer.ChannelState) { - channel := api.NewDataTransferChannel(sm.Host.ID(), channelState) - select { - case <-ctx.Done(): - case channels <- channel: - } - }) - - go func() { - defer unsub() - <-ctx.Done() - }() - - return channels, nil -} - -func (sm *StorageMinerAPI) MarketDataTransferDiagnostics(ctx context.Context, mpid peer.ID) (*api.TransferDiagnostics, error) { - gsTransport, ok := sm.Transport.(*gst.Transport) - if !ok { - return nil, errors.New("api only works for graphsync as transport") - } - graphsyncConcrete, ok := sm.StagingGraphsync.(*gsimpl.GraphSync) - if !ok { - return nil, errors.New("api only works for non-mock graphsync implementation") - } - - inProgressChannels, err := sm.DataTransfer.InProgressChannels(ctx) - if err != nil { - return nil, err - } - - allReceivingChannels := make(map[datatransfer.ChannelID]datatransfer.ChannelState) - allSendingChannels := make(map[datatransfer.ChannelID]datatransfer.ChannelState) - for channelID, channel := range inProgressChannels { - if channel.OtherPeer() != mpid { - continue - } - if channel.Status() == datatransfer.Completed { - continue - } - if channel.Status() == datatransfer.Failed || channel.Status() == datatransfer.Cancelled { - continue - } - if channel.SelfPeer() == channel.Sender() { - allSendingChannels[channelID] = channel - } else { - allReceivingChannels[channelID] = channel - } - } - - // gather information about active transport channels - transportChannels := gsTransport.ChannelsForPeer(mpid) - // gather information about graphsync state for peer - gsPeerState := graphsyncConcrete.PeerState(mpid) - - sendingTransfers := sm.generateTransfers(ctx, transportChannels.SendingChannels, gsPeerState.IncomingState, allSendingChannels) - receivingTransfers := sm.generateTransfers(ctx, transportChannels.ReceivingChannels, gsPeerState.OutgoingState, allReceivingChannels) - - return &api.TransferDiagnostics{ - SendingTransfers: sendingTransfers, - ReceivingTransfers: receivingTransfers, - }, nil -} - -// generate transfers matches graphsync state and data transfer state for a given peer -// to produce detailed output on what's happening with a transfer -func (sm *StorageMinerAPI) generateTransfers(ctx context.Context, - transportChannels map[datatransfer.ChannelID]gst.ChannelGraphsyncRequests, - gsPeerState peerstate.PeerState, - allChannels map[datatransfer.ChannelID]datatransfer.ChannelState) []*api.GraphSyncDataTransfer { - tc := &transferConverter{ - matchedChannelIds: make(map[datatransfer.ChannelID]struct{}), - matchedRequests: make(map[graphsync.RequestID]*api.GraphSyncDataTransfer), - gsDiagnostics: gsPeerState.Diagnostics(), - requestStates: gsPeerState.RequestStates, - allChannels: allChannels, - } - - // iterate through all operating data transfer transport channels - for channelID, channelRequests := range transportChannels { - originalState, err := sm.DataTransfer.ChannelState(ctx, channelID) - var baseDiagnostics []string - var channelState *api.DataTransferChannel - if err != nil { - baseDiagnostics = append(baseDiagnostics, fmt.Sprintf("Unable to lookup channel state: %s", err)) - } else { - cs := api.NewDataTransferChannel(sm.Host.ID(), originalState) - channelState = &cs - } - // add the current request for this channel - tc.convertTransfer(channelID, true, channelState, baseDiagnostics, channelRequests.Current, true) - for _, requestID := range channelRequests.Previous { - // add any previous requests that were cancelled for a restart - tc.convertTransfer(channelID, true, channelState, baseDiagnostics, requestID, false) - } - } - - // collect any graphsync data for channels we don't have any data transfer data for - tc.collectRemainingTransfers() - - return tc.transfers -} - -type transferConverter struct { - matchedChannelIds map[datatransfer.ChannelID]struct{} - matchedRequests map[graphsync.RequestID]*api.GraphSyncDataTransfer - transfers []*api.GraphSyncDataTransfer - gsDiagnostics map[graphsync.RequestID][]string - requestStates graphsync.RequestStates - allChannels map[datatransfer.ChannelID]datatransfer.ChannelState -} - -// convert transfer assembles transfer and diagnostic data for a given graphsync/data-transfer request -func (tc *transferConverter) convertTransfer(channelID datatransfer.ChannelID, hasChannelID bool, channelState *api.DataTransferChannel, baseDiagnostics []string, - requestID graphsync.RequestID, isCurrentChannelRequest bool) { - diagnostics := baseDiagnostics - state, hasState := tc.requestStates[requestID] - stateString := state.String() - if !hasState { - stateString = "no graphsync state found" - } - var channelIDPtr *datatransfer.ChannelID - if !hasChannelID { - diagnostics = append(diagnostics, fmt.Sprintf("No data transfer channel id for GraphSync request ID %s", requestID)) - } else { - channelIDPtr = &channelID - if isCurrentChannelRequest && !hasState { - diagnostics = append(diagnostics, fmt.Sprintf("No current request state for data transfer channel id %s", channelID)) - } else if !isCurrentChannelRequest && hasState { - diagnostics = append(diagnostics, fmt.Sprintf("Graphsync request %s is a previous request on data transfer channel id %s that was restarted, but it is still running", requestID, channelID)) - } - } - diagnostics = append(diagnostics, tc.gsDiagnostics[requestID]...) - transfer := &api.GraphSyncDataTransfer{ - RequestID: &requestID, - RequestState: stateString, - IsCurrentChannelRequest: isCurrentChannelRequest, - ChannelID: channelIDPtr, - ChannelState: channelState, - Diagnostics: diagnostics, - } - tc.transfers = append(tc.transfers, transfer) - tc.matchedRequests[requestID] = transfer - if hasChannelID { - tc.matchedChannelIds[channelID] = struct{}{} - } -} - -func (tc *transferConverter) collectRemainingTransfers() { - for requestID := range tc.requestStates { - if _, ok := tc.matchedRequests[requestID]; !ok { - tc.convertTransfer(datatransfer.ChannelID{}, false, nil, nil, requestID, false) - } - } - for requestID := range tc.gsDiagnostics { - if _, ok := tc.matchedRequests[requestID]; !ok { - tc.convertTransfer(datatransfer.ChannelID{}, false, nil, nil, requestID, false) - } - } - for channelID, channelState := range tc.allChannels { - if _, ok := tc.matchedChannelIds[channelID]; !ok { - channelID := channelID - cs := api.NewDataTransferChannel(channelState.SelfPeer(), channelState) - transfer := &api.GraphSyncDataTransfer{ - RequestID: nil, - RequestState: "graphsync state unknown", - IsCurrentChannelRequest: false, - ChannelID: &channelID, - ChannelState: &cs, - Diagnostics: []string{"data transfer with no open transport channel, cannot determine linked graphsync request"}, - } - tc.transfers = append(tc.transfers, transfer) - } - } -} - -func (sm *StorageMinerAPI) MarketPendingDeals(ctx context.Context) (api.PendingDealInfo, error) { - return sm.DealPublisher.PendingDeals(), nil -} - -func (sm *StorageMinerAPI) MarketRetryPublishDeal(ctx context.Context, propcid cid.Cid) error { - return sm.StorageProvider.RetryDealPublishing(propcid) -} - -func (sm *StorageMinerAPI) MarketPublishPendingDeals(ctx context.Context) error { - sm.DealPublisher.ForcePublishPendingDeals() - return nil -} - -func (sm *StorageMinerAPI) DagstoreListShards(ctx context.Context) ([]api.DagstoreShardInfo, error) { - if sm.DAGStore == nil { - return nil, fmt.Errorf("dagstore not available on this node") - } - - info := sm.DAGStore.AllShardsInfo() - ret := make([]api.DagstoreShardInfo, 0, len(info)) - for k, i := range info { - ret = append(ret, api.DagstoreShardInfo{ - Key: k.String(), - State: i.ShardState.String(), - Error: func() string { - if i.Error == nil { - return "" - } - return i.Error.Error() - }(), - }) - } - - // order by key. - sort.SliceStable(ret, func(i, j int) bool { - return ret[i].Key < ret[j].Key - }) - - return ret, nil -} - -func (sm *StorageMinerAPI) DagstoreRegisterShard(ctx context.Context, key string) error { - if sm.DAGStore == nil { - return fmt.Errorf("dagstore not available on this node") - } - - // First check if the shard has already been registered - k := shard.KeyFromString(key) - _, err := sm.DAGStore.GetShardInfo(k) - if err == nil { - // Shard already registered, nothing further to do - return nil - } - // If the shard is not registered we would expect ErrShardUnknown - if !errors.Is(err, dagstore.ErrShardUnknown) { - return fmt.Errorf("getting shard info from DAG store: %w", err) - } - - pieceCid, err := cid.Parse(key) - if err != nil { - return fmt.Errorf("parsing shard key as piece cid: %w", err) - } - - if err = filmktsstore.RegisterShardSync(ctx, sm.DAGStoreWrapper, pieceCid, "", true); err != nil { - return fmt.Errorf("failed to register shard: %w", err) - } - - return nil -} - -func (sm *StorageMinerAPI) DagstoreInitializeShard(ctx context.Context, key string) error { - if sm.DAGStore == nil { - return fmt.Errorf("dagstore not available on this node") - } - - k := shard.KeyFromString(key) - - info, err := sm.DAGStore.GetShardInfo(k) - if err != nil { - return fmt.Errorf("failed to get shard info: %w", err) - } - if st := info.ShardState; st != dagstore.ShardStateNew { - return fmt.Errorf("cannot initialize shard; expected state ShardStateNew, was: %s", st.String()) - } - - ch := make(chan dagstore.ShardResult, 1) - if err = sm.DAGStore.AcquireShard(ctx, k, ch, dagstore.AcquireOpts{}); err != nil { - return fmt.Errorf("failed to acquire shard: %w", err) - } - - var res dagstore.ShardResult - select { - case res = <-ch: - case <-ctx.Done(): - return ctx.Err() - } - - if err := res.Error; err != nil { - return fmt.Errorf("failed to acquire shard: %w", err) - } - - if res.Accessor != nil { - err = res.Accessor.Close() - if err != nil { - log.Warnw("failed to close shard accessor; continuing", "shard_key", k, "error", err) - } - } - - return nil -} - -func (sm *StorageMinerAPI) DagstoreInitializeAll(ctx context.Context, params api.DagstoreInitializeAllParams) (<-chan api.DagstoreInitializeAllEvent, error) { - if sm.DAGStore == nil { - return nil, fmt.Errorf("dagstore not available on this node") - } - - if sm.SectorAccessor == nil { - return nil, fmt.Errorf("sector accessor not available on this node") - } - - // prepare the thottler tokens. - var throttle chan struct{} - if c := params.MaxConcurrency; c > 0 { - throttle = make(chan struct{}, c) - for i := 0; i < c; i++ { - throttle <- struct{}{} - } - } - - // are we initializing only unsealed pieces? - onlyUnsealed := !params.IncludeSealed - - info := sm.DAGStore.AllShardsInfo() - var toInitialize []string - for k, i := range info { - if i.ShardState != dagstore.ShardStateNew { - continue - } - - // if we're initializing only unsealed pieces, check if there's an - // unsealed deal for this piece available. - if onlyUnsealed { - pieceCid, err := cid.Decode(k.String()) - if err != nil { - log.Warnw("DagstoreInitializeAll: failed to decode shard key as piece CID; skipping", "shard_key", k.String(), "error", err) - continue - } - - pi, err := sm.PieceStore.GetPieceInfo(pieceCid) - if err != nil { - log.Warnw("DagstoreInitializeAll: failed to get piece info; skipping", "piece_cid", pieceCid, "error", err) - continue - } - - var isUnsealed bool - for _, d := range pi.Deals { - isUnsealed, err = sm.SectorAccessor.IsUnsealed(ctx, d.SectorID, d.Offset.Unpadded(), d.Length.Unpadded()) - if err != nil { - log.Warnw("DagstoreInitializeAll: failed to get unsealed status; skipping deal", "deal_id", d.DealID, "error", err) - continue - } - if isUnsealed { - break - } - } - - if !isUnsealed { - log.Infow("DagstoreInitializeAll: skipping piece because it's sealed", "piece_cid", pieceCid, "error", err) - continue - } - } - - // yes, we're initializing this shard. - toInitialize = append(toInitialize, k.String()) - } - - total := len(toInitialize) - if total == 0 { - out := make(chan api.DagstoreInitializeAllEvent) - close(out) - return out, nil - } - - // response channel must be closed when we're done, or the context is cancelled. - // this buffering is necessary to prevent inflight children goroutines from - // publishing to a closed channel (res) when the context is cancelled. - out := make(chan api.DagstoreInitializeAllEvent, 32) // internal buffer. - res := make(chan api.DagstoreInitializeAllEvent, 32) // returned to caller. - - // pump events back to caller. - // two events per shard. - go func() { - defer close(res) - - for i := 0; i < total*2; i++ { - select { - case res <- <-out: - case <-ctx.Done(): - return - } - } - }() - - go func() { - for i, k := range toInitialize { - if throttle != nil { - select { - case <-throttle: - // acquired a throttle token, proceed. - case <-ctx.Done(): - return - } - } - - go func(k string, i int) { - r := api.DagstoreInitializeAllEvent{ - Key: k, - Event: "start", - Total: total, - Current: i + 1, // start with 1 - } - select { - case out <- r: - case <-ctx.Done(): - return - } - - err := sm.DagstoreInitializeShard(ctx, k) - - if throttle != nil { - throttle <- struct{}{} - } - - r.Event = "end" - if err == nil { - r.Success = true - } else { - r.Success = false - r.Error = err.Error() - } - - select { - case out <- r: - case <-ctx.Done(): - } - }(k, i) - } - }() - - return res, nil - -} - -func (sm *StorageMinerAPI) DagstoreRecoverShard(ctx context.Context, key string) error { - if sm.DAGStore == nil { - return fmt.Errorf("dagstore not available on this node") - } - - k := shard.KeyFromString(key) - - info, err := sm.DAGStore.GetShardInfo(k) - if err != nil { - return fmt.Errorf("failed to get shard info: %w", err) - } - if st := info.ShardState; st != dagstore.ShardStateErrored { - return fmt.Errorf("cannot recover shard; expected state ShardStateErrored, was: %s", st.String()) - } - - ch := make(chan dagstore.ShardResult, 1) - if err = sm.DAGStore.RecoverShard(ctx, k, ch, dagstore.RecoverOpts{}); err != nil { - return fmt.Errorf("failed to recover shard: %w", err) - } - - var res dagstore.ShardResult - select { - case res = <-ch: - case <-ctx.Done(): - return ctx.Err() - } - - return res.Error -} - -func (sm *StorageMinerAPI) DagstoreGC(ctx context.Context) ([]api.DagstoreShardResult, error) { - if sm.DAGStore == nil { - return nil, fmt.Errorf("dagstore not available on this node") - } - - res, err := sm.DAGStore.GC(ctx) - if err != nil { - return nil, fmt.Errorf("failed to gc: %w", err) - } - - ret := make([]api.DagstoreShardResult, 0, len(res.Shards)) - for k, err := range res.Shards { - r := api.DagstoreShardResult{Key: k.String()} - if err == nil { - r.Success = true - } else { - r.Success = false - r.Error = err.Error() - } - ret = append(ret, r) - } - - return ret, nil -} - -func (sm *StorageMinerAPI) IndexerAnnounceDeal(ctx context.Context, proposalCid cid.Cid) error { - return sm.StorageProvider.AnnounceDealToIndexer(ctx, proposalCid) -} - -func (sm *StorageMinerAPI) IndexerAnnounceAllDeals(ctx context.Context) error { - return sm.StorageProvider.AnnounceAllDealsToIndexer(ctx) -} - -func (sm *StorageMinerAPI) DagstoreLookupPieces(ctx context.Context, cid cid.Cid) ([]api.DagstoreShardInfo, error) { - if sm.DAGStore == nil { - return nil, fmt.Errorf("dagstore not available on this node") - } - - keys, err := sm.DAGStore.TopLevelIndex.GetShardsForMultihash(ctx, cid.Hash()) - if err != nil { - return nil, err - } - - var ret []api.DagstoreShardInfo - - for _, k := range keys { - shard, err := sm.DAGStore.GetShardInfo(k) - if err != nil { - return nil, err - } - - ret = append(ret, api.DagstoreShardInfo{ - Key: k.String(), - State: shard.ShardState.String(), - Error: func() string { - if shard.Error == nil { - return "" - } - return shard.Error.Error() - }(), - }) - } - - // order by key. - sort.SliceStable(ret, func(i, j int) bool { - return ret[i].Key < ret[j].Key - }) - - return ret, nil -} - func (sm *StorageMinerAPI) DealsList(ctx context.Context) ([]*api.MarketDeal, error) { return sm.listDeals(ctx) } -func (sm *StorageMinerAPI) RetrievalDealsList(ctx context.Context) (map[retrievalmarket.ProviderDealIdentifier]retrievalmarket.ProviderDealState, error) { - return sm.RetrievalProvider.ListDeals(), nil -} - -func (sm *StorageMinerAPI) DealsConsiderOnlineStorageDeals(ctx context.Context) (bool, error) { - return sm.ConsiderOnlineStorageDealsConfigFunc() -} - -func (sm *StorageMinerAPI) DealsSetConsiderOnlineStorageDeals(ctx context.Context, b bool) error { - return sm.SetConsiderOnlineStorageDealsConfigFunc(b) -} - -func (sm *StorageMinerAPI) DealsConsiderOnlineRetrievalDeals(ctx context.Context) (bool, error) { - return sm.ConsiderOnlineRetrievalDealsConfigFunc() -} - -func (sm *StorageMinerAPI) DealsSetConsiderOnlineRetrievalDeals(ctx context.Context, b bool) error { - return sm.SetConsiderOnlineRetrievalDealsConfigFunc(b) -} - -func (sm *StorageMinerAPI) DealsConsiderOfflineStorageDeals(ctx context.Context) (bool, error) { - return sm.ConsiderOfflineStorageDealsConfigFunc() -} - -func (sm *StorageMinerAPI) DealsSetConsiderOfflineStorageDeals(ctx context.Context, b bool) error { - return sm.SetConsiderOfflineStorageDealsConfigFunc(b) -} - -func (sm *StorageMinerAPI) DealsConsiderOfflineRetrievalDeals(ctx context.Context) (bool, error) { - return sm.ConsiderOfflineRetrievalDealsConfigFunc() -} - -func (sm *StorageMinerAPI) DealsSetConsiderOfflineRetrievalDeals(ctx context.Context, b bool) error { - return sm.SetConsiderOfflineRetrievalDealsConfigFunc(b) -} - -func (sm *StorageMinerAPI) DealsConsiderVerifiedStorageDeals(ctx context.Context) (bool, error) { - return sm.ConsiderVerifiedStorageDealsConfigFunc() -} - -func (sm *StorageMinerAPI) DealsSetConsiderVerifiedStorageDeals(ctx context.Context, b bool) error { - return sm.SetConsiderVerifiedStorageDealsConfigFunc(b) -} - -func (sm *StorageMinerAPI) DealsConsiderUnverifiedStorageDeals(ctx context.Context) (bool, error) { - return sm.ConsiderUnverifiedStorageDealsConfigFunc() -} - -func (sm *StorageMinerAPI) DealsSetConsiderUnverifiedStorageDeals(ctx context.Context, b bool) error { - return sm.SetConsiderUnverifiedStorageDealsConfigFunc(b) -} - func (sm *StorageMinerAPI) DealsGetExpectedSealDurationFunc(ctx context.Context) (time.Duration, error) { return sm.GetExpectedSealDurationFunc() } @@ -1242,24 +528,6 @@ func (sm *StorageMinerAPI) DealsSetExpectedSealDurationFunc(ctx context.Context, return sm.SetExpectedSealDurationFunc(d) } -func (sm *StorageMinerAPI) DealsImportData(ctx context.Context, deal cid.Cid, fname string) error { - fi, err := os.Open(fname) - if err != nil { - return xerrors.Errorf("failed to open given file: %w", err) - } - defer fi.Close() //nolint:errcheck - - return sm.StorageProvider.ImportDataForDeal(ctx, deal, fi) -} - -func (sm *StorageMinerAPI) DealsPieceCidBlocklist(ctx context.Context) ([]cid.Cid, error) { - return sm.StorageDealPieceCidBlocklistConfigFunc() -} - -func (sm *StorageMinerAPI) DealsSetPieceCidBlocklist(ctx context.Context, cids []cid.Cid) error { - return sm.SetStorageDealPieceCidBlocklistConfigFunc(cids) -} - func (sm *StorageMinerAPI) StorageAddLocal(ctx context.Context, path string) error { if sm.StorageMgr == nil { return xerrors.Errorf("no storage manager") @@ -1283,32 +551,6 @@ func (sm *StorageMinerAPI) StorageRedeclareLocal(ctx context.Context, id *storif return sm.StorageMgr.RedeclareLocalStorage(ctx, id, dropMissing) } - -func (sm *StorageMinerAPI) PiecesListPieces(ctx context.Context) ([]cid.Cid, error) { - return sm.PieceStore.ListPieceInfoKeys() -} - -func (sm *StorageMinerAPI) PiecesListCidInfos(ctx context.Context) ([]cid.Cid, error) { - return sm.PieceStore.ListCidInfoKeys() -} - -func (sm *StorageMinerAPI) PiecesGetPieceInfo(ctx context.Context, pieceCid cid.Cid) (*piecestore.PieceInfo, error) { - pi, err := sm.PieceStore.GetPieceInfo(pieceCid) - if err != nil { - return nil, err - } - return &pi, nil -} - -func (sm *StorageMinerAPI) PiecesGetCIDInfo(ctx context.Context, payloadCid cid.Cid) (*piecestore.CIDInfo, error) { - ci, err := sm.PieceStore.GetCIDInfo(payloadCid) - if err != nil { - return nil, err - } - - return &ci, nil -} - func (sm *StorageMinerAPI) CreateBackup(ctx context.Context, fpath string) error { return backup(ctx, sm.DS, fpath) } diff --git a/node/modules/alerts.go b/node/modules/alerts.go index 9976c6d0e42..e0aa0977a85 100644 --- a/node/modules/alerts.go +++ b/node/modules/alerts.go @@ -100,16 +100,6 @@ func CheckUDPBufferSize(wanted int) func(al *alerting.Alerting) { } } -func LegacyMarketsEOL(al *alerting.Alerting) { - // Add alert if lotus-miner legacy markets subsystem is still in use - alert := al.AddAlertType("system", "EOL") - - // Alert with a message to migrate to Boost or similar markets subsystems - al.Raise(alert, map[string]string{ - "message": "The lotus-miner legacy markets subsystem is deprecated and will be removed in a future release. Please migrate to [Boost](https://boost.filecoin.io) or similar markets subsystems.", - }) -} - func CheckFvmConcurrency() func(al *alerting.Alerting) { return func(al *alerting.Alerting) { fvmConcurrency, ok := os.LookupEnv("LOTUS_FVM_CONCURRENCY") diff --git a/node/modules/client.go b/node/modules/client.go index 9d8eef4217b..560e1d50996 100644 --- a/node/modules/client.go +++ b/node/modules/client.go @@ -3,44 +3,17 @@ package modules import ( "bytes" "context" - "os" - "path/filepath" - "time" "github.com/ipfs/go-datastore" - "github.com/ipfs/go-datastore/namespace" - "github.com/libp2p/go-libp2p/core/host" "go.uber.org/fx" "golang.org/x/xerrors" - "github.com/filecoin-project/go-data-transfer/v2/channelmonitor" - dtimpl "github.com/filecoin-project/go-data-transfer/v2/impl" - dtnet "github.com/filecoin-project/go-data-transfer/v2/network" - dtgstransport "github.com/filecoin-project/go-data-transfer/v2/transport/graphsync" - "github.com/filecoin-project/go-fil-markets/discovery" - discoveryimpl "github.com/filecoin-project/go-fil-markets/discovery/impl" - "github.com/filecoin-project/go-fil-markets/retrievalmarket" - retrievalimpl "github.com/filecoin-project/go-fil-markets/retrievalmarket/impl" - rmnet "github.com/filecoin-project/go-fil-markets/retrievalmarket/network" - "github.com/filecoin-project/go-fil-markets/storagemarket" - storageimpl "github.com/filecoin-project/go-fil-markets/storagemarket/impl" - smnet "github.com/filecoin-project/go-fil-markets/storagemarket/network" "github.com/filecoin-project/go-state-types/abi" - "github.com/filecoin-project/lotus/blockstore" "github.com/filecoin-project/lotus/chain/market" - "github.com/filecoin-project/lotus/journal" - "github.com/filecoin-project/lotus/markets" - marketevents "github.com/filecoin-project/lotus/markets/loggers" - "github.com/filecoin-project/lotus/markets/retrievaladapter" - "github.com/filecoin-project/lotus/markets/storageadapter" - "github.com/filecoin-project/lotus/node/config" "github.com/filecoin-project/lotus/node/impl/full" - payapi "github.com/filecoin-project/lotus/node/impl/paych" "github.com/filecoin-project/lotus/node/modules/dtypes" "github.com/filecoin-project/lotus/node/modules/helpers" - "github.com/filecoin-project/lotus/node/repo" - "github.com/filecoin-project/lotus/node/repo/imports" ) func HandleMigrateClientFunds(lc fx.Lifecycle, mctx helpers.MetricsCtx, ds dtypes.MetadataDS, wallet full.WalletAPI, fundMgr *market.FundManager) { @@ -76,143 +49,3 @@ func HandleMigrateClientFunds(lc fx.Lifecycle, mctx helpers.MetricsCtx, ds dtype }, }) } - -func ClientImportMgr(ds dtypes.MetadataDS, r repo.LockedRepo) (dtypes.ClientImportMgr, error) { - // store the imports under the repo's `imports` subdirectory. - dir := filepath.Join(r.Path(), "imports") - if err := os.MkdirAll(dir, 0755); err != nil { - return nil, xerrors.Errorf("failed to create directory %s: %w", dir, err) - } - - ns := namespace.Wrap(ds, datastore.NewKey("/client")) - return imports.NewManager(ns, dir), nil -} - -// TODO this should be removed. -func ClientBlockstore() dtypes.ClientBlockstore { - // in most cases this is now unused in normal operations -- however, it's important to preserve for the IPFS use case - return blockstore.WrapIDStore(blockstore.FromDatastore(datastore.NewMapDatastore())) -} - -// NewClientGraphsyncDataTransfer returns a data transfer manager that just -// uses the clients's Client DAG service for transfers -func NewClientGraphsyncDataTransfer(lc fx.Lifecycle, h host.Host, gs dtypes.Graphsync, ds dtypes.MetadataDS, r repo.LockedRepo) (dtypes.ClientDataTransfer, error) { - // go-data-transfer protocol retries: - // 1s, 5s, 25s, 2m5s, 5m x 11 ~= 1 hour - dtRetryParams := dtnet.RetryParameters(time.Second, 5*time.Minute, 15, 5) - net := dtnet.NewFromLibp2pHost(h, dtRetryParams) - - dtDs := namespace.Wrap(ds, datastore.NewKey("/datatransfer/client/transfers")) - transport := dtgstransport.NewTransport(h.ID(), gs) - - // data-transfer push / pull channel restart configuration: - dtRestartConfig := dtimpl.ChannelRestartConfig(channelmonitor.Config{ - // Disable Accept and Complete timeouts until this issue is resolved: - // https://github.com/filecoin-project/lotus/issues/6343# - // Wait for the other side to respond to an Open channel message - AcceptTimeout: 0, - // Wait for the other side to send a Complete message once all - // data has been sent / received - CompleteTimeout: 0, - - // When an error occurs, wait a little while until all related errors - // have fired before sending a restart message - RestartDebounce: 10 * time.Second, - // After sending a restart, wait for at least 1 minute before sending another - RestartBackoff: time.Minute, - // After trying to restart 3 times, give up and fail the transfer - MaxConsecutiveRestarts: 3, - }) - dt, err := dtimpl.NewDataTransfer(dtDs, net, transport, dtRestartConfig) - if err != nil { - return nil, err - } - - dt.OnReady(marketevents.ReadyLogger("client data transfer")) - lc.Append(fx.Hook{ - OnStart: func(ctx context.Context) error { - dt.SubscribeToEvents(marketevents.DataTransferLogger) - return dt.Start(ctx) - }, - OnStop: func(ctx context.Context) error { - return dt.Stop(ctx) - }, - }) - return dt, nil -} - -// NewClientDatastore creates a datastore for the client to store its deals -func NewClientDatastore(ds dtypes.MetadataDS) dtypes.ClientDatastore { - return namespace.Wrap(ds, datastore.NewKey("/deals/client")) -} - -// StorageBlockstoreAccessor returns the default storage blockstore accessor -// from the import manager. -func StorageBlockstoreAccessor(importmgr dtypes.ClientImportMgr) storagemarket.BlockstoreAccessor { - return storageadapter.NewImportsBlockstoreAccessor(importmgr) -} - -// RetrievalBlockstoreAccessor returns the default retrieval blockstore accessor -// using the subdirectory `retrievals` under the repo. -func RetrievalBlockstoreAccessor(r repo.LockedRepo) (retrievalmarket.BlockstoreAccessor, error) { - dir := filepath.Join(r.Path(), "retrievals") - if err := os.MkdirAll(dir, 0755); err != nil { - return nil, xerrors.Errorf("failed to create directory %s: %w", dir, err) - } - return retrievaladapter.NewCARBlockstoreAccessor(dir), nil -} - -func StorageClient(lc fx.Lifecycle, h host.Host, dataTransfer dtypes.ClientDataTransfer, discovery *discoveryimpl.Local, - deals dtypes.ClientDatastore, scn storagemarket.StorageClientNode, accessor storagemarket.BlockstoreAccessor, j journal.Journal) (storagemarket.StorageClient, error) { - // go-fil-markets protocol retries: - // 1s, 5s, 25s, 2m5s, 5m x 11 ~= 1 hour - marketsRetryParams := smnet.RetryParameters(time.Second, 5*time.Minute, 15, 5) - net := smnet.NewFromLibp2pHost(h, marketsRetryParams) - - c, err := storageimpl.NewClient(net, dataTransfer, discovery, deals, scn, accessor, storageimpl.DealPollingInterval(time.Second), storageimpl.MaxTraversalLinks(config.MaxTraversalLinks)) - if err != nil { - return nil, err - } - c.OnReady(marketevents.ReadyLogger("storage client")) - lc.Append(fx.Hook{ - OnStart: func(ctx context.Context) error { - c.SubscribeToEvents(marketevents.StorageClientLogger) - - evtType := j.RegisterEventType("markets/storage/client", "state_change") - c.SubscribeToEvents(markets.StorageClientJournaler(j, evtType)) - - return c.Start(ctx) - }, - OnStop: func(context.Context) error { - return c.Stop() - }, - }) - return c, nil -} - -// RetrievalClient creates a new retrieval client attached to the client blockstore -func RetrievalClient(forceOffChain bool) func(lc fx.Lifecycle, h host.Host, r repo.LockedRepo, dt dtypes.ClientDataTransfer, payAPI payapi.PaychAPI, resolver discovery.PeerResolver, - ds dtypes.MetadataDS, chainAPI full.ChainAPI, stateAPI full.StateAPI, accessor *retrievaladapter.APIBlockstoreAccessor, j journal.Journal) (retrievalmarket.RetrievalClient, error) { - return func(lc fx.Lifecycle, h host.Host, r repo.LockedRepo, dt dtypes.ClientDataTransfer, payAPI payapi.PaychAPI, resolver discovery.PeerResolver, - ds dtypes.MetadataDS, chainAPI full.ChainAPI, stateAPI full.StateAPI, accessor *retrievaladapter.APIBlockstoreAccessor, j journal.Journal) (retrievalmarket.RetrievalClient, error) { - adapter := retrievaladapter.NewRetrievalClientNode(forceOffChain, payAPI, chainAPI, stateAPI) - network := rmnet.NewFromLibp2pHost(h) - ds = namespace.Wrap(ds, datastore.NewKey("/retrievals/client")) - client, err := retrievalimpl.NewClient(network, dt, adapter, resolver, ds, accessor) - if err != nil { - return nil, err - } - client.OnReady(marketevents.ReadyLogger("retrieval client")) - lc.Append(fx.Hook{ - OnStart: func(ctx context.Context) error { - client.SubscribeToEvents(marketevents.RetrievalClientLogger) - - evtType := j.RegisterEventType("markets/retrieval/client", "state_change") - client.SubscribeToEvents(markets.RetrievalClientJournaler(j, evtType)) - - return client.Start(ctx) - }, - }) - return client, nil - } -} diff --git a/node/modules/dtypes/miner.go b/node/modules/dtypes/miner.go index 24bcc714c17..8e3a50cf14c 100644 --- a/node/modules/dtypes/miner.go +++ b/node/modules/dtypes/miner.go @@ -1,14 +1,11 @@ package dtypes import ( - "context" "time" "github.com/ipfs/go-cid" "github.com/filecoin-project/go-address" - "github.com/filecoin-project/go-fil-markets/retrievalmarket" - "github.com/filecoin-project/go-fil-markets/storagemarket" "github.com/filecoin-project/go-state-types/abi" "github.com/filecoin-project/lotus/storage/pipeline/sealiface" @@ -89,11 +86,3 @@ type SetExpectedSealDurationFunc func(time.Duration) error // GetExpectedSealDurationFunc is a function which reads from miner // too determine how long sealing is expected to take type GetExpectedSealDurationFunc func() (time.Duration, error) - -type SetMaxDealStartDelayFunc func(time.Duration) error -type GetMaxDealStartDelayFunc func() (time.Duration, error) - -type StorageDealFilter func(ctx context.Context, deal storagemarket.MinerDeal) (bool, string, error) -type RetrievalDealFilter func(ctx context.Context, deal retrievalmarket.ProviderDealState) (bool, string, error) - -type RetrievalPricingFunc func(ctx context.Context, dealPricingParams retrievalmarket.PricingInput) (retrievalmarket.Ask, error) diff --git a/node/modules/dtypes/storage.go b/node/modules/dtypes/storage.go index 7f0466f1f3d..102f6b67c0a 100644 --- a/node/modules/dtypes/storage.go +++ b/node/modules/dtypes/storage.go @@ -4,16 +4,8 @@ import ( bserv "github.com/ipfs/boxo/blockservice" exchange "github.com/ipfs/boxo/exchange" "github.com/ipfs/go-datastore" - "github.com/ipfs/go-graphsync" - - datatransfer "github.com/filecoin-project/go-data-transfer/v2" - dtnet "github.com/filecoin-project/go-data-transfer/v2/network" - "github.com/filecoin-project/go-fil-markets/piecestore" - "github.com/filecoin-project/go-fil-markets/storagemarket/impl/requestvalidation" - "github.com/filecoin-project/go-statestore" "github.com/filecoin-project/lotus/blockstore" - "github.com/filecoin-project/lotus/node/repo/imports" ) // MetadataDS stores metadata. By default it's namespaced under /metadata in @@ -67,26 +59,3 @@ type ( type ChainBitswap exchange.Interface type ChainBlockService bserv.BlockService - -type ClientImportMgr *imports.Manager -type ClientBlockstore blockstore.BasicBlockstore -type ClientDealStore *statestore.StateStore -type ClientRequestValidator *requestvalidation.UnifiedRequestValidator -type ClientDatastore datastore.Batching - -type Graphsync graphsync.GraphExchange - -// ClientDataTransfer is a data transfer manager for the client -type ClientDataTransfer datatransfer.Manager - -type ProviderDealStore *statestore.StateStore -type ProviderPieceStore piecestore.PieceStore - -type ProviderRequestValidator *requestvalidation.UnifiedRequestValidator - -// ProviderDataTransfer is a data transfer manager for the provider -type ProviderDataTransfer datatransfer.Manager -type ProviderTransferNetwork dtnet.DataTransferNetwork -type ProviderTransport datatransfer.Transport -type StagingBlockstore blockstore.BasicBlockstore -type StagingGraphsync graphsync.GraphExchange diff --git a/node/modules/graphsync.go b/node/modules/graphsync.go deleted file mode 100644 index ca69cd2d202..00000000000 --- a/node/modules/graphsync.go +++ /dev/null @@ -1,101 +0,0 @@ -package modules - -import ( - "context" - "time" - - "github.com/ipfs/go-graphsync" - graphsyncimpl "github.com/ipfs/go-graphsync/impl" - gsnet "github.com/ipfs/go-graphsync/network" - "github.com/ipfs/go-graphsync/storeutil" - "github.com/libp2p/go-libp2p/core/host" - "github.com/libp2p/go-libp2p/core/peer" - "go.opencensus.io/stats" - "go.uber.org/fx" - - "github.com/filecoin-project/lotus/metrics" - "github.com/filecoin-project/lotus/node/config" - "github.com/filecoin-project/lotus/node/modules/dtypes" - "github.com/filecoin-project/lotus/node/modules/helpers" - "github.com/filecoin-project/lotus/node/repo" -) - -// Graphsync creates a graphsync instance from the given loader and storer -func Graphsync(parallelTransfersForStorage uint64, parallelTransfersForRetrieval uint64) func(mctx helpers.MetricsCtx, lc fx.Lifecycle, r repo.LockedRepo, clientBs dtypes.ClientBlockstore, chainBs dtypes.ExposedBlockstore, h host.Host) (dtypes.Graphsync, error) { - return func(mctx helpers.MetricsCtx, lc fx.Lifecycle, r repo.LockedRepo, clientBs dtypes.ClientBlockstore, chainBs dtypes.ExposedBlockstore, h host.Host) (dtypes.Graphsync, error) { - graphsyncNetwork := gsnet.NewFromLibp2pHost(h) - lsys := storeutil.LinkSystemForBlockstore(clientBs) - - gs := graphsyncimpl.New(helpers.LifecycleCtx(mctx, lc), - graphsyncNetwork, - lsys, - graphsyncimpl.RejectAllRequestsByDefault(), - graphsyncimpl.MaxInProgressIncomingRequests(parallelTransfersForStorage), - graphsyncimpl.MaxInProgressOutgoingRequests(parallelTransfersForRetrieval), - graphsyncimpl.MaxLinksPerIncomingRequests(config.MaxTraversalLinks), - graphsyncimpl.MaxLinksPerOutgoingRequests(config.MaxTraversalLinks)) - chainLinkSystem := storeutil.LinkSystemForBlockstore(chainBs) - err := gs.RegisterPersistenceOption("chainstore", chainLinkSystem) - if err != nil { - return nil, err - } - gs.RegisterIncomingRequestHook(func(p peer.ID, requestData graphsync.RequestData, hookActions graphsync.IncomingRequestHookActions) { - _, has := requestData.Extension("chainsync") - if has { - // TODO: we should confirm the selector is a reasonable one before we validate - // TODO: this code will get more complicated and should probably not live here eventually - hookActions.ValidateRequest() - hookActions.UsePersistenceOption("chainstore") - } - }) - gs.RegisterOutgoingRequestHook(func(p peer.ID, requestData graphsync.RequestData, hookActions graphsync.OutgoingRequestHookActions) { - _, has := requestData.Extension("chainsync") - if has { - hookActions.UsePersistenceOption("chainstore") - } - }) - - graphsyncStats(mctx, lc, gs) - - return gs, nil - } -} - -func graphsyncStats(mctx helpers.MetricsCtx, lc fx.Lifecycle, gs dtypes.Graphsync) { - stopStats := make(chan struct{}) - lc.Append(fx.Hook{ - OnStart: func(context.Context) error { - go func() { - t := time.NewTicker(10 * time.Second) - for { - select { - case <-t.C: - - st := gs.Stats() - stats.Record(mctx, metrics.GraphsyncReceivingPeersCount.M(int64(st.OutgoingRequests.TotalPeers))) - stats.Record(mctx, metrics.GraphsyncReceivingActiveCount.M(int64(st.OutgoingRequests.Active))) - stats.Record(mctx, metrics.GraphsyncReceivingCountCount.M(int64(st.OutgoingRequests.Pending))) - stats.Record(mctx, metrics.GraphsyncReceivingTotalMemoryAllocated.M(int64(st.IncomingResponses.TotalAllocatedAllPeers))) - stats.Record(mctx, metrics.GraphsyncReceivingTotalPendingAllocations.M(int64(st.IncomingResponses.TotalPendingAllocations))) - stats.Record(mctx, metrics.GraphsyncReceivingPeersPending.M(int64(st.IncomingResponses.NumPeersWithPendingAllocations))) - stats.Record(mctx, metrics.GraphsyncSendingPeersCount.M(int64(st.IncomingRequests.TotalPeers))) - stats.Record(mctx, metrics.GraphsyncSendingActiveCount.M(int64(st.IncomingRequests.Active))) - stats.Record(mctx, metrics.GraphsyncSendingCountCount.M(int64(st.IncomingRequests.Pending))) - stats.Record(mctx, metrics.GraphsyncSendingTotalMemoryAllocated.M(int64(st.OutgoingResponses.TotalAllocatedAllPeers))) - stats.Record(mctx, metrics.GraphsyncSendingTotalPendingAllocations.M(int64(st.OutgoingResponses.TotalPendingAllocations))) - stats.Record(mctx, metrics.GraphsyncSendingPeersPending.M(int64(st.OutgoingResponses.NumPeersWithPendingAllocations))) - - case <-stopStats: - return - } - } - }() - - return nil - }, - OnStop: func(ctx context.Context) error { - close(stopStats) - return nil - }, - }) -} diff --git a/node/modules/services.go b/node/modules/services.go index f3dd443d94d..9c90ba1308d 100644 --- a/node/modules/services.go +++ b/node/modules/services.go @@ -6,8 +6,6 @@ import ( "strconv" "time" - "github.com/ipfs/go-datastore" - "github.com/ipfs/go-datastore/namespace" pubsub "github.com/libp2p/go-libp2p-pubsub" "github.com/libp2p/go-libp2p/core/event" "github.com/libp2p/go-libp2p/core/host" @@ -17,9 +15,6 @@ import ( "go.uber.org/fx" "golang.org/x/xerrors" - "github.com/filecoin-project/go-fil-markets/discovery" - discoveryimpl "github.com/filecoin-project/go-fil-markets/discovery/impl" - "github.com/filecoin-project/lotus/build" "github.com/filecoin-project/lotus/chain" "github.com/filecoin-project/lotus/chain/beacon" @@ -34,7 +29,6 @@ import ( "github.com/filecoin-project/lotus/journal" "github.com/filecoin-project/lotus/journal/fsjournal" "github.com/filecoin-project/lotus/lib/peermgr" - marketevents "github.com/filecoin-project/lotus/markets/loggers" "github.com/filecoin-project/lotus/node/hello" "github.com/filecoin-project/lotus/node/impl/full" "github.com/filecoin-project/lotus/node/modules/dtypes" @@ -224,24 +218,6 @@ func RelayIndexerMessages(lc fx.Lifecycle, ps *pubsub.PubSub, nn dtypes.NetworkN return nil } -func NewLocalDiscovery(lc fx.Lifecycle, ds dtypes.MetadataDS) (*discoveryimpl.Local, error) { - local, err := discoveryimpl.NewLocal(namespace.Wrap(ds, datastore.NewKey("/deals/local"))) - if err != nil { - return nil, err - } - local.OnReady(marketevents.ReadyLogger("discovery")) - lc.Append(fx.Hook{ - OnStart: func(ctx context.Context) error { - return local.Start(ctx) - }, - }) - return local, nil -} - -func RetrievalResolver(l *discoveryimpl.Local) discovery.PeerResolver { - return discoveryimpl.Multi(l) -} - type RandomBeaconParams struct { fx.In diff --git a/node/modules/storageminer.go b/node/modules/storageminer.go index 1b9988b9563..dd39ec2ae6e 100644 --- a/node/modules/storageminer.go +++ b/node/modules/storageminer.go @@ -1,53 +1,28 @@ package modules import ( - "bytes" "context" "errors" - "fmt" "net/http" - "os" - "path/filepath" "strings" "time" "github.com/google/uuid" - "github.com/ipfs/go-cid" "github.com/ipfs/go-datastore" "github.com/ipfs/go-datastore/namespace" - graphsync "github.com/ipfs/go-graphsync/impl" - gsnet "github.com/ipfs/go-graphsync/network" - "github.com/ipfs/go-graphsync/storeutil" - provider "github.com/ipni/index-provider" - "github.com/libp2p/go-libp2p/core/host" "go.uber.org/fx" "go.uber.org/multierr" "golang.org/x/xerrors" "github.com/filecoin-project/go-address" - dtimpl "github.com/filecoin-project/go-data-transfer/v2/impl" - dtnet "github.com/filecoin-project/go-data-transfer/v2/network" - dtgstransport "github.com/filecoin-project/go-data-transfer/v2/transport/graphsync" - piecefilestore "github.com/filecoin-project/go-fil-markets/filestore" - piecestoreimpl "github.com/filecoin-project/go-fil-markets/piecestore/impl" - "github.com/filecoin-project/go-fil-markets/retrievalmarket" - retrievalimpl "github.com/filecoin-project/go-fil-markets/retrievalmarket/impl" - rmnet "github.com/filecoin-project/go-fil-markets/retrievalmarket/network" - "github.com/filecoin-project/go-fil-markets/shared" - "github.com/filecoin-project/go-fil-markets/storagemarket" - storageimpl "github.com/filecoin-project/go-fil-markets/storagemarket/impl" - "github.com/filecoin-project/go-fil-markets/storagemarket/impl/storedask" - smnet "github.com/filecoin-project/go-fil-markets/storagemarket/network" "github.com/filecoin-project/go-jsonrpc/auth" "github.com/filecoin-project/go-paramfetch" "github.com/filecoin-project/go-state-types/abi" - "github.com/filecoin-project/go-state-types/big" "github.com/filecoin-project/go-statestore" "github.com/filecoin-project/lotus/api" "github.com/filecoin-project/lotus/api/v0api" "github.com/filecoin-project/lotus/api/v1api" - "github.com/filecoin-project/lotus/blockstore" "github.com/filecoin-project/lotus/build" "github.com/filecoin-project/lotus/chain/actors/builtin/miner" "github.com/filecoin-project/lotus/chain/events" @@ -55,11 +30,6 @@ import ( "github.com/filecoin-project/lotus/chain/gen/slashfilter" "github.com/filecoin-project/lotus/chain/types" "github.com/filecoin-project/lotus/journal" - "github.com/filecoin-project/lotus/markets" - "github.com/filecoin-project/lotus/markets/dagstore" - "github.com/filecoin-project/lotus/markets/idxprov" - marketevents "github.com/filecoin-project/lotus/markets/loggers" - "github.com/filecoin-project/lotus/markets/pricing" lotusminer "github.com/filecoin-project/lotus/miner" "github.com/filecoin-project/lotus/node/config" "github.com/filecoin-project/lotus/node/modules/dtypes" @@ -332,163 +302,6 @@ func WindowPostScheduler(fc config.MinerFeeConfig, pc config.ProvingConfig) func } } -func HandleRetrieval(host host.Host, lc fx.Lifecycle, m retrievalmarket.RetrievalProvider, j journal.Journal) { - m.OnReady(marketevents.ReadyLogger("retrieval provider")) - lc.Append(fx.Hook{ - - OnStart: func(ctx context.Context) error { - m.SubscribeToEvents(marketevents.RetrievalProviderLogger) - - evtType := j.RegisterEventType("markets/retrieval/provider", "state_change") - m.SubscribeToEvents(markets.RetrievalProviderJournaler(j, evtType)) - - return m.Start(ctx) - }, - OnStop: func(context.Context) error { - return m.Stop() - }, - }) -} - -func HandleDeals(mctx helpers.MetricsCtx, lc fx.Lifecycle, host host.Host, h storagemarket.StorageProvider, j journal.Journal) { - ctx := helpers.LifecycleCtx(mctx, lc) - h.OnReady(marketevents.ReadyLogger("storage provider")) - lc.Append(fx.Hook{ - OnStart: func(context.Context) error { - h.SubscribeToEvents(marketevents.StorageProviderLogger) - - evtType := j.RegisterEventType("markets/storage/provider", "state_change") - h.SubscribeToEvents(markets.StorageProviderJournaler(j, evtType)) - - return h.Start(ctx) - }, - OnStop: func(context.Context) error { - return h.Stop() - }, - }) -} - -func HandleMigrateProviderFunds(lc fx.Lifecycle, ds dtypes.MetadataDS, node api.FullNode, minerAddress dtypes.MinerAddress) { - lc.Append(fx.Hook{ - OnStart: func(ctx context.Context) error { - b, err := ds.Get(ctx, datastore.NewKey("/marketfunds/provider")) - if err != nil { - if xerrors.Is(err, datastore.ErrNotFound) { - return nil - } - return err - } - - var value abi.TokenAmount - if err = value.UnmarshalCBOR(bytes.NewReader(b)); err != nil { - return err - } - ts, err := node.ChainHead(ctx) - if err != nil { - log.Errorf("provider funds migration - getting chain head: %v", err) - return nil - } - - mi, err := node.StateMinerInfo(ctx, address.Address(minerAddress), ts.Key()) - if err != nil { - log.Errorf("provider funds migration - getting miner info %s: %v", minerAddress, err) - return nil - } - - _, err = node.MarketReserveFunds(ctx, mi.Worker, address.Address(minerAddress), value) - if err != nil { - log.Errorf("provider funds migration - reserving funds (wallet %s, addr %s, funds %d): %v", - mi.Worker, minerAddress, value, err) - return nil - } - - return ds.Delete(ctx, datastore.NewKey("/marketfunds/provider")) - }, - }) -} - -// NewProviderTransferNetwork sets up the libp2p2 protocol networking for data transfer -func NewProviderTransferNetwork(h host.Host) dtypes.ProviderTransferNetwork { - return dtnet.NewFromLibp2pHost(h) -} - -// NewProviderTransport sets up a data transfer transport over graphsync -func NewProviderTransport(h host.Host, gs dtypes.StagingGraphsync) dtypes.ProviderTransport { - return dtgstransport.NewTransport(h.ID(), gs) -} - -// NewProviderDataTransfer returns a data transfer manager -func NewProviderDataTransfer(lc fx.Lifecycle, net dtypes.ProviderTransferNetwork, transport dtypes.ProviderTransport, ds dtypes.MetadataDS, r repo.LockedRepo) (dtypes.ProviderDataTransfer, error) { - dtDs := namespace.Wrap(ds, datastore.NewKey("/datatransfer/provider/transfers")) - - dt, err := dtimpl.NewDataTransfer(dtDs, net, transport) - if err != nil { - return nil, err - } - - dt.OnReady(marketevents.ReadyLogger("provider data transfer")) - lc.Append(fx.Hook{ - OnStart: func(ctx context.Context) error { - dt.SubscribeToEvents(marketevents.DataTransferLogger) - return dt.Start(ctx) - }, - OnStop: func(ctx context.Context) error { - return dt.Stop(ctx) - }, - }) - return dt, nil -} - -// NewProviderPieceStore creates a statestore for storing metadata about pieces -// shared by the storage and retrieval providers -func NewProviderPieceStore(lc fx.Lifecycle, ds dtypes.MetadataDS) (dtypes.ProviderPieceStore, error) { - ps, err := piecestoreimpl.NewPieceStore(namespace.Wrap(ds, datastore.NewKey("/storagemarket"))) - if err != nil { - return nil, err - } - ps.OnReady(marketevents.ReadyLogger("piecestore")) - lc.Append(fx.Hook{ - OnStart: func(ctx context.Context) error { - return ps.Start(ctx) - }, - }) - return ps, nil -} - -// StagingBlockstore creates a blockstore for staging blocks for a miner -// in a storage deal, prior to sealing -func StagingBlockstore(lc fx.Lifecycle, mctx helpers.MetricsCtx, r repo.LockedRepo) (dtypes.StagingBlockstore, error) { - ctx := helpers.LifecycleCtx(mctx, lc) - stagingds, err := r.Datastore(ctx, "/staging") - if err != nil { - return nil, err - } - - return blockstore.FromDatastore(stagingds), nil -} - -// StagingGraphsync creates a graphsync instance which reads and writes blocks -// to the StagingBlockstore -func StagingGraphsync(parallelTransfersForStorage uint64, parallelTransfersForStoragePerPeer uint64, parallelTransfersForRetrieval uint64) func(mctx helpers.MetricsCtx, lc fx.Lifecycle, ibs dtypes.StagingBlockstore, h host.Host) dtypes.StagingGraphsync { - return func(mctx helpers.MetricsCtx, lc fx.Lifecycle, ibs dtypes.StagingBlockstore, h host.Host) dtypes.StagingGraphsync { - graphsyncNetwork := gsnet.NewFromLibp2pHost(h) - lsys := storeutil.LinkSystemForBlockstore(ibs) - gs := graphsync.New(helpers.LifecycleCtx(mctx, lc), - graphsyncNetwork, - lsys, - graphsync.RejectAllRequestsByDefault(), - graphsync.MaxInProgressIncomingRequests(parallelTransfersForRetrieval), - graphsync.MaxInProgressIncomingRequestsPerPeer(parallelTransfersForStoragePerPeer), - graphsync.MaxInProgressOutgoingRequests(parallelTransfersForStorage), - graphsync.MaxLinksPerIncomingRequests(config.MaxTraversalLinks), - graphsync.MaxLinksPerOutgoingRequests(config.MaxTraversalLinks)) - - graphsyncStats(mctx, lc, gs) - - return gs - } -} - func SetupBlockProducer(lc fx.Lifecycle, ds dtypes.MetadataDS, api v1api.FullNode, epp gen.WinningPoStProver, sf *slashfilter.SlashFilter, j journal.Journal) (*lotusminer.Miner, error) { minerAddr, err := minerAddrFromDS(ds) if err != nil { @@ -512,273 +325,6 @@ func SetupBlockProducer(lc fx.Lifecycle, ds dtypes.MetadataDS, api v1api.FullNod return m, nil } -func NewStorageAsk(ctx helpers.MetricsCtx, fapi v1api.FullNode, ds dtypes.MetadataDS, minerAddress dtypes.MinerAddress, spn storagemarket.StorageProviderNode) (*storedask.StoredAsk, error) { - - mi, err := fapi.StateMinerInfo(ctx, address.Address(minerAddress), types.EmptyTSK) - if err != nil { - return nil, err - } - - providerDs := namespace.Wrap(ds, datastore.NewKey("/deals/provider")) - // legacy this was mistake where this key was place -- so we move the legacy key if need be - err = shared.MoveKey(providerDs, "/latest-ask", "/storage-ask/latest") - if err != nil { - return nil, err - } - return storedask.NewStoredAsk(namespace.Wrap(providerDs, datastore.NewKey("/storage-ask")), datastore.NewKey("latest"), spn, address.Address(minerAddress), - storagemarket.MaxPieceSize(abi.PaddedPieceSize(mi.SectorSize))) -} - -func BasicDealFilter(cfg config.DealmakingConfig, user dtypes.StorageDealFilter) func(onlineOk dtypes.ConsiderOnlineStorageDealsConfigFunc, - offlineOk dtypes.ConsiderOfflineStorageDealsConfigFunc, - verifiedOk dtypes.ConsiderVerifiedStorageDealsConfigFunc, - unverifiedOk dtypes.ConsiderUnverifiedStorageDealsConfigFunc, - blocklistFunc dtypes.StorageDealPieceCidBlocklistConfigFunc, - expectedSealTimeFunc dtypes.GetExpectedSealDurationFunc, - startDelay dtypes.GetMaxDealStartDelayFunc, - spn storagemarket.StorageProviderNode, - r repo.LockedRepo, -) dtypes.StorageDealFilter { - return func(onlineOk dtypes.ConsiderOnlineStorageDealsConfigFunc, - offlineOk dtypes.ConsiderOfflineStorageDealsConfigFunc, - verifiedOk dtypes.ConsiderVerifiedStorageDealsConfigFunc, - unverifiedOk dtypes.ConsiderUnverifiedStorageDealsConfigFunc, - blocklistFunc dtypes.StorageDealPieceCidBlocklistConfigFunc, - expectedSealTimeFunc dtypes.GetExpectedSealDurationFunc, - startDelay dtypes.GetMaxDealStartDelayFunc, - spn storagemarket.StorageProviderNode, - r repo.LockedRepo, - ) dtypes.StorageDealFilter { - - return func(ctx context.Context, deal storagemarket.MinerDeal) (bool, string, error) { - b, err := onlineOk() - if err != nil { - return false, "miner error", err - } - - if deal.Ref != nil && deal.Ref.TransferType != storagemarket.TTManual && !b { - log.Warnf("online storage deal consideration disabled; rejecting storage deal proposal from client: %s", deal.Client.String()) - return false, "miner is not considering online storage deals", nil - } - - b, err = offlineOk() - if err != nil { - return false, "miner error", err - } - - if deal.Ref != nil && deal.Ref.TransferType == storagemarket.TTManual && !b { - log.Warnf("offline storage deal consideration disabled; rejecting storage deal proposal from client: %s", deal.Client.String()) - return false, "miner is not accepting offline storage deals", nil - } - - b, err = verifiedOk() - if err != nil { - return false, "miner error", err - } - - if deal.Proposal.VerifiedDeal && !b { - log.Warnf("verified storage deal consideration disabled; rejecting storage deal proposal from client: %s", deal.Client.String()) - return false, "miner is not accepting verified storage deals", nil - } - - b, err = unverifiedOk() - if err != nil { - return false, "miner error", err - } - - if !deal.Proposal.VerifiedDeal && !b { - log.Warnf("unverified storage deal consideration disabled; rejecting storage deal proposal from client: %s", deal.Client.String()) - return false, "miner is not accepting unverified storage deals", nil - } - - blocklist, err := blocklistFunc() - if err != nil { - return false, "miner error", err - } - - for idx := range blocklist { - if deal.Proposal.PieceCID.Equals(blocklist[idx]) { - log.Warnf("piece CID in proposal %s is blocklisted; rejecting storage deal proposal from client: %s", deal.Proposal.PieceCID, deal.Client.String()) - return false, fmt.Sprintf("miner has blocklisted piece CID %s", deal.Proposal.PieceCID), nil - } - } - - sealDuration, err := expectedSealTimeFunc() - if err != nil { - return false, "miner error", err - } - - sealEpochs := sealDuration / (time.Duration(build.BlockDelaySecs) * time.Second) - _, ht, err := spn.GetChainHead(ctx) - if err != nil { - return false, "failed to get chain head", err - } - earliest := abi.ChainEpoch(sealEpochs) + ht - if deal.Proposal.StartEpoch < earliest { - log.Warnw("proposed deal would start before sealing can be completed; rejecting storage deal proposal from client", "piece_cid", deal.Proposal.PieceCID, "client", deal.Client.String(), "seal_duration", sealDuration, "earliest", earliest, "curepoch", ht) - return false, fmt.Sprintf("cannot seal a sector before %s", deal.Proposal.StartEpoch), nil - } - - sd, err := startDelay() - if err != nil { - return false, "miner error", err - } - - dir := filepath.Join(r.Path(), StagingAreaDirName) - diskUsageBytes, err := r.DiskUsage(dir) - if err != nil { - return false, "miner error", err - } - - if cfg.MaxStagingDealsBytes != 0 && diskUsageBytes >= cfg.MaxStagingDealsBytes { - log.Errorw("proposed deal rejected because there are too many deals in the staging area at the moment", "MaxStagingDealsBytes", cfg.MaxStagingDealsBytes, "DiskUsageBytes", diskUsageBytes) - return false, "cannot accept deal as miner is overloaded at the moment - there are too many staging deals being processed", nil - } - - // Reject if it's more than 7 days in the future - // TODO: read from cfg - maxStartEpoch := earliest + abi.ChainEpoch(uint64(sd.Seconds())/build.BlockDelaySecs) - if deal.Proposal.StartEpoch > maxStartEpoch { - return false, fmt.Sprintf("deal start epoch is too far in the future: %s > %s", deal.Proposal.StartEpoch, maxStartEpoch), nil - } - - if user != nil { - return user(ctx, deal) - } - - return true, "", nil - } - } -} - -func StorageProvider(minerAddress dtypes.MinerAddress, - storedAsk *storedask.StoredAsk, - h host.Host, ds dtypes.MetadataDS, - r repo.LockedRepo, - pieceStore dtypes.ProviderPieceStore, - indexer provider.Interface, - dataTransfer dtypes.ProviderDataTransfer, - spn storagemarket.StorageProviderNode, - df dtypes.StorageDealFilter, - dsw *dagstore.Wrapper, - meshCreator idxprov.MeshCreator, -) (storagemarket.StorageProvider, error) { - net := smnet.NewFromLibp2pHost(h) - - dir := filepath.Join(r.Path(), StagingAreaDirName) - - // migrate temporary files that were created directly under the repo, by - // moving them to the new directory and symlinking them. - oldDir := r.Path() - if err := migrateDealStaging(oldDir, dir); err != nil { - return nil, xerrors.Errorf("failed to make deal staging directory %w", err) - } - - store, err := piecefilestore.NewLocalFileStore(piecefilestore.OsPath(dir)) - if err != nil { - return nil, err - } - - opt := storageimpl.CustomDealDecisionLogic(storageimpl.DealDeciderFunc(df)) - - return storageimpl.NewProvider( - net, - namespace.Wrap(ds, datastore.NewKey("/deals/provider")), - store, - dsw, - indexer, - pieceStore, - dataTransfer, - spn, - address.Address(minerAddress), - storedAsk, - meshCreator, - opt, - ) -} - -func RetrievalDealFilter(userFilter dtypes.RetrievalDealFilter) func(onlineOk dtypes.ConsiderOnlineRetrievalDealsConfigFunc, - offlineOk dtypes.ConsiderOfflineRetrievalDealsConfigFunc) dtypes.RetrievalDealFilter { - return func(onlineOk dtypes.ConsiderOnlineRetrievalDealsConfigFunc, - offlineOk dtypes.ConsiderOfflineRetrievalDealsConfigFunc) dtypes.RetrievalDealFilter { - return func(ctx context.Context, state retrievalmarket.ProviderDealState) (bool, string, error) { - b, err := onlineOk() - if err != nil { - return false, "miner error", err - } - - if !b { - log.Warn("online retrieval deal consideration disabled; rejecting retrieval deal proposal from client") - return false, "miner is not accepting online retrieval deals", nil - } - - b, err = offlineOk() - if err != nil { - return false, "miner error", err - } - - if !b { - log.Info("offline retrieval has not been implemented yet") - } - - if userFilter != nil { - return userFilter(ctx, state) - } - - return true, "", nil - } - } -} - -func RetrievalNetwork(h host.Host) rmnet.RetrievalMarketNetwork { - return rmnet.NewFromLibp2pHost(h) -} - -// RetrievalPricingFunc configures the pricing function to use for retrieval deals. -func RetrievalPricingFunc(cfg config.DealmakingConfig) func(_ dtypes.ConsiderOnlineRetrievalDealsConfigFunc, - _ dtypes.ConsiderOfflineRetrievalDealsConfigFunc) dtypes.RetrievalPricingFunc { - - return func(_ dtypes.ConsiderOnlineRetrievalDealsConfigFunc, - _ dtypes.ConsiderOfflineRetrievalDealsConfigFunc) dtypes.RetrievalPricingFunc { - if cfg.RetrievalPricing.Strategy == config.RetrievalPricingExternalMode { - return pricing.ExternalRetrievalPricingFunc(cfg.RetrievalPricing.External.Path) - } - - return retrievalimpl.DefaultPricingFunc(cfg.RetrievalPricing.Default.VerifiedDealsFreeTransfer) - } -} - -// RetrievalProvider creates a new retrieval provider attached to the provider blockstore -func RetrievalProvider( - maddr dtypes.MinerAddress, - adapter retrievalmarket.RetrievalProviderNode, - sa retrievalmarket.SectorAccessor, - netwk rmnet.RetrievalMarketNetwork, - ds dtypes.MetadataDS, - pieceStore dtypes.ProviderPieceStore, - dt dtypes.ProviderDataTransfer, - pricingFnc dtypes.RetrievalPricingFunc, - userFilter dtypes.RetrievalDealFilter, - dagStore *dagstore.Wrapper, -) (retrievalmarket.RetrievalProvider, error) { - opt := retrievalimpl.DealDeciderOpt(retrievalimpl.DealDecider(userFilter)) - - retrievalmarket.DefaultPricePerByte = big.Zero() // todo: for whatever reason this is a global var in markets - - return retrievalimpl.NewProvider( - address.Address(maddr), - adapter, - sa, - netwk, - pieceStore, - dagStore, - dt, - namespace.Wrap(ds, datastore.NewKey("/retrievals/provider")), - retrievalimpl.RetrievalPricingFunc(pricingFnc), - opt, - ) -} - var WorkerCallsPrefix = datastore.NewKey("/worker/calls") var ManagerWorkPrefix = datastore.NewKey("/stmgr/calls") @@ -838,153 +384,6 @@ func StorageAuthWithURL(apiInfo string) interface{} { } } -func NewConsiderOnlineStorageDealsConfigFunc(r repo.LockedRepo) (dtypes.ConsiderOnlineStorageDealsConfigFunc, error) { - return func() (out bool, err error) { - err = readDealmakingCfg(r, func(c config.DealmakingConfiger) { - cfg := c.GetDealmakingConfig() - out = cfg.ConsiderOnlineStorageDeals - }) - return - }, nil -} - -func NewSetConsideringOnlineStorageDealsFunc(r repo.LockedRepo) (dtypes.SetConsiderOnlineStorageDealsConfigFunc, error) { - return func(b bool) (err error) { - err = mutateDealmakingCfg(r, func(c config.DealmakingConfiger) { - cfg := c.GetDealmakingConfig() - cfg.ConsiderOnlineStorageDeals = b - c.SetDealmakingConfig(cfg) - }) - return - }, nil -} - -func NewConsiderOnlineRetrievalDealsConfigFunc(r repo.LockedRepo) (dtypes.ConsiderOnlineRetrievalDealsConfigFunc, error) { - return func() (out bool, err error) { - err = readDealmakingCfg(r, func(c config.DealmakingConfiger) { - cfg := c.GetDealmakingConfig() - out = cfg.ConsiderOnlineRetrievalDeals - }) - return - }, nil -} - -func NewSetConsiderOnlineRetrievalDealsConfigFunc(r repo.LockedRepo) (dtypes.SetConsiderOnlineRetrievalDealsConfigFunc, error) { - return func(b bool) (err error) { - err = mutateDealmakingCfg(r, func(c config.DealmakingConfiger) { - cfg := c.GetDealmakingConfig() - cfg.ConsiderOnlineRetrievalDeals = b - c.SetDealmakingConfig(cfg) - }) - return - }, nil -} - -func NewStorageDealPieceCidBlocklistConfigFunc(r repo.LockedRepo) (dtypes.StorageDealPieceCidBlocklistConfigFunc, error) { - return func() (out []cid.Cid, err error) { - err = readDealmakingCfg(r, func(c config.DealmakingConfiger) { - cfg := c.GetDealmakingConfig() - out = cfg.PieceCidBlocklist - }) - return - }, nil -} - -func NewSetStorageDealPieceCidBlocklistConfigFunc(r repo.LockedRepo) (dtypes.SetStorageDealPieceCidBlocklistConfigFunc, error) { - return func(blocklist []cid.Cid) (err error) { - err = mutateDealmakingCfg(r, func(c config.DealmakingConfiger) { - cfg := c.GetDealmakingConfig() - cfg.PieceCidBlocklist = blocklist - c.SetDealmakingConfig(cfg) - }) - return - }, nil -} - -func NewConsiderOfflineStorageDealsConfigFunc(r repo.LockedRepo) (dtypes.ConsiderOfflineStorageDealsConfigFunc, error) { - return func() (out bool, err error) { - err = readDealmakingCfg(r, func(c config.DealmakingConfiger) { - cfg := c.GetDealmakingConfig() - out = cfg.ConsiderOfflineStorageDeals - }) - return - }, nil -} - -func NewSetConsideringOfflineStorageDealsFunc(r repo.LockedRepo) (dtypes.SetConsiderOfflineStorageDealsConfigFunc, error) { - return func(b bool) (err error) { - err = mutateDealmakingCfg(r, func(c config.DealmakingConfiger) { - cfg := c.GetDealmakingConfig() - cfg.ConsiderOfflineStorageDeals = b - c.SetDealmakingConfig(cfg) - }) - return - }, nil -} - -func NewConsiderOfflineRetrievalDealsConfigFunc(r repo.LockedRepo) (dtypes.ConsiderOfflineRetrievalDealsConfigFunc, error) { - return func() (out bool, err error) { - err = readDealmakingCfg(r, func(c config.DealmakingConfiger) { - cfg := c.GetDealmakingConfig() - out = cfg.ConsiderOfflineRetrievalDeals - }) - return - }, nil -} - -func NewSetConsiderOfflineRetrievalDealsConfigFunc(r repo.LockedRepo) (dtypes.SetConsiderOfflineRetrievalDealsConfigFunc, error) { - return func(b bool) (err error) { - err = mutateDealmakingCfg(r, func(c config.DealmakingConfiger) { - cfg := c.GetDealmakingConfig() - cfg.ConsiderOfflineRetrievalDeals = b - c.SetDealmakingConfig(cfg) - }) - return - }, nil -} - -func NewConsiderVerifiedStorageDealsConfigFunc(r repo.LockedRepo) (dtypes.ConsiderVerifiedStorageDealsConfigFunc, error) { - return func() (out bool, err error) { - err = readDealmakingCfg(r, func(c config.DealmakingConfiger) { - cfg := c.GetDealmakingConfig() - out = cfg.ConsiderVerifiedStorageDeals - }) - return - }, nil -} - -func NewSetConsideringVerifiedStorageDealsFunc(r repo.LockedRepo) (dtypes.SetConsiderVerifiedStorageDealsConfigFunc, error) { - return func(b bool) (err error) { - err = mutateDealmakingCfg(r, func(c config.DealmakingConfiger) { - cfg := c.GetDealmakingConfig() - cfg.ConsiderVerifiedStorageDeals = b - c.SetDealmakingConfig(cfg) - }) - return - }, nil -} - -func NewConsiderUnverifiedStorageDealsConfigFunc(r repo.LockedRepo) (dtypes.ConsiderUnverifiedStorageDealsConfigFunc, error) { - return func() (out bool, err error) { - err = readDealmakingCfg(r, func(c config.DealmakingConfiger) { - cfg := c.GetDealmakingConfig() - out = cfg.ConsiderUnverifiedStorageDeals - }) - return - }, nil -} - -func NewSetConsideringUnverifiedStorageDealsFunc(r repo.LockedRepo) (dtypes.SetConsiderUnverifiedStorageDealsConfigFunc, error) { - return func(b bool) (err error) { - err = mutateDealmakingCfg(r, func(c config.DealmakingConfiger) { - cfg := c.GetDealmakingConfig() - cfg.ConsiderUnverifiedStorageDeals = b - c.SetDealmakingConfig(cfg) - }) - return - }, nil -} - func NewSetSealConfigFunc(r repo.LockedRepo) (dtypes.SetSealingConfigFunc, error) { return func(cfg sealiface.Config) (err error) { err = mutateSealingCfg(r, func(c config.SealingConfiger) { @@ -1092,48 +491,6 @@ func NewGetSealConfigFunc(r repo.LockedRepo) (dtypes.GetSealingConfigFunc, error }, nil } -func NewSetExpectedSealDurationFunc(r repo.LockedRepo) (dtypes.SetExpectedSealDurationFunc, error) { - return func(delay time.Duration) (err error) { - err = mutateDealmakingCfg(r, func(c config.DealmakingConfiger) { - cfg := c.GetDealmakingConfig() - cfg.ExpectedSealDuration = config.Duration(delay) - c.SetDealmakingConfig(cfg) - }) - return - }, nil -} - -func NewGetExpectedSealDurationFunc(r repo.LockedRepo) (dtypes.GetExpectedSealDurationFunc, error) { - return func() (out time.Duration, err error) { - err = readDealmakingCfg(r, func(c config.DealmakingConfiger) { - cfg := c.GetDealmakingConfig() - out = time.Duration(cfg.ExpectedSealDuration) - }) - return - }, nil -} - -func NewSetMaxDealStartDelayFunc(r repo.LockedRepo) (dtypes.SetMaxDealStartDelayFunc, error) { - return func(delay time.Duration) (err error) { - err = mutateDealmakingCfg(r, func(c config.DealmakingConfiger) { - cfg := c.GetDealmakingConfig() - cfg.MaxDealStartDelay = config.Duration(delay) - c.SetDealmakingConfig(cfg) - }) - return - }, nil -} - -func NewGetMaxDealStartDelayFunc(r repo.LockedRepo) (dtypes.GetMaxDealStartDelayFunc, error) { - return func() (out time.Duration, err error) { - err = readDealmakingCfg(r, func(c config.DealmakingConfiger) { - cfg := c.GetDealmakingConfig() - out = time.Duration(cfg.MaxDealStartDelay) - }) - return - }, nil -} - func readSealingCfg(r repo.LockedRepo, accessor func(config.DealmakingConfiger, config.SealingConfiger)) error { raw, err := r.Config() if err != nil { @@ -1171,91 +528,6 @@ func mutateSealingCfg(r repo.LockedRepo, mutator func(config.SealingConfiger)) e return multierr.Combine(typeErr, setConfigErr) } -func readDealmakingCfg(r repo.LockedRepo, accessor func(config.DealmakingConfiger)) error { - raw, err := r.Config() - if err != nil { - return err - } - - cfg, ok := raw.(config.DealmakingConfiger) - if !ok { - return xerrors.New("expected config with dealmaking config trait") - } - - accessor(cfg) - - return nil -} - -func mutateDealmakingCfg(r repo.LockedRepo, mutator func(config.DealmakingConfiger)) error { - var typeErr error - - setConfigErr := r.SetConfig(func(raw interface{}) { - cfg, ok := raw.(config.DealmakingConfiger) - if !ok { - typeErr = errors.New("expected config with dealmaking config trait") - return - } - - mutator(cfg) - }) - - return multierr.Combine(typeErr, setConfigErr) -} - -func migrateDealStaging(oldPath, newPath string) error { - dirInfo, err := os.Stat(newPath) - if err == nil { - if !dirInfo.IsDir() { - return xerrors.Errorf("%s is not a directory", newPath) - } - // The newPath exists already, below migration has already occurred. - return nil - } - - // if the directory doesn't exist, create it - if os.IsNotExist(err) { - if err := os.MkdirAll(newPath, 0755); err != nil { - return xerrors.Errorf("failed to mk directory %s for deal staging: %w", newPath, err) - } - } else { // if we failed for other reasons, abort. - return err - } - - // if this is the first time we created the directory, symlink all staged deals into it. "Migration" - // get a list of files in the miner repo - dirEntries, err := os.ReadDir(oldPath) - if err != nil { - return xerrors.Errorf("failed to list directory %s for deal staging: %w", oldPath, err) - } - - for _, entry := range dirEntries { - // ignore directories, they are not the deals. - if entry.IsDir() { - continue - } - // the FileStore from fil-storage-market creates temporary staged deal files with the pattern "fstmp" - // https://github.com/filecoin-project/go-fil-markets/blob/00ff81e477d846ac0cb58a0c7d1c2e9afb5ee1db/filestore/filestore.go#L69 - name := entry.Name() - if strings.Contains(name, "fstmp") { - // from the miner repo - oldPath := filepath.Join(oldPath, name) - // to its subdir "deal-staging" - newPath := filepath.Join(newPath, name) - // create a symbolic link in the new deal staging directory to preserve existing staged deals. - // all future staged deals will be created here. - if err := os.Rename(oldPath, newPath); err != nil { - return xerrors.Errorf("failed to move %s to %s: %w", oldPath, newPath, err) - } - if err := os.Symlink(newPath, oldPath); err != nil { - return xerrors.Errorf("failed to symlink %s to %s: %w", oldPath, newPath, err) - } - log.Infow("symlinked staged deal", "from", oldPath, "to", newPath) - } - } - return nil -} - func ExtractEnabledMinerSubsystems(cfg config.MinerSubsystemConfig) (res api.MinerSubsystems) { if cfg.EnableMining { res = append(res, api.SubsystemMining) @@ -1266,8 +538,6 @@ func ExtractEnabledMinerSubsystems(cfg config.MinerSubsystemConfig) (res api.Min if cfg.EnableSectorStorage { res = append(res, api.SubsystemSectorStorage) } - if cfg.EnableMarkets { - res = append(res, api.SubsystemMarkets) - } + return res } diff --git a/node/modules/storageminer_dagstore.go b/node/modules/storageminer_dagstore.go deleted file mode 100644 index 620e690901c..00000000000 --- a/node/modules/storageminer_dagstore.go +++ /dev/null @@ -1,94 +0,0 @@ -package modules - -import ( - "context" - "fmt" - "os" - "path/filepath" - "strconv" - - "github.com/libp2p/go-libp2p/core/host" - "go.uber.org/fx" - "golang.org/x/xerrors" - - "github.com/filecoin-project/dagstore" - - mdagstore "github.com/filecoin-project/lotus/markets/dagstore" - "github.com/filecoin-project/lotus/node/config" - "github.com/filecoin-project/lotus/node/modules/dtypes" - "github.com/filecoin-project/lotus/node/repo" -) - -const ( - EnvDAGStoreCopyConcurrency = "LOTUS_DAGSTORE_COPY_CONCURRENCY" - DefaultDAGStoreDir = "dagstore" -) - -// NewMinerAPI creates a new MinerAPI adaptor for the dagstore mounts. -func NewMinerAPI(cfg config.DAGStoreConfig) func(fx.Lifecycle, repo.LockedRepo, dtypes.ProviderPieceStore, mdagstore.SectorAccessor) (mdagstore.MinerAPI, error) { - return func(lc fx.Lifecycle, r repo.LockedRepo, pieceStore dtypes.ProviderPieceStore, sa mdagstore.SectorAccessor) (mdagstore.MinerAPI, error) { - // caps the amount of concurrent calls to the storage, so that we don't - // spam it during heavy processes like bulk migration. - if v, ok := os.LookupEnv("LOTUS_DAGSTORE_MOUNT_CONCURRENCY"); ok { - concurrency, err := strconv.Atoi(v) - if err == nil { - cfg.MaxConcurrencyStorageCalls = concurrency - } - } - - mountApi := mdagstore.NewMinerAPI(pieceStore, sa, cfg.MaxConcurrencyStorageCalls, cfg.MaxConcurrentUnseals) - ready := make(chan error, 1) - pieceStore.OnReady(func(err error) { - ready <- err - }) - lc.Append(fx.Hook{ - OnStart: func(ctx context.Context) error { - if err := <-ready; err != nil { - return fmt.Errorf("aborting dagstore start; piecestore failed to start: %s", err) - } - return mountApi.Start(ctx) - }, - OnStop: func(context.Context) error { - return nil - }, - }) - - return mountApi, nil - } -} - -// DAGStore constructs a DAG store using the supplied minerAPI, and the -// user configuration. It returns both the DAGStore and the Wrapper suitable for -// passing to markets. -func DAGStore(cfg config.DAGStoreConfig) func(lc fx.Lifecycle, r repo.LockedRepo, minerAPI mdagstore.MinerAPI, h host.Host) (*dagstore.DAGStore, *mdagstore.Wrapper, error) { - return func(lc fx.Lifecycle, r repo.LockedRepo, minerAPI mdagstore.MinerAPI, h host.Host) (*dagstore.DAGStore, *mdagstore.Wrapper, error) { - // fall back to default root directory if not explicitly set in the config. - if cfg.RootDir == "" { - cfg.RootDir = filepath.Join(r.Path(), DefaultDAGStoreDir) - } - - v, ok := os.LookupEnv(EnvDAGStoreCopyConcurrency) - if ok { - concurrency, err := strconv.Atoi(v) - if err == nil { - cfg.MaxConcurrentReadyFetches = concurrency - } - } - - dagst, w, err := mdagstore.NewDAGStore(cfg, minerAPI, h) - if err != nil { - return nil, nil, xerrors.Errorf("failed to create DAG store: %w", err) - } - - lc.Append(fx.Hook{ - OnStart: func(ctx context.Context) error { - return w.Start(ctx) - }, - OnStop: func(context.Context) error { - return w.Close() - }, - }) - - return dagst, w, nil - } -} diff --git a/node/modules/storageminer_idxprov.go b/node/modules/storageminer_idxprov.go deleted file mode 100644 index 777c59386b5..00000000000 --- a/node/modules/storageminer_idxprov.go +++ /dev/null @@ -1,117 +0,0 @@ -package modules - -import ( - "context" - - "github.com/ipfs/go-datastore" - "github.com/ipfs/go-datastore/namespace" - provider "github.com/ipni/index-provider" - "github.com/ipni/index-provider/engine" - pubsub "github.com/libp2p/go-libp2p-pubsub" - "github.com/libp2p/go-libp2p/core/host" - "go.uber.org/fx" - "golang.org/x/xerrors" - - "github.com/filecoin-project/go-address" - - "github.com/filecoin-project/lotus/build" - "github.com/filecoin-project/lotus/node/config" - "github.com/filecoin-project/lotus/node/modules/dtypes" -) - -type IdxProv struct { - fx.In - - fx.Lifecycle - Datastore dtypes.MetadataDS -} - -func IndexProvider(cfg config.IndexProviderConfig) func(params IdxProv, marketHost host.Host, dt dtypes.ProviderDataTransfer, maddr dtypes.MinerAddress, ps *pubsub.PubSub, nn dtypes.NetworkName) (provider.Interface, error) { - return func(args IdxProv, marketHost host.Host, dt dtypes.ProviderDataTransfer, maddr dtypes.MinerAddress, ps *pubsub.PubSub, nn dtypes.NetworkName) (provider.Interface, error) { - topicName := cfg.TopicName - // If indexer topic name is left empty, infer it from the network name. - if topicName == "" { - // Use the same mechanism as the Dependency Injection (DI) to construct the topic name, - // so that we are certain it is consistent with the name allowed by the subscription - // filter. - // - // See: lp2p.GossipSub. - topicName = build.IndexerIngestTopic(nn) - log.Debugw("Inferred indexer topic from network name", "topic", topicName) - } - - ipds := namespace.Wrap(args.Datastore, datastore.NewKey("/index-provider")) - addrs := marketHost.Addrs() - addrsString := make([]string, 0, len(addrs)) - for _, addr := range addrs { - addrsString = append(addrsString, addr.String()) - } - var opts = []engine.Option{ - engine.WithDatastore(ipds), - engine.WithHost(marketHost), - engine.WithRetrievalAddrs(addrsString...), - engine.WithEntriesCacheCapacity(cfg.EntriesCacheCapacity), - engine.WithChainedEntries(cfg.EntriesChunkSize), - engine.WithTopicName(topicName), - engine.WithPurgeCacheOnStart(cfg.PurgeCacheOnStart), - } - - llog := log.With( - "idxProvEnabled", cfg.Enable, - "pid", marketHost.ID(), - "topic", topicName, - "retAddrs", marketHost.Addrs()) - // If announcements to the network are enabled, then set options for datatransfer publisher. - if cfg.Enable { - // Join the indexer topic using the market's pubsub instance. Otherwise, the provider - // engine would create its own instance of pubsub down the line in dagsync, which has - // no validators by default. - t, err := ps.Join(topicName) - if err != nil { - llog.Errorw("Failed to join indexer topic", "err", err) - return nil, xerrors.Errorf("joining indexer topic %s: %w", topicName, err) - } - - // Get the miner ID and set as extra gossip data. - // The extra data is required by the lotus-specific index-provider gossip message validators. - ma := address.Address(maddr) - opts = append(opts, - engine.WithPublisherKind(engine.DataTransferPublisher), - engine.WithDataTransfer(dt), - engine.WithExtraGossipData(ma.Bytes()), - engine.WithTopic(t), - ) - llog = llog.With("extraGossipData", ma, "publisher", "data-transfer") - } else { - opts = append(opts, engine.WithPublisherKind(engine.NoPublisher)) - llog = llog.With("publisher", "none") - } - - // Instantiate the index provider engine. - e, err := engine.New(opts...) - if err != nil { - return nil, xerrors.Errorf("creating indexer provider engine: %w", err) - } - llog.Info("Instantiated index provider engine") - - args.Lifecycle.Append(fx.Hook{ - OnStart: func(ctx context.Context) error { - // Note that the OnStart context is cancelled after startup. Its use in e.Start is - // to start up gossipsub publishers and restore cache, all of which are completed - // before e.Start returns. Therefore, it is fine to reuse the give context. - if err := e.Start(ctx); err != nil { - return xerrors.Errorf("starting indexer provider engine: %w", err) - } - log.Infof("Started index provider engine") - return nil - }, - OnStop: func(_ context.Context) error { - if err := e.Shutdown(); err != nil { - return xerrors.Errorf("shutting down indexer provider engine: %w", err) - } - return nil - }, - }) - return e, nil - } -} diff --git a/node/modules/storageminer_idxprov_test.go b/node/modules/storageminer_idxprov_test.go deleted file mode 100644 index 434577bab64..00000000000 --- a/node/modules/storageminer_idxprov_test.go +++ /dev/null @@ -1,99 +0,0 @@ -package modules_test - -import ( - "context" - "strings" - "testing" - "time" - - "github.com/ipfs/go-datastore" - provider "github.com/ipni/index-provider" - "github.com/libp2p/go-libp2p" - pubsub "github.com/libp2p/go-libp2p-pubsub" - "github.com/libp2p/go-libp2p/core/host" - "github.com/stretchr/testify/require" - "go.uber.org/fx" - - "github.com/filecoin-project/go-address" - - "github.com/filecoin-project/lotus/node/config" - "github.com/filecoin-project/lotus/node/modules" - "github.com/filecoin-project/lotus/node/modules/dtypes" -) - -func Test_IndexProviderTopic(t *testing.T) { - tests := []struct { - name string - givenAllowedTopics []string - givenConfiguredTopic string - givenNetworkName dtypes.NetworkName - wantErr string - }{ - { - name: "Joins configured topic when allowed", - givenAllowedTopics: []string{"fish"}, - givenConfiguredTopic: "fish", - }, - { - name: "Joins topic inferred from network name when allowed", - givenAllowedTopics: []string{"/indexer/ingest/fish"}, - givenNetworkName: "fish", - }, - { - name: "Fails to join configured topic when disallowed", - givenAllowedTopics: []string{"/indexer/ingest/fish"}, - givenConfiguredTopic: "lobster", - wantErr: "joining indexer topic lobster: topic is not allowed by the subscription filter", - }, - { - name: "Fails to join topic inferred from network name when disallowed", - givenAllowedTopics: []string{"/indexer/ingest/fish"}, - givenNetworkName: "lobster", - wantErr: "joining indexer topic /indexer/ingest/lobster: topic is not allowed by the subscription filter", - }, - } - - for _, test := range tests { - test := test - t.Run(test.name, func(t *testing.T) { - ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second) - defer cancel() - - h, err := libp2p.New() - require.NoError(t, err) - defer func() { - require.NoError(t, h.Close()) - }() - - filter := pubsub.WithSubscriptionFilter(pubsub.NewAllowlistSubscriptionFilter(test.givenAllowedTopics...)) - ps, err := pubsub.NewGossipSub(ctx, h, filter) - require.NoError(t, err) - - app := fx.New( - fx.Provide( - func() host.Host { return h }, - func() dtypes.NetworkName { return test.givenNetworkName }, - func() dtypes.MinerAddress { return dtypes.MinerAddress(address.TestAddress) }, - func() dtypes.ProviderDataTransfer { return nil }, - func() *pubsub.PubSub { return ps }, - func() dtypes.MetadataDS { return datastore.NewMapDatastore() }, - modules.IndexProvider(config.IndexProviderConfig{ - Enable: true, - TopicName: test.givenConfiguredTopic, - EntriesChunkSize: 16384, - }), - ), - fx.Invoke(func(p provider.Interface) {}), - ) - err = app.Start(ctx) - - if test.wantErr == "" { - require.NoError(t, err) - err = app.Stop(ctx) - require.NoError(t, err) - } else { - require.True(t, strings.HasSuffix(err.Error(), test.wantErr)) - } - }) - } -} diff --git a/node/repo/imports/manager.go b/node/repo/imports/manager.go deleted file mode 100644 index a3648b6b02a..00000000000 --- a/node/repo/imports/manager.go +++ /dev/null @@ -1,275 +0,0 @@ -package imports - -import ( - "context" - "encoding/json" - "fmt" - "os" - "path/filepath" - "strconv" - - "github.com/ipfs/go-cid" - "github.com/ipfs/go-datastore" - "github.com/ipfs/go-datastore/namespace" - "github.com/ipfs/go-datastore/query" - logging "github.com/ipfs/go-log/v2" - "golang.org/x/xerrors" - - "github.com/filecoin-project/go-fil-markets/shared" -) - -var log = logging.Logger("importmgr") - -type ID uint64 - -func (id ID) dsKey() datastore.Key { - return datastore.NewKey(fmt.Sprintf("%d", id)) -} - -type Manager struct { - ds datastore.Batching - rootDir string - counter *shared.TimeCounter -} - -type LabelKey = string -type LabelValue = string - -const ( - CAROwnerImportMgr = "importmgr" - CAROwnerUser = "user" -) - -const ( - LSource = LabelKey("source") // Function which created the import - LRootCid = LabelKey("root") // Root CID - LFileName = LabelKey("filename") // Local file path of the source file. - LCARPath = LabelKey("car_path") // Path of the CARv2 file containing the imported data. - LCAROwner = LabelKey("car_owner") // Owner of the CAR; "importmgr" is us; "user" or empty is them. -) - -func NewManager(ds datastore.Batching, rootDir string) *Manager { - ds = namespace.Wrap(ds, datastore.NewKey("/stores")) - ds = datastore.NewLogDatastore(ds, "storess") - - m := &Manager{ - ds: ds, - rootDir: rootDir, - counter: shared.NewTimeCounter(), - } - - log.Info("sanity checking imports") - - ids, err := m.List() - if err != nil { - log.Warnw("failed to enumerate imports on initialization", "error", err) - return m - } - - var broken int - for _, id := range ids { - log := log.With("id", id) - - info, err := m.Info(id) - if err != nil { - log.Warnw("failed to query metadata for import; skipping", "error", err) - continue - } - - log = log.With("source", info.Labels[LSource], "root", info.Labels[LRootCid], "original", info.Labels[LFileName]) - - path, ok := info.Labels[LCARPath] - if !ok { - broken++ - log.Warnw("import lacks carv2 path; import will not work; please reimport") - continue - } - - stat, err := os.Stat(path) - if err != nil { - broken++ - log.Warnw("import has missing/broken carv2; please reimport", "error", err) - continue - } - - log.Infow("import ok", "size", stat.Size()) - } - - log.Infow("sanity check completed", "broken", broken, "total", len(ids)) - - return m -} - -type Meta struct { - Labels map[LabelKey]LabelValue -} - -// CreateImport initializes a new import, returning its ID and optionally a -// CAR path where to place the data, if requested. -func (m *Manager) CreateImport() (id ID, err error) { - ctx := context.TODO() - id = ID(m.counter.Next()) - - meta := &Meta{Labels: map[LabelKey]LabelValue{ - LSource: "unknown", - }} - - metajson, err := json.Marshal(meta) - if err != nil { - return 0, xerrors.Errorf("marshaling store metadata: %w", err) - } - - err = m.ds.Put(ctx, id.dsKey(), metajson) - if err != nil { - return 0, xerrors.Errorf("failed to insert import metadata: %w", err) - } - - return id, err -} - -// AllocateCAR creates a new CAR allocated to the supplied import under the -// root directory. -func (m *Manager) AllocateCAR(id ID) (path string, err error) { - ctx := context.TODO() - meta, err := m.ds.Get(ctx, id.dsKey()) - if err != nil { - return "", xerrors.Errorf("getting metadata form datastore: %w", err) - } - - var sm Meta - if err := json.Unmarshal(meta, &sm); err != nil { - return "", xerrors.Errorf("unmarshaling store meta: %w", err) - } - - // refuse if a CAR path already exists. - if curr := sm.Labels[LCARPath]; curr != "" { - return "", xerrors.Errorf("import CAR already exists at %s: %w", curr, err) - } - - path = filepath.Join(m.rootDir, fmt.Sprintf("%d.car", id)) - file, err := os.Create(path) - if err != nil { - return "", xerrors.Errorf("failed to create car file for import: %w", err) - } - - // close the file before returning the path. - if err := file.Close(); err != nil { - return "", xerrors.Errorf("failed to close temp file: %w", err) - } - - // record the path and ownership. - sm.Labels[LCARPath] = path - sm.Labels[LCAROwner] = CAROwnerImportMgr - - if meta, err = json.Marshal(sm); err != nil { - return "", xerrors.Errorf("marshaling store metadata: %w", err) - } - - err = m.ds.Put(ctx, id.dsKey(), meta) - return path, err -} - -// AddLabel adds a label associated with an import, such as the source, -// car path, CID, etc. -func (m *Manager) AddLabel(id ID, key LabelKey, value LabelValue) error { - ctx := context.TODO() - meta, err := m.ds.Get(ctx, id.dsKey()) - if err != nil { - return xerrors.Errorf("getting metadata form datastore: %w", err) - } - - var sm Meta - if err := json.Unmarshal(meta, &sm); err != nil { - return xerrors.Errorf("unmarshaling store meta: %w", err) - } - - sm.Labels[key] = value - - meta, err = json.Marshal(&sm) - if err != nil { - return xerrors.Errorf("marshaling store meta: %w", err) - } - - return m.ds.Put(ctx, id.dsKey(), meta) -} - -// List returns all import IDs known by this Manager. -func (m *Manager) List() ([]ID, error) { - ctx := context.TODO() - var keys []ID - - qres, err := m.ds.Query(ctx, query.Query{KeysOnly: true}) - if err != nil { - return nil, xerrors.Errorf("query error: %w", err) - } - defer qres.Close() //nolint:errcheck - - for r := range qres.Next() { - k := r.Key - if string(k[0]) == "/" { - k = k[1:] - } - - id, err := strconv.ParseUint(k, 10, 64) - if err != nil { - return nil, xerrors.Errorf("failed to parse key %s to uint64, err=%w", r.Key, err) - } - keys = append(keys, ID(id)) - } - - return keys, nil -} - -// Info returns the metadata known to this store for the specified import ID. -func (m *Manager) Info(id ID) (*Meta, error) { - ctx := context.TODO() - - meta, err := m.ds.Get(ctx, id.dsKey()) - if err != nil { - return nil, xerrors.Errorf("getting metadata form datastore: %w", err) - } - - var sm Meta - if err := json.Unmarshal(meta, &sm); err != nil { - return nil, xerrors.Errorf("unmarshaling store meta: %w", err) - } - - return &sm, nil -} - -// Remove drops all data associated with the supplied import ID. -func (m *Manager) Remove(id ID) error { - ctx := context.TODO() - if err := m.ds.Delete(ctx, id.dsKey()); err != nil { - return xerrors.Errorf("removing import metadata: %w", err) - } - return nil -} - -func (m *Manager) CARPathFor(dagRoot cid.Cid) (string, error) { - ids, err := m.List() - if err != nil { - return "", xerrors.Errorf("failed to fetch import IDs: %w", err) - } - - for _, id := range ids { - info, err := m.Info(id) - if err != nil { - log.Errorf("failed to fetch info, importID=%d: %s", id, err) - continue - } - if info.Labels[LRootCid] == "" { - continue - } - c, err := cid.Parse(info.Labels[LRootCid]) - if err != nil { - log.Errorf("failed to parse root cid %s: %s", info.Labels[LRootCid], err) - continue - } - if c.Equals(dagRoot) { - return info.Labels[LCARPath], nil - } - } - - return "", nil -} diff --git a/node/rpc.go b/node/rpc.go index 7a47d1b68ee..ede1b924cd4 100644 --- a/node/rpc.go +++ b/node/rpc.go @@ -2,8 +2,6 @@ package node import ( "context" - "encoding/json" - "fmt" "net" "net/http" _ "net/http/pprof" @@ -11,10 +9,7 @@ import ( "strconv" "time" - "github.com/google/uuid" "github.com/gorilla/mux" - "github.com/gorilla/websocket" - "github.com/ipfs/go-cid" logging "github.com/ipfs/go-log/v2" "github.com/multiformats/go-multiaddr" manet "github.com/multiformats/go-multiaddr/net" @@ -27,12 +22,10 @@ import ( "github.com/filecoin-project/lotus/api" "github.com/filecoin-project/lotus/api/v0api" "github.com/filecoin-project/lotus/api/v1api" - bstore "github.com/filecoin-project/lotus/blockstore" "github.com/filecoin-project/lotus/lib/rpcenc" "github.com/filecoin-project/lotus/metrics" "github.com/filecoin-project/lotus/metrics/proxy" "github.com/filecoin-project/lotus/node/impl" - "github.com/filecoin-project/lotus/node/impl/client" ) var rpclog = logging.Logger("rpc") @@ -98,33 +91,6 @@ func FullNodeHandler(a v1api.FullNode, permissioned bool, opts ...jsonrpc.Server serveRpc("/rpc/v1", fnapi) serveRpc("/rpc/v0", v0) - // Import handler - handleImportFunc := handleImport(a.(*impl.FullNodeAPI)) - handleExportFunc := handleExport(a.(*impl.FullNodeAPI)) - handleRemoteStoreFunc := handleRemoteStore(a.(*impl.FullNodeAPI)) - if permissioned { - importAH := &auth.Handler{ - Verify: a.AuthVerify, - Next: handleImportFunc, - } - m.Handle("/rest/v0/import", importAH) - exportAH := &auth.Handler{ - Verify: a.AuthVerify, - Next: handleExportFunc, - } - m.Handle("/rest/v0/export", exportAH) - - storeAH := &auth.Handler{ - Verify: a.AuthVerify, - Next: handleRemoteStoreFunc, - } - m.Handle("/rest/v0/store/{uuid}", storeAH) - } else { - m.HandleFunc("/rest/v0/import", handleImportFunc) - m.HandleFunc("/rest/v0/export", handleExportFunc) - m.HandleFunc("/rest/v0/store/{uuid}", handleRemoteStoreFunc) - } - // debugging m.Handle("/debug/metrics", metrics.Exporter()) m.Handle("/debug/pprof-set/block", handleFractionOpt("BlockProfileRate", runtime.SetBlockProfileRate)) @@ -191,61 +157,6 @@ func MinerHandler(a api.StorageMiner, permissioned bool) (http.Handler, error) { return rootMux, nil } -func handleImport(a *impl.FullNodeAPI) func(w http.ResponseWriter, r *http.Request) { - return func(w http.ResponseWriter, r *http.Request) { - if r.Method != "PUT" { - w.WriteHeader(404) - return - } - if !auth.HasPerm(r.Context(), nil, api.PermWrite) { - w.WriteHeader(401) - _ = json.NewEncoder(w).Encode(struct{ Error string }{"unauthorized: missing write permission"}) - return - } - - c, err := a.ClientImportLocal(r.Context(), r.Body) - if err != nil { - w.WriteHeader(500) - _ = json.NewEncoder(w).Encode(struct{ Error string }{err.Error()}) - return - } - w.WriteHeader(200) - err = json.NewEncoder(w).Encode(struct{ Cid cid.Cid }{c}) - if err != nil { - rpclog.Errorf("/rest/v0/import: Writing response failed: %+v", err) - return - } - } -} - -func handleExport(a *impl.FullNodeAPI) func(w http.ResponseWriter, r *http.Request) { - return func(w http.ResponseWriter, r *http.Request) { - if r.Method != "GET" { - w.WriteHeader(404) - return - } - if !auth.HasPerm(r.Context(), nil, api.PermWrite) { - w.WriteHeader(401) - _ = json.NewEncoder(w).Encode(struct{ Error string }{"unauthorized: missing write permission"}) - return - } - - var eref api.ExportRef - if err := json.Unmarshal([]byte(r.FormValue("export")), &eref); err != nil { - http.Error(w, err.Error(), http.StatusBadRequest) - return - } - - car := r.FormValue("car") == "true" - - err := a.ClientExportInto(r.Context(), eref, car, client.ExportDest{Writer: w}) - if err != nil { - http.Error(w, err.Error(), http.StatusInternalServerError) - return - } - } -} - func handleFractionOpt(name string, setter func(int)) http.HandlerFunc { return func(rw http.ResponseWriter, r *http.Request) { if r.Method != http.MethodPost { @@ -272,34 +183,3 @@ func handleFractionOpt(name string, setter func(int)) http.HandlerFunc { setter(fr) } } - -var upgrader = websocket.Upgrader{ - CheckOrigin: func(r *http.Request) bool { - return true - }, -} - -func handleRemoteStore(a *impl.FullNodeAPI) func(w http.ResponseWriter, r *http.Request) { - return func(w http.ResponseWriter, r *http.Request) { - vars := mux.Vars(r) - id, err := uuid.Parse(vars["uuid"]) - if err != nil { - http.Error(w, fmt.Sprintf("parse uuid: %s", err), http.StatusBadRequest) - return - } - - c, err := upgrader.Upgrade(w, r, nil) - if err != nil { - log.Error(err) - w.WriteHeader(500) - return - } - - nstore := bstore.NewNetworkStoreWS(c) - if err := a.ApiBlockstoreAccessor.RegisterApiStore(id, nstore); err != nil { - log.Errorw("registering api bstore", "error", err) - _ = c.Close() - return - } - } -} diff --git a/storage/sealer/mock/mock.go b/storage/sealer/mock/mock.go index e33be847715..958a246a74e 100644 --- a/storage/sealer/mock/mock.go +++ b/storage/sealer/mock/mock.go @@ -13,7 +13,6 @@ import ( logging "github.com/ipfs/go-log/v2" "golang.org/x/xerrors" - "github.com/filecoin-project/dagstore/mount" commpffi "github.com/filecoin-project/go-commp-utils/ffiwrapper" commcid "github.com/filecoin-project/go-fil-commcid" "github.com/filecoin-project/go-state-types/abi" @@ -435,7 +434,7 @@ func (mgr *SectorMgr) GenerateWindowPoStWithVanilla(ctx context.Context, proofTy panic("implement me") } -func (mgr *SectorMgr) ReadPiece(ctx context.Context, sector storiface.SectorRef, offset storiface.UnpaddedByteIndex, size abi.UnpaddedPieceSize, ticket abi.SealRandomness, unsealed cid.Cid) (mount.Reader, bool, error) { +func (mgr *SectorMgr) ReadPiece(ctx context.Context, sector storiface.SectorRef, offset storiface.UnpaddedByteIndex, size abi.UnpaddedPieceSize, ticket abi.SealRandomness, unsealed cid.Cid) (storiface.Reader, bool, error) { off := storiface.UnpaddedByteIndex(0) var piece cid.Cid diff --git a/storage/sealer/piece_provider.go b/storage/sealer/piece_provider.go index 0e992b67918..3d177665acf 100644 --- a/storage/sealer/piece_provider.go +++ b/storage/sealer/piece_provider.go @@ -10,7 +10,6 @@ import ( pool "github.com/libp2p/go-buffer-pool" "golang.org/x/xerrors" - "github.com/filecoin-project/dagstore/mount" "github.com/filecoin-project/go-state-types/abi" "github.com/filecoin-project/lotus/storage/paths" @@ -29,7 +28,7 @@ type PieceProvider interface { // default in most cases, but this might matter with future PoRep) // startOffset is added to the pieceOffset to get the starting reader offset. // The number of bytes that can be read is pieceSize-startOffset - ReadPiece(ctx context.Context, sector storiface.SectorRef, pieceOffset storiface.UnpaddedByteIndex, pieceSize abi.UnpaddedPieceSize, ticket abi.SealRandomness, unsealed cid.Cid) (mount.Reader, bool, error) + ReadPiece(ctx context.Context, sector storiface.SectorRef, pieceOffset storiface.UnpaddedByteIndex, pieceSize abi.UnpaddedPieceSize, ticket abi.SealRandomness, unsealed cid.Cid) (storiface.Reader, bool, error) IsUnsealed(ctx context.Context, sector storiface.SectorRef, offset storiface.UnpaddedByteIndex, size abi.UnpaddedPieceSize) (bool, error) } @@ -73,7 +72,7 @@ func (p *pieceProvider) IsUnsealed(ctx context.Context, sector storiface.SectorR // It will NOT try to schedule an Unseal of a sealed sector file for the read. // // Returns a nil reader if the piece does NOT exist in any unsealed file or there is no unsealed file for the given sector on any of the workers. -func (p *pieceProvider) tryReadUnsealedPiece(ctx context.Context, pc cid.Cid, sector storiface.SectorRef, pieceOffset storiface.UnpaddedByteIndex, pieceSize abi.UnpaddedPieceSize) (mount.Reader, error) { +func (p *pieceProvider) tryReadUnsealedPiece(ctx context.Context, pc cid.Cid, sector storiface.SectorRef, pieceOffset storiface.UnpaddedByteIndex, pieceSize abi.UnpaddedPieceSize) (storiface.Reader, error) { // acquire a lock purely for reading unsealed sectors ctx, cancel := context.WithCancel(ctx) if err := p.index.StorageLock(ctx, sector.ID, storiface.FTUnsealed, storiface.FTNone); err != nil { @@ -169,7 +168,7 @@ var _ io.Closer = funcCloser(nil) // If we do NOT have an existing unsealed file containing the given piece thus causing us to schedule an Unseal, // the returned boolean parameter will be set to true. // If we have an existing unsealed file containing the given piece, the returned boolean will be set to false. -func (p *pieceProvider) ReadPiece(ctx context.Context, sector storiface.SectorRef, pieceOffset storiface.UnpaddedByteIndex, size abi.UnpaddedPieceSize, ticket abi.SealRandomness, unsealed cid.Cid) (mount.Reader, bool, error) { +func (p *pieceProvider) ReadPiece(ctx context.Context, sector storiface.SectorRef, pieceOffset storiface.UnpaddedByteIndex, size abi.UnpaddedPieceSize, ticket abi.SealRandomness, unsealed cid.Cid) (storiface.Reader, bool, error) { if err := pieceOffset.Valid(); err != nil { return nil, false, xerrors.Errorf("pieceOffset is not valid: %w", err) } @@ -224,3 +223,5 @@ func (p *pieceProvider) ReadPiece(ctx context.Context, sector storiface.SectorRe return r, uns, nil } + +var _ storiface.Reader = &pieceReader{} diff --git a/storage/sealer/piece_reader.go b/storage/sealer/piece_reader.go index 7a7cd184110..37fb4488c9c 100644 --- a/storage/sealer/piece_reader.go +++ b/storage/sealer/piece_reader.go @@ -12,7 +12,6 @@ import ( "go.opencensus.io/tag" "golang.org/x/xerrors" - "github.com/filecoin-project/dagstore/mount" "github.com/filecoin-project/go-state-types/abi" "github.com/filecoin-project/lotus/metrics" @@ -303,5 +302,3 @@ func (p *pieceReader) readInto(b []byte, off int64) (n int, err error) { return n, cerr } - -var _ mount.Reader = (*pieceReader)(nil) diff --git a/storage/sealer/storiface/storage.go b/storage/sealer/storiface/storage.go index 143c3b5d560..91ab12805ca 100644 --- a/storage/sealer/storiface/storage.go +++ b/storage/sealer/storiface/storage.go @@ -13,6 +13,16 @@ import ( type Data = io.Reader +// Reader is a fully-featured Reader. It is the +// union of the standard IO sequential access method (Read), with seeking +// ability (Seek), as well random access (ReadAt). +type Reader interface { + io.Closer + io.Reader + io.ReaderAt + io.Seeker +} + type SectorRef struct { ID abi.SectorID ProofType abi.RegisteredSealProof