diff --git a/.circleci/config.yml b/.circleci/config.yml index 85b3fc73e..29a6db372 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -358,6 +358,15 @@ jobs: command: | curl --location https://github.com/stedolan/jq/releases/download/jq-1.6/jq-osx-amd64 --output /usr/local/bin/jq chmod +x /usr/local/bin/jq + - run: + name: Install hwloc + command: | + mkdir ~/hwloc + curl --location https://download.open-mpi.org/release/hwloc/v2.4/hwloc-2.4.1.tar.gz --output ~/hwloc/hwloc-2.4.1.tar.gz + cd ~/hwloc + tar -xvzpf hwloc-2.4.1.tar.gz + cd hwloc-2.4.1 + ./configure && make && sudo make install - restore_cache: name: restore cargo cache key: v3-go-deps-{{ arch }}-{{ checksum "~/go/src/github.com/filecoin-project/lotus/go.sum" }} @@ -408,9 +417,18 @@ jobs: steps: - install-deps - prepare + - run: zcat build/openrpc/full.json.gz | jq > ../pre-openrpc-full + - run: zcat build/openrpc/miner.json.gz | jq > ../pre-openrpc-miner + - run: zcat build/openrpc/worker.json.gz | jq > ../pre-openrpc-worker - run: make deps - run: make docsgen + - run: zcat build/openrpc/full.json.gz | jq > ../post-openrpc-full + - run: zcat build/openrpc/miner.json.gz | jq > ../post-openrpc-miner + - run: zcat build/openrpc/worker.json.gz | jq > ../post-openrpc-worker - run: git --no-pager diff + - run: diff ../pre-openrpc-full ../post-openrpc-full + - run: diff ../pre-openrpc-miner ../post-openrpc-miner + - run: diff ../pre-openrpc-worker ../post-openrpc-worker - run: git --no-pager diff --quiet lint: &lint diff --git a/.gitignore b/.gitignore index 23eca7e42..e34ebb935 100644 --- a/.gitignore +++ b/.gitignore @@ -14,6 +14,8 @@ /lotus-pcr /lotus-wallet /lotus-keygen +/docgen-md +/docgen-openrpc /bench.json /lotuspond/front/node_modules /lotuspond/front/build diff --git a/.golangci.yml b/.golangci.yml index 8bdba64f0..87db745e4 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -16,6 +16,12 @@ linters: - deadcode - scopelint +# We don't want to skip builtin/ +skip-dirs-use-default: false +skip-dirs: + - vendor$ + - testdata$ + - examples$ issues: exclude: diff --git a/CHANGELOG.md b/CHANGELOG.md index 07c91bea7..854166c4c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,8 @@ # Lotus changelog -# 1.5.3-rc2 / 2021-03-17 +# 1.5.3 / 2021-03-24 -This is the second release candidate for Lotus 1.5.3, which introduces small fixes to the Storage FSM. +This is a patch release of Lotus that introduces small fixes to the Storage FSM. ## Changes diff --git a/Makefile b/Makefile index abc01385a..16269e133 100644 --- a/Makefile +++ b/Makefile @@ -325,12 +325,41 @@ type-gen: method-gen: (cd ./lotuspond/front/src/chain && go run ./methodgen.go) -gen: type-gen method-gen +api-gen: + go run ./gen/api > api/apistruct/struct.go + goimports -w api/apistruct + goimports -w api/apistruct +.PHONY: api-gen -docsgen: - go run ./api/docgen "api/api_full.go" "FullNode" > documentation/en/api-methods.md - go run ./api/docgen "api/api_storage.go" "StorageMiner" > documentation/en/api-methods-miner.md - go run ./api/docgen "api/api_worker.go" "WorkerAPI" > documentation/en/api-methods-worker.md +docsgen: docsgen-md docsgen-openrpc + +docsgen-md-bin: + go build $(GOFLAGS) -o docgen-md ./api/docgen/cmd +docsgen-openrpc-bin: + go build $(GOFLAGS) -o docgen-openrpc ./api/docgen-openrpc/cmd + +docsgen-md: docsgen-md-full docsgen-md-storage docsgen-md-worker + +docsgen-md-full: docsgen-md-bin + ./docgen-md "api/api_full.go" "FullNode" > documentation/en/api-methods.md +docsgen-md-storage: docsgen-md-bin + ./docgen-md "api/api_storage.go" "StorageMiner" > documentation/en/api-methods-miner.md +docsgen-md-worker: docsgen-md-bin + ./docgen-md "api/api_worker.go" "Worker" > documentation/en/api-methods-worker.md + +docsgen-openrpc: docsgen-openrpc-full docsgen-openrpc-storage docsgen-openrpc-worker + +docsgen-openrpc-full: docsgen-openrpc-bin + ./docgen-openrpc "api/api_full.go" "FullNode" -gzip > build/openrpc/full.json.gz +docsgen-openrpc-storage: docsgen-openrpc-bin + ./docgen-openrpc "api/api_storage.go" "StorageMiner" -gzip > build/openrpc/miner.json.gz +docsgen-openrpc-worker: docsgen-openrpc-bin + ./docgen-openrpc "api/api_worker.go" "Worker" -gzip > build/openrpc/worker.json.gz + +.PHONY: docsgen docsgen-md-bin docsgen-openrpc-bin + +gen: type-gen method-gen docsgen api-gen +.PHONY: gen print-%: @echo $*=$($*) diff --git a/api/api_common.go b/api/api_common.go index fc89f11cd..b1aaa4a82 100644 --- a/api/api_common.go +++ b/api/api_common.go @@ -11,63 +11,68 @@ import ( "github.com/libp2p/go-libp2p-core/network" "github.com/libp2p/go-libp2p-core/peer" protocol "github.com/libp2p/go-libp2p-core/protocol" + + apitypes "github.com/filecoin-project/lotus/api/types" ) type Common interface { // MethodGroup: Auth - AuthVerify(ctx context.Context, token string) ([]auth.Permission, error) - AuthNew(ctx context.Context, perms []auth.Permission) ([]byte, error) + AuthVerify(ctx context.Context, token string) ([]auth.Permission, error) //perm:read + AuthNew(ctx context.Context, perms []auth.Permission) ([]byte, error) //perm:admin // MethodGroup: Net - NetConnectedness(context.Context, peer.ID) (network.Connectedness, error) - NetPeers(context.Context) ([]peer.AddrInfo, error) - NetConnect(context.Context, peer.AddrInfo) error - NetAddrsListen(context.Context) (peer.AddrInfo, error) - NetDisconnect(context.Context, peer.ID) error - NetFindPeer(context.Context, peer.ID) (peer.AddrInfo, error) - NetPubsubScores(context.Context) ([]PubsubScore, error) - NetAutoNatStatus(context.Context) (NatInfo, error) - NetAgentVersion(ctx context.Context, p peer.ID) (string, error) - NetPeerInfo(context.Context, peer.ID) (*ExtendedPeerInfo, error) + NetConnectedness(context.Context, peer.ID) (network.Connectedness, error) //perm:read + NetPeers(context.Context) ([]peer.AddrInfo, error) //perm:read + NetConnect(context.Context, peer.AddrInfo) error //perm:write + NetAddrsListen(context.Context) (peer.AddrInfo, error) //perm:read + NetDisconnect(context.Context, peer.ID) error //perm:write + NetFindPeer(context.Context, peer.ID) (peer.AddrInfo, error) //perm:read + NetPubsubScores(context.Context) ([]PubsubScore, error) //perm:read + NetAutoNatStatus(context.Context) (NatInfo, error) //perm:read + NetAgentVersion(ctx context.Context, p peer.ID) (string, error) //perm:read + NetPeerInfo(context.Context, peer.ID) (*ExtendedPeerInfo, error) //perm:read // NetBandwidthStats returns statistics about the nodes total bandwidth // usage and current rate across all peers and protocols. - NetBandwidthStats(ctx context.Context) (metrics.Stats, error) + NetBandwidthStats(ctx context.Context) (metrics.Stats, error) //perm:read // NetBandwidthStatsByPeer returns statistics about the nodes bandwidth // usage and current rate per peer - NetBandwidthStatsByPeer(ctx context.Context) (map[string]metrics.Stats, error) + NetBandwidthStatsByPeer(ctx context.Context) (map[string]metrics.Stats, error) //perm:read // NetBandwidthStatsByProtocol returns statistics about the nodes bandwidth // usage and current rate per protocol - NetBandwidthStatsByProtocol(ctx context.Context) (map[protocol.ID]metrics.Stats, error) + NetBandwidthStatsByProtocol(ctx context.Context) (map[protocol.ID]metrics.Stats, error) //perm:read // ConnectionGater API - NetBlockAdd(ctx context.Context, acl NetBlockList) error - NetBlockRemove(ctx context.Context, acl NetBlockList) error - NetBlockList(ctx context.Context) (NetBlockList, error) + NetBlockAdd(ctx context.Context, acl NetBlockList) error //perm:admin + NetBlockRemove(ctx context.Context, acl NetBlockList) error //perm:admin + NetBlockList(ctx context.Context) (NetBlockList, error) //perm:read // MethodGroup: Common + // Discover returns an OpenRPC document describing an RPC API. + Discover(ctx context.Context) (apitypes.OpenRPCDocument, error) //perm:read + // ID returns peerID of libp2p node backing this API - ID(context.Context) (peer.ID, error) + ID(context.Context) (peer.ID, error) //perm:read // Version provides information about API provider - Version(context.Context) (APIVersion, error) + Version(context.Context) (APIVersion, error) //perm:read - LogList(context.Context) ([]string, error) - LogSetLevel(context.Context, string, string) error + LogList(context.Context) ([]string, error) //perm:write + LogSetLevel(context.Context, string, string) error //perm:write // trigger graceful shutdown - Shutdown(context.Context) error + Shutdown(context.Context) error //perm:admin // Session returns a random UUID of api provider session - Session(context.Context) (uuid.UUID, error) + Session(context.Context) (uuid.UUID, error) //perm:read - Closing(context.Context) (<-chan struct{}, error) + Closing(context.Context) (<-chan struct{}, error) //perm:read } // APIVersion provides various build-time information diff --git a/api/api_full.go b/api/api_full.go index 3ed28f429..c0b17e4ea 100644 --- a/api/api_full.go +++ b/api/api_full.go @@ -6,14 +6,12 @@ import ( "fmt" "time" - datatransfer "github.com/filecoin-project/go-data-transfer" - "github.com/filecoin-project/go-state-types/network" - "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" "github.com/filecoin-project/go-fil-markets/retrievalmarket" "github.com/filecoin-project/go-fil-markets/storagemarket" "github.com/filecoin-project/go-multistore" @@ -21,11 +19,12 @@ import ( "github.com/filecoin-project/go-state-types/big" "github.com/filecoin-project/go-state-types/crypto" "github.com/filecoin-project/go-state-types/dline" + + apitypes "github.com/filecoin-project/lotus/api/types" + "github.com/filecoin-project/lotus/chain/actors/builtin" "github.com/filecoin-project/lotus/chain/actors/builtin/market" "github.com/filecoin-project/lotus/chain/actors/builtin/miner" "github.com/filecoin-project/lotus/chain/actors/builtin/paych" - - "github.com/filecoin-project/lotus/chain/actors/builtin" "github.com/filecoin-project/lotus/chain/actors/builtin/power" "github.com/filecoin-project/lotus/chain/types" marketevents "github.com/filecoin-project/lotus/markets/loggers" @@ -50,66 +49,78 @@ type FullNode interface { // ChainNotify returns channel with chain head updates. // First message is guaranteed to be of len == 1, and type == 'current'. - ChainNotify(context.Context) (<-chan []*HeadChange, error) + ChainNotify(context.Context) (<-chan []*HeadChange, error) //perm:read // ChainHead returns the current head of the chain. - ChainHead(context.Context) (*types.TipSet, error) + ChainHead(context.Context) (*types.TipSet, error) //perm:read // ChainGetRandomnessFromTickets is used to sample the chain for randomness. - ChainGetRandomnessFromTickets(ctx context.Context, tsk types.TipSetKey, personalization crypto.DomainSeparationTag, randEpoch abi.ChainEpoch, entropy []byte) (abi.Randomness, error) + ChainGetRandomnessFromTickets(ctx context.Context, tsk types.TipSetKey, personalization crypto.DomainSeparationTag, randEpoch abi.ChainEpoch, entropy []byte) (abi.Randomness, error) //perm:read // ChainGetRandomnessFromBeacon is used to sample the beacon for randomness. - ChainGetRandomnessFromBeacon(ctx context.Context, tsk types.TipSetKey, personalization crypto.DomainSeparationTag, randEpoch abi.ChainEpoch, entropy []byte) (abi.Randomness, error) + ChainGetRandomnessFromBeacon(ctx context.Context, tsk types.TipSetKey, personalization crypto.DomainSeparationTag, randEpoch abi.ChainEpoch, entropy []byte) (abi.Randomness, error) //perm:read // ChainGetBlock returns the block specified by the given CID. - ChainGetBlock(context.Context, cid.Cid) (*types.BlockHeader, error) + ChainGetBlock(context.Context, cid.Cid) (*types.BlockHeader, error) //perm:read // ChainGetTipSet returns the tipset specified by the given TipSetKey. - ChainGetTipSet(context.Context, types.TipSetKey) (*types.TipSet, error) + ChainGetTipSet(context.Context, types.TipSetKey) (*types.TipSet, error) //perm:read // ChainGetBlockMessages returns messages stored in the specified block. - ChainGetBlockMessages(ctx context.Context, blockCid cid.Cid) (*BlockMessages, error) + // + // Note: If there are multiple blocks in a tipset, it's likely that some + // messages will be duplicated. It's also possible for blocks in a tipset to have + // different messages from the same sender at the same nonce. When that happens, + // only the first message (in a block with lowest ticket) will be considered + // for execution + // + // NOTE: THIS METHOD SHOULD ONLY BE USED FOR GETTING MESSAGES IN A SPECIFIC BLOCK + // + // DO NOT USE THIS METHOD TO GET MESSAGES INCLUDED IN A TIPSET + // Use ChainGetParentMessages, which will perform correct message deduplication + ChainGetBlockMessages(ctx context.Context, blockCid cid.Cid) (*BlockMessages, error) //perm:read // ChainGetParentReceipts returns receipts for messages in parent tipset of - // the specified block. - ChainGetParentReceipts(ctx context.Context, blockCid cid.Cid) ([]*types.MessageReceipt, error) + // the specified block. The receipts in the list returned is one-to-one with the + // messages returned by a call to ChainGetParentMessages with the same blockCid. + ChainGetParentReceipts(ctx context.Context, blockCid cid.Cid) ([]*types.MessageReceipt, error) //perm:read // ChainGetParentMessages returns messages stored in parent tipset of the // specified block. - ChainGetParentMessages(ctx context.Context, blockCid cid.Cid) ([]Message, error) + ChainGetParentMessages(ctx context.Context, blockCid cid.Cid) ([]Message, error) //perm:read // ChainGetTipSetByHeight looks back for a tipset at the specified epoch. // If there are no blocks at the specified epoch, a tipset at an earlier epoch // will be returned. - ChainGetTipSetByHeight(context.Context, abi.ChainEpoch, types.TipSetKey) (*types.TipSet, error) + ChainGetTipSetByHeight(context.Context, abi.ChainEpoch, types.TipSetKey) (*types.TipSet, error) //perm:read // ChainReadObj reads ipld nodes referenced by the specified CID from chain // blockstore and returns raw bytes. - ChainReadObj(context.Context, cid.Cid) ([]byte, error) + ChainReadObj(context.Context, cid.Cid) ([]byte, error) //perm:read // ChainDeleteObj deletes node referenced by the given CID - ChainDeleteObj(context.Context, cid.Cid) error + ChainDeleteObj(context.Context, cid.Cid) error //perm:admin // ChainHasObj checks if a given CID exists in the chain blockstore. - ChainHasObj(context.Context, cid.Cid) (bool, error) + ChainHasObj(context.Context, cid.Cid) (bool, error) //perm:read // ChainStatObj returns statistics about the graph referenced by 'obj'. // If 'base' is also specified, then the returned stat will be a diff // between the two objects. - ChainStatObj(ctx context.Context, obj cid.Cid, base cid.Cid) (ObjStat, error) + ChainStatObj(ctx context.Context, obj cid.Cid, base cid.Cid) (ObjStat, error) //perm:read // ChainSetHead forcefully sets current chain head. Use with caution. - ChainSetHead(context.Context, types.TipSetKey) error + ChainSetHead(context.Context, types.TipSetKey) error //perm:admin // ChainGetGenesis returns the genesis tipset. - ChainGetGenesis(context.Context) (*types.TipSet, error) + ChainGetGenesis(context.Context) (*types.TipSet, error) //perm:read // ChainTipSetWeight computes weight for the specified tipset. - ChainTipSetWeight(context.Context, types.TipSetKey) (types.BigInt, error) - ChainGetNode(ctx context.Context, p string) (*IpldObject, error) + ChainTipSetWeight(context.Context, types.TipSetKey) (types.BigInt, error) //perm:read + ChainGetNode(ctx context.Context, p string) (*IpldObject, error) //perm:read // ChainGetMessage reads a message referenced by the specified CID from the // chain blockstore. - ChainGetMessage(context.Context, cid.Cid) (*types.Message, error) + ChainGetMessage(context.Context, cid.Cid) (*types.Message, error) //perm:read // ChainGetPath returns a set of revert/apply operations needed to get from // one tipset to another, for example: @@ -124,14 +135,14 @@ type FullNode interface { // tRR //``` // Would return `[revert(tBA), apply(tAB), apply(tAA)]` - ChainGetPath(ctx context.Context, from types.TipSetKey, to types.TipSetKey) ([]*HeadChange, error) + ChainGetPath(ctx context.Context, from types.TipSetKey, to types.TipSetKey) ([]*HeadChange, error) //perm:read // ChainExport returns a stream of bytes with CAR dump of chain data. // The exported chain data includes the header chain from the given tipset // back to genesis, the entire genesis state, and the most recent 'nroots' // state trees. // If oldmsgskip is set, messages from before the requested roots are also not included. - ChainExport(ctx context.Context, nroots abi.ChainEpoch, oldmsgskip bool, tsk types.TipSetKey) (<-chan []byte, error) + ChainExport(ctx context.Context, nroots abi.ChainEpoch, oldmsgskip bool, tsk types.TipSetKey) (<-chan []byte, error) //perm:read // MethodGroup: Beacon // The Beacon method group contains methods for interacting with the random beacon (DRAND) @@ -139,74 +150,74 @@ type FullNode interface { // BeaconGetEntry returns the beacon entry for the given filecoin epoch. If // the entry has not yet been produced, the call will block until the entry // becomes available - BeaconGetEntry(ctx context.Context, epoch abi.ChainEpoch) (*types.BeaconEntry, error) + BeaconGetEntry(ctx context.Context, epoch abi.ChainEpoch) (*types.BeaconEntry, error) //perm:read // GasEstimateFeeCap estimates gas fee cap - GasEstimateFeeCap(context.Context, *types.Message, int64, types.TipSetKey) (types.BigInt, error) + GasEstimateFeeCap(context.Context, *types.Message, int64, types.TipSetKey) (types.BigInt, error) //perm:read // GasEstimateGasLimit estimates gas used by the message and returns it. // It fails if message fails to execute. - GasEstimateGasLimit(context.Context, *types.Message, types.TipSetKey) (int64, error) + GasEstimateGasLimit(context.Context, *types.Message, types.TipSetKey) (int64, error) //perm:read // GasEstimateGasPremium estimates what gas price should be used for a // message to have high likelihood of inclusion in `nblocksincl` epochs. GasEstimateGasPremium(_ context.Context, nblocksincl uint64, - sender address.Address, gaslimit int64, tsk types.TipSetKey) (types.BigInt, error) + sender address.Address, gaslimit int64, tsk types.TipSetKey) (types.BigInt, error) //perm:read // GasEstimateMessageGas estimates gas values for unset message gas fields - GasEstimateMessageGas(context.Context, *types.Message, *MessageSendSpec, types.TipSetKey) (*types.Message, error) + GasEstimateMessageGas(context.Context, *types.Message, *MessageSendSpec, types.TipSetKey) (*types.Message, error) //perm:read // MethodGroup: Sync // The Sync method group contains methods for interacting with and // observing the lotus sync service. // SyncState returns the current status of the lotus sync system. - SyncState(context.Context) (*SyncState, error) + SyncState(context.Context) (*SyncState, error) //perm:read // SyncSubmitBlock can be used to submit a newly created block to the. // network through this node - SyncSubmitBlock(ctx context.Context, blk *types.BlockMsg) error + SyncSubmitBlock(ctx context.Context, blk *types.BlockMsg) error //perm:write // SyncIncomingBlocks returns a channel streaming incoming, potentially not // yet synced block headers. - SyncIncomingBlocks(ctx context.Context) (<-chan *types.BlockHeader, error) + SyncIncomingBlocks(ctx context.Context) (<-chan *types.BlockHeader, error) //perm:read // SyncCheckpoint marks a blocks as checkpointed, meaning that it won't ever fork away from it. - SyncCheckpoint(ctx context.Context, tsk types.TipSetKey) error + SyncCheckpoint(ctx context.Context, tsk types.TipSetKey) error //perm:admin // SyncMarkBad marks a blocks as bad, meaning that it won't ever by synced. // Use with extreme caution. - SyncMarkBad(ctx context.Context, bcid cid.Cid) error + SyncMarkBad(ctx context.Context, bcid cid.Cid) error //perm:admin // SyncUnmarkBad unmarks a blocks as bad, making it possible to be validated and synced again. - SyncUnmarkBad(ctx context.Context, bcid cid.Cid) error + SyncUnmarkBad(ctx context.Context, bcid cid.Cid) error //perm:admin // SyncUnmarkAllBad purges bad block cache, making it possible to sync to chains previously marked as bad - SyncUnmarkAllBad(ctx context.Context) error + SyncUnmarkAllBad(ctx context.Context) error //perm:admin // SyncCheckBad checks if a block was marked as bad, and if it was, returns // the reason. - SyncCheckBad(ctx context.Context, bcid cid.Cid) (string, error) + SyncCheckBad(ctx context.Context, bcid cid.Cid) (string, error) //perm:read // SyncValidateTipset indicates whether the provided tipset is valid or not - SyncValidateTipset(ctx context.Context, tsk types.TipSetKey) (bool, error) + SyncValidateTipset(ctx context.Context, tsk types.TipSetKey) (bool, error) //perm:read // MethodGroup: Mpool // The Mpool methods are for interacting with the message pool. The message pool // manages all incoming and outgoing 'messages' going over the network. // MpoolPending returns pending mempool messages. - MpoolPending(context.Context, types.TipSetKey) ([]*types.SignedMessage, error) + MpoolPending(context.Context, types.TipSetKey) ([]*types.SignedMessage, error) //perm:read // MpoolSelect returns a list of pending messages for inclusion in the next block - MpoolSelect(context.Context, types.TipSetKey, float64) ([]*types.SignedMessage, error) + MpoolSelect(context.Context, types.TipSetKey, float64) ([]*types.SignedMessage, error) //perm:read // MpoolPush pushes a signed message to mempool. - MpoolPush(context.Context, *types.SignedMessage) (cid.Cid, error) + MpoolPush(context.Context, *types.SignedMessage) (cid.Cid, error) //perm:write // MpoolPushUntrusted pushes a signed message to mempool from untrusted sources. - MpoolPushUntrusted(context.Context, *types.SignedMessage) (cid.Cid, error) + MpoolPushUntrusted(context.Context, *types.SignedMessage) (cid.Cid, error) //perm:write // MpoolPushMessage atomically assigns a nonce, signs, and pushes a message // to mempool. @@ -214,34 +225,34 @@ type FullNode interface { // // When maxFee is set to 0, MpoolPushMessage will guess appropriate fee // based on current chain conditions - MpoolPushMessage(ctx context.Context, msg *types.Message, spec *MessageSendSpec) (*types.SignedMessage, error) + MpoolPushMessage(ctx context.Context, msg *types.Message, spec *MessageSendSpec) (*types.SignedMessage, error) //perm:sign // MpoolBatchPush batch pushes a signed message to mempool. - MpoolBatchPush(context.Context, []*types.SignedMessage) ([]cid.Cid, error) + MpoolBatchPush(context.Context, []*types.SignedMessage) ([]cid.Cid, error) //perm:write // MpoolBatchPushUntrusted batch pushes a signed message to mempool from untrusted sources. - MpoolBatchPushUntrusted(context.Context, []*types.SignedMessage) ([]cid.Cid, error) + MpoolBatchPushUntrusted(context.Context, []*types.SignedMessage) ([]cid.Cid, error) //perm:write // MpoolBatchPushMessage batch pushes a unsigned message to mempool. - MpoolBatchPushMessage(context.Context, []*types.Message, *MessageSendSpec) ([]*types.SignedMessage, error) + MpoolBatchPushMessage(context.Context, []*types.Message, *MessageSendSpec) ([]*types.SignedMessage, error) //perm:sign // MpoolGetNonce gets next nonce for the specified sender. // Note that this method may not be atomic. Use MpoolPushMessage instead. - MpoolGetNonce(context.Context, address.Address) (uint64, error) - MpoolSub(context.Context) (<-chan MpoolUpdate, error) + MpoolGetNonce(context.Context, address.Address) (uint64, error) //perm:read + MpoolSub(context.Context) (<-chan MpoolUpdate, error) //perm:read // MpoolClear clears pending messages from the mpool - MpoolClear(context.Context, bool) error + MpoolClear(context.Context, bool) error //perm:write // MpoolGetConfig returns (a copy of) the current mpool config - MpoolGetConfig(context.Context) (*types.MpoolConfig, error) + MpoolGetConfig(context.Context) (*types.MpoolConfig, error) //perm:read // MpoolSetConfig sets the mpool config to (a copy of) the supplied config - MpoolSetConfig(context.Context, *types.MpoolConfig) error + MpoolSetConfig(context.Context, *types.MpoolConfig) error //perm:admin // MethodGroup: Miner - MinerGetBaseInfo(context.Context, address.Address, abi.ChainEpoch, types.TipSetKey) (*MiningBaseInfo, error) - MinerCreateBlock(context.Context, *BlockTemplate) (*types.BlockMsg, error) + MinerGetBaseInfo(context.Context, address.Address, abi.ChainEpoch, types.TipSetKey) (*MiningBaseInfo, error) //perm:read + MinerCreateBlock(context.Context, *BlockTemplate) (*types.BlockMsg, error) //perm:write // // UX ? @@ -250,32 +261,32 @@ type FullNode interface { // WalletNew creates a new address in the wallet with the given sigType. // Available key types: bls, secp256k1, secp256k1-ledger // Support for numerical types: 1 - secp256k1, 2 - BLS is deprecated - WalletNew(context.Context, types.KeyType) (address.Address, error) + WalletNew(context.Context, types.KeyType) (address.Address, error) //perm:write // WalletHas indicates whether the given address is in the wallet. - WalletHas(context.Context, address.Address) (bool, error) + WalletHas(context.Context, address.Address) (bool, error) //perm:write // WalletList lists all the addresses in the wallet. - WalletList(context.Context) ([]address.Address, error) + WalletList(context.Context) ([]address.Address, error) //perm:write // WalletBalance returns the balance of the given address at the current head of the chain. - WalletBalance(context.Context, address.Address) (types.BigInt, error) + WalletBalance(context.Context, address.Address) (types.BigInt, error) //perm:read // WalletSign signs the given bytes using the given address. - WalletSign(context.Context, address.Address, []byte) (*crypto.Signature, error) + WalletSign(context.Context, address.Address, []byte) (*crypto.Signature, error) //perm:sign // WalletSignMessage signs the given message using the given address. - WalletSignMessage(context.Context, address.Address, *types.Message) (*types.SignedMessage, error) + WalletSignMessage(context.Context, address.Address, *types.Message) (*types.SignedMessage, error) //perm:sign // WalletVerify takes an address, a signature, and some bytes, and indicates whether the signature is valid. // The address does not have to be in the wallet. - WalletVerify(context.Context, address.Address, []byte, *crypto.Signature) (bool, error) + WalletVerify(context.Context, address.Address, []byte, *crypto.Signature) (bool, error) //perm:read // WalletDefaultAddress returns the address marked as default in the wallet. - WalletDefaultAddress(context.Context) (address.Address, error) + WalletDefaultAddress(context.Context) (address.Address, error) //perm:write // WalletSetDefault marks the given address as as the default one. - WalletSetDefault(context.Context, address.Address) error + WalletSetDefault(context.Context, address.Address) error //perm:write // WalletExport returns the private key of an address in the wallet. - WalletExport(context.Context, address.Address) (*types.KeyInfo, error) + WalletExport(context.Context, address.Address) (*types.KeyInfo, error) //perm:admin // WalletImport receives a KeyInfo, which includes a private key, and imports it into the wallet. - WalletImport(context.Context, *types.KeyInfo) (address.Address, error) + WalletImport(context.Context, *types.KeyInfo) (address.Address, error) //perm:admin // WalletDelete deletes an address from the wallet. - WalletDelete(context.Context, address.Address) error + WalletDelete(context.Context, address.Address) error //perm:admin // WalletValidateAddress validates whether a given string can be decoded as a well-formed address - WalletValidateAddress(context.Context, string) (address.Address, error) + WalletValidateAddress(context.Context, string) (address.Address, error) //perm:read // Other @@ -284,58 +295,61 @@ type FullNode interface { // retrieval markets as a client // ClientImport imports file under the specified path into filestore. - ClientImport(ctx context.Context, ref FileRef) (*ImportRes, error) + ClientImport(ctx context.Context, ref FileRef) (*ImportRes, error) //perm:admin // ClientRemoveImport removes file import - ClientRemoveImport(ctx context.Context, importID multistore.StoreID) error + ClientRemoveImport(ctx context.Context, importID multistore.StoreID) error //perm:admin // ClientStartDeal proposes a deal with a miner. - ClientStartDeal(ctx context.Context, params *StartDealParams) (*cid.Cid, error) + 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) + 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) + 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) + ClientListDeals(ctx context.Context) ([]DealInfo, error) //perm:write // ClientGetDealUpdates returns the status of updated deals - ClientGetDealUpdates(ctx context.Context) (<-chan DealInfo, error) + ClientGetDealUpdates(ctx context.Context) (<-chan DealInfo, error) //perm:write // ClientGetDealStatus returns status given a code - ClientGetDealStatus(ctx context.Context, statusCode uint64) (string, error) + 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) + 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) + 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) + 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, order RetrievalOrder, ref *FileRef) error + ClientRetrieve(ctx context.Context, order RetrievalOrder, ref *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 *FileRef) (<-chan marketevents.RetrievalEvent, error) + ClientRetrieveWithEvents(ctx context.Context, order RetrievalOrder, ref *FileRef) (<-chan marketevents.RetrievalEvent, error) //perm:admin // ClientQueryAsk returns a signed StorageAsk from the specified miner. - ClientQueryAsk(ctx context.Context, p peer.ID, miner address.Address) (*storagemarket.StorageAsk, error) + 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) (DataCIDSize, error) + 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) + 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 + 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) + 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) - ClientDataTransferUpdates(ctx context.Context) (<-chan DataTransferChannel, error) + 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 + 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 + 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 + 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) + ClientListImports(ctx context.Context) ([]Import, error) //perm:write //ClientListAsks() []Ask @@ -349,149 +363,258 @@ type FullNode interface { // StateCall applies the message to the tipset's parent state. The // message is not applied on-top-of the messages in the passed-in // tipset. - StateCall(context.Context, *types.Message, types.TipSetKey) (*InvocResult, error) + StateCall(context.Context, *types.Message, types.TipSetKey) (*InvocResult, error) //perm:read // StateReplay replays a given message, assuming it was included in a block in the specified tipset. - // If no tipset key is provided, the appropriate tipset is looked up. - StateReplay(context.Context, types.TipSetKey, cid.Cid) (*InvocResult, error) + // + // If a tipset key is provided, and a replacing message is found on chain, + // the method will return an error saying that the message wasn't found + // + // If no tipset key is provided, the appropriate tipset is looked up, and if + // the message was gas-repriced, the on-chain message will be replayed - in + // that case the returned InvocResult.MsgCid will not match the Cid param + // + // If the caller wants to ensure that exactly the requested message was executed, + // they MUST check that InvocResult.MsgCid is equal to the provided Cid. + // Without this check both the requested and original message may appear as + // successfully executed on-chain, which may look like a double-spend. + // + // A replacing message is a message with a different CID, any of Gas values, and + // different signature, but with all other parameters matching (source/destination, + // nonce, params, etc.) + StateReplay(context.Context, types.TipSetKey, cid.Cid) (*InvocResult, error) //perm:read // StateGetActor returns the indicated actor's nonce and balance. - StateGetActor(ctx context.Context, actor address.Address, tsk types.TipSetKey) (*types.Actor, error) + StateGetActor(ctx context.Context, actor address.Address, tsk types.TipSetKey) (*types.Actor, error) //perm:read // StateReadState returns the indicated actor's state. - StateReadState(ctx context.Context, actor address.Address, tsk types.TipSetKey) (*ActorState, error) + StateReadState(ctx context.Context, actor address.Address, tsk types.TipSetKey) (*ActorState, error) //perm:read // StateListMessages looks back and returns all messages with a matching to or from address, stopping at the given height. - StateListMessages(ctx context.Context, match *MessageMatch, tsk types.TipSetKey, toht abi.ChainEpoch) ([]cid.Cid, error) + StateListMessages(ctx context.Context, match *MessageMatch, tsk types.TipSetKey, toht abi.ChainEpoch) ([]cid.Cid, error) //perm:read // StateDecodeParams attempts to decode the provided params, based on the recipient actor address and method number. - StateDecodeParams(ctx context.Context, toAddr address.Address, method abi.MethodNum, params []byte, tsk types.TipSetKey) (interface{}, error) + StateDecodeParams(ctx context.Context, toAddr address.Address, method abi.MethodNum, params []byte, tsk types.TipSetKey) (interface{}, error) //perm:read // StateNetworkName returns the name of the network the node is synced to - StateNetworkName(context.Context) (dtypes.NetworkName, error) + StateNetworkName(context.Context) (dtypes.NetworkName, error) //perm:read // StateMinerSectors returns info about the given miner's sectors. If the filter bitfield is nil, all sectors are included. - StateMinerSectors(context.Context, address.Address, *bitfield.BitField, types.TipSetKey) ([]*miner.SectorOnChainInfo, error) + StateMinerSectors(context.Context, address.Address, *bitfield.BitField, types.TipSetKey) ([]*miner.SectorOnChainInfo, error) //perm:read // StateMinerActiveSectors returns info about sectors that a given miner is actively proving. - StateMinerActiveSectors(context.Context, address.Address, types.TipSetKey) ([]*miner.SectorOnChainInfo, error) + StateMinerActiveSectors(context.Context, address.Address, types.TipSetKey) ([]*miner.SectorOnChainInfo, error) //perm:read // StateMinerProvingDeadline calculates the deadline at some epoch for a proving period // and returns the deadline-related calculations. - StateMinerProvingDeadline(context.Context, address.Address, types.TipSetKey) (*dline.Info, error) + StateMinerProvingDeadline(context.Context, address.Address, types.TipSetKey) (*dline.Info, error) //perm:read // StateMinerPower returns the power of the indicated miner - StateMinerPower(context.Context, address.Address, types.TipSetKey) (*MinerPower, error) + StateMinerPower(context.Context, address.Address, types.TipSetKey) (*MinerPower, error) //perm:read // StateMinerInfo returns info about the indicated miner - StateMinerInfo(context.Context, address.Address, types.TipSetKey) (miner.MinerInfo, error) + StateMinerInfo(context.Context, address.Address, types.TipSetKey) (miner.MinerInfo, error) //perm:read // StateMinerDeadlines returns all the proving deadlines for the given miner - StateMinerDeadlines(context.Context, address.Address, types.TipSetKey) ([]Deadline, error) + StateMinerDeadlines(context.Context, address.Address, types.TipSetKey) ([]Deadline, error) //perm:read // StateMinerPartitions returns all partitions in the specified deadline - StateMinerPartitions(ctx context.Context, m address.Address, dlIdx uint64, tsk types.TipSetKey) ([]Partition, error) + StateMinerPartitions(ctx context.Context, m address.Address, dlIdx uint64, tsk types.TipSetKey) ([]Partition, error) //perm:read // StateMinerFaults returns a bitfield indicating the faulty sectors of the given miner - StateMinerFaults(context.Context, address.Address, types.TipSetKey) (bitfield.BitField, error) + StateMinerFaults(context.Context, address.Address, types.TipSetKey) (bitfield.BitField, error) //perm:read // StateAllMinerFaults returns all non-expired Faults that occur within lookback epochs of the given tipset - StateAllMinerFaults(ctx context.Context, lookback abi.ChainEpoch, ts types.TipSetKey) ([]*Fault, error) + StateAllMinerFaults(ctx context.Context, lookback abi.ChainEpoch, ts types.TipSetKey) ([]*Fault, error) //perm:read // StateMinerRecoveries returns a bitfield indicating the recovering sectors of the given miner - StateMinerRecoveries(context.Context, address.Address, types.TipSetKey) (bitfield.BitField, error) + StateMinerRecoveries(context.Context, address.Address, types.TipSetKey) (bitfield.BitField, error) //perm:read // StateMinerInitialPledgeCollateral returns the precommit deposit for the specified miner's sector - StateMinerPreCommitDepositForPower(context.Context, address.Address, miner.SectorPreCommitInfo, types.TipSetKey) (types.BigInt, error) + StateMinerPreCommitDepositForPower(context.Context, address.Address, miner.SectorPreCommitInfo, types.TipSetKey) (types.BigInt, error) //perm:read // StateMinerInitialPledgeCollateral returns the initial pledge collateral for the specified miner's sector - StateMinerInitialPledgeCollateral(context.Context, address.Address, miner.SectorPreCommitInfo, types.TipSetKey) (types.BigInt, error) + StateMinerInitialPledgeCollateral(context.Context, address.Address, miner.SectorPreCommitInfo, types.TipSetKey) (types.BigInt, error) //perm:read // StateMinerAvailableBalance returns the portion of a miner's balance that can be withdrawn or spent - StateMinerAvailableBalance(context.Context, address.Address, types.TipSetKey) (types.BigInt, error) + StateMinerAvailableBalance(context.Context, address.Address, types.TipSetKey) (types.BigInt, error) //perm:read // StateMinerSectorAllocated checks if a sector is allocated - StateMinerSectorAllocated(context.Context, address.Address, abi.SectorNumber, types.TipSetKey) (bool, error) + StateMinerSectorAllocated(context.Context, address.Address, abi.SectorNumber, types.TipSetKey) (bool, error) //perm:read // StateSectorPreCommitInfo returns the PreCommit info for the specified miner's sector - StateSectorPreCommitInfo(context.Context, address.Address, abi.SectorNumber, types.TipSetKey) (miner.SectorPreCommitOnChainInfo, error) + StateSectorPreCommitInfo(context.Context, address.Address, abi.SectorNumber, types.TipSetKey) (miner.SectorPreCommitOnChainInfo, error) //perm:read // StateSectorGetInfo returns the on-chain info for the specified miner's sector. Returns null in case the sector info isn't found // NOTE: returned info.Expiration may not be accurate in some cases, use StateSectorExpiration to get accurate // expiration epoch - StateSectorGetInfo(context.Context, address.Address, abi.SectorNumber, types.TipSetKey) (*miner.SectorOnChainInfo, error) + StateSectorGetInfo(context.Context, address.Address, abi.SectorNumber, types.TipSetKey) (*miner.SectorOnChainInfo, error) //perm:read // StateSectorExpiration returns epoch at which given sector will expire - StateSectorExpiration(context.Context, address.Address, abi.SectorNumber, types.TipSetKey) (*miner.SectorExpiration, error) + StateSectorExpiration(context.Context, address.Address, abi.SectorNumber, types.TipSetKey) (*miner.SectorExpiration, error) //perm:read // StateSectorPartition finds deadline/partition with the specified sector - StateSectorPartition(ctx context.Context, maddr address.Address, sectorNumber abi.SectorNumber, tok types.TipSetKey) (*miner.SectorLocation, error) + StateSectorPartition(ctx context.Context, maddr address.Address, sectorNumber abi.SectorNumber, tok types.TipSetKey) (*miner.SectorLocation, error) //perm:read // StateSearchMsg searches for a message in the chain, and returns its receipt and the tipset where it was executed - StateSearchMsg(context.Context, cid.Cid) (*MsgLookup, error) + // + // NOTE: If a replacing message is found on chain, this method will return + // a MsgLookup for the replacing message - the MsgLookup.Message will be a different + // CID than the one provided in the 'cid' param, MsgLookup.Receipt will contain the + // result of the execution of the replacing message. + // + // If the caller wants to ensure that exactly the requested message was executed, + // they MUST check that MsgLookup.Message is equal to the provided 'cid'. + // Without this check both the requested and original message may appear as + // successfully executed on-chain, which may look like a double-spend. + // + // A replacing message is a message with a different CID, any of Gas values, and + // different signature, but with all other parameters matching (source/destination, + // nonce, params, etc.) + StateSearchMsg(context.Context, cid.Cid) (*MsgLookup, error) //perm:read // StateSearchMsgLimited looks back up to limit epochs in the chain for a message, and returns its receipt and the tipset where it was executed - StateSearchMsgLimited(ctx context.Context, msg cid.Cid, limit abi.ChainEpoch) (*MsgLookup, error) + // + // NOTE: If a replacing message is found on chain, this method will return + // a MsgLookup for the replacing message - the MsgLookup.Message will be a different + // CID than the one provided in the 'cid' param, MsgLookup.Receipt will contain the + // result of the execution of the replacing message. + // + // If the caller wants to ensure that exactly the requested message was executed, + // they MUST check that MsgLookup.Message is equal to the provided 'cid'. + // Without this check both the requested and original message may appear as + // successfully executed on-chain, which may look like a double-spend. + // + // A replacing message is a message with a different CID, any of Gas values, and + // different signature, but with all other parameters matching (source/destination, + // nonce, params, etc.) + StateSearchMsgLimited(ctx context.Context, msg cid.Cid, limit abi.ChainEpoch) (*MsgLookup, error) //perm:read // StateWaitMsg looks back in the chain for a message. If not found, it blocks until the // message arrives on chain, and gets to the indicated confidence depth. - StateWaitMsg(ctx context.Context, cid cid.Cid, confidence uint64) (*MsgLookup, error) + // + // NOTE: If a replacing message is found on chain, this method will return + // a MsgLookup for the replacing message - the MsgLookup.Message will be a different + // CID than the one provided in the 'cid' param, MsgLookup.Receipt will contain the + // result of the execution of the replacing message. + // + // If the caller wants to ensure that exactly the requested message was executed, + // they MUST check that MsgLookup.Message is equal to the provided 'cid'. + // Without this check both the requested and original message may appear as + // successfully executed on-chain, which may look like a double-spend. + // + // A replacing message is a message with a different CID, any of Gas values, and + // different signature, but with all other parameters matching (source/destination, + // nonce, params, etc.) + StateWaitMsg(ctx context.Context, cid cid.Cid, confidence uint64) (*MsgLookup, error) //perm:read // StateWaitMsgLimited looks back up to limit epochs in the chain for a message. // If not found, it blocks until the message arrives on chain, and gets to the // indicated confidence depth. - StateWaitMsgLimited(ctx context.Context, cid cid.Cid, confidence uint64, limit abi.ChainEpoch) (*MsgLookup, error) + // + // NOTE: If a replacing message is found on chain, this method will return + // a MsgLookup for the replacing message - the MsgLookup.Message will be a different + // CID than the one provided in the 'cid' param, MsgLookup.Receipt will contain the + // result of the execution of the replacing message. + // + // If the caller wants to ensure that exactly the requested message was executed, + // they MUST check that MsgLookup.Message is equal to the provided 'cid'. + // Without this check both the requested and original message may appear as + // successfully executed on-chain, which may look like a double-spend. + // + // A replacing message is a message with a different CID, any of Gas values, and + // different signature, but with all other parameters matching (source/destination, + // nonce, params, etc.) + StateWaitMsgLimited(ctx context.Context, cid cid.Cid, confidence uint64, limit abi.ChainEpoch) (*MsgLookup, error) //perm:read // StateListMiners returns the addresses of every miner that has claimed power in the Power Actor - StateListMiners(context.Context, types.TipSetKey) ([]address.Address, error) + StateListMiners(context.Context, types.TipSetKey) ([]address.Address, error) //perm:read // StateListActors returns the addresses of every actor in the state - StateListActors(context.Context, types.TipSetKey) ([]address.Address, error) + StateListActors(context.Context, types.TipSetKey) ([]address.Address, error) //perm:read // StateMarketBalance looks up the Escrow and Locked balances of the given address in the Storage Market - StateMarketBalance(context.Context, address.Address, types.TipSetKey) (MarketBalance, error) + StateMarketBalance(context.Context, address.Address, types.TipSetKey) (MarketBalance, error) //perm:read // StateMarketParticipants returns the Escrow and Locked balances of every participant in the Storage Market - StateMarketParticipants(context.Context, types.TipSetKey) (map[string]MarketBalance, error) + StateMarketParticipants(context.Context, types.TipSetKey) (map[string]MarketBalance, error) //perm:read // StateMarketDeals returns information about every deal in the Storage Market - StateMarketDeals(context.Context, types.TipSetKey) (map[string]MarketDeal, error) + StateMarketDeals(context.Context, types.TipSetKey) (map[string]MarketDeal, error) //perm:read // StateMarketStorageDeal returns information about the indicated deal - StateMarketStorageDeal(context.Context, abi.DealID, types.TipSetKey) (*MarketDeal, error) + StateMarketStorageDeal(context.Context, abi.DealID, types.TipSetKey) (*MarketDeal, error) //perm:read // StateLookupID retrieves the ID address of the given address - StateLookupID(context.Context, address.Address, types.TipSetKey) (address.Address, error) + StateLookupID(context.Context, address.Address, types.TipSetKey) (address.Address, error) //perm:read // StateAccountKey returns the public key address of the given ID address - StateAccountKey(context.Context, address.Address, types.TipSetKey) (address.Address, error) + StateAccountKey(context.Context, address.Address, types.TipSetKey) (address.Address, error) //perm:read // StateChangedActors returns all the actors whose states change between the two given state CIDs // TODO: Should this take tipset keys instead? - StateChangedActors(context.Context, cid.Cid, cid.Cid) (map[string]types.Actor, error) - // StateGetReceipt returns the message receipt for the given message - StateGetReceipt(context.Context, cid.Cid, types.TipSetKey) (*types.MessageReceipt, error) + StateChangedActors(context.Context, cid.Cid, cid.Cid) (map[string]types.Actor, error) //perm:read + // StateGetReceipt returns the message receipt for the given message or for a + // matching gas-repriced replacing message + // + // NOTE: If the requested message was replaced, this method will return the receipt + // for the replacing message - if the caller needs the receipt for exactly the + // requested message, use StateSearchMsg().Receipt, and check that MsgLookup.Message + // is matching the requested CID + // + // DEPRECATED: Use StateSearchMsg, this method won't be supported in v1 API + StateGetReceipt(context.Context, cid.Cid, types.TipSetKey) (*types.MessageReceipt, error) //perm:read // StateMinerSectorCount returns the number of sectors in a miner's sector set and proving set - StateMinerSectorCount(context.Context, address.Address, types.TipSetKey) (MinerSectors, error) + StateMinerSectorCount(context.Context, address.Address, types.TipSetKey) (MinerSectors, error) //perm:read // StateCompute is a flexible command that applies the given messages on the given tipset. // The messages are run as though the VM were at the provided height. - StateCompute(context.Context, abi.ChainEpoch, []*types.Message, types.TipSetKey) (*ComputeStateOutput, error) + // + // When called, StateCompute will: + // - Load the provided tipset, or use the current chain head if not provided + // - Compute the tipset state of the provided tipset on top of the parent state + // - (note that this step runs before vmheight is applied to the execution) + // - Execute state upgrade if any were scheduled at the epoch, or in null + // blocks preceding the tipset + // - Call the cron actor on null blocks preceding the tipset + // - For each block in the tipset + // - Apply messages in blocks in the specified + // - Award block reward by calling the reward actor + // - Call the cron actor for the current epoch + // - If the specified vmheight is higher than the current epoch, apply any + // needed state upgrades to the state + // - Apply the specified messages to the state + // + // The vmheight parameter sets VM execution epoch, and can be used to simulate + // message execution in different network versions. If the specified vmheight + // epoch is higher than the epoch of the specified tipset, any state upgrades + // until the vmheight will be executed on the state before applying messages + // specified by the user. + // + // Note that the initial tipset state computation is not affected by the + // vmheight parameter - only the messages in the `apply` set are + // + // If the caller wants to simply compute the state, vmheight should be set to + // the epoch of the specified tipset. + // + // Messages in the `apply` parameter must have the correct nonces, and gas + // values set. + StateCompute(context.Context, abi.ChainEpoch, []*types.Message, types.TipSetKey) (*ComputeStateOutput, error) //perm:read // StateVerifierStatus returns the data cap for the given address. // Returns nil if there is no entry in the data cap table for the // address. - StateVerifierStatus(ctx context.Context, addr address.Address, tsk types.TipSetKey) (*abi.StoragePower, error) + StateVerifierStatus(ctx context.Context, addr address.Address, tsk types.TipSetKey) (*abi.StoragePower, error) //perm:read // StateVerifiedClientStatus returns the data cap for the given address. // Returns nil if there is no entry in the data cap table for the // address. - StateVerifiedClientStatus(ctx context.Context, addr address.Address, tsk types.TipSetKey) (*abi.StoragePower, error) + StateVerifiedClientStatus(ctx context.Context, addr address.Address, tsk types.TipSetKey) (*abi.StoragePower, error) //perm:read // StateVerifiedClientStatus returns the address of the Verified Registry's root key - StateVerifiedRegistryRootKey(ctx context.Context, tsk types.TipSetKey) (address.Address, error) + StateVerifiedRegistryRootKey(ctx context.Context, tsk types.TipSetKey) (address.Address, error) //perm:read // StateDealProviderCollateralBounds returns the min and max collateral a storage provider // can issue. It takes the deal size and verified status as parameters. - StateDealProviderCollateralBounds(context.Context, abi.PaddedPieceSize, bool, types.TipSetKey) (DealCollateralBounds, error) + StateDealProviderCollateralBounds(context.Context, abi.PaddedPieceSize, bool, types.TipSetKey) (DealCollateralBounds, error) //perm:read // StateCirculatingSupply returns the exact circulating supply of Filecoin at the given tipset. // This is not used anywhere in the protocol itself, and is only for external consumption. - StateCirculatingSupply(context.Context, types.TipSetKey) (abi.TokenAmount, error) + StateCirculatingSupply(context.Context, types.TipSetKey) (abi.TokenAmount, error) //perm:read // StateVMCirculatingSupplyInternal returns an approximation of the circulating supply of Filecoin at the given tipset. // This is the value reported by the runtime interface to actors code. - StateVMCirculatingSupplyInternal(context.Context, types.TipSetKey) (CirculatingSupply, error) + StateVMCirculatingSupplyInternal(context.Context, types.TipSetKey) (CirculatingSupply, error) //perm:read // StateNetworkVersion returns the network version at the given tipset - StateNetworkVersion(context.Context, types.TipSetKey) (network.Version, error) + StateNetworkVersion(context.Context, types.TipSetKey) (apitypes.NetworkVersion, error) //perm:read // MethodGroup: Msig // The Msig methods are used to interact with multisig wallets on the // filecoin network // MsigGetAvailableBalance returns the portion of a multisig's balance that can be withdrawn or spent - MsigGetAvailableBalance(context.Context, address.Address, types.TipSetKey) (types.BigInt, error) + MsigGetAvailableBalance(context.Context, address.Address, types.TipSetKey) (types.BigInt, error) //perm:read // MsigGetVestingSchedule returns the vesting details of a given multisig. - MsigGetVestingSchedule(context.Context, address.Address, types.TipSetKey) (MsigVesting, error) + MsigGetVestingSchedule(context.Context, address.Address, types.TipSetKey) (MsigVesting, error) //perm:read // MsigGetVested returns the amount of FIL that vested in a multisig in a certain period. // It takes the following params: , , - MsigGetVested(context.Context, address.Address, types.TipSetKey, types.TipSetKey) (types.BigInt, error) + MsigGetVested(context.Context, address.Address, types.TipSetKey, types.TipSetKey) (types.BigInt, error) //perm:read //MsigGetPending returns pending transactions for the given multisig //wallet. Once pending transactions are fully approved, they will no longer //appear here. - MsigGetPending(context.Context, address.Address, types.TipSetKey) ([]*MsigTransaction, error) + MsigGetPending(context.Context, address.Address, types.TipSetKey) ([]*MsigTransaction, error) //perm:read // MsigCreate creates a multisig wallet // It takes the following params: , , //, , - MsigCreate(context.Context, uint64, []address.Address, abi.ChainEpoch, types.BigInt, address.Address, types.BigInt) (cid.Cid, error) + MsigCreate(context.Context, uint64, []address.Address, abi.ChainEpoch, types.BigInt, address.Address, types.BigInt) (cid.Cid, error) //perm:sign // MsigPropose proposes a multisig message // It takes the following params: , , , // , , - MsigPropose(context.Context, address.Address, address.Address, types.BigInt, address.Address, uint64, []byte) (cid.Cid, error) + MsigPropose(context.Context, address.Address, address.Address, types.BigInt, address.Address, uint64, []byte) (cid.Cid, error) //perm:sign // MsigApprove approves a previously-proposed multisig message by transaction ID // It takes the following params: , - MsigApprove(context.Context, address.Address, uint64, address.Address) (cid.Cid, error) + MsigApprove(context.Context, address.Address, uint64, address.Address) (cid.Cid, error) //perm:sign // MsigApproveTxnHash approves a previously-proposed multisig message, specified // using both transaction ID and a hash of the parameters used in the @@ -499,80 +622,80 @@ type FullNode interface { // exactly the transaction you think you are. // It takes the following params: , , , , , // , , - MsigApproveTxnHash(context.Context, address.Address, uint64, address.Address, address.Address, types.BigInt, address.Address, uint64, []byte) (cid.Cid, error) + MsigApproveTxnHash(context.Context, address.Address, uint64, address.Address, address.Address, types.BigInt, address.Address, uint64, []byte) (cid.Cid, error) //perm:sign // MsigCancel cancels a previously-proposed multisig message // It takes the following params: , , , , // , , - MsigCancel(context.Context, address.Address, uint64, address.Address, types.BigInt, address.Address, uint64, []byte) (cid.Cid, error) + MsigCancel(context.Context, address.Address, uint64, address.Address, types.BigInt, address.Address, uint64, []byte) (cid.Cid, error) //perm:sign // MsigAddPropose proposes adding a signer in the multisig // It takes the following params: , , // , - MsigAddPropose(context.Context, address.Address, address.Address, address.Address, bool) (cid.Cid, error) + MsigAddPropose(context.Context, address.Address, address.Address, address.Address, bool) (cid.Cid, error) //perm:sign // MsigAddApprove approves a previously proposed AddSigner message // It takes the following params: , , , // , , - MsigAddApprove(context.Context, address.Address, address.Address, uint64, address.Address, address.Address, bool) (cid.Cid, error) + MsigAddApprove(context.Context, address.Address, address.Address, uint64, address.Address, address.Address, bool) (cid.Cid, error) //perm:sign // MsigAddCancel cancels a previously proposed AddSigner message // It takes the following params: , , , // , - MsigAddCancel(context.Context, address.Address, address.Address, uint64, address.Address, bool) (cid.Cid, error) + MsigAddCancel(context.Context, address.Address, address.Address, uint64, address.Address, bool) (cid.Cid, error) //perm:sign // MsigSwapPropose proposes swapping 2 signers in the multisig // It takes the following params: , , // , - MsigSwapPropose(context.Context, address.Address, address.Address, address.Address, address.Address) (cid.Cid, error) + MsigSwapPropose(context.Context, address.Address, address.Address, address.Address, address.Address) (cid.Cid, error) //perm:sign // MsigSwapApprove approves a previously proposed SwapSigner // It takes the following params: , , , // , , - MsigSwapApprove(context.Context, address.Address, address.Address, uint64, address.Address, address.Address, address.Address) (cid.Cid, error) + MsigSwapApprove(context.Context, address.Address, address.Address, uint64, address.Address, address.Address, address.Address) (cid.Cid, error) //perm:sign // MsigSwapCancel cancels a previously proposed SwapSigner message // It takes the following params: , , , // , - MsigSwapCancel(context.Context, address.Address, address.Address, uint64, address.Address, address.Address) (cid.Cid, error) + MsigSwapCancel(context.Context, address.Address, address.Address, uint64, address.Address, address.Address) (cid.Cid, error) //perm:sign // MsigRemoveSigner proposes the removal of a signer from the multisig. // It accepts the multisig to make the change on, the proposer address to // send the message from, the address to be removed, and a boolean // indicating whether or not the signing threshold should be lowered by one // along with the address removal. - MsigRemoveSigner(ctx context.Context, msig address.Address, proposer address.Address, toRemove address.Address, decrease bool) (cid.Cid, error) + MsigRemoveSigner(ctx context.Context, msig address.Address, proposer address.Address, toRemove address.Address, decrease bool) (cid.Cid, error) //perm:sign // MarketAddBalance adds funds to the market actor - MarketAddBalance(ctx context.Context, wallet, addr address.Address, amt types.BigInt) (cid.Cid, error) + MarketAddBalance(ctx context.Context, wallet, addr address.Address, amt types.BigInt) (cid.Cid, error) //perm:sign // MarketGetReserved gets the amount of funds that are currently reserved for the address - MarketGetReserved(ctx context.Context, addr address.Address) (types.BigInt, error) + MarketGetReserved(ctx context.Context, addr address.Address) (types.BigInt, error) //perm:sign // MarketReserveFunds reserves funds for a deal - MarketReserveFunds(ctx context.Context, wallet address.Address, addr address.Address, amt types.BigInt) (cid.Cid, error) + MarketReserveFunds(ctx context.Context, wallet address.Address, addr address.Address, amt types.BigInt) (cid.Cid, error) //perm:sign // MarketReleaseFunds releases funds reserved by MarketReserveFunds - MarketReleaseFunds(ctx context.Context, addr address.Address, amt types.BigInt) error + MarketReleaseFunds(ctx context.Context, addr address.Address, amt types.BigInt) error //perm:sign // MarketWithdraw withdraws unlocked funds from the market actor - MarketWithdraw(ctx context.Context, wallet, addr address.Address, amt types.BigInt) (cid.Cid, error) + MarketWithdraw(ctx context.Context, wallet, addr address.Address, amt types.BigInt) (cid.Cid, error) //perm:sign // MethodGroup: Paych // The Paych methods are for interacting with and managing payment channels - PaychGet(ctx context.Context, from, to address.Address, amt types.BigInt) (*ChannelInfo, error) - PaychGetWaitReady(context.Context, cid.Cid) (address.Address, error) - PaychAvailableFunds(ctx context.Context, ch address.Address) (*ChannelAvailableFunds, error) - PaychAvailableFundsByFromTo(ctx context.Context, from, to address.Address) (*ChannelAvailableFunds, error) - PaychList(context.Context) ([]address.Address, error) - PaychStatus(context.Context, address.Address) (*PaychStatus, error) - PaychSettle(context.Context, address.Address) (cid.Cid, error) - PaychCollect(context.Context, address.Address) (cid.Cid, error) - PaychAllocateLane(ctx context.Context, ch address.Address) (uint64, error) - PaychNewPayment(ctx context.Context, from, to address.Address, vouchers []VoucherSpec) (*PaymentInfo, error) - PaychVoucherCheckValid(context.Context, address.Address, *paych.SignedVoucher) error - PaychVoucherCheckSpendable(context.Context, address.Address, *paych.SignedVoucher, []byte, []byte) (bool, error) - PaychVoucherCreate(context.Context, address.Address, types.BigInt, uint64) (*VoucherCreateResult, error) - PaychVoucherAdd(context.Context, address.Address, *paych.SignedVoucher, []byte, types.BigInt) (types.BigInt, error) - PaychVoucherList(context.Context, address.Address) ([]*paych.SignedVoucher, error) - PaychVoucherSubmit(context.Context, address.Address, *paych.SignedVoucher, []byte, []byte) (cid.Cid, error) + PaychGet(ctx context.Context, from, to address.Address, amt types.BigInt) (*ChannelInfo, error) //perm:sign + PaychGetWaitReady(context.Context, cid.Cid) (address.Address, error) //perm:sign + PaychAvailableFunds(ctx context.Context, ch address.Address) (*ChannelAvailableFunds, error) //perm:sign + PaychAvailableFundsByFromTo(ctx context.Context, from, to address.Address) (*ChannelAvailableFunds, error) //perm:sign + PaychList(context.Context) ([]address.Address, error) //perm:read + PaychStatus(context.Context, address.Address) (*PaychStatus, error) //perm:read + PaychSettle(context.Context, address.Address) (cid.Cid, error) //perm:sign + PaychCollect(context.Context, address.Address) (cid.Cid, error) //perm:sign + PaychAllocateLane(ctx context.Context, ch address.Address) (uint64, error) //perm:sign + PaychNewPayment(ctx context.Context, from, to address.Address, vouchers []VoucherSpec) (*PaymentInfo, error) //perm:sign + PaychVoucherCheckValid(context.Context, address.Address, *paych.SignedVoucher) error //perm:read + PaychVoucherCheckSpendable(context.Context, address.Address, *paych.SignedVoucher, []byte, []byte) (bool, error) //perm:read + PaychVoucherCreate(context.Context, address.Address, types.BigInt, uint64) (*VoucherCreateResult, error) //perm:sign + PaychVoucherAdd(context.Context, address.Address, *paych.SignedVoucher, []byte, types.BigInt) (types.BigInt, error) //perm:write + PaychVoucherList(context.Context, address.Address) ([]*paych.SignedVoucher, error) //perm:write + PaychVoucherSubmit(context.Context, address.Address, *paych.SignedVoucher, []byte, []byte) (cid.Cid, error) //perm:sign // CreateBackup creates node backup onder the specified file name. The // method requires that the lotus daemon is running with the // LOTUS_BACKUP_BASE_PATH environment variable set to some path, and that // the path specified when calling CreateBackup is within the base path - CreateBackup(ctx context.Context, fpath string) error + CreateBackup(ctx context.Context, fpath string) error //perm:admin } type FileRef struct { @@ -607,6 +730,7 @@ 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 @@ -762,7 +886,7 @@ func (o *QueryOffer) Order(client address.Address) RetrievalOrder { Client: client, Miner: o.Miner, - MinerPeer: o.MinerPeer, + MinerPeer: &o.MinerPeer, } } @@ -781,6 +905,8 @@ type RetrievalOrder struct { Root cid.Cid Piece *cid.Cid Size uint64 + + LocalStore *multistore.StoreID // if specified, get data from local store // TODO: support offset Total types.BigInt UnsealPrice types.BigInt @@ -788,7 +914,7 @@ type RetrievalOrder struct { PaymentIntervalIncrease uint64 Client address.Address Miner address.Address - MinerPeer retrievalmarket.RetrievalPeer + MinerPeer *retrievalmarket.RetrievalPeer } type InvocResult struct { diff --git a/api/api_gateway.go b/api/api_gateway.go index a53ac221a..b550bcbbc 100644 --- a/api/api_gateway.go +++ b/api/api_gateway.go @@ -8,13 +8,13 @@ import ( "github.com/filecoin-project/go-address" "github.com/filecoin-project/go-state-types/abi" "github.com/filecoin-project/go-state-types/dline" - "github.com/filecoin-project/go-state-types/network" + apitypes "github.com/filecoin-project/lotus/api/types" "github.com/filecoin-project/lotus/chain/actors/builtin/miner" "github.com/filecoin-project/lotus/chain/types" ) -type GatewayAPI interface { +type Gateway interface { ChainHasObj(context.Context, cid.Cid) (bool, error) ChainHead(ctx context.Context) (*types.TipSet, error) ChainGetBlockMessages(context.Context, cid.Cid) (*BlockMessages, error) @@ -39,7 +39,7 @@ type GatewayAPI interface { StateMinerInfo(ctx context.Context, actor address.Address, tsk types.TipSetKey) (miner.MinerInfo, error) StateMinerProvingDeadline(ctx context.Context, addr address.Address, tsk types.TipSetKey) (*dline.Info, error) StateMinerPower(context.Context, address.Address, types.TipSetKey) (*MinerPower, error) - StateNetworkVersion(context.Context, types.TipSetKey) (network.Version, error) + StateNetworkVersion(context.Context, types.TipSetKey) (apitypes.NetworkVersion, error) StateSearchMsg(ctx context.Context, msg cid.Cid) (*MsgLookup, error) StateSectorGetInfo(ctx context.Context, maddr address.Address, n abi.SectorNumber, tsk types.TipSetKey) (*miner.SectorOnChainInfo, error) StateVerifiedClientStatus(ctx context.Context, addr address.Address, tsk types.TipSetKey) (*abi.StoragePower, error) diff --git a/api/api_storage.go b/api/api_storage.go index a153875f0..9662e8cd8 100644 --- a/api/api_storage.go +++ b/api/api_storage.go @@ -5,6 +5,8 @@ import ( "context" "time" + "github.com/filecoin-project/lotus/chain/actors/builtin" + "github.com/google/uuid" "github.com/ipfs/go-cid" "github.com/libp2p/go-libp2p-core/peer" @@ -28,124 +30,150 @@ import ( type StorageMiner interface { Common - ActorAddress(context.Context) (address.Address, error) + ActorAddress(context.Context) (address.Address, error) //perm:read - ActorSectorSize(context.Context, address.Address) (abi.SectorSize, error) - ActorAddressConfig(ctx context.Context) (AddressConfig, error) + ActorSectorSize(context.Context, address.Address) (abi.SectorSize, error) //perm:read + ActorAddressConfig(ctx context.Context) (AddressConfig, error) //perm:read - MiningBase(context.Context) (*types.TipSet, error) + MiningBase(context.Context) (*types.TipSet, error) //perm:read // Temp api for testing - PledgeSector(context.Context) (abi.SectorID, error) + PledgeSector(context.Context) (abi.SectorID, error) //perm:write // Get the status of a given sector by ID - SectorsStatus(ctx context.Context, sid abi.SectorNumber, showOnChainInfo bool) (SectorInfo, error) + SectorsStatus(ctx context.Context, sid abi.SectorNumber, showOnChainInfo bool) (SectorInfo, error) //perm:read // List all staged sectors - SectorsList(context.Context) ([]abi.SectorNumber, error) + SectorsList(context.Context) ([]abi.SectorNumber, error) //perm:read // Get summary info of sectors - SectorsSummary(ctx context.Context) (map[SectorState]int, error) + SectorsSummary(ctx context.Context) (map[SectorState]int, error) //perm:read // List sectors in particular states - SectorsListInStates(context.Context, []SectorState) ([]abi.SectorNumber, error) + SectorsListInStates(context.Context, []SectorState) ([]abi.SectorNumber, error) //perm:read - SectorsRefs(context.Context) (map[string][]SealedRef, error) + SectorsRefs(context.Context) (map[string][]SealedRef, error) //perm:read // SectorStartSealing can be called on sectors in Empty or WaitDeals states // to trigger sealing early - SectorStartSealing(context.Context, abi.SectorNumber) error + SectorStartSealing(context.Context, abi.SectorNumber) error //perm:write // SectorSetSealDelay sets the time that a newly-created sector // waits for more deals before it starts sealing - SectorSetSealDelay(context.Context, time.Duration) error + SectorSetSealDelay(context.Context, time.Duration) error //perm:write // SectorGetSealDelay gets the time that a newly-created sector // waits for more deals before it starts sealing - SectorGetSealDelay(context.Context) (time.Duration, error) + SectorGetSealDelay(context.Context) (time.Duration, error) //perm:read // SectorSetExpectedSealDuration sets the expected time for a sector to seal - SectorSetExpectedSealDuration(context.Context, time.Duration) error + SectorSetExpectedSealDuration(context.Context, time.Duration) error //perm:write // SectorGetExpectedSealDuration gets the expected time for a sector to seal - SectorGetExpectedSealDuration(context.Context) (time.Duration, error) - SectorsUpdate(context.Context, abi.SectorNumber, SectorState) error + SectorGetExpectedSealDuration(context.Context) (time.Duration, error) //perm:read + SectorsUpdate(context.Context, abi.SectorNumber, SectorState) error //perm:admin // SectorRemove removes the sector from storage. It doesn't terminate it on-chain, which can // be done with SectorTerminate. Removing and not terminating live sectors will cause additional penalties. - SectorRemove(context.Context, abi.SectorNumber) error + SectorRemove(context.Context, abi.SectorNumber) error //perm:admin // SectorTerminate terminates the sector on-chain (adding it to a termination batch first), then // automatically removes it from storage - SectorTerminate(context.Context, abi.SectorNumber) error + SectorTerminate(context.Context, abi.SectorNumber) error //perm:admin // SectorTerminateFlush immediately sends a terminate message with sectors batched for termination. // Returns null if message wasn't sent - SectorTerminateFlush(ctx context.Context) (*cid.Cid, error) + SectorTerminateFlush(ctx context.Context) (*cid.Cid, error) //perm:admin // SectorTerminatePending returns a list of pending sector terminations to be sent in the next batch message - SectorTerminatePending(ctx context.Context) ([]abi.SectorID, error) - SectorMarkForUpgrade(ctx context.Context, id abi.SectorNumber) error - - StorageList(ctx context.Context) (map[stores.ID][]stores.Decl, error) - StorageLocal(ctx context.Context) (map[stores.ID]string, error) - StorageStat(ctx context.Context, id stores.ID) (fsutil.FsStat, error) + SectorTerminatePending(ctx context.Context) ([]abi.SectorID, error) //perm:admin + SectorMarkForUpgrade(ctx context.Context, id abi.SectorNumber) error //perm:admin // WorkerConnect tells the node to connect to workers RPC - WorkerConnect(context.Context, string) error - WorkerStats(context.Context) (map[uuid.UUID]storiface.WorkerStats, error) - WorkerJobs(context.Context) (map[uuid.UUID][]storiface.WorkerJob, error) - storiface.WorkerReturn + WorkerConnect(context.Context, string) error //perm:admin retry:true + WorkerStats(context.Context) (map[uuid.UUID]storiface.WorkerStats, error) //perm:admin + WorkerJobs(context.Context) (map[uuid.UUID][]storiface.WorkerJob, error) //perm:admin + + //storiface.WorkerReturn + ReturnAddPiece(ctx context.Context, callID storiface.CallID, pi abi.PieceInfo, err *storiface.CallError) error //perm:admin retry:true + ReturnSealPreCommit1(ctx context.Context, callID storiface.CallID, p1o storage.PreCommit1Out, err *storiface.CallError) error //perm:admin retry:true + ReturnSealPreCommit2(ctx context.Context, callID storiface.CallID, sealed storage.SectorCids, err *storiface.CallError) error //perm:admin retry:true + ReturnSealCommit1(ctx context.Context, callID storiface.CallID, out storage.Commit1Out, err *storiface.CallError) error //perm:admin retry:true + ReturnSealCommit2(ctx context.Context, callID storiface.CallID, proof storage.Proof, err *storiface.CallError) error //perm:admin retry:true + ReturnFinalizeSector(ctx context.Context, callID storiface.CallID, err *storiface.CallError) error //perm:admin retry:true + ReturnReleaseUnsealed(ctx context.Context, callID storiface.CallID, err *storiface.CallError) error //perm:admin retry:true + ReturnMoveStorage(ctx context.Context, callID storiface.CallID, err *storiface.CallError) error //perm:admin retry:true + ReturnUnsealPiece(ctx context.Context, callID storiface.CallID, err *storiface.CallError) error //perm:admin retry:true + ReturnReadPiece(ctx context.Context, callID storiface.CallID, ok bool, err *storiface.CallError) error //perm:admin retry:true + ReturnFetch(ctx context.Context, callID storiface.CallID, err *storiface.CallError) error //perm:admin retry:true // SealingSchedDiag dumps internal sealing scheduler state - SealingSchedDiag(ctx context.Context, doSched bool) (interface{}, error) - SealingAbort(ctx context.Context, call storiface.CallID) error + SealingSchedDiag(ctx context.Context, doSched bool) (interface{}, error) //perm:admin + SealingAbort(ctx context.Context, call storiface.CallID) error //perm:admin - stores.SectorIndex + //stores.SectorIndex + StorageAttach(context.Context, stores.StorageInfo, fsutil.FsStat) error //perm:admin + StorageInfo(context.Context, stores.ID) (stores.StorageInfo, error) //perm:admin + StorageReportHealth(context.Context, stores.ID, stores.HealthReport) error //perm:admin + StorageDeclareSector(ctx context.Context, storageID stores.ID, s abi.SectorID, ft storiface.SectorFileType, primary bool) error //perm:admin + StorageDropSector(ctx context.Context, storageID stores.ID, s abi.SectorID, ft storiface.SectorFileType) error //perm:admin + StorageFindSector(ctx context.Context, sector abi.SectorID, ft storiface.SectorFileType, ssize abi.SectorSize, allowFetch bool) ([]stores.SectorStorageInfo, error) //perm:admin + StorageBestAlloc(ctx context.Context, allocate storiface.SectorFileType, ssize abi.SectorSize, pathType storiface.PathType) ([]stores.StorageInfo, error) //perm:admin + StorageLock(ctx context.Context, sector abi.SectorID, read storiface.SectorFileType, write storiface.SectorFileType) error //perm:admin + StorageTryLock(ctx context.Context, sector abi.SectorID, read storiface.SectorFileType, write storiface.SectorFileType) (bool, error) //perm:admin - MarketImportDealData(ctx context.Context, propcid cid.Cid, path string) error - MarketListDeals(ctx context.Context) ([]MarketDeal, error) - MarketListRetrievalDeals(ctx context.Context) ([]retrievalmarket.ProviderDealState, error) - MarketGetDealUpdates(ctx context.Context) (<-chan storagemarket.MinerDeal, error) - MarketListIncompleteDeals(ctx context.Context) ([]storagemarket.MinerDeal, error) - MarketSetAsk(ctx context.Context, price types.BigInt, verifiedPrice types.BigInt, duration abi.ChainEpoch, minPieceSize abi.PaddedPieceSize, maxPieceSize abi.PaddedPieceSize) error - MarketGetAsk(ctx context.Context) (*storagemarket.SignedStorageAsk, error) - MarketSetRetrievalAsk(ctx context.Context, rask *retrievalmarket.Ask) error - MarketGetRetrievalAsk(ctx context.Context) (*retrievalmarket.Ask, error) - MarketListDataTransfers(ctx context.Context) ([]DataTransferChannel, error) - MarketDataTransferUpdates(ctx context.Context) (<-chan DataTransferChannel, error) + StorageList(ctx context.Context) (map[stores.ID][]stores.Decl, error) //perm:admin + StorageLocal(ctx context.Context) (map[stores.ID]string, error) //perm:admin + StorageStat(ctx context.Context, id stores.ID) (fsutil.FsStat, error) //perm:admin + + MarketImportDealData(ctx context.Context, propcid cid.Cid, path string) error //perm:write + MarketListDeals(ctx context.Context) ([]MarketDeal, error) //perm:read + MarketListRetrievalDeals(ctx context.Context) ([]retrievalmarket.ProviderDealState, 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 // 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 + 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 - MarketPendingDeals(ctx context.Context) (PendingDealInfo, error) - MarketPublishPendingDeals(ctx context.Context) error + 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 - DealsImportData(ctx context.Context, dealPropCid cid.Cid, file string) error - DealsList(ctx context.Context) ([]MarketDeal, error) - DealsConsiderOnlineStorageDeals(context.Context) (bool, error) - DealsSetConsiderOnlineStorageDeals(context.Context, bool) error - DealsConsiderOnlineRetrievalDeals(context.Context) (bool, error) - DealsSetConsiderOnlineRetrievalDeals(context.Context, bool) error - DealsPieceCidBlocklist(context.Context) ([]cid.Cid, error) - DealsSetPieceCidBlocklist(context.Context, []cid.Cid) error - DealsConsiderOfflineStorageDeals(context.Context) (bool, error) - DealsSetConsiderOfflineStorageDeals(context.Context, bool) error - DealsConsiderOfflineRetrievalDeals(context.Context) (bool, error) - DealsSetConsiderOfflineRetrievalDeals(context.Context, bool) error - DealsConsiderVerifiedStorageDeals(context.Context) (bool, error) - DealsSetConsiderVerifiedStorageDeals(context.Context, bool) error - DealsConsiderUnverifiedStorageDeals(context.Context) (bool, error) - DealsSetConsiderUnverifiedStorageDeals(context.Context, bool) error + 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 - StorageAddLocal(ctx context.Context, path string) error + StorageAddLocal(ctx context.Context, path string) error //perm:admin - PiecesListPieces(ctx context.Context) ([]cid.Cid, error) - PiecesListCidInfos(ctx context.Context) ([]cid.Cid, error) - PiecesGetPieceInfo(ctx context.Context, pieceCid cid.Cid) (*piecestore.PieceInfo, error) - PiecesGetCIDInfo(ctx context.Context, payloadCid cid.Cid) (*piecestore.CIDInfo, error) + 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 // CreateBackup creates node backup onder the specified file name. The // method requires that the lotus-miner is running with the // LOTUS_BACKUP_BASE_PATH environment variable set to some path, and that // the path specified when calling CreateBackup is within the base path - CreateBackup(ctx context.Context, fpath string) error + CreateBackup(ctx context.Context, fpath string) error //perm:admin - CheckProvable(ctx context.Context, pp abi.RegisteredPoStProof, sectors []storage.SectorRef, expensive bool) (map[abi.SectorNumber]string, error) + CheckProvable(ctx context.Context, pp abi.RegisteredPoStProof, sectors []storage.SectorRef, expensive bool) (map[abi.SectorNumber]string, error) //perm:admin + + ComputeProof(ctx context.Context, ssi []builtin.SectorInfo, rand abi.PoStRandomness) ([]builtin.PoStProof, error) //perm:read } +var _ storiface.WorkerReturn = *new(StorageMiner) +var _ stores.SectorIndex = *new(StorageMiner) + type SealRes struct { Err string GoErr error `json:"-"` diff --git a/api/api_test.go b/api/api_test.go index 34c47f432..70d918b5c 100644 --- a/api/api_test.go +++ b/api/api_test.go @@ -37,6 +37,18 @@ func TestDoesntDependOnFFI(t *testing.T) { } } +func TestDoesntDependOnBuild(t *testing.T) { + deps, err := exec.Command(goCmd(), "list", "-deps", "github.com/filecoin-project/lotus/api").Output() + if err != nil { + t.Fatal(err) + } + for _, pkg := range strings.Fields(string(deps)) { + if pkg == "github.com/filecoin-project/build" { + t.Fatal("api depends on filecoin-ffi") + } + } +} + func TestReturnTypes(t *testing.T) { errType := reflect.TypeOf(new(error)).Elem() bareIface := reflect.TypeOf(new(interface{})).Elem() @@ -99,5 +111,5 @@ func TestReturnTypes(t *testing.T) { t.Run("common", tst(new(Common))) t.Run("full", tst(new(FullNode))) t.Run("miner", tst(new(StorageMiner))) - t.Run("worker", tst(new(WorkerAPI))) + t.Run("worker", tst(new(Worker))) } diff --git a/api/api_wallet.go b/api/api_wallet.go index 88ad8f43a..891b2fabb 100644 --- a/api/api_wallet.go +++ b/api/api_wallet.go @@ -34,7 +34,7 @@ type MsgMeta struct { Extra []byte } -type WalletAPI interface { +type Wallet interface { WalletNew(context.Context, types.KeyType) (address.Address, error) WalletHas(context.Context, address.Address) (bool, error) WalletList(context.Context) ([]address.Address, error) diff --git a/api/api_worker.go b/api/api_worker.go index 999c42680..3232de449 100644 --- a/api/api_worker.go +++ b/api/api_worker.go @@ -2,46 +2,62 @@ package api import ( "context" + "io" "github.com/google/uuid" + "github.com/ipfs/go-cid" "github.com/filecoin-project/go-state-types/abi" "github.com/filecoin-project/lotus/extern/sector-storage/sealtasks" "github.com/filecoin-project/lotus/extern/sector-storage/stores" "github.com/filecoin-project/lotus/extern/sector-storage/storiface" + "github.com/filecoin-project/specs-storage/storage" ) -type WorkerAPI interface { - Version(context.Context) (Version, error) - // TODO: Info() (name, ...) ? +type Worker interface { + Version(context.Context) (Version, error) //perm:admin - TaskTypes(context.Context) (map[sealtasks.TaskType]struct{}, error) // TaskType -> Weight - Paths(context.Context) ([]stores.StoragePath, error) - Info(context.Context) (storiface.WorkerInfo, error) + // TaskType -> Weight + TaskTypes(context.Context) (map[sealtasks.TaskType]struct{}, error) //perm:admin + Paths(context.Context) ([]stores.StoragePath, error) //perm:admin + Info(context.Context) (storiface.WorkerInfo, error) //perm:admin - storiface.WorkerCalls + // storiface.WorkerCalls + AddPiece(ctx context.Context, sector storage.SectorRef, pieceSizes []abi.UnpaddedPieceSize, newPieceSize abi.UnpaddedPieceSize, pieceData storage.Data) (storiface.CallID, error) //perm:admin + SealPreCommit1(ctx context.Context, sector storage.SectorRef, ticket abi.SealRandomness, pieces []abi.PieceInfo) (storiface.CallID, error) //perm:admin + SealPreCommit2(ctx context.Context, sector storage.SectorRef, pc1o storage.PreCommit1Out) (storiface.CallID, error) //perm:admin + SealCommit1(ctx context.Context, sector storage.SectorRef, ticket abi.SealRandomness, seed abi.InteractiveSealRandomness, pieces []abi.PieceInfo, cids storage.SectorCids) (storiface.CallID, error) //perm:admin + SealCommit2(ctx context.Context, sector storage.SectorRef, c1o storage.Commit1Out) (storiface.CallID, error) //perm:admin + FinalizeSector(ctx context.Context, sector storage.SectorRef, keepUnsealed []storage.Range) (storiface.CallID, error) //perm:admin + ReleaseUnsealed(ctx context.Context, sector storage.SectorRef, safeToFree []storage.Range) (storiface.CallID, error) //perm:admin + MoveStorage(ctx context.Context, sector storage.SectorRef, types storiface.SectorFileType) (storiface.CallID, error) //perm:admin + UnsealPiece(context.Context, storage.SectorRef, storiface.UnpaddedByteIndex, abi.UnpaddedPieceSize, abi.SealRandomness, cid.Cid) (storiface.CallID, error) //perm:admin + ReadPiece(context.Context, io.Writer, storage.SectorRef, storiface.UnpaddedByteIndex, abi.UnpaddedPieceSize) (storiface.CallID, error) //perm:admin + Fetch(context.Context, storage.SectorRef, storiface.SectorFileType, storiface.PathType, storiface.AcquireMode) (storiface.CallID, error) //perm:admin - TaskDisable(ctx context.Context, tt sealtasks.TaskType) error - TaskEnable(ctx context.Context, tt sealtasks.TaskType) error + TaskDisable(ctx context.Context, tt sealtasks.TaskType) error //perm:admin + TaskEnable(ctx context.Context, tt sealtasks.TaskType) error //perm:admin // Storage / Other - Remove(ctx context.Context, sector abi.SectorID) error + Remove(ctx context.Context, sector abi.SectorID) error //perm:admin - StorageAddLocal(ctx context.Context, path string) error + StorageAddLocal(ctx context.Context, path string) error //perm:admin // SetEnabled marks the worker as enabled/disabled. Not that this setting // may take a few seconds to propagate to task scheduler - SetEnabled(ctx context.Context, enabled bool) error + SetEnabled(ctx context.Context, enabled bool) error //perm:admin - Enabled(ctx context.Context) (bool, error) + Enabled(ctx context.Context) (bool, error) //perm:admin // WaitQuiet blocks until there are no tasks running - WaitQuiet(ctx context.Context) error + WaitQuiet(ctx context.Context) error //perm:admin // returns a random UUID of worker session, generated randomly when worker // process starts - ProcessSession(context.Context) (uuid.UUID, error) + ProcessSession(context.Context) (uuid.UUID, error) //perm:admin // Like ProcessSession, but returns an error when worker is disabled - Session(context.Context) (uuid.UUID, error) + Session(context.Context) (uuid.UUID, error) //perm:admin } + +var _ storiface.WorkerCalls = *new(Worker) diff --git a/api/apistruct/permissioned.go b/api/apistruct/permissioned.go index 86902d31b..23259fa87 100644 --- a/api/apistruct/permissioned.go +++ b/api/apistruct/permissioned.go @@ -31,13 +31,13 @@ func PermissionedFullAPI(a api.FullNode) api.FullNode { return &out } -func PermissionedWorkerAPI(a api.WorkerAPI) api.WorkerAPI { +func PermissionedWorkerAPI(a api.Worker) api.Worker { var out WorkerStruct auth.PermissionedProxy(AllPermissions, DefaultPerms, a, &out.Internal) return &out } -func PermissionedWalletAPI(a api.WalletAPI) api.WalletAPI { +func PermissionedWalletAPI(a api.Wallet) api.Wallet { var out WalletStruct auth.PermissionedProxy(AllPermissions, DefaultPerms, a, &out.Internal) return &out diff --git a/api/apistruct/struct.go b/api/apistruct/struct.go index fb08c24ee..ba1c7fe17 100644 --- a/api/apistruct/struct.go +++ b/api/apistruct/struct.go @@ -1,3 +1,5 @@ +// Code generated by github.com/filecoin-project/lotus/gen/api. DO NOT EDIT. + package apistruct import ( @@ -5,13 +7,6 @@ import ( "io" "time" - "github.com/google/uuid" - "github.com/ipfs/go-cid" - metrics "github.com/libp2p/go-libp2p-core/metrics" - "github.com/libp2p/go-libp2p-core/network" - "github.com/libp2p/go-libp2p-core/peer" - protocol "github.com/libp2p/go-libp2p-core/protocol" - "github.com/filecoin-project/go-address" "github.com/filecoin-project/go-bitfield" datatransfer "github.com/filecoin-project/go-data-transfer" @@ -21,1851 +16,2176 @@ import ( "github.com/filecoin-project/go-jsonrpc/auth" "github.com/filecoin-project/go-multistore" "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/go-state-types/dline" - stnetwork "github.com/filecoin-project/go-state-types/network" + "github.com/filecoin-project/lotus/api" + apitypes "github.com/filecoin-project/lotus/api/types" + "github.com/filecoin-project/lotus/chain/actors/builtin" + "github.com/filecoin-project/lotus/chain/actors/builtin/miner" + "github.com/filecoin-project/lotus/chain/actors/builtin/paych" + "github.com/filecoin-project/lotus/chain/types" "github.com/filecoin-project/lotus/extern/sector-storage/fsutil" "github.com/filecoin-project/lotus/extern/sector-storage/sealtasks" "github.com/filecoin-project/lotus/extern/sector-storage/stores" "github.com/filecoin-project/lotus/extern/sector-storage/storiface" marketevents "github.com/filecoin-project/lotus/markets/loggers" - "github.com/filecoin-project/specs-storage/storage" - - "github.com/filecoin-project/lotus/api" - "github.com/filecoin-project/lotus/chain/actors/builtin/miner" - "github.com/filecoin-project/lotus/chain/actors/builtin/paych" - "github.com/filecoin-project/lotus/chain/types" "github.com/filecoin-project/lotus/node/modules/dtypes" + "github.com/filecoin-project/specs-storage/storage" + "github.com/google/uuid" + "github.com/ipfs/go-cid" + "github.com/libp2p/go-libp2p-core/metrics" + "github.com/libp2p/go-libp2p-core/network" + "github.com/libp2p/go-libp2p-core/peer" + "github.com/libp2p/go-libp2p-core/protocol" ) -// All permissions are listed in permissioned.go -var _ = AllPermissions - -type CommonStruct struct { +type ChainIOStruct struct { Internal struct { - AuthVerify func(ctx context.Context, token string) ([]auth.Permission, error) `perm:"read"` - AuthNew func(ctx context.Context, perms []auth.Permission) ([]byte, error) `perm:"admin"` + ChainHasObj func(p0 context.Context, p1 cid.Cid) (bool, error) `` - NetConnectedness func(context.Context, peer.ID) (network.Connectedness, error) `perm:"read"` - NetPeers func(context.Context) ([]peer.AddrInfo, error) `perm:"read"` - NetConnect func(context.Context, peer.AddrInfo) error `perm:"write"` - NetAddrsListen func(context.Context) (peer.AddrInfo, error) `perm:"read"` - NetDisconnect func(context.Context, peer.ID) error `perm:"write"` - NetFindPeer func(context.Context, peer.ID) (peer.AddrInfo, error) `perm:"read"` - NetPubsubScores func(context.Context) ([]api.PubsubScore, error) `perm:"read"` - NetAutoNatStatus func(context.Context) (api.NatInfo, error) `perm:"read"` - NetBandwidthStats func(ctx context.Context) (metrics.Stats, error) `perm:"read"` - NetBandwidthStatsByPeer func(ctx context.Context) (map[string]metrics.Stats, error) `perm:"read"` - NetBandwidthStatsByProtocol func(ctx context.Context) (map[protocol.ID]metrics.Stats, error) `perm:"read"` - NetAgentVersion func(ctx context.Context, p peer.ID) (string, error) `perm:"read"` - NetPeerInfo func(context.Context, peer.ID) (*api.ExtendedPeerInfo, error) `perm:"read"` - NetBlockAdd func(ctx context.Context, acl api.NetBlockList) error `perm:"admin"` - NetBlockRemove func(ctx context.Context, acl api.NetBlockList) error `perm:"admin"` - NetBlockList func(ctx context.Context) (api.NetBlockList, error) `perm:"read"` - - ID func(context.Context) (peer.ID, error) `perm:"read"` - Version func(context.Context) (api.APIVersion, error) `perm:"read"` - - LogList func(context.Context) ([]string, error) `perm:"write"` - LogSetLevel func(context.Context, string, string) error `perm:"write"` - - Shutdown func(context.Context) error `perm:"admin"` - Session func(context.Context) (uuid.UUID, error) `perm:"read"` - Closing func(context.Context) (<-chan struct{}, error) `perm:"read"` + ChainReadObj func(p0 context.Context, p1 cid.Cid) ([]byte, error) `` + } +} + +type CommonStruct struct { + Internal struct { + AuthNew func(p0 context.Context, p1 []auth.Permission) ([]byte, error) `perm:"admin"` + + AuthVerify func(p0 context.Context, p1 string) ([]auth.Permission, error) `perm:"read"` + + Closing func(p0 context.Context) (<-chan struct{}, error) `perm:"read"` + + Discover func(p0 context.Context) (apitypes.OpenRPCDocument, error) `perm:"read"` + + ID func(p0 context.Context) (peer.ID, error) `perm:"read"` + + LogList func(p0 context.Context) ([]string, error) `perm:"write"` + + LogSetLevel func(p0 context.Context, p1 string, p2 string) error `perm:"write"` + + NetAddrsListen func(p0 context.Context) (peer.AddrInfo, error) `perm:"read"` + + NetAgentVersion func(p0 context.Context, p1 peer.ID) (string, error) `perm:"read"` + + NetAutoNatStatus func(p0 context.Context) (api.NatInfo, error) `perm:"read"` + + NetBandwidthStats func(p0 context.Context) (metrics.Stats, error) `perm:"read"` + + NetBandwidthStatsByPeer func(p0 context.Context) (map[string]metrics.Stats, error) `perm:"read"` + + NetBandwidthStatsByProtocol func(p0 context.Context) (map[protocol.ID]metrics.Stats, error) `perm:"read"` + + NetBlockAdd func(p0 context.Context, p1 api.NetBlockList) error `perm:"admin"` + + NetBlockList func(p0 context.Context) (api.NetBlockList, error) `perm:"read"` + + NetBlockRemove func(p0 context.Context, p1 api.NetBlockList) error `perm:"admin"` + + NetConnect func(p0 context.Context, p1 peer.AddrInfo) error `perm:"write"` + + NetConnectedness func(p0 context.Context, p1 peer.ID) (network.Connectedness, error) `perm:"read"` + + NetDisconnect func(p0 context.Context, p1 peer.ID) error `perm:"write"` + + NetFindPeer func(p0 context.Context, p1 peer.ID) (peer.AddrInfo, error) `perm:"read"` + + NetPeerInfo func(p0 context.Context, p1 peer.ID) (*api.ExtendedPeerInfo, error) `perm:"read"` + + NetPeers func(p0 context.Context) ([]peer.AddrInfo, error) `perm:"read"` + + NetPubsubScores func(p0 context.Context) ([]api.PubsubScore, error) `perm:"read"` + + Session func(p0 context.Context) (uuid.UUID, error) `perm:"read"` + + Shutdown func(p0 context.Context) error `perm:"admin"` + + Version func(p0 context.Context) (api.APIVersion, error) `perm:"read"` } } -// FullNodeStruct implements API passing calls to user-provided function values. type FullNodeStruct struct { CommonStruct Internal struct { - ChainNotify func(context.Context) (<-chan []*api.HeadChange, error) `perm:"read"` - ChainHead func(context.Context) (*types.TipSet, error) `perm:"read"` - ChainGetRandomnessFromTickets func(context.Context, types.TipSetKey, crypto.DomainSeparationTag, abi.ChainEpoch, []byte) (abi.Randomness, error) `perm:"read"` - ChainGetRandomnessFromBeacon func(context.Context, types.TipSetKey, crypto.DomainSeparationTag, abi.ChainEpoch, []byte) (abi.Randomness, error) `perm:"read"` - ChainGetBlock func(context.Context, cid.Cid) (*types.BlockHeader, error) `perm:"read"` - ChainGetTipSet func(context.Context, types.TipSetKey) (*types.TipSet, error) `perm:"read"` - ChainGetBlockMessages func(context.Context, cid.Cid) (*api.BlockMessages, error) `perm:"read"` - ChainGetParentReceipts func(context.Context, cid.Cid) ([]*types.MessageReceipt, error) `perm:"read"` - ChainGetParentMessages func(context.Context, cid.Cid) ([]api.Message, error) `perm:"read"` - ChainGetTipSetByHeight func(context.Context, abi.ChainEpoch, types.TipSetKey) (*types.TipSet, error) `perm:"read"` - ChainReadObj func(context.Context, cid.Cid) ([]byte, error) `perm:"read"` - ChainDeleteObj func(context.Context, cid.Cid) error `perm:"admin"` - ChainHasObj func(context.Context, cid.Cid) (bool, error) `perm:"read"` - ChainStatObj func(context.Context, cid.Cid, cid.Cid) (api.ObjStat, error) `perm:"read"` - ChainSetHead func(context.Context, types.TipSetKey) error `perm:"admin"` - ChainGetGenesis func(context.Context) (*types.TipSet, error) `perm:"read"` - ChainTipSetWeight func(context.Context, types.TipSetKey) (types.BigInt, error) `perm:"read"` - ChainGetNode func(ctx context.Context, p string) (*api.IpldObject, error) `perm:"read"` - ChainGetMessage func(context.Context, cid.Cid) (*types.Message, error) `perm:"read"` - ChainGetPath func(context.Context, types.TipSetKey, types.TipSetKey) ([]*api.HeadChange, error) `perm:"read"` - ChainExport func(context.Context, abi.ChainEpoch, bool, types.TipSetKey) (<-chan []byte, error) `perm:"read"` + BeaconGetEntry func(p0 context.Context, p1 abi.ChainEpoch) (*types.BeaconEntry, error) `perm:"read"` - BeaconGetEntry func(ctx context.Context, epoch abi.ChainEpoch) (*types.BeaconEntry, error) `perm:"read"` + ChainDeleteObj func(p0 context.Context, p1 cid.Cid) error `perm:"admin"` - GasEstimateGasPremium func(context.Context, uint64, address.Address, int64, types.TipSetKey) (types.BigInt, error) `perm:"read"` - GasEstimateGasLimit func(context.Context, *types.Message, types.TipSetKey) (int64, error) `perm:"read"` - GasEstimateFeeCap func(context.Context, *types.Message, int64, types.TipSetKey) (types.BigInt, error) `perm:"read"` - GasEstimateMessageGas func(context.Context, *types.Message, *api.MessageSendSpec, types.TipSetKey) (*types.Message, error) `perm:"read"` + ChainExport func(p0 context.Context, p1 abi.ChainEpoch, p2 bool, p3 types.TipSetKey) (<-chan []byte, error) `perm:"read"` - SyncState func(context.Context) (*api.SyncState, error) `perm:"read"` - SyncSubmitBlock func(ctx context.Context, blk *types.BlockMsg) error `perm:"write"` - SyncIncomingBlocks func(ctx context.Context) (<-chan *types.BlockHeader, error) `perm:"read"` - SyncCheckpoint func(ctx context.Context, key types.TipSetKey) error `perm:"admin"` - SyncMarkBad func(ctx context.Context, bcid cid.Cid) error `perm:"admin"` - SyncUnmarkBad func(ctx context.Context, bcid cid.Cid) error `perm:"admin"` - SyncUnmarkAllBad func(ctx context.Context) error `perm:"admin"` - SyncCheckBad func(ctx context.Context, bcid cid.Cid) (string, error) `perm:"read"` - SyncValidateTipset func(ctx context.Context, tsk types.TipSetKey) (bool, error) `perm:"read"` + ChainGetBlock func(p0 context.Context, p1 cid.Cid) (*types.BlockHeader, error) `perm:"read"` - MpoolGetConfig func(context.Context) (*types.MpoolConfig, error) `perm:"read"` - MpoolSetConfig func(context.Context, *types.MpoolConfig) error `perm:"write"` + ChainGetBlockMessages func(p0 context.Context, p1 cid.Cid) (*api.BlockMessages, error) `perm:"read"` - MpoolSelect func(context.Context, types.TipSetKey, float64) ([]*types.SignedMessage, error) `perm:"read"` + ChainGetGenesis func(p0 context.Context) (*types.TipSet, error) `perm:"read"` - MpoolPending func(context.Context, types.TipSetKey) ([]*types.SignedMessage, error) `perm:"read"` - MpoolClear func(context.Context, bool) error `perm:"write"` + ChainGetMessage func(p0 context.Context, p1 cid.Cid) (*types.Message, error) `perm:"read"` - MpoolPush func(context.Context, *types.SignedMessage) (cid.Cid, error) `perm:"write"` - MpoolPushUntrusted func(context.Context, *types.SignedMessage) (cid.Cid, error) `perm:"write"` + ChainGetNode func(p0 context.Context, p1 string) (*api.IpldObject, error) `perm:"read"` - MpoolPushMessage func(context.Context, *types.Message, *api.MessageSendSpec) (*types.SignedMessage, error) `perm:"sign"` - MpoolGetNonce func(context.Context, address.Address) (uint64, error) `perm:"read"` - MpoolSub func(context.Context) (<-chan api.MpoolUpdate, error) `perm:"read"` + ChainGetParentMessages func(p0 context.Context, p1 cid.Cid) ([]api.Message, error) `perm:"read"` - MpoolBatchPush func(ctx context.Context, smsgs []*types.SignedMessage) ([]cid.Cid, error) `perm:"write"` - MpoolBatchPushUntrusted func(ctx context.Context, smsgs []*types.SignedMessage) ([]cid.Cid, error) `perm:"write"` - MpoolBatchPushMessage func(ctx context.Context, msgs []*types.Message, spec *api.MessageSendSpec) ([]*types.SignedMessage, error) `perm:"sign"` + ChainGetParentReceipts func(p0 context.Context, p1 cid.Cid) ([]*types.MessageReceipt, error) `perm:"read"` - MinerGetBaseInfo func(context.Context, address.Address, abi.ChainEpoch, types.TipSetKey) (*api.MiningBaseInfo, error) `perm:"read"` - MinerCreateBlock func(context.Context, *api.BlockTemplate) (*types.BlockMsg, error) `perm:"write"` + ChainGetPath func(p0 context.Context, p1 types.TipSetKey, p2 types.TipSetKey) ([]*api.HeadChange, error) `perm:"read"` - WalletNew func(context.Context, types.KeyType) (address.Address, error) `perm:"write"` - WalletHas func(context.Context, address.Address) (bool, error) `perm:"write"` - WalletList func(context.Context) ([]address.Address, error) `perm:"write"` - WalletBalance func(context.Context, address.Address) (types.BigInt, error) `perm:"read"` - WalletSign func(context.Context, address.Address, []byte) (*crypto.Signature, error) `perm:"sign"` - WalletSignMessage func(context.Context, address.Address, *types.Message) (*types.SignedMessage, error) `perm:"sign"` - WalletVerify func(context.Context, address.Address, []byte, *crypto.Signature) (bool, error) `perm:"read"` - WalletDefaultAddress func(context.Context) (address.Address, error) `perm:"write"` - WalletSetDefault func(context.Context, address.Address) error `perm:"admin"` - WalletExport func(context.Context, address.Address) (*types.KeyInfo, error) `perm:"admin"` - WalletImport func(context.Context, *types.KeyInfo) (address.Address, error) `perm:"admin"` - WalletDelete func(context.Context, address.Address) error `perm:"write"` - WalletValidateAddress func(context.Context, string) (address.Address, error) `perm:"read"` + ChainGetRandomnessFromBeacon func(p0 context.Context, p1 types.TipSetKey, p2 crypto.DomainSeparationTag, p3 abi.ChainEpoch, p4 []byte) (abi.Randomness, error) `perm:"read"` - ClientImport func(ctx context.Context, ref api.FileRef) (*api.ImportRes, error) `perm:"admin"` - ClientListImports func(ctx context.Context) ([]api.Import, error) `perm:"write"` - ClientRemoveImport func(ctx context.Context, importID multistore.StoreID) error `perm:"admin"` - ClientHasLocal func(ctx context.Context, root cid.Cid) (bool, error) `perm:"write"` - ClientFindData func(ctx context.Context, root cid.Cid, piece *cid.Cid) ([]api.QueryOffer, error) `perm:"read"` - ClientMinerQueryOffer func(ctx context.Context, miner address.Address, root cid.Cid, piece *cid.Cid) (api.QueryOffer, error) `perm:"read"` - ClientStartDeal func(ctx context.Context, params *api.StartDealParams) (*cid.Cid, error) `perm:"admin"` - ClientStatelessDeal func(ctx context.Context, params *api.StartDealParams) (*cid.Cid, error) `perm:"write"` - ClientGetDealInfo func(context.Context, cid.Cid) (*api.DealInfo, error) `perm:"read"` - ClientGetDealStatus func(context.Context, uint64) (string, error) `perm:"read"` - ClientListDeals func(ctx context.Context) ([]api.DealInfo, error) `perm:"write"` - ClientGetDealUpdates func(ctx context.Context) (<-chan api.DealInfo, error) `perm:"read"` - ClientRetrieve func(ctx context.Context, order api.RetrievalOrder, ref *api.FileRef) error `perm:"admin"` - ClientRetrieveWithEvents func(ctx context.Context, order api.RetrievalOrder, ref *api.FileRef) (<-chan marketevents.RetrievalEvent, error) `perm:"admin"` - ClientQueryAsk func(ctx context.Context, p peer.ID, miner address.Address) (*storagemarket.StorageAsk, error) `perm:"read"` - ClientDealPieceCID func(ctx context.Context, root cid.Cid) (api.DataCIDSize, error) `perm:"read"` - ClientCalcCommP func(ctx context.Context, inpath string) (*api.CommPRet, error) `perm:"read"` - ClientGenCar func(ctx context.Context, ref api.FileRef, outpath string) error `perm:"write"` - ClientDealSize func(ctx context.Context, root cid.Cid) (api.DataSize, error) `perm:"read"` - ClientListDataTransfers func(ctx context.Context) ([]api.DataTransferChannel, error) `perm:"write"` - ClientDataTransferUpdates func(ctx context.Context) (<-chan api.DataTransferChannel, error) `perm:"write"` - ClientRestartDataTransfer func(ctx context.Context, transferID datatransfer.TransferID, otherPeer peer.ID, isInitiator bool) error `perm:"write"` - ClientCancelDataTransfer func(ctx context.Context, transferID datatransfer.TransferID, otherPeer peer.ID, isInitiator bool) error `perm:"write"` - ClientRetrieveTryRestartInsufficientFunds func(ctx context.Context, paymentChannel address.Address) error `perm:"write"` + ChainGetRandomnessFromTickets func(p0 context.Context, p1 types.TipSetKey, p2 crypto.DomainSeparationTag, p3 abi.ChainEpoch, p4 []byte) (abi.Randomness, error) `perm:"read"` - StateNetworkName func(context.Context) (dtypes.NetworkName, error) `perm:"read"` - StateMinerSectors func(context.Context, address.Address, *bitfield.BitField, types.TipSetKey) ([]*miner.SectorOnChainInfo, error) `perm:"read"` - StateMinerActiveSectors func(context.Context, address.Address, types.TipSetKey) ([]*miner.SectorOnChainInfo, error) `perm:"read"` - StateMinerProvingDeadline func(context.Context, address.Address, types.TipSetKey) (*dline.Info, error) `perm:"read"` - StateMinerPower func(context.Context, address.Address, types.TipSetKey) (*api.MinerPower, error) `perm:"read"` - StateMinerInfo func(context.Context, address.Address, types.TipSetKey) (miner.MinerInfo, error) `perm:"read"` - StateMinerDeadlines func(context.Context, address.Address, types.TipSetKey) ([]api.Deadline, error) `perm:"read"` - StateMinerPartitions func(ctx context.Context, m address.Address, dlIdx uint64, tsk types.TipSetKey) ([]api.Partition, error) `perm:"read"` - StateMinerFaults func(context.Context, address.Address, types.TipSetKey) (bitfield.BitField, error) `perm:"read"` - StateAllMinerFaults func(context.Context, abi.ChainEpoch, types.TipSetKey) ([]*api.Fault, error) `perm:"read"` - StateMinerRecoveries func(context.Context, address.Address, types.TipSetKey) (bitfield.BitField, error) `perm:"read"` - StateMinerPreCommitDepositForPower func(context.Context, address.Address, miner.SectorPreCommitInfo, types.TipSetKey) (types.BigInt, error) `perm:"read"` - StateMinerInitialPledgeCollateral func(context.Context, address.Address, miner.SectorPreCommitInfo, types.TipSetKey) (types.BigInt, error) `perm:"read"` - StateMinerAvailableBalance func(context.Context, address.Address, types.TipSetKey) (types.BigInt, error) `perm:"read"` - StateMinerSectorAllocated func(context.Context, address.Address, abi.SectorNumber, types.TipSetKey) (bool, error) `perm:"read"` - StateSectorPreCommitInfo func(context.Context, address.Address, abi.SectorNumber, types.TipSetKey) (miner.SectorPreCommitOnChainInfo, error) `perm:"read"` - StateSectorGetInfo func(context.Context, address.Address, abi.SectorNumber, types.TipSetKey) (*miner.SectorOnChainInfo, error) `perm:"read"` - StateSectorExpiration func(context.Context, address.Address, abi.SectorNumber, types.TipSetKey) (*miner.SectorExpiration, error) `perm:"read"` - StateSectorPartition func(context.Context, address.Address, abi.SectorNumber, types.TipSetKey) (*miner.SectorLocation, error) `perm:"read"` - StateCall func(context.Context, *types.Message, types.TipSetKey) (*api.InvocResult, error) `perm:"read"` - StateReplay func(context.Context, types.TipSetKey, cid.Cid) (*api.InvocResult, error) `perm:"read"` - StateGetActor func(context.Context, address.Address, types.TipSetKey) (*types.Actor, error) `perm:"read"` - StateReadState func(context.Context, address.Address, types.TipSetKey) (*api.ActorState, error) `perm:"read"` - StateWaitMsg func(ctx context.Context, cid cid.Cid, confidence uint64) (*api.MsgLookup, error) `perm:"read"` - StateWaitMsgLimited func(context.Context, cid.Cid, uint64, abi.ChainEpoch) (*api.MsgLookup, error) `perm:"read"` - StateSearchMsg func(context.Context, cid.Cid) (*api.MsgLookup, error) `perm:"read"` - StateSearchMsgLimited func(context.Context, cid.Cid, abi.ChainEpoch) (*api.MsgLookup, error) `perm:"read"` - StateListMiners func(context.Context, types.TipSetKey) ([]address.Address, error) `perm:"read"` - StateListActors func(context.Context, types.TipSetKey) ([]address.Address, error) `perm:"read"` - StateMarketBalance func(context.Context, address.Address, types.TipSetKey) (api.MarketBalance, error) `perm:"read"` - StateMarketParticipants func(context.Context, types.TipSetKey) (map[string]api.MarketBalance, error) `perm:"read"` - StateMarketDeals func(context.Context, types.TipSetKey) (map[string]api.MarketDeal, error) `perm:"read"` - StateMarketStorageDeal func(context.Context, abi.DealID, types.TipSetKey) (*api.MarketDeal, error) `perm:"read"` - StateLookupID func(ctx context.Context, addr address.Address, tsk types.TipSetKey) (address.Address, error) `perm:"read"` - StateAccountKey func(context.Context, address.Address, types.TipSetKey) (address.Address, error) `perm:"read"` - StateChangedActors func(context.Context, cid.Cid, cid.Cid) (map[string]types.Actor, error) `perm:"read"` - StateGetReceipt func(context.Context, cid.Cid, types.TipSetKey) (*types.MessageReceipt, error) `perm:"read"` - StateMinerSectorCount func(context.Context, address.Address, types.TipSetKey) (api.MinerSectors, error) `perm:"read"` - StateListMessages func(ctx context.Context, match *api.MessageMatch, tsk types.TipSetKey, toht abi.ChainEpoch) ([]cid.Cid, error) `perm:"read"` - StateDecodeParams func(context.Context, address.Address, abi.MethodNum, []byte, types.TipSetKey) (interface{}, error) `perm:"read"` - StateCompute func(context.Context, abi.ChainEpoch, []*types.Message, types.TipSetKey) (*api.ComputeStateOutput, error) `perm:"read"` - StateVerifierStatus func(context.Context, address.Address, types.TipSetKey) (*abi.StoragePower, error) `perm:"read"` - StateVerifiedClientStatus func(context.Context, address.Address, types.TipSetKey) (*abi.StoragePower, error) `perm:"read"` - StateVerifiedRegistryRootKey func(ctx context.Context, tsk types.TipSetKey) (address.Address, error) `perm:"read"` - StateDealProviderCollateralBounds func(context.Context, abi.PaddedPieceSize, bool, types.TipSetKey) (api.DealCollateralBounds, error) `perm:"read"` - StateCirculatingSupply func(context.Context, types.TipSetKey) (abi.TokenAmount, error) `perm:"read"` - StateVMCirculatingSupplyInternal func(context.Context, types.TipSetKey) (api.CirculatingSupply, error) `perm:"read"` - StateNetworkVersion func(context.Context, types.TipSetKey) (stnetwork.Version, error) `perm:"read"` + ChainGetTipSet func(p0 context.Context, p1 types.TipSetKey) (*types.TipSet, error) `perm:"read"` - MsigGetAvailableBalance func(context.Context, address.Address, types.TipSetKey) (types.BigInt, error) `perm:"read"` - MsigGetVestingSchedule func(context.Context, address.Address, types.TipSetKey) (api.MsigVesting, error) `perm:"read"` - MsigGetVested func(context.Context, address.Address, types.TipSetKey, types.TipSetKey) (types.BigInt, error) `perm:"read"` - MsigGetPending func(context.Context, address.Address, types.TipSetKey) ([]*api.MsigTransaction, error) `perm:"read"` - MsigCreate func(context.Context, uint64, []address.Address, abi.ChainEpoch, types.BigInt, address.Address, types.BigInt) (cid.Cid, error) `perm:"sign"` - MsigPropose func(context.Context, address.Address, address.Address, types.BigInt, address.Address, uint64, []byte) (cid.Cid, error) `perm:"sign"` - MsigApprove func(context.Context, address.Address, uint64, address.Address) (cid.Cid, error) `perm:"sign"` - MsigApproveTxnHash func(context.Context, address.Address, uint64, address.Address, address.Address, types.BigInt, address.Address, uint64, []byte) (cid.Cid, error) `perm:"sign"` - MsigCancel func(context.Context, address.Address, uint64, address.Address, types.BigInt, address.Address, uint64, []byte) (cid.Cid, error) `perm:"sign"` - MsigAddPropose func(context.Context, address.Address, address.Address, address.Address, bool) (cid.Cid, error) `perm:"sign"` - MsigAddApprove func(context.Context, address.Address, address.Address, uint64, address.Address, address.Address, bool) (cid.Cid, error) `perm:"sign"` - MsigAddCancel func(context.Context, address.Address, address.Address, uint64, address.Address, bool) (cid.Cid, error) `perm:"sign"` - MsigSwapPropose func(context.Context, address.Address, address.Address, address.Address, address.Address) (cid.Cid, error) `perm:"sign"` - MsigSwapApprove func(context.Context, address.Address, address.Address, uint64, address.Address, address.Address, address.Address) (cid.Cid, error) `perm:"sign"` - MsigSwapCancel func(context.Context, address.Address, address.Address, uint64, address.Address, address.Address) (cid.Cid, error) `perm:"sign"` - MsigRemoveSigner func(ctx context.Context, msig address.Address, proposer address.Address, toRemove address.Address, decrease bool) (cid.Cid, error) `perm:"sign"` + ChainGetTipSetByHeight func(p0 context.Context, p1 abi.ChainEpoch, p2 types.TipSetKey) (*types.TipSet, error) `perm:"read"` - MarketAddBalance func(ctx context.Context, wallet, addr address.Address, amt types.BigInt) (cid.Cid, error) `perm:"sign"` - MarketGetReserved func(ctx context.Context, addr address.Address) (types.BigInt, error) `perm:"sign"` - MarketReserveFunds func(ctx context.Context, wallet address.Address, addr address.Address, amt types.BigInt) (cid.Cid, error) `perm:"sign"` - MarketReleaseFunds func(ctx context.Context, addr address.Address, amt types.BigInt) error `perm:"sign"` - MarketWithdraw func(ctx context.Context, wallet, addr address.Address, amt types.BigInt) (cid.Cid, error) `perm:"sign"` + ChainHasObj func(p0 context.Context, p1 cid.Cid) (bool, error) `perm:"read"` - PaychGet func(ctx context.Context, from, to address.Address, amt types.BigInt) (*api.ChannelInfo, error) `perm:"sign"` - PaychGetWaitReady func(context.Context, cid.Cid) (address.Address, error) `perm:"sign"` - PaychAvailableFunds func(context.Context, address.Address) (*api.ChannelAvailableFunds, error) `perm:"sign"` - PaychAvailableFundsByFromTo func(context.Context, address.Address, address.Address) (*api.ChannelAvailableFunds, error) `perm:"sign"` - PaychList func(context.Context) ([]address.Address, error) `perm:"read"` - PaychStatus func(context.Context, address.Address) (*api.PaychStatus, error) `perm:"read"` - PaychSettle func(context.Context, address.Address) (cid.Cid, error) `perm:"sign"` - PaychCollect func(context.Context, address.Address) (cid.Cid, error) `perm:"sign"` - PaychAllocateLane func(context.Context, address.Address) (uint64, error) `perm:"sign"` - PaychNewPayment func(ctx context.Context, from, to address.Address, vouchers []api.VoucherSpec) (*api.PaymentInfo, error) `perm:"sign"` - PaychVoucherCheck func(context.Context, *paych.SignedVoucher) error `perm:"read"` - PaychVoucherCheckValid func(context.Context, address.Address, *paych.SignedVoucher) error `perm:"read"` - PaychVoucherCheckSpendable func(context.Context, address.Address, *paych.SignedVoucher, []byte, []byte) (bool, error) `perm:"read"` - PaychVoucherAdd func(context.Context, address.Address, *paych.SignedVoucher, []byte, types.BigInt) (types.BigInt, error) `perm:"write"` - PaychVoucherCreate func(context.Context, address.Address, big.Int, uint64) (*api.VoucherCreateResult, error) `perm:"sign"` - PaychVoucherList func(context.Context, address.Address) ([]*paych.SignedVoucher, error) `perm:"write"` - PaychVoucherSubmit func(context.Context, address.Address, *paych.SignedVoucher, []byte, []byte) (cid.Cid, error) `perm:"sign"` + ChainHead func(p0 context.Context) (*types.TipSet, error) `perm:"read"` - CreateBackup func(ctx context.Context, fpath string) error `perm:"admin"` + ChainNotify func(p0 context.Context) (<-chan []*api.HeadChange, error) `perm:"read"` + + ChainReadObj func(p0 context.Context, p1 cid.Cid) ([]byte, error) `perm:"read"` + + ChainSetHead func(p0 context.Context, p1 types.TipSetKey) error `perm:"admin"` + + ChainStatObj func(p0 context.Context, p1 cid.Cid, p2 cid.Cid) (api.ObjStat, error) `perm:"read"` + + 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"` + + 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"` + + 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 multistore.StoreID) 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 api.RetrievalOrder, p2 *api.FileRef) error `perm:"admin"` + + ClientRetrieveTryRestartInsufficientFunds func(p0 context.Context, p1 address.Address) error `perm:"write"` + + ClientRetrieveWithEvents func(p0 context.Context, p1 api.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"` + + GasEstimateGasLimit func(p0 context.Context, p1 *types.Message, p2 types.TipSetKey) (int64, error) `perm:"read"` + + GasEstimateGasPremium func(p0 context.Context, p1 uint64, p2 address.Address, p3 int64, p4 types.TipSetKey) (types.BigInt, error) `perm:"read"` + + GasEstimateMessageGas func(p0 context.Context, p1 *types.Message, p2 *api.MessageSendSpec, p3 types.TipSetKey) (*types.Message, error) `perm:"read"` + + MarketAddBalance func(p0 context.Context, p1 address.Address, p2 address.Address, p3 types.BigInt) (cid.Cid, error) `perm:"sign"` + + MarketGetReserved func(p0 context.Context, p1 address.Address) (types.BigInt, error) `perm:"sign"` + + MarketReleaseFunds func(p0 context.Context, p1 address.Address, p2 types.BigInt) error `perm:"sign"` + + MarketReserveFunds func(p0 context.Context, p1 address.Address, p2 address.Address, p3 types.BigInt) (cid.Cid, error) `perm:"sign"` + + MarketWithdraw func(p0 context.Context, p1 address.Address, p2 address.Address, p3 types.BigInt) (cid.Cid, error) `perm:"sign"` + + MinerCreateBlock func(p0 context.Context, p1 *api.BlockTemplate) (*types.BlockMsg, error) `perm:"write"` + + MinerGetBaseInfo func(p0 context.Context, p1 address.Address, p2 abi.ChainEpoch, p3 types.TipSetKey) (*api.MiningBaseInfo, error) `perm:"read"` + + MpoolBatchPush func(p0 context.Context, p1 []*types.SignedMessage) ([]cid.Cid, error) `perm:"write"` + + MpoolBatchPushMessage func(p0 context.Context, p1 []*types.Message, p2 *api.MessageSendSpec) ([]*types.SignedMessage, error) `perm:"sign"` + + MpoolBatchPushUntrusted func(p0 context.Context, p1 []*types.SignedMessage) ([]cid.Cid, error) `perm:"write"` + + MpoolClear func(p0 context.Context, p1 bool) error `perm:"write"` + + MpoolGetConfig func(p0 context.Context) (*types.MpoolConfig, error) `perm:"read"` + + MpoolGetNonce func(p0 context.Context, p1 address.Address) (uint64, error) `perm:"read"` + + MpoolPending func(p0 context.Context, p1 types.TipSetKey) ([]*types.SignedMessage, error) `perm:"read"` + + MpoolPush func(p0 context.Context, p1 *types.SignedMessage) (cid.Cid, error) `perm:"write"` + + MpoolPushMessage func(p0 context.Context, p1 *types.Message, p2 *api.MessageSendSpec) (*types.SignedMessage, error) `perm:"sign"` + + MpoolPushUntrusted func(p0 context.Context, p1 *types.SignedMessage) (cid.Cid, error) `perm:"write"` + + MpoolSelect func(p0 context.Context, p1 types.TipSetKey, p2 float64) ([]*types.SignedMessage, error) `perm:"read"` + + MpoolSetConfig func(p0 context.Context, p1 *types.MpoolConfig) error `perm:"admin"` + + MpoolSub func(p0 context.Context) (<-chan api.MpoolUpdate, error) `perm:"read"` + + MsigAddApprove func(p0 context.Context, p1 address.Address, p2 address.Address, p3 uint64, p4 address.Address, p5 address.Address, p6 bool) (cid.Cid, error) `perm:"sign"` + + MsigAddCancel func(p0 context.Context, p1 address.Address, p2 address.Address, p3 uint64, p4 address.Address, p5 bool) (cid.Cid, error) `perm:"sign"` + + MsigAddPropose func(p0 context.Context, p1 address.Address, p2 address.Address, p3 address.Address, p4 bool) (cid.Cid, error) `perm:"sign"` + + MsigApprove func(p0 context.Context, p1 address.Address, p2 uint64, p3 address.Address) (cid.Cid, error) `perm:"sign"` + + MsigApproveTxnHash func(p0 context.Context, p1 address.Address, p2 uint64, p3 address.Address, p4 address.Address, p5 types.BigInt, p6 address.Address, p7 uint64, p8 []byte) (cid.Cid, error) `perm:"sign"` + + MsigCancel func(p0 context.Context, p1 address.Address, p2 uint64, p3 address.Address, p4 types.BigInt, p5 address.Address, p6 uint64, p7 []byte) (cid.Cid, error) `perm:"sign"` + + MsigCreate func(p0 context.Context, p1 uint64, p2 []address.Address, p3 abi.ChainEpoch, p4 types.BigInt, p5 address.Address, p6 types.BigInt) (cid.Cid, error) `perm:"sign"` + + MsigGetAvailableBalance func(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (types.BigInt, error) `perm:"read"` + + MsigGetPending func(p0 context.Context, p1 address.Address, p2 types.TipSetKey) ([]*api.MsigTransaction, error) `perm:"read"` + + MsigGetVested func(p0 context.Context, p1 address.Address, p2 types.TipSetKey, p3 types.TipSetKey) (types.BigInt, error) `perm:"read"` + + MsigGetVestingSchedule func(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (api.MsigVesting, error) `perm:"read"` + + MsigPropose func(p0 context.Context, p1 address.Address, p2 address.Address, p3 types.BigInt, p4 address.Address, p5 uint64, p6 []byte) (cid.Cid, error) `perm:"sign"` + + MsigRemoveSigner func(p0 context.Context, p1 address.Address, p2 address.Address, p3 address.Address, p4 bool) (cid.Cid, error) `perm:"sign"` + + MsigSwapApprove func(p0 context.Context, p1 address.Address, p2 address.Address, p3 uint64, p4 address.Address, p5 address.Address, p6 address.Address) (cid.Cid, error) `perm:"sign"` + + MsigSwapCancel func(p0 context.Context, p1 address.Address, p2 address.Address, p3 uint64, p4 address.Address, p5 address.Address) (cid.Cid, error) `perm:"sign"` + + MsigSwapPropose func(p0 context.Context, p1 address.Address, p2 address.Address, p3 address.Address, p4 address.Address) (cid.Cid, error) `perm:"sign"` + + PaychAllocateLane func(p0 context.Context, p1 address.Address) (uint64, error) `perm:"sign"` + + PaychAvailableFunds func(p0 context.Context, p1 address.Address) (*api.ChannelAvailableFunds, error) `perm:"sign"` + + PaychAvailableFundsByFromTo func(p0 context.Context, p1 address.Address, p2 address.Address) (*api.ChannelAvailableFunds, error) `perm:"sign"` + + PaychCollect func(p0 context.Context, p1 address.Address) (cid.Cid, error) `perm:"sign"` + + PaychGet func(p0 context.Context, p1 address.Address, p2 address.Address, p3 types.BigInt) (*api.ChannelInfo, error) `perm:"sign"` + + PaychGetWaitReady func(p0 context.Context, p1 cid.Cid) (address.Address, error) `perm:"sign"` + + PaychList func(p0 context.Context) ([]address.Address, error) `perm:"read"` + + PaychNewPayment func(p0 context.Context, p1 address.Address, p2 address.Address, p3 []api.VoucherSpec) (*api.PaymentInfo, error) `perm:"sign"` + + PaychSettle func(p0 context.Context, p1 address.Address) (cid.Cid, error) `perm:"sign"` + + PaychStatus func(p0 context.Context, p1 address.Address) (*api.PaychStatus, error) `perm:"read"` + + PaychVoucherAdd func(p0 context.Context, p1 address.Address, p2 *paych.SignedVoucher, p3 []byte, p4 types.BigInt) (types.BigInt, error) `perm:"write"` + + PaychVoucherCheckSpendable func(p0 context.Context, p1 address.Address, p2 *paych.SignedVoucher, p3 []byte, p4 []byte) (bool, error) `perm:"read"` + + PaychVoucherCheckValid func(p0 context.Context, p1 address.Address, p2 *paych.SignedVoucher) error `perm:"read"` + + PaychVoucherCreate func(p0 context.Context, p1 address.Address, p2 types.BigInt, p3 uint64) (*api.VoucherCreateResult, error) `perm:"sign"` + + PaychVoucherList func(p0 context.Context, p1 address.Address) ([]*paych.SignedVoucher, error) `perm:"write"` + + PaychVoucherSubmit func(p0 context.Context, p1 address.Address, p2 *paych.SignedVoucher, p3 []byte, p4 []byte) (cid.Cid, error) `perm:"sign"` + + StateAccountKey func(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (address.Address, error) `perm:"read"` + + StateAllMinerFaults func(p0 context.Context, p1 abi.ChainEpoch, p2 types.TipSetKey) ([]*api.Fault, error) `perm:"read"` + + StateCall func(p0 context.Context, p1 *types.Message, p2 types.TipSetKey) (*api.InvocResult, error) `perm:"read"` + + StateChangedActors func(p0 context.Context, p1 cid.Cid, p2 cid.Cid) (map[string]types.Actor, error) `perm:"read"` + + StateCirculatingSupply func(p0 context.Context, p1 types.TipSetKey) (abi.TokenAmount, error) `perm:"read"` + + StateCompute func(p0 context.Context, p1 abi.ChainEpoch, p2 []*types.Message, p3 types.TipSetKey) (*api.ComputeStateOutput, error) `perm:"read"` + + StateDealProviderCollateralBounds func(p0 context.Context, p1 abi.PaddedPieceSize, p2 bool, p3 types.TipSetKey) (api.DealCollateralBounds, error) `perm:"read"` + + StateDecodeParams func(p0 context.Context, p1 address.Address, p2 abi.MethodNum, p3 []byte, p4 types.TipSetKey) (interface{}, error) `perm:"read"` + + StateGetActor func(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (*types.Actor, error) `perm:"read"` + + StateGetReceipt func(p0 context.Context, p1 cid.Cid, p2 types.TipSetKey) (*types.MessageReceipt, error) `perm:"read"` + + StateListActors func(p0 context.Context, p1 types.TipSetKey) ([]address.Address, error) `perm:"read"` + + StateListMessages func(p0 context.Context, p1 *api.MessageMatch, p2 types.TipSetKey, p3 abi.ChainEpoch) ([]cid.Cid, error) `perm:"read"` + + StateListMiners func(p0 context.Context, p1 types.TipSetKey) ([]address.Address, error) `perm:"read"` + + StateLookupID func(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (address.Address, error) `perm:"read"` + + StateMarketBalance func(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (api.MarketBalance, error) `perm:"read"` + + StateMarketDeals func(p0 context.Context, p1 types.TipSetKey) (map[string]api.MarketDeal, error) `perm:"read"` + + StateMarketParticipants func(p0 context.Context, p1 types.TipSetKey) (map[string]api.MarketBalance, error) `perm:"read"` + + StateMarketStorageDeal func(p0 context.Context, p1 abi.DealID, p2 types.TipSetKey) (*api.MarketDeal, error) `perm:"read"` + + StateMinerActiveSectors func(p0 context.Context, p1 address.Address, p2 types.TipSetKey) ([]*miner.SectorOnChainInfo, error) `perm:"read"` + + StateMinerAvailableBalance func(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (types.BigInt, error) `perm:"read"` + + StateMinerDeadlines func(p0 context.Context, p1 address.Address, p2 types.TipSetKey) ([]api.Deadline, error) `perm:"read"` + + StateMinerFaults func(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (bitfield.BitField, error) `perm:"read"` + + StateMinerInfo func(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (miner.MinerInfo, error) `perm:"read"` + + StateMinerInitialPledgeCollateral func(p0 context.Context, p1 address.Address, p2 miner.SectorPreCommitInfo, p3 types.TipSetKey) (types.BigInt, error) `perm:"read"` + + StateMinerPartitions func(p0 context.Context, p1 address.Address, p2 uint64, p3 types.TipSetKey) ([]api.Partition, error) `perm:"read"` + + StateMinerPower func(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (*api.MinerPower, error) `perm:"read"` + + StateMinerPreCommitDepositForPower func(p0 context.Context, p1 address.Address, p2 miner.SectorPreCommitInfo, p3 types.TipSetKey) (types.BigInt, error) `perm:"read"` + + StateMinerProvingDeadline func(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (*dline.Info, error) `perm:"read"` + + StateMinerRecoveries func(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (bitfield.BitField, error) `perm:"read"` + + StateMinerSectorAllocated func(p0 context.Context, p1 address.Address, p2 abi.SectorNumber, p3 types.TipSetKey) (bool, error) `perm:"read"` + + StateMinerSectorCount func(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (api.MinerSectors, error) `perm:"read"` + + StateMinerSectors func(p0 context.Context, p1 address.Address, p2 *bitfield.BitField, p3 types.TipSetKey) ([]*miner.SectorOnChainInfo, error) `perm:"read"` + + StateNetworkName func(p0 context.Context) (dtypes.NetworkName, error) `perm:"read"` + + StateNetworkVersion func(p0 context.Context, p1 types.TipSetKey) (apitypes.NetworkVersion, error) `perm:"read"` + + StateReadState func(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (*api.ActorState, error) `perm:"read"` + + StateReplay func(p0 context.Context, p1 types.TipSetKey, p2 cid.Cid) (*api.InvocResult, error) `perm:"read"` + + StateSearchMsg func(p0 context.Context, p1 cid.Cid) (*api.MsgLookup, error) `perm:"read"` + + StateSearchMsgLimited func(p0 context.Context, p1 cid.Cid, p2 abi.ChainEpoch) (*api.MsgLookup, error) `perm:"read"` + + StateSectorExpiration func(p0 context.Context, p1 address.Address, p2 abi.SectorNumber, p3 types.TipSetKey) (*miner.SectorExpiration, error) `perm:"read"` + + StateSectorGetInfo func(p0 context.Context, p1 address.Address, p2 abi.SectorNumber, p3 types.TipSetKey) (*miner.SectorOnChainInfo, error) `perm:"read"` + + StateSectorPartition func(p0 context.Context, p1 address.Address, p2 abi.SectorNumber, p3 types.TipSetKey) (*miner.SectorLocation, error) `perm:"read"` + + StateSectorPreCommitInfo func(p0 context.Context, p1 address.Address, p2 abi.SectorNumber, p3 types.TipSetKey) (miner.SectorPreCommitOnChainInfo, error) `perm:"read"` + + StateVMCirculatingSupplyInternal func(p0 context.Context, p1 types.TipSetKey) (api.CirculatingSupply, error) `perm:"read"` + + StateVerifiedClientStatus func(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (*abi.StoragePower, error) `perm:"read"` + + StateVerifiedRegistryRootKey func(p0 context.Context, p1 types.TipSetKey) (address.Address, error) `perm:"read"` + + StateVerifierStatus func(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (*abi.StoragePower, error) `perm:"read"` + + StateWaitMsg func(p0 context.Context, p1 cid.Cid, p2 uint64) (*api.MsgLookup, error) `perm:"read"` + + StateWaitMsgLimited func(p0 context.Context, p1 cid.Cid, p2 uint64, p3 abi.ChainEpoch) (*api.MsgLookup, error) `perm:"read"` + + SyncCheckBad func(p0 context.Context, p1 cid.Cid) (string, error) `perm:"read"` + + SyncCheckpoint func(p0 context.Context, p1 types.TipSetKey) error `perm:"admin"` + + SyncIncomingBlocks func(p0 context.Context) (<-chan *types.BlockHeader, error) `perm:"read"` + + SyncMarkBad func(p0 context.Context, p1 cid.Cid) error `perm:"admin"` + + SyncState func(p0 context.Context) (*api.SyncState, error) `perm:"read"` + + SyncSubmitBlock func(p0 context.Context, p1 *types.BlockMsg) error `perm:"write"` + + SyncUnmarkAllBad func(p0 context.Context) error `perm:"admin"` + + SyncUnmarkBad func(p0 context.Context, p1 cid.Cid) error `perm:"admin"` + + SyncValidateTipset func(p0 context.Context, p1 types.TipSetKey) (bool, error) `perm:"read"` + + WalletBalance func(p0 context.Context, p1 address.Address) (types.BigInt, error) `perm:"read"` + + WalletDefaultAddress func(p0 context.Context) (address.Address, error) `perm:"write"` + + WalletDelete func(p0 context.Context, p1 address.Address) error `perm:"admin"` + + WalletExport func(p0 context.Context, p1 address.Address) (*types.KeyInfo, error) `perm:"admin"` + + WalletHas func(p0 context.Context, p1 address.Address) (bool, error) `perm:"write"` + + WalletImport func(p0 context.Context, p1 *types.KeyInfo) (address.Address, error) `perm:"admin"` + + WalletList func(p0 context.Context) ([]address.Address, error) `perm:"write"` + + WalletNew func(p0 context.Context, p1 types.KeyType) (address.Address, error) `perm:"write"` + + WalletSetDefault func(p0 context.Context, p1 address.Address) error `perm:"write"` + + WalletSign func(p0 context.Context, p1 address.Address, p2 []byte) (*crypto.Signature, error) `perm:"sign"` + + WalletSignMessage func(p0 context.Context, p1 address.Address, p2 *types.Message) (*types.SignedMessage, error) `perm:"sign"` + + WalletValidateAddress func(p0 context.Context, p1 string) (address.Address, error) `perm:"read"` + + WalletVerify func(p0 context.Context, p1 address.Address, p2 []byte, p3 *crypto.Signature) (bool, error) `perm:"read"` } } -func (c *FullNodeStruct) StateMinerSectorCount(ctx context.Context, addr address.Address, tsk types.TipSetKey) (api.MinerSectors, error) { - return c.Internal.StateMinerSectorCount(ctx, addr, tsk) +type GatewayStruct struct { + Internal struct { + ChainGetBlockMessages func(p0 context.Context, p1 cid.Cid) (*api.BlockMessages, error) `` + + ChainGetMessage func(p0 context.Context, p1 cid.Cid) (*types.Message, error) `` + + ChainGetTipSet func(p0 context.Context, p1 types.TipSetKey) (*types.TipSet, error) `` + + ChainGetTipSetByHeight func(p0 context.Context, p1 abi.ChainEpoch, p2 types.TipSetKey) (*types.TipSet, error) `` + + ChainHasObj func(p0 context.Context, p1 cid.Cid) (bool, error) `` + + ChainHead func(p0 context.Context) (*types.TipSet, error) `` + + ChainNotify func(p0 context.Context) (<-chan []*api.HeadChange, error) `` + + ChainReadObj func(p0 context.Context, p1 cid.Cid) ([]byte, error) `` + + GasEstimateMessageGas func(p0 context.Context, p1 *types.Message, p2 *api.MessageSendSpec, p3 types.TipSetKey) (*types.Message, error) `` + + MpoolPush func(p0 context.Context, p1 *types.SignedMessage) (cid.Cid, error) `` + + MsigGetAvailableBalance func(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (types.BigInt, error) `` + + MsigGetPending func(p0 context.Context, p1 address.Address, p2 types.TipSetKey) ([]*api.MsigTransaction, error) `` + + MsigGetVested func(p0 context.Context, p1 address.Address, p2 types.TipSetKey, p3 types.TipSetKey) (types.BigInt, error) `` + + StateAccountKey func(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (address.Address, error) `` + + StateDealProviderCollateralBounds func(p0 context.Context, p1 abi.PaddedPieceSize, p2 bool, p3 types.TipSetKey) (api.DealCollateralBounds, error) `` + + StateGetActor func(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (*types.Actor, error) `` + + StateGetReceipt func(p0 context.Context, p1 cid.Cid, p2 types.TipSetKey) (*types.MessageReceipt, error) `` + + StateListMiners func(p0 context.Context, p1 types.TipSetKey) ([]address.Address, error) `` + + StateLookupID func(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (address.Address, error) `` + + StateMarketBalance func(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (api.MarketBalance, error) `` + + StateMarketStorageDeal func(p0 context.Context, p1 abi.DealID, p2 types.TipSetKey) (*api.MarketDeal, error) `` + + StateMinerInfo func(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (miner.MinerInfo, error) `` + + StateMinerPower func(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (*api.MinerPower, error) `` + + StateMinerProvingDeadline func(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (*dline.Info, error) `` + + StateNetworkVersion func(p0 context.Context, p1 types.TipSetKey) (apitypes.NetworkVersion, error) `` + + StateSearchMsg func(p0 context.Context, p1 cid.Cid) (*api.MsgLookup, error) `` + + StateSectorGetInfo func(p0 context.Context, p1 address.Address, p2 abi.SectorNumber, p3 types.TipSetKey) (*miner.SectorOnChainInfo, error) `` + + StateVerifiedClientStatus func(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (*abi.StoragePower, error) `` + + StateWaitMsg func(p0 context.Context, p1 cid.Cid, p2 uint64) (*api.MsgLookup, error) `` + } +} + +type SignableStruct struct { + Internal struct { + Sign func(p0 context.Context, p1 api.SignFunc) error `` + } } type StorageMinerStruct struct { CommonStruct Internal struct { - ActorAddress func(context.Context) (address.Address, error) `perm:"read"` - ActorSectorSize func(context.Context, address.Address) (abi.SectorSize, error) `perm:"read"` - ActorAddressConfig func(ctx context.Context) (api.AddressConfig, error) `perm:"read"` + ActorAddress func(p0 context.Context) (address.Address, error) `perm:"read"` - MiningBase func(context.Context) (*types.TipSet, error) `perm:"read"` + ActorAddressConfig func(p0 context.Context) (api.AddressConfig, error) `perm:"read"` - MarketImportDealData func(context.Context, cid.Cid, string) error `perm:"write"` - MarketListDeals func(ctx context.Context) ([]api.MarketDeal, error) `perm:"read"` - MarketListRetrievalDeals func(ctx context.Context) ([]retrievalmarket.ProviderDealState, error) `perm:"read"` - MarketGetDealUpdates func(ctx context.Context) (<-chan storagemarket.MinerDeal, error) `perm:"read"` - MarketListIncompleteDeals func(ctx context.Context) ([]storagemarket.MinerDeal, error) `perm:"read"` - MarketSetAsk func(ctx context.Context, price types.BigInt, verifiedPrice types.BigInt, duration abi.ChainEpoch, minPieceSize abi.PaddedPieceSize, maxPieceSize abi.PaddedPieceSize) error `perm:"admin"` - MarketGetAsk func(ctx context.Context) (*storagemarket.SignedStorageAsk, error) `perm:"read"` - MarketSetRetrievalAsk func(ctx context.Context, rask *retrievalmarket.Ask) error `perm:"admin"` - MarketGetRetrievalAsk func(ctx context.Context) (*retrievalmarket.Ask, error) `perm:"read"` - MarketListDataTransfers func(ctx context.Context) ([]api.DataTransferChannel, error) `perm:"write"` - MarketDataTransferUpdates func(ctx context.Context) (<-chan api.DataTransferChannel, error) `perm:"write"` - MarketRestartDataTransfer func(ctx context.Context, transferID datatransfer.TransferID, otherPeer peer.ID, isInitiator bool) error `perm:"write"` - MarketCancelDataTransfer func(ctx context.Context, transferID datatransfer.TransferID, otherPeer peer.ID, isInitiator bool) error `perm:"write"` - MarketPendingDeals func(ctx context.Context) (api.PendingDealInfo, error) `perm:"write"` - MarketPublishPendingDeals func(ctx context.Context) error `perm:"admin"` + ActorSectorSize func(p0 context.Context, p1 address.Address) (abi.SectorSize, error) `perm:"read"` - PledgeSector func(context.Context) (abi.SectorID, error) `perm:"write"` + CheckProvable func(p0 context.Context, p1 abi.RegisteredPoStProof, p2 []storage.SectorRef, p3 bool) (map[abi.SectorNumber]string, error) `perm:"admin"` - SectorsStatus func(ctx context.Context, sid abi.SectorNumber, showOnChainInfo bool) (api.SectorInfo, error) `perm:"read"` - SectorsList func(context.Context) ([]abi.SectorNumber, error) `perm:"read"` - SectorsListInStates func(context.Context, []api.SectorState) ([]abi.SectorNumber, error) `perm:"read"` - SectorsSummary func(ctx context.Context) (map[api.SectorState]int, error) `perm:"read"` - SectorsRefs func(context.Context) (map[string][]api.SealedRef, error) `perm:"read"` - SectorStartSealing func(context.Context, abi.SectorNumber) error `perm:"write"` - SectorSetSealDelay func(context.Context, time.Duration) error `perm:"write"` - SectorGetSealDelay func(context.Context) (time.Duration, error) `perm:"read"` - SectorSetExpectedSealDuration func(context.Context, time.Duration) error `perm:"write"` - SectorGetExpectedSealDuration func(context.Context) (time.Duration, error) `perm:"read"` - SectorsUpdate func(context.Context, abi.SectorNumber, api.SectorState) error `perm:"admin"` - SectorRemove func(context.Context, abi.SectorNumber) error `perm:"admin"` - SectorTerminate func(context.Context, abi.SectorNumber) error `perm:"admin"` - SectorTerminateFlush func(ctx context.Context) (*cid.Cid, error) `perm:"admin"` - SectorTerminatePending func(ctx context.Context) ([]abi.SectorID, error) `perm:"admin"` - SectorMarkForUpgrade func(ctx context.Context, id abi.SectorNumber) error `perm:"admin"` + ComputeProof func(p0 context.Context, p1 []builtin.SectorInfo, p2 abi.PoStRandomness) ([]builtin.PoStProof, error) `perm:"read"` - WorkerConnect func(context.Context, string) error `perm:"admin" retry:"true"` // TODO: worker perm - WorkerStats func(context.Context) (map[uuid.UUID]storiface.WorkerStats, error) `perm:"admin"` - WorkerJobs func(context.Context) (map[uuid.UUID][]storiface.WorkerJob, error) `perm:"admin"` + CreateBackup func(p0 context.Context, p1 string) error `perm:"admin"` - ReturnAddPiece func(ctx context.Context, callID storiface.CallID, pi abi.PieceInfo, err *storiface.CallError) error `perm:"admin" retry:"true"` - ReturnSealPreCommit1 func(ctx context.Context, callID storiface.CallID, p1o storage.PreCommit1Out, err *storiface.CallError) error `perm:"admin" retry:"true"` - ReturnSealPreCommit2 func(ctx context.Context, callID storiface.CallID, sealed storage.SectorCids, err *storiface.CallError) error `perm:"admin" retry:"true"` - ReturnSealCommit1 func(ctx context.Context, callID storiface.CallID, out storage.Commit1Out, err *storiface.CallError) error `perm:"admin" retry:"true"` - ReturnSealCommit2 func(ctx context.Context, callID storiface.CallID, proof storage.Proof, err *storiface.CallError) error `perm:"admin" retry:"true"` - ReturnFinalizeSector func(ctx context.Context, callID storiface.CallID, err *storiface.CallError) error `perm:"admin" retry:"true"` - ReturnReleaseUnsealed func(ctx context.Context, callID storiface.CallID, err *storiface.CallError) error `perm:"admin" retry:"true"` - ReturnMoveStorage func(ctx context.Context, callID storiface.CallID, err *storiface.CallError) error `perm:"admin" retry:"true"` - ReturnUnsealPiece func(ctx context.Context, callID storiface.CallID, err *storiface.CallError) error `perm:"admin" retry:"true"` - ReturnReadPiece func(ctx context.Context, callID storiface.CallID, ok bool, err *storiface.CallError) error `perm:"admin" retry:"true"` - ReturnFetch func(ctx context.Context, callID storiface.CallID, err *storiface.CallError) error `perm:"admin" retry:"true"` + DealsConsiderOfflineRetrievalDeals func(p0 context.Context) (bool, error) `perm:"admin"` - SealingSchedDiag func(context.Context, bool) (interface{}, error) `perm:"admin"` - SealingAbort func(ctx context.Context, call storiface.CallID) error `perm:"admin"` + DealsConsiderOfflineStorageDeals func(p0 context.Context) (bool, error) `perm:"admin"` - StorageList func(context.Context) (map[stores.ID][]stores.Decl, error) `perm:"admin"` - StorageLocal func(context.Context) (map[stores.ID]string, error) `perm:"admin"` - StorageStat func(context.Context, stores.ID) (fsutil.FsStat, error) `perm:"admin"` - StorageAttach func(context.Context, stores.StorageInfo, fsutil.FsStat) error `perm:"admin"` - StorageDeclareSector func(context.Context, stores.ID, abi.SectorID, storiface.SectorFileType, bool) error `perm:"admin"` - StorageDropSector func(context.Context, stores.ID, abi.SectorID, storiface.SectorFileType) error `perm:"admin"` - StorageFindSector func(context.Context, abi.SectorID, storiface.SectorFileType, abi.SectorSize, bool) ([]stores.SectorStorageInfo, error) `perm:"admin"` - StorageInfo func(context.Context, stores.ID) (stores.StorageInfo, error) `perm:"admin"` - StorageBestAlloc func(ctx context.Context, allocate storiface.SectorFileType, ssize abi.SectorSize, sealing storiface.PathType) ([]stores.StorageInfo, error) `perm:"admin"` - StorageReportHealth func(ctx context.Context, id stores.ID, report stores.HealthReport) error `perm:"admin"` - StorageLock func(ctx context.Context, sector abi.SectorID, read storiface.SectorFileType, write storiface.SectorFileType) error `perm:"admin"` - StorageTryLock func(ctx context.Context, sector abi.SectorID, read storiface.SectorFileType, write storiface.SectorFileType) (bool, error) `perm:"admin"` + DealsConsiderOnlineRetrievalDeals func(p0 context.Context) (bool, error) `perm:"admin"` - DealsImportData func(ctx context.Context, dealPropCid cid.Cid, file string) error `perm:"write"` - DealsList func(ctx context.Context) ([]api.MarketDeal, error) `perm:"read"` - DealsConsiderOnlineStorageDeals func(context.Context) (bool, error) `perm:"read"` - DealsSetConsiderOnlineStorageDeals func(context.Context, bool) error `perm:"admin"` - DealsConsiderOnlineRetrievalDeals func(context.Context) (bool, error) `perm:"read"` - DealsSetConsiderOnlineRetrievalDeals func(context.Context, bool) error `perm:"admin"` - DealsConsiderOfflineStorageDeals func(context.Context) (bool, error) `perm:"read"` - DealsSetConsiderOfflineStorageDeals func(context.Context, bool) error `perm:"admin"` - DealsConsiderOfflineRetrievalDeals func(context.Context) (bool, error) `perm:"read"` - DealsSetConsiderOfflineRetrievalDeals func(context.Context, bool) error `perm:"admin"` - DealsConsiderVerifiedStorageDeals func(context.Context) (bool, error) `perm:"read"` - DealsSetConsiderVerifiedStorageDeals func(context.Context, bool) error `perm:"admin"` - DealsConsiderUnverifiedStorageDeals func(context.Context) (bool, error) `perm:"read"` - DealsSetConsiderUnverifiedStorageDeals func(context.Context, bool) error `perm:"admin"` - DealsPieceCidBlocklist func(context.Context) ([]cid.Cid, error) `perm:"read"` - DealsSetPieceCidBlocklist func(context.Context, []cid.Cid) error `perm:"admin"` + DealsConsiderOnlineStorageDeals func(p0 context.Context) (bool, error) `perm:"admin"` - StorageAddLocal func(ctx context.Context, path string) error `perm:"admin"` + DealsConsiderUnverifiedStorageDeals func(p0 context.Context) (bool, error) `perm:"admin"` - PiecesListPieces func(ctx context.Context) ([]cid.Cid, error) `perm:"read"` - PiecesListCidInfos func(ctx context.Context) ([]cid.Cid, error) `perm:"read"` - PiecesGetPieceInfo func(ctx context.Context, pieceCid cid.Cid) (*piecestore.PieceInfo, error) `perm:"read"` - PiecesGetCIDInfo func(ctx context.Context, payloadCid cid.Cid) (*piecestore.CIDInfo, error) `perm:"read"` + DealsConsiderVerifiedStorageDeals func(p0 context.Context) (bool, error) `perm:"admin"` - CreateBackup func(ctx context.Context, fpath string) error `perm:"admin"` + DealsImportData func(p0 context.Context, p1 cid.Cid, p2 string) error `perm:"admin"` - CheckProvable func(ctx context.Context, pp abi.RegisteredPoStProof, sectors []storage.SectorRef, expensive bool) (map[abi.SectorNumber]string, error) `perm:"admin"` - } -} + DealsList func(p0 context.Context) ([]api.MarketDeal, error) `perm:"admin"` -type WorkerStruct struct { - Internal struct { - // TODO: lower perms + DealsPieceCidBlocklist func(p0 context.Context) ([]cid.Cid, error) `perm:"admin"` - Version func(context.Context) (api.Version, error) `perm:"admin"` + DealsSetConsiderOfflineRetrievalDeals func(p0 context.Context, p1 bool) error `perm:"admin"` - TaskTypes func(context.Context) (map[sealtasks.TaskType]struct{}, error) `perm:"admin"` - Paths func(context.Context) ([]stores.StoragePath, error) `perm:"admin"` - Info func(context.Context) (storiface.WorkerInfo, error) `perm:"admin"` + DealsSetConsiderOfflineStorageDeals func(p0 context.Context, p1 bool) error `perm:"admin"` - AddPiece func(ctx context.Context, sector storage.SectorRef, pieceSizes []abi.UnpaddedPieceSize, newPieceSize abi.UnpaddedPieceSize, pieceData storage.Data) (storiface.CallID, error) `perm:"admin"` - SealPreCommit1 func(ctx context.Context, sector storage.SectorRef, ticket abi.SealRandomness, pieces []abi.PieceInfo) (storiface.CallID, error) `perm:"admin"` - SealPreCommit2 func(ctx context.Context, sector storage.SectorRef, pc1o storage.PreCommit1Out) (storiface.CallID, error) `perm:"admin"` - SealCommit1 func(ctx context.Context, sector storage.SectorRef, ticket abi.SealRandomness, seed abi.InteractiveSealRandomness, pieces []abi.PieceInfo, cids storage.SectorCids) (storiface.CallID, error) `perm:"admin"` - SealCommit2 func(ctx context.Context, sector storage.SectorRef, c1o storage.Commit1Out) (storiface.CallID, error) `perm:"admin"` - FinalizeSector func(ctx context.Context, sector storage.SectorRef, keepUnsealed []storage.Range) (storiface.CallID, error) `perm:"admin"` - ReleaseUnsealed func(ctx context.Context, sector storage.SectorRef, safeToFree []storage.Range) (storiface.CallID, error) `perm:"admin"` - MoveStorage func(ctx context.Context, sector storage.SectorRef, types storiface.SectorFileType) (storiface.CallID, error) `perm:"admin"` - UnsealPiece func(context.Context, storage.SectorRef, storiface.UnpaddedByteIndex, abi.UnpaddedPieceSize, abi.SealRandomness, cid.Cid) (storiface.CallID, error) `perm:"admin"` - ReadPiece func(context.Context, io.Writer, storage.SectorRef, storiface.UnpaddedByteIndex, abi.UnpaddedPieceSize) (storiface.CallID, error) `perm:"admin"` - Fetch func(context.Context, storage.SectorRef, storiface.SectorFileType, storiface.PathType, storiface.AcquireMode) (storiface.CallID, error) `perm:"admin"` + DealsSetConsiderOnlineRetrievalDeals func(p0 context.Context, p1 bool) error `perm:"admin"` - TaskDisable func(ctx context.Context, tt sealtasks.TaskType) error `perm:"admin"` - TaskEnable func(ctx context.Context, tt sealtasks.TaskType) error `perm:"admin"` + DealsSetConsiderOnlineStorageDeals func(p0 context.Context, p1 bool) error `perm:"admin"` - Remove func(ctx context.Context, sector abi.SectorID) error `perm:"admin"` - StorageAddLocal func(ctx context.Context, path string) error `perm:"admin"` + DealsSetConsiderUnverifiedStorageDeals func(p0 context.Context, p1 bool) error `perm:"admin"` - SetEnabled func(ctx context.Context, enabled bool) error `perm:"admin"` - Enabled func(ctx context.Context) (bool, error) `perm:"admin"` + DealsSetConsiderVerifiedStorageDeals func(p0 context.Context, p1 bool) error `perm:"admin"` - WaitQuiet func(ctx context.Context) error `perm:"admin"` + DealsSetPieceCidBlocklist func(p0 context.Context, p1 []cid.Cid) error `perm:"admin"` - ProcessSession func(context.Context) (uuid.UUID, error) `perm:"admin"` - Session func(context.Context) (uuid.UUID, error) `perm:"admin"` - } -} + MarketCancelDataTransfer func(p0 context.Context, p1 datatransfer.TransferID, p2 peer.ID, p3 bool) error `perm:"write"` -type GatewayStruct struct { - Internal struct { - ChainGetBlockMessages func(ctx context.Context, c cid.Cid) (*api.BlockMessages, error) - ChainGetMessage func(ctx context.Context, mc cid.Cid) (*types.Message, error) - ChainGetTipSet func(ctx context.Context, tsk types.TipSetKey) (*types.TipSet, error) - ChainGetTipSetByHeight func(ctx context.Context, h abi.ChainEpoch, tsk types.TipSetKey) (*types.TipSet, error) - ChainHasObj func(context.Context, cid.Cid) (bool, error) - ChainHead func(ctx context.Context) (*types.TipSet, error) - ChainNotify func(ctx context.Context) (<-chan []*api.HeadChange, error) - ChainReadObj func(context.Context, cid.Cid) ([]byte, error) - GasEstimateMessageGas func(ctx context.Context, msg *types.Message, spec *api.MessageSendSpec, tsk types.TipSetKey) (*types.Message, error) - MpoolPush func(ctx context.Context, sm *types.SignedMessage) (cid.Cid, error) - MsigGetAvailableBalance func(ctx context.Context, addr address.Address, tsk types.TipSetKey) (types.BigInt, error) - MsigGetVested func(ctx context.Context, addr address.Address, start types.TipSetKey, end types.TipSetKey) (types.BigInt, error) - MsigGetPending func(context.Context, address.Address, types.TipSetKey) ([]*api.MsigTransaction, error) - StateAccountKey func(ctx context.Context, addr address.Address, tsk types.TipSetKey) (address.Address, error) - StateDealProviderCollateralBounds func(ctx context.Context, size abi.PaddedPieceSize, verified bool, tsk types.TipSetKey) (api.DealCollateralBounds, error) - StateGetActor func(ctx context.Context, actor address.Address, ts types.TipSetKey) (*types.Actor, error) - StateGetReceipt func(ctx context.Context, c cid.Cid, tsk types.TipSetKey) (*types.MessageReceipt, error) - StateLookupID func(ctx context.Context, addr address.Address, tsk types.TipSetKey) (address.Address, error) - StateListMiners func(ctx context.Context, tsk types.TipSetKey) ([]address.Address, error) - StateMinerInfo func(ctx context.Context, actor address.Address, tsk types.TipSetKey) (miner.MinerInfo, error) - StateMinerProvingDeadline func(ctx context.Context, addr address.Address, tsk types.TipSetKey) (*dline.Info, error) - StateMinerPower func(context.Context, address.Address, types.TipSetKey) (*api.MinerPower, error) - StateMarketBalance func(ctx context.Context, addr address.Address, tsk types.TipSetKey) (api.MarketBalance, error) - StateMarketStorageDeal func(ctx context.Context, dealId abi.DealID, tsk types.TipSetKey) (*api.MarketDeal, error) - StateReadState func(context.Context, address.Address, types.TipSetKey) (*api.ActorState, error) - StateNetworkVersion func(ctx context.Context, tsk types.TipSetKey) (stnetwork.Version, error) - StateSearchMsg func(ctx context.Context, msg cid.Cid) (*api.MsgLookup, error) - StateSectorGetInfo func(ctx context.Context, maddr address.Address, n abi.SectorNumber, tsk types.TipSetKey) (*miner.SectorOnChainInfo, error) - StateVerifiedClientStatus func(ctx context.Context, addr address.Address, tsk types.TipSetKey) (*abi.StoragePower, error) - StateWaitMsg func(ctx context.Context, msg cid.Cid, confidence uint64) (*api.MsgLookup, error) + MarketDataTransferUpdates func(p0 context.Context) (<-chan api.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) ([]api.DataTransferChannel, error) `perm:"write"` + + MarketListDeals func(p0 context.Context) ([]api.MarketDeal, error) `perm:"read"` + + MarketListIncompleteDeals func(p0 context.Context) ([]storagemarket.MinerDeal, error) `perm:"read"` + + MarketListRetrievalDeals func(p0 context.Context) ([]retrievalmarket.ProviderDealState, error) `perm:"read"` + + MarketPendingDeals func(p0 context.Context) (api.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"` + + 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"` + + ReturnAddPiece func(p0 context.Context, p1 storiface.CallID, p2 abi.PieceInfo, p3 *storiface.CallError) error `perm:"admin"` + + ReturnFetch func(p0 context.Context, p1 storiface.CallID, p2 *storiface.CallError) error `perm:"admin"` + + ReturnFinalizeSector func(p0 context.Context, p1 storiface.CallID, p2 *storiface.CallError) error `perm:"admin"` + + ReturnMoveStorage func(p0 context.Context, p1 storiface.CallID, p2 *storiface.CallError) error `perm:"admin"` + + ReturnReadPiece func(p0 context.Context, p1 storiface.CallID, p2 bool, p3 *storiface.CallError) error `perm:"admin"` + + ReturnReleaseUnsealed func(p0 context.Context, p1 storiface.CallID, p2 *storiface.CallError) error `perm:"admin"` + + ReturnSealCommit1 func(p0 context.Context, p1 storiface.CallID, p2 storage.Commit1Out, p3 *storiface.CallError) error `perm:"admin"` + + ReturnSealCommit2 func(p0 context.Context, p1 storiface.CallID, p2 storage.Proof, p3 *storiface.CallError) error `perm:"admin"` + + ReturnSealPreCommit1 func(p0 context.Context, p1 storiface.CallID, p2 storage.PreCommit1Out, p3 *storiface.CallError) error `perm:"admin"` + + ReturnSealPreCommit2 func(p0 context.Context, p1 storiface.CallID, p2 storage.SectorCids, p3 *storiface.CallError) error `perm:"admin"` + + ReturnUnsealPiece func(p0 context.Context, p1 storiface.CallID, p2 *storiface.CallError) error `perm:"admin"` + + SealingAbort func(p0 context.Context, p1 storiface.CallID) error `perm:"admin"` + + SealingSchedDiag func(p0 context.Context, p1 bool) (interface{}, error) `perm:"admin"` + + SectorGetExpectedSealDuration func(p0 context.Context) (time.Duration, error) `perm:"read"` + + SectorGetSealDelay func(p0 context.Context) (time.Duration, error) `perm:"read"` + + SectorMarkForUpgrade func(p0 context.Context, p1 abi.SectorNumber) error `perm:"admin"` + + SectorRemove func(p0 context.Context, p1 abi.SectorNumber) error `perm:"admin"` + + SectorSetExpectedSealDuration func(p0 context.Context, p1 time.Duration) error `perm:"write"` + + SectorSetSealDelay func(p0 context.Context, p1 time.Duration) error `perm:"write"` + + SectorStartSealing func(p0 context.Context, p1 abi.SectorNumber) error `perm:"write"` + + SectorTerminate func(p0 context.Context, p1 abi.SectorNumber) error `perm:"admin"` + + SectorTerminateFlush func(p0 context.Context) (*cid.Cid, error) `perm:"admin"` + + SectorTerminatePending func(p0 context.Context) ([]abi.SectorID, error) `perm:"admin"` + + SectorsList func(p0 context.Context) ([]abi.SectorNumber, error) `perm:"read"` + + SectorsListInStates func(p0 context.Context, p1 []api.SectorState) ([]abi.SectorNumber, error) `perm:"read"` + + SectorsRefs func(p0 context.Context) (map[string][]api.SealedRef, error) `perm:"read"` + + SectorsStatus func(p0 context.Context, p1 abi.SectorNumber, p2 bool) (api.SectorInfo, error) `perm:"read"` + + SectorsSummary func(p0 context.Context) (map[api.SectorState]int, error) `perm:"read"` + + SectorsUpdate func(p0 context.Context, p1 abi.SectorNumber, p2 api.SectorState) error `perm:"admin"` + + StorageAddLocal func(p0 context.Context, p1 string) error `perm:"admin"` + + StorageAttach func(p0 context.Context, p1 stores.StorageInfo, p2 fsutil.FsStat) error `perm:"admin"` + + StorageBestAlloc func(p0 context.Context, p1 storiface.SectorFileType, p2 abi.SectorSize, p3 storiface.PathType) ([]stores.StorageInfo, error) `perm:"admin"` + + StorageDeclareSector func(p0 context.Context, p1 stores.ID, p2 abi.SectorID, p3 storiface.SectorFileType, p4 bool) error `perm:"admin"` + + StorageDropSector func(p0 context.Context, p1 stores.ID, p2 abi.SectorID, p3 storiface.SectorFileType) error `perm:"admin"` + + StorageFindSector func(p0 context.Context, p1 abi.SectorID, p2 storiface.SectorFileType, p3 abi.SectorSize, p4 bool) ([]stores.SectorStorageInfo, error) `perm:"admin"` + + StorageInfo func(p0 context.Context, p1 stores.ID) (stores.StorageInfo, error) `perm:"admin"` + + StorageList func(p0 context.Context) (map[stores.ID][]stores.Decl, error) `perm:"admin"` + + StorageLocal func(p0 context.Context) (map[stores.ID]string, error) `perm:"admin"` + + StorageLock func(p0 context.Context, p1 abi.SectorID, p2 storiface.SectorFileType, p3 storiface.SectorFileType) error `perm:"admin"` + + StorageReportHealth func(p0 context.Context, p1 stores.ID, p2 stores.HealthReport) error `perm:"admin"` + + StorageStat func(p0 context.Context, p1 stores.ID) (fsutil.FsStat, error) `perm:"admin"` + + StorageTryLock func(p0 context.Context, p1 abi.SectorID, p2 storiface.SectorFileType, p3 storiface.SectorFileType) (bool, error) `perm:"admin"` + + WorkerConnect func(p0 context.Context, p1 string) error `perm:"admin"` + + WorkerJobs func(p0 context.Context) (map[uuid.UUID][]storiface.WorkerJob, error) `perm:"admin"` + + WorkerStats func(p0 context.Context) (map[uuid.UUID]storiface.WorkerStats, error) `perm:"admin"` } } type WalletStruct struct { Internal struct { - WalletNew func(context.Context, types.KeyType) (address.Address, error) `perm:"write"` - WalletHas func(context.Context, address.Address) (bool, error) `perm:"write"` - WalletList func(context.Context) ([]address.Address, error) `perm:"write"` - WalletSign func(context.Context, address.Address, []byte, api.MsgMeta) (*crypto.Signature, error) `perm:"sign"` - WalletExport func(context.Context, address.Address) (*types.KeyInfo, error) `perm:"admin"` - WalletImport func(context.Context, *types.KeyInfo) (address.Address, error) `perm:"admin"` - WalletDelete func(context.Context, address.Address) error `perm:"write"` + WalletDelete func(p0 context.Context, p1 address.Address) error `` + + WalletExport func(p0 context.Context, p1 address.Address) (*types.KeyInfo, error) `` + + WalletHas func(p0 context.Context, p1 address.Address) (bool, error) `` + + WalletImport func(p0 context.Context, p1 *types.KeyInfo) (address.Address, error) `` + + WalletList func(p0 context.Context) ([]address.Address, error) `` + + WalletNew func(p0 context.Context, p1 types.KeyType) (address.Address, error) `` + + WalletSign func(p0 context.Context, p1 address.Address, p2 []byte, p3 api.MsgMeta) (*crypto.Signature, error) `` } } -// CommonStruct +type WorkerStruct struct { + Internal struct { + AddPiece func(p0 context.Context, p1 storage.SectorRef, p2 []abi.UnpaddedPieceSize, p3 abi.UnpaddedPieceSize, p4 storage.Data) (storiface.CallID, error) `perm:"admin"` -func (c *CommonStruct) AuthVerify(ctx context.Context, token string) ([]auth.Permission, error) { - return c.Internal.AuthVerify(ctx, token) + Enabled func(p0 context.Context) (bool, error) `perm:"admin"` + + Fetch func(p0 context.Context, p1 storage.SectorRef, p2 storiface.SectorFileType, p3 storiface.PathType, p4 storiface.AcquireMode) (storiface.CallID, error) `perm:"admin"` + + FinalizeSector func(p0 context.Context, p1 storage.SectorRef, p2 []storage.Range) (storiface.CallID, error) `perm:"admin"` + + Info func(p0 context.Context) (storiface.WorkerInfo, error) `perm:"admin"` + + MoveStorage func(p0 context.Context, p1 storage.SectorRef, p2 storiface.SectorFileType) (storiface.CallID, error) `perm:"admin"` + + Paths func(p0 context.Context) ([]stores.StoragePath, error) `perm:"admin"` + + ProcessSession func(p0 context.Context) (uuid.UUID, error) `perm:"admin"` + + ReadPiece func(p0 context.Context, p1 io.Writer, p2 storage.SectorRef, p3 storiface.UnpaddedByteIndex, p4 abi.UnpaddedPieceSize) (storiface.CallID, error) `perm:"admin"` + + ReleaseUnsealed func(p0 context.Context, p1 storage.SectorRef, p2 []storage.Range) (storiface.CallID, error) `perm:"admin"` + + Remove func(p0 context.Context, p1 abi.SectorID) error `perm:"admin"` + + SealCommit1 func(p0 context.Context, p1 storage.SectorRef, p2 abi.SealRandomness, p3 abi.InteractiveSealRandomness, p4 []abi.PieceInfo, p5 storage.SectorCids) (storiface.CallID, error) `perm:"admin"` + + SealCommit2 func(p0 context.Context, p1 storage.SectorRef, p2 storage.Commit1Out) (storiface.CallID, error) `perm:"admin"` + + SealPreCommit1 func(p0 context.Context, p1 storage.SectorRef, p2 abi.SealRandomness, p3 []abi.PieceInfo) (storiface.CallID, error) `perm:"admin"` + + SealPreCommit2 func(p0 context.Context, p1 storage.SectorRef, p2 storage.PreCommit1Out) (storiface.CallID, error) `perm:"admin"` + + Session func(p0 context.Context) (uuid.UUID, error) `perm:"admin"` + + SetEnabled func(p0 context.Context, p1 bool) error `perm:"admin"` + + StorageAddLocal func(p0 context.Context, p1 string) error `perm:"admin"` + + TaskDisable func(p0 context.Context, p1 sealtasks.TaskType) error `perm:"admin"` + + TaskEnable func(p0 context.Context, p1 sealtasks.TaskType) error `perm:"admin"` + + TaskTypes func(p0 context.Context) (map[sealtasks.TaskType]struct{}, error) `perm:"admin"` + + UnsealPiece func(p0 context.Context, p1 storage.SectorRef, p2 storiface.UnpaddedByteIndex, p3 abi.UnpaddedPieceSize, p4 abi.SealRandomness, p5 cid.Cid) (storiface.CallID, error) `perm:"admin"` + + Version func(p0 context.Context) (api.Version, error) `perm:"admin"` + + WaitQuiet func(p0 context.Context) error `perm:"admin"` + } +} + +func (s *ChainIOStruct) ChainHasObj(p0 context.Context, p1 cid.Cid) (bool, error) { + return s.Internal.ChainHasObj(p0, p1) +} + +func (s *ChainIOStruct) ChainReadObj(p0 context.Context, p1 cid.Cid) ([]byte, error) { + return s.Internal.ChainReadObj(p0, p1) +} + +func (s *CommonStruct) AuthNew(p0 context.Context, p1 []auth.Permission) ([]byte, error) { + return s.Internal.AuthNew(p0, p1) +} + +func (s *CommonStruct) AuthVerify(p0 context.Context, p1 string) ([]auth.Permission, error) { + return s.Internal.AuthVerify(p0, p1) } -func (c *CommonStruct) AuthNew(ctx context.Context, perms []auth.Permission) ([]byte, error) { - return c.Internal.AuthNew(ctx, perms) +func (s *CommonStruct) Closing(p0 context.Context) (<-chan struct{}, error) { + return s.Internal.Closing(p0) } -func (c *CommonStruct) NetPubsubScores(ctx context.Context) ([]api.PubsubScore, error) { - return c.Internal.NetPubsubScores(ctx) +func (s *CommonStruct) Discover(p0 context.Context) (apitypes.OpenRPCDocument, error) { + return s.Internal.Discover(p0) } -func (c *CommonStruct) NetConnectedness(ctx context.Context, pid peer.ID) (network.Connectedness, error) { - return c.Internal.NetConnectedness(ctx, pid) +func (s *CommonStruct) ID(p0 context.Context) (peer.ID, error) { + return s.Internal.ID(p0) } -func (c *CommonStruct) NetPeers(ctx context.Context) ([]peer.AddrInfo, error) { - return c.Internal.NetPeers(ctx) +func (s *CommonStruct) LogList(p0 context.Context) ([]string, error) { + return s.Internal.LogList(p0) } -func (c *CommonStruct) NetConnect(ctx context.Context, p peer.AddrInfo) error { - return c.Internal.NetConnect(ctx, p) +func (s *CommonStruct) LogSetLevel(p0 context.Context, p1 string, p2 string) error { + return s.Internal.LogSetLevel(p0, p1, p2) } -func (c *CommonStruct) NetAddrsListen(ctx context.Context) (peer.AddrInfo, error) { - return c.Internal.NetAddrsListen(ctx) +func (s *CommonStruct) NetAddrsListen(p0 context.Context) (peer.AddrInfo, error) { + return s.Internal.NetAddrsListen(p0) } -func (c *CommonStruct) NetDisconnect(ctx context.Context, p peer.ID) error { - return c.Internal.NetDisconnect(ctx, p) +func (s *CommonStruct) NetAgentVersion(p0 context.Context, p1 peer.ID) (string, error) { + return s.Internal.NetAgentVersion(p0, p1) } -func (c *CommonStruct) NetFindPeer(ctx context.Context, p peer.ID) (peer.AddrInfo, error) { - return c.Internal.NetFindPeer(ctx, p) +func (s *CommonStruct) NetAutoNatStatus(p0 context.Context) (api.NatInfo, error) { + return s.Internal.NetAutoNatStatus(p0) } -func (c *CommonStruct) NetAutoNatStatus(ctx context.Context) (api.NatInfo, error) { - return c.Internal.NetAutoNatStatus(ctx) +func (s *CommonStruct) NetBandwidthStats(p0 context.Context) (metrics.Stats, error) { + return s.Internal.NetBandwidthStats(p0) } -func (c *CommonStruct) NetBandwidthStats(ctx context.Context) (metrics.Stats, error) { - return c.Internal.NetBandwidthStats(ctx) +func (s *CommonStruct) NetBandwidthStatsByPeer(p0 context.Context) (map[string]metrics.Stats, error) { + return s.Internal.NetBandwidthStatsByPeer(p0) } -func (c *CommonStruct) NetBandwidthStatsByPeer(ctx context.Context) (map[string]metrics.Stats, error) { - return c.Internal.NetBandwidthStatsByPeer(ctx) +func (s *CommonStruct) NetBandwidthStatsByProtocol(p0 context.Context) (map[protocol.ID]metrics.Stats, error) { + return s.Internal.NetBandwidthStatsByProtocol(p0) } -func (c *CommonStruct) NetBandwidthStatsByProtocol(ctx context.Context) (map[protocol.ID]metrics.Stats, error) { - return c.Internal.NetBandwidthStatsByProtocol(ctx) +func (s *CommonStruct) NetBlockAdd(p0 context.Context, p1 api.NetBlockList) error { + return s.Internal.NetBlockAdd(p0, p1) } -func (c *CommonStruct) NetBlockAdd(ctx context.Context, acl api.NetBlockList) error { - return c.Internal.NetBlockAdd(ctx, acl) +func (s *CommonStruct) NetBlockList(p0 context.Context) (api.NetBlockList, error) { + return s.Internal.NetBlockList(p0) } -func (c *CommonStruct) NetBlockRemove(ctx context.Context, acl api.NetBlockList) error { - return c.Internal.NetBlockRemove(ctx, acl) +func (s *CommonStruct) NetBlockRemove(p0 context.Context, p1 api.NetBlockList) error { + return s.Internal.NetBlockRemove(p0, p1) } -func (c *CommonStruct) NetBlockList(ctx context.Context) (api.NetBlockList, error) { - return c.Internal.NetBlockList(ctx) +func (s *CommonStruct) NetConnect(p0 context.Context, p1 peer.AddrInfo) error { + return s.Internal.NetConnect(p0, p1) } -func (c *CommonStruct) NetAgentVersion(ctx context.Context, p peer.ID) (string, error) { - return c.Internal.NetAgentVersion(ctx, p) +func (s *CommonStruct) NetConnectedness(p0 context.Context, p1 peer.ID) (network.Connectedness, error) { + return s.Internal.NetConnectedness(p0, p1) } -func (c *CommonStruct) NetPeerInfo(ctx context.Context, p peer.ID) (*api.ExtendedPeerInfo, error) { - return c.Internal.NetPeerInfo(ctx, p) +func (s *CommonStruct) NetDisconnect(p0 context.Context, p1 peer.ID) error { + return s.Internal.NetDisconnect(p0, p1) } -// ID implements API.ID -func (c *CommonStruct) ID(ctx context.Context) (peer.ID, error) { - return c.Internal.ID(ctx) +func (s *CommonStruct) NetFindPeer(p0 context.Context, p1 peer.ID) (peer.AddrInfo, error) { + return s.Internal.NetFindPeer(p0, p1) } -// Version implements API.Version -func (c *CommonStruct) Version(ctx context.Context) (api.APIVersion, error) { - return c.Internal.Version(ctx) +func (s *CommonStruct) NetPeerInfo(p0 context.Context, p1 peer.ID) (*api.ExtendedPeerInfo, error) { + return s.Internal.NetPeerInfo(p0, p1) } -func (c *CommonStruct) LogList(ctx context.Context) ([]string, error) { - return c.Internal.LogList(ctx) +func (s *CommonStruct) NetPeers(p0 context.Context) ([]peer.AddrInfo, error) { + return s.Internal.NetPeers(p0) } -func (c *CommonStruct) LogSetLevel(ctx context.Context, group, level string) error { - return c.Internal.LogSetLevel(ctx, group, level) +func (s *CommonStruct) NetPubsubScores(p0 context.Context) ([]api.PubsubScore, error) { + return s.Internal.NetPubsubScores(p0) } -func (c *CommonStruct) Shutdown(ctx context.Context) error { - return c.Internal.Shutdown(ctx) +func (s *CommonStruct) Session(p0 context.Context) (uuid.UUID, error) { + return s.Internal.Session(p0) } -func (c *CommonStruct) Session(ctx context.Context) (uuid.UUID, error) { - return c.Internal.Session(ctx) +func (s *CommonStruct) Shutdown(p0 context.Context) error { + return s.Internal.Shutdown(p0) } -func (c *CommonStruct) Closing(ctx context.Context) (<-chan struct{}, error) { - return c.Internal.Closing(ctx) +func (s *CommonStruct) Version(p0 context.Context) (api.APIVersion, error) { + return s.Internal.Version(p0) } -// FullNodeStruct +func (s *FullNodeStruct) BeaconGetEntry(p0 context.Context, p1 abi.ChainEpoch) (*types.BeaconEntry, error) { + return s.Internal.BeaconGetEntry(p0, p1) +} -func (c *FullNodeStruct) ClientListImports(ctx context.Context) ([]api.Import, error) { - return c.Internal.ClientListImports(ctx) +func (s *FullNodeStruct) ChainDeleteObj(p0 context.Context, p1 cid.Cid) error { + return s.Internal.ChainDeleteObj(p0, p1) } -func (c *FullNodeStruct) ClientRemoveImport(ctx context.Context, importID multistore.StoreID) error { - return c.Internal.ClientRemoveImport(ctx, importID) +func (s *FullNodeStruct) ChainExport(p0 context.Context, p1 abi.ChainEpoch, p2 bool, p3 types.TipSetKey) (<-chan []byte, error) { + return s.Internal.ChainExport(p0, p1, p2, p3) } -func (c *FullNodeStruct) ClientImport(ctx context.Context, ref api.FileRef) (*api.ImportRes, error) { - return c.Internal.ClientImport(ctx, ref) +func (s *FullNodeStruct) ChainGetBlock(p0 context.Context, p1 cid.Cid) (*types.BlockHeader, error) { + return s.Internal.ChainGetBlock(p0, p1) } -func (c *FullNodeStruct) ClientHasLocal(ctx context.Context, root cid.Cid) (bool, error) { - return c.Internal.ClientHasLocal(ctx, root) +func (s *FullNodeStruct) ChainGetBlockMessages(p0 context.Context, p1 cid.Cid) (*api.BlockMessages, error) { + return s.Internal.ChainGetBlockMessages(p0, p1) } -func (c *FullNodeStruct) ClientFindData(ctx context.Context, root cid.Cid, piece *cid.Cid) ([]api.QueryOffer, error) { - return c.Internal.ClientFindData(ctx, root, piece) +func (s *FullNodeStruct) ChainGetGenesis(p0 context.Context) (*types.TipSet, error) { + return s.Internal.ChainGetGenesis(p0) } -func (c *FullNodeStruct) ClientMinerQueryOffer(ctx context.Context, miner address.Address, root cid.Cid, piece *cid.Cid) (api.QueryOffer, error) { - return c.Internal.ClientMinerQueryOffer(ctx, miner, root, piece) +func (s *FullNodeStruct) ChainGetMessage(p0 context.Context, p1 cid.Cid) (*types.Message, error) { + return s.Internal.ChainGetMessage(p0, p1) } -func (c *FullNodeStruct) ClientStartDeal(ctx context.Context, params *api.StartDealParams) (*cid.Cid, error) { - return c.Internal.ClientStartDeal(ctx, params) +func (s *FullNodeStruct) ChainGetNode(p0 context.Context, p1 string) (*api.IpldObject, error) { + return s.Internal.ChainGetNode(p0, p1) } -func (c *FullNodeStruct) ClientStatelessDeal(ctx context.Context, params *api.StartDealParams) (*cid.Cid, error) { - return c.Internal.ClientStatelessDeal(ctx, params) +func (s *FullNodeStruct) ChainGetParentMessages(p0 context.Context, p1 cid.Cid) ([]api.Message, error) { + return s.Internal.ChainGetParentMessages(p0, p1) } -func (c *FullNodeStruct) ClientGetDealInfo(ctx context.Context, deal cid.Cid) (*api.DealInfo, error) { - return c.Internal.ClientGetDealInfo(ctx, deal) +func (s *FullNodeStruct) ChainGetParentReceipts(p0 context.Context, p1 cid.Cid) ([]*types.MessageReceipt, error) { + return s.Internal.ChainGetParentReceipts(p0, p1) } -func (c *FullNodeStruct) ClientGetDealStatus(ctx context.Context, statusCode uint64) (string, error) { - return c.Internal.ClientGetDealStatus(ctx, statusCode) +func (s *FullNodeStruct) ChainGetPath(p0 context.Context, p1 types.TipSetKey, p2 types.TipSetKey) ([]*api.HeadChange, error) { + return s.Internal.ChainGetPath(p0, p1, p2) } -func (c *FullNodeStruct) ClientListDeals(ctx context.Context) ([]api.DealInfo, error) { - return c.Internal.ClientListDeals(ctx) +func (s *FullNodeStruct) ChainGetRandomnessFromBeacon(p0 context.Context, p1 types.TipSetKey, p2 crypto.DomainSeparationTag, p3 abi.ChainEpoch, p4 []byte) (abi.Randomness, error) { + return s.Internal.ChainGetRandomnessFromBeacon(p0, p1, p2, p3, p4) } -func (c *FullNodeStruct) ClientGetDealUpdates(ctx context.Context) (<-chan api.DealInfo, error) { - return c.Internal.ClientGetDealUpdates(ctx) +func (s *FullNodeStruct) ChainGetRandomnessFromTickets(p0 context.Context, p1 types.TipSetKey, p2 crypto.DomainSeparationTag, p3 abi.ChainEpoch, p4 []byte) (abi.Randomness, error) { + return s.Internal.ChainGetRandomnessFromTickets(p0, p1, p2, p3, p4) } -func (c *FullNodeStruct) ClientRetrieve(ctx context.Context, order api.RetrievalOrder, ref *api.FileRef) error { - return c.Internal.ClientRetrieve(ctx, order, ref) +func (s *FullNodeStruct) ChainGetTipSet(p0 context.Context, p1 types.TipSetKey) (*types.TipSet, error) { + return s.Internal.ChainGetTipSet(p0, p1) } -func (c *FullNodeStruct) ClientRetrieveWithEvents(ctx context.Context, order api.RetrievalOrder, ref *api.FileRef) (<-chan marketevents.RetrievalEvent, error) { - return c.Internal.ClientRetrieveWithEvents(ctx, order, ref) +func (s *FullNodeStruct) ChainGetTipSetByHeight(p0 context.Context, p1 abi.ChainEpoch, p2 types.TipSetKey) (*types.TipSet, error) { + return s.Internal.ChainGetTipSetByHeight(p0, p1, p2) } -func (c *FullNodeStruct) ClientQueryAsk(ctx context.Context, p peer.ID, miner address.Address) (*storagemarket.StorageAsk, error) { - return c.Internal.ClientQueryAsk(ctx, p, miner) +func (s *FullNodeStruct) ChainHasObj(p0 context.Context, p1 cid.Cid) (bool, error) { + return s.Internal.ChainHasObj(p0, p1) } -func (c *FullNodeStruct) ClientDealPieceCID(ctx context.Context, root cid.Cid) (api.DataCIDSize, error) { - return c.Internal.ClientDealPieceCID(ctx, root) +func (s *FullNodeStruct) ChainHead(p0 context.Context) (*types.TipSet, error) { + return s.Internal.ChainHead(p0) } -func (c *FullNodeStruct) ClientCalcCommP(ctx context.Context, inpath string) (*api.CommPRet, error) { - return c.Internal.ClientCalcCommP(ctx, inpath) +func (s *FullNodeStruct) ChainNotify(p0 context.Context) (<-chan []*api.HeadChange, error) { + return s.Internal.ChainNotify(p0) } -func (c *FullNodeStruct) ClientGenCar(ctx context.Context, ref api.FileRef, outpath string) error { - return c.Internal.ClientGenCar(ctx, ref, outpath) +func (s *FullNodeStruct) ChainReadObj(p0 context.Context, p1 cid.Cid) ([]byte, error) { + return s.Internal.ChainReadObj(p0, p1) } -func (c *FullNodeStruct) ClientDealSize(ctx context.Context, root cid.Cid) (api.DataSize, error) { - return c.Internal.ClientDealSize(ctx, root) +func (s *FullNodeStruct) ChainSetHead(p0 context.Context, p1 types.TipSetKey) error { + return s.Internal.ChainSetHead(p0, p1) } -func (c *FullNodeStruct) ClientListDataTransfers(ctx context.Context) ([]api.DataTransferChannel, error) { - return c.Internal.ClientListDataTransfers(ctx) +func (s *FullNodeStruct) ChainStatObj(p0 context.Context, p1 cid.Cid, p2 cid.Cid) (api.ObjStat, error) { + return s.Internal.ChainStatObj(p0, p1, p2) } -func (c *FullNodeStruct) ClientDataTransferUpdates(ctx context.Context) (<-chan api.DataTransferChannel, error) { - return c.Internal.ClientDataTransferUpdates(ctx) +func (s *FullNodeStruct) ChainTipSetWeight(p0 context.Context, p1 types.TipSetKey) (types.BigInt, error) { + return s.Internal.ChainTipSetWeight(p0, p1) } -func (c *FullNodeStruct) ClientRestartDataTransfer(ctx context.Context, transferID datatransfer.TransferID, otherPeer peer.ID, isInitiator bool) error { - return c.Internal.ClientRestartDataTransfer(ctx, transferID, otherPeer, isInitiator) +func (s *FullNodeStruct) ClientCalcCommP(p0 context.Context, p1 string) (*api.CommPRet, error) { + return s.Internal.ClientCalcCommP(p0, p1) } -func (c *FullNodeStruct) ClientCancelDataTransfer(ctx context.Context, transferID datatransfer.TransferID, otherPeer peer.ID, isInitiator bool) error { - return c.Internal.ClientCancelDataTransfer(ctx, transferID, otherPeer, isInitiator) +func (s *FullNodeStruct) ClientCancelDataTransfer(p0 context.Context, p1 datatransfer.TransferID, p2 peer.ID, p3 bool) error { + return s.Internal.ClientCancelDataTransfer(p0, p1, p2, p3) } -func (c *FullNodeStruct) ClientRetrieveTryRestartInsufficientFunds(ctx context.Context, paymentChannel address.Address) error { - return c.Internal.ClientRetrieveTryRestartInsufficientFunds(ctx, paymentChannel) +func (s *FullNodeStruct) ClientCancelRetrievalDeal(p0 context.Context, p1 retrievalmarket.DealID) error { + return s.Internal.ClientCancelRetrievalDeal(p0, p1) } -func (c *FullNodeStruct) GasEstimateGasPremium(ctx context.Context, nblocksincl uint64, sender address.Address, gaslimit int64, tsk types.TipSetKey) (types.BigInt, error) { - return c.Internal.GasEstimateGasPremium(ctx, nblocksincl, sender, gaslimit, tsk) +func (s *FullNodeStruct) ClientDataTransferUpdates(p0 context.Context) (<-chan api.DataTransferChannel, error) { + return s.Internal.ClientDataTransferUpdates(p0) } -func (c *FullNodeStruct) GasEstimateFeeCap(ctx context.Context, msg *types.Message, maxqueueblks int64, tsk types.TipSetKey) (types.BigInt, error) { - return c.Internal.GasEstimateFeeCap(ctx, msg, maxqueueblks, tsk) +func (s *FullNodeStruct) ClientDealPieceCID(p0 context.Context, p1 cid.Cid) (api.DataCIDSize, error) { + return s.Internal.ClientDealPieceCID(p0, p1) } -func (c *FullNodeStruct) GasEstimateMessageGas(ctx context.Context, msg *types.Message, spec *api.MessageSendSpec, tsk types.TipSetKey) (*types.Message, error) { - return c.Internal.GasEstimateMessageGas(ctx, msg, spec, tsk) +func (s *FullNodeStruct) ClientDealSize(p0 context.Context, p1 cid.Cid) (api.DataSize, error) { + return s.Internal.ClientDealSize(p0, p1) } -func (c *FullNodeStruct) GasEstimateGasLimit(ctx context.Context, msg *types.Message, tsk types.TipSetKey) (int64, error) { - return c.Internal.GasEstimateGasLimit(ctx, msg, tsk) +func (s *FullNodeStruct) ClientFindData(p0 context.Context, p1 cid.Cid, p2 *cid.Cid) ([]api.QueryOffer, error) { + return s.Internal.ClientFindData(p0, p1, p2) } -func (c *FullNodeStruct) MpoolGetConfig(ctx context.Context) (*types.MpoolConfig, error) { - return c.Internal.MpoolGetConfig(ctx) +func (s *FullNodeStruct) ClientGenCar(p0 context.Context, p1 api.FileRef, p2 string) error { + return s.Internal.ClientGenCar(p0, p1, p2) } -func (c *FullNodeStruct) MpoolSetConfig(ctx context.Context, cfg *types.MpoolConfig) error { - return c.Internal.MpoolSetConfig(ctx, cfg) +func (s *FullNodeStruct) ClientGetDealInfo(p0 context.Context, p1 cid.Cid) (*api.DealInfo, error) { + return s.Internal.ClientGetDealInfo(p0, p1) } -func (c *FullNodeStruct) MpoolSelect(ctx context.Context, tsk types.TipSetKey, tq float64) ([]*types.SignedMessage, error) { - return c.Internal.MpoolSelect(ctx, tsk, tq) +func (s *FullNodeStruct) ClientGetDealStatus(p0 context.Context, p1 uint64) (string, error) { + return s.Internal.ClientGetDealStatus(p0, p1) } -func (c *FullNodeStruct) MpoolPending(ctx context.Context, tsk types.TipSetKey) ([]*types.SignedMessage, error) { - return c.Internal.MpoolPending(ctx, tsk) +func (s *FullNodeStruct) ClientGetDealUpdates(p0 context.Context) (<-chan api.DealInfo, error) { + return s.Internal.ClientGetDealUpdates(p0) } -func (c *FullNodeStruct) MpoolClear(ctx context.Context, local bool) error { - return c.Internal.MpoolClear(ctx, local) +func (s *FullNodeStruct) ClientHasLocal(p0 context.Context, p1 cid.Cid) (bool, error) { + return s.Internal.ClientHasLocal(p0, p1) } -func (c *FullNodeStruct) MpoolPush(ctx context.Context, smsg *types.SignedMessage) (cid.Cid, error) { - return c.Internal.MpoolPush(ctx, smsg) +func (s *FullNodeStruct) ClientImport(p0 context.Context, p1 api.FileRef) (*api.ImportRes, error) { + return s.Internal.ClientImport(p0, p1) } -func (c *FullNodeStruct) MpoolPushUntrusted(ctx context.Context, smsg *types.SignedMessage) (cid.Cid, error) { - return c.Internal.MpoolPushUntrusted(ctx, smsg) +func (s *FullNodeStruct) ClientListDataTransfers(p0 context.Context) ([]api.DataTransferChannel, error) { + return s.Internal.ClientListDataTransfers(p0) } -func (c *FullNodeStruct) MpoolPushMessage(ctx context.Context, msg *types.Message, spec *api.MessageSendSpec) (*types.SignedMessage, error) { - return c.Internal.MpoolPushMessage(ctx, msg, spec) +func (s *FullNodeStruct) ClientListDeals(p0 context.Context) ([]api.DealInfo, error) { + return s.Internal.ClientListDeals(p0) } -func (c *FullNodeStruct) MpoolBatchPush(ctx context.Context, smsgs []*types.SignedMessage) ([]cid.Cid, error) { - return c.Internal.MpoolBatchPush(ctx, smsgs) +func (s *FullNodeStruct) ClientListImports(p0 context.Context) ([]api.Import, error) { + return s.Internal.ClientListImports(p0) } -func (c *FullNodeStruct) MpoolBatchPushUntrusted(ctx context.Context, smsgs []*types.SignedMessage) ([]cid.Cid, error) { - return c.Internal.MpoolBatchPushUntrusted(ctx, smsgs) +func (s *FullNodeStruct) ClientMinerQueryOffer(p0 context.Context, p1 address.Address, p2 cid.Cid, p3 *cid.Cid) (api.QueryOffer, error) { + return s.Internal.ClientMinerQueryOffer(p0, p1, p2, p3) } -func (c *FullNodeStruct) MpoolBatchPushMessage(ctx context.Context, msgs []*types.Message, spec *api.MessageSendSpec) ([]*types.SignedMessage, error) { - return c.Internal.MpoolBatchPushMessage(ctx, msgs, spec) +func (s *FullNodeStruct) ClientQueryAsk(p0 context.Context, p1 peer.ID, p2 address.Address) (*storagemarket.StorageAsk, error) { + return s.Internal.ClientQueryAsk(p0, p1, p2) } -func (c *FullNodeStruct) MpoolSub(ctx context.Context) (<-chan api.MpoolUpdate, error) { - return c.Internal.MpoolSub(ctx) +func (s *FullNodeStruct) ClientRemoveImport(p0 context.Context, p1 multistore.StoreID) error { + return s.Internal.ClientRemoveImport(p0, p1) } -func (c *FullNodeStruct) MinerGetBaseInfo(ctx context.Context, maddr address.Address, epoch abi.ChainEpoch, tsk types.TipSetKey) (*api.MiningBaseInfo, error) { - return c.Internal.MinerGetBaseInfo(ctx, maddr, epoch, tsk) +func (s *FullNodeStruct) ClientRestartDataTransfer(p0 context.Context, p1 datatransfer.TransferID, p2 peer.ID, p3 bool) error { + return s.Internal.ClientRestartDataTransfer(p0, p1, p2, p3) } -func (c *FullNodeStruct) MinerCreateBlock(ctx context.Context, bt *api.BlockTemplate) (*types.BlockMsg, error) { - return c.Internal.MinerCreateBlock(ctx, bt) +func (s *FullNodeStruct) ClientRetrieve(p0 context.Context, p1 api.RetrievalOrder, p2 *api.FileRef) error { + return s.Internal.ClientRetrieve(p0, p1, p2) } -func (c *FullNodeStruct) ChainHead(ctx context.Context) (*types.TipSet, error) { - return c.Internal.ChainHead(ctx) +func (s *FullNodeStruct) ClientRetrieveTryRestartInsufficientFunds(p0 context.Context, p1 address.Address) error { + return s.Internal.ClientRetrieveTryRestartInsufficientFunds(p0, p1) } -func (c *FullNodeStruct) ChainGetRandomnessFromTickets(ctx context.Context, tsk types.TipSetKey, personalization crypto.DomainSeparationTag, randEpoch abi.ChainEpoch, entropy []byte) (abi.Randomness, error) { - return c.Internal.ChainGetRandomnessFromTickets(ctx, tsk, personalization, randEpoch, entropy) +func (s *FullNodeStruct) ClientRetrieveWithEvents(p0 context.Context, p1 api.RetrievalOrder, p2 *api.FileRef) (<-chan marketevents.RetrievalEvent, error) { + return s.Internal.ClientRetrieveWithEvents(p0, p1, p2) } -func (c *FullNodeStruct) ChainGetRandomnessFromBeacon(ctx context.Context, tsk types.TipSetKey, personalization crypto.DomainSeparationTag, randEpoch abi.ChainEpoch, entropy []byte) (abi.Randomness, error) { - return c.Internal.ChainGetRandomnessFromBeacon(ctx, tsk, personalization, randEpoch, entropy) +func (s *FullNodeStruct) ClientStartDeal(p0 context.Context, p1 *api.StartDealParams) (*cid.Cid, error) { + return s.Internal.ClientStartDeal(p0, p1) } -func (c *FullNodeStruct) ChainGetTipSetByHeight(ctx context.Context, h abi.ChainEpoch, tsk types.TipSetKey) (*types.TipSet, error) { - return c.Internal.ChainGetTipSetByHeight(ctx, h, tsk) +func (s *FullNodeStruct) ClientStatelessDeal(p0 context.Context, p1 *api.StartDealParams) (*cid.Cid, error) { + return s.Internal.ClientStatelessDeal(p0, p1) } -func (c *FullNodeStruct) WalletNew(ctx context.Context, typ types.KeyType) (address.Address, error) { - return c.Internal.WalletNew(ctx, typ) +func (s *FullNodeStruct) CreateBackup(p0 context.Context, p1 string) error { + return s.Internal.CreateBackup(p0, p1) } -func (c *FullNodeStruct) WalletHas(ctx context.Context, addr address.Address) (bool, error) { - return c.Internal.WalletHas(ctx, addr) +func (s *FullNodeStruct) GasEstimateFeeCap(p0 context.Context, p1 *types.Message, p2 int64, p3 types.TipSetKey) (types.BigInt, error) { + return s.Internal.GasEstimateFeeCap(p0, p1, p2, p3) } -func (c *FullNodeStruct) WalletList(ctx context.Context) ([]address.Address, error) { - return c.Internal.WalletList(ctx) +func (s *FullNodeStruct) GasEstimateGasLimit(p0 context.Context, p1 *types.Message, p2 types.TipSetKey) (int64, error) { + return s.Internal.GasEstimateGasLimit(p0, p1, p2) } -func (c *FullNodeStruct) WalletBalance(ctx context.Context, a address.Address) (types.BigInt, error) { - return c.Internal.WalletBalance(ctx, a) +func (s *FullNodeStruct) GasEstimateGasPremium(p0 context.Context, p1 uint64, p2 address.Address, p3 int64, p4 types.TipSetKey) (types.BigInt, error) { + return s.Internal.GasEstimateGasPremium(p0, p1, p2, p3, p4) } -func (c *FullNodeStruct) WalletSign(ctx context.Context, k address.Address, msg []byte) (*crypto.Signature, error) { - return c.Internal.WalletSign(ctx, k, msg) +func (s *FullNodeStruct) GasEstimateMessageGas(p0 context.Context, p1 *types.Message, p2 *api.MessageSendSpec, p3 types.TipSetKey) (*types.Message, error) { + return s.Internal.GasEstimateMessageGas(p0, p1, p2, p3) } -func (c *FullNodeStruct) WalletSignMessage(ctx context.Context, k address.Address, msg *types.Message) (*types.SignedMessage, error) { - return c.Internal.WalletSignMessage(ctx, k, msg) +func (s *FullNodeStruct) MarketAddBalance(p0 context.Context, p1 address.Address, p2 address.Address, p3 types.BigInt) (cid.Cid, error) { + return s.Internal.MarketAddBalance(p0, p1, p2, p3) } -func (c *FullNodeStruct) WalletVerify(ctx context.Context, k address.Address, msg []byte, sig *crypto.Signature) (bool, error) { - return c.Internal.WalletVerify(ctx, k, msg, sig) +func (s *FullNodeStruct) MarketGetReserved(p0 context.Context, p1 address.Address) (types.BigInt, error) { + return s.Internal.MarketGetReserved(p0, p1) } -func (c *FullNodeStruct) WalletDefaultAddress(ctx context.Context) (address.Address, error) { - return c.Internal.WalletDefaultAddress(ctx) +func (s *FullNodeStruct) MarketReleaseFunds(p0 context.Context, p1 address.Address, p2 types.BigInt) error { + return s.Internal.MarketReleaseFunds(p0, p1, p2) } -func (c *FullNodeStruct) WalletSetDefault(ctx context.Context, a address.Address) error { - return c.Internal.WalletSetDefault(ctx, a) +func (s *FullNodeStruct) MarketReserveFunds(p0 context.Context, p1 address.Address, p2 address.Address, p3 types.BigInt) (cid.Cid, error) { + return s.Internal.MarketReserveFunds(p0, p1, p2, p3) } -func (c *FullNodeStruct) WalletExport(ctx context.Context, a address.Address) (*types.KeyInfo, error) { - return c.Internal.WalletExport(ctx, a) +func (s *FullNodeStruct) MarketWithdraw(p0 context.Context, p1 address.Address, p2 address.Address, p3 types.BigInt) (cid.Cid, error) { + return s.Internal.MarketWithdraw(p0, p1, p2, p3) } -func (c *FullNodeStruct) WalletImport(ctx context.Context, ki *types.KeyInfo) (address.Address, error) { - return c.Internal.WalletImport(ctx, ki) +func (s *FullNodeStruct) MinerCreateBlock(p0 context.Context, p1 *api.BlockTemplate) (*types.BlockMsg, error) { + return s.Internal.MinerCreateBlock(p0, p1) } -func (c *FullNodeStruct) WalletDelete(ctx context.Context, addr address.Address) error { - return c.Internal.WalletDelete(ctx, addr) +func (s *FullNodeStruct) MinerGetBaseInfo(p0 context.Context, p1 address.Address, p2 abi.ChainEpoch, p3 types.TipSetKey) (*api.MiningBaseInfo, error) { + return s.Internal.MinerGetBaseInfo(p0, p1, p2, p3) } -func (c *FullNodeStruct) WalletValidateAddress(ctx context.Context, str string) (address.Address, error) { - return c.Internal.WalletValidateAddress(ctx, str) +func (s *FullNodeStruct) MpoolBatchPush(p0 context.Context, p1 []*types.SignedMessage) ([]cid.Cid, error) { + return s.Internal.MpoolBatchPush(p0, p1) } -func (c *FullNodeStruct) MpoolGetNonce(ctx context.Context, addr address.Address) (uint64, error) { - return c.Internal.MpoolGetNonce(ctx, addr) +func (s *FullNodeStruct) MpoolBatchPushMessage(p0 context.Context, p1 []*types.Message, p2 *api.MessageSendSpec) ([]*types.SignedMessage, error) { + return s.Internal.MpoolBatchPushMessage(p0, p1, p2) } -func (c *FullNodeStruct) ChainGetBlock(ctx context.Context, b cid.Cid) (*types.BlockHeader, error) { - return c.Internal.ChainGetBlock(ctx, b) +func (s *FullNodeStruct) MpoolBatchPushUntrusted(p0 context.Context, p1 []*types.SignedMessage) ([]cid.Cid, error) { + return s.Internal.MpoolBatchPushUntrusted(p0, p1) } -func (c *FullNodeStruct) ChainGetTipSet(ctx context.Context, key types.TipSetKey) (*types.TipSet, error) { - return c.Internal.ChainGetTipSet(ctx, key) +func (s *FullNodeStruct) MpoolClear(p0 context.Context, p1 bool) error { + return s.Internal.MpoolClear(p0, p1) } -func (c *FullNodeStruct) ChainGetBlockMessages(ctx context.Context, b cid.Cid) (*api.BlockMessages, error) { - return c.Internal.ChainGetBlockMessages(ctx, b) +func (s *FullNodeStruct) MpoolGetConfig(p0 context.Context) (*types.MpoolConfig, error) { + return s.Internal.MpoolGetConfig(p0) } -func (c *FullNodeStruct) ChainGetParentReceipts(ctx context.Context, b cid.Cid) ([]*types.MessageReceipt, error) { - return c.Internal.ChainGetParentReceipts(ctx, b) +func (s *FullNodeStruct) MpoolGetNonce(p0 context.Context, p1 address.Address) (uint64, error) { + return s.Internal.MpoolGetNonce(p0, p1) } -func (c *FullNodeStruct) ChainGetParentMessages(ctx context.Context, b cid.Cid) ([]api.Message, error) { - return c.Internal.ChainGetParentMessages(ctx, b) +func (s *FullNodeStruct) MpoolPending(p0 context.Context, p1 types.TipSetKey) ([]*types.SignedMessage, error) { + return s.Internal.MpoolPending(p0, p1) } -func (c *FullNodeStruct) ChainNotify(ctx context.Context) (<-chan []*api.HeadChange, error) { - return c.Internal.ChainNotify(ctx) +func (s *FullNodeStruct) MpoolPush(p0 context.Context, p1 *types.SignedMessage) (cid.Cid, error) { + return s.Internal.MpoolPush(p0, p1) } -func (c *FullNodeStruct) ChainReadObj(ctx context.Context, obj cid.Cid) ([]byte, error) { - return c.Internal.ChainReadObj(ctx, obj) +func (s *FullNodeStruct) MpoolPushMessage(p0 context.Context, p1 *types.Message, p2 *api.MessageSendSpec) (*types.SignedMessage, error) { + return s.Internal.MpoolPushMessage(p0, p1, p2) } -func (c *FullNodeStruct) ChainDeleteObj(ctx context.Context, obj cid.Cid) error { - return c.Internal.ChainDeleteObj(ctx, obj) +func (s *FullNodeStruct) MpoolPushUntrusted(p0 context.Context, p1 *types.SignedMessage) (cid.Cid, error) { + return s.Internal.MpoolPushUntrusted(p0, p1) } -func (c *FullNodeStruct) ChainHasObj(ctx context.Context, o cid.Cid) (bool, error) { - return c.Internal.ChainHasObj(ctx, o) +func (s *FullNodeStruct) MpoolSelect(p0 context.Context, p1 types.TipSetKey, p2 float64) ([]*types.SignedMessage, error) { + return s.Internal.MpoolSelect(p0, p1, p2) } -func (c *FullNodeStruct) ChainStatObj(ctx context.Context, obj, base cid.Cid) (api.ObjStat, error) { - return c.Internal.ChainStatObj(ctx, obj, base) +func (s *FullNodeStruct) MpoolSetConfig(p0 context.Context, p1 *types.MpoolConfig) error { + return s.Internal.MpoolSetConfig(p0, p1) } -func (c *FullNodeStruct) ChainSetHead(ctx context.Context, tsk types.TipSetKey) error { - return c.Internal.ChainSetHead(ctx, tsk) +func (s *FullNodeStruct) MpoolSub(p0 context.Context) (<-chan api.MpoolUpdate, error) { + return s.Internal.MpoolSub(p0) } -func (c *FullNodeStruct) ChainGetGenesis(ctx context.Context) (*types.TipSet, error) { - return c.Internal.ChainGetGenesis(ctx) +func (s *FullNodeStruct) MsigAddApprove(p0 context.Context, p1 address.Address, p2 address.Address, p3 uint64, p4 address.Address, p5 address.Address, p6 bool) (cid.Cid, error) { + return s.Internal.MsigAddApprove(p0, p1, p2, p3, p4, p5, p6) } -func (c *FullNodeStruct) ChainTipSetWeight(ctx context.Context, tsk types.TipSetKey) (types.BigInt, error) { - return c.Internal.ChainTipSetWeight(ctx, tsk) +func (s *FullNodeStruct) MsigAddCancel(p0 context.Context, p1 address.Address, p2 address.Address, p3 uint64, p4 address.Address, p5 bool) (cid.Cid, error) { + return s.Internal.MsigAddCancel(p0, p1, p2, p3, p4, p5) } -func (c *FullNodeStruct) ChainGetNode(ctx context.Context, p string) (*api.IpldObject, error) { - return c.Internal.ChainGetNode(ctx, p) +func (s *FullNodeStruct) MsigAddPropose(p0 context.Context, p1 address.Address, p2 address.Address, p3 address.Address, p4 bool) (cid.Cid, error) { + return s.Internal.MsigAddPropose(p0, p1, p2, p3, p4) } -func (c *FullNodeStruct) ChainGetMessage(ctx context.Context, mc cid.Cid) (*types.Message, error) { - return c.Internal.ChainGetMessage(ctx, mc) +func (s *FullNodeStruct) MsigApprove(p0 context.Context, p1 address.Address, p2 uint64, p3 address.Address) (cid.Cid, error) { + return s.Internal.MsigApprove(p0, p1, p2, p3) } -func (c *FullNodeStruct) ChainGetPath(ctx context.Context, from types.TipSetKey, to types.TipSetKey) ([]*api.HeadChange, error) { - return c.Internal.ChainGetPath(ctx, from, to) +func (s *FullNodeStruct) MsigApproveTxnHash(p0 context.Context, p1 address.Address, p2 uint64, p3 address.Address, p4 address.Address, p5 types.BigInt, p6 address.Address, p7 uint64, p8 []byte) (cid.Cid, error) { + return s.Internal.MsigApproveTxnHash(p0, p1, p2, p3, p4, p5, p6, p7, p8) } -func (c *FullNodeStruct) ChainExport(ctx context.Context, nroots abi.ChainEpoch, iom bool, tsk types.TipSetKey) (<-chan []byte, error) { - return c.Internal.ChainExport(ctx, nroots, iom, tsk) +func (s *FullNodeStruct) MsigCancel(p0 context.Context, p1 address.Address, p2 uint64, p3 address.Address, p4 types.BigInt, p5 address.Address, p6 uint64, p7 []byte) (cid.Cid, error) { + return s.Internal.MsigCancel(p0, p1, p2, p3, p4, p5, p6, p7) } -func (c *FullNodeStruct) BeaconGetEntry(ctx context.Context, epoch abi.ChainEpoch) (*types.BeaconEntry, error) { - return c.Internal.BeaconGetEntry(ctx, epoch) +func (s *FullNodeStruct) MsigCreate(p0 context.Context, p1 uint64, p2 []address.Address, p3 abi.ChainEpoch, p4 types.BigInt, p5 address.Address, p6 types.BigInt) (cid.Cid, error) { + return s.Internal.MsigCreate(p0, p1, p2, p3, p4, p5, p6) } -func (c *FullNodeStruct) SyncState(ctx context.Context) (*api.SyncState, error) { - return c.Internal.SyncState(ctx) +func (s *FullNodeStruct) MsigGetAvailableBalance(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (types.BigInt, error) { + return s.Internal.MsigGetAvailableBalance(p0, p1, p2) } -func (c *FullNodeStruct) SyncSubmitBlock(ctx context.Context, blk *types.BlockMsg) error { - return c.Internal.SyncSubmitBlock(ctx, blk) +func (s *FullNodeStruct) MsigGetPending(p0 context.Context, p1 address.Address, p2 types.TipSetKey) ([]*api.MsigTransaction, error) { + return s.Internal.MsigGetPending(p0, p1, p2) } -func (c *FullNodeStruct) SyncIncomingBlocks(ctx context.Context) (<-chan *types.BlockHeader, error) { - return c.Internal.SyncIncomingBlocks(ctx) +func (s *FullNodeStruct) MsigGetVested(p0 context.Context, p1 address.Address, p2 types.TipSetKey, p3 types.TipSetKey) (types.BigInt, error) { + return s.Internal.MsigGetVested(p0, p1, p2, p3) } -func (c *FullNodeStruct) SyncCheckpoint(ctx context.Context, tsk types.TipSetKey) error { - return c.Internal.SyncCheckpoint(ctx, tsk) +func (s *FullNodeStruct) MsigGetVestingSchedule(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (api.MsigVesting, error) { + return s.Internal.MsigGetVestingSchedule(p0, p1, p2) } -func (c *FullNodeStruct) SyncMarkBad(ctx context.Context, bcid cid.Cid) error { - return c.Internal.SyncMarkBad(ctx, bcid) +func (s *FullNodeStruct) MsigPropose(p0 context.Context, p1 address.Address, p2 address.Address, p3 types.BigInt, p4 address.Address, p5 uint64, p6 []byte) (cid.Cid, error) { + return s.Internal.MsigPropose(p0, p1, p2, p3, p4, p5, p6) } -func (c *FullNodeStruct) SyncUnmarkBad(ctx context.Context, bcid cid.Cid) error { - return c.Internal.SyncUnmarkBad(ctx, bcid) +func (s *FullNodeStruct) MsigRemoveSigner(p0 context.Context, p1 address.Address, p2 address.Address, p3 address.Address, p4 bool) (cid.Cid, error) { + return s.Internal.MsigRemoveSigner(p0, p1, p2, p3, p4) } -func (c *FullNodeStruct) SyncUnmarkAllBad(ctx context.Context) error { - return c.Internal.SyncUnmarkAllBad(ctx) +func (s *FullNodeStruct) MsigSwapApprove(p0 context.Context, p1 address.Address, p2 address.Address, p3 uint64, p4 address.Address, p5 address.Address, p6 address.Address) (cid.Cid, error) { + return s.Internal.MsigSwapApprove(p0, p1, p2, p3, p4, p5, p6) } -func (c *FullNodeStruct) SyncCheckBad(ctx context.Context, bcid cid.Cid) (string, error) { - return c.Internal.SyncCheckBad(ctx, bcid) +func (s *FullNodeStruct) MsigSwapCancel(p0 context.Context, p1 address.Address, p2 address.Address, p3 uint64, p4 address.Address, p5 address.Address) (cid.Cid, error) { + return s.Internal.MsigSwapCancel(p0, p1, p2, p3, p4, p5) } -func (c *FullNodeStruct) SyncValidateTipset(ctx context.Context, tsk types.TipSetKey) (bool, error) { - return c.Internal.SyncValidateTipset(ctx, tsk) +func (s *FullNodeStruct) MsigSwapPropose(p0 context.Context, p1 address.Address, p2 address.Address, p3 address.Address, p4 address.Address) (cid.Cid, error) { + return s.Internal.MsigSwapPropose(p0, p1, p2, p3, p4) } -func (c *FullNodeStruct) StateNetworkName(ctx context.Context) (dtypes.NetworkName, error) { - return c.Internal.StateNetworkName(ctx) +func (s *FullNodeStruct) PaychAllocateLane(p0 context.Context, p1 address.Address) (uint64, error) { + return s.Internal.PaychAllocateLane(p0, p1) } -func (c *FullNodeStruct) StateMinerSectors(ctx context.Context, addr address.Address, sectorNos *bitfield.BitField, tsk types.TipSetKey) ([]*miner.SectorOnChainInfo, error) { - return c.Internal.StateMinerSectors(ctx, addr, sectorNos, tsk) +func (s *FullNodeStruct) PaychAvailableFunds(p0 context.Context, p1 address.Address) (*api.ChannelAvailableFunds, error) { + return s.Internal.PaychAvailableFunds(p0, p1) } -func (c *FullNodeStruct) StateMinerActiveSectors(ctx context.Context, addr address.Address, tsk types.TipSetKey) ([]*miner.SectorOnChainInfo, error) { - return c.Internal.StateMinerActiveSectors(ctx, addr, tsk) +func (s *FullNodeStruct) PaychAvailableFundsByFromTo(p0 context.Context, p1 address.Address, p2 address.Address) (*api.ChannelAvailableFunds, error) { + return s.Internal.PaychAvailableFundsByFromTo(p0, p1, p2) } -func (c *FullNodeStruct) StateMinerProvingDeadline(ctx context.Context, addr address.Address, tsk types.TipSetKey) (*dline.Info, error) { - return c.Internal.StateMinerProvingDeadline(ctx, addr, tsk) +func (s *FullNodeStruct) PaychCollect(p0 context.Context, p1 address.Address) (cid.Cid, error) { + return s.Internal.PaychCollect(p0, p1) } -func (c *FullNodeStruct) StateMinerPower(ctx context.Context, a address.Address, tsk types.TipSetKey) (*api.MinerPower, error) { - return c.Internal.StateMinerPower(ctx, a, tsk) +func (s *FullNodeStruct) PaychGet(p0 context.Context, p1 address.Address, p2 address.Address, p3 types.BigInt) (*api.ChannelInfo, error) { + return s.Internal.PaychGet(p0, p1, p2, p3) } -func (c *FullNodeStruct) StateMinerInfo(ctx context.Context, actor address.Address, tsk types.TipSetKey) (miner.MinerInfo, error) { - return c.Internal.StateMinerInfo(ctx, actor, tsk) +func (s *FullNodeStruct) PaychGetWaitReady(p0 context.Context, p1 cid.Cid) (address.Address, error) { + return s.Internal.PaychGetWaitReady(p0, p1) } -func (c *FullNodeStruct) StateMinerDeadlines(ctx context.Context, actor address.Address, tsk types.TipSetKey) ([]api.Deadline, error) { - return c.Internal.StateMinerDeadlines(ctx, actor, tsk) +func (s *FullNodeStruct) PaychList(p0 context.Context) ([]address.Address, error) { + return s.Internal.PaychList(p0) } -func (c *FullNodeStruct) StateMinerPartitions(ctx context.Context, m address.Address, dlIdx uint64, tsk types.TipSetKey) ([]api.Partition, error) { - return c.Internal.StateMinerPartitions(ctx, m, dlIdx, tsk) +func (s *FullNodeStruct) PaychNewPayment(p0 context.Context, p1 address.Address, p2 address.Address, p3 []api.VoucherSpec) (*api.PaymentInfo, error) { + return s.Internal.PaychNewPayment(p0, p1, p2, p3) } -func (c *FullNodeStruct) StateMinerFaults(ctx context.Context, actor address.Address, tsk types.TipSetKey) (bitfield.BitField, error) { - return c.Internal.StateMinerFaults(ctx, actor, tsk) +func (s *FullNodeStruct) PaychSettle(p0 context.Context, p1 address.Address) (cid.Cid, error) { + return s.Internal.PaychSettle(p0, p1) } -func (c *FullNodeStruct) StateAllMinerFaults(ctx context.Context, cutoff abi.ChainEpoch, endTsk types.TipSetKey) ([]*api.Fault, error) { - return c.Internal.StateAllMinerFaults(ctx, cutoff, endTsk) +func (s *FullNodeStruct) PaychStatus(p0 context.Context, p1 address.Address) (*api.PaychStatus, error) { + return s.Internal.PaychStatus(p0, p1) } -func (c *FullNodeStruct) StateMinerRecoveries(ctx context.Context, actor address.Address, tsk types.TipSetKey) (bitfield.BitField, error) { - return c.Internal.StateMinerRecoveries(ctx, actor, tsk) +func (s *FullNodeStruct) PaychVoucherAdd(p0 context.Context, p1 address.Address, p2 *paych.SignedVoucher, p3 []byte, p4 types.BigInt) (types.BigInt, error) { + return s.Internal.PaychVoucherAdd(p0, p1, p2, p3, p4) } -func (c *FullNodeStruct) StateMinerPreCommitDepositForPower(ctx context.Context, maddr address.Address, pci miner.SectorPreCommitInfo, tsk types.TipSetKey) (types.BigInt, error) { - return c.Internal.StateMinerPreCommitDepositForPower(ctx, maddr, pci, tsk) +func (s *FullNodeStruct) PaychVoucherCheckSpendable(p0 context.Context, p1 address.Address, p2 *paych.SignedVoucher, p3 []byte, p4 []byte) (bool, error) { + return s.Internal.PaychVoucherCheckSpendable(p0, p1, p2, p3, p4) } -func (c *FullNodeStruct) StateMinerInitialPledgeCollateral(ctx context.Context, maddr address.Address, pci miner.SectorPreCommitInfo, tsk types.TipSetKey) (types.BigInt, error) { - return c.Internal.StateMinerInitialPledgeCollateral(ctx, maddr, pci, tsk) +func (s *FullNodeStruct) PaychVoucherCheckValid(p0 context.Context, p1 address.Address, p2 *paych.SignedVoucher) error { + return s.Internal.PaychVoucherCheckValid(p0, p1, p2) } -func (c *FullNodeStruct) StateMinerAvailableBalance(ctx context.Context, maddr address.Address, tsk types.TipSetKey) (types.BigInt, error) { - return c.Internal.StateMinerAvailableBalance(ctx, maddr, tsk) +func (s *FullNodeStruct) PaychVoucherCreate(p0 context.Context, p1 address.Address, p2 types.BigInt, p3 uint64) (*api.VoucherCreateResult, error) { + return s.Internal.PaychVoucherCreate(p0, p1, p2, p3) } -func (c *FullNodeStruct) StateMinerSectorAllocated(ctx context.Context, maddr address.Address, s abi.SectorNumber, tsk types.TipSetKey) (bool, error) { - return c.Internal.StateMinerSectorAllocated(ctx, maddr, s, tsk) +func (s *FullNodeStruct) PaychVoucherList(p0 context.Context, p1 address.Address) ([]*paych.SignedVoucher, error) { + return s.Internal.PaychVoucherList(p0, p1) } -func (c *FullNodeStruct) StateSectorPreCommitInfo(ctx context.Context, maddr address.Address, n abi.SectorNumber, tsk types.TipSetKey) (miner.SectorPreCommitOnChainInfo, error) { - return c.Internal.StateSectorPreCommitInfo(ctx, maddr, n, tsk) +func (s *FullNodeStruct) PaychVoucherSubmit(p0 context.Context, p1 address.Address, p2 *paych.SignedVoucher, p3 []byte, p4 []byte) (cid.Cid, error) { + return s.Internal.PaychVoucherSubmit(p0, p1, p2, p3, p4) } -func (c *FullNodeStruct) StateSectorGetInfo(ctx context.Context, maddr address.Address, n abi.SectorNumber, tsk types.TipSetKey) (*miner.SectorOnChainInfo, error) { - return c.Internal.StateSectorGetInfo(ctx, maddr, n, tsk) +func (s *FullNodeStruct) StateAccountKey(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (address.Address, error) { + return s.Internal.StateAccountKey(p0, p1, p2) } -func (c *FullNodeStruct) StateSectorExpiration(ctx context.Context, maddr address.Address, n abi.SectorNumber, tsk types.TipSetKey) (*miner.SectorExpiration, error) { - return c.Internal.StateSectorExpiration(ctx, maddr, n, tsk) +func (s *FullNodeStruct) StateAllMinerFaults(p0 context.Context, p1 abi.ChainEpoch, p2 types.TipSetKey) ([]*api.Fault, error) { + return s.Internal.StateAllMinerFaults(p0, p1, p2) } -func (c *FullNodeStruct) StateSectorPartition(ctx context.Context, maddr address.Address, sectorNumber abi.SectorNumber, tok types.TipSetKey) (*miner.SectorLocation, error) { - return c.Internal.StateSectorPartition(ctx, maddr, sectorNumber, tok) +func (s *FullNodeStruct) StateCall(p0 context.Context, p1 *types.Message, p2 types.TipSetKey) (*api.InvocResult, error) { + return s.Internal.StateCall(p0, p1, p2) } -func (c *FullNodeStruct) StateCall(ctx context.Context, msg *types.Message, tsk types.TipSetKey) (*api.InvocResult, error) { - return c.Internal.StateCall(ctx, msg, tsk) +func (s *FullNodeStruct) StateChangedActors(p0 context.Context, p1 cid.Cid, p2 cid.Cid) (map[string]types.Actor, error) { + return s.Internal.StateChangedActors(p0, p1, p2) } -func (c *FullNodeStruct) StateReplay(ctx context.Context, tsk types.TipSetKey, mc cid.Cid) (*api.InvocResult, error) { - return c.Internal.StateReplay(ctx, tsk, mc) +func (s *FullNodeStruct) StateCirculatingSupply(p0 context.Context, p1 types.TipSetKey) (abi.TokenAmount, error) { + return s.Internal.StateCirculatingSupply(p0, p1) } -func (c *FullNodeStruct) StateGetActor(ctx context.Context, actor address.Address, tsk types.TipSetKey) (*types.Actor, error) { - return c.Internal.StateGetActor(ctx, actor, tsk) +func (s *FullNodeStruct) StateCompute(p0 context.Context, p1 abi.ChainEpoch, p2 []*types.Message, p3 types.TipSetKey) (*api.ComputeStateOutput, error) { + return s.Internal.StateCompute(p0, p1, p2, p3) } -func (c *FullNodeStruct) StateReadState(ctx context.Context, addr address.Address, tsk types.TipSetKey) (*api.ActorState, error) { - return c.Internal.StateReadState(ctx, addr, tsk) +func (s *FullNodeStruct) StateDealProviderCollateralBounds(p0 context.Context, p1 abi.PaddedPieceSize, p2 bool, p3 types.TipSetKey) (api.DealCollateralBounds, error) { + return s.Internal.StateDealProviderCollateralBounds(p0, p1, p2, p3) } -func (c *FullNodeStruct) StateWaitMsg(ctx context.Context, msgc cid.Cid, confidence uint64) (*api.MsgLookup, error) { - return c.Internal.StateWaitMsg(ctx, msgc, confidence) +func (s *FullNodeStruct) StateDecodeParams(p0 context.Context, p1 address.Address, p2 abi.MethodNum, p3 []byte, p4 types.TipSetKey) (interface{}, error) { + return s.Internal.StateDecodeParams(p0, p1, p2, p3, p4) } -func (c *FullNodeStruct) StateWaitMsgLimited(ctx context.Context, msgc cid.Cid, confidence uint64, limit abi.ChainEpoch) (*api.MsgLookup, error) { - return c.Internal.StateWaitMsgLimited(ctx, msgc, confidence, limit) +func (s *FullNodeStruct) StateGetActor(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (*types.Actor, error) { + return s.Internal.StateGetActor(p0, p1, p2) } -func (c *FullNodeStruct) StateSearchMsg(ctx context.Context, msgc cid.Cid) (*api.MsgLookup, error) { - return c.Internal.StateSearchMsg(ctx, msgc) +func (s *FullNodeStruct) StateGetReceipt(p0 context.Context, p1 cid.Cid, p2 types.TipSetKey) (*types.MessageReceipt, error) { + return s.Internal.StateGetReceipt(p0, p1, p2) } -func (c *FullNodeStruct) StateSearchMsgLimited(ctx context.Context, msgc cid.Cid, limit abi.ChainEpoch) (*api.MsgLookup, error) { - return c.Internal.StateSearchMsgLimited(ctx, msgc, limit) +func (s *FullNodeStruct) StateListActors(p0 context.Context, p1 types.TipSetKey) ([]address.Address, error) { + return s.Internal.StateListActors(p0, p1) } -func (c *FullNodeStruct) StateListMiners(ctx context.Context, tsk types.TipSetKey) ([]address.Address, error) { - return c.Internal.StateListMiners(ctx, tsk) +func (s *FullNodeStruct) StateListMessages(p0 context.Context, p1 *api.MessageMatch, p2 types.TipSetKey, p3 abi.ChainEpoch) ([]cid.Cid, error) { + return s.Internal.StateListMessages(p0, p1, p2, p3) } -func (c *FullNodeStruct) StateListActors(ctx context.Context, tsk types.TipSetKey) ([]address.Address, error) { - return c.Internal.StateListActors(ctx, tsk) +func (s *FullNodeStruct) StateListMiners(p0 context.Context, p1 types.TipSetKey) ([]address.Address, error) { + return s.Internal.StateListMiners(p0, p1) } -func (c *FullNodeStruct) StateMarketBalance(ctx context.Context, addr address.Address, tsk types.TipSetKey) (api.MarketBalance, error) { - return c.Internal.StateMarketBalance(ctx, addr, tsk) +func (s *FullNodeStruct) StateLookupID(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (address.Address, error) { + return s.Internal.StateLookupID(p0, p1, p2) } -func (c *FullNodeStruct) StateMarketParticipants(ctx context.Context, tsk types.TipSetKey) (map[string]api.MarketBalance, error) { - return c.Internal.StateMarketParticipants(ctx, tsk) +func (s *FullNodeStruct) StateMarketBalance(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (api.MarketBalance, error) { + return s.Internal.StateMarketBalance(p0, p1, p2) } -func (c *FullNodeStruct) StateMarketDeals(ctx context.Context, tsk types.TipSetKey) (map[string]api.MarketDeal, error) { - return c.Internal.StateMarketDeals(ctx, tsk) +func (s *FullNodeStruct) StateMarketDeals(p0 context.Context, p1 types.TipSetKey) (map[string]api.MarketDeal, error) { + return s.Internal.StateMarketDeals(p0, p1) } -func (c *FullNodeStruct) StateMarketStorageDeal(ctx context.Context, dealid abi.DealID, tsk types.TipSetKey) (*api.MarketDeal, error) { - return c.Internal.StateMarketStorageDeal(ctx, dealid, tsk) +func (s *FullNodeStruct) StateMarketParticipants(p0 context.Context, p1 types.TipSetKey) (map[string]api.MarketBalance, error) { + return s.Internal.StateMarketParticipants(p0, p1) } -func (c *FullNodeStruct) StateLookupID(ctx context.Context, addr address.Address, tsk types.TipSetKey) (address.Address, error) { - return c.Internal.StateLookupID(ctx, addr, tsk) +func (s *FullNodeStruct) StateMarketStorageDeal(p0 context.Context, p1 abi.DealID, p2 types.TipSetKey) (*api.MarketDeal, error) { + return s.Internal.StateMarketStorageDeal(p0, p1, p2) } -func (c *FullNodeStruct) StateAccountKey(ctx context.Context, addr address.Address, tsk types.TipSetKey) (address.Address, error) { - return c.Internal.StateAccountKey(ctx, addr, tsk) +func (s *FullNodeStruct) StateMinerActiveSectors(p0 context.Context, p1 address.Address, p2 types.TipSetKey) ([]*miner.SectorOnChainInfo, error) { + return s.Internal.StateMinerActiveSectors(p0, p1, p2) } -func (c *FullNodeStruct) StateChangedActors(ctx context.Context, olnstate cid.Cid, newstate cid.Cid) (map[string]types.Actor, error) { - return c.Internal.StateChangedActors(ctx, olnstate, newstate) +func (s *FullNodeStruct) StateMinerAvailableBalance(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (types.BigInt, error) { + return s.Internal.StateMinerAvailableBalance(p0, p1, p2) } -func (c *FullNodeStruct) StateGetReceipt(ctx context.Context, msg cid.Cid, tsk types.TipSetKey) (*types.MessageReceipt, error) { - return c.Internal.StateGetReceipt(ctx, msg, tsk) +func (s *FullNodeStruct) StateMinerDeadlines(p0 context.Context, p1 address.Address, p2 types.TipSetKey) ([]api.Deadline, error) { + return s.Internal.StateMinerDeadlines(p0, p1, p2) } -func (c *FullNodeStruct) StateListMessages(ctx context.Context, match *api.MessageMatch, tsk types.TipSetKey, toht abi.ChainEpoch) ([]cid.Cid, error) { - return c.Internal.StateListMessages(ctx, match, tsk, toht) +func (s *FullNodeStruct) StateMinerFaults(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (bitfield.BitField, error) { + return s.Internal.StateMinerFaults(p0, p1, p2) } -func (c *FullNodeStruct) StateDecodeParams(ctx context.Context, toAddr address.Address, method abi.MethodNum, params []byte, tsk types.TipSetKey) (interface{}, error) { - return c.Internal.StateDecodeParams(ctx, toAddr, method, params, tsk) +func (s *FullNodeStruct) StateMinerInfo(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (miner.MinerInfo, error) { + return s.Internal.StateMinerInfo(p0, p1, p2) } -func (c *FullNodeStruct) StateCompute(ctx context.Context, height abi.ChainEpoch, msgs []*types.Message, tsk types.TipSetKey) (*api.ComputeStateOutput, error) { - return c.Internal.StateCompute(ctx, height, msgs, tsk) +func (s *FullNodeStruct) StateMinerInitialPledgeCollateral(p0 context.Context, p1 address.Address, p2 miner.SectorPreCommitInfo, p3 types.TipSetKey) (types.BigInt, error) { + return s.Internal.StateMinerInitialPledgeCollateral(p0, p1, p2, p3) } -func (c *FullNodeStruct) StateVerifierStatus(ctx context.Context, addr address.Address, tsk types.TipSetKey) (*abi.StoragePower, error) { - return c.Internal.StateVerifierStatus(ctx, addr, tsk) +func (s *FullNodeStruct) StateMinerPartitions(p0 context.Context, p1 address.Address, p2 uint64, p3 types.TipSetKey) ([]api.Partition, error) { + return s.Internal.StateMinerPartitions(p0, p1, p2, p3) } -func (c *FullNodeStruct) StateVerifiedClientStatus(ctx context.Context, addr address.Address, tsk types.TipSetKey) (*abi.StoragePower, error) { - return c.Internal.StateVerifiedClientStatus(ctx, addr, tsk) +func (s *FullNodeStruct) StateMinerPower(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (*api.MinerPower, error) { + return s.Internal.StateMinerPower(p0, p1, p2) } -func (c *FullNodeStruct) StateVerifiedRegistryRootKey(ctx context.Context, tsk types.TipSetKey) (address.Address, error) { - return c.Internal.StateVerifiedRegistryRootKey(ctx, tsk) +func (s *FullNodeStruct) StateMinerPreCommitDepositForPower(p0 context.Context, p1 address.Address, p2 miner.SectorPreCommitInfo, p3 types.TipSetKey) (types.BigInt, error) { + return s.Internal.StateMinerPreCommitDepositForPower(p0, p1, p2, p3) } -func (c *FullNodeStruct) StateDealProviderCollateralBounds(ctx context.Context, size abi.PaddedPieceSize, verified bool, tsk types.TipSetKey) (api.DealCollateralBounds, error) { - return c.Internal.StateDealProviderCollateralBounds(ctx, size, verified, tsk) +func (s *FullNodeStruct) StateMinerProvingDeadline(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (*dline.Info, error) { + return s.Internal.StateMinerProvingDeadline(p0, p1, p2) } -func (c *FullNodeStruct) StateCirculatingSupply(ctx context.Context, tsk types.TipSetKey) (abi.TokenAmount, error) { - return c.Internal.StateCirculatingSupply(ctx, tsk) +func (s *FullNodeStruct) StateMinerRecoveries(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (bitfield.BitField, error) { + return s.Internal.StateMinerRecoveries(p0, p1, p2) } -func (c *FullNodeStruct) StateVMCirculatingSupplyInternal(ctx context.Context, tsk types.TipSetKey) (api.CirculatingSupply, error) { - return c.Internal.StateVMCirculatingSupplyInternal(ctx, tsk) +func (s *FullNodeStruct) StateMinerSectorAllocated(p0 context.Context, p1 address.Address, p2 abi.SectorNumber, p3 types.TipSetKey) (bool, error) { + return s.Internal.StateMinerSectorAllocated(p0, p1, p2, p3) } -func (c *FullNodeStruct) StateNetworkVersion(ctx context.Context, tsk types.TipSetKey) (stnetwork.Version, error) { - return c.Internal.StateNetworkVersion(ctx, tsk) +func (s *FullNodeStruct) StateMinerSectorCount(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (api.MinerSectors, error) { + return s.Internal.StateMinerSectorCount(p0, p1, p2) } -func (c *FullNodeStruct) MsigGetAvailableBalance(ctx context.Context, a address.Address, tsk types.TipSetKey) (types.BigInt, error) { - return c.Internal.MsigGetAvailableBalance(ctx, a, tsk) +func (s *FullNodeStruct) StateMinerSectors(p0 context.Context, p1 address.Address, p2 *bitfield.BitField, p3 types.TipSetKey) ([]*miner.SectorOnChainInfo, error) { + return s.Internal.StateMinerSectors(p0, p1, p2, p3) } -func (c *FullNodeStruct) MsigGetVestingSchedule(ctx context.Context, a address.Address, tsk types.TipSetKey) (api.MsigVesting, error) { - return c.Internal.MsigGetVestingSchedule(ctx, a, tsk) +func (s *FullNodeStruct) StateNetworkName(p0 context.Context) (dtypes.NetworkName, error) { + return s.Internal.StateNetworkName(p0) } -func (c *FullNodeStruct) MsigGetVested(ctx context.Context, a address.Address, sTsk types.TipSetKey, eTsk types.TipSetKey) (types.BigInt, error) { - return c.Internal.MsigGetVested(ctx, a, sTsk, eTsk) +func (s *FullNodeStruct) StateNetworkVersion(p0 context.Context, p1 types.TipSetKey) (apitypes.NetworkVersion, error) { + return s.Internal.StateNetworkVersion(p0, p1) } -func (c *FullNodeStruct) MsigGetPending(ctx context.Context, a address.Address, tsk types.TipSetKey) ([]*api.MsigTransaction, error) { - return c.Internal.MsigGetPending(ctx, a, tsk) +func (s *FullNodeStruct) StateReadState(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (*api.ActorState, error) { + return s.Internal.StateReadState(p0, p1, p2) } -func (c *FullNodeStruct) MsigCreate(ctx context.Context, req uint64, addrs []address.Address, duration abi.ChainEpoch, val types.BigInt, src address.Address, gp types.BigInt) (cid.Cid, error) { - return c.Internal.MsigCreate(ctx, req, addrs, duration, val, src, gp) +func (s *FullNodeStruct) StateReplay(p0 context.Context, p1 types.TipSetKey, p2 cid.Cid) (*api.InvocResult, error) { + return s.Internal.StateReplay(p0, p1, p2) } -func (c *FullNodeStruct) MsigPropose(ctx context.Context, msig address.Address, to address.Address, amt types.BigInt, src address.Address, method uint64, params []byte) (cid.Cid, error) { - return c.Internal.MsigPropose(ctx, msig, to, amt, src, method, params) +func (s *FullNodeStruct) StateSearchMsg(p0 context.Context, p1 cid.Cid) (*api.MsgLookup, error) { + return s.Internal.StateSearchMsg(p0, p1) } -func (c *FullNodeStruct) MsigApprove(ctx context.Context, msig address.Address, txID uint64, signer address.Address) (cid.Cid, error) { - return c.Internal.MsigApprove(ctx, msig, txID, signer) +func (s *FullNodeStruct) StateSearchMsgLimited(p0 context.Context, p1 cid.Cid, p2 abi.ChainEpoch) (*api.MsgLookup, error) { + return s.Internal.StateSearchMsgLimited(p0, p1, p2) } -func (c *FullNodeStruct) MsigApproveTxnHash(ctx context.Context, msig address.Address, txID uint64, proposer address.Address, to address.Address, amt types.BigInt, src address.Address, method uint64, params []byte) (cid.Cid, error) { - return c.Internal.MsigApproveTxnHash(ctx, msig, txID, proposer, to, amt, src, method, params) +func (s *FullNodeStruct) StateSectorExpiration(p0 context.Context, p1 address.Address, p2 abi.SectorNumber, p3 types.TipSetKey) (*miner.SectorExpiration, error) { + return s.Internal.StateSectorExpiration(p0, p1, p2, p3) } -func (c *FullNodeStruct) MsigCancel(ctx context.Context, msig address.Address, txID uint64, to address.Address, amt types.BigInt, src address.Address, method uint64, params []byte) (cid.Cid, error) { - return c.Internal.MsigCancel(ctx, msig, txID, to, amt, src, method, params) +func (s *FullNodeStruct) StateSectorGetInfo(p0 context.Context, p1 address.Address, p2 abi.SectorNumber, p3 types.TipSetKey) (*miner.SectorOnChainInfo, error) { + return s.Internal.StateSectorGetInfo(p0, p1, p2, p3) } -func (c *FullNodeStruct) MsigAddPropose(ctx context.Context, msig address.Address, src address.Address, newAdd address.Address, inc bool) (cid.Cid, error) { - return c.Internal.MsigAddPropose(ctx, msig, src, newAdd, inc) +func (s *FullNodeStruct) StateSectorPartition(p0 context.Context, p1 address.Address, p2 abi.SectorNumber, p3 types.TipSetKey) (*miner.SectorLocation, error) { + return s.Internal.StateSectorPartition(p0, p1, p2, p3) } -func (c *FullNodeStruct) MsigAddApprove(ctx context.Context, msig address.Address, src address.Address, txID uint64, proposer address.Address, newAdd address.Address, inc bool) (cid.Cid, error) { - return c.Internal.MsigAddApprove(ctx, msig, src, txID, proposer, newAdd, inc) +func (s *FullNodeStruct) StateSectorPreCommitInfo(p0 context.Context, p1 address.Address, p2 abi.SectorNumber, p3 types.TipSetKey) (miner.SectorPreCommitOnChainInfo, error) { + return s.Internal.StateSectorPreCommitInfo(p0, p1, p2, p3) } -func (c *FullNodeStruct) MsigAddCancel(ctx context.Context, msig address.Address, src address.Address, txID uint64, newAdd address.Address, inc bool) (cid.Cid, error) { - return c.Internal.MsigAddCancel(ctx, msig, src, txID, newAdd, inc) +func (s *FullNodeStruct) StateVMCirculatingSupplyInternal(p0 context.Context, p1 types.TipSetKey) (api.CirculatingSupply, error) { + return s.Internal.StateVMCirculatingSupplyInternal(p0, p1) } -func (c *FullNodeStruct) MsigSwapPropose(ctx context.Context, msig address.Address, src address.Address, oldAdd address.Address, newAdd address.Address) (cid.Cid, error) { - return c.Internal.MsigSwapPropose(ctx, msig, src, oldAdd, newAdd) +func (s *FullNodeStruct) StateVerifiedClientStatus(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (*abi.StoragePower, error) { + return s.Internal.StateVerifiedClientStatus(p0, p1, p2) } -func (c *FullNodeStruct) MsigSwapApprove(ctx context.Context, msig address.Address, src address.Address, txID uint64, proposer address.Address, oldAdd address.Address, newAdd address.Address) (cid.Cid, error) { - return c.Internal.MsigSwapApprove(ctx, msig, src, txID, proposer, oldAdd, newAdd) +func (s *FullNodeStruct) StateVerifiedRegistryRootKey(p0 context.Context, p1 types.TipSetKey) (address.Address, error) { + return s.Internal.StateVerifiedRegistryRootKey(p0, p1) } -func (c *FullNodeStruct) MsigSwapCancel(ctx context.Context, msig address.Address, src address.Address, txID uint64, oldAdd address.Address, newAdd address.Address) (cid.Cid, error) { - return c.Internal.MsigSwapCancel(ctx, msig, src, txID, oldAdd, newAdd) +func (s *FullNodeStruct) StateVerifierStatus(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (*abi.StoragePower, error) { + return s.Internal.StateVerifierStatus(p0, p1, p2) } -func (c *FullNodeStruct) MsigRemoveSigner(ctx context.Context, msig address.Address, proposer address.Address, toRemove address.Address, decrease bool) (cid.Cid, error) { - return c.Internal.MsigRemoveSigner(ctx, msig, proposer, toRemove, decrease) +func (s *FullNodeStruct) StateWaitMsg(p0 context.Context, p1 cid.Cid, p2 uint64) (*api.MsgLookup, error) { + return s.Internal.StateWaitMsg(p0, p1, p2) } -func (c *FullNodeStruct) MarketAddBalance(ctx context.Context, wallet address.Address, addr address.Address, amt types.BigInt) (cid.Cid, error) { - return c.Internal.MarketAddBalance(ctx, wallet, addr, amt) +func (s *FullNodeStruct) StateWaitMsgLimited(p0 context.Context, p1 cid.Cid, p2 uint64, p3 abi.ChainEpoch) (*api.MsgLookup, error) { + return s.Internal.StateWaitMsgLimited(p0, p1, p2, p3) } -func (c *FullNodeStruct) MarketGetReserved(ctx context.Context, addr address.Address) (types.BigInt, error) { - return c.Internal.MarketGetReserved(ctx, addr) +func (s *FullNodeStruct) SyncCheckBad(p0 context.Context, p1 cid.Cid) (string, error) { + return s.Internal.SyncCheckBad(p0, p1) } -func (c *FullNodeStruct) MarketReserveFunds(ctx context.Context, wallet address.Address, addr address.Address, amt types.BigInt) (cid.Cid, error) { - return c.Internal.MarketReserveFunds(ctx, wallet, addr, amt) +func (s *FullNodeStruct) SyncCheckpoint(p0 context.Context, p1 types.TipSetKey) error { + return s.Internal.SyncCheckpoint(p0, p1) } -func (c *FullNodeStruct) MarketReleaseFunds(ctx context.Context, addr address.Address, amt types.BigInt) error { - return c.Internal.MarketReleaseFunds(ctx, addr, amt) +func (s *FullNodeStruct) SyncIncomingBlocks(p0 context.Context) (<-chan *types.BlockHeader, error) { + return s.Internal.SyncIncomingBlocks(p0) } -func (c *FullNodeStruct) MarketWithdraw(ctx context.Context, wallet, addr address.Address, amt types.BigInt) (cid.Cid, error) { - return c.Internal.MarketWithdraw(ctx, wallet, addr, amt) +func (s *FullNodeStruct) SyncMarkBad(p0 context.Context, p1 cid.Cid) error { + return s.Internal.SyncMarkBad(p0, p1) } -func (c *FullNodeStruct) PaychGet(ctx context.Context, from, to address.Address, amt types.BigInt) (*api.ChannelInfo, error) { - return c.Internal.PaychGet(ctx, from, to, amt) +func (s *FullNodeStruct) SyncState(p0 context.Context) (*api.SyncState, error) { + return s.Internal.SyncState(p0) } -func (c *FullNodeStruct) PaychGetWaitReady(ctx context.Context, sentinel cid.Cid) (address.Address, error) { - return c.Internal.PaychGetWaitReady(ctx, sentinel) +func (s *FullNodeStruct) SyncSubmitBlock(p0 context.Context, p1 *types.BlockMsg) error { + return s.Internal.SyncSubmitBlock(p0, p1) } -func (c *FullNodeStruct) PaychAvailableFunds(ctx context.Context, ch address.Address) (*api.ChannelAvailableFunds, error) { - return c.Internal.PaychAvailableFunds(ctx, ch) +func (s *FullNodeStruct) SyncUnmarkAllBad(p0 context.Context) error { + return s.Internal.SyncUnmarkAllBad(p0) } -func (c *FullNodeStruct) PaychAvailableFundsByFromTo(ctx context.Context, from, to address.Address) (*api.ChannelAvailableFunds, error) { - return c.Internal.PaychAvailableFundsByFromTo(ctx, from, to) +func (s *FullNodeStruct) SyncUnmarkBad(p0 context.Context, p1 cid.Cid) error { + return s.Internal.SyncUnmarkBad(p0, p1) } -func (c *FullNodeStruct) PaychList(ctx context.Context) ([]address.Address, error) { - return c.Internal.PaychList(ctx) +func (s *FullNodeStruct) SyncValidateTipset(p0 context.Context, p1 types.TipSetKey) (bool, error) { + return s.Internal.SyncValidateTipset(p0, p1) } -func (c *FullNodeStruct) PaychStatus(ctx context.Context, pch address.Address) (*api.PaychStatus, error) { - return c.Internal.PaychStatus(ctx, pch) +func (s *FullNodeStruct) WalletBalance(p0 context.Context, p1 address.Address) (types.BigInt, error) { + return s.Internal.WalletBalance(p0, p1) } -func (c *FullNodeStruct) PaychVoucherCheckValid(ctx context.Context, addr address.Address, sv *paych.SignedVoucher) error { - return c.Internal.PaychVoucherCheckValid(ctx, addr, sv) +func (s *FullNodeStruct) WalletDefaultAddress(p0 context.Context) (address.Address, error) { + return s.Internal.WalletDefaultAddress(p0) } -func (c *FullNodeStruct) PaychVoucherCheckSpendable(ctx context.Context, addr address.Address, sv *paych.SignedVoucher, secret []byte, proof []byte) (bool, error) { - return c.Internal.PaychVoucherCheckSpendable(ctx, addr, sv, secret, proof) +func (s *FullNodeStruct) WalletDelete(p0 context.Context, p1 address.Address) error { + return s.Internal.WalletDelete(p0, p1) } -func (c *FullNodeStruct) PaychVoucherAdd(ctx context.Context, addr address.Address, sv *paych.SignedVoucher, proof []byte, minDelta types.BigInt) (types.BigInt, error) { - return c.Internal.PaychVoucherAdd(ctx, addr, sv, proof, minDelta) +func (s *FullNodeStruct) WalletExport(p0 context.Context, p1 address.Address) (*types.KeyInfo, error) { + return s.Internal.WalletExport(p0, p1) } -func (c *FullNodeStruct) PaychVoucherCreate(ctx context.Context, pch address.Address, amt types.BigInt, lane uint64) (*api.VoucherCreateResult, error) { - return c.Internal.PaychVoucherCreate(ctx, pch, amt, lane) +func (s *FullNodeStruct) WalletHas(p0 context.Context, p1 address.Address) (bool, error) { + return s.Internal.WalletHas(p0, p1) } -func (c *FullNodeStruct) PaychVoucherList(ctx context.Context, pch address.Address) ([]*paych.SignedVoucher, error) { - return c.Internal.PaychVoucherList(ctx, pch) +func (s *FullNodeStruct) WalletImport(p0 context.Context, p1 *types.KeyInfo) (address.Address, error) { + return s.Internal.WalletImport(p0, p1) } -func (c *FullNodeStruct) PaychSettle(ctx context.Context, a address.Address) (cid.Cid, error) { - return c.Internal.PaychSettle(ctx, a) +func (s *FullNodeStruct) WalletList(p0 context.Context) ([]address.Address, error) { + return s.Internal.WalletList(p0) } -func (c *FullNodeStruct) PaychCollect(ctx context.Context, a address.Address) (cid.Cid, error) { - return c.Internal.PaychCollect(ctx, a) +func (s *FullNodeStruct) WalletNew(p0 context.Context, p1 types.KeyType) (address.Address, error) { + return s.Internal.WalletNew(p0, p1) } -func (c *FullNodeStruct) PaychAllocateLane(ctx context.Context, ch address.Address) (uint64, error) { - return c.Internal.PaychAllocateLane(ctx, ch) +func (s *FullNodeStruct) WalletSetDefault(p0 context.Context, p1 address.Address) error { + return s.Internal.WalletSetDefault(p0, p1) } -func (c *FullNodeStruct) PaychNewPayment(ctx context.Context, from, to address.Address, vouchers []api.VoucherSpec) (*api.PaymentInfo, error) { - return c.Internal.PaychNewPayment(ctx, from, to, vouchers) +func (s *FullNodeStruct) WalletSign(p0 context.Context, p1 address.Address, p2 []byte) (*crypto.Signature, error) { + return s.Internal.WalletSign(p0, p1, p2) } -func (c *FullNodeStruct) PaychVoucherSubmit(ctx context.Context, ch address.Address, sv *paych.SignedVoucher, secret []byte, proof []byte) (cid.Cid, error) { - return c.Internal.PaychVoucherSubmit(ctx, ch, sv, secret, proof) +func (s *FullNodeStruct) WalletSignMessage(p0 context.Context, p1 address.Address, p2 *types.Message) (*types.SignedMessage, error) { + return s.Internal.WalletSignMessage(p0, p1, p2) } -func (c *FullNodeStruct) CreateBackup(ctx context.Context, fpath string) error { - return c.Internal.CreateBackup(ctx, fpath) +func (s *FullNodeStruct) WalletValidateAddress(p0 context.Context, p1 string) (address.Address, error) { + return s.Internal.WalletValidateAddress(p0, p1) } -// StorageMinerStruct +func (s *FullNodeStruct) WalletVerify(p0 context.Context, p1 address.Address, p2 []byte, p3 *crypto.Signature) (bool, error) { + return s.Internal.WalletVerify(p0, p1, p2, p3) +} -func (c *StorageMinerStruct) ActorAddress(ctx context.Context) (address.Address, error) { - return c.Internal.ActorAddress(ctx) +func (s *GatewayStruct) ChainGetBlockMessages(p0 context.Context, p1 cid.Cid) (*api.BlockMessages, error) { + return s.Internal.ChainGetBlockMessages(p0, p1) } -func (c *StorageMinerStruct) MiningBase(ctx context.Context) (*types.TipSet, error) { - return c.Internal.MiningBase(ctx) +func (s *GatewayStruct) ChainGetMessage(p0 context.Context, p1 cid.Cid) (*types.Message, error) { + return s.Internal.ChainGetMessage(p0, p1) } -func (c *StorageMinerStruct) ActorSectorSize(ctx context.Context, addr address.Address) (abi.SectorSize, error) { - return c.Internal.ActorSectorSize(ctx, addr) +func (s *GatewayStruct) ChainGetTipSet(p0 context.Context, p1 types.TipSetKey) (*types.TipSet, error) { + return s.Internal.ChainGetTipSet(p0, p1) } -func (c *StorageMinerStruct) ActorAddressConfig(ctx context.Context) (api.AddressConfig, error) { - return c.Internal.ActorAddressConfig(ctx) +func (s *GatewayStruct) ChainGetTipSetByHeight(p0 context.Context, p1 abi.ChainEpoch, p2 types.TipSetKey) (*types.TipSet, error) { + return s.Internal.ChainGetTipSetByHeight(p0, p1, p2) } -func (c *StorageMinerStruct) PledgeSector(ctx context.Context) (abi.SectorID, error) { - return c.Internal.PledgeSector(ctx) +func (s *GatewayStruct) ChainHasObj(p0 context.Context, p1 cid.Cid) (bool, error) { + return s.Internal.ChainHasObj(p0, p1) } -// Get the status of a given sector by ID -func (c *StorageMinerStruct) SectorsStatus(ctx context.Context, sid abi.SectorNumber, showOnChainInfo bool) (api.SectorInfo, error) { - return c.Internal.SectorsStatus(ctx, sid, showOnChainInfo) +func (s *GatewayStruct) ChainHead(p0 context.Context) (*types.TipSet, error) { + return s.Internal.ChainHead(p0) } -// List all staged sectors -func (c *StorageMinerStruct) SectorsList(ctx context.Context) ([]abi.SectorNumber, error) { - return c.Internal.SectorsList(ctx) +func (s *GatewayStruct) ChainNotify(p0 context.Context) (<-chan []*api.HeadChange, error) { + return s.Internal.ChainNotify(p0) } -func (c *StorageMinerStruct) SectorsListInStates(ctx context.Context, states []api.SectorState) ([]abi.SectorNumber, error) { - return c.Internal.SectorsListInStates(ctx, states) +func (s *GatewayStruct) ChainReadObj(p0 context.Context, p1 cid.Cid) ([]byte, error) { + return s.Internal.ChainReadObj(p0, p1) } -func (c *StorageMinerStruct) SectorsSummary(ctx context.Context) (map[api.SectorState]int, error) { - return c.Internal.SectorsSummary(ctx) +func (s *GatewayStruct) GasEstimateMessageGas(p0 context.Context, p1 *types.Message, p2 *api.MessageSendSpec, p3 types.TipSetKey) (*types.Message, error) { + return s.Internal.GasEstimateMessageGas(p0, p1, p2, p3) } -func (c *StorageMinerStruct) SectorsRefs(ctx context.Context) (map[string][]api.SealedRef, error) { - return c.Internal.SectorsRefs(ctx) +func (s *GatewayStruct) MpoolPush(p0 context.Context, p1 *types.SignedMessage) (cid.Cid, error) { + return s.Internal.MpoolPush(p0, p1) } -func (c *StorageMinerStruct) SectorStartSealing(ctx context.Context, number abi.SectorNumber) error { - return c.Internal.SectorStartSealing(ctx, number) +func (s *GatewayStruct) MsigGetAvailableBalance(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (types.BigInt, error) { + return s.Internal.MsigGetAvailableBalance(p0, p1, p2) } -func (c *StorageMinerStruct) SectorSetSealDelay(ctx context.Context, delay time.Duration) error { - return c.Internal.SectorSetSealDelay(ctx, delay) +func (s *GatewayStruct) MsigGetPending(p0 context.Context, p1 address.Address, p2 types.TipSetKey) ([]*api.MsigTransaction, error) { + return s.Internal.MsigGetPending(p0, p1, p2) } -func (c *StorageMinerStruct) SectorGetSealDelay(ctx context.Context) (time.Duration, error) { - return c.Internal.SectorGetSealDelay(ctx) +func (s *GatewayStruct) MsigGetVested(p0 context.Context, p1 address.Address, p2 types.TipSetKey, p3 types.TipSetKey) (types.BigInt, error) { + return s.Internal.MsigGetVested(p0, p1, p2, p3) } -func (c *StorageMinerStruct) SectorSetExpectedSealDuration(ctx context.Context, delay time.Duration) error { - return c.Internal.SectorSetExpectedSealDuration(ctx, delay) +func (s *GatewayStruct) StateAccountKey(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (address.Address, error) { + return s.Internal.StateAccountKey(p0, p1, p2) } -func (c *StorageMinerStruct) SectorGetExpectedSealDuration(ctx context.Context) (time.Duration, error) { - return c.Internal.SectorGetExpectedSealDuration(ctx) +func (s *GatewayStruct) StateDealProviderCollateralBounds(p0 context.Context, p1 abi.PaddedPieceSize, p2 bool, p3 types.TipSetKey) (api.DealCollateralBounds, error) { + return s.Internal.StateDealProviderCollateralBounds(p0, p1, p2, p3) } -func (c *StorageMinerStruct) SectorsUpdate(ctx context.Context, id abi.SectorNumber, state api.SectorState) error { - return c.Internal.SectorsUpdate(ctx, id, state) +func (s *GatewayStruct) StateGetActor(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (*types.Actor, error) { + return s.Internal.StateGetActor(p0, p1, p2) } -func (c *StorageMinerStruct) SectorRemove(ctx context.Context, number abi.SectorNumber) error { - return c.Internal.SectorRemove(ctx, number) +func (s *GatewayStruct) StateGetReceipt(p0 context.Context, p1 cid.Cid, p2 types.TipSetKey) (*types.MessageReceipt, error) { + return s.Internal.StateGetReceipt(p0, p1, p2) } -func (c *StorageMinerStruct) SectorTerminate(ctx context.Context, number abi.SectorNumber) error { - return c.Internal.SectorTerminate(ctx, number) +func (s *GatewayStruct) StateListMiners(p0 context.Context, p1 types.TipSetKey) ([]address.Address, error) { + return s.Internal.StateListMiners(p0, p1) } -func (c *StorageMinerStruct) SectorTerminateFlush(ctx context.Context) (*cid.Cid, error) { - return c.Internal.SectorTerminateFlush(ctx) +func (s *GatewayStruct) StateLookupID(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (address.Address, error) { + return s.Internal.StateLookupID(p0, p1, p2) } -func (c *StorageMinerStruct) SectorTerminatePending(ctx context.Context) ([]abi.SectorID, error) { - return c.Internal.SectorTerminatePending(ctx) +func (s *GatewayStruct) StateMarketBalance(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (api.MarketBalance, error) { + return s.Internal.StateMarketBalance(p0, p1, p2) } -func (c *StorageMinerStruct) SectorMarkForUpgrade(ctx context.Context, number abi.SectorNumber) error { - return c.Internal.SectorMarkForUpgrade(ctx, number) +func (s *GatewayStruct) StateMarketStorageDeal(p0 context.Context, p1 abi.DealID, p2 types.TipSetKey) (*api.MarketDeal, error) { + return s.Internal.StateMarketStorageDeal(p0, p1, p2) } -func (c *StorageMinerStruct) WorkerConnect(ctx context.Context, url string) error { - return c.Internal.WorkerConnect(ctx, url) +func (s *GatewayStruct) StateMinerInfo(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (miner.MinerInfo, error) { + return s.Internal.StateMinerInfo(p0, p1, p2) } -func (c *StorageMinerStruct) WorkerStats(ctx context.Context) (map[uuid.UUID]storiface.WorkerStats, error) { - return c.Internal.WorkerStats(ctx) +func (s *GatewayStruct) StateMinerPower(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (*api.MinerPower, error) { + return s.Internal.StateMinerPower(p0, p1, p2) } -func (c *StorageMinerStruct) WorkerJobs(ctx context.Context) (map[uuid.UUID][]storiface.WorkerJob, error) { - return c.Internal.WorkerJobs(ctx) +func (s *GatewayStruct) StateMinerProvingDeadline(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (*dline.Info, error) { + return s.Internal.StateMinerProvingDeadline(p0, p1, p2) } -func (c *StorageMinerStruct) ReturnAddPiece(ctx context.Context, callID storiface.CallID, pi abi.PieceInfo, err *storiface.CallError) error { - return c.Internal.ReturnAddPiece(ctx, callID, pi, err) +func (s *GatewayStruct) StateNetworkVersion(p0 context.Context, p1 types.TipSetKey) (apitypes.NetworkVersion, error) { + return s.Internal.StateNetworkVersion(p0, p1) } -func (c *StorageMinerStruct) ReturnSealPreCommit1(ctx context.Context, callID storiface.CallID, p1o storage.PreCommit1Out, err *storiface.CallError) error { - return c.Internal.ReturnSealPreCommit1(ctx, callID, p1o, err) +func (s *GatewayStruct) StateSearchMsg(p0 context.Context, p1 cid.Cid) (*api.MsgLookup, error) { + return s.Internal.StateSearchMsg(p0, p1) } -func (c *StorageMinerStruct) ReturnSealPreCommit2(ctx context.Context, callID storiface.CallID, sealed storage.SectorCids, err *storiface.CallError) error { - return c.Internal.ReturnSealPreCommit2(ctx, callID, sealed, err) +func (s *GatewayStruct) StateSectorGetInfo(p0 context.Context, p1 address.Address, p2 abi.SectorNumber, p3 types.TipSetKey) (*miner.SectorOnChainInfo, error) { + return s.Internal.StateSectorGetInfo(p0, p1, p2, p3) } -func (c *StorageMinerStruct) ReturnSealCommit1(ctx context.Context, callID storiface.CallID, out storage.Commit1Out, err *storiface.CallError) error { - return c.Internal.ReturnSealCommit1(ctx, callID, out, err) +func (s *GatewayStruct) StateVerifiedClientStatus(p0 context.Context, p1 address.Address, p2 types.TipSetKey) (*abi.StoragePower, error) { + return s.Internal.StateVerifiedClientStatus(p0, p1, p2) } -func (c *StorageMinerStruct) ReturnSealCommit2(ctx context.Context, callID storiface.CallID, proof storage.Proof, err *storiface.CallError) error { - return c.Internal.ReturnSealCommit2(ctx, callID, proof, err) +func (s *GatewayStruct) StateWaitMsg(p0 context.Context, p1 cid.Cid, p2 uint64) (*api.MsgLookup, error) { + return s.Internal.StateWaitMsg(p0, p1, p2) } -func (c *StorageMinerStruct) ReturnFinalizeSector(ctx context.Context, callID storiface.CallID, err *storiface.CallError) error { - return c.Internal.ReturnFinalizeSector(ctx, callID, err) +func (s *SignableStruct) Sign(p0 context.Context, p1 api.SignFunc) error { + return s.Internal.Sign(p0, p1) } -func (c *StorageMinerStruct) ReturnReleaseUnsealed(ctx context.Context, callID storiface.CallID, err *storiface.CallError) error { - return c.Internal.ReturnReleaseUnsealed(ctx, callID, err) +func (s *StorageMinerStruct) ActorAddress(p0 context.Context) (address.Address, error) { + return s.Internal.ActorAddress(p0) } -func (c *StorageMinerStruct) ReturnMoveStorage(ctx context.Context, callID storiface.CallID, err *storiface.CallError) error { - return c.Internal.ReturnMoveStorage(ctx, callID, err) +func (s *StorageMinerStruct) ActorAddressConfig(p0 context.Context) (api.AddressConfig, error) { + return s.Internal.ActorAddressConfig(p0) } -func (c *StorageMinerStruct) ReturnUnsealPiece(ctx context.Context, callID storiface.CallID, err *storiface.CallError) error { - return c.Internal.ReturnUnsealPiece(ctx, callID, err) +func (s *StorageMinerStruct) ActorSectorSize(p0 context.Context, p1 address.Address) (abi.SectorSize, error) { + return s.Internal.ActorSectorSize(p0, p1) } -func (c *StorageMinerStruct) ReturnReadPiece(ctx context.Context, callID storiface.CallID, ok bool, err *storiface.CallError) error { - return c.Internal.ReturnReadPiece(ctx, callID, ok, err) +func (s *StorageMinerStruct) CheckProvable(p0 context.Context, p1 abi.RegisteredPoStProof, p2 []storage.SectorRef, p3 bool) (map[abi.SectorNumber]string, error) { + return s.Internal.CheckProvable(p0, p1, p2, p3) } -func (c *StorageMinerStruct) ReturnFetch(ctx context.Context, callID storiface.CallID, err *storiface.CallError) error { - return c.Internal.ReturnFetch(ctx, callID, err) +func (s *StorageMinerStruct) ComputeProof(p0 context.Context, p1 []builtin.SectorInfo, p2 abi.PoStRandomness) ([]builtin.PoStProof, error) { + return s.Internal.ComputeProof(p0, p1, p2) } -func (c *StorageMinerStruct) SealingSchedDiag(ctx context.Context, doSched bool) (interface{}, error) { - return c.Internal.SealingSchedDiag(ctx, doSched) +func (s *StorageMinerStruct) CreateBackup(p0 context.Context, p1 string) error { + return s.Internal.CreateBackup(p0, p1) } -func (c *StorageMinerStruct) SealingAbort(ctx context.Context, call storiface.CallID) error { - return c.Internal.SealingAbort(ctx, call) +func (s *StorageMinerStruct) DealsConsiderOfflineRetrievalDeals(p0 context.Context) (bool, error) { + return s.Internal.DealsConsiderOfflineRetrievalDeals(p0) } -func (c *StorageMinerStruct) StorageAttach(ctx context.Context, si stores.StorageInfo, st fsutil.FsStat) error { - return c.Internal.StorageAttach(ctx, si, st) +func (s *StorageMinerStruct) DealsConsiderOfflineStorageDeals(p0 context.Context) (bool, error) { + return s.Internal.DealsConsiderOfflineStorageDeals(p0) } -func (c *StorageMinerStruct) StorageDeclareSector(ctx context.Context, storageId stores.ID, s abi.SectorID, ft storiface.SectorFileType, primary bool) error { - return c.Internal.StorageDeclareSector(ctx, storageId, s, ft, primary) +func (s *StorageMinerStruct) DealsConsiderOnlineRetrievalDeals(p0 context.Context) (bool, error) { + return s.Internal.DealsConsiderOnlineRetrievalDeals(p0) } -func (c *StorageMinerStruct) StorageDropSector(ctx context.Context, storageId stores.ID, s abi.SectorID, ft storiface.SectorFileType) error { - return c.Internal.StorageDropSector(ctx, storageId, s, ft) +func (s *StorageMinerStruct) DealsConsiderOnlineStorageDeals(p0 context.Context) (bool, error) { + return s.Internal.DealsConsiderOnlineStorageDeals(p0) } -func (c *StorageMinerStruct) StorageFindSector(ctx context.Context, si abi.SectorID, types storiface.SectorFileType, ssize abi.SectorSize, allowFetch bool) ([]stores.SectorStorageInfo, error) { - return c.Internal.StorageFindSector(ctx, si, types, ssize, allowFetch) +func (s *StorageMinerStruct) DealsConsiderUnverifiedStorageDeals(p0 context.Context) (bool, error) { + return s.Internal.DealsConsiderUnverifiedStorageDeals(p0) } -func (c *StorageMinerStruct) StorageList(ctx context.Context) (map[stores.ID][]stores.Decl, error) { - return c.Internal.StorageList(ctx) +func (s *StorageMinerStruct) DealsConsiderVerifiedStorageDeals(p0 context.Context) (bool, error) { + return s.Internal.DealsConsiderVerifiedStorageDeals(p0) } -func (c *StorageMinerStruct) StorageLocal(ctx context.Context) (map[stores.ID]string, error) { - return c.Internal.StorageLocal(ctx) +func (s *StorageMinerStruct) DealsImportData(p0 context.Context, p1 cid.Cid, p2 string) error { + return s.Internal.DealsImportData(p0, p1, p2) } -func (c *StorageMinerStruct) StorageStat(ctx context.Context, id stores.ID) (fsutil.FsStat, error) { - return c.Internal.StorageStat(ctx, id) +func (s *StorageMinerStruct) DealsList(p0 context.Context) ([]api.MarketDeal, error) { + return s.Internal.DealsList(p0) } -func (c *StorageMinerStruct) StorageInfo(ctx context.Context, id stores.ID) (stores.StorageInfo, error) { - return c.Internal.StorageInfo(ctx, id) +func (s *StorageMinerStruct) DealsPieceCidBlocklist(p0 context.Context) ([]cid.Cid, error) { + return s.Internal.DealsPieceCidBlocklist(p0) } -func (c *StorageMinerStruct) StorageBestAlloc(ctx context.Context, allocate storiface.SectorFileType, ssize abi.SectorSize, pt storiface.PathType) ([]stores.StorageInfo, error) { - return c.Internal.StorageBestAlloc(ctx, allocate, ssize, pt) +func (s *StorageMinerStruct) DealsSetConsiderOfflineRetrievalDeals(p0 context.Context, p1 bool) error { + return s.Internal.DealsSetConsiderOfflineRetrievalDeals(p0, p1) } -func (c *StorageMinerStruct) StorageReportHealth(ctx context.Context, id stores.ID, report stores.HealthReport) error { - return c.Internal.StorageReportHealth(ctx, id, report) +func (s *StorageMinerStruct) DealsSetConsiderOfflineStorageDeals(p0 context.Context, p1 bool) error { + return s.Internal.DealsSetConsiderOfflineStorageDeals(p0, p1) } -func (c *StorageMinerStruct) StorageLock(ctx context.Context, sector abi.SectorID, read storiface.SectorFileType, write storiface.SectorFileType) error { - return c.Internal.StorageLock(ctx, sector, read, write) +func (s *StorageMinerStruct) DealsSetConsiderOnlineRetrievalDeals(p0 context.Context, p1 bool) error { + return s.Internal.DealsSetConsiderOnlineRetrievalDeals(p0, p1) } -func (c *StorageMinerStruct) StorageTryLock(ctx context.Context, sector abi.SectorID, read storiface.SectorFileType, write storiface.SectorFileType) (bool, error) { - return c.Internal.StorageTryLock(ctx, sector, read, write) +func (s *StorageMinerStruct) DealsSetConsiderOnlineStorageDeals(p0 context.Context, p1 bool) error { + return s.Internal.DealsSetConsiderOnlineStorageDeals(p0, p1) } -func (c *StorageMinerStruct) MarketImportDealData(ctx context.Context, propcid cid.Cid, path string) error { - return c.Internal.MarketImportDealData(ctx, propcid, path) +func (s *StorageMinerStruct) DealsSetConsiderUnverifiedStorageDeals(p0 context.Context, p1 bool) error { + return s.Internal.DealsSetConsiderUnverifiedStorageDeals(p0, p1) } -func (c *StorageMinerStruct) MarketListDeals(ctx context.Context) ([]api.MarketDeal, error) { - return c.Internal.MarketListDeals(ctx) +func (s *StorageMinerStruct) DealsSetConsiderVerifiedStorageDeals(p0 context.Context, p1 bool) error { + return s.Internal.DealsSetConsiderVerifiedStorageDeals(p0, p1) } -func (c *StorageMinerStruct) MarketListRetrievalDeals(ctx context.Context) ([]retrievalmarket.ProviderDealState, error) { - return c.Internal.MarketListRetrievalDeals(ctx) +func (s *StorageMinerStruct) DealsSetPieceCidBlocklist(p0 context.Context, p1 []cid.Cid) error { + return s.Internal.DealsSetPieceCidBlocklist(p0, p1) } -func (c *StorageMinerStruct) MarketGetDealUpdates(ctx context.Context) (<-chan storagemarket.MinerDeal, error) { - return c.Internal.MarketGetDealUpdates(ctx) +func (s *StorageMinerStruct) MarketCancelDataTransfer(p0 context.Context, p1 datatransfer.TransferID, p2 peer.ID, p3 bool) error { + return s.Internal.MarketCancelDataTransfer(p0, p1, p2, p3) } -func (c *StorageMinerStruct) MarketListIncompleteDeals(ctx context.Context) ([]storagemarket.MinerDeal, error) { - return c.Internal.MarketListIncompleteDeals(ctx) +func (s *StorageMinerStruct) MarketDataTransferUpdates(p0 context.Context) (<-chan api.DataTransferChannel, error) { + return s.Internal.MarketDataTransferUpdates(p0) } -func (c *StorageMinerStruct) MarketSetAsk(ctx context.Context, price types.BigInt, verifiedPrice types.BigInt, duration abi.ChainEpoch, minPieceSize abi.PaddedPieceSize, maxPieceSize abi.PaddedPieceSize) error { - return c.Internal.MarketSetAsk(ctx, price, verifiedPrice, duration, minPieceSize, maxPieceSize) +func (s *StorageMinerStruct) MarketGetAsk(p0 context.Context) (*storagemarket.SignedStorageAsk, error) { + return s.Internal.MarketGetAsk(p0) } -func (c *StorageMinerStruct) MarketGetAsk(ctx context.Context) (*storagemarket.SignedStorageAsk, error) { - return c.Internal.MarketGetAsk(ctx) +func (s *StorageMinerStruct) MarketGetDealUpdates(p0 context.Context) (<-chan storagemarket.MinerDeal, error) { + return s.Internal.MarketGetDealUpdates(p0) } -func (c *StorageMinerStruct) MarketSetRetrievalAsk(ctx context.Context, rask *retrievalmarket.Ask) error { - return c.Internal.MarketSetRetrievalAsk(ctx, rask) +func (s *StorageMinerStruct) MarketGetRetrievalAsk(p0 context.Context) (*retrievalmarket.Ask, error) { + return s.Internal.MarketGetRetrievalAsk(p0) } -func (c *StorageMinerStruct) MarketGetRetrievalAsk(ctx context.Context) (*retrievalmarket.Ask, error) { - return c.Internal.MarketGetRetrievalAsk(ctx) +func (s *StorageMinerStruct) MarketImportDealData(p0 context.Context, p1 cid.Cid, p2 string) error { + return s.Internal.MarketImportDealData(p0, p1, p2) } -func (c *StorageMinerStruct) MarketListDataTransfers(ctx context.Context) ([]api.DataTransferChannel, error) { - return c.Internal.MarketListDataTransfers(ctx) +func (s *StorageMinerStruct) MarketListDataTransfers(p0 context.Context) ([]api.DataTransferChannel, error) { + return s.Internal.MarketListDataTransfers(p0) } -func (c *StorageMinerStruct) MarketDataTransferUpdates(ctx context.Context) (<-chan api.DataTransferChannel, error) { - return c.Internal.MarketDataTransferUpdates(ctx) +func (s *StorageMinerStruct) MarketListDeals(p0 context.Context) ([]api.MarketDeal, error) { + return s.Internal.MarketListDeals(p0) } -func (c *StorageMinerStruct) MarketRestartDataTransfer(ctx context.Context, transferID datatransfer.TransferID, otherPeer peer.ID, isInitiator bool) error { - return c.Internal.MarketRestartDataTransfer(ctx, transferID, otherPeer, isInitiator) +func (s *StorageMinerStruct) MarketListIncompleteDeals(p0 context.Context) ([]storagemarket.MinerDeal, error) { + return s.Internal.MarketListIncompleteDeals(p0) } -func (c *StorageMinerStruct) MarketCancelDataTransfer(ctx context.Context, transferID datatransfer.TransferID, otherPeer peer.ID, isInitiator bool) error { - return c.Internal.MarketCancelDataTransfer(ctx, transferID, otherPeer, isInitiator) +func (s *StorageMinerStruct) MarketListRetrievalDeals(p0 context.Context) ([]retrievalmarket.ProviderDealState, error) { + return s.Internal.MarketListRetrievalDeals(p0) } -func (c *StorageMinerStruct) MarketPendingDeals(ctx context.Context) (api.PendingDealInfo, error) { - return c.Internal.MarketPendingDeals(ctx) +func (s *StorageMinerStruct) MarketPendingDeals(p0 context.Context) (api.PendingDealInfo, error) { + return s.Internal.MarketPendingDeals(p0) } -func (c *StorageMinerStruct) MarketPublishPendingDeals(ctx context.Context) error { - return c.Internal.MarketPublishPendingDeals(ctx) +func (s *StorageMinerStruct) MarketPublishPendingDeals(p0 context.Context) error { + return s.Internal.MarketPublishPendingDeals(p0) } -func (c *StorageMinerStruct) DealsImportData(ctx context.Context, dealPropCid cid.Cid, file string) error { - return c.Internal.DealsImportData(ctx, dealPropCid, file) +func (s *StorageMinerStruct) MarketRestartDataTransfer(p0 context.Context, p1 datatransfer.TransferID, p2 peer.ID, p3 bool) error { + return s.Internal.MarketRestartDataTransfer(p0, p1, p2, p3) } -func (c *StorageMinerStruct) DealsList(ctx context.Context) ([]api.MarketDeal, error) { - return c.Internal.DealsList(ctx) +func (s *StorageMinerStruct) MarketSetAsk(p0 context.Context, p1 types.BigInt, p2 types.BigInt, p3 abi.ChainEpoch, p4 abi.PaddedPieceSize, p5 abi.PaddedPieceSize) error { + return s.Internal.MarketSetAsk(p0, p1, p2, p3, p4, p5) } -func (c *StorageMinerStruct) DealsConsiderOnlineStorageDeals(ctx context.Context) (bool, error) { - return c.Internal.DealsConsiderOnlineStorageDeals(ctx) +func (s *StorageMinerStruct) MarketSetRetrievalAsk(p0 context.Context, p1 *retrievalmarket.Ask) error { + return s.Internal.MarketSetRetrievalAsk(p0, p1) } -func (c *StorageMinerStruct) DealsSetConsiderOnlineStorageDeals(ctx context.Context, b bool) error { - return c.Internal.DealsSetConsiderOnlineStorageDeals(ctx, b) +func (s *StorageMinerStruct) MiningBase(p0 context.Context) (*types.TipSet, error) { + return s.Internal.MiningBase(p0) } -func (c *StorageMinerStruct) DealsConsiderOnlineRetrievalDeals(ctx context.Context) (bool, error) { - return c.Internal.DealsConsiderOnlineRetrievalDeals(ctx) +func (s *StorageMinerStruct) PiecesGetCIDInfo(p0 context.Context, p1 cid.Cid) (*piecestore.CIDInfo, error) { + return s.Internal.PiecesGetCIDInfo(p0, p1) } -func (c *StorageMinerStruct) DealsSetConsiderOnlineRetrievalDeals(ctx context.Context, b bool) error { - return c.Internal.DealsSetConsiderOnlineRetrievalDeals(ctx, b) +func (s *StorageMinerStruct) PiecesGetPieceInfo(p0 context.Context, p1 cid.Cid) (*piecestore.PieceInfo, error) { + return s.Internal.PiecesGetPieceInfo(p0, p1) } -func (c *StorageMinerStruct) DealsPieceCidBlocklist(ctx context.Context) ([]cid.Cid, error) { - return c.Internal.DealsPieceCidBlocklist(ctx) +func (s *StorageMinerStruct) PiecesListCidInfos(p0 context.Context) ([]cid.Cid, error) { + return s.Internal.PiecesListCidInfos(p0) } -func (c *StorageMinerStruct) DealsSetPieceCidBlocklist(ctx context.Context, cids []cid.Cid) error { - return c.Internal.DealsSetPieceCidBlocklist(ctx, cids) +func (s *StorageMinerStruct) PiecesListPieces(p0 context.Context) ([]cid.Cid, error) { + return s.Internal.PiecesListPieces(p0) } -func (c *StorageMinerStruct) DealsConsiderOfflineStorageDeals(ctx context.Context) (bool, error) { - return c.Internal.DealsConsiderOfflineStorageDeals(ctx) +func (s *StorageMinerStruct) PledgeSector(p0 context.Context) (abi.SectorID, error) { + return s.Internal.PledgeSector(p0) } -func (c *StorageMinerStruct) DealsSetConsiderOfflineStorageDeals(ctx context.Context, b bool) error { - return c.Internal.DealsSetConsiderOfflineStorageDeals(ctx, b) +func (s *StorageMinerStruct) ReturnAddPiece(p0 context.Context, p1 storiface.CallID, p2 abi.PieceInfo, p3 *storiface.CallError) error { + return s.Internal.ReturnAddPiece(p0, p1, p2, p3) } -func (c *StorageMinerStruct) DealsConsiderOfflineRetrievalDeals(ctx context.Context) (bool, error) { - return c.Internal.DealsConsiderOfflineRetrievalDeals(ctx) +func (s *StorageMinerStruct) ReturnFetch(p0 context.Context, p1 storiface.CallID, p2 *storiface.CallError) error { + return s.Internal.ReturnFetch(p0, p1, p2) } -func (c *StorageMinerStruct) DealsSetConsiderOfflineRetrievalDeals(ctx context.Context, b bool) error { - return c.Internal.DealsSetConsiderOfflineRetrievalDeals(ctx, b) +func (s *StorageMinerStruct) ReturnFinalizeSector(p0 context.Context, p1 storiface.CallID, p2 *storiface.CallError) error { + return s.Internal.ReturnFinalizeSector(p0, p1, p2) } -func (c *StorageMinerStruct) DealsConsiderVerifiedStorageDeals(ctx context.Context) (bool, error) { - return c.Internal.DealsConsiderVerifiedStorageDeals(ctx) +func (s *StorageMinerStruct) ReturnMoveStorage(p0 context.Context, p1 storiface.CallID, p2 *storiface.CallError) error { + return s.Internal.ReturnMoveStorage(p0, p1, p2) } -func (c *StorageMinerStruct) DealsSetConsiderVerifiedStorageDeals(ctx context.Context, b bool) error { - return c.Internal.DealsSetConsiderVerifiedStorageDeals(ctx, b) +func (s *StorageMinerStruct) ReturnReadPiece(p0 context.Context, p1 storiface.CallID, p2 bool, p3 *storiface.CallError) error { + return s.Internal.ReturnReadPiece(p0, p1, p2, p3) } -func (c *StorageMinerStruct) DealsConsiderUnverifiedStorageDeals(ctx context.Context) (bool, error) { - return c.Internal.DealsConsiderUnverifiedStorageDeals(ctx) +func (s *StorageMinerStruct) ReturnReleaseUnsealed(p0 context.Context, p1 storiface.CallID, p2 *storiface.CallError) error { + return s.Internal.ReturnReleaseUnsealed(p0, p1, p2) } -func (c *StorageMinerStruct) DealsSetConsiderUnverifiedStorageDeals(ctx context.Context, b bool) error { - return c.Internal.DealsSetConsiderUnverifiedStorageDeals(ctx, b) +func (s *StorageMinerStruct) ReturnSealCommit1(p0 context.Context, p1 storiface.CallID, p2 storage.Commit1Out, p3 *storiface.CallError) error { + return s.Internal.ReturnSealCommit1(p0, p1, p2, p3) } -func (c *StorageMinerStruct) StorageAddLocal(ctx context.Context, path string) error { - return c.Internal.StorageAddLocal(ctx, path) +func (s *StorageMinerStruct) ReturnSealCommit2(p0 context.Context, p1 storiface.CallID, p2 storage.Proof, p3 *storiface.CallError) error { + return s.Internal.ReturnSealCommit2(p0, p1, p2, p3) } -func (c *StorageMinerStruct) PiecesListPieces(ctx context.Context) ([]cid.Cid, error) { - return c.Internal.PiecesListPieces(ctx) +func (s *StorageMinerStruct) ReturnSealPreCommit1(p0 context.Context, p1 storiface.CallID, p2 storage.PreCommit1Out, p3 *storiface.CallError) error { + return s.Internal.ReturnSealPreCommit1(p0, p1, p2, p3) } -func (c *StorageMinerStruct) PiecesListCidInfos(ctx context.Context) ([]cid.Cid, error) { - return c.Internal.PiecesListCidInfos(ctx) +func (s *StorageMinerStruct) ReturnSealPreCommit2(p0 context.Context, p1 storiface.CallID, p2 storage.SectorCids, p3 *storiface.CallError) error { + return s.Internal.ReturnSealPreCommit2(p0, p1, p2, p3) } -func (c *StorageMinerStruct) PiecesGetPieceInfo(ctx context.Context, pieceCid cid.Cid) (*piecestore.PieceInfo, error) { - return c.Internal.PiecesGetPieceInfo(ctx, pieceCid) +func (s *StorageMinerStruct) ReturnUnsealPiece(p0 context.Context, p1 storiface.CallID, p2 *storiface.CallError) error { + return s.Internal.ReturnUnsealPiece(p0, p1, p2) } -func (c *StorageMinerStruct) PiecesGetCIDInfo(ctx context.Context, payloadCid cid.Cid) (*piecestore.CIDInfo, error) { - return c.Internal.PiecesGetCIDInfo(ctx, payloadCid) +func (s *StorageMinerStruct) SealingAbort(p0 context.Context, p1 storiface.CallID) error { + return s.Internal.SealingAbort(p0, p1) } -func (c *StorageMinerStruct) CreateBackup(ctx context.Context, fpath string) error { - return c.Internal.CreateBackup(ctx, fpath) +func (s *StorageMinerStruct) SealingSchedDiag(p0 context.Context, p1 bool) (interface{}, error) { + return s.Internal.SealingSchedDiag(p0, p1) } -func (c *StorageMinerStruct) CheckProvable(ctx context.Context, pp abi.RegisteredPoStProof, sectors []storage.SectorRef, expensive bool) (map[abi.SectorNumber]string, error) { - return c.Internal.CheckProvable(ctx, pp, sectors, expensive) +func (s *StorageMinerStruct) SectorGetExpectedSealDuration(p0 context.Context) (time.Duration, error) { + return s.Internal.SectorGetExpectedSealDuration(p0) } -// WorkerStruct +func (s *StorageMinerStruct) SectorGetSealDelay(p0 context.Context) (time.Duration, error) { + return s.Internal.SectorGetSealDelay(p0) +} -func (w *WorkerStruct) Version(ctx context.Context) (api.Version, error) { - return w.Internal.Version(ctx) +func (s *StorageMinerStruct) SectorMarkForUpgrade(p0 context.Context, p1 abi.SectorNumber) error { + return s.Internal.SectorMarkForUpgrade(p0, p1) } -func (w *WorkerStruct) TaskTypes(ctx context.Context) (map[sealtasks.TaskType]struct{}, error) { - return w.Internal.TaskTypes(ctx) +func (s *StorageMinerStruct) SectorRemove(p0 context.Context, p1 abi.SectorNumber) error { + return s.Internal.SectorRemove(p0, p1) } -func (w *WorkerStruct) Paths(ctx context.Context) ([]stores.StoragePath, error) { - return w.Internal.Paths(ctx) +func (s *StorageMinerStruct) SectorSetExpectedSealDuration(p0 context.Context, p1 time.Duration) error { + return s.Internal.SectorSetExpectedSealDuration(p0, p1) } -func (w *WorkerStruct) Info(ctx context.Context) (storiface.WorkerInfo, error) { - return w.Internal.Info(ctx) +func (s *StorageMinerStruct) SectorSetSealDelay(p0 context.Context, p1 time.Duration) error { + return s.Internal.SectorSetSealDelay(p0, p1) } -func (w *WorkerStruct) AddPiece(ctx context.Context, sector storage.SectorRef, pieceSizes []abi.UnpaddedPieceSize, newPieceSize abi.UnpaddedPieceSize, pieceData storage.Data) (storiface.CallID, error) { - return w.Internal.AddPiece(ctx, sector, pieceSizes, newPieceSize, pieceData) +func (s *StorageMinerStruct) SectorStartSealing(p0 context.Context, p1 abi.SectorNumber) error { + return s.Internal.SectorStartSealing(p0, p1) } -func (w *WorkerStruct) SealPreCommit1(ctx context.Context, sector storage.SectorRef, ticket abi.SealRandomness, pieces []abi.PieceInfo) (storiface.CallID, error) { - return w.Internal.SealPreCommit1(ctx, sector, ticket, pieces) +func (s *StorageMinerStruct) SectorTerminate(p0 context.Context, p1 abi.SectorNumber) error { + return s.Internal.SectorTerminate(p0, p1) } -func (w *WorkerStruct) SealPreCommit2(ctx context.Context, sector storage.SectorRef, pc1o storage.PreCommit1Out) (storiface.CallID, error) { - return w.Internal.SealPreCommit2(ctx, sector, pc1o) +func (s *StorageMinerStruct) SectorTerminateFlush(p0 context.Context) (*cid.Cid, error) { + return s.Internal.SectorTerminateFlush(p0) } -func (w *WorkerStruct) SealCommit1(ctx context.Context, sector storage.SectorRef, ticket abi.SealRandomness, seed abi.InteractiveSealRandomness, pieces []abi.PieceInfo, cids storage.SectorCids) (storiface.CallID, error) { - return w.Internal.SealCommit1(ctx, sector, ticket, seed, pieces, cids) +func (s *StorageMinerStruct) SectorTerminatePending(p0 context.Context) ([]abi.SectorID, error) { + return s.Internal.SectorTerminatePending(p0) } -func (w *WorkerStruct) SealCommit2(ctx context.Context, sector storage.SectorRef, c1o storage.Commit1Out) (storiface.CallID, error) { - return w.Internal.SealCommit2(ctx, sector, c1o) +func (s *StorageMinerStruct) SectorsList(p0 context.Context) ([]abi.SectorNumber, error) { + return s.Internal.SectorsList(p0) } -func (w *WorkerStruct) FinalizeSector(ctx context.Context, sector storage.SectorRef, keepUnsealed []storage.Range) (storiface.CallID, error) { - return w.Internal.FinalizeSector(ctx, sector, keepUnsealed) +func (s *StorageMinerStruct) SectorsListInStates(p0 context.Context, p1 []api.SectorState) ([]abi.SectorNumber, error) { + return s.Internal.SectorsListInStates(p0, p1) } -func (w *WorkerStruct) ReleaseUnsealed(ctx context.Context, sector storage.SectorRef, safeToFree []storage.Range) (storiface.CallID, error) { - return w.Internal.ReleaseUnsealed(ctx, sector, safeToFree) +func (s *StorageMinerStruct) SectorsRefs(p0 context.Context) (map[string][]api.SealedRef, error) { + return s.Internal.SectorsRefs(p0) } -func (w *WorkerStruct) MoveStorage(ctx context.Context, sector storage.SectorRef, types storiface.SectorFileType) (storiface.CallID, error) { - return w.Internal.MoveStorage(ctx, sector, types) +func (s *StorageMinerStruct) SectorsStatus(p0 context.Context, p1 abi.SectorNumber, p2 bool) (api.SectorInfo, error) { + return s.Internal.SectorsStatus(p0, p1, p2) } -func (w *WorkerStruct) UnsealPiece(ctx context.Context, sector storage.SectorRef, offset storiface.UnpaddedByteIndex, size abi.UnpaddedPieceSize, ticket abi.SealRandomness, c cid.Cid) (storiface.CallID, error) { - return w.Internal.UnsealPiece(ctx, sector, offset, size, ticket, c) +func (s *StorageMinerStruct) SectorsSummary(p0 context.Context) (map[api.SectorState]int, error) { + return s.Internal.SectorsSummary(p0) } -func (w *WorkerStruct) ReadPiece(ctx context.Context, sink io.Writer, sector storage.SectorRef, offset storiface.UnpaddedByteIndex, size abi.UnpaddedPieceSize) (storiface.CallID, error) { - return w.Internal.ReadPiece(ctx, sink, sector, offset, size) +func (s *StorageMinerStruct) SectorsUpdate(p0 context.Context, p1 abi.SectorNumber, p2 api.SectorState) error { + return s.Internal.SectorsUpdate(p0, p1, p2) } -func (w *WorkerStruct) Fetch(ctx context.Context, id storage.SectorRef, fileType storiface.SectorFileType, ptype storiface.PathType, am storiface.AcquireMode) (storiface.CallID, error) { - return w.Internal.Fetch(ctx, id, fileType, ptype, am) +func (s *StorageMinerStruct) StorageAddLocal(p0 context.Context, p1 string) error { + return s.Internal.StorageAddLocal(p0, p1) } -func (w *WorkerStruct) TaskDisable(ctx context.Context, tt sealtasks.TaskType) error { - return w.Internal.TaskDisable(ctx, tt) +func (s *StorageMinerStruct) StorageAttach(p0 context.Context, p1 stores.StorageInfo, p2 fsutil.FsStat) error { + return s.Internal.StorageAttach(p0, p1, p2) } -func (w *WorkerStruct) TaskEnable(ctx context.Context, tt sealtasks.TaskType) error { - return w.Internal.TaskEnable(ctx, tt) +func (s *StorageMinerStruct) StorageBestAlloc(p0 context.Context, p1 storiface.SectorFileType, p2 abi.SectorSize, p3 storiface.PathType) ([]stores.StorageInfo, error) { + return s.Internal.StorageBestAlloc(p0, p1, p2, p3) } -func (w *WorkerStruct) Remove(ctx context.Context, sector abi.SectorID) error { - return w.Internal.Remove(ctx, sector) +func (s *StorageMinerStruct) StorageDeclareSector(p0 context.Context, p1 stores.ID, p2 abi.SectorID, p3 storiface.SectorFileType, p4 bool) error { + return s.Internal.StorageDeclareSector(p0, p1, p2, p3, p4) } -func (w *WorkerStruct) StorageAddLocal(ctx context.Context, path string) error { - return w.Internal.StorageAddLocal(ctx, path) +func (s *StorageMinerStruct) StorageDropSector(p0 context.Context, p1 stores.ID, p2 abi.SectorID, p3 storiface.SectorFileType) error { + return s.Internal.StorageDropSector(p0, p1, p2, p3) } -func (w *WorkerStruct) SetEnabled(ctx context.Context, enabled bool) error { - return w.Internal.SetEnabled(ctx, enabled) +func (s *StorageMinerStruct) StorageFindSector(p0 context.Context, p1 abi.SectorID, p2 storiface.SectorFileType, p3 abi.SectorSize, p4 bool) ([]stores.SectorStorageInfo, error) { + return s.Internal.StorageFindSector(p0, p1, p2, p3, p4) } -func (w *WorkerStruct) Enabled(ctx context.Context) (bool, error) { - return w.Internal.Enabled(ctx) +func (s *StorageMinerStruct) StorageInfo(p0 context.Context, p1 stores.ID) (stores.StorageInfo, error) { + return s.Internal.StorageInfo(p0, p1) } -func (w *WorkerStruct) WaitQuiet(ctx context.Context) error { - return w.Internal.WaitQuiet(ctx) +func (s *StorageMinerStruct) StorageList(p0 context.Context) (map[stores.ID][]stores.Decl, error) { + return s.Internal.StorageList(p0) } -func (w *WorkerStruct) ProcessSession(ctx context.Context) (uuid.UUID, error) { - return w.Internal.ProcessSession(ctx) +func (s *StorageMinerStruct) StorageLocal(p0 context.Context) (map[stores.ID]string, error) { + return s.Internal.StorageLocal(p0) } -func (w *WorkerStruct) Session(ctx context.Context) (uuid.UUID, error) { - return w.Internal.Session(ctx) +func (s *StorageMinerStruct) StorageLock(p0 context.Context, p1 abi.SectorID, p2 storiface.SectorFileType, p3 storiface.SectorFileType) error { + return s.Internal.StorageLock(p0, p1, p2, p3) } -func (g GatewayStruct) ChainGetBlockMessages(ctx context.Context, c cid.Cid) (*api.BlockMessages, error) { - return g.Internal.ChainGetBlockMessages(ctx, c) +func (s *StorageMinerStruct) StorageReportHealth(p0 context.Context, p1 stores.ID, p2 stores.HealthReport) error { + return s.Internal.StorageReportHealth(p0, p1, p2) } -func (g GatewayStruct) ChainGetMessage(ctx context.Context, mc cid.Cid) (*types.Message, error) { - return g.Internal.ChainGetMessage(ctx, mc) +func (s *StorageMinerStruct) StorageStat(p0 context.Context, p1 stores.ID) (fsutil.FsStat, error) { + return s.Internal.StorageStat(p0, p1) } -func (g GatewayStruct) ChainGetTipSet(ctx context.Context, tsk types.TipSetKey) (*types.TipSet, error) { - return g.Internal.ChainGetTipSet(ctx, tsk) +func (s *StorageMinerStruct) StorageTryLock(p0 context.Context, p1 abi.SectorID, p2 storiface.SectorFileType, p3 storiface.SectorFileType) (bool, error) { + return s.Internal.StorageTryLock(p0, p1, p2, p3) } -func (g GatewayStruct) ChainGetTipSetByHeight(ctx context.Context, h abi.ChainEpoch, tsk types.TipSetKey) (*types.TipSet, error) { - return g.Internal.ChainGetTipSetByHeight(ctx, h, tsk) +func (s *StorageMinerStruct) WorkerConnect(p0 context.Context, p1 string) error { + return s.Internal.WorkerConnect(p0, p1) } -func (g GatewayStruct) ChainHasObj(ctx context.Context, c cid.Cid) (bool, error) { - return g.Internal.ChainHasObj(ctx, c) +func (s *StorageMinerStruct) WorkerJobs(p0 context.Context) (map[uuid.UUID][]storiface.WorkerJob, error) { + return s.Internal.WorkerJobs(p0) } -func (g GatewayStruct) ChainHead(ctx context.Context) (*types.TipSet, error) { - return g.Internal.ChainHead(ctx) +func (s *StorageMinerStruct) WorkerStats(p0 context.Context) (map[uuid.UUID]storiface.WorkerStats, error) { + return s.Internal.WorkerStats(p0) } -func (g GatewayStruct) ChainNotify(ctx context.Context) (<-chan []*api.HeadChange, error) { - return g.Internal.ChainNotify(ctx) +func (s *WalletStruct) WalletDelete(p0 context.Context, p1 address.Address) error { + return s.Internal.WalletDelete(p0, p1) } -func (g GatewayStruct) ChainReadObj(ctx context.Context, c cid.Cid) ([]byte, error) { - return g.Internal.ChainReadObj(ctx, c) +func (s *WalletStruct) WalletExport(p0 context.Context, p1 address.Address) (*types.KeyInfo, error) { + return s.Internal.WalletExport(p0, p1) } -func (g GatewayStruct) GasEstimateMessageGas(ctx context.Context, msg *types.Message, spec *api.MessageSendSpec, tsk types.TipSetKey) (*types.Message, error) { - return g.Internal.GasEstimateMessageGas(ctx, msg, spec, tsk) +func (s *WalletStruct) WalletHas(p0 context.Context, p1 address.Address) (bool, error) { + return s.Internal.WalletHas(p0, p1) } -func (g GatewayStruct) MpoolPush(ctx context.Context, sm *types.SignedMessage) (cid.Cid, error) { - return g.Internal.MpoolPush(ctx, sm) +func (s *WalletStruct) WalletImport(p0 context.Context, p1 *types.KeyInfo) (address.Address, error) { + return s.Internal.WalletImport(p0, p1) } -func (g GatewayStruct) MsigGetAvailableBalance(ctx context.Context, addr address.Address, tsk types.TipSetKey) (types.BigInt, error) { - return g.Internal.MsigGetAvailableBalance(ctx, addr, tsk) +func (s *WalletStruct) WalletList(p0 context.Context) ([]address.Address, error) { + return s.Internal.WalletList(p0) } -func (g GatewayStruct) MsigGetVested(ctx context.Context, addr address.Address, start types.TipSetKey, end types.TipSetKey) (types.BigInt, error) { - return g.Internal.MsigGetVested(ctx, addr, start, end) +func (s *WalletStruct) WalletNew(p0 context.Context, p1 types.KeyType) (address.Address, error) { + return s.Internal.WalletNew(p0, p1) } -func (g GatewayStruct) MsigGetPending(ctx context.Context, addr address.Address, tsk types.TipSetKey) ([]*api.MsigTransaction, error) { - return g.Internal.MsigGetPending(ctx, addr, tsk) +func (s *WalletStruct) WalletSign(p0 context.Context, p1 address.Address, p2 []byte, p3 api.MsgMeta) (*crypto.Signature, error) { + return s.Internal.WalletSign(p0, p1, p2, p3) } -func (g GatewayStruct) StateAccountKey(ctx context.Context, addr address.Address, tsk types.TipSetKey) (address.Address, error) { - return g.Internal.StateAccountKey(ctx, addr, tsk) +func (s *WorkerStruct) AddPiece(p0 context.Context, p1 storage.SectorRef, p2 []abi.UnpaddedPieceSize, p3 abi.UnpaddedPieceSize, p4 storage.Data) (storiface.CallID, error) { + return s.Internal.AddPiece(p0, p1, p2, p3, p4) } -func (g GatewayStruct) StateDealProviderCollateralBounds(ctx context.Context, size abi.PaddedPieceSize, verified bool, tsk types.TipSetKey) (api.DealCollateralBounds, error) { - return g.Internal.StateDealProviderCollateralBounds(ctx, size, verified, tsk) +func (s *WorkerStruct) Enabled(p0 context.Context) (bool, error) { + return s.Internal.Enabled(p0) } -func (g GatewayStruct) StateGetActor(ctx context.Context, actor address.Address, ts types.TipSetKey) (*types.Actor, error) { - return g.Internal.StateGetActor(ctx, actor, ts) +func (s *WorkerStruct) Fetch(p0 context.Context, p1 storage.SectorRef, p2 storiface.SectorFileType, p3 storiface.PathType, p4 storiface.AcquireMode) (storiface.CallID, error) { + return s.Internal.Fetch(p0, p1, p2, p3, p4) } -func (g GatewayStruct) StateGetReceipt(ctx context.Context, c cid.Cid, tsk types.TipSetKey) (*types.MessageReceipt, error) { - return g.Internal.StateGetReceipt(ctx, c, tsk) +func (s *WorkerStruct) FinalizeSector(p0 context.Context, p1 storage.SectorRef, p2 []storage.Range) (storiface.CallID, error) { + return s.Internal.FinalizeSector(p0, p1, p2) } -func (g GatewayStruct) StateLookupID(ctx context.Context, addr address.Address, tsk types.TipSetKey) (address.Address, error) { - return g.Internal.StateLookupID(ctx, addr, tsk) +func (s *WorkerStruct) Info(p0 context.Context) (storiface.WorkerInfo, error) { + return s.Internal.Info(p0) } -func (g GatewayStruct) StateListMiners(ctx context.Context, tsk types.TipSetKey) ([]address.Address, error) { - return g.Internal.StateListMiners(ctx, tsk) +func (s *WorkerStruct) MoveStorage(p0 context.Context, p1 storage.SectorRef, p2 storiface.SectorFileType) (storiface.CallID, error) { + return s.Internal.MoveStorage(p0, p1, p2) } -func (g GatewayStruct) StateMarketBalance(ctx context.Context, addr address.Address, tsk types.TipSetKey) (api.MarketBalance, error) { - return g.Internal.StateMarketBalance(ctx, addr, tsk) +func (s *WorkerStruct) Paths(p0 context.Context) ([]stores.StoragePath, error) { + return s.Internal.Paths(p0) } -func (g GatewayStruct) StateMarketStorageDeal(ctx context.Context, dealId abi.DealID, tsk types.TipSetKey) (*api.MarketDeal, error) { - return g.Internal.StateMarketStorageDeal(ctx, dealId, tsk) +func (s *WorkerStruct) ProcessSession(p0 context.Context) (uuid.UUID, error) { + return s.Internal.ProcessSession(p0) } -func (g GatewayStruct) StateMinerInfo(ctx context.Context, actor address.Address, tsk types.TipSetKey) (miner.MinerInfo, error) { - return g.Internal.StateMinerInfo(ctx, actor, tsk) +func (s *WorkerStruct) ReadPiece(p0 context.Context, p1 io.Writer, p2 storage.SectorRef, p3 storiface.UnpaddedByteIndex, p4 abi.UnpaddedPieceSize) (storiface.CallID, error) { + return s.Internal.ReadPiece(p0, p1, p2, p3, p4) } -func (g GatewayStruct) StateMinerProvingDeadline(ctx context.Context, addr address.Address, tsk types.TipSetKey) (*dline.Info, error) { - return g.Internal.StateMinerProvingDeadline(ctx, addr, tsk) +func (s *WorkerStruct) ReleaseUnsealed(p0 context.Context, p1 storage.SectorRef, p2 []storage.Range) (storiface.CallID, error) { + return s.Internal.ReleaseUnsealed(p0, p1, p2) } -func (g GatewayStruct) StateMinerPower(ctx context.Context, addr address.Address, tsk types.TipSetKey) (*api.MinerPower, error) { - return g.Internal.StateMinerPower(ctx, addr, tsk) +func (s *WorkerStruct) Remove(p0 context.Context, p1 abi.SectorID) error { + return s.Internal.Remove(p0, p1) } -func (g GatewayStruct) StateNetworkVersion(ctx context.Context, tsk types.TipSetKey) (stnetwork.Version, error) { - return g.Internal.StateNetworkVersion(ctx, tsk) +func (s *WorkerStruct) SealCommit1(p0 context.Context, p1 storage.SectorRef, p2 abi.SealRandomness, p3 abi.InteractiveSealRandomness, p4 []abi.PieceInfo, p5 storage.SectorCids) (storiface.CallID, error) { + return s.Internal.SealCommit1(p0, p1, p2, p3, p4, p5) } -func (g GatewayStruct) StateSearchMsg(ctx context.Context, msg cid.Cid) (*api.MsgLookup, error) { - return g.Internal.StateSearchMsg(ctx, msg) +func (s *WorkerStruct) SealCommit2(p0 context.Context, p1 storage.SectorRef, p2 storage.Commit1Out) (storiface.CallID, error) { + return s.Internal.SealCommit2(p0, p1, p2) } -func (g GatewayStruct) StateSectorGetInfo(ctx context.Context, maddr address.Address, n abi.SectorNumber, tsk types.TipSetKey) (*miner.SectorOnChainInfo, error) { - return g.Internal.StateSectorGetInfo(ctx, maddr, n, tsk) +func (s *WorkerStruct) SealPreCommit1(p0 context.Context, p1 storage.SectorRef, p2 abi.SealRandomness, p3 []abi.PieceInfo) (storiface.CallID, error) { + return s.Internal.SealPreCommit1(p0, p1, p2, p3) } -func (g GatewayStruct) StateVerifiedClientStatus(ctx context.Context, addr address.Address, tsk types.TipSetKey) (*abi.StoragePower, error) { - return g.Internal.StateVerifiedClientStatus(ctx, addr, tsk) +func (s *WorkerStruct) SealPreCommit2(p0 context.Context, p1 storage.SectorRef, p2 storage.PreCommit1Out) (storiface.CallID, error) { + return s.Internal.SealPreCommit2(p0, p1, p2) } -func (g GatewayStruct) StateWaitMsg(ctx context.Context, msg cid.Cid, confidence uint64) (*api.MsgLookup, error) { - return g.Internal.StateWaitMsg(ctx, msg, confidence) +func (s *WorkerStruct) Session(p0 context.Context) (uuid.UUID, error) { + return s.Internal.Session(p0) } -func (g GatewayStruct) StateReadState(ctx context.Context, addr address.Address, ts types.TipSetKey) (*api.ActorState, error) { - return g.Internal.StateReadState(ctx, addr, ts) +func (s *WorkerStruct) SetEnabled(p0 context.Context, p1 bool) error { + return s.Internal.SetEnabled(p0, p1) } -func (c *WalletStruct) WalletNew(ctx context.Context, typ types.KeyType) (address.Address, error) { - return c.Internal.WalletNew(ctx, typ) +func (s *WorkerStruct) StorageAddLocal(p0 context.Context, p1 string) error { + return s.Internal.StorageAddLocal(p0, p1) } -func (c *WalletStruct) WalletHas(ctx context.Context, addr address.Address) (bool, error) { - return c.Internal.WalletHas(ctx, addr) +func (s *WorkerStruct) TaskDisable(p0 context.Context, p1 sealtasks.TaskType) error { + return s.Internal.TaskDisable(p0, p1) } -func (c *WalletStruct) WalletList(ctx context.Context) ([]address.Address, error) { - return c.Internal.WalletList(ctx) +func (s *WorkerStruct) TaskEnable(p0 context.Context, p1 sealtasks.TaskType) error { + return s.Internal.TaskEnable(p0, p1) } -func (c *WalletStruct) WalletSign(ctx context.Context, k address.Address, msg []byte, meta api.MsgMeta) (*crypto.Signature, error) { - return c.Internal.WalletSign(ctx, k, msg, meta) +func (s *WorkerStruct) TaskTypes(p0 context.Context) (map[sealtasks.TaskType]struct{}, error) { + return s.Internal.TaskTypes(p0) } -func (c *WalletStruct) WalletExport(ctx context.Context, a address.Address) (*types.KeyInfo, error) { - return c.Internal.WalletExport(ctx, a) +func (s *WorkerStruct) UnsealPiece(p0 context.Context, p1 storage.SectorRef, p2 storiface.UnpaddedByteIndex, p3 abi.UnpaddedPieceSize, p4 abi.SealRandomness, p5 cid.Cid) (storiface.CallID, error) { + return s.Internal.UnsealPiece(p0, p1, p2, p3, p4, p5) } -func (c *WalletStruct) WalletImport(ctx context.Context, ki *types.KeyInfo) (address.Address, error) { - return c.Internal.WalletImport(ctx, ki) +func (s *WorkerStruct) Version(p0 context.Context) (api.Version, error) { + return s.Internal.Version(p0) } -func (c *WalletStruct) WalletDelete(ctx context.Context, addr address.Address) error { - return c.Internal.WalletDelete(ctx, addr) +func (s *WorkerStruct) WaitQuiet(p0 context.Context) error { + return s.Internal.WaitQuiet(p0) } -var _ api.Common = &CommonStruct{} -var _ api.FullNode = &FullNodeStruct{} -var _ api.StorageMiner = &StorageMinerStruct{} -var _ api.WorkerAPI = &WorkerStruct{} -var _ api.GatewayAPI = &GatewayStruct{} -var _ api.WalletAPI = &WalletStruct{} +var _ api.ChainIO = new(ChainIOStruct) +var _ api.Common = new(CommonStruct) +var _ api.FullNode = new(FullNodeStruct) +var _ api.Gateway = new(GatewayStruct) +var _ api.Signable = new(SignableStruct) +var _ api.StorageMiner = new(StorageMinerStruct) +var _ api.Wallet = new(WalletStruct) +var _ api.Worker = new(WorkerStruct) diff --git a/api/client/client.go b/api/client/client.go index 7d8a466d3..9ffd1707e 100644 --- a/api/client/client.go +++ b/api/client/client.go @@ -54,7 +54,7 @@ func NewStorageMinerRPC(ctx context.Context, addr string, requestHeader http.Hea return &res, closer, err } -func NewWorkerRPC(ctx context.Context, addr string, requestHeader http.Header) (api.WorkerAPI, jsonrpc.ClientCloser, error) { +func NewWorkerRPC(ctx context.Context, addr string, requestHeader http.Header) (api.Worker, jsonrpc.ClientCloser, error) { u, err := url.Parse(addr) if err != nil { return nil, nil, err @@ -84,7 +84,7 @@ func NewWorkerRPC(ctx context.Context, addr string, requestHeader http.Header) ( } // NewGatewayRPC creates a new http jsonrpc client for a gateway node. -func NewGatewayRPC(ctx context.Context, addr string, requestHeader http.Header, opts ...jsonrpc.Option) (api.GatewayAPI, jsonrpc.ClientCloser, error) { +func NewGatewayRPC(ctx context.Context, addr string, requestHeader http.Header, opts ...jsonrpc.Option) (api.Gateway, jsonrpc.ClientCloser, error) { var res apistruct.GatewayStruct closer, err := jsonrpc.NewMergeClient(ctx, addr, "Filecoin", []interface{}{ @@ -97,7 +97,7 @@ func NewGatewayRPC(ctx context.Context, addr string, requestHeader http.Header, return &res, closer, err } -func NewWalletRPC(ctx context.Context, addr string, requestHeader http.Header) (api.WalletAPI, jsonrpc.ClientCloser, error) { +func NewWalletRPC(ctx context.Context, addr string, requestHeader http.Header) (api.Wallet, jsonrpc.ClientCloser, error) { var res apistruct.WalletStruct closer, err := jsonrpc.NewMergeClient(ctx, addr, "Filecoin", []interface{}{ diff --git a/api/docgen-openrpc/cmd/docgen_openrpc.go b/api/docgen-openrpc/cmd/docgen_openrpc.go new file mode 100644 index 000000000..81683e04d --- /dev/null +++ b/api/docgen-openrpc/cmd/docgen_openrpc.go @@ -0,0 +1,77 @@ +package main + +import ( + "compress/gzip" + "encoding/json" + "io" + "log" + "os" + + "github.com/filecoin-project/lotus/api/apistruct" + docgen_openrpc "github.com/filecoin-project/lotus/api/docgen-openrpc" +) + +/* +main defines a small program that writes an OpenRPC document describing +a Lotus API to stdout. + +If the first argument is "miner", the document will describe the StorageMiner API. +If not (no, or any other args), the document will describe the Full API. + +Use: + + go run ./api/openrpc/cmd ["api/api_full.go"|"api/api_storage.go"|"api/api_worker.go"] ["FullNode"|"StorageMiner"|"Worker"] + + With gzip compression: a '-gzip' flag is made available as an optional third argument. Note that position matters. + + go run ./api/openrpc/cmd ["api/api_full.go"|"api/api_storage.go"|"api/api_worker.go"] ["FullNode"|"StorageMiner"|"Worker"] -gzip + +*/ + +func main() { + doc := docgen_openrpc.NewLotusOpenRPCDocument() + + switch os.Args[2] { + case "FullNode": + doc.RegisterReceiverName("Filecoin", &apistruct.FullNodeStruct{}) + case "StorageMiner": + doc.RegisterReceiverName("Filecoin", &apistruct.StorageMinerStruct{}) + case "Worker": + doc.RegisterReceiverName("Filecoin", &apistruct.WorkerStruct{}) + } + + out, err := doc.Discover() + if err != nil { + log.Fatalln(err) + } + + var jsonOut []byte + var writer io.WriteCloser + + // Use os.Args to handle a somewhat hacky flag for the gzip option. + // Could use flags package to handle this more cleanly, but that requires changes elsewhere + // the scope of which just isn't warranted by this one use case which will usually be run + // programmatically anyways. + if len(os.Args) > 3 && os.Args[3] == "-gzip" { + jsonOut, err = json.Marshal(out) + if err != nil { + log.Fatalln(err) + } + writer = gzip.NewWriter(os.Stdout) + } else { + jsonOut, err = json.MarshalIndent(out, "", " ") + if err != nil { + log.Fatalln(err) + } + writer = os.Stdout + } + + _, err = writer.Write(jsonOut) + if err != nil { + log.Fatalln(err) + } + err = writer.Close() + if err != nil { + log.Fatalln(err) + } +} diff --git a/api/docgen-openrpc/openrpc.go b/api/docgen-openrpc/openrpc.go new file mode 100644 index 000000000..507ad3cb1 --- /dev/null +++ b/api/docgen-openrpc/openrpc.go @@ -0,0 +1,172 @@ +package docgenopenrpc + +import ( + "encoding/json" + "go/ast" + "net" + "os" + "reflect" + + "github.com/alecthomas/jsonschema" + go_openrpc_reflect "github.com/etclabscore/go-openrpc-reflect" + "github.com/filecoin-project/lotus/api/docgen" + "github.com/filecoin-project/lotus/build" + "github.com/ipfs/go-cid" + meta_schema "github.com/open-rpc/meta-schema" +) + +// Comments holds API method comments collected by AST parsing. +var Comments map[string]string + +// GroupDocs holds documentation for documentation groups. +var GroupDocs map[string]string + +func init() { + Comments, GroupDocs = docgen.ParseApiASTInfo(os.Args[1], os.Args[2]) +} + +// schemaDictEntry represents a type association passed to the jsonschema reflector. +type schemaDictEntry struct { + example interface{} + rawJson string +} + +const integerD = `{ + "title": "number", + "type": "number", + "description": "Number is a number" + }` + +const cidCidD = `{"title": "Content Identifier", "type": "string", "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."}` + +func OpenRPCSchemaTypeMapper(ty reflect.Type) *jsonschema.Type { + unmarshalJSONToJSONSchemaType := func(input string) *jsonschema.Type { + var js jsonschema.Type + err := json.Unmarshal([]byte(input), &js) + if err != nil { + panic(err) + } + return &js + } + + if ty.Kind() == reflect.Ptr { + ty = ty.Elem() + } + + if ty == reflect.TypeOf((*interface{})(nil)).Elem() { + return &jsonschema.Type{Type: "object", AdditionalProperties: []byte("true")} + } + + // Second, handle other types. + // Use a slice instead of a map because it preserves order, as a logic safeguard/fallback. + dict := []schemaDictEntry{ + {cid.Cid{}, cidCidD}, + } + + for _, d := range dict { + if reflect.TypeOf(d.example) == ty { + tt := unmarshalJSONToJSONSchemaType(d.rawJson) + + return tt + } + } + + // Handle primitive types in case there are generic cases + // specific to our services. + switch ty.Kind() { + case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64: + // Return all integer types as the hex representation integer schemea. + ret := unmarshalJSONToJSONSchemaType(integerD) + return ret + case reflect.Uintptr: + return &jsonschema.Type{Type: "number", Title: "uintptr-title"} + case reflect.Struct: + case reflect.Map: + case reflect.Slice, reflect.Array: + case reflect.Float32, reflect.Float64: + case reflect.Bool: + case reflect.String: + case reflect.Ptr, reflect.Interface: + default: + } + + return nil +} + +// NewLotusOpenRPCDocument defines application-specific documentation and configuration for its OpenRPC document. +func NewLotusOpenRPCDocument() *go_openrpc_reflect.Document { + d := &go_openrpc_reflect.Document{} + + // Register "Meta" document fields. + // These include getters for + // - Servers object + // - Info object + // - ExternalDocs object + // + // These objects represent server-specific data that cannot be + // reflected. + d.WithMeta(&go_openrpc_reflect.MetaT{ + GetServersFn: func() func(listeners []net.Listener) (*meta_schema.Servers, error) { + return func(listeners []net.Listener) (*meta_schema.Servers, error) { + return nil, nil + } + }, + GetInfoFn: func() (info *meta_schema.InfoObject) { + info = &meta_schema.InfoObject{} + title := "Lotus RPC API" + info.Title = (*meta_schema.InfoObjectProperties)(&title) + + version := build.BuildVersion + info.Version = (*meta_schema.InfoObjectVersion)(&version) + return info + }, + GetExternalDocsFn: func() (exdocs *meta_schema.ExternalDocumentationObject) { + return nil // FIXME + }, + }) + + // Use a provided Ethereum default configuration as a base. + appReflector := &go_openrpc_reflect.EthereumReflectorT{} + + // Install overrides for the json schema->type map fn used by the jsonschema reflect package. + appReflector.FnSchemaTypeMap = func() func(ty reflect.Type) *jsonschema.Type { + return OpenRPCSchemaTypeMapper + } + + appReflector.FnIsMethodEligible = func(m reflect.Method) bool { + for i := 0; i < m.Func.Type().NumOut(); i++ { + if m.Func.Type().Out(i).Kind() == reflect.Chan { + return false + } + } + return go_openrpc_reflect.EthereumReflector.IsMethodEligible(m) + } + appReflector.FnGetMethodName = func(moduleName string, r reflect.Value, m reflect.Method, funcDecl *ast.FuncDecl) (string, error) { + if m.Name == "ID" { + return moduleName + "_ID", nil + } + if moduleName == "rpc" && m.Name == "Discover" { + return "rpc.discover", nil + } + + return moduleName + "." + m.Name, nil + } + + appReflector.FnGetMethodSummary = func(r reflect.Value, m reflect.Method, funcDecl *ast.FuncDecl) (string, error) { + if v, ok := Comments[m.Name]; ok { + return v, nil + } + return "", nil // noComment + } + + appReflector.FnSchemaExamples = func(ty reflect.Type) (examples *meta_schema.Examples, err error) { + v := docgen.ExampleValue("unknown", ty, ty) // This isn't ideal, but seems to work well enough. + return &meta_schema.Examples{ + meta_schema.AlwaysTrue(v), + }, nil + } + + // Finally, register the configured reflector to the document. + d.WithReflector(appReflector) + return d +} diff --git a/api/docgen/cmd/docgen.go b/api/docgen/cmd/docgen.go new file mode 100644 index 000000000..c47d44208 --- /dev/null +++ b/api/docgen/cmd/docgen.go @@ -0,0 +1,137 @@ +package main + +import ( + "encoding/json" + "fmt" + "os" + "reflect" + "sort" + "strings" + + "github.com/filecoin-project/lotus/api" + "github.com/filecoin-project/lotus/api/apistruct" + "github.com/filecoin-project/lotus/api/docgen" +) + +func main() { + comments, groupComments := docgen.ParseApiASTInfo(os.Args[1], os.Args[2]) + + groups := make(map[string]*docgen.MethodGroup) + + var t reflect.Type + var permStruct, commonPermStruct reflect.Type + + switch os.Args[2] { + case "FullNode": + t = reflect.TypeOf(new(struct{ api.FullNode })).Elem() + permStruct = reflect.TypeOf(apistruct.FullNodeStruct{}.Internal) + commonPermStruct = reflect.TypeOf(apistruct.CommonStruct{}.Internal) + case "StorageMiner": + t = reflect.TypeOf(new(struct{ api.StorageMiner })).Elem() + permStruct = reflect.TypeOf(apistruct.StorageMinerStruct{}.Internal) + commonPermStruct = reflect.TypeOf(apistruct.CommonStruct{}.Internal) + case "Worker": + t = reflect.TypeOf(new(struct{ api.Worker })).Elem() + permStruct = reflect.TypeOf(apistruct.WorkerStruct{}.Internal) + commonPermStruct = reflect.TypeOf(apistruct.WorkerStruct{}.Internal) + default: + panic("unknown type") + } + + for i := 0; i < t.NumMethod(); i++ { + m := t.Method(i) + + groupName := docgen.MethodGroupFromName(m.Name) + + g, ok := groups[groupName] + if !ok { + g = new(docgen.MethodGroup) + g.Header = groupComments[groupName] + g.GroupName = groupName + groups[groupName] = g + } + + var args []interface{} + ft := m.Func.Type() + for j := 2; j < ft.NumIn(); j++ { + inp := ft.In(j) + args = append(args, docgen.ExampleValue(m.Name, inp, nil)) + } + + v, err := json.MarshalIndent(args, "", " ") + if err != nil { + panic(err) + } + + outv := docgen.ExampleValue(m.Name, ft.Out(0), nil) + + ov, err := json.MarshalIndent(outv, "", " ") + if err != nil { + panic(err) + } + + g.Methods = append(g.Methods, &docgen.Method{ + Name: m.Name, + Comment: comments[m.Name], + InputExample: string(v), + ResponseExample: string(ov), + }) + } + + var groupslice []*docgen.MethodGroup + for _, g := range groups { + groupslice = append(groupslice, g) + } + + sort.Slice(groupslice, func(i, j int) bool { + return groupslice[i].GroupName < groupslice[j].GroupName + }) + + fmt.Printf("# Groups\n") + + for _, g := range groupslice { + fmt.Printf("* [%s](#%s)\n", g.GroupName, g.GroupName) + for _, method := range g.Methods { + fmt.Printf(" * [%s](#%s)\n", method.Name, method.Name) + } + } + + for _, g := range groupslice { + g := g + fmt.Printf("## %s\n", g.GroupName) + fmt.Printf("%s\n\n", g.Header) + + sort.Slice(g.Methods, func(i, j int) bool { + return g.Methods[i].Name < g.Methods[j].Name + }) + + for _, m := range g.Methods { + fmt.Printf("### %s\n", m.Name) + fmt.Printf("%s\n\n", m.Comment) + + meth, ok := permStruct.FieldByName(m.Name) + if !ok { + meth, ok = commonPermStruct.FieldByName(m.Name) + if !ok { + panic("no perms for method: " + m.Name) + } + } + + perms := meth.Tag.Get("perm") + + fmt.Printf("Perms: %s\n\n", perms) + + if strings.Count(m.InputExample, "\n") > 0 { + fmt.Printf("Inputs:\n```json\n%s\n```\n\n", m.InputExample) + } else { + fmt.Printf("Inputs: `%s`\n\n", m.InputExample) + } + + if strings.Count(m.ResponseExample, "\n") > 0 { + fmt.Printf("Response:\n```json\n%s\n```\n\n", m.ResponseExample) + } else { + fmt.Printf("Response: `%s`\n\n", m.ResponseExample) + } + } + } +} diff --git a/api/docgen/docgen.go b/api/docgen/docgen.go index 7b6a2725b..e17238d88 100644 --- a/api/docgen/docgen.go +++ b/api/docgen/docgen.go @@ -1,18 +1,18 @@ -package main +package docgen import ( - "encoding/json" "fmt" "go/ast" "go/parser" "go/token" - "os" + "path/filepath" "reflect" - "sort" "strings" "time" "unicode" + "github.com/filecoin-project/go-address" + "github.com/filecoin-project/go-bitfield" "github.com/google/uuid" "github.com/ipfs/go-cid" "github.com/ipfs/go-filestore" @@ -23,8 +23,6 @@ import ( pubsub "github.com/libp2p/go-libp2p-pubsub" "github.com/multiformats/go-multiaddr" - "github.com/filecoin-project/go-address" - "github.com/filecoin-project/go-bitfield" datatransfer "github.com/filecoin-project/go-data-transfer" filestore2 "github.com/filecoin-project/go-fil-markets/filestore" "github.com/filecoin-project/go-fil-markets/retrievalmarket" @@ -36,7 +34,7 @@ import ( "github.com/filecoin-project/go-state-types/exitcode" "github.com/filecoin-project/lotus/api" - "github.com/filecoin-project/lotus/api/apistruct" + apitypes "github.com/filecoin-project/lotus/api/types" "github.com/filecoin-project/lotus/build" "github.com/filecoin-project/lotus/chain/types" "github.com/filecoin-project/lotus/extern/sector-storage/sealtasks" @@ -89,6 +87,8 @@ func init() { addExample(pid) addExample(&pid) + multistoreIDExample := multistore.StoreID(50) + addExample(bitfield.NewFromSet([]uint64{5})) addExample(abi.RegisteredSealProof_StackedDrg32GiBV1_1) addExample(abi.RegisteredPoStProof_StackedDrgWindow32GiBV1) @@ -118,7 +118,8 @@ func init() { addExample(time.Minute) addExample(datatransfer.TransferID(3)) addExample(datatransfer.Ongoing) - addExample(multistore.StoreID(50)) + addExample(multistoreIDExample) + addExample(&multistoreIDExample) addExample(retrievalmarket.ClientEventDealAccepted) addExample(retrievalmarket.DealStatusNew) addExample(network.ReachabilityPublic) @@ -126,17 +127,17 @@ func init() { addExample(map[string]int{"name": 42}) addExample(map[string]time.Time{"name": time.Unix(1615243938, 0).UTC()}) addExample(&types.ExecutionTrace{ - Msg: exampleValue("init", reflect.TypeOf(&types.Message{}), nil).(*types.Message), - MsgRct: exampleValue("init", reflect.TypeOf(&types.MessageReceipt{}), nil).(*types.MessageReceipt), + Msg: ExampleValue("init", reflect.TypeOf(&types.Message{}), nil).(*types.Message), + MsgRct: ExampleValue("init", reflect.TypeOf(&types.MessageReceipt{}), nil).(*types.MessageReceipt), }) addExample(map[string]types.Actor{ - "t01236": exampleValue("init", reflect.TypeOf(types.Actor{}), nil).(types.Actor), + "t01236": ExampleValue("init", reflect.TypeOf(types.Actor{}), nil).(types.Actor), }) addExample(map[string]api.MarketDeal{ - "t026363": exampleValue("init", reflect.TypeOf(api.MarketDeal{}), nil).(api.MarketDeal), + "t026363": ExampleValue("init", reflect.TypeOf(api.MarketDeal{}), nil).(api.MarketDeal), }) addExample(map[string]api.MarketBalance{ - "t026363": exampleValue("init", reflect.TypeOf(api.MarketBalance{}), nil).(api.MarketBalance), + "t026363": ExampleValue("init", reflect.TypeOf(api.MarketBalance{}), nil).(api.MarketBalance), }) addExample(map[string]*pubsub.TopicScoreSnapshot{ "/blocks": { @@ -251,9 +252,17 @@ func init() { sealtasks.TTPreCommit2: {}, }) addExample(sealtasks.TTCommit2) + addExample(apitypes.OpenRPCDocument{ + "openrpc": "1.2.6", + "info": map[string]interface{}{ + "title": "Lotus RPC API", + "version": "1.2.1/generated=2020-11-22T08:22:42-06:00", + }, + "methods": []interface{}{}}, + ) } -func exampleValue(method string, t, parent reflect.Type) interface{} { +func ExampleValue(method string, t, parent reflect.Type) interface{} { v, ok := ExampleValues[t] if ok { return v @@ -262,10 +271,10 @@ func exampleValue(method string, t, parent reflect.Type) interface{} { switch t.Kind() { case reflect.Slice: out := reflect.New(t).Elem() - reflect.Append(out, reflect.ValueOf(exampleValue(method, t.Elem(), t))) + reflect.Append(out, reflect.ValueOf(ExampleValue(method, t.Elem(), t))) return out.Interface() case reflect.Chan: - return exampleValue(method, t.Elem(), nil) + return ExampleValue(method, t.Elem(), nil) case reflect.Struct: es := exampleStruct(method, t, parent) v := reflect.ValueOf(es).Elem().Interface() @@ -274,7 +283,7 @@ func exampleValue(method string, t, parent reflect.Type) interface{} { case reflect.Array: out := reflect.New(t).Elem() for i := 0; i < t.Len(); i++ { - out.Index(i).Set(reflect.ValueOf(exampleValue(method, t.Elem(), t))) + out.Index(i).Set(reflect.ValueOf(ExampleValue(method, t.Elem(), t))) } return out.Interface() @@ -299,7 +308,7 @@ func exampleStruct(method string, t, parent reflect.Type) interface{} { continue } if strings.Title(f.Name) == f.Name { - ns.Elem().Field(i).Set(reflect.ValueOf(exampleValue(method, f.Type, t))) + ns.Elem().Field(i).Set(reflect.ValueOf(ExampleValue(method, f.Type, t))) } } @@ -331,13 +340,24 @@ func (v *Visitor) Visit(node ast.Node) ast.Visitor { return v } -const noComment = "There are not yet any comments for this method." +const NoComment = "There are not yet any comments for this method." -func parseApiASTInfo(apiFile, iface string) (map[string]string, map[string]string) { //nolint:golint +func ParseApiASTInfo(apiFile, iface string) (comments map[string]string, groupDocs map[string]string) { //nolint:golint fset := token.NewFileSet() - pkgs, err := parser.ParseDir(fset, "./api", nil, parser.AllErrors|parser.ParseComments) + apiDir, err := filepath.Abs("./api") + if err != nil { + fmt.Println("./api filepath absolute error: ", err) + return + } + apiFile, err = filepath.Abs(apiFile) + if err != nil { + fmt.Println("filepath absolute error: ", err, "file:", apiFile) + return + } + pkgs, err := parser.ParseDir(fset, apiDir, nil, parser.AllErrors|parser.ParseComments) if err != nil { fmt.Println("parse error: ", err) + return } ap := pkgs["api"] @@ -349,14 +369,14 @@ func parseApiASTInfo(apiFile, iface string) (map[string]string, map[string]strin v := &Visitor{iface, make(map[string]ast.Node)} ast.Walk(v, pkgs["api"]) - groupDocs := make(map[string]string) - out := make(map[string]string) + comments = make(map[string]string) + groupDocs = make(map[string]string) for mn, node := range v.Methods { - cs := cmap.Filter(node).Comments() - if len(cs) == 0 { - out[mn] = noComment + filteredComments := cmap.Filter(node).Comments() + if len(filteredComments) == 0 { + comments[mn] = NoComment } else { - for _, c := range cs { + for _, c := range filteredComments { if strings.HasPrefix(c.Text(), "MethodGroup:") { parts := strings.Split(c.Text(), "\n") groupName := strings.TrimSpace(parts[0][12:]) @@ -367,15 +387,19 @@ func parseApiASTInfo(apiFile, iface string) (map[string]string, map[string]strin } } - last := cs[len(cs)-1].Text() + l := len(filteredComments) - 1 + if len(filteredComments) > 1 { + l = len(filteredComments) - 2 + } + last := filteredComments[l].Text() if !strings.HasPrefix(last, "MethodGroup:") { - out[mn] = last + comments[mn] = last } else { - out[mn] = noComment + comments[mn] = NoComment } } } - return out, groupDocs + return comments, groupDocs } type MethodGroup struct { @@ -391,7 +415,7 @@ type Method struct { ResponseExample string } -func methodGroupFromName(mn string) string { +func MethodGroupFromName(mn string) string { i := strings.IndexFunc(mn[1:], func(r rune) bool { return unicode.IsUpper(r) }) @@ -400,126 +424,3 @@ func methodGroupFromName(mn string) string { } return mn[:i+1] } - -func main() { - comments, groupComments := parseApiASTInfo(os.Args[1], os.Args[2]) - - groups := make(map[string]*MethodGroup) - - var t reflect.Type - var permStruct, commonPermStruct reflect.Type - - switch os.Args[2] { - case "FullNode": - t = reflect.TypeOf(new(struct{ api.FullNode })).Elem() - permStruct = reflect.TypeOf(apistruct.FullNodeStruct{}.Internal) - commonPermStruct = reflect.TypeOf(apistruct.CommonStruct{}.Internal) - case "StorageMiner": - t = reflect.TypeOf(new(struct{ api.StorageMiner })).Elem() - permStruct = reflect.TypeOf(apistruct.StorageMinerStruct{}.Internal) - commonPermStruct = reflect.TypeOf(apistruct.CommonStruct{}.Internal) - case "WorkerAPI": - t = reflect.TypeOf(new(struct{ api.WorkerAPI })).Elem() - permStruct = reflect.TypeOf(apistruct.WorkerStruct{}.Internal) - commonPermStruct = reflect.TypeOf(apistruct.WorkerStruct{}.Internal) - default: - panic("unknown type") - } - - for i := 0; i < t.NumMethod(); i++ { - m := t.Method(i) - - groupName := methodGroupFromName(m.Name) - - g, ok := groups[groupName] - if !ok { - g = new(MethodGroup) - g.Header = groupComments[groupName] - g.GroupName = groupName - groups[groupName] = g - } - - var args []interface{} - ft := m.Func.Type() - for j := 2; j < ft.NumIn(); j++ { - inp := ft.In(j) - args = append(args, exampleValue(m.Name, inp, nil)) - } - - v, err := json.MarshalIndent(args, "", " ") - if err != nil { - panic(err) - } - - outv := exampleValue(m.Name, ft.Out(0), nil) - - ov, err := json.MarshalIndent(outv, "", " ") - if err != nil { - panic(err) - } - - g.Methods = append(g.Methods, &Method{ - Name: m.Name, - Comment: comments[m.Name], - InputExample: string(v), - ResponseExample: string(ov), - }) - } - - var groupslice []*MethodGroup - for _, g := range groups { - groupslice = append(groupslice, g) - } - - sort.Slice(groupslice, func(i, j int) bool { - return groupslice[i].GroupName < groupslice[j].GroupName - }) - - fmt.Printf("# Groups\n") - - for _, g := range groupslice { - fmt.Printf("* [%s](#%s)\n", g.GroupName, g.GroupName) - for _, method := range g.Methods { - fmt.Printf(" * [%s](#%s)\n", method.Name, method.Name) - } - } - - for _, g := range groupslice { - g := g - fmt.Printf("## %s\n", g.GroupName) - fmt.Printf("%s\n\n", g.Header) - - sort.Slice(g.Methods, func(i, j int) bool { - return g.Methods[i].Name < g.Methods[j].Name - }) - - for _, m := range g.Methods { - fmt.Printf("### %s\n", m.Name) - fmt.Printf("%s\n\n", m.Comment) - - meth, ok := permStruct.FieldByName(m.Name) - if !ok { - meth, ok = commonPermStruct.FieldByName(m.Name) - if !ok { - panic("no perms for method: " + m.Name) - } - } - - perms := meth.Tag.Get("perm") - - fmt.Printf("Perms: %s\n\n", perms) - - if strings.Count(m.InputExample, "\n") > 0 { - fmt.Printf("Inputs:\n```json\n%s\n```\n\n", m.InputExample) - } else { - fmt.Printf("Inputs: `%s`\n\n", m.InputExample) - } - - if strings.Count(m.ResponseExample, "\n") > 0 { - fmt.Printf("Response:\n```json\n%s\n```\n\n", m.ResponseExample) - } else { - fmt.Printf("Response: `%s`\n\n", m.ResponseExample) - } - } - } -} diff --git a/api/mocks/mock_full.go b/api/mocks/mock_full.go index 0b76c784d..ebea04c7f 100644 --- a/api/mocks/mock_full.go +++ b/api/mocks/mock_full.go @@ -9,6 +9,7 @@ import ( address "github.com/filecoin-project/go-address" bitfield "github.com/filecoin-project/go-bitfield" datatransfer "github.com/filecoin-project/go-data-transfer" + 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" multistore "github.com/filecoin-project/go-multistore" @@ -18,6 +19,7 @@ import ( dline "github.com/filecoin-project/go-state-types/dline" network "github.com/filecoin-project/go-state-types/network" api "github.com/filecoin-project/lotus/api" + apitypes "github.com/filecoin-project/lotus/api/types" miner "github.com/filecoin-project/lotus/chain/actors/builtin/miner" types "github.com/filecoin-project/lotus/chain/types" marketevents "github.com/filecoin-project/lotus/markets/loggers" @@ -444,6 +446,20 @@ func (mr *MockFullNodeMockRecorder) ClientCancelDataTransfer(arg0, arg1, arg2, a 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() @@ -754,6 +770,21 @@ func (mr *MockFullNodeMockRecorder) ClientStartDeal(arg0, arg1 interface{}) *gom 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() @@ -783,6 +814,21 @@ func (mr *MockFullNodeMockRecorder) CreateBackup(arg0, arg1 interface{}) *gomock return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateBackup", reflect.TypeOf((*MockFullNode)(nil).CreateBackup), arg0, arg1) } +// Discover mocks base method +func (m *MockFullNode) Discover(arg0 context.Context) (apitypes.OpenRPCDocument, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Discover", arg0) + ret0, _ := ret[0].(apitypes.OpenRPCDocument) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// Discover indicates an expected call of Discover +func (mr *MockFullNodeMockRecorder) Discover(arg0 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Discover", reflect.TypeOf((*MockFullNode)(nil).Discover), arg0) +} + // GasEstimateFeeCap mocks base method func (m *MockFullNode) GasEstimateFeeCap(arg0 context.Context, arg1 *types.Message, arg2 int64, arg3 types.TipSetKey) (big.Int, error) { m.ctrl.T.Helper() diff --git a/api/test/deals.go b/api/test/deals.go index f3d22d26c..7a9454bae 100644 --- a/api/test/deals.go +++ b/api/test/deals.go @@ -23,9 +23,11 @@ import ( "github.com/filecoin-project/lotus/chain/actors/builtin/market" "github.com/filecoin-project/lotus/chain/types" sealing "github.com/filecoin-project/lotus/extern/storage-sealing" + "github.com/filecoin-project/lotus/extern/storage-sealing/sealiface" "github.com/filecoin-project/lotus/markets/storageadapter" "github.com/filecoin-project/lotus/node" "github.com/filecoin-project/lotus/node/impl" + "github.com/filecoin-project/lotus/node/modules/dtypes" market2 "github.com/filecoin-project/specs-actors/v2/actors/builtin/market" ipld "github.com/ipfs/go-ipld-format" dag "github.com/ipfs/go-merkledag" @@ -183,6 +185,71 @@ func TestPublishDealsBatching(t *testing.T, b APIBuilder, blocktime time.Duratio } } +func TestBatchDealInput(t *testing.T, b APIBuilder, blocktime time.Duration, startEpoch abi.ChainEpoch) { + publishPeriod := 10 * time.Second + maxDealsPerMsg := uint64(4) + + // Set max deals per publish deals message to maxDealsPerMsg + minerDef := []StorageMiner{{ + Full: 0, + Opts: 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) { + return sealiface.Config{ + MaxWaitDealsSectors: 1, + MaxSealingSectors: 1, + MaxSealingSectorsForDeals: 2, + AlwaysKeepUnsealedCopy: true, + }, nil + }, nil + }), + ), + Preseal: PresealGenesis, + }} + + // Create a connect client and miner node + n, sn := b(t, OneFull, minerDef) + client := n[0].FullNode.(*impl.FullNodeAPI) + miner := sn[0] + s := connectAndStartMining(t, b, blocktime, client, miner) + defer s.blockMiner.Stop() + + // Starts a deal and waits until it's published + runDealTillSeal := func(rseed int) { + res, _, err := CreateClientFile(s.ctx, s.client, rseed) + require.NoError(t, err) + + dc := startDeal(t, s.ctx, s.miner, s.client, res.Root, false, startEpoch) + waitDealSealed(t, s.ctx, s.miner, s.client, dc, false) + } + + // Run maxDealsPerMsg+1 deals in parallel + done := make(chan struct{}, maxDealsPerMsg+1) + for rseed := 1; rseed <= int(maxDealsPerMsg+1); rseed++ { + rseed := rseed + go func() { + runDealTillSeal(rseed) + done <- struct{}{} + }() + } + + // Wait for maxDealsPerMsg of the deals to be published + for i := 0; i < int(maxDealsPerMsg); i++ { + <-done + } + + sl, err := sn[0].SectorsList(s.ctx) + require.NoError(t, err) + require.GreaterOrEqual(t, len(sl), 4) + require.LessOrEqual(t, len(sl), 5) +} + func TestFastRetrievalDealFlow(t *testing.T, b APIBuilder, blocktime time.Duration, startEpoch abi.ChainEpoch) { s := setupOneClientOneMiner(t, b, blocktime) defer s.blockMiner.Stop() diff --git a/api/types.go b/api/types.go index a463dd36e..6417ce756 100644 --- a/api/types.go +++ b/api/types.go @@ -61,6 +61,7 @@ type DataTransferChannel struct { 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 diff --git a/api/types/actors.go b/api/types/actors.go new file mode 100644 index 000000000..d55ef3e10 --- /dev/null +++ b/api/types/actors.go @@ -0,0 +1,5 @@ +package apitypes + +import "github.com/filecoin-project/go-state-types/network" + +type NetworkVersion = network.Version diff --git a/api/types/openrpc.go b/api/types/openrpc.go new file mode 100644 index 000000000..7d65cbde6 --- /dev/null +++ b/api/types/openrpc.go @@ -0,0 +1,3 @@ +package apitypes + +type OpenRPCDocument map[string]interface{} diff --git a/blockstore/badger/blockstore.go b/blockstore/badger/blockstore.go index 2c00f4240..e03266ab7 100644 --- a/blockstore/badger/blockstore.go +++ b/blockstore/badger/blockstore.go @@ -4,6 +4,7 @@ import ( "context" "fmt" "io" + "runtime" "sync/atomic" "github.com/dgraph-io/badger/v2" @@ -84,11 +85,11 @@ const ( // operation calls after Close() has returned, but it may not happen for // operations in progress. Those are likely to fail with a different error. type Blockstore struct { - DB *badger.DB - - // state is guarded by atomic. + // state is accessed atomically state int64 + DB *badger.DB + prefixing bool prefix []byte prefixLen int @@ -150,6 +151,20 @@ func (b *Blockstore) CollectGarbage() error { return err } +// Compact runs a synchronous compaction +func (b *Blockstore) Compact() error { + if atomic.LoadInt64(&b.state) != stateOpen { + return ErrBlockstoreClosed + } + + nworkers := runtime.NumCPU() / 2 + if nworkers < 2 { + nworkers = 2 + } + + return b.DB.Flatten(nworkers) +} + // View implements blockstore.Viewer, which leverages zero-copy read-only // access to values. func (b *Blockstore) View(cid cid.Cid, fn func([]byte) error) error { @@ -288,9 +303,6 @@ func (b *Blockstore) PutMany(blocks []blocks.Block) error { return ErrBlockstoreClosed } - batch := b.DB.NewWriteBatch() - defer batch.Cancel() - // toReturn tracks the byte slices to return to the pool, if we're using key // prefixing. we can't return each slice to the pool after each Set, because // badger holds on to the slice. @@ -304,6 +316,9 @@ func (b *Blockstore) PutMany(blocks []blocks.Block) error { }() } + batch := b.DB.NewWriteBatch() + defer batch.Cancel() + for _, block := range blocks { k, pooled := b.PooledStorageKey(block.Cid()) if pooled { @@ -342,9 +357,6 @@ func (b *Blockstore) DeleteMany(cids []cid.Cid) error { return ErrBlockstoreClosed } - batch := b.DB.NewWriteBatch() - defer batch.Cancel() - // toReturn tracks the byte slices to return to the pool, if we're using key // prefixing. we can't return each slice to the pool after each Set, because // badger holds on to the slice. @@ -358,6 +370,9 @@ func (b *Blockstore) DeleteMany(cids []cid.Cid) error { }() } + batch := b.DB.NewWriteBatch() + defer batch.Cancel() + for _, cid := range cids { k, pooled := b.PooledStorageKey(cid) if pooled { diff --git a/blockstore/splitstore/splitstore.go b/blockstore/splitstore/splitstore.go index fb3e28803..23b2d3427 100644 --- a/blockstore/splitstore/splitstore.go +++ b/blockstore/splitstore/splitstore.go @@ -798,15 +798,26 @@ func (s *SplitStore) purgeTracking(cids []cid.Cid) error { } func (s *SplitStore) gcHotstore() { + if compact, ok := s.hot.(interface{ Compact() error }); ok { + log.Infof("compacting hotstore") + startCompact := time.Now() + err := compact.Compact() + if err != nil { + log.Warnf("error compacting hotstore: %s", err) + return + } + log.Infow("hotstore compaction done", "took", time.Since(startCompact)) + } + if gc, ok := s.hot.(interface{ CollectGarbage() error }); ok { log.Infof("garbage collecting hotstore") startGC := time.Now() err := gc.CollectGarbage() if err != nil { log.Warnf("error garbage collecting hotstore: %s", err) - } else { - log.Infow("garbage collection done", "took", time.Since(startGC)) + return } + log.Infow("hotstore garbage collection done", "took", time.Since(startGC)) } } diff --git a/blockstore/timed.go b/blockstore/timed.go index ce25bb5bc..80e6c8a08 100644 --- a/blockstore/timed.go +++ b/blockstore/timed.go @@ -103,13 +103,20 @@ func (t *TimedCacheBlockstore) PutMany(bs []blocks.Block) error { } func (t *TimedCacheBlockstore) View(k cid.Cid, callback func([]byte) error) error { + // The underlying blockstore is always a "mem" blockstore so there's no difference, + // from a performance perspective, between view & get. So we call Get to avoid + // calling an arbitrary callback while holding a lock. t.mu.RLock() - defer t.mu.RUnlock() - err := t.active.View(k, callback) + block, err := t.active.Get(k) if err == ErrNotFound { - err = t.inactive.View(k, callback) + block, err = t.inactive.Get(k) } - return err + t.mu.RUnlock() + + if err != nil { + return err + } + return callback(block.RawData()) } func (t *TimedCacheBlockstore) Get(k cid.Cid) (blocks.Block, error) { diff --git a/build/bootstrap/mainnet.pi b/build/bootstrap/mainnet.pi index 886ac8e99..370e954bd 100644 --- a/build/bootstrap/mainnet.pi +++ b/build/bootstrap/mainnet.pi @@ -7,7 +7,7 @@ /dns4/bootstrap-6.mainnet.filops.net/tcp/1347/p2p/12D3KooWP5MwCiqdMETF9ub1P3MbCvQCcfconnYHbWg6sUJcDRQQ /dns4/bootstrap-7.mainnet.filops.net/tcp/1347/p2p/12D3KooWRs3aY1p3juFjPy8gPN95PEQChm2QKGUCAdcDCC4EBMKf /dns4/bootstrap-8.mainnet.filops.net/tcp/1347/p2p/12D3KooWScFR7385LTyR4zU1bYdzSiiAb5rnNABfVahPvVSzyTkR -/dns4/lotus-bootstrap.forceup.cn/tcp/41778/p2p/12D3KooWFQsv3nRMUevZNWWsY1Wu6NUzUbawnWU5NcRhgKuJA37C +/dns4/lotus-bootstrap.ipfsforce.com/tcp/41778/p2p/12D3KooWGhufNmZHF3sv48aQeS13ng5XVJZ9E6qy2Ms4VzqeUsHk /dns4/bootstrap-0.starpool.in/tcp/12757/p2p/12D3KooWGHpBMeZbestVEWkfdnC9u7p6uFHXL1n7m1ZBqsEmiUzz /dns4/bootstrap-1.starpool.in/tcp/12757/p2p/12D3KooWQZrGH1PxSNZPum99M1zNvjNFM33d1AAu5DcvdHptuU7u /dns4/node.glif.io/tcp/1235/p2p/12D3KooWBF8cpp65hp2u9LK5mh19x67ftAam84z9LsfaquTDSBpt diff --git a/build/openrpc.go b/build/openrpc.go new file mode 100644 index 000000000..0f514c8aa --- /dev/null +++ b/build/openrpc.go @@ -0,0 +1,43 @@ +package build + +import ( + "bytes" + "compress/gzip" + "encoding/json" + + rice "github.com/GeertJohan/go.rice" + + apitypes "github.com/filecoin-project/lotus/api/types" +) + +func mustReadGzippedOpenRPCDocument(data []byte) apitypes.OpenRPCDocument { + zr, err := gzip.NewReader(bytes.NewBuffer(data)) + if err != nil { + log.Fatal(err) + } + m := apitypes.OpenRPCDocument{} + err = json.NewDecoder(zr).Decode(&m) + if err != nil { + log.Fatal(err) + } + err = zr.Close() + if err != nil { + log.Fatal(err) + } + return m +} + +func OpenRPCDiscoverJSON_Full() apitypes.OpenRPCDocument { + data := rice.MustFindBox("openrpc").MustBytes("full.json.gz") + return mustReadGzippedOpenRPCDocument(data) +} + +func OpenRPCDiscoverJSON_Miner() apitypes.OpenRPCDocument { + data := rice.MustFindBox("openrpc").MustBytes("miner.json.gz") + return mustReadGzippedOpenRPCDocument(data) +} + +func OpenRPCDiscoverJSON_Worker() apitypes.OpenRPCDocument { + data := rice.MustFindBox("openrpc").MustBytes("worker.json.gz") + return mustReadGzippedOpenRPCDocument(data) +} diff --git a/build/openrpc/full.json.gz b/build/openrpc/full.json.gz new file mode 100644 index 000000000..297a6411e Binary files /dev/null and b/build/openrpc/full.json.gz differ diff --git a/build/openrpc/miner.json.gz b/build/openrpc/miner.json.gz new file mode 100644 index 000000000..07ec95fd4 Binary files /dev/null and b/build/openrpc/miner.json.gz differ diff --git a/build/openrpc/worker.json.gz b/build/openrpc/worker.json.gz new file mode 100644 index 000000000..cfe344989 Binary files /dev/null and b/build/openrpc/worker.json.gz differ diff --git a/build/openrpc_test.go b/build/openrpc_test.go new file mode 100644 index 000000000..20c775331 --- /dev/null +++ b/build/openrpc_test.go @@ -0,0 +1,23 @@ +package build + +import ( + "testing" + + apitypes "github.com/filecoin-project/lotus/api/types" +) + +func TestOpenRPCDiscoverJSON_Version(t *testing.T) { + // openRPCDocVersion is the current OpenRPC version of the API docs. + openRPCDocVersion := "1.2.6" + + for i, docFn := range []func() apitypes.OpenRPCDocument{ + OpenRPCDiscoverJSON_Full, + OpenRPCDiscoverJSON_Miner, + OpenRPCDiscoverJSON_Worker, + } { + doc := docFn() + if got, ok := doc["openrpc"]; !ok || got != openRPCDocVersion { + t.Fatalf("case: %d, want: %s, got: %v, doc: %v", i, openRPCDocVersion, got, doc) + } + } +} diff --git a/build/params_2k.go b/build/params_2k.go index 63f7e70b4..308db3bd8 100644 --- a/build/params_2k.go +++ b/build/params_2k.go @@ -37,6 +37,7 @@ func init() { policy.SetSupportedProofTypes(abi.RegisteredSealProof_StackedDrg2KiBV1) policy.SetConsensusMinerMinPower(abi.NewStoragePower(2048)) policy.SetMinVerifiedDealSize(abi.NewStoragePower(256)) + policy.SetPreCommitChallengeDelay(abi.ChainEpoch(10)) BuildType |= Build2k } diff --git a/build/params_shared_vals.go b/build/params_shared_vals.go index 5e2d18ff1..f67971235 100644 --- a/build/params_shared_vals.go +++ b/build/params_shared_vals.go @@ -118,5 +118,5 @@ const PackingEfficiencyNum = 4 const PackingEfficiencyDenom = 5 // Actor consts -// TODO: Pull from actors when its made not private -var MinDealDuration = abi.ChainEpoch(180 * builtin2.EpochsInDay) +// TODO: pieceSize unused from actors +var MinDealDuration, MaxDealDuration = policy.DealDurationBounds(0) diff --git a/build/params_testground.go b/build/params_testground.go index 759b29692..5e9bc2672 100644 --- a/build/params_testground.go +++ b/build/params_testground.go @@ -72,8 +72,8 @@ var ( }() // Actor consts - // TODO: Pull from actors when its made not private - MinDealDuration = abi.ChainEpoch(180 * builtin2.EpochsInDay) + // TODO: pieceSize unused from actors + MinDealDuration, MaxDealDuration = policy.DealDurationBounds(0) PackingEfficiencyNum int64 = 4 PackingEfficiencyDenom int64 = 5 diff --git a/build/version.go b/build/version.go index 0715a883a..5baa4743a 100644 --- a/build/version.go +++ b/build/version.go @@ -29,7 +29,7 @@ func buildType() string { } // BuildVersion is the local build version, set by build system -const BuildVersion = "1.5.3" +const BuildVersion = "1.7.0-dev" func UserVersion() string { return BuildVersion + buildType() + CurrentCommit diff --git a/chain/actors/builtin/builtin.go b/chain/actors/builtin/builtin.go index 1e535dca4..045048d1f 100644 --- a/chain/actors/builtin/builtin.go +++ b/chain/actors/builtin/builtin.go @@ -52,7 +52,7 @@ type PoStProof = proof0.PoStProof type FilterEstimate = smoothing0.FilterEstimate func FromV0FilterEstimate(v0 smoothing0.FilterEstimate) FilterEstimate { - return (FilterEstimate)(v0) + return (FilterEstimate)(v0) //nolint:unconvert } // Doesn't change between actors v0, v2, and v3. diff --git a/chain/actors/builtin/market/market.go b/chain/actors/builtin/market/market.go index 628b27e08..0e4d9e01b 100644 --- a/chain/actors/builtin/market/market.go +++ b/chain/actors/builtin/market/market.go @@ -61,6 +61,7 @@ type State interface { VerifyDealsForActivation( minerAddr address.Address, deals []abi.DealID, currEpoch, sectorExpiry abi.ChainEpoch, ) (weight, verifiedWeight abi.DealWeight, err error) + NextID() (abi.DealID, error) } type BalanceTable interface { diff --git a/chain/actors/builtin/market/v0.go b/chain/actors/builtin/market/v0.go index 20d38b5f1..f3b885995 100644 --- a/chain/actors/builtin/market/v0.go +++ b/chain/actors/builtin/market/v0.go @@ -105,6 +105,10 @@ func (s *state0) VerifyDealsForActivation( return market0.ValidateDealsForActivation(&s.State, s.store, deals, minerAddr, sectorExpiry, currEpoch) } +func (s *state0) NextID() (abi.DealID, error) { + return s.State.NextID, nil +} + type balanceTable0 struct { *adt0.BalanceTable } diff --git a/chain/actors/builtin/market/v2.go b/chain/actors/builtin/market/v2.go index a5e5c7b45..1ce051c38 100644 --- a/chain/actors/builtin/market/v2.go +++ b/chain/actors/builtin/market/v2.go @@ -106,6 +106,10 @@ func (s *state2) VerifyDealsForActivation( return w, vw, err } +func (s *state2) NextID() (abi.DealID, error) { + return s.State.NextID, nil +} + type balanceTable2 struct { *adt2.BalanceTable } diff --git a/chain/actors/builtin/market/v3.go b/chain/actors/builtin/market/v3.go index 3309d37a7..15251985b 100644 --- a/chain/actors/builtin/market/v3.go +++ b/chain/actors/builtin/market/v3.go @@ -106,6 +106,10 @@ func (s *state3) VerifyDealsForActivation( return w, vw, err } +func (s *state3) NextID() (abi.DealID, error) { + return s.State.NextID, nil +} + type balanceTable3 struct { *adt3.BalanceTable } diff --git a/chain/actors/builtin/multisig/state0.go b/chain/actors/builtin/multisig/state0.go index 5548b0a5c..27dd5c413 100644 --- a/chain/actors/builtin/multisig/state0.go +++ b/chain/actors/builtin/multisig/state0.go @@ -68,7 +68,7 @@ func (s *state0) ForEachPendingTxn(cb func(id int64, txn Transaction) error) err if n <= 0 { return xerrors.Errorf("invalid pending transaction key: %v", key) } - return cb(txid, (Transaction)(out)) + return cb(txid, (Transaction)(out)) //nolint:unconvert }) } diff --git a/chain/actors/builtin/multisig/state2.go b/chain/actors/builtin/multisig/state2.go index 628da3f2c..d637abb91 100644 --- a/chain/actors/builtin/multisig/state2.go +++ b/chain/actors/builtin/multisig/state2.go @@ -67,7 +67,7 @@ func (s *state2) ForEachPendingTxn(cb func(id int64, txn Transaction) error) err if n <= 0 { return xerrors.Errorf("invalid pending transaction key: %v", key) } - return cb(txid, (Transaction)(out)) + return cb(txid, (Transaction)(out)) //nolint:unconvert }) } diff --git a/chain/actors/builtin/multisig/state3.go b/chain/actors/builtin/multisig/state3.go index 7ade2ab64..a2eb1d909 100644 --- a/chain/actors/builtin/multisig/state3.go +++ b/chain/actors/builtin/multisig/state3.go @@ -69,7 +69,7 @@ func (s *state3) ForEachPendingTxn(cb func(id int64, txn Transaction) error) err if n <= 0 { return xerrors.Errorf("invalid pending transaction key: %v", key) } - return cb(txid, (Transaction)(out)) + return cb(txid, (Transaction)(out)) //nolint:unconvert }) } diff --git a/chain/actors/policy/policy.go b/chain/actors/policy/policy.go index e32b36743..75badf36d 100644 --- a/chain/actors/policy/policy.go +++ b/chain/actors/policy/policy.go @@ -25,9 +25,10 @@ import ( ) const ( - ChainFinality = miner3.ChainFinality - SealRandomnessLookback = ChainFinality - PaychSettleDelay = paych3.SettleDelay + ChainFinality = miner3.ChainFinality + SealRandomnessLookback = ChainFinality + PaychSettleDelay = paych3.SettleDelay + MaxPreCommitRandomnessLookback = builtin3.EpochsInDay + SealRandomnessLookback ) // SetSupportedProofTypes sets supported proof types, across all actor versions. @@ -136,6 +137,10 @@ func DealProviderCollateralBounds( } } +func DealDurationBounds(pieceSize abi.PaddedPieceSize) (min, max abi.ChainEpoch) { + return market2.DealDurationBounds(pieceSize) +} + // Sets the challenge window and scales the proving period to match (such that // there are always 48 challenge windows in a proving period). func SetWPoStChallengeWindow(period abi.ChainEpoch) { diff --git a/chain/events/events.go b/chain/events/events.go index acb65d2c1..8ad40f95f 100644 --- a/chain/events/events.go +++ b/chain/events/events.go @@ -55,11 +55,11 @@ type Events struct { heightEvents *hcEvents + + observers []TipSetObserver } -func NewEvents(ctx context.Context, api eventAPI) *Events { - gcConfidence := 2 * build.ForkLengthThreshold - +func NewEventsWithConfidence(ctx context.Context, api eventAPI, gcConfidence abi.ChainEpoch) *Events { tsc := newTSCache(gcConfidence, api) e := &Events{ @@ -77,8 +77,9 @@ func NewEvents(ctx context.Context, api eventAPI) *Events { htHeights: map[abi.ChainEpoch][]uint64{}, }, - hcEvents: newHCEvents(ctx, api, tsc, uint64(gcConfidence)), - ready: make(chan struct{}), + hcEvents: newHCEvents(ctx, api, tsc, uint64(gcConfidence)), + ready: make(chan struct{}), + observers: []TipSetObserver{}, } go e.listenHeadChanges(ctx) @@ -92,6 +93,11 @@ func NewEvents(ctx context.Context, api eventAPI) *Events { return e } +func NewEvents(ctx context.Context, api eventAPI) *Events { + gcConfidence := 2 * build.ForkLengthThreshold + return NewEventsWithConfidence(ctx, api, gcConfidence) +} + func (e *Events) listenHeadChanges(ctx context.Context) { for { if err := e.listenHeadChangesOnce(ctx); err != nil { @@ -164,7 +170,7 @@ func (e *Events) listenHeadChangesOnce(ctx context.Context) error { } } - if err := e.headChange(rev, app); err != nil { + if err := e.headChange(ctx, rev, app); err != nil { log.Warnf("headChange failed: %s", err) } @@ -177,7 +183,7 @@ func (e *Events) listenHeadChangesOnce(ctx context.Context) error { return nil } -func (e *Events) headChange(rev, app []*types.TipSet) error { +func (e *Events) headChange(ctx context.Context, rev, app []*types.TipSet) error { if len(app) == 0 { return xerrors.New("events.headChange expected at least one applied tipset") } @@ -189,5 +195,39 @@ func (e *Events) headChange(rev, app []*types.TipSet) error { return err } + if err := e.observeChanges(ctx, rev, app); err != nil { + return err + } return e.processHeadChangeEvent(rev, app) } + +// A TipSetObserver receives notifications of tipsets +type TipSetObserver interface { + Apply(ctx context.Context, ts *types.TipSet) error + Revert(ctx context.Context, ts *types.TipSet) error +} + +// TODO: add a confidence level so we can have observers with difference levels of confidence +func (e *Events) Observe(obs TipSetObserver) error { + e.lk.Lock() + defer e.lk.Unlock() + e.observers = append(e.observers, obs) + return nil +} + +// observeChanges expects caller to hold e.lk +func (e *Events) observeChanges(ctx context.Context, rev, app []*types.TipSet) error { + for _, ts := range rev { + for _, o := range e.observers { + _ = o.Revert(ctx, ts) + } + } + + for _, ts := range app { + for _, o := range e.observers { + _ = o.Apply(ctx, ts) + } + } + + return nil +} diff --git a/chain/gen/genesis/f01_init.go b/chain/gen/genesis/f01_init.go index 9fc6cfb9e..718eb4480 100644 --- a/chain/gen/genesis/f01_init.go +++ b/chain/gen/genesis/f01_init.go @@ -133,9 +133,22 @@ func SetupInitActor(bs bstore.Blockstore, netname string, initialActors []genesi } } - err := setupMsig(remainder.Meta) - if err != nil { - return 0, nil, nil, xerrors.Errorf("setting up remainder msig: %w", err) + if remainder.Type == genesis.TAccount { + var ainfo genesis.AccountMeta + if err := json.Unmarshal(remainder.Meta, &ainfo); err != nil { + return 0, nil, nil, xerrors.Errorf("unmarshaling account meta: %w", err) + } + + // TODO: Use builtin.ReserveAddress... + value := cbg.CborInt(90) + if err := amap.Put(abi.AddrKey(ainfo.Owner), &value); err != nil { + return 0, nil, nil, err + } + } else if remainder.Type == genesis.TMultisig { + err := setupMsig(remainder.Meta) + if err != nil { + return 0, nil, nil, xerrors.Errorf("setting up remainder msig: %w", err) + } } amapaddr, err := amap.Root() diff --git a/chain/gen/genesis/genesis.go b/chain/gen/genesis/genesis.go index d382e4d0d..4b86db550 100644 --- a/chain/gen/genesis/genesis.go +++ b/chain/gen/genesis/genesis.go @@ -330,24 +330,18 @@ func MakeInitialStateTree(ctx context.Context, bs bstore.Blockstore, template ge if err := json.Unmarshal(template.RemainderAccount.Meta, &ainfo); err != nil { return nil, nil, xerrors.Errorf("unmarshaling account meta: %w", err) } - st, err := cst.Put(ctx, &account0.State{Address: ainfo.Owner}) - if err != nil { - return nil, nil, err - } _, ok := keyIDs[ainfo.Owner] if ok { return nil, nil, fmt.Errorf("remainder account has already been declared, cannot be assigned 90: %s", ainfo.Owner) } - err = state.SetActor(builtin.ReserveAddress, &types.Actor{ - Code: builtin0.AccountActorCodeID, - Balance: template.RemainderAccount.Balance, - Head: st, - }) + keyIDs[ainfo.Owner] = builtin.ReserveAddress + err = createAccountActor(ctx, cst, state, template.RemainderAccount, keyIDs) if err != nil { - return nil, nil, xerrors.Errorf("setting remainder account: %w", err) + return nil, nil, xerrors.Errorf("creating remainder acct: %w", err) } + case genesis.TMultisig: if err = createMultisigAccount(ctx, bs, cst, state, builtin.ReserveAddress, template.RemainderAccount, keyIDs); err != nil { return nil, nil, xerrors.Errorf("failed to set up remainder: %w", err) diff --git a/chain/gen/mining.go b/chain/gen/mining.go index 3c6a89873..1400c12c5 100644 --- a/chain/gen/mining.go +++ b/chain/gen/mining.go @@ -15,7 +15,7 @@ import ( "github.com/filecoin-project/lotus/chain/types" ) -func MinerCreateBlock(ctx context.Context, sm *stmgr.StateManager, w api.WalletAPI, bt *api.BlockTemplate) (*types.FullBlock, error) { +func MinerCreateBlock(ctx context.Context, sm *stmgr.StateManager, w api.Wallet, bt *api.BlockTemplate) (*types.FullBlock, error) { pts, err := sm.ChainStore().LoadTipSet(bt.Parents) if err != nil { diff --git a/chain/messagepool/selection_test.go b/chain/messagepool/selection_test.go index fb3de7683..c61e24fcf 100644 --- a/chain/messagepool/selection_test.go +++ b/chain/messagepool/selection_test.go @@ -1333,7 +1333,7 @@ readLoop: } actorMap := make(map[address.Address]address.Address) - actorWallets := make(map[address.Address]api.WalletAPI) + actorWallets := make(map[address.Address]api.Wallet) for _, m := range msgs { baseNonce := baseNonces[m.Message.From] diff --git a/chain/messagesigner/messagesigner.go b/chain/messagesigner/messagesigner.go index 9b8f86b64..ce9d01b3a 100644 --- a/chain/messagesigner/messagesigner.go +++ b/chain/messagesigner/messagesigner.go @@ -29,13 +29,13 @@ type MpoolNonceAPI interface { // MessageSigner keeps track of nonces per address, and increments the nonce // when signing a message type MessageSigner struct { - wallet api.WalletAPI + wallet api.Wallet lk sync.Mutex mpool MpoolNonceAPI ds datastore.Batching } -func NewMessageSigner(wallet api.WalletAPI, mpool MpoolNonceAPI, ds dtypes.MetadataDS) *MessageSigner { +func NewMessageSigner(wallet api.Wallet, mpool MpoolNonceAPI, ds dtypes.MetadataDS) *MessageSigner { ds = namespace.Wrap(ds, datastore.NewKey("/message-signer/")) return &MessageSigner{ wallet: wallet, diff --git a/chain/stmgr/call.go b/chain/stmgr/call.go index 89f91b0b7..961bebd9c 100644 --- a/chain/stmgr/call.go +++ b/chain/stmgr/call.go @@ -255,7 +255,7 @@ func (sm *StateManager) Replay(ctx context.Context, ts *types.TipSet, mcid cid.C } return nil }) - if err != nil && err != errHaltExecution { + if err != nil && !xerrors.Is(err, errHaltExecution) { return nil, nil, xerrors.Errorf("unexpected error during execution: %w", err) } diff --git a/node/modules/rpcstatemanager.go b/chain/stmgr/rpc/rpcstatemanager.go similarity index 94% rename from node/modules/rpcstatemanager.go rename to chain/stmgr/rpc/rpcstatemanager.go index b14e1dc80..dc719eb55 100644 --- a/node/modules/rpcstatemanager.go +++ b/chain/stmgr/rpc/rpcstatemanager.go @@ -1,4 +1,4 @@ -package modules +package rpcstmgr import ( "context" @@ -16,11 +16,11 @@ import ( ) type RPCStateManager struct { - gapi api.GatewayAPI + gapi api.Gateway cstore *cbor.BasicIpldStore } -func NewRPCStateManager(api api.GatewayAPI) *RPCStateManager { +func NewRPCStateManager(api api.Gateway) *RPCStateManager { cstore := cbor.NewCborStore(blockstore.NewAPIBlockstore(api)) return &RPCStateManager{gapi: api, cstore: cstore} } diff --git a/chain/wallet/ledger/ledger.go b/chain/wallet/ledger/ledger.go index 07f92e7ff..1b0bf1a04 100644 --- a/chain/wallet/ledger/ledger.go +++ b/chain/wallet/ledger/ledger.go @@ -36,7 +36,7 @@ type LedgerKeyInfo struct { Path []uint32 } -var _ api.WalletAPI = (*LedgerWallet)(nil) +var _ api.Wallet = (*LedgerWallet)(nil) func (lw LedgerWallet) WalletSign(ctx context.Context, signer address.Address, toSign []byte, meta api.MsgMeta) (*crypto.Signature, error) { ki, err := lw.getKeyInfo(signer) @@ -227,7 +227,7 @@ func (lw LedgerWallet) WalletNew(ctx context.Context, t types.KeyType) (address. return lw.importKey(lki) } -func (lw *LedgerWallet) Get() api.WalletAPI { +func (lw *LedgerWallet) Get() api.Wallet { if lw == nil { return nil } diff --git a/chain/wallet/multi.go b/chain/wallet/multi.go index 5b603dbd5..1fee4f040 100644 --- a/chain/wallet/multi.go +++ b/chain/wallet/multi.go @@ -24,13 +24,13 @@ type MultiWallet struct { } type getif interface { - api.WalletAPI + api.Wallet // workaround for the fact that iface(*struct(nil)) != nil - Get() api.WalletAPI + Get() api.Wallet } -func firstNonNil(wallets ...getif) api.WalletAPI { +func firstNonNil(wallets ...getif) api.Wallet { for _, w := range wallets { if w.Get() != nil { return w @@ -40,8 +40,8 @@ func firstNonNil(wallets ...getif) api.WalletAPI { return nil } -func nonNil(wallets ...getif) []api.WalletAPI { - var out []api.WalletAPI +func nonNil(wallets ...getif) []api.Wallet { + var out []api.Wallet for _, w := range wallets { if w.Get() == nil { continue @@ -53,7 +53,7 @@ func nonNil(wallets ...getif) []api.WalletAPI { return out } -func (m MultiWallet) find(ctx context.Context, address address.Address, wallets ...getif) (api.WalletAPI, error) { +func (m MultiWallet) find(ctx context.Context, address address.Address, wallets ...getif) (api.Wallet, error) { ws := nonNil(wallets...) for _, w := range ws { @@ -167,4 +167,4 @@ func (m MultiWallet) WalletDelete(ctx context.Context, address address.Address) } } -var _ api.WalletAPI = MultiWallet{} +var _ api.Wallet = MultiWallet{} diff --git a/chain/wallet/remotewallet/remote.go b/chain/wallet/remotewallet/remote.go index aa4427132..262b5f9c6 100644 --- a/chain/wallet/remotewallet/remote.go +++ b/chain/wallet/remotewallet/remote.go @@ -13,7 +13,7 @@ import ( ) type RemoteWallet struct { - api.WalletAPI + api.Wallet } func SetupRemoteWallet(info string) func(mctx helpers.MetricsCtx, lc fx.Lifecycle) (*RemoteWallet, error) { @@ -41,7 +41,7 @@ func SetupRemoteWallet(info string) func(mctx helpers.MetricsCtx, lc fx.Lifecycl } } -func (w *RemoteWallet) Get() api.WalletAPI { +func (w *RemoteWallet) Get() api.Wallet { if w == nil { return nil } diff --git a/chain/wallet/wallet.go b/chain/wallet/wallet.go index 884557520..cbe78a9e8 100644 --- a/chain/wallet/wallet.go +++ b/chain/wallet/wallet.go @@ -329,7 +329,7 @@ func (w *LocalWallet) WalletDelete(ctx context.Context, addr address.Address) er return nil } -func (w *LocalWallet) Get() api.WalletAPI { +func (w *LocalWallet) Get() api.Wallet { if w == nil { return nil } @@ -337,7 +337,7 @@ func (w *LocalWallet) Get() api.WalletAPI { return w } -var _ api.WalletAPI = &LocalWallet{} +var _ api.Wallet = &LocalWallet{} func swapMainnetForTestnetPrefix(addr string) (string, error) { aChars := []rune(addr) diff --git a/cli/auth.go b/cli/auth.go index 2f41b38d1..6426a4ab6 100644 --- a/cli/auth.go +++ b/cli/auth.go @@ -13,16 +13,16 @@ import ( "github.com/filecoin-project/lotus/node/repo" ) -var authCmd = &cli.Command{ +var AuthCmd = &cli.Command{ Name: "auth", Usage: "Manage RPC permissions", Subcommands: []*cli.Command{ - authCreateAdminToken, - authApiInfoToken, + AuthCreateAdminToken, + AuthApiInfoToken, }, } -var authCreateAdminToken = &cli.Command{ +var AuthCreateAdminToken = &cli.Command{ Name: "create-token", Usage: "Create token", Flags: []cli.Flag{ @@ -70,7 +70,7 @@ var authCreateAdminToken = &cli.Command{ }, } -var authApiInfoToken = &cli.Command{ +var AuthApiInfoToken = &cli.Command{ Name: "api-info", Usage: "Get token with API info required to connect to this node", Flags: []cli.Flag{ @@ -90,7 +90,7 @@ var authApiInfoToken = &cli.Command{ ctx := ReqContext(cctx) if !cctx.IsSet("perm") { - return xerrors.New("--perm flag not set") + return xerrors.New("--perm flag not set, use with one of: read, write, sign, admin") } perm := cctx.String("perm") diff --git a/cli/chain.go b/cli/chain.go index e86cac9b3..1574f3f64 100644 --- a/cli/chain.go +++ b/cli/chain.go @@ -38,31 +38,31 @@ import ( types "github.com/filecoin-project/lotus/chain/types" ) -var chainCmd = &cli.Command{ +var ChainCmd = &cli.Command{ Name: "chain", Usage: "Interact with filecoin blockchain", Subcommands: []*cli.Command{ - chainHeadCmd, - chainGetBlock, - chainReadObjCmd, - chainDeleteObjCmd, - chainStatObjCmd, - chainGetMsgCmd, - chainSetHeadCmd, - chainListCmd, - chainGetCmd, - chainBisectCmd, - chainExportCmd, - slashConsensusFault, - chainGasPriceCmd, - chainInspectUsage, - chainDecodeCmd, - chainEncodeCmd, - chainDisputeSetCmd, + ChainHeadCmd, + ChainGetBlock, + ChainReadObjCmd, + ChainDeleteObjCmd, + ChainStatObjCmd, + ChainGetMsgCmd, + ChainSetHeadCmd, + ChainListCmd, + ChainGetCmd, + ChainBisectCmd, + ChainExportCmd, + SlashConsensusFault, + ChainGasPriceCmd, + ChainInspectUsage, + ChainDecodeCmd, + ChainEncodeCmd, + ChainDisputeSetCmd, }, } -var chainHeadCmd = &cli.Command{ +var ChainHeadCmd = &cli.Command{ Name: "head", Usage: "Print chain head", Action: func(cctx *cli.Context) error { @@ -85,7 +85,7 @@ var chainHeadCmd = &cli.Command{ }, } -var chainGetBlock = &cli.Command{ +var ChainGetBlock = &cli.Command{ Name: "getblock", Usage: "Get a block and print its details", ArgsUsage: "[blockCid]", @@ -176,7 +176,7 @@ func apiMsgCids(in []lapi.Message) []cid.Cid { return out } -var chainReadObjCmd = &cli.Command{ +var ChainReadObjCmd = &cli.Command{ Name: "read-obj", Usage: "Read the raw bytes of an object", ArgsUsage: "[objectCid]", @@ -203,7 +203,7 @@ var chainReadObjCmd = &cli.Command{ }, } -var chainDeleteObjCmd = &cli.Command{ +var ChainDeleteObjCmd = &cli.Command{ Name: "delete-obj", Usage: "Delete an object from the chain blockstore", Description: "WARNING: Removing wrong objects from the chain blockstore may lead to sync issues", @@ -240,7 +240,7 @@ var chainDeleteObjCmd = &cli.Command{ }, } -var chainStatObjCmd = &cli.Command{ +var ChainStatObjCmd = &cli.Command{ Name: "stat-obj", Usage: "Collect size and ipld link counts for objs", ArgsUsage: "[cid]", @@ -287,7 +287,7 @@ var chainStatObjCmd = &cli.Command{ }, } -var chainGetMsgCmd = &cli.Command{ +var ChainGetMsgCmd = &cli.Command{ Name: "getmessage", Usage: "Get and print a message by its cid", ArgsUsage: "[messageCid]", @@ -335,7 +335,7 @@ var chainGetMsgCmd = &cli.Command{ }, } -var chainSetHeadCmd = &cli.Command{ +var ChainSetHeadCmd = &cli.Command{ Name: "sethead", Usage: "manually set the local nodes head tipset (Caution: normally only used for recovery)", ArgsUsage: "[tipsetkey]", @@ -384,7 +384,7 @@ var chainSetHeadCmd = &cli.Command{ }, } -var chainInspectUsage = &cli.Command{ +var ChainInspectUsage = &cli.Command{ Name: "inspect-usage", Usage: "Inspect block space usage of a given tipset", Flags: []cli.Flag{ @@ -529,7 +529,7 @@ var chainInspectUsage = &cli.Command{ }, } -var chainListCmd = &cli.Command{ +var ChainListCmd = &cli.Command{ Name: "list", Aliases: []string{"love"}, Usage: "View a segment of the chain", @@ -658,7 +658,7 @@ var chainListCmd = &cli.Command{ }, } -var chainGetCmd = &cli.Command{ +var ChainGetCmd = &cli.Command{ Name: "get", Usage: "Get chain DAG node by path", ArgsUsage: "[path]", @@ -905,7 +905,7 @@ func printTipSet(format string, ts *types.TipSet) { fmt.Println(format) } -var chainBisectCmd = &cli.Command{ +var ChainBisectCmd = &cli.Command{ Name: "bisect", Usage: "bisect chain for an event", ArgsUsage: "[minHeight maxHeight path shellCommand ]", @@ -1028,7 +1028,7 @@ var chainBisectCmd = &cli.Command{ }, } -var chainExportCmd = &cli.Command{ +var ChainExportCmd = &cli.Command{ Name: "export", Usage: "export chain to a car file", ArgsUsage: "[outputPath]", @@ -1106,7 +1106,7 @@ var chainExportCmd = &cli.Command{ }, } -var slashConsensusFault = &cli.Command{ +var SlashConsensusFault = &cli.Command{ Name: "slash-consensus", Usage: "Report consensus fault", ArgsUsage: "[blockCid1 blockCid2]", @@ -1227,7 +1227,7 @@ var slashConsensusFault = &cli.Command{ }, } -var chainGasPriceCmd = &cli.Command{ +var ChainGasPriceCmd = &cli.Command{ Name: "gas-price", Usage: "Estimate gas prices", Action: func(cctx *cli.Context) error { @@ -1254,7 +1254,7 @@ var chainGasPriceCmd = &cli.Command{ }, } -var chainDecodeCmd = &cli.Command{ +var ChainDecodeCmd = &cli.Command{ Name: "decode", Usage: "decode various types", Subcommands: []*cli.Command{ @@ -1334,7 +1334,7 @@ var chainDecodeParamsCmd = &cli.Command{ }, } -var chainEncodeCmd = &cli.Command{ +var ChainEncodeCmd = &cli.Command{ Name: "encode", Usage: "encode various types", Subcommands: []*cli.Command{ diff --git a/cli/client.go b/cli/client.go index 189d34882..f401fefff 100644 --- a/cli/client.go +++ b/cli/client.go @@ -83,12 +83,14 @@ var clientCmd = &cli.Command{ 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", clientRetrieveCmd), + WithCategory("retrieval", clientCancelRetrievalDealCmd), WithCategory("util", clientCommPCmd), WithCategory("util", clientCarGenCmd), WithCategory("util", clientBalancesCmd), @@ -391,6 +393,9 @@ var clientDealCmd = &cli.Command{ 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 != "" { @@ -513,9 +518,10 @@ func interactiveDeal(cctx *cli.Context) error { var ds lapi.DataCIDSize // find - var candidateAsks []*storagemarket.StorageAsk + 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 != "" { @@ -675,6 +681,18 @@ uiLoop: 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 @@ -682,10 +700,48 @@ uiLoop: if ask.Ask.MaxPieceSize < ds.PieceSize { continue } - candidateAsks = append(candidateAsks, ask.Ask) + 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)) @@ -704,11 +760,11 @@ uiLoop: continue uiLoop } - var goodAsks []*storagemarket.StorageAsk + var goodAsks []QueriedAsk for _, ask := range candidateAsks { - p := ask.Price + p := ask.Ask.Price if verified { - p = ask.VerifiedPrice + p = ask.Ask.VerifiedPrice } epochPrice := types.BigDiv(types.BigMul(p, types.NewInt(uint64(ds.PieceSize))), gib) @@ -748,9 +804,9 @@ uiLoop: pickedAsks = []*storagemarket.StorageAsk{} for _, ask := range candidateAsks { - p := ask.Price + p := ask.Ask.Price if verified { - p = ask.VerifiedPrice + p = ask.Ask.VerifiedPrice } epochPrice := types.BigDiv(types.BigMul(p, types.NewInt(uint64(ds.PieceSize))), gib) @@ -760,7 +816,7 @@ uiLoop: continue } - pickedAsks = append(pickedAsks, ask) + pickedAsks = append(pickedAsks, ask.Ask) remainingBudget = big.Sub(remainingBudget, totalPrice) if len(pickedAsks) == int(dealCount) { @@ -960,7 +1016,7 @@ var clientFindCmd = &cli.Command{ }, } -const DefaultMaxRetrievePrice = 1 +const DefaultMaxRetrievePrice = "0.01" var clientRetrieveCmd = &cli.Command{ Name: "retrieve", @@ -981,12 +1037,15 @@ var clientRetrieveCmd = &cli.Command{ }, &cli.StringFlag{ Name: "maxPrice", - Usage: fmt.Sprintf("maximum price the client is willing to consider (default: %d FIL)", DefaultMaxRetrievePrice), + 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", + }, }, Action: func(cctx *cli.Context) error { if cctx.NArg() != 2 { @@ -1016,18 +1075,6 @@ var clientRetrieveCmd = &cli.Command{ return err } - // Check if we already have this data locally - - /*has, err := api.ClientHasLocal(ctx, file) - if err != nil { - return err - } - - if has { - fmt.Println("Success: Already in local storage") - return nil - }*/ // TODO: fix - var pieceCid *cid.Cid if cctx.String("pieceCid") != "" { parsed, err := cid.Parse(cctx.String("pieceCid")) @@ -1037,69 +1084,93 @@ var clientRetrieveCmd = &cli.Command{ pieceCid = &parsed } - var offer api.QueryOffer - minerStrAddr := cctx.String("miner") - if minerStrAddr == "" { // Local discovery - offers, err := fapi.ClientFindData(ctx, file, pieceCid) + var order *lapi.RetrievalOrder + if cctx.Bool("allow-local") { + imports, err := fapi.ClientListImports(ctx) + if err != nil { + return err + } - var cleaned []api.QueryOffer - // filter out offers that errored - for _, o := range offers { - if o.Err == "" { - cleaned = append(cleaned, o) + for _, i := range imports { + if i.Root != nil && i.Root.Equals(file) { + order = &lapi.RetrievalOrder{ + Root: file, + LocalStore: &i.Key, + + Total: big.Zero(), + UnsealPrice: big.Zero(), + } + break + } + } + } + + if order == nil { + var offer api.QueryOffer + minerStrAddr := cctx.String("miner") + if minerStrAddr == "" { // Local discovery + offers, err := fapi.ClientFindData(ctx, file, pieceCid) + + var cleaned []api.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 err + } + + // TODO: parse offer strings from `client find`, make this smarter + if len(offers) < 1 { + fmt.Println("Failed to find file") + return nil + } + offer = offers[0] + } else { // Directed retrieval + minerAddr, err := address.NewFromString(minerStrAddr) + if err != nil { + return err + } + offer, err = fapi.ClientMinerQueryOffer(ctx, minerAddr, file, pieceCid) + if err != nil { + return err + } + } + if offer.Err != "" { + return fmt.Errorf("The received offer errored: %s", offer.Err) + } + + maxPrice := types.MustParseFIL(DefaultMaxRetrievePrice) + + if cctx.String("maxPrice") != "" { + maxPrice, err = types.ParseFIL(cctx.String("maxPrice")) + if err != nil { + return xerrors.Errorf("parsing maxPrice: %w", err) } } - 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 err + if offer.MinPrice.GreaterThan(big.Int(maxPrice)) { + return xerrors.Errorf("failed to find offer satisfying maxPrice: %s", maxPrice) } - // TODO: parse offer strings from `client find`, make this smarter - if len(offers) < 1 { - fmt.Println("Failed to find file") - return nil - } - offer = offers[0] - } else { // Directed retrieval - minerAddr, err := address.NewFromString(minerStrAddr) - if err != nil { - return err - } - offer, err = fapi.ClientMinerQueryOffer(ctx, minerAddr, file, pieceCid) - if err != nil { - return err - } + o := offer.Order(payer) + order = &o } - if offer.Err != "" { - return fmt.Errorf("The received offer errored: %s", offer.Err) - } - - maxPrice := types.FromFil(DefaultMaxRetrievePrice) - - if cctx.String("maxPrice") != "" { - maxPriceFil, err := types.ParseFIL(cctx.String("maxPrice")) - if err != nil { - return xerrors.Errorf("parsing maxPrice: %w", err) - } - - maxPrice = types.BigInt(maxPriceFil) - } - - if offer.MinPrice.GreaterThan(maxPrice) { - return xerrors.Errorf("failed to find offer satisfying maxPrice: %s", maxPrice) - } - ref := &lapi.FileRef{ Path: cctx.Args().Get(1), IsCAR: cctx.Bool("car"), } - updates, err := fapi.ClientRetrieveWithEvents(ctx, offer.Order(payer), ref) + + updates, err := fapi.ClientRetrieveWithEvents(ctx, *order, ref) if err != nil { return xerrors.Errorf("error setting up retrieval: %w", err) } @@ -1129,6 +1200,29 @@ var clientRetrieveCmd = &cli.Command{ }, } +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", @@ -1990,6 +2084,33 @@ var clientCancelTransfer = &cli.Command{ }, } +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", @@ -2178,3 +2299,77 @@ func ellipsis(s string, length int) string { } return s } + +func inspectDealCmd(ctx context.Context, api lapi.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 (%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/cmd.go b/cli/cmd.go index 19006702f..efbb3b990 100644 --- a/cli/cmd.go +++ b/cli/cmd.go @@ -56,12 +56,12 @@ var GetStorageMinerAPI = cliutil.GetStorageMinerAPI var GetWorkerAPI = cliutil.GetWorkerAPI var CommonCommands = []*cli.Command{ - netCmd, - authCmd, - logCmd, - waitApiCmd, - fetchParamCmd, - pprofCmd, + NetCmd, + AuthCmd, + LogCmd, + WaitApiCmd, + FetchParamCmd, + PprofCmd, VersionCmd, } @@ -71,16 +71,16 @@ var Commands = []*cli.Command{ WithCategory("basic", clientCmd), WithCategory("basic", multisigCmd), WithCategory("basic", paychCmd), - WithCategory("developer", authCmd), - WithCategory("developer", mpoolCmd), - WithCategory("developer", stateCmd), - WithCategory("developer", chainCmd), - WithCategory("developer", logCmd), - WithCategory("developer", waitApiCmd), - WithCategory("developer", fetchParamCmd), - WithCategory("network", netCmd), - WithCategory("network", syncCmd), - pprofCmd, + WithCategory("developer", AuthCmd), + WithCategory("developer", MpoolCmd), + WithCategory("developer", StateCmd), + WithCategory("developer", ChainCmd), + WithCategory("developer", LogCmd), + WithCategory("developer", WaitApiCmd), + WithCategory("developer", FetchParamCmd), + WithCategory("network", NetCmd), + WithCategory("network", SyncCmd), + PprofCmd, VersionCmd, } diff --git a/cli/disputer.go b/cli/disputer.go index 1a72173c3..ded240a80 100644 --- a/cli/disputer.go +++ b/cli/disputer.go @@ -35,7 +35,7 @@ type minerDeadline struct { index uint64 } -var chainDisputeSetCmd = &cli.Command{ +var ChainDisputeSetCmd = &cli.Command{ Name: "disputer", Usage: "interact with the window post disputer", Flags: []cli.Flag{ diff --git a/cli/log.go b/cli/log.go index a4aeaad5c..4ab6aa748 100644 --- a/cli/log.go +++ b/cli/log.go @@ -7,16 +7,16 @@ import ( "golang.org/x/xerrors" ) -var logCmd = &cli.Command{ +var LogCmd = &cli.Command{ Name: "log", Usage: "Manage logging", Subcommands: []*cli.Command{ - logList, - logSetLevel, + LogList, + LogSetLevel, }, } -var logList = &cli.Command{ +var LogList = &cli.Command{ Name: "list", Usage: "List log systems", Action: func(cctx *cli.Context) error { @@ -41,7 +41,7 @@ var logList = &cli.Command{ }, } -var logSetLevel = &cli.Command{ +var LogSetLevel = &cli.Command{ Name: "set-level", Usage: "Set log level", ArgsUsage: "[level]", diff --git a/cli/mpool.go b/cli/mpool.go index d74c7c9ba..b5a68860f 100644 --- a/cli/mpool.go +++ b/cli/mpool.go @@ -22,22 +22,22 @@ import ( "github.com/filecoin-project/lotus/node/config" ) -var mpoolCmd = &cli.Command{ +var MpoolCmd = &cli.Command{ Name: "mpool", Usage: "Manage message pool", Subcommands: []*cli.Command{ - mpoolPending, - mpoolClear, - mpoolSub, - mpoolStat, - mpoolReplaceCmd, - mpoolFindCmd, - mpoolConfig, - mpoolGasPerfCmd, + MpoolPending, + MpoolClear, + MpoolSub, + MpoolStat, + MpoolReplaceCmd, + MpoolFindCmd, + MpoolConfig, + MpoolGasPerfCmd, }, } -var mpoolPending = &cli.Command{ +var MpoolPending = &cli.Command{ Name: "pending", Usage: "Get pending messages", Flags: []cli.Flag{ @@ -132,7 +132,7 @@ var mpoolPending = &cli.Command{ }, } -var mpoolClear = &cli.Command{ +var MpoolClear = &cli.Command{ Name: "clear", Usage: "Clear all pending messages from the mpool (USE WITH CARE)", Flags: []cli.Flag{ @@ -165,7 +165,7 @@ var mpoolClear = &cli.Command{ }, } -var mpoolSub = &cli.Command{ +var MpoolSub = &cli.Command{ Name: "sub", Usage: "Subscribe to mpool changes", Action: func(cctx *cli.Context) error { @@ -197,7 +197,7 @@ var mpoolSub = &cli.Command{ }, } -var mpoolStat = &cli.Command{ +var MpoolStat = &cli.Command{ Name: "stat", Usage: "print mempool stats", Flags: []cli.Flag{ @@ -356,7 +356,7 @@ var mpoolStat = &cli.Command{ }, } -var mpoolReplaceCmd = &cli.Command{ +var MpoolReplaceCmd = &cli.Command{ Name: "replace", Usage: "replace a message in the mempool", Flags: []cli.Flag{ @@ -509,7 +509,7 @@ var mpoolReplaceCmd = &cli.Command{ }, } -var mpoolFindCmd = &cli.Command{ +var MpoolFindCmd = &cli.Command{ Name: "find", Usage: "find a message in the mempool", Flags: []cli.Flag{ @@ -592,7 +592,7 @@ var mpoolFindCmd = &cli.Command{ }, } -var mpoolConfig = &cli.Command{ +var MpoolConfig = &cli.Command{ Name: "config", Usage: "get or set current mpool configuration", ArgsUsage: "[new-config]", @@ -637,7 +637,7 @@ var mpoolConfig = &cli.Command{ }, } -var mpoolGasPerfCmd = &cli.Command{ +var MpoolGasPerfCmd = &cli.Command{ Name: "gas-perf", Usage: "Check gas performance of messages in mempool", Flags: []cli.Flag{ diff --git a/cli/net.go b/cli/net.go index de9dbd767..fdd0a13d6 100644 --- a/cli/net.go +++ b/cli/net.go @@ -23,16 +23,16 @@ import ( "github.com/filecoin-project/lotus/lib/addrutil" ) -var netCmd = &cli.Command{ +var NetCmd = &cli.Command{ Name: "net", Usage: "Manage P2P Network", Subcommands: []*cli.Command{ NetPeers, - netConnect, + NetConnect, NetListen, NetId, - netFindPeer, - netScores, + NetFindPeer, + NetScores, NetReachability, NetBandwidthCmd, NetBlockCmd, @@ -112,7 +112,7 @@ var NetPeers = &cli.Command{ }, } -var netScores = &cli.Command{ +var NetScores = &cli.Command{ Name: "scores", Usage: "Print peers' pubsub scores", Flags: []cli.Flag{ @@ -175,7 +175,7 @@ var NetListen = &cli.Command{ }, } -var netConnect = &cli.Command{ +var NetConnect = &cli.Command{ Name: "connect", Usage: "Connect to a peer", ArgsUsage: "[peerMultiaddr|minerActorAddress]", @@ -264,7 +264,7 @@ var NetId = &cli.Command{ }, } -var netFindPeer = &cli.Command{ +var NetFindPeer = &cli.Command{ Name: "findpeer", Usage: "Find the addresses of a given peerID", ArgsUsage: "[peerId]", diff --git a/cli/params.go b/cli/params.go index 05c0a4cda..8419507b8 100644 --- a/cli/params.go +++ b/cli/params.go @@ -9,7 +9,7 @@ import ( "github.com/filecoin-project/lotus/build" ) -var fetchParamCmd = &cli.Command{ +var FetchParamCmd = &cli.Command{ Name: "fetch-params", Usage: "Fetch proving parameters", ArgsUsage: "[sectorSize]", diff --git a/cli/pprof.go b/cli/pprof.go index dccb97f9a..0da245910 100644 --- a/cli/pprof.go +++ b/cli/pprof.go @@ -11,7 +11,7 @@ import ( "github.com/filecoin-project/lotus/node/repo" ) -var pprofCmd = &cli.Command{ +var PprofCmd = &cli.Command{ Name: "pprof", Hidden: true, Subcommands: []*cli.Command{ diff --git a/cli/state.go b/cli/state.go index df64c7ddf..12689c7e3 100644 --- a/cli/state.go +++ b/cli/state.go @@ -41,7 +41,7 @@ import ( "github.com/filecoin-project/lotus/chain/types" ) -var stateCmd = &cli.Command{ +var StateCmd = &cli.Command{ Name: "state", Usage: "Interact with and query filecoin chain state", Flags: []cli.Flag{ @@ -51,32 +51,32 @@ var stateCmd = &cli.Command{ }, }, Subcommands: []*cli.Command{ - statePowerCmd, - stateSectorsCmd, - stateActiveSectorsCmd, - stateListActorsCmd, - stateListMinersCmd, - stateCircSupplyCmd, - stateSectorCmd, - stateGetActorCmd, - stateLookupIDCmd, - stateReplayCmd, - stateSectorSizeCmd, - stateReadStateCmd, - stateListMessagesCmd, - stateComputeStateCmd, - stateCallCmd, - stateGetDealSetCmd, - stateWaitMsgCmd, - stateSearchMsgCmd, - stateMinerInfo, - stateMarketCmd, - stateExecTraceCmd, - stateNtwkVersionCmd, + StatePowerCmd, + StateSectorsCmd, + StateActiveSectorsCmd, + StateListActorsCmd, + StateListMinersCmd, + StateCircSupplyCmd, + StateSectorCmd, + StateGetActorCmd, + StateLookupIDCmd, + StateReplayCmd, + StateSectorSizeCmd, + StateReadStateCmd, + StateListMessagesCmd, + StateComputeStateCmd, + StateCallCmd, + StateGetDealSetCmd, + StateWaitMsgCmd, + StateSearchMsgCmd, + StateMinerInfo, + StateMarketCmd, + StateExecTraceCmd, + StateNtwkVersionCmd, }, } -var stateMinerInfo = &cli.Command{ +var StateMinerInfo = &cli.Command{ Name: "miner-info", Usage: "Retrieve miner information", ArgsUsage: "[minerAddress]", @@ -219,7 +219,7 @@ func ParseTipSetRef(ctx context.Context, api api.FullNode, tss string) (*types.T return ts, nil } -var statePowerCmd = &cli.Command{ +var StatePowerCmd = &cli.Command{ Name: "power", Usage: "Query network or miner power", ArgsUsage: "[ (optional)]", @@ -263,7 +263,7 @@ var statePowerCmd = &cli.Command{ }, } -var stateSectorsCmd = &cli.Command{ +var StateSectorsCmd = &cli.Command{ Name: "sectors", Usage: "Query the sector set of a miner", ArgsUsage: "[minerAddress]", @@ -303,7 +303,7 @@ var stateSectorsCmd = &cli.Command{ }, } -var stateActiveSectorsCmd = &cli.Command{ +var StateActiveSectorsCmd = &cli.Command{ Name: "active-sectors", Usage: "Query the active sector set of a miner", ArgsUsage: "[minerAddress]", @@ -343,7 +343,7 @@ var stateActiveSectorsCmd = &cli.Command{ }, } -var stateExecTraceCmd = &cli.Command{ +var StateExecTraceCmd = &cli.Command{ Name: "exec-trace", Usage: "Get the execution trace of a given message", ArgsUsage: "", @@ -411,7 +411,7 @@ var stateExecTraceCmd = &cli.Command{ }, } -var stateReplayCmd = &cli.Command{ +var StateReplayCmd = &cli.Command{ Name: "replay", Usage: "Replay a particular message", ArgsUsage: "", @@ -476,7 +476,7 @@ var stateReplayCmd = &cli.Command{ }, } -var stateGetDealSetCmd = &cli.Command{ +var StateGetDealSetCmd = &cli.Command{ Name: "get-deal", Usage: "View on-chain deal info", ArgsUsage: "[dealId]", @@ -518,7 +518,7 @@ var stateGetDealSetCmd = &cli.Command{ }, } -var stateListMinersCmd = &cli.Command{ +var StateListMinersCmd = &cli.Command{ Name: "list-miners", Usage: "list all miners in the network", Flags: []cli.Flag{ @@ -590,7 +590,7 @@ func getDealsCounts(ctx context.Context, lapi api.FullNode) (map[address.Address return out, nil } -var stateListActorsCmd = &cli.Command{ +var StateListActorsCmd = &cli.Command{ Name: "list-actors", Usage: "list all actors in the network", Action: func(cctx *cli.Context) error { @@ -620,7 +620,7 @@ var stateListActorsCmd = &cli.Command{ }, } -var stateGetActorCmd = &cli.Command{ +var StateGetActorCmd = &cli.Command{ Name: "get-actor", Usage: "Print actor information", ArgsUsage: "[actorrAddress]", @@ -664,7 +664,7 @@ var stateGetActorCmd = &cli.Command{ }, } -var stateLookupIDCmd = &cli.Command{ +var StateLookupIDCmd = &cli.Command{ Name: "lookup", Usage: "Find corresponding ID address", ArgsUsage: "[address]", @@ -715,7 +715,7 @@ var stateLookupIDCmd = &cli.Command{ }, } -var stateSectorSizeCmd = &cli.Command{ +var StateSectorSizeCmd = &cli.Command{ Name: "sector-size", Usage: "Look up miners sector size", ArgsUsage: "[minerAddress]", @@ -752,7 +752,7 @@ var stateSectorSizeCmd = &cli.Command{ }, } -var stateReadStateCmd = &cli.Command{ +var StateReadStateCmd = &cli.Command{ Name: "read-state", Usage: "View a json representation of an actors state", ArgsUsage: "[actorAddress]", @@ -794,7 +794,7 @@ var stateReadStateCmd = &cli.Command{ }, } -var stateListMessagesCmd = &cli.Command{ +var StateListMessagesCmd = &cli.Command{ Name: "list-messages", Usage: "list messages on chain matching given criteria", Flags: []cli.Flag{ @@ -907,7 +907,7 @@ var stateListMessagesCmd = &cli.Command{ }, } -var stateComputeStateCmd = &cli.Command{ +var StateComputeStateCmd = &cli.Command{ Name: "compute-state", Usage: "Perform state computations", Flags: []cli.Flag{ @@ -1365,7 +1365,7 @@ func jsonReturn(code cid.Cid, method abi.MethodNum, ret []byte) (string, error) return string(b), err } -var stateWaitMsgCmd = &cli.Command{ +var StateWaitMsgCmd = &cli.Command{ Name: "wait-msg", Usage: "Wait for a message to appear on chain", ArgsUsage: "[messageCid]", @@ -1407,7 +1407,7 @@ var stateWaitMsgCmd = &cli.Command{ }, } -var stateSearchMsgCmd = &cli.Command{ +var StateSearchMsgCmd = &cli.Command{ Name: "search-msg", Usage: "Search to see whether a message has appeared on chain", ArgsUsage: "[messageCid]", @@ -1484,7 +1484,7 @@ func printMsg(ctx context.Context, api api.FullNode, msg cid.Cid, mw *lapi.MsgLo return nil } -var stateCallCmd = &cli.Command{ +var StateCallCmd = &cli.Command{ Name: "call", Usage: "Invoke a method on an actor locally", ArgsUsage: "[toAddress methodId (optional)]", @@ -1692,7 +1692,7 @@ func parseParamsForMethod(act cid.Cid, method uint64, args []string) ([]byte, er return buf.Bytes(), nil } -var stateCircSupplyCmd = &cli.Command{ +var StateCircSupplyCmd = &cli.Command{ Name: "circulating-supply", Usage: "Get the exact current circulating supply of Filecoin", Flags: []cli.Flag{ @@ -1741,7 +1741,7 @@ var stateCircSupplyCmd = &cli.Command{ }, } -var stateSectorCmd = &cli.Command{ +var StateSectorCmd = &cli.Command{ Name: "sector", Usage: "Get miner sector info", ArgsUsage: "[miner address] [sector number]", @@ -1815,7 +1815,7 @@ var stateSectorCmd = &cli.Command{ }, } -var stateMarketCmd = &cli.Command{ +var StateMarketCmd = &cli.Command{ Name: "market", Usage: "Inspect the storage market actor", Subcommands: []*cli.Command{ @@ -1861,7 +1861,7 @@ var stateMarketBalanceCmd = &cli.Command{ }, } -var stateNtwkVersionCmd = &cli.Command{ +var StateNtwkVersionCmd = &cli.Command{ Name: "network-version", Usage: "Returns the network version", Action: func(cctx *cli.Context) error { diff --git a/cli/sync.go b/cli/sync.go index ff7d4bd65..223d50337 100644 --- a/cli/sync.go +++ b/cli/sync.go @@ -15,20 +15,20 @@ import ( "github.com/filecoin-project/lotus/build" ) -var syncCmd = &cli.Command{ +var SyncCmd = &cli.Command{ Name: "sync", Usage: "Inspect or interact with the chain syncer", Subcommands: []*cli.Command{ - syncStatusCmd, - syncWaitCmd, - syncMarkBadCmd, - syncUnmarkBadCmd, - syncCheckBadCmd, - syncCheckpointCmd, + SyncStatusCmd, + SyncWaitCmd, + SyncMarkBadCmd, + SyncUnmarkBadCmd, + SyncCheckBadCmd, + SyncCheckpointCmd, }, } -var syncStatusCmd = &cli.Command{ +var SyncStatusCmd = &cli.Command{ Name: "status", Usage: "check sync status", Action: func(cctx *cli.Context) error { @@ -81,7 +81,7 @@ var syncStatusCmd = &cli.Command{ }, } -var syncWaitCmd = &cli.Command{ +var SyncWaitCmd = &cli.Command{ Name: "wait", Usage: "Wait for sync to be complete", Flags: []cli.Flag{ @@ -102,7 +102,7 @@ var syncWaitCmd = &cli.Command{ }, } -var syncMarkBadCmd = &cli.Command{ +var SyncMarkBadCmd = &cli.Command{ Name: "mark-bad", Usage: "Mark the given block as bad, will prevent syncing to a chain that contains it", ArgsUsage: "[blockCid]", @@ -127,7 +127,7 @@ var syncMarkBadCmd = &cli.Command{ }, } -var syncUnmarkBadCmd = &cli.Command{ +var SyncUnmarkBadCmd = &cli.Command{ Name: "unmark-bad", Usage: "Unmark the given block as bad, makes it possible to sync to a chain containing it", Flags: []cli.Flag{ @@ -162,7 +162,7 @@ var syncUnmarkBadCmd = &cli.Command{ }, } -var syncCheckBadCmd = &cli.Command{ +var SyncCheckBadCmd = &cli.Command{ Name: "check-bad", Usage: "check if the given block was marked bad, and for what reason", ArgsUsage: "[blockCid]", @@ -198,7 +198,7 @@ var syncCheckBadCmd = &cli.Command{ }, } -var syncCheckpointCmd = &cli.Command{ +var SyncCheckpointCmd = &cli.Command{ Name: "checkpoint", Usage: "mark a certain tipset as checkpointed; the node will never fork away from this tipset", ArgsUsage: "[tipsetKey]", diff --git a/cli/util/api.go b/cli/util/api.go index 6a4982894..ce5945f2e 100644 --- a/cli/util/api.go +++ b/cli/util/api.go @@ -230,7 +230,7 @@ func GetStorageMinerAPI(ctx *cli.Context, opts ...GetStorageMinerOption) (api.St return client.NewStorageMinerRPC(ctx.Context, addr, headers) } -func GetWorkerAPI(ctx *cli.Context) (api.WorkerAPI, jsonrpc.ClientCloser, error) { +func GetWorkerAPI(ctx *cli.Context) (api.Worker, jsonrpc.ClientCloser, error) { addr, headers, err := GetRawAPI(ctx, repo.Worker) if err != nil { return nil, nil, err @@ -239,7 +239,7 @@ func GetWorkerAPI(ctx *cli.Context) (api.WorkerAPI, jsonrpc.ClientCloser, error) return client.NewWorkerRPC(ctx.Context, addr, headers) } -func GetGatewayAPI(ctx *cli.Context) (api.GatewayAPI, jsonrpc.ClientCloser, error) { +func GetGatewayAPI(ctx *cli.Context) (api.Gateway, jsonrpc.ClientCloser, error) { addr, headers, err := GetRawAPI(ctx, repo.FullNode) if err != nil { return nil, nil, err diff --git a/cli/wait.go b/cli/wait.go index ca8cdce3f..98fc9c0d8 100644 --- a/cli/wait.go +++ b/cli/wait.go @@ -7,7 +7,7 @@ import ( "github.com/urfave/cli/v2" ) -var waitApiCmd = &cli.Command{ +var WaitApiCmd = &cli.Command{ Name: "wait-api", Usage: "Wait for lotus api to come online", Action: func(cctx *cli.Context) error { diff --git a/cmd/lotus-gateway/api.go b/cmd/lotus-gateway/api.go index 6f6cf27e6..6799ef627 100644 --- a/cmd/lotus-gateway/api.go +++ b/cmd/lotus-gateway/api.go @@ -404,7 +404,7 @@ func (a *GatewayAPI) WalletVerify(ctx context.Context, k address.Address, msg [] return sigs.Verify(sig, k, msg) == nil, nil } -var _ api.GatewayAPI = (*GatewayAPI)(nil) +var _ api.Gateway = (*GatewayAPI)(nil) var _ full.ChainModuleAPI = (*GatewayAPI)(nil) var _ full.GasModuleAPI = (*GatewayAPI)(nil) var _ full.MpoolModuleAPI = (*GatewayAPI)(nil) diff --git a/cmd/lotus-gateway/endtoend_test.go b/cmd/lotus-gateway/endtoend_test.go index b6d81efb4..8c1901d65 100644 --- a/cmd/lotus-gateway/endtoend_test.go +++ b/cmd/lotus-gateway/endtoend_test.go @@ -249,12 +249,12 @@ func startNodes( require.NoError(t, err) // Create a gateway client API that connects to the gateway server - var gapi api.GatewayAPI + var gapi api.Gateway gapi, closer, err = client.NewGatewayRPC(ctx, addr, nil) require.NoError(t, err) // Provide the gateway API to dependency injection - return node.Override(new(api.GatewayAPI), gapi) + return node.Override(new(api.Gateway), gapi) }, }, ) diff --git a/cmd/lotus-seal-worker/rpc.go b/cmd/lotus-seal-worker/rpc.go index f69129c50..3649d6c8f 100644 --- a/cmd/lotus-seal-worker/rpc.go +++ b/cmd/lotus-seal-worker/rpc.go @@ -9,6 +9,8 @@ import ( "golang.org/x/xerrors" "github.com/filecoin-project/lotus/api" + apitypes "github.com/filecoin-project/lotus/api/types" + "github.com/filecoin-project/lotus/build" sectorstorage "github.com/filecoin-project/lotus/extern/sector-storage" "github.com/filecoin-project/lotus/extern/sector-storage/stores" "github.com/filecoin-project/lotus/extern/sector-storage/storiface" @@ -76,4 +78,8 @@ func (w *worker) Session(ctx context.Context) (uuid.UUID, error) { return w.LocalWorker.Session(ctx) } +func (w *worker) Discover(ctx context.Context) (apitypes.OpenRPCDocument, error) { + return build.OpenRPCDiscoverJSON_Worker(), nil +} + var _ storiface.WorkerCalls = &worker{} diff --git a/cmd/lotus-seal-worker/tasks.go b/cmd/lotus-seal-worker/tasks.go index bafd98951..02e5d6cfd 100644 --- a/cmd/lotus-seal-worker/tasks.go +++ b/cmd/lotus-seal-worker/tasks.go @@ -41,17 +41,17 @@ var tasksEnableCmd = &cli.Command{ Name: "enable", Usage: "Enable a task type", ArgsUsage: "[" + settableStr + "]", - Action: taskAction(api.WorkerAPI.TaskEnable), + Action: taskAction(api.Worker.TaskEnable), } var tasksDisableCmd = &cli.Command{ Name: "disable", Usage: "Disable a task type", ArgsUsage: "[" + settableStr + "]", - Action: taskAction(api.WorkerAPI.TaskDisable), + Action: taskAction(api.Worker.TaskDisable), } -func taskAction(tf func(a api.WorkerAPI, ctx context.Context, tt sealtasks.TaskType) error) func(cctx *cli.Context) error { +func taskAction(tf func(a api.Worker, ctx context.Context, tt sealtasks.TaskType) error) func(cctx *cli.Context) error { return func(cctx *cli.Context) error { if cctx.NArg() != 1 { return xerrors.Errorf("expected 1 argument") diff --git a/cmd/lotus-shed/base64.go b/cmd/lotus-shed/base64.go new file mode 100644 index 000000000..3f0469ef9 --- /dev/null +++ b/cmd/lotus-shed/base64.go @@ -0,0 +1,75 @@ +package main + +import ( + "encoding/base64" + "fmt" + "io" + "io/ioutil" + "os" + "strings" + + "github.com/filecoin-project/go-state-types/abi" + + "github.com/filecoin-project/go-address" + + "github.com/urfave/cli/v2" +) + +var base64Cmd = &cli.Command{ + Name: "base64", + Description: "multiformats base64", + Flags: []cli.Flag{ + &cli.BoolFlag{ + Name: "decodeAddr", + Value: false, + Usage: "Decode a base64 addr", + }, + &cli.BoolFlag{ + Name: "decodeBig", + Value: false, + Usage: "Decode a base64 big", + }, + }, + Action: func(cctx *cli.Context) error { + var input io.Reader + + if cctx.Args().Len() == 0 { + input = os.Stdin + } else { + input = strings.NewReader(cctx.Args().First()) + } + + bytes, err := ioutil.ReadAll(input) + if err != nil { + return nil + } + + decoded, err := base64.RawStdEncoding.DecodeString(strings.TrimSpace(string(bytes))) + if err != nil { + return err + } + + if cctx.Bool("decodeAddr") { + addr, err := address.NewFromBytes(decoded) + if err != nil { + return err + } + + fmt.Println(addr) + + return nil + } + + if cctx.Bool("decodeBig") { + var val abi.TokenAmount + err = val.UnmarshalBinary(decoded) + if err != nil { + return err + } + + fmt.Println(val) + } + + return nil + }, +} diff --git a/cmd/lotus-shed/datastore.go b/cmd/lotus-shed/datastore.go index 1086e8260..4533b78a9 100644 --- a/cmd/lotus-shed/datastore.go +++ b/cmd/lotus-shed/datastore.go @@ -180,8 +180,11 @@ var datastoreBackupStatCmd = &cli.Command{ } defer f.Close() // nolint:errcheck - var keys, kbytes, vbytes uint64 - err = backupds.ReadBackup(f, func(key datastore.Key, value []byte) error { + var keys, logs, kbytes, vbytes uint64 + clean, err := backupds.ReadBackup(f, func(key datastore.Key, value []byte, log bool) error { + if log { + logs++ + } keys++ kbytes += uint64(len(key.String())) vbytes += uint64(len(value)) @@ -191,7 +194,9 @@ var datastoreBackupStatCmd = &cli.Command{ return err } + fmt.Println("Truncated: ", !clean) fmt.Println("Keys: ", keys) + fmt.Println("Log values: ", log) fmt.Println("Key bytes: ", units.BytesSize(float64(kbytes))) fmt.Println("Value bytes: ", units.BytesSize(float64(vbytes))) @@ -225,7 +230,7 @@ var datastoreBackupListCmd = &cli.Command{ defer f.Close() // nolint:errcheck printKv := kvPrinter(cctx.Bool("top-level"), cctx.String("get-enc")) - err = backupds.ReadBackup(f, func(key datastore.Key, value []byte) error { + _, err = backupds.ReadBackup(f, func(key datastore.Key, value []byte, _ bool) error { return printKv(key.String(), value) }) if err != nil { diff --git a/cmd/lotus-shed/election.go b/cmd/lotus-shed/election.go index ffe30d163..c844203d6 100644 --- a/cmd/lotus-shed/election.go +++ b/cmd/lotus-shed/election.go @@ -7,30 +7,35 @@ import ( "github.com/filecoin-project/lotus/chain/types" lcli "github.com/filecoin-project/lotus/cli" + builtin2 "github.com/filecoin-project/specs-actors/v2/actors/builtin" "github.com/urfave/cli/v2" "golang.org/x/xerrors" ) var electionCmd = &cli.Command{ Name: "election", - Usage: "commands related to leader election", + Usage: "Commands related to leader election", Subcommands: []*cli.Command{ electionRunDummy, + electionEstimate, }, } var electionRunDummy = &cli.Command{ Name: "run-dummy", - Usage: "runs dummy elections with given power", + Usage: "Runs dummy elections with given power", Flags: []cli.Flag{ &cli.StringFlag{ - Name: "network-power", + Name: "network-power", + Usage: "network storage power", }, &cli.StringFlag{ - Name: "miner-power", + Name: "miner-power", + Usage: "miner storage power", }, &cli.Uint64Flag{ Name: "seed", + Usage: "rand number", Value: 0, }, }, @@ -42,7 +47,7 @@ var electionRunDummy = &cli.Command{ } networkPow, err := types.BigFromString(cctx.String("network-power")) if err != nil { - return xerrors.Errorf("decoding miner-power: %w", err) + return xerrors.Errorf("decoding network-power: %w", err) } ep := &types.ElectionProof{} @@ -68,3 +73,54 @@ var electionRunDummy = &cli.Command{ } }, } + +var electionEstimate = &cli.Command{ + Name: "estimate", + Usage: "Estimate elections with given power", + Flags: []cli.Flag{ + &cli.StringFlag{ + Name: "network-power", + Usage: "network storage power", + }, + &cli.StringFlag{ + Name: "miner-power", + Usage: "miner storage power", + }, + &cli.Uint64Flag{ + Name: "seed", + Usage: "rand number", + Value: 0, + }, + }, + Action: func(cctx *cli.Context) error { + minerPow, err := types.BigFromString(cctx.String("miner-power")) + if err != nil { + return xerrors.Errorf("decoding miner-power: %w", err) + } + networkPow, err := types.BigFromString(cctx.String("network-power")) + if err != nil { + return xerrors.Errorf("decoding network-power: %w", err) + } + + ep := &types.ElectionProof{} + ep.VRFProof = make([]byte, 32) + seed := cctx.Uint64("seed") + if seed == 0 { + seed = rand.Uint64() + } + binary.BigEndian.PutUint64(ep.VRFProof, seed) + + winYear := int64(0) + for i := 0; i < builtin2.EpochsInYear; i++ { + binary.BigEndian.PutUint64(ep.VRFProof[8:], uint64(i)) + j := ep.ComputeWinCount(minerPow, networkPow) + winYear += j + } + winHour := winYear * builtin2.EpochsInHour / builtin2.EpochsInYear + winDay := winYear * builtin2.EpochsInDay / builtin2.EpochsInYear + winMonth := winYear * builtin2.EpochsInDay * 30 / builtin2.EpochsInYear + fmt.Println("winInHour, winInDay, winInMonth, winInYear") + fmt.Printf("%d, %d, %d, %d\n", winHour, winDay, winMonth, winYear) + return nil + }, +} diff --git a/cmd/lotus-shed/main.go b/cmd/lotus-shed/main.go index b2a676a8d..ebe4f014a 100644 --- a/cmd/lotus-shed/main.go +++ b/cmd/lotus-shed/main.go @@ -16,6 +16,7 @@ func main() { logging.SetLogLevel("*", "INFO") local := []*cli.Command{ + base64Cmd, base32Cmd, base16Cmd, bitFieldCmd, @@ -37,6 +38,7 @@ func main() { mpoolCmd, genesisVerifyCmd, mathCmd, + minerCmd, mpoolStatsCmd, exportChainCmd, consensusCmd, @@ -51,6 +53,7 @@ func main() { rpcCmd, cidCmd, blockmsgidCmd, + signaturesCmd, } app := &cli.App{ diff --git a/cmd/lotus-shed/miner.go b/cmd/lotus-shed/miner.go new file mode 100644 index 000000000..ec5a445f9 --- /dev/null +++ b/cmd/lotus-shed/miner.go @@ -0,0 +1,113 @@ +package main + +import ( + "bufio" + "io" + "os" + "path/filepath" + "strings" + + "github.com/mitchellh/go-homedir" + "github.com/urfave/cli/v2" + "golang.org/x/xerrors" +) + +var minerCmd = &cli.Command{ + Name: "miner", + Usage: "miner-related utilities", + Subcommands: []*cli.Command{ + minerUnpackInfoCmd, + }, +} + +var minerUnpackInfoCmd = &cli.Command{ + Name: "unpack-info", + Usage: "unpack miner info all dump", + ArgsUsage: "[allinfo.txt] [dir]", + Action: func(cctx *cli.Context) error { + if cctx.Args().Len() != 2 { + return xerrors.Errorf("expected 2 args") + } + + src, err := homedir.Expand(cctx.Args().Get(0)) + if err != nil { + return xerrors.Errorf("expand src: %w", err) + } + + f, err := os.Open(src) + if err != nil { + return xerrors.Errorf("open file: %w", err) + } + defer f.Close() // nolint + + dest, err := homedir.Expand(cctx.Args().Get(1)) + if err != nil { + return xerrors.Errorf("expand dest: %w", err) + } + + var outf *os.File + + r := bufio.NewReader(f) + for { + l, _, err := r.ReadLine() + if err == io.EOF { + if outf != nil { + return outf.Close() + } + } + if err != nil { + return xerrors.Errorf("read line: %w", err) + } + sl := string(l) + + if strings.HasPrefix(sl, "#") { + if strings.Contains(sl, "..") { + return xerrors.Errorf("bad name %s", sl) + } + + if strings.HasPrefix(sl, "#: ") { + if outf != nil { + if err := outf.Close(); err != nil { + return xerrors.Errorf("close out file: %w", err) + } + } + p := filepath.Join(dest, sl[len("#: "):]) + if err := os.MkdirAll(filepath.Dir(p), 0775); err != nil { + return xerrors.Errorf("mkdir: %w", err) + } + outf, err = os.Create(p) + if err != nil { + return xerrors.Errorf("create out file: %w", err) + } + continue + } + + if strings.HasPrefix(sl, "##: ") { + if outf != nil { + if err := outf.Close(); err != nil { + return xerrors.Errorf("close out file: %w", err) + } + } + p := filepath.Join(dest, "Per Sector Infos", sl[len("##: "):]) + if err := os.MkdirAll(filepath.Dir(p), 0775); err != nil { + return xerrors.Errorf("mkdir: %w", err) + } + outf, err = os.Create(p) + if err != nil { + return xerrors.Errorf("create out file: %w", err) + } + continue + } + } + + if outf != nil { + if _, err := outf.Write(l); err != nil { + return xerrors.Errorf("write line: %w", err) + } + if _, err := outf.Write([]byte("\n")); err != nil { + return xerrors.Errorf("write line end: %w", err) + } + } + } + }, +} diff --git a/cmd/lotus-shed/sectors.go b/cmd/lotus-shed/sectors.go index 64f3faf79..6cf6ee86e 100644 --- a/cmd/lotus-shed/sectors.go +++ b/cmd/lotus-shed/sectors.go @@ -6,6 +6,7 @@ import ( "golang.org/x/xerrors" + "github.com/filecoin-project/go-address" "github.com/filecoin-project/go-bitfield" "github.com/filecoin-project/go-state-types/abi" "github.com/filecoin-project/go-state-types/big" @@ -34,6 +35,10 @@ var terminateSectorCmd = &cli.Command{ Usage: "Forcefully terminate a sector (WARNING: This means losing power and pay a one-time termination penalty(including collateral) for the terminated sector)", ArgsUsage: "[sectorNum1 sectorNum2 ...]", Flags: []cli.Flag{ + &cli.StringFlag{ + Name: "actor", + Usage: "specify the address of miner actor", + }, &cli.BoolFlag{ Name: "really-do-it", Usage: "pass this flag if you know what you are doing", @@ -44,6 +49,15 @@ var terminateSectorCmd = &cli.Command{ return fmt.Errorf("at least one sector must be specified") } + var maddr address.Address + if act := cctx.String("actor"); act != "" { + var err error + maddr, err = address.NewFromString(act) + if err != nil { + return fmt.Errorf("parsing address %s: %w", act, err) + } + } + if !cctx.Bool("really-do-it") { return fmt.Errorf("this is a command for advanced users, only use it if you are sure of what you are doing") } @@ -54,17 +68,19 @@ var terminateSectorCmd = &cli.Command{ } defer closer() - api, acloser, err := lcli.GetStorageMinerAPI(cctx) - if err != nil { - return err - } - defer acloser() - ctx := lcli.ReqContext(cctx) - maddr, err := api.ActorAddress(ctx) - if err != nil { - return err + if maddr.Empty() { + api, acloser, err := lcli.GetStorageMinerAPI(cctx) + if err != nil { + return err + } + defer acloser() + + maddr, err = api.ActorAddress(ctx) + if err != nil { + return err + } } mi, err := nodeApi.StateMinerInfo(ctx, maddr, types.EmptyTSK) @@ -147,28 +163,45 @@ var terminateSectorPenaltyEstimationCmd = &cli.Command{ Name: "termination-estimate", Usage: "Estimate the termination penalty", ArgsUsage: "[sectorNum1 sectorNum2 ...]", + Flags: []cli.Flag{ + &cli.StringFlag{ + Name: "actor", + Usage: "specify the address of miner actor", + }, + }, Action: func(cctx *cli.Context) error { if cctx.Args().Len() < 1 { return fmt.Errorf("at least one sector must be specified") } + var maddr address.Address + if act := cctx.String("actor"); act != "" { + var err error + maddr, err = address.NewFromString(act) + if err != nil { + return fmt.Errorf("parsing address %s: %w", act, err) + } + } + nodeApi, closer, err := lcli.GetFullNodeAPI(cctx) if err != nil { return err } defer closer() - api, acloser, err := lcli.GetStorageMinerAPI(cctx) - if err != nil { - return err - } - defer acloser() - ctx := lcli.ReqContext(cctx) - maddr, err := api.ActorAddress(ctx) - if err != nil { - return err + if maddr.Empty() { + api, acloser, err := lcli.GetStorageMinerAPI(cctx) + if err != nil { + return err + } + defer acloser() + + maddr, err = api.ActorAddress(ctx) + if err != nil { + return err + } } mi, err := nodeApi.StateMinerInfo(ctx, maddr, types.EmptyTSK) diff --git a/cmd/lotus-shed/signatures.go b/cmd/lotus-shed/signatures.go new file mode 100644 index 000000000..76a4b3bdf --- /dev/null +++ b/cmd/lotus-shed/signatures.go @@ -0,0 +1,74 @@ +package main + +import ( + "encoding/hex" + "fmt" + "strconv" + + "github.com/filecoin-project/go-state-types/crypto" + "github.com/filecoin-project/lotus/lib/sigs" + + "github.com/filecoin-project/go-address" + "github.com/urfave/cli/v2" + "golang.org/x/xerrors" +) + +var signaturesCmd = &cli.Command{ + Name: "signatures", + Usage: "tools involving signatures", + Subcommands: []*cli.Command{ + sigsVerifyVoteCmd, + }, +} + +var sigsVerifyVoteCmd = &cli.Command{ + Name: "verify-vote", + Description: "can be used to verify signed votes being submitted for FILPolls", + Usage: " ", + Action: func(cctx *cli.Context) error { + + if cctx.Args().Len() != 3 { + return xerrors.Errorf("usage: verify-vote ") + } + + fip, err := strconv.ParseInt(cctx.Args().First(), 10, 64) + if err != nil { + return xerrors.Errorf("couldn't parse FIP number: %w", err) + } + + addr, err := address.NewFromString(cctx.Args().Get(1)) + if err != nil { + return xerrors.Errorf("couldn't parse signing address: %w", err) + } + + sigBytes, err := hex.DecodeString(cctx.Args().Get(2)) + if err != nil { + return xerrors.Errorf("couldn't parse sig: %w", err) + } + + var sig crypto.Signature + if err := sig.UnmarshalBinary(sigBytes); err != nil { + return xerrors.Errorf("couldn't unmarshal sig: %w", err) + } + + switch fip { + case 14: + approve := []byte("7 - Approve") + + if sigs.Verify(&sig, addr, approve) == nil { + fmt.Println("valid vote for approving FIP-0014") + return nil + } + + reject := []byte("7 - Reject") + if sigs.Verify(&sig, addr, reject) == nil { + fmt.Println("valid vote for rejecting FIP-0014") + return nil + } + + return xerrors.Errorf("invalid vote for FIP-0014!") + default: + return xerrors.Errorf("unrecognized FIP number") + } + }, +} diff --git a/cmd/lotus-storage-miner/info_all.go b/cmd/lotus-storage-miner/info_all.go index 408f9b5c7..e5e08a569 100644 --- a/cmd/lotus-storage-miner/info_all.go +++ b/cmd/lotus-storage-miner/info_all.go @@ -35,80 +35,80 @@ var infoAllCmd = &cli.Command{ fmt.Println("#: Version") if err := lcli.VersionCmd.Action(cctx); err != nil { - return err + fmt.Println("ERROR: ", err) } fmt.Println("\n#: Miner Info") if err := infoCmdAct(cctx); err != nil { - return err + fmt.Println("ERROR: ", err) } // Verbose info fmt.Println("\n#: Storage List") if err := storageListCmd.Action(cctx); err != nil { - return err + fmt.Println("ERROR: ", err) } fmt.Println("\n#: Worker List") if err := sealingWorkersCmd.Action(cctx); err != nil { - return err + fmt.Println("ERROR: ", err) } fmt.Println("\n#: PeerID") if err := lcli.NetId.Action(cctx); err != nil { - return err + fmt.Println("ERROR: ", err) } fmt.Println("\n#: Listen Addresses") if err := lcli.NetListen.Action(cctx); err != nil { - return err + fmt.Println("ERROR: ", err) } fmt.Println("\n#: Reachability") if err := lcli.NetReachability.Action(cctx); err != nil { - return err + fmt.Println("ERROR: ", err) } // Very Verbose info fmt.Println("\n#: Peers") if err := lcli.NetPeers.Action(cctx); err != nil { - return err + fmt.Println("ERROR: ", err) } fmt.Println("\n#: Sealing Jobs") if err := sealingJobsCmd.Action(cctx); err != nil { - return err + fmt.Println("ERROR: ", err) } fmt.Println("\n#: Sched Diag") if err := sealingSchedDiagCmd.Action(cctx); err != nil { - return err + fmt.Println("ERROR: ", err) } fmt.Println("\n#: Storage Ask") if err := getAskCmd.Action(cctx); err != nil { - return err + fmt.Println("ERROR: ", err) } fmt.Println("\n#: Storage Deals") if err := dealsListCmd.Action(cctx); err != nil { - return err + fmt.Println("ERROR: ", err) } fmt.Println("\n#: Retrieval Deals") if err := retrievalDealsListCmd.Action(cctx); err != nil { - return err + fmt.Println("ERROR: ", err) } fmt.Println("\n#: Sector List") if err := sectorsListCmd.Action(cctx); err != nil { - return err + fmt.Println("ERROR: ", err) } fmt.Println("\n#: Sector Refs") if err := sectorsRefsCmd.Action(cctx); err != nil { - return err + fmt.Println("ERROR: ", err) } // Very Very Verbose info @@ -116,7 +116,7 @@ var infoAllCmd = &cli.Command{ list, err := nodeApi.SectorsList(ctx) if err != nil { - return err + fmt.Println("ERROR: ", err) } sort.Slice(list, func(i, j int) bool { @@ -129,11 +129,11 @@ var infoAllCmd = &cli.Command{ fs := &flag.FlagSet{} for _, f := range sectorsStatusCmd.Flags { if err := f.Apply(fs); err != nil { - return err + fmt.Println("ERROR: ", err) } } if err := fs.Parse([]string{"--log", "--on-chain-info", fmt.Sprint(s)}); err != nil { - return err + fmt.Println("ERROR: ", err) } if err := sectorsStatusCmd.Action(cli.NewContext(cctx.App, fs, cctx)); err != nil { @@ -144,7 +144,7 @@ var infoAllCmd = &cli.Command{ fs = &flag.FlagSet{} if err := fs.Parse([]string{fmt.Sprint(s)}); err != nil { - return err + fmt.Println("ERROR: ", err) } if err := storageFindCmd.Action(cli.NewContext(cctx.App, fs, cctx)); err != nil { @@ -155,7 +155,7 @@ var infoAllCmd = &cli.Command{ if !_test { fmt.Println("\n#: Goroutines") if err := lcli.PprofGoroutines.Action(cctx); err != nil { - return err + fmt.Println("ERROR: ", err) } } diff --git a/cmd/lotus-wallet/interactive.go b/cmd/lotus-wallet/interactive.go index 0f3d13e0b..91c181e65 100644 --- a/cmd/lotus-wallet/interactive.go +++ b/cmd/lotus-wallet/interactive.go @@ -31,7 +31,7 @@ type InteractiveWallet struct { lk sync.Mutex apiGetter func() (api.FullNode, jsonrpc.ClientCloser, error) - under api.WalletAPI + under api.Wallet } func (c *InteractiveWallet) WalletNew(ctx context.Context, typ types.KeyType) (address.Address, error) { diff --git a/cmd/lotus-wallet/logged.go b/cmd/lotus-wallet/logged.go index 272a8d10b..4f07d6ae4 100644 --- a/cmd/lotus-wallet/logged.go +++ b/cmd/lotus-wallet/logged.go @@ -16,7 +16,7 @@ import ( ) type LoggedWallet struct { - under api.WalletAPI + under api.Wallet } func (c *LoggedWallet) WalletNew(ctx context.Context, typ types.KeyType) (address.Address, error) { diff --git a/cmd/lotus-wallet/main.go b/cmd/lotus-wallet/main.go index f41e3f426..271ed198e 100644 --- a/cmd/lotus-wallet/main.go +++ b/cmd/lotus-wallet/main.go @@ -130,7 +130,7 @@ var runCmd = &cli.Command{ return err } - var w api.WalletAPI = lw + var w api.Wallet = lw if cctx.Bool("ledger") { ds, err := lr.Datastore(context.Background(), "/metadata") if err != nil { diff --git a/cmd/lotus/daemon.go b/cmd/lotus/daemon.go index e84fb5195..5a59ec816 100644 --- a/cmd/lotus/daemon.go +++ b/cmd/lotus/daemon.go @@ -289,7 +289,7 @@ var DaemonCmd = &cli.Command{ shutdownChan := make(chan struct{}) - // If the daemon is started in "lite mode", provide a GatewayAPI + // If the daemon is started in "lite mode", provide a Gateway // for RPC calls liteModeDeps := node.Options() if isLite { @@ -299,7 +299,7 @@ var DaemonCmd = &cli.Command{ } defer closer() - liteModeDeps = node.Override(new(api.GatewayAPI), gapi) + liteModeDeps = node.Override(new(api.Gateway), gapi) } // some libraries like ipfs/go-ds-measure and ipfs/go-ipfs-blockstore diff --git a/cmd/lotus/rpc.go b/cmd/lotus/rpc.go index 48720d833..abadfd20c 100644 --- a/cmd/lotus/rpc.go +++ b/cmd/lotus/rpc.go @@ -37,6 +37,7 @@ func serveRPC(a api.FullNode, stop node.StopFunc, addr multiaddr.Multiaddr, shut } rpcServer := jsonrpc.NewServer(serverOptions...) rpcServer.Register("Filecoin", apistruct.PermissionedFullAPI(metrics.MetricedFullAPI(a))) + rpcServer.AliasMethod("rpc.discover", "Filecoin.Discover") ah := &auth.Handler{ Verify: a.AuthVerify, diff --git a/documentation/en/api-methods-miner.md b/documentation/en/api-methods-miner.md index da10a8bcd..9d33a55d0 100644 --- a/documentation/en/api-methods-miner.md +++ b/documentation/en/api-methods-miner.md @@ -1,6 +1,7 @@ # Groups * [](#) * [Closing](#Closing) + * [Discover](#Discover) * [Session](#Session) * [Shutdown](#Shutdown) * [Version](#Version) @@ -13,6 +14,8 @@ * [AuthVerify](#AuthVerify) * [Check](#Check) * [CheckProvable](#CheckProvable) +* [Compute](#Compute) + * [ComputeProof](#ComputeProof) * [Create](#Create) * [CreateBackup](#CreateBackup) * [Deals](#Deals) @@ -142,6 +145,25 @@ Inputs: `null` Response: `{}` +### Discover + + +Perms: read + +Inputs: `null` + +Response: +```json +{ + "info": { + "title": "Lotus RPC API", + "version": "1.2.1/generated=2020-11-22T08:22:42-06:00" + }, + "methods": [], + "openrpc": "1.2.6" +} +``` + ### Session @@ -180,7 +202,7 @@ Response: ### ActorAddress -There are not yet any comments for this method. + Perms: read @@ -189,7 +211,7 @@ Inputs: `null` Response: `"f01234"` ### ActorAddressConfig -There are not yet any comments for this method. + Perms: read @@ -207,7 +229,7 @@ Response: ``` ### ActorSectorSize -There are not yet any comments for this method. + Perms: read @@ -255,7 +277,7 @@ Response: `null` ### CheckProvable -There are not yet any comments for this method. + Perms: admin @@ -275,6 +297,24 @@ Response: } ``` +## Compute + + +### ComputeProof + + +Perms: read + +Inputs: +```json +[ + null, + null +] +``` + +Response: `null` + ## Create @@ -300,63 +340,63 @@ Response: `{}` ### DealsConsiderOfflineRetrievalDeals -There are not yet any comments for this method. -Perms: read + +Perms: admin Inputs: `null` Response: `true` ### DealsConsiderOfflineStorageDeals -There are not yet any comments for this method. -Perms: read + +Perms: admin Inputs: `null` Response: `true` ### DealsConsiderOnlineRetrievalDeals -There are not yet any comments for this method. -Perms: read + +Perms: admin Inputs: `null` Response: `true` ### DealsConsiderOnlineStorageDeals -There are not yet any comments for this method. -Perms: read + +Perms: admin Inputs: `null` Response: `true` ### DealsConsiderUnverifiedStorageDeals -There are not yet any comments for this method. -Perms: read + +Perms: admin Inputs: `null` Response: `true` ### DealsConsiderVerifiedStorageDeals -There are not yet any comments for this method. -Perms: read + +Perms: admin Inputs: `null` Response: `true` ### DealsImportData -There are not yet any comments for this method. -Perms: write + +Perms: admin Inputs: ```json @@ -371,25 +411,25 @@ Inputs: Response: `{}` ### DealsList -There are not yet any comments for this method. -Perms: read + +Perms: admin Inputs: `null` Response: `null` ### DealsPieceCidBlocklist -There are not yet any comments for this method. -Perms: read + +Perms: admin Inputs: `null` Response: `null` ### DealsSetConsiderOfflineRetrievalDeals -There are not yet any comments for this method. + Perms: admin @@ -403,7 +443,7 @@ Inputs: Response: `{}` ### DealsSetConsiderOfflineStorageDeals -There are not yet any comments for this method. + Perms: admin @@ -417,7 +457,7 @@ Inputs: Response: `{}` ### DealsSetConsiderOnlineRetrievalDeals -There are not yet any comments for this method. + Perms: admin @@ -431,7 +471,7 @@ Inputs: Response: `{}` ### DealsSetConsiderOnlineStorageDeals -There are not yet any comments for this method. + Perms: admin @@ -445,7 +485,7 @@ Inputs: Response: `{}` ### DealsSetConsiderUnverifiedStorageDeals -There are not yet any comments for this method. + Perms: admin @@ -459,7 +499,7 @@ Inputs: Response: `{}` ### DealsSetConsiderVerifiedStorageDeals -There are not yet any comments for this method. + Perms: admin @@ -473,7 +513,7 @@ Inputs: Response: `{}` ### DealsSetPieceCidBlocklist -There are not yet any comments for this method. + Perms: admin @@ -546,7 +586,7 @@ Inputs: Response: `{}` ### MarketDataTransferUpdates -There are not yet any comments for this method. + Perms: write @@ -565,12 +605,15 @@ Response: "Voucher": "string value", "Message": "string value", "OtherPeer": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "Transferred": 42 + "Transferred": 42, + "Stages": { + "Stages": null + } } ``` ### MarketGetAsk -There are not yet any comments for this method. + Perms: read @@ -597,7 +640,7 @@ Response: ``` ### MarketGetDealUpdates -There are not yet any comments for this method. + Perms: read @@ -662,7 +705,7 @@ Response: ``` ### MarketGetRetrievalAsk -There are not yet any comments for this method. + Perms: read @@ -679,7 +722,7 @@ Response: ``` ### MarketImportDealData -There are not yet any comments for this method. + Perms: write @@ -696,7 +739,7 @@ Inputs: Response: `{}` ### MarketListDataTransfers -There are not yet any comments for this method. + Perms: write @@ -705,7 +748,7 @@ Inputs: `null` Response: `null` ### MarketListDeals -There are not yet any comments for this method. + Perms: read @@ -714,7 +757,7 @@ Inputs: `null` Response: `null` ### MarketListIncompleteDeals -There are not yet any comments for this method. + Perms: read @@ -723,7 +766,7 @@ Inputs: `null` Response: `null` ### MarketListRetrievalDeals -There are not yet any comments for this method. + Perms: read @@ -732,7 +775,7 @@ Inputs: `null` Response: `null` ### MarketPendingDeals -There are not yet any comments for this method. + Perms: write @@ -748,7 +791,7 @@ Response: ``` ### MarketPublishPendingDeals -There are not yet any comments for this method. + Perms: admin @@ -774,7 +817,7 @@ Inputs: Response: `{}` ### MarketSetAsk -There are not yet any comments for this method. + Perms: admin @@ -792,7 +835,7 @@ Inputs: Response: `{}` ### MarketSetRetrievalAsk -There are not yet any comments for this method. + Perms: admin @@ -814,7 +857,7 @@ Response: `{}` ### MiningBase -There are not yet any comments for this method. + Perms: read @@ -1102,7 +1145,7 @@ Response: `null` ### PiecesGetCIDInfo -There are not yet any comments for this method. + Perms: read @@ -1126,7 +1169,7 @@ Response: ``` ### PiecesGetPieceInfo -There are not yet any comments for this method. + Perms: read @@ -1150,7 +1193,7 @@ Response: ``` ### PiecesListCidInfos -There are not yet any comments for this method. + Perms: read @@ -1159,7 +1202,7 @@ Inputs: `null` Response: `null` ### PiecesListPieces -There are not yet any comments for this method. + Perms: read @@ -1190,6 +1233,7 @@ Response: ### ReturnAddPiece +storiface.WorkerReturn Perms: admin @@ -1475,7 +1519,7 @@ Response: `{}` ### SealingAbort -There are not yet any comments for this method. + Perms: admin @@ -1534,7 +1578,7 @@ Inputs: `null` Response: `60000000000` ### SectorMarkForUpgrade -There are not yet any comments for this method. + Perms: admin @@ -1688,7 +1732,7 @@ Response: ``` ### SectorsRefs -There are not yet any comments for this method. + Perms: read @@ -1771,7 +1815,7 @@ Response: ``` ### SectorsUpdate -There are not yet any comments for this method. + Perms: admin @@ -1789,7 +1833,7 @@ Response: `{}` ### StorageAddLocal -There are not yet any comments for this method. + Perms: admin @@ -1803,6 +1847,7 @@ Inputs: Response: `{}` ### StorageAttach +stores.SectorIndex Perms: admin @@ -1931,7 +1976,7 @@ Response: ``` ### StorageList -There are not yet any comments for this method. + Perms: admin @@ -1951,7 +1996,7 @@ Response: ``` ### StorageLocal -There are not yet any comments for this method. + Perms: admin @@ -2009,7 +2054,7 @@ Inputs: Response: `{}` ### StorageStat -There are not yet any comments for this method. + Perms: admin @@ -2070,7 +2115,7 @@ Inputs: Response: `{}` ### WorkerJobs -There are not yet any comments for this method. + Perms: admin @@ -2102,7 +2147,7 @@ Response: ``` ### WorkerStats -There are not yet any comments for this method. + Perms: admin diff --git a/documentation/en/api-methods-worker.md b/documentation/en/api-methods-worker.md index f86fa52e0..40300866e 100644 --- a/documentation/en/api-methods-worker.md +++ b/documentation/en/api-methods-worker.md @@ -40,7 +40,7 @@ ### Enabled -There are not yet any comments for this method. + Perms: admin @@ -81,7 +81,7 @@ Response: ``` ### Info -There are not yet any comments for this method. + Perms: admin @@ -102,7 +102,7 @@ Response: ``` ### Paths -There are not yet any comments for this method. + Perms: admin @@ -139,7 +139,6 @@ Inputs: `null` Response: `"07070707-0707-0707-0707-070707070707"` ### Version -TODO: Info() (name, ...) ? Perms: admin @@ -152,6 +151,7 @@ Response: `65792` ### AddPiece +storiface.WorkerCalls Perms: admin @@ -488,7 +488,7 @@ Response: `{}` ### StorageAddLocal -There are not yet any comments for this method. + Perms: admin @@ -505,7 +505,7 @@ Response: `{}` ### TaskDisable -There are not yet any comments for this method. + Perms: admin @@ -519,7 +519,7 @@ Inputs: Response: `{}` ### TaskEnable -There are not yet any comments for this method. + Perms: admin diff --git a/documentation/en/api-methods.md b/documentation/en/api-methods.md index 49afeeb1a..2830be0bd 100644 --- a/documentation/en/api-methods.md +++ b/documentation/en/api-methods.md @@ -1,6 +1,7 @@ # Groups * [](#) * [Closing](#Closing) + * [Discover](#Discover) * [Session](#Session) * [Shutdown](#Shutdown) * [Version](#Version) @@ -34,6 +35,7 @@ * [Client](#Client) * [ClientCalcCommP](#ClientCalcCommP) * [ClientCancelDataTransfer](#ClientCancelDataTransfer) + * [ClientCancelRetrievalDeal](#ClientCancelRetrievalDeal) * [ClientDataTransferUpdates](#ClientDataTransferUpdates) * [ClientDealPieceCID](#ClientDealPieceCID) * [ClientDealSize](#ClientDealSize) @@ -226,6 +228,25 @@ Inputs: `null` Response: `{}` +### Discover + + +Perms: read + +Inputs: `null` + +Response: +```json +{ + "info": { + "title": "Lotus RPC API", + "version": "1.2.1/generated=2020-11-22T08:22:42-06:00" + }, + "methods": [], + "openrpc": "1.2.6" +} +``` + ### Session @@ -425,6 +446,17 @@ Response: ### ChainGetBlockMessages ChainGetBlockMessages returns messages stored in the specified block. +Note: If there are multiple blocks in a tipset, it's likely that some +messages will be duplicated. It's also possible for blocks in a tipset to have +different messages from the same sender at the same nonce. When that happens, +only the first message (in a block with lowest ticket) will be considered +for execution + +NOTE: THIS METHOD SHOULD ONLY BE USED FOR GETTING MESSAGES IN A SPECIFIC BLOCK + +DO NOT USE THIS METHOD TO GET MESSAGES INCLUDED IN A TIPSET +Use ChainGetParentMessages, which will perform correct message deduplication + Perms: read @@ -499,7 +531,7 @@ Response: ``` ### ChainGetNode -There are not yet any comments for this method. + Perms: read @@ -540,7 +572,8 @@ Response: `null` ### ChainGetParentReceipts ChainGetParentReceipts returns receipts for messages in parent tipset of -the specified block. +the specified block. The receipts in the list returned is one-to-one with the +messages returned by a call to ChainGetParentMessages with the same blockCid. Perms: read @@ -853,7 +886,7 @@ retrieval markets as a client ClientCalcCommP calculates the CommP for a specified file -Perms: read +Perms: write Inputs: ```json @@ -889,8 +922,23 @@ Inputs: Response: `{}` +### ClientCancelRetrievalDeal +ClientCancelRetrievalDeal cancels an ongoing retrieval deal based on DealID + + +Perms: write + +Inputs: +```json +[ + 5 +] +``` + +Response: `{}` + ### ClientDataTransferUpdates -There are not yet any comments for this method. + Perms: write @@ -909,7 +957,10 @@ Response: "Voucher": "string value", "Message": "string value", "OtherPeer": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "Transferred": 42 + "Transferred": 42, + "Stages": { + "Stages": null + } } ``` @@ -1022,6 +1073,9 @@ Response: }, "State": 42, "Message": "string value", + "DealStages": { + "Stages": null + }, "Provider": "f01234", "DataRef": { "TransferType": "string value", @@ -1057,7 +1111,10 @@ Response: "Voucher": "string value", "Message": "string value", "OtherPeer": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "Transferred": 42 + "Transferred": 42, + "Stages": { + "Stages": null + } } } ``` @@ -1081,7 +1138,7 @@ Response: `"string value"` ClientGetDealUpdates returns the status of updated deals -Perms: read +Perms: write Inputs: `null` @@ -1093,6 +1150,9 @@ Response: }, "State": 42, "Message": "string value", + "DealStages": { + "Stages": null + }, "Provider": "f01234", "DataRef": { "TransferType": "string value", @@ -1128,7 +1188,10 @@ Response: "Voucher": "string value", "Message": "string value", "OtherPeer": "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf", - "Transferred": 42 + "Transferred": 42, + "Stages": { + "Stages": null + } } } ``` @@ -1320,6 +1383,7 @@ Inputs: }, "Piece": null, "Size": 42, + "LocalStore": 12, "Total": "0", "UnsealPrice": "0", "PaymentInterval": 42, @@ -1373,6 +1437,7 @@ Inputs: }, "Piece": null, "Size": 42, + "LocalStore": 12, "Total": "0", "UnsealPrice": "0", "PaymentInterval": 42, @@ -1762,7 +1827,7 @@ Response: ### MinerCreateBlock -There are not yet any comments for this method. + Perms: write @@ -2178,7 +2243,7 @@ Response: `null` MpoolSetConfig sets the mpool config to (a copy of) the supplied config -Perms: write +Perms: admin Inputs: ```json @@ -2197,7 +2262,7 @@ Inputs: Response: `{}` ### MpoolSub -There are not yet any comments for this method. + Perms: read @@ -2943,7 +3008,7 @@ The Paych methods are for interacting with and managing payment channels ### PaychAllocateLane -There are not yet any comments for this method. + Perms: sign @@ -2957,7 +3022,7 @@ Inputs: Response: `42` ### PaychAvailableFunds -There are not yet any comments for this method. + Perms: sign @@ -2983,7 +3048,7 @@ Response: ``` ### PaychAvailableFundsByFromTo -There are not yet any comments for this method. + Perms: sign @@ -3010,7 +3075,7 @@ Response: ``` ### PaychCollect -There are not yet any comments for this method. + Perms: sign @@ -3053,7 +3118,7 @@ Response: ``` ### PaychGetWaitReady -There are not yet any comments for this method. + Perms: sign @@ -3069,7 +3134,7 @@ Inputs: Response: `"f01234"` ### PaychList -There are not yet any comments for this method. + Perms: read @@ -3078,7 +3143,7 @@ Inputs: `null` Response: `null` ### PaychNewPayment -There are not yet any comments for this method. + Perms: sign @@ -3103,7 +3168,7 @@ Response: ``` ### PaychSettle -There are not yet any comments for this method. + Perms: sign @@ -3122,7 +3187,7 @@ Response: ``` ### PaychStatus -There are not yet any comments for this method. + Perms: read @@ -3142,7 +3207,7 @@ Response: ``` ### PaychVoucherAdd -There are not yet any comments for this method. + Perms: write @@ -3178,7 +3243,7 @@ Inputs: Response: `"0"` ### PaychVoucherCheckSpendable -There are not yet any comments for this method. + Perms: read @@ -3214,7 +3279,7 @@ Inputs: Response: `true` ### PaychVoucherCheckValid -There are not yet any comments for this method. + Perms: read @@ -3248,7 +3313,7 @@ Inputs: Response: `{}` ### PaychVoucherCreate -There are not yet any comments for this method. + Perms: sign @@ -3289,7 +3354,7 @@ Response: ``` ### PaychVoucherList -There are not yet any comments for this method. + Perms: write @@ -3303,7 +3368,7 @@ Inputs: Response: `null` ### PaychVoucherSubmit -There are not yet any comments for this method. + Perms: sign @@ -3565,6 +3630,36 @@ Response: `"0"` StateCompute is a flexible command that applies the given messages on the given tipset. The messages are run as though the VM were at the provided height. +When called, StateCompute will: +- Load the provided tipset, or use the current chain head if not provided +- Compute the tipset state of the provided tipset on top of the parent state + - (note that this step runs before vmheight is applied to the execution) + - Execute state upgrade if any were scheduled at the epoch, or in null + blocks preceding the tipset + - Call the cron actor on null blocks preceding the tipset + - For each block in the tipset + - Apply messages in blocks in the specified + - Award block reward by calling the reward actor + - Call the cron actor for the current epoch +- If the specified vmheight is higher than the current epoch, apply any + needed state upgrades to the state +- Apply the specified messages to the state + +The vmheight parameter sets VM execution epoch, and can be used to simulate +message execution in different network versions. If the specified vmheight +epoch is higher than the epoch of the specified tipset, any state upgrades +until the vmheight will be executed on the state before applying messages +specified by the user. + +Note that the initial tipset state computation is not affected by the +vmheight parameter - only the messages in the `apply` set are + +If the caller wants to simply compute the state, vmheight should be set to +the epoch of the specified tipset. + +Messages in the `apply` parameter must have the correct nonces, and gas +values set. + Perms: read @@ -3686,7 +3781,15 @@ Response: ``` ### StateGetReceipt -StateGetReceipt returns the message receipt for the given message +StateGetReceipt returns the message receipt for the given message or for a +matching gas-repriced replacing message + +NOTE: If the requested message was replaced, this method will return the receipt +for the replacing message - if the caller needs the receipt for exactly the +requested message, use StateSearchMsg().Receipt, and check that MsgLookup.Message +is matching the requested CID + +DEPRECATED: Use StateSearchMsg, this method won't be supported in v1 API Perms: read @@ -4450,7 +4553,22 @@ Response: ### StateReplay StateReplay replays a given message, assuming it was included in a block in the specified tipset. -If no tipset key is provided, the appropriate tipset is looked up. + +If a tipset key is provided, and a replacing message is found on chain, +the method will return an error saying that the message wasn't found + +If no tipset key is provided, the appropriate tipset is looked up, and if +the message was gas-repriced, the on-chain message will be replayed - in +that case the returned InvocResult.MsgCid will not match the Cid param + +If the caller wants to ensure that exactly the requested message was executed, +they MUST check that InvocResult.MsgCid is equal to the provided Cid. +Without this check both the requested and original message may appear as +successfully executed on-chain, which may look like a double-spend. + +A replacing message is a message with a different CID, any of Gas values, and +different signature, but with all other parameters matching (source/destination, +nonce, params, etc.) Perms: read @@ -4544,6 +4662,20 @@ Response: ### StateSearchMsg StateSearchMsg searches for a message in the chain, and returns its receipt and the tipset where it was executed +NOTE: If a replacing message is found on chain, this method will return +a MsgLookup for the replacing message - the MsgLookup.Message will be a different +CID than the one provided in the 'cid' param, MsgLookup.Receipt will contain the +result of the execution of the replacing message. + +If the caller wants to ensure that exactly the requested message was executed, +they MUST check that MsgLookup.Message is equal to the provided 'cid'. +Without this check both the requested and original message may appear as +successfully executed on-chain, which may look like a double-spend. + +A replacing message is a message with a different CID, any of Gas values, and +different signature, but with all other parameters matching (source/destination, +nonce, params, etc.) + Perms: read @@ -4583,6 +4715,20 @@ Response: ### StateSearchMsgLimited StateSearchMsgLimited looks back up to limit epochs in the chain for a message, and returns its receipt and the tipset where it was executed +NOTE: If a replacing message is found on chain, this method will return +a MsgLookup for the replacing message - the MsgLookup.Message will be a different +CID than the one provided in the 'cid' param, MsgLookup.Receipt will contain the +result of the execution of the replacing message. + +If the caller wants to ensure that exactly the requested message was executed, +they MUST check that MsgLookup.Message is equal to the provided 'cid'. +Without this check both the requested and original message may appear as +successfully executed on-chain, which may look like a double-spend. + +A replacing message is a message with a different CID, any of Gas values, and +different signature, but with all other parameters matching (source/destination, +nonce, params, etc.) + Perms: read @@ -4877,6 +5023,20 @@ Response: `"0"` StateWaitMsg looks back in the chain for a message. If not found, it blocks until the message arrives on chain, and gets to the indicated confidence depth. +NOTE: If a replacing message is found on chain, this method will return +a MsgLookup for the replacing message - the MsgLookup.Message will be a different +CID than the one provided in the 'cid' param, MsgLookup.Receipt will contain the +result of the execution of the replacing message. + +If the caller wants to ensure that exactly the requested message was executed, +they MUST check that MsgLookup.Message is equal to the provided 'cid'. +Without this check both the requested and original message may appear as +successfully executed on-chain, which may look like a double-spend. + +A replacing message is a message with a different CID, any of Gas values, and +different signature, but with all other parameters matching (source/destination, +nonce, params, etc.) + Perms: read @@ -4919,6 +5079,20 @@ StateWaitMsgLimited looks back up to limit epochs in the chain for a message. If not found, it blocks until the message arrives on chain, and gets to the indicated confidence depth. +NOTE: If a replacing message is found on chain, this method will return +a MsgLookup for the replacing message - the MsgLookup.Message will be a different +CID than the one provided in the 'cid' param, MsgLookup.Receipt will contain the +result of the execution of the replacing message. + +If the caller wants to ensure that exactly the requested message was executed, +they MUST check that MsgLookup.Message is equal to the provided 'cid'. +Without this check both the requested and original message may appear as +successfully executed on-chain, which may look like a double-spend. + +A replacing message is a message with a different CID, any of Gas values, and +different signature, but with all other parameters matching (source/destination, +nonce, params, etc.) + Perms: read @@ -5219,7 +5393,7 @@ Response: `"f01234"` WalletDelete deletes an address from the wallet. -Perms: write +Perms: admin Inputs: ```json @@ -5315,7 +5489,7 @@ Response: `"f01234"` WalletSetDefault marks the given address as as the default one. -Perms: admin +Perms: write Inputs: ```json diff --git a/extern/sector-storage/mock/mock.go b/extern/sector-storage/mock/mock.go index 82fce4b19..17e969758 100644 --- a/extern/sector-storage/mock/mock.go +++ b/extern/sector-storage/mock/mock.go @@ -325,6 +325,8 @@ func (mgr *SectorMgr) GenerateWindowPoSt(ctx context.Context, minerID abi.ActorI } func generateFakePoStProof(sectorInfo []proof2.SectorInfo, randomness abi.PoStRandomness) []byte { + randomness[31] &= 0x3f + hasher := sha256.New() _, _ = hasher.Write(randomness) for _, info := range sectorInfo { @@ -489,6 +491,7 @@ func (m mockVerif) VerifySeal(svi proof2.SealVerifyInfo) (bool, error) { } func (m mockVerif) VerifyWinningPoSt(ctx context.Context, info proof2.WinningPoStVerifyInfo) (bool, error) { + info.Randomness[31] &= 0x3f return true, nil } diff --git a/extern/sector-storage/stores/http_handler.go b/extern/sector-storage/stores/http_handler.go index a4c0480d4..3e3468470 100644 --- a/extern/sector-storage/stores/http_handler.go +++ b/extern/sector-storage/stores/http_handler.go @@ -116,9 +116,16 @@ func (handler *FetchHandler) remoteGetSector(w http.ResponseWriter, r *http.Requ w.WriteHeader(500) return } + if !stat.IsDir() { + defer func() { + if err := rd.(*os.File).Close(); err != nil { + log.Errorf("closing source file: %+v", err) + } + }() + } w.WriteHeader(200) - if _, err := io.Copy(w, rd); err != nil { // TODO: default 32k buf may be too small + if _, err := io.CopyBuffer(w, rd, make([]byte, CopyBuf)); err != nil { log.Errorf("%+v", err) return } diff --git a/extern/sector-storage/stores/local.go b/extern/sector-storage/stores/local.go index a7df5ae21..5837b711c 100644 --- a/extern/sector-storage/stores/local.go +++ b/extern/sector-storage/stores/local.go @@ -392,8 +392,10 @@ func (st *Local) Reserve(ctx context.Context, sid storage.SectorRef, ft storifac } p.reserved += overhead + p.reservations[sid.ID] |= fileType prevDone := done + saveFileType := fileType done = func() { prevDone() @@ -401,6 +403,10 @@ func (st *Local) Reserve(ctx context.Context, sid storage.SectorRef, ft storifac defer st.localLk.Unlock() p.reserved -= overhead + p.reservations[sid.ID] ^= saveFileType + if p.reservations[sid.ID] == storiface.FTNone { + delete(p.reservations, sid.ID) + } } } diff --git a/extern/storage-sealing/checks.go b/extern/storage-sealing/checks.go index db2e87d0e..5ee39e58f 100644 --- a/extern/storage-sealing/checks.go +++ b/extern/storage-sealing/checks.go @@ -4,7 +4,6 @@ import ( "bytes" "context" - "github.com/filecoin-project/lotus/chain/actors" "github.com/filecoin-project/lotus/chain/actors/policy" proof2 "github.com/filecoin-project/specs-actors/v2/actors/runtime/proof" @@ -94,14 +93,9 @@ func checkPrecommit(ctx context.Context, maddr address.Address, si SectorInfo, t return &ErrBadCommD{xerrors.Errorf("on chain CommD differs from sector: %s != %s", commD, si.CommD)} } - nv, err := api.StateNetworkVersion(ctx, tok) - if err != nil { - return &ErrApi{xerrors.Errorf("calling StateNetworkVersion: %w", err)} - } + ticketEarliest := height - policy.MaxPreCommitRandomnessLookback - msd := policy.GetMaxProveCommitDuration(actors.VersionForNetwork(nv), si.SectorType) - - if height-(si.TicketEpoch+policy.SealRandomnessLookback) > msd { + if si.TicketEpoch < ticketEarliest { return &ErrExpiredTicket{xerrors.Errorf("ticket expired: seal height: %d, head: %d", si.TicketEpoch+policy.SealRandomnessLookback, height)} } diff --git a/extern/storage-sealing/fsm.go b/extern/storage-sealing/fsm.go index fd6b32001..7b60efa68 100644 --- a/extern/storage-sealing/fsm.go +++ b/extern/storage-sealing/fsm.go @@ -300,7 +300,9 @@ func (m *Sealing) plan(events []statemachine.Event, state *SectorInfo) (func(sta */ - m.stats.updateSector(m.minerSectorID(state.SectorNumber), state.State) + if err := m.onUpdateSector(context.TODO(), state); err != nil { + log.Errorw("update sector stats", "error", err) + } switch state.State { // Happy path @@ -391,6 +393,37 @@ func (m *Sealing) plan(events []statemachine.Event, state *SectorInfo) (func(sta return nil, processed, nil } +func (m *Sealing) onUpdateSector(ctx context.Context, state *SectorInfo) error { + if m.getConfig == nil { + return nil // tests + } + + cfg, err := m.getConfig() + if err != nil { + return xerrors.Errorf("getting config: %w", err) + } + sp, err := m.currentSealProof(ctx) + if err != nil { + return xerrors.Errorf("getting seal proof type: %w", err) + } + + shouldUpdateInput := m.stats.updateSector(cfg, m.minerSectorID(state.SectorNumber), state.State) + + // trigger more input processing when we've dipped below max sealing limits + if shouldUpdateInput { + go func() { + m.inputLk.Lock() + defer m.inputLk.Unlock() + + if err := m.updateInput(ctx, sp); err != nil { + log.Errorf("%+v", err) + } + }() + } + + return nil +} + func planCommitting(events []statemachine.Event, state *SectorInfo) (uint64, error) { for i, event := range events { switch e := event.User.(type) { diff --git a/extern/storage-sealing/garbage.go b/extern/storage-sealing/garbage.go index 398040e6e..c8ec21a84 100644 --- a/extern/storage-sealing/garbage.go +++ b/extern/storage-sealing/garbage.go @@ -28,18 +28,13 @@ func (m *Sealing) PledgeSector(ctx context.Context) (storage.SectorRef, error) { return storage.SectorRef{}, xerrors.Errorf("getting seal proof type: %w", err) } - sid, err := m.sc.Next() + sid, err := m.createSector(ctx, cfg, spt) if err != nil { - return storage.SectorRef{}, xerrors.Errorf("generating sector number: %w", err) - } - sectorID := m.minerSector(spt, sid) - err = m.sealer.NewSector(ctx, sectorID) - if err != nil { - return storage.SectorRef{}, xerrors.Errorf("notifying sealer of the new sector: %w", err) + return storage.SectorRef{}, err } log.Infof("Creating CC sector %d", sid) - return sectorID, m.sectors.Send(uint64(sid), SectorStartCC{ + return m.minerSector(spt, sid), m.sectors.Send(uint64(sid), SectorStartCC{ ID: sid, SectorType: spt, }) diff --git a/extern/storage-sealing/input.go b/extern/storage-sealing/input.go index 564afbc88..44d2e8275 100644 --- a/extern/storage-sealing/input.go +++ b/extern/storage-sealing/input.go @@ -16,6 +16,7 @@ import ( sectorstorage "github.com/filecoin-project/lotus/extern/sector-storage" "github.com/filecoin-project/lotus/extern/sector-storage/ffiwrapper" + "github.com/filecoin-project/lotus/extern/storage-sealing/sealiface" ) func (m *Sealing) handleWaitDeals(ctx statemachine.Context, sector SectorInfo) error { @@ -388,16 +389,9 @@ func (m *Sealing) tryCreateDealSector(ctx context.Context, sp abi.RegisteredSeal return nil } - // Now actually create a new sector - - sid, err := m.sc.Next() + sid, err := m.createSector(ctx, cfg, sp) if err != nil { - return xerrors.Errorf("getting sector number: %w", err) - } - - err = m.sealer.NewSector(ctx, m.minerSector(sp, sid)) - if err != nil { - return xerrors.Errorf("initializing sector: %w", err) + return err } log.Infow("Creating sector", "number", sid, "type", "deal", "proofType", sp) @@ -407,6 +401,26 @@ func (m *Sealing) tryCreateDealSector(ctx context.Context, sp abi.RegisteredSeal }) } +// call with m.inputLk +func (m *Sealing) createSector(ctx context.Context, cfg sealiface.Config, sp abi.RegisteredSealProof) (abi.SectorNumber, error) { + // Now actually create a new sector + + sid, err := m.sc.Next() + if err != nil { + return 0, xerrors.Errorf("getting sector number: %w", err) + } + + err = m.sealer.NewSector(ctx, m.minerSector(sp, sid)) + if err != nil { + return 0, xerrors.Errorf("initializing sector: %w", err) + } + + // update stats early, fsm planner would do that async + m.stats.updateSector(cfg, m.minerSectorID(sid), UndefinedSectorState) + + return sid, nil +} + func (m *Sealing) StartPacking(sid abi.SectorNumber) error { return m.sectors.Send(uint64(sid), SectorStartPacking{}) } diff --git a/extern/storage-sealing/states_sealing.go b/extern/storage-sealing/states_sealing.go index f5bb4cae6..e371ab33f 100644 --- a/extern/storage-sealing/states_sealing.go +++ b/extern/storage-sealing/states_sealing.go @@ -12,7 +12,6 @@ import ( "github.com/filecoin-project/go-state-types/crypto" "github.com/filecoin-project/go-state-types/exitcode" "github.com/filecoin-project/go-statemachine" - builtin0 "github.com/filecoin-project/specs-actors/actors/builtin" "github.com/filecoin-project/specs-storage/storage" "github.com/filecoin-project/lotus/api" @@ -22,7 +21,7 @@ import ( ) var DealSectorPriority = 1024 -var MaxTicketAge = abi.ChainEpoch(builtin0.EpochsInDay * 2) +var MaxTicketAge = policy.MaxPreCommitRandomnessLookback func (m *Sealing) handlePacking(ctx statemachine.Context, sector SectorInfo) error { m.inputLk.Lock() diff --git a/extern/storage-sealing/stats.go b/extern/storage-sealing/stats.go index 108529375..2688d8494 100644 --- a/extern/storage-sealing/stats.go +++ b/extern/storage-sealing/stats.go @@ -4,6 +4,7 @@ import ( "sync" "github.com/filecoin-project/go-state-types/abi" + "github.com/filecoin-project/lotus/extern/storage-sealing/sealiface" ) type statSectorState int @@ -23,10 +24,14 @@ type SectorStats struct { totals [nsst]uint64 } -func (ss *SectorStats) updateSector(id abi.SectorID, st SectorState) { +func (ss *SectorStats) updateSector(cfg sealiface.Config, id abi.SectorID, st SectorState) (updateInput bool) { ss.lk.Lock() defer ss.lk.Unlock() + preSealing := ss.curSealingLocked() + preStaging := ss.curStagingLocked() + + // update totals oldst, found := ss.bySector[id] if found { ss.totals[oldst]-- @@ -35,6 +40,34 @@ func (ss *SectorStats) updateSector(id abi.SectorID, st SectorState) { sst := toStatState(st) ss.bySector[id] = sst ss.totals[sst]++ + + // check if we may need be able to process more deals + sealing := ss.curSealingLocked() + staging := ss.curStagingLocked() + + log.Debugw("sector stats", "sealing", sealing, "staging", staging) + + if cfg.MaxSealingSectorsForDeals > 0 && // max sealing deal sector limit set + preSealing >= cfg.MaxSealingSectorsForDeals && // we were over limit + sealing < cfg.MaxSealingSectorsForDeals { // and we're below the limit now + updateInput = true + } + + if cfg.MaxWaitDealsSectors > 0 && // max waiting deal sector limit set + preStaging >= cfg.MaxWaitDealsSectors && // we were over limit + staging < cfg.MaxWaitDealsSectors { // and we're below the limit now + updateInput = true + } + + return updateInput +} + +func (ss *SectorStats) curSealingLocked() uint64 { + return ss.totals[sstStaging] + ss.totals[sstSealing] + ss.totals[sstFailed] +} + +func (ss *SectorStats) curStagingLocked() uint64 { + return ss.totals[sstStaging] } // return the number of sectors currently in the sealing pipeline @@ -42,7 +75,7 @@ func (ss *SectorStats) curSealing() uint64 { ss.lk.Lock() defer ss.lk.Unlock() - return ss.totals[sstStaging] + ss.totals[sstSealing] + ss.totals[sstFailed] + return ss.curSealingLocked() } // return the number of sectors waiting to enter the sealing pipeline @@ -50,5 +83,5 @@ func (ss *SectorStats) curStaging() uint64 { ss.lk.Lock() defer ss.lk.Unlock() - return ss.totals[sstStaging] + return ss.curStagingLocked() } diff --git a/gen/api/proxygen.go b/gen/api/proxygen.go new file mode 100644 index 000000000..42aed0965 --- /dev/null +++ b/gen/api/proxygen.go @@ -0,0 +1,297 @@ +package main + +import ( + "fmt" + "go/ast" + "go/parser" + "go/token" + "io" + "os" + "path/filepath" + "strings" + "text/template" + "unicode" + + "golang.org/x/xerrors" +) + +type methodMeta struct { + node ast.Node + ftype *ast.FuncType +} + +type Visitor struct { + Methods map[string]map[string]*methodMeta + Include map[string][]string +} + +func (v *Visitor) Visit(node ast.Node) ast.Visitor { + st, ok := node.(*ast.TypeSpec) + if !ok { + return v + } + + iface, ok := st.Type.(*ast.InterfaceType) + if !ok { + return v + } + if v.Methods[st.Name.Name] == nil { + v.Methods[st.Name.Name] = map[string]*methodMeta{} + } + for _, m := range iface.Methods.List { + switch ft := m.Type.(type) { + case *ast.Ident: + v.Include[st.Name.Name] = append(v.Include[st.Name.Name], ft.Name) + case *ast.FuncType: + v.Methods[st.Name.Name][m.Names[0].Name] = &methodMeta{ + node: m, + ftype: ft, + } + } + } + + return v +} +func main() { + if err := runMain(); err != nil { + fmt.Println("error: ", err) + } +} + +func typeName(e ast.Expr) (string, error) { + switch t := e.(type) { + case *ast.SelectorExpr: + return t.X.(*ast.Ident).Name + "." + t.Sel.Name, nil + case *ast.Ident: + pstr := t.Name + if !unicode.IsLower(rune(pstr[0])) { + pstr = "api." + pstr // todo src pkg name + } + return pstr, nil + case *ast.ArrayType: + subt, err := typeName(t.Elt) + if err != nil { + return "", err + } + return "[]" + subt, nil + case *ast.StarExpr: + subt, err := typeName(t.X) + if err != nil { + return "", err + } + return "*" + subt, nil + case *ast.MapType: + k, err := typeName(t.Key) + if err != nil { + return "", err + } + v, err := typeName(t.Value) + if err != nil { + return "", err + } + return "map[" + k + "]" + v, nil + case *ast.StructType: + if len(t.Fields.List) != 0 { + return "", xerrors.Errorf("can't struct") + } + return "struct{}", nil + case *ast.InterfaceType: + if len(t.Methods.List) != 0 { + return "", xerrors.Errorf("can't interface") + } + return "interface{}", nil + case *ast.ChanType: + subt, err := typeName(t.Value) + if err != nil { + return "", err + } + if t.Dir == ast.SEND { + subt = "->chan " + subt + } else { + subt = "<-chan " + subt + } + return subt, nil + default: + return "", xerrors.Errorf("unknown type") + } +} + +func runMain() error { + fset := token.NewFileSet() + apiDir, err := filepath.Abs("./api") + if err != nil { + return err + } + pkgs, err := parser.ParseDir(fset, apiDir, nil, parser.AllErrors|parser.ParseComments) + if err != nil { + return err + } + + ap := pkgs["api"] + + v := &Visitor{make(map[string]map[string]*methodMeta), map[string][]string{}} + ast.Walk(v, ap) + + type methodInfo struct { + Name string + node ast.Node + Tags map[string][]string + NamedParams, ParamNames, Results string + } + + type strinfo struct { + Name string + Methods map[string]*methodInfo + Include []string + } + + type meta struct { + Infos map[string]*strinfo + Imports map[string]string + } + + m := &meta{ + Infos: map[string]*strinfo{}, + Imports: map[string]string{}, + } + + for fn, f := range ap.Files { + if strings.HasSuffix(fn, "gen.go") { + continue + } + + //fmt.Println("F:", fn) + cmap := ast.NewCommentMap(fset, f, f.Comments) + + for _, im := range f.Imports { + m.Imports[im.Path.Value] = im.Path.Value + } + + for ifname, methods := range v.Methods { + if _, ok := m.Infos[ifname]; !ok { + m.Infos[ifname] = &strinfo{ + Name: ifname, + Methods: map[string]*methodInfo{}, + Include: v.Include[ifname], + } + } + info := m.Infos[ifname] + for mname, node := range methods { + filteredComments := cmap.Filter(node.node).Comments() + + if _, ok := info.Methods[mname]; !ok { + var params, pnames []string + for _, param := range node.ftype.Params.List { + pstr, err := typeName(param.Type) + if err != nil { + return err + } + + c := len(param.Names) + if c == 0 { + c = 1 + } + + for i := 0; i < c; i++ { + pname := fmt.Sprintf("p%d", len(params)) + pnames = append(pnames, pname) + params = append(params, pname+" "+pstr) + } + } + + var results []string + for _, result := range node.ftype.Results.List { + rs, err := typeName(result.Type) + if err != nil { + return err + } + results = append(results, rs) + } + + info.Methods[mname] = &methodInfo{ + Name: mname, + node: node.node, + Tags: map[string][]string{}, + NamedParams: strings.Join(params, ", "), + ParamNames: strings.Join(pnames, ", "), + Results: strings.Join(results, ", "), + } + } + + // try to parse tag info + if len(filteredComments) > 0 { + tagstr := filteredComments[len(filteredComments)-1].List[0].Text + tagstr = strings.TrimPrefix(tagstr, "//") + tl := strings.Split(strings.TrimSpace(tagstr), " ") + for _, ts := range tl { + tf := strings.Split(ts, ":") + if len(tf) != 2 { + continue + } + if tf[0] != "perm" { // todo: allow more tag types + continue + } + info.Methods[mname].Tags[tf[0]] = tf + } + } + } + } + } + + /*jb, err := json.MarshalIndent(Infos, "", " ") + if err != nil { + return err + } + fmt.Println(string(jb))*/ + + w := os.Stdout + + err = doTemplate(w, m, `// Code generated by github.com/filecoin-project/lotus/gen/api. DO NOT EDIT. + +package apistruct + +import ( +{{range .Imports}}{{.}} +{{end}} +) +`) + if err != nil { + return err + } + + err = doTemplate(w, m, ` +{{range .Infos}} +type {{.Name}}Struct struct { +{{range .Include}} + {{.}}Struct +{{end}} + Internal struct { +{{range .Methods}} + {{.Name}} func({{.NamedParams}}) ({{.Results}}) `+"`"+`{{range .Tags}}{{index . 0}}:"{{index . 1}}"{{end}}`+"`"+` +{{end}} + } +} +{{end}} + +{{range .Infos}} +{{$name := .Name}} +{{range .Methods}} +func (s *{{$name}}Struct) {{.Name}}({{.NamedParams}}) ({{.Results}}) { + return s.Internal.{{.Name}}({{.ParamNames}}) +} +{{end}} +{{end}} + +{{range .Infos}}var _ api.{{.Name}} = new({{.Name}}Struct) +{{end}} + +`) + return err +} + +func doTemplate(w io.Writer, info interface{}, templ string) error { + t := template.Must(template.New(""). + Funcs(template.FuncMap{}).Parse(templ)) + + return t.Execute(w, info) +} diff --git a/go.mod b/go.mod index dd042eaeb..fa564df80 100644 --- a/go.mod +++ b/go.mod @@ -10,6 +10,7 @@ require ( github.com/Gurpartap/async v0.0.0-20180927173644-4f7f499dd9ee github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d // indirect github.com/acarl005/stripansi v0.0.0-20180116102854-5a71ef0e047d + github.com/alecthomas/jsonschema v0.0.0-20200530073317-71f438968921 github.com/buger/goterm v0.0.0-20200322175922-2f3e71b85129 github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e github.com/cockroachdb/pebble v0.0.0-20201001221639-879f3bfeef07 @@ -22,24 +23,25 @@ require ( github.com/dustin/go-humanize v1.0.0 github.com/elastic/go-sysinfo v1.3.0 github.com/elastic/gosigar v0.12.0 + github.com/etclabscore/go-openrpc-reflect v0.0.36 github.com/fatih/color v1.9.0 github.com/filecoin-project/filecoin-ffi v0.30.4-0.20200910194244-f640612a1a1f github.com/filecoin-project/go-address v0.0.5 github.com/filecoin-project/go-amt-ipld/v2 v2.1.1-0.20201006184820-924ee87a1349 // indirect github.com/filecoin-project/go-bitfield v0.2.4 github.com/filecoin-project/go-cbor-util v0.0.0-20191219014500-08c40a1e63a2 - github.com/filecoin-project/go-commp-utils v0.0.0-20201119054358-b88f7a96a434 + github.com/filecoin-project/go-commp-utils v0.1.0 github.com/filecoin-project/go-crypto v0.0.0-20191218222705-effae4ea9f03 - github.com/filecoin-project/go-data-transfer v1.2.7 + github.com/filecoin-project/go-data-transfer v1.4.1 github.com/filecoin-project/go-fil-commcid v0.0.0-20201016201715-d41df56b4f6a - github.com/filecoin-project/go-fil-markets v1.1.9 + github.com/filecoin-project/go-fil-markets v1.2.4 github.com/filecoin-project/go-jsonrpc v0.1.4-0.20210217175800-45ea43ac2bec github.com/filecoin-project/go-multistore v0.0.3 github.com/filecoin-project/go-padreader v0.0.0-20200903213702-ed5fae088b20 github.com/filecoin-project/go-paramfetch v0.0.2-0.20200701152213-3e0f0afdc261 github.com/filecoin-project/go-state-types v0.1.0 github.com/filecoin-project/go-statemachine v0.0.0-20200925024713-05bd7c71fbfe - github.com/filecoin-project/go-statestore v0.1.1-0.20210311122610-6c7a5aedbdea + github.com/filecoin-project/go-statestore v0.1.1 github.com/filecoin-project/go-storedcounter v0.0.0-20200421200003-1c99c62e8a5b github.com/filecoin-project/specs-actors v0.9.13 github.com/filecoin-project/specs-actors/v2 v2.3.4 @@ -122,11 +124,13 @@ require ( github.com/multiformats/go-multibase v0.0.3 github.com/multiformats/go-multihash v0.0.14 github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e // indirect + github.com/open-rpc/meta-schema v0.0.0-20201029221707-1b72ef2ea333 github.com/opentracing/opentracing-go v1.2.0 github.com/polydawn/refmt v0.0.0-20190809202753-05966cbd336a github.com/prometheus/client_golang v1.6.0 github.com/raulk/clock v1.1.0 github.com/raulk/go-watchdog v1.0.1 + github.com/stretchr/objx v0.2.0 // indirect github.com/stretchr/testify v1.7.0 github.com/syndtr/goleveldb v1.0.0 github.com/urfave/cli/v2 v2.2.0 @@ -142,7 +146,7 @@ require ( go.uber.org/fx v1.9.0 go.uber.org/multierr v1.6.0 go.uber.org/zap v1.16.0 - golang.org/x/net v0.0.0-20201021035429-f5854403a974 + golang.org/x/net v0.0.0-20201022231255-08b38378de70 golang.org/x/sync v0.0.0-20201207232520-09787c993a3a golang.org/x/sys v0.0.0-20201119102817-f84b799fce68 golang.org/x/time v0.0.0-20191024005414-555d28b269f0 @@ -150,6 +154,7 @@ require ( gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f // indirect gopkg.in/cheggaaa/pb.v1 v1.0.28 gotest.tools v2.2.0+incompatible + honnef.co/go/tools v0.0.1-2020.1.3 // indirect ) replace github.com/filecoin-project/lotus => ./ diff --git a/go.sum b/go.sum index d8175785c..fe0050b73 100644 --- a/go.sum +++ b/go.sum @@ -42,8 +42,15 @@ 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/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/Masterminds/glide v0.13.2/go.mod h1:STyF5vcenH/rUqTEv+/hBXlSTo7KYwg2oc2f4tzPWic= +github.com/Masterminds/semver v1.4.2/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y= +github.com/Masterminds/vcs v1.13.0/go.mod h1:N09YCmOQr6RLxC6UNHzuVwAdodYbbnycGHSmwVJjcKA= github.com/OneOfOne/xxhash v1.2.2 h1:KMrpdQIwFcEqXDklaen+P1axHaj9BSKzvpUUfnHldSE= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= +github.com/PuerkitoBio/purell v1.1.1 h1:WEQqlqaGbrPkxLJWfBwQmfEAE1Z7ONdDLqrN38tNFfI= +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 v0.0.0-20190523213315-cbe66965904d h1:G0m3OIz70MZUWq3EgK3CesDbo8upS2Vm9/P3FtgI+Jk= @@ -58,6 +65,8 @@ github.com/aead/siphash v1.0.1/go.mod h1:Nywa3cDsYNNK3gaciGTWPwHt0wlpNV15vwmswBA 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= +github.com/alecthomas/jsonschema v0.0.0-20200530073317-71f438968921/go.mod h1:/n6+1/DWPltRLWL/VKyUxg6tzsl5kHUCcraimt4vr60= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= @@ -140,6 +149,7 @@ github.com/cockroachdb/redact v0.0.0-20200622112456-cd282804bbd3 h1:2+dpIJzYMSbL github.com/cockroachdb/redact v0.0.0-20200622112456-cd282804bbd3/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd h1:qMd81Ts1T2OTKmB4acZcyKaMtRnY5Y44NuXGX2GFJ1w= 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/containerd/cgroups v0.0.0-20201119153540-4cbc285b3327 h1:7grrpcfCtbZLsjtB0DgMuzs1umsJmpzaHMZ6cO6iAWw= github.com/containerd/cgroups v0.0.0-20201119153540-4cbc285b3327/go.mod h1:ZJeTFisyysqgcCdecO57Dj79RfL0LNeGiFUqLYQRYLE= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= @@ -155,6 +165,7 @@ github.com/coreos/go-systemd v0.0.0-20191104093116-d3cd4ed1dbcf/go.mod h1:F5haX7 github.com/coreos/go-systemd/v22 v22.1.0 h1:kq/SbG2BCKLkDKkjQf5OWwKWUKj1lgs3lFI4PxnR5lg= github.com/coreos/go-systemd/v22 v22.1.0/go.mod h1:xO0FLkIi5MaZafQlIrOotqXZ90ih+1atmu1JpKERPPk= 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 h1:BSKMNlYxDvnunlTymqtgONjNnaRV1sTpcovwwjF22jk= 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= @@ -223,6 +234,10 @@ github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymF 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= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/etclabscore/go-jsonschema-walk v0.0.6 h1:DrNzoKWKd8f8XB5nFGBY00IcjakRE22OTI12k+2LkyY= +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/facebookgo/atomicfile v0.0.0-20151019160806-2de1f203e7d5 h1:BBso6MBKW8ncyZLv37o+KNyy0HrrHgfnOaGQC2qvN+A= github.com/facebookgo/atomicfile v0.0.0-20151019160806-2de1f203e7d5/go.mod h1:JpoxHjuQauoxiFMl1ie8Xc/7TfLuMZ5eOCONd1sUBHg= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= @@ -240,26 +255,26 @@ github.com/filecoin-project/go-amt-ipld/v3 v3.0.0 h1:Ou/q82QeHGOhpkedvaxxzpBYuqT github.com/filecoin-project/go-amt-ipld/v3 v3.0.0/go.mod h1:Qa95YNAbtoVCTSVtX38aAC1ptBnJfPma1R/zZsKmx4o= github.com/filecoin-project/go-bitfield v0.2.0/go.mod h1:CNl9WG8hgR5mttCnUErjcQjGvuiZjRqK9rHVBsQF4oM= github.com/filecoin-project/go-bitfield v0.2.3/go.mod h1:CNl9WG8hgR5mttCnUErjcQjGvuiZjRqK9rHVBsQF4oM= -github.com/filecoin-project/go-bitfield v0.2.3/go.mod h1:CNl9WG8hgR5mttCnUErjcQjGvuiZjRqK9rHVBsQF4oM= github.com/filecoin-project/go-bitfield v0.2.4 h1:uZ7MeE+XfM5lqrHJZ93OnhQKc/rveW8p9au0C68JPgk= github.com/filecoin-project/go-bitfield v0.2.4/go.mod h1:CNl9WG8hgR5mttCnUErjcQjGvuiZjRqK9rHVBsQF4oM= github.com/filecoin-project/go-cbor-util v0.0.0-20191219014500-08c40a1e63a2 h1:av5fw6wmm58FYMgJeoB/lK9XXrgdugYiTqkdxjTy9k8= github.com/filecoin-project/go-cbor-util v0.0.0-20191219014500-08c40a1e63a2/go.mod h1:pqTiPHobNkOVM5thSRsHYjyQfq7O5QSCMhvuu9JoDlg= -github.com/filecoin-project/go-commp-utils v0.0.0-20201119054358-b88f7a96a434 h1:0kHszkYP3hgApcjl5x4rpwONhN9+j7XDobf6at5XfHs= github.com/filecoin-project/go-commp-utils v0.0.0-20201119054358-b88f7a96a434/go.mod h1:6s95K91mCyHY51RPWECZieD3SGWTqIFLf1mPOes9l5U= +github.com/filecoin-project/go-commp-utils v0.1.0 h1:PaDxoXYh1TXnnz5kA/xSObpAQwcJSUs4Szb72nuaNdk= +github.com/filecoin-project/go-commp-utils v0.1.0/go.mod h1:6s95K91mCyHY51RPWECZieD3SGWTqIFLf1mPOes9l5U= github.com/filecoin-project/go-crypto v0.0.0-20191218222705-effae4ea9f03 h1:2pMXdBnCiXjfCYx/hLqFxccPoqsSveQFxVLvNxy9bus= github.com/filecoin-project/go-crypto v0.0.0-20191218222705-effae4ea9f03/go.mod h1:+viYnvGtUTgJRdy6oaeF4MTFKAfatX071MPDPBL11EQ= github.com/filecoin-project/go-data-transfer v1.0.1/go.mod h1:UxvfUAY9v3ub0a21BSK9u3pB2aq30Y0KMsG+w9/ysyo= -github.com/filecoin-project/go-data-transfer v1.2.7 h1:WE5Cpp9eMt5BDoWOVR64QegSn6bwHQaDzyyjVU377Y0= -github.com/filecoin-project/go-data-transfer v1.2.7/go.mod h1:mvjZ+C3NkBX10JP4JMu27DCjUouHFjHwUGh+Xc4yvDA= +github.com/filecoin-project/go-data-transfer v1.4.1 h1:4GoMGEdMeDLqbKR74Q5ceZTN35nv+66JZERqQ+SjxWU= +github.com/filecoin-project/go-data-transfer v1.4.1/go.mod h1:n8kbDQXWrY1c4UgfMa9KERxNCWbOTDwdNhf2MpN9dpo= github.com/filecoin-project/go-ds-versioning v0.1.0 h1:y/X6UksYTsK8TLCI7rttCKEvl8btmWxyFMEeeWGUxIQ= github.com/filecoin-project/go-ds-versioning v0.1.0/go.mod h1:mp16rb4i2QPmxBnmanUx8i/XANp+PFCCJWiAb+VW4/s= github.com/filecoin-project/go-fil-commcid v0.0.0-20200716160307-8f644712406f/go.mod h1:Eaox7Hvus1JgPrL5+M3+h7aSPHc0cVqpSxA+TxIEpZQ= github.com/filecoin-project/go-fil-commcid v0.0.0-20201016201715-d41df56b4f6a h1:hyJ+pUm/4U4RdEZBlg6k8Ma4rDiuvqyGpoICXAxwsTg= 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-markets v1.0.5-0.20201113164554-c5eba40d5335/go.mod h1:AJySOJC00JRWEZzRG2KsfUnqEf5ITXxeX09BE9N4f9c= -github.com/filecoin-project/go-fil-markets v1.1.9 h1:sA0NIEOpy7brZaeXeNgdXg5pvHaBtD5OTRlraOUbI0w= -github.com/filecoin-project/go-fil-markets v1.1.9/go.mod h1:0yQu5gvrjFoAIyzPSSJ+xUdCG83vjInAFbTswIB5/hk= +github.com/filecoin-project/go-fil-markets v1.2.4 h1:AcNMy/XGvSdv4GjuVoeqe67Q7OvppkSx1zWEGqVHixg= +github.com/filecoin-project/go-fil-markets v1.2.4/go.mod h1:8WEpiMkwdvtHb5dXmRIWX4vz4XjkVlhxRdHJdouV1b0= 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= @@ -283,8 +298,8 @@ github.com/filecoin-project/go-state-types v0.1.0/go.mod h1:ezYnPf0bNkTsDibL/psS github.com/filecoin-project/go-statemachine v0.0.0-20200925024713-05bd7c71fbfe h1:dF8u+LEWeIcTcfUcCf3WFVlc81Fr2JKg8zPzIbBDKDw= github.com/filecoin-project/go-statemachine v0.0.0-20200925024713-05bd7c71fbfe/go.mod h1:FGwQgZAt2Gh5mjlwJUlVB62JeYdo+if0xWxSEfBD9ig= github.com/filecoin-project/go-statestore v0.1.0/go.mod h1:LFc9hD+fRxPqiHiaqUEZOinUJB4WARkRfNl10O7kTnI= -github.com/filecoin-project/go-statestore v0.1.1-0.20210311122610-6c7a5aedbdea h1:EvmiCrHRrPF2mxVMIRdtsxZGByqwT24aJLw7mdzEFxE= -github.com/filecoin-project/go-statestore v0.1.1-0.20210311122610-6c7a5aedbdea/go.mod h1:LFc9hD+fRxPqiHiaqUEZOinUJB4WARkRfNl10O7kTnI= +github.com/filecoin-project/go-statestore v0.1.1 h1:ufMFq00VqnT2CAuDpcGnwLnCX1I/c3OROw/kXVNSTZk= +github.com/filecoin-project/go-statestore v0.1.1/go.mod h1:LFc9hD+fRxPqiHiaqUEZOinUJB4WARkRfNl10O7kTnI= github.com/filecoin-project/go-storedcounter v0.0.0-20200421200003-1c99c62e8a5b h1:fkRZSPrYpk42PV3/lIXiL0LHetxde7vyYYvSsttQtfg= github.com/filecoin-project/go-storedcounter v0.0.0-20200421200003-1c99c62e8a5b/go.mod h1:Q0GQOBtKf1oE10eSXSlhN45kDBdGvEcVOqMiffqX+N8= github.com/filecoin-project/specs-actors v0.9.4/go.mod h1:BStZQzx5x7TmCkLv0Bpa07U6cPKol6fd3w9KjMPZ6Z4= @@ -333,6 +348,21 @@ github.com/go-logfmt/logfmt v0.5.0 h1:TrB8swr/68K7m9CcGut2g3UOihhbcbiMAYiuTXdEih github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= github.com/go-ole/go-ole v1.2.4 h1:nNBDSCOigTSiarFpYE9J/KtEA1IOW4CNeqT9TQDqCxI= github.com/go-ole/go-ole v1.2.4/go.mod h1:XCwSNxSkXRo4vlyPy93sltvi/qJq0jqQhjqQNIwKuxM= +github.com/go-openapi/jsonpointer v0.19.2/go.mod h1:3akKfEdA7DF1sugOqz1dVQHBcuDBPKZGEoHC/NkiQRg= +github.com/go-openapi/jsonpointer v0.19.3 h1:gihV7YNZK1iK6Tgwwsxo2rJbD1GTbdm72325Bq8FI3w= +github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= +github.com/go-openapi/jsonreference v0.19.2/go.mod h1:jMjeRr2HHw6nAVajTXJ4eiUwohSTlpa0o73RUL1owJc= +github.com/go-openapi/jsonreference v0.19.3/go.mod h1:rjx6GuL8TTa9VaixXglHmQmIL98+wF9xc8zWvFonSJ8= +github.com/go-openapi/jsonreference v0.19.4 h1:3Vw+rh13uq2JFNxgnMTGE1rnoieU9FmyE1gvnyylsYg= +github.com/go-openapi/jsonreference v0.19.4/go.mod h1:RdybgQwPxbL4UEjuAruzK1x3nE69AqPYEJeo/TWfEeg= +github.com/go-openapi/spec v0.19.7/go.mod h1:Hm2Jr4jv8G1ciIAo+frC/Ft+rR2kQDh8JHKHb3gWUSk= +github.com/go-openapi/spec v0.19.11 h1:ogU5q8dtp3MMPn59a9VRrPKVxvJHEs5P7yNMR5sNnis= +github.com/go-openapi/spec v0.19.11/go.mod h1:vqK/dIdLGCosfvYsQV3WfC7N3TiZSnGY2RZKoFK7X28= +github.com/go-openapi/swag v0.19.2/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= +github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= +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-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= github.com/go-stack/stack v1.8.0 h1:5SgMzNM5HxrEjV0ww2lTmX6E2Izsfxas4+YHWRs3Lsk= @@ -366,6 +396,7 @@ github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfb github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= github.com/golang/mock v1.4.4 h1:l75CXGRSwbaYNpl/Z2X1XIIAMSCquvXgpVZDhwEIJsc= github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= @@ -484,7 +515,11 @@ github.com/huin/goupnp v0.0.0-20180415215157-1395d1447324/go.mod h1:MZ2ZmwcBpvOo github.com/huin/goupnp v1.0.0 h1:wg75sLpL6DZqwHQN6E1Cfk6mtfzS45z8OV+ic+DtHRo= github.com/huin/goupnp v1.0.0/go.mod h1:n9v9KO1tAxYH82qOn+UTIFQDmx5n1Zxd/ClZDMX7Bnc= github.com/huin/goutil v0.0.0-20170803182201-1ca381bf3150/go.mod h1:PpLOETDnJ0o3iZrZfqZzyLl6l7F3c6L1oWn7OICBi6o= +github.com/iancoleman/orderedmap v0.0.0-20190318233801-ac98e3ecb4b0/go.mod h1:N0Wam8K1arqPXNWjMo21EXnBPOPp36vB07FNRdD2geA= +github.com/iancoleman/orderedmap v0.1.0 h1:2orAxZBJsvimgEBmMWfXaFlzSG2fbQil5qzP3F6cCkg= +github.com/iancoleman/orderedmap v0.1.0/go.mod h1:N0Wam8K1arqPXNWjMo21EXnBPOPp36vB07FNRdD2geA= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= +github.com/icrowley/fake v0.0.0-20180203215853-4178557ae428/go.mod h1:uhpZMVGznybq1itEKXj6RYw9I71qK4kH+OGMjRC4KEo= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d h1:/WZQPMZNsjZ7IlCpsLGdQBINg5bxKQ1K1sh6awxLtkA= github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo= @@ -560,7 +595,6 @@ github.com/ipfs/go-fs-lock v0.0.6/go.mod h1:OTR+Rj9sHiRubJh3dRhD15Juhd/+w6VPOY28 github.com/ipfs/go-graphsync v0.1.0/go.mod h1:jMXfqIEDFukLPZHqDPp8tJMbHO9Rmeb9CEGevngQbmE= github.com/ipfs/go-graphsync v0.4.2/go.mod h1:/VmbZTUdUMTbNkgzAiCEucIIAU3BkLE2cZrDCVUhyi0= github.com/ipfs/go-graphsync v0.4.3/go.mod h1:mPOwDYv128gf8gxPFgXnz4fNrSYPsWyqisJ7ych+XDY= -github.com/ipfs/go-graphsync v0.5.2/go.mod h1:e2ZxnClqBBYAtd901g9vXMJzS47labjAtOzsWtOzKNk= github.com/ipfs/go-graphsync v0.6.0 h1:x6UvDUGA7wjaKNqx5Vbo7FGT8aJ5ryYA0dMQ5jN3dF0= github.com/ipfs/go-graphsync v0.6.0/go.mod h1:e2ZxnClqBBYAtd901g9vXMJzS47labjAtOzsWtOzKNk= github.com/ipfs/go-hamt-ipld v0.1.1/go.mod h1:1EZCr2v0jlCnhpa+aZ0JZYp8Tt2w16+JJOAVz17YcDk= @@ -710,6 +744,8 @@ github.com/joeshaw/multierror v0.0.0-20140124173710-69b34d4ec901/go.mod h1:Z86h9 github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= github.com/jonboulle/clockwork v0.1.1-0.20190114141812-62fb9bc030d1 h1:qBCV/RLV02TSfQa7tFmxTihnG+u+7JXByOkhlkR5rmQ= github.com/jonboulle/clockwork v0.1.1-0.20190114141812-62fb9bc030d1/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= +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/go.mod h1:LNinyqDIJnpAur+b8yyulnQw/wDuN1+BYKlTRt3OuAQ= @@ -1078,6 +1114,11 @@ github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0Q github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= 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= +github.com/mailru/easyjson v0.7.1/go.mod h1:KAzv3t3aY1NaHWoQz1+4F1ccyAH66Jk7yos7ldAVICs= +github.com/mailru/easyjson v0.7.6 h1:8yTIVnZgCoiM1TgqoeTl+LfU5Jg6/xL3QhGQnimLYnA= +github.com/mailru/easyjson v0.7.6/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= github.com/marten-seemann/qpack v0.1.0/go.mod h1:LFt1NU/Ptjip0C2CPkhimBz5CGE3WGDAUWqna+CNTrI= github.com/marten-seemann/qpack v0.2.0/go.mod h1:F7Gl5L1jIgN1D11ucXefiuJS9UMVP2opoCp2jDKb7wc= github.com/marten-seemann/qtls v0.2.3/go.mod h1:xzjG7avBwGGbdZ8dTGxlBnLArsVKLvwmjgmPuiQEcYk= @@ -1212,6 +1253,7 @@ github.com/nats-io/nkeys v0.1.3/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxzi 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= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/nikkolasg/hexjson v0.0.0-20181101101858-78e39397e00c h1:5bFTChQxSKNwy8ALwOebjekYExl9HTT9urdawqC95tA= @@ -1239,6 +1281,8 @@ github.com/onsi/gomega v1.9.0/go.mod h1:Ho0h+IUsWyvy1OpqCwxlQ/21gkhVunqlU8fDGcoT github.com/onsi/gomega v1.10.1 h1:o0+MgICZLuZ7xjH7Vx6zS/zcu93/BEp1VwkIW1mEXCE= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= 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 h1:UfAcuLBJB9Coz72x1hgl8O5RVzTdNiaglX6v2DM6FI0= github.com/opencontainers/runtime-spec v1.0.2/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= github.com/opentracing-contrib/go-grpc v0.0.0-20180928155321-4b5a12d3ff02/go.mod h1:JNdpVEzCpXBgIiv4ds+TzhN1hrtxq6ClLrTlT9OQRSc= @@ -1406,10 +1450,12 @@ github.com/streadway/amqp v0.0.0-20190404075320-75d898a42a94/go.mod h1:AZpEONHx3 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 h1:2vfRuCMp5sSVIDSqO8oNnWJq7mPa6KVP3iPIwFBuy8A= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.2.0 h1:Hbg2NidpLE8veEBkEZTL3CvlkUIVzuU9jDplZO54c48= +github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.3.1-0.20190311161405-34c6fa2dc709/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.6.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= @@ -1420,6 +1466,12 @@ github.com/syndtr/goleveldb v1.0.0 h1:fBdIW9lB4Iz0n9khmH8w27SJ3QEJ7+IgjPEwGSZiFd github.com/syndtr/goleveldb v1.0.0/go.mod h1:ZVVdQEZoIme9iO1Ch2Jdy24qqXrMMOU6lpPAyBWyWuQ= github.com/tarm/serial v0.0.0-20180830185346-98f6abe2eb07/go.mod h1:kDXzergiv9cbyO7IOYJZWg1U88JhDg3PB6klq9Hg2pA= github.com/texttheater/golang-levenshtein v0.0.0-20180516184445-d188e65d659e/go.mod h1:XDKHRm5ThF8YJjx001LtgelzsoaEcvnA7lVWz9EeX3g= +github.com/tidwall/gjson v1.6.0 h1:9VEQWz6LLMUsUl6PueE49ir4Ka6CzLymOAZDxpFsTDc= +github.com/tidwall/gjson v1.6.0/go.mod h1:P256ACg0Mn+j1RXIDXoss50DeIABTYK1PULOJHhxOls= +github.com/tidwall/match v1.0.1 h1:PnKP62LPNxHKTwvHHZZzdOAOCtsJTjo6dZLCwpKm5xc= +github.com/tidwall/match v1.0.1/go.mod h1:LujAq0jyVjBy028G1WhWfIzbpQfMO8bBZ6Tyb0+pL9E= +github.com/tidwall/pretty v1.0.0 h1:HsD+QiTn7sK6flMKIvNmpqz1qrpP3Ps6jOKIKMooyg4= +github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= github.com/tj/go-spin v1.1.0 h1:lhdWZsvImxvZ3q1C5OIB7d72DuOwP4O2NdBg9PyzNds= github.com/tj/go-spin v1.1.0/go.mod h1:Mg1mzmePZm4dva8Qz60H2lHwmJ2loum4VIrLgVnKwh4= github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= @@ -1664,13 +1716,15 @@ golang.org/x/net v0.0.0-20191007182048-72f939374954/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200519113804-d87ec0cfa476/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200602114024-627f9648deb9/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20201021035429-f5854403a974 h1:IX6qOQeG5uLjB/hjjwjedwfjND0hgjPMMyO1RoIXQNI= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201022231255-08b38378de70 h1:Z6x4N9mAi4oF0TbHweCsH618MO6OI6UFgV0FP5n0wBY= +golang.org/x/net v0.0.0-20201022231255-08b38378de70/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20181017192945-9dcd33a902f4/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20181203162652-d668ce993890/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -1798,6 +1852,7 @@ golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtn 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= @@ -1928,15 +1983,15 @@ honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.1-2019.2.3 h1:3JgtbtFHMiCmsznwGVTUWbgGov+pVqnlf1dEJTNAXeM= honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= +honnef.co/go/tools v0.0.1-2020.1.3 h1:sXmLre5bzIR6ypkjXCDI3jHPssRhc8KD/Ome589sc3U= +honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= howett.net/plist v0.0.0-20181124034731-591f970eefbb h1:jhnBjNi9UFpfpl8YZhA9CrOqpnJdvzuiHsl/dnxl11M= howett.net/plist v0.0.0-20181124034731-591f970eefbb/go.mod h1:vMygbs4qMhSZSc4lCUl2OEE+rDiIIJAIdR4m7MiMcm0= modernc.org/cc v1.0.0 h1:nPibNuDEx6tvYrUAtvDTTw98rx5juGsa5zuDnKwEEQQ= modernc.org/cc v1.0.0/go.mod h1:1Sk4//wdnYJiUIxnW8ddKpaOJCF37yAdqYnkxUpaYxw= modernc.org/fileutil v1.0.0/go.mod h1:JHsWpkrk/CnVV1H/eGlFf85BEpfkrp56ro8nojIq9Q8= modernc.org/golex v1.0.0/go.mod h1:b/QX9oBD/LhixY6NDh+IdGv17hgB+51fET1i2kPSmvk= -modernc.org/golex v1.0.0/go.mod h1:b/QX9oBD/LhixY6NDh+IdGv17hgB+51fET1i2kPSmvk= modernc.org/golex v1.0.1 h1:EYKY1a3wStt0RzHaH8mdSRNg78Ub0OHxYfCRWw35YtM= modernc.org/golex v1.0.1/go.mod h1:QCA53QtsT1NdGkaZZkF5ezFwk4IXh4BGNafAARTC254= modernc.org/lex v1.0.0/go.mod h1:G6rxMTy3cH2iA0iXL/HRRv4Znu8MK4higxph/lE7ypk= diff --git a/lib/backupds/backupds_test.go b/lib/backupds/backupds_test.go new file mode 100644 index 000000000..f7bc36e22 --- /dev/null +++ b/lib/backupds/backupds_test.go @@ -0,0 +1,85 @@ +package backupds + +import ( + "bytes" + "fmt" + "io/ioutil" + "os" + "path/filepath" + "strings" + "testing" + + "github.com/ipfs/go-datastore" + "github.com/stretchr/testify/require" +) + +const valSize = 512 << 10 + +func putVals(t *testing.T, ds datastore.Datastore, start, end int) { + for i := start; i < end; i++ { + err := ds.Put(datastore.NewKey(fmt.Sprintf("%d", i)), []byte(fmt.Sprintf("%d-%s", i, strings.Repeat("~", valSize)))) + require.NoError(t, err) + } +} + +func checkVals(t *testing.T, ds datastore.Datastore, start, end int, exist bool) { + for i := start; i < end; i++ { + v, err := ds.Get(datastore.NewKey(fmt.Sprintf("%d", i))) + if exist { + require.NoError(t, err) + expect := []byte(fmt.Sprintf("%d-%s", i, strings.Repeat("~", valSize))) + require.EqualValues(t, expect, v) + } else { + require.ErrorIs(t, err, datastore.ErrNotFound) + } + } +} + +func TestNoLogRestore(t *testing.T) { + ds1 := datastore.NewMapDatastore() + + putVals(t, ds1, 0, 10) + + bds, err := Wrap(ds1, NoLogdir) + require.NoError(t, err) + + var bup bytes.Buffer + require.NoError(t, bds.Backup(&bup)) + + putVals(t, ds1, 10, 20) + + ds2 := datastore.NewMapDatastore() + require.NoError(t, RestoreInto(&bup, ds2)) + + checkVals(t, ds2, 0, 10, true) + checkVals(t, ds2, 10, 20, false) +} + +func TestLogRestore(t *testing.T) { + logdir, err := ioutil.TempDir("", "backupds-test-") + require.NoError(t, err) + defer os.RemoveAll(logdir) // nolint + + ds1 := datastore.NewMapDatastore() + + putVals(t, ds1, 0, 10) + + bds, err := Wrap(ds1, logdir) + require.NoError(t, err) + + putVals(t, bds, 10, 20) + + require.NoError(t, bds.Close()) + + fls, err := ioutil.ReadDir(logdir) + require.NoError(t, err) + require.Equal(t, 1, len(fls)) + + bf, err := ioutil.ReadFile(filepath.Join(logdir, fls[0].Name())) + require.NoError(t, err) + + ds2 := datastore.NewMapDatastore() + require.NoError(t, RestoreInto(bytes.NewReader(bf), ds2)) + + checkVals(t, ds2, 0, 20, true) +} diff --git a/lib/backupds/log.go b/lib/backupds/log.go index 85db600ef..b76dfbfe6 100644 --- a/lib/backupds/log.go +++ b/lib/backupds/log.go @@ -55,7 +55,7 @@ func (d *Datastore) startLog(logdir string) error { return xerrors.Errorf("creating log: %w", err) } } else { - l, err = d.openLog(filepath.Join(logdir, latest)) + l, latest, err = d.openLog(filepath.Join(logdir, latest)) if err != nil { return xerrors.Errorf("opening log: %w", err) } @@ -97,6 +97,8 @@ type logfile struct { file *os.File } +var compactThresh = 2 + func (d *Datastore) createLog(logdir string) (*logfile, string, error) { p := filepath.Join(logdir, strconv.FormatInt(time.Now().Unix(), 10)+".log.cbor") log.Infow("creating log", "file", p) @@ -119,32 +121,36 @@ func (d *Datastore) createLog(logdir string) (*logfile, string, error) { }, filepath.Base(p), nil } -func (d *Datastore) openLog(p string) (*logfile, error) { +func (d *Datastore) openLog(p string) (*logfile, string, error) { log.Infow("opening log", "file", p) lh, err := d.child.Get(loghead) if err != nil { - return nil, xerrors.Errorf("checking log head (logfile '%s'): %w", p, err) + return nil, "", xerrors.Errorf("checking log head (logfile '%s'): %w", p, err) } lhp := strings.Split(string(lh), ";") if len(lhp) != 3 { - return nil, xerrors.Errorf("expected loghead to have 3 parts") + return nil, "", xerrors.Errorf("expected loghead to have 3 parts") } if lhp[0] != filepath.Base(p) { - return nil, xerrors.Errorf("loghead log file doesn't match, opening %s, expected %s", p, lhp[0]) + return nil, "", xerrors.Errorf("loghead log file doesn't match, opening %s, expected %s", p, lhp[0]) } f, err := os.OpenFile(p, os.O_RDWR, 0644) if err != nil { - return nil, err + return nil, "", err } var lastLogHead string - var openCount, logvals int64 + var openCount, vals, logvals int64 // check file integrity - err = ReadBackup(f, func(k datastore.Key, v []byte) error { - logvals++ + clean, err := ReadBackup(f, func(k datastore.Key, v []byte, log bool) error { + if log { + logvals++ + } else { + vals++ + } if k == loghead { lastLogHead = string(v) openCount++ @@ -152,32 +158,57 @@ func (d *Datastore) openLog(p string) (*logfile, error) { return nil }) if err != nil { - return nil, xerrors.Errorf("reading backup part of the logfile: %w", err) + return nil, "", xerrors.Errorf("reading backup part of the logfile: %w", err) } - if string(lh) != lastLogHead { - return nil, xerrors.Errorf("loghead didn't match, expected '%s', last in logfile '%s'", string(lh), lastLogHead) + if string(lh) != lastLogHead && clean { // if not clean, user has opted in to ignore truncated logs, this will almost certainly happen + return nil, "", xerrors.Errorf("loghead didn't match, expected '%s', last in logfile '%s'", string(lh), lastLogHead) } // make sure we're at the end of the file at, err := f.Seek(0, io.SeekCurrent) if err != nil { - return nil, xerrors.Errorf("get current logfile offset: %w", err) + return nil, "", xerrors.Errorf("get current logfile offset: %w", err) } end, err := f.Seek(0, io.SeekEnd) if err != nil { - return nil, xerrors.Errorf("get current logfile offset: %w", err) + return nil, "", xerrors.Errorf("get current logfile offset: %w", err) } if at != end { - return nil, xerrors.Errorf("logfile %s validated %d bytes, but the file has %d bytes (%d more)", p, at, end, end-at) + return nil, "", xerrors.Errorf("logfile %s validated %d bytes, but the file has %d bytes (%d more)", p, at, end, end-at) } - log.Infow("log opened", "file", p, "openCount", openCount, "logValues", logvals) + compact := logvals > vals*int64(compactThresh) + if compact || !clean { + log.Infow("compacting log", "current", p, "openCount", openCount, "baseValues", vals, "logValues", logvals, "truncated", !clean) + if err := f.Close(); err != nil { + return nil, "", xerrors.Errorf("closing current log: %w", err) + } + + l, latest, err := d.createLog(filepath.Dir(p)) + if err != nil { + return nil, "", xerrors.Errorf("creating compacted log: %w", err) + } + + if clean { + log.Infow("compacted log created, cleaning up old", "old", p, "new", latest) + if err := os.Remove(p); err != nil { + l.Close() // nolint + return nil, "", xerrors.Errorf("cleaning up old logfile: %w", err) + } + } else { + log.Errorw("LOG FILE WAS TRUNCATED, KEEPING THE FILE", "old", p, "new", latest) + } + + return l, latest, nil + } + + log.Infow("log opened", "file", p, "openCount", openCount, "baseValues", vals, "logValues", logvals) // todo: maybe write a magic 'opened at' entry; pad the log to filesystem page to prevent more exotic types of corruption return &logfile{ file: f, - }, nil + }, filepath.Base(p), nil } func (l *logfile) writeLogHead(logname string, ds datastore.Batching) error { diff --git a/lib/backupds/read.go b/lib/backupds/read.go index 7c8e33e74..a44442af1 100644 --- a/lib/backupds/read.go +++ b/lib/backupds/read.go @@ -11,16 +11,16 @@ import ( "golang.org/x/xerrors" ) -func ReadBackup(r io.Reader, cb func(key datastore.Key, value []byte) error) error { +func ReadBackup(r io.Reader, cb func(key datastore.Key, value []byte, log bool) error) (bool, error) { scratch := make([]byte, 9) // read array[2]( if _, err := r.Read(scratch[:1]); err != nil { - return xerrors.Errorf("reading array header: %w", err) + return false, xerrors.Errorf("reading array header: %w", err) } if scratch[0] != 0x82 { - return xerrors.Errorf("expected array(2) header byte 0x82, got %x", scratch[0]) + return false, xerrors.Errorf("expected array(2) header byte 0x82, got %x", scratch[0]) } hasher := sha256.New() @@ -28,16 +28,16 @@ func ReadBackup(r io.Reader, cb func(key datastore.Key, value []byte) error) err // read array[*]( if _, err := hr.Read(scratch[:1]); err != nil { - return xerrors.Errorf("reading array header: %w", err) + return false, xerrors.Errorf("reading array header: %w", err) } if scratch[0] != 0x9f { - return xerrors.Errorf("expected indefinite length array header byte 0x9f, got %x", scratch[0]) + return false, xerrors.Errorf("expected indefinite length array header byte 0x9f, got %x", scratch[0]) } for { if _, err := hr.Read(scratch[:1]); err != nil { - return xerrors.Errorf("reading tuple header: %w", err) + return false, xerrors.Errorf("reading tuple header: %w", err) } // close array[*] @@ -47,22 +47,22 @@ func ReadBackup(r io.Reader, cb func(key datastore.Key, value []byte) error) err // read array[2](key:[]byte, value:[]byte) if scratch[0] != 0x82 { - return xerrors.Errorf("expected array(2) header 0x82, got %x", scratch[0]) + return false, xerrors.Errorf("expected array(2) header 0x82, got %x", scratch[0]) } keyb, err := cbg.ReadByteArray(hr, 1<<40) if err != nil { - return xerrors.Errorf("reading key: %w", err) + return false, xerrors.Errorf("reading key: %w", err) } key := datastore.NewKey(string(keyb)) value, err := cbg.ReadByteArray(hr, 1<<40) if err != nil { - return xerrors.Errorf("reading value: %w", err) + return false, xerrors.Errorf("reading value: %w", err) } - if err := cb(key, value); err != nil { - return err + if err := cb(key, value, false); err != nil { + return false, err } } @@ -71,11 +71,11 @@ func ReadBackup(r io.Reader, cb func(key datastore.Key, value []byte) error) err // read the [32]byte checksum expSum, err := cbg.ReadByteArray(r, 32) if err != nil { - return xerrors.Errorf("reading expected checksum: %w", err) + return false, xerrors.Errorf("reading expected checksum: %w", err) } if !bytes.Equal(sum, expSum) { - return xerrors.Errorf("checksum didn't match; expected %x, got %x", expSum, sum) + return false, xerrors.Errorf("checksum didn't match; expected %x, got %x", expSum, sum) } // read the log, set of Entry-ies @@ -86,32 +86,32 @@ func ReadBackup(r io.Reader, cb func(key datastore.Key, value []byte) error) err _, err := bp.ReadByte() switch err { case io.EOF, io.ErrUnexpectedEOF: - return nil + return true, nil case nil: default: - return xerrors.Errorf("peek log: %w", err) + return false, xerrors.Errorf("peek log: %w", err) } if err := bp.UnreadByte(); err != nil { - return xerrors.Errorf("unread log byte: %w", err) + return false, xerrors.Errorf("unread log byte: %w", err) } if err := ent.UnmarshalCBOR(bp); err != nil { switch err { case io.EOF, io.ErrUnexpectedEOF: if os.Getenv("LOTUS_ALLOW_TRUNCATED_LOG") == "1" { - panic("handleme; just ignore and tell the caller about the corrupted file") // todo - } else { - return xerrors.Errorf("log entry potentially truncated, set LOTUS_ALLOW_TRUNCATED_LOG=1 to proceed: %w", err) + log.Errorw("log entry potentially truncated") + return false, nil } + return false, xerrors.Errorf("log entry potentially truncated, set LOTUS_ALLOW_TRUNCATED_LOG=1 to proceed: %w", err) default: - return xerrors.Errorf("unmarshaling log entry: %w", err) + return false, xerrors.Errorf("unmarshaling log entry: %w", err) } } key := datastore.NewKey(string(ent.Key)) - if err := cb(key, ent.Value); err != nil { - return err + if err := cb(key, ent.Value, true); err != nil { + return false, err } } } @@ -122,7 +122,7 @@ func RestoreInto(r io.Reader, dest datastore.Batching) error { return xerrors.Errorf("creating batch: %w", err) } - err = ReadBackup(r, func(key datastore.Key, value []byte) error { + _, err = ReadBackup(r, func(key datastore.Key, value []byte, _ bool) error { if err := batch.Put(key, value); err != nil { return xerrors.Errorf("put key: %w", err) } diff --git a/markets/retrievaladapter/provider.go b/markets/retrievaladapter/provider.go index 440e2a480..3c8505c51 100644 --- a/markets/retrievaladapter/provider.go +++ b/markets/retrievaladapter/provider.go @@ -4,6 +4,9 @@ import ( "context" "io" + "github.com/ipfs/go-cid" + logging "github.com/ipfs/go-log/v2" + "github.com/filecoin-project/lotus/api" "github.com/filecoin-project/lotus/chain/actors/builtin/paych" "github.com/filecoin-project/lotus/chain/types" @@ -16,10 +19,10 @@ import ( "github.com/filecoin-project/go-fil-markets/shared" "github.com/filecoin-project/go-state-types/abi" specstorage "github.com/filecoin-project/specs-storage/storage" - - "github.com/ipfs/go-cid" ) +var log = logging.Logger("retrievaladapter") + type retrievalProviderNode struct { miner *storage.Miner sealer sectorstorage.SectorManager @@ -61,13 +64,20 @@ func (rpn *retrievalProviderNode) UnsealSector(ctx context.Context, sectorID abi ProofType: si.SectorType, } + // Set up a pipe so that data can be written from the unsealing process + // into the reader returned by this function r, w := io.Pipe() go func() { var commD cid.Cid if si.CommD != nil { commD = *si.CommD } + // Read the piece into the pipe's writer, unsealing the piece if necessary err := rpn.sealer.ReadPiece(ctx, w, ref, storiface.UnpaddedByteIndex(offset), length, si.TicketValue, commD) + if err != nil { + log.Errorf("failed to unseal piece from sector %d: %s", sectorID, err) + } + // Close the reader with any error that was returned while reading the piece _ = w.CloseWithError(err) }() diff --git a/metrics/proxy.go b/metrics/proxy.go index f3714ec2e..309ef80e1 100644 --- a/metrics/proxy.go +++ b/metrics/proxy.go @@ -24,19 +24,19 @@ func MetricedFullAPI(a api.FullNode) api.FullNode { return &out } -func MetricedWorkerAPI(a api.WorkerAPI) api.WorkerAPI { +func MetricedWorkerAPI(a api.Worker) api.Worker { var out apistruct.WorkerStruct proxy(a, &out.Internal) return &out } -func MetricedWalletAPI(a api.WalletAPI) api.WalletAPI { +func MetricedWalletAPI(a api.Wallet) api.Wallet { var out apistruct.WalletStruct proxy(a, &out.Internal) return &out } -func MetricedGatewayAPI(a api.GatewayAPI) api.GatewayAPI { +func MetricedGatewayAPI(a api.Gateway) api.Gateway { var out apistruct.GatewayStruct proxy(a, &out.Internal) return &out diff --git a/miner/miner.go b/miner/miner.go index efdbe4896..eb7dd95f5 100644 --- a/miner/miner.go +++ b/miner/miner.go @@ -37,7 +37,13 @@ const ( evtTypeBlockMined = iota ) -// returns a callback reporting whether we mined a blocks in this round +// waitFunc is expected to pace block mining at the configured network rate. +// +// baseTime is the timestamp of the mining base, i.e. the timestamp +// of the tipset we're planning to construct upon. +// +// Upon each mining loop iteration, the returned callback is called reporting +// whether we mined a block in this round or not. type waitFunc func(ctx context.Context, baseTime uint64) (func(bool, abi.ChainEpoch, error), abi.ChainEpoch, error) func randTimeOffset(width time.Duration) time.Duration { @@ -48,6 +54,8 @@ func randTimeOffset(width time.Duration) time.Duration { return val - (width / 2) } +// NewMiner instantiates a miner with a concrete WinningPoStProver and a miner +// address (which can be different from the worker's address). func NewMiner(api api.FullNode, epp gen.WinningPoStProver, addr address.Address, sf *slashfilter.SlashFilter, j journal.Journal) *Miner { arc, err := lru.NewARC(10000) if err != nil { @@ -59,7 +67,16 @@ func NewMiner(api api.FullNode, epp gen.WinningPoStProver, addr address.Address, epp: epp, address: addr, waitFunc: func(ctx context.Context, baseTime uint64) (func(bool, abi.ChainEpoch, error), abi.ChainEpoch, error) { - // Wait around for half the block time in case other parents come in + // wait around for half the block time in case other parents come in + // + // if we're mining a block in the past via catch-up/rush mining, + // such as when recovering from a network halt, this sleep will be + // for a negative duration, and therefore **will return + // immediately**. + // + // the result is that we WILL NOT wait, therefore fast-forwarding + // and thus healing the chain by backfilling it with null rounds + // rapidly. deadline := baseTime + build.PropagationDelaySecs baseT := time.Unix(int64(deadline), 0) @@ -79,6 +96,9 @@ func NewMiner(api api.FullNode, epp gen.WinningPoStProver, addr address.Address, } } +// Miner encapsulates the mining processes of the system. +// +// Refer to the godocs on mineOne and mine methods for more detail. type Miner struct { api api.FullNode @@ -91,15 +111,20 @@ type Miner struct { waitFunc waitFunc + // lastWork holds the last MiningBase we built upon. lastWork *MiningBase - sf *slashfilter.SlashFilter + sf *slashfilter.SlashFilter + // minedBlockHeights is a safeguard that caches the last heights we mined. + // It is consulted before publishing a newly mined block, for a sanity check + // intended to avoid slashings in case of a bug. minedBlockHeights *lru.ARCCache evtTypes [1]journal.EventType journal journal.Journal } +// Address returns the address of the miner. func (m *Miner) Address() address.Address { m.lk.Lock() defer m.lk.Unlock() @@ -107,7 +132,9 @@ func (m *Miner) Address() address.Address { return m.address } -func (m *Miner) Start(ctx context.Context) error { +// Start starts the mining operation. It spawns a goroutine and returns +// immediately. Start is not idempotent. +func (m *Miner) Start(_ context.Context) error { m.lk.Lock() defer m.lk.Unlock() if m.stop != nil { @@ -118,6 +145,8 @@ func (m *Miner) Start(ctx context.Context) error { return nil } +// Stop stops the mining operation. It is not idempotent, and multiple adjacent +// calls to Stop will fail. func (m *Miner) Stop(ctx context.Context) error { m.lk.Lock() @@ -145,6 +174,28 @@ func (m *Miner) niceSleep(d time.Duration) bool { } } +// mine runs the mining loop. It performs the following: +// +// 1. Queries our current best currently-known mining candidate (tipset to +// build upon). +// 2. Waits until the propagation delay of the network has elapsed (currently +// 6 seconds). The waiting is done relative to the timestamp of the best +// candidate, which means that if it's way in the past, we won't wait at +// all (e.g. in catch-up or rush mining). +// 3. After the wait, we query our best mining candidate. This will be the one +// we'll work with. +// 4. Sanity check that we _actually_ have a new mining base to mine on. If +// not, wait one epoch + propagation delay, and go back to the top. +// 5. We attempt to mine a block, by calling mineOne (refer to godocs). This +// method will either return a block if we were eligible to mine, or nil +// if we weren't. +// 6a. If we mined a block, we update our state and push it out to the network +// via gossipsub. +// 6b. If we didn't mine a block, we consider this to be a nil round on top of +// the mining base we selected. If other miner or miners on the network +// were eligible to mine, we will receive their blocks via gossipsub and +// we will select that tipset on the next iteration of the loop, thus +// discarding our null round. func (m *Miner) mine(ctx context.Context) { ctx, span := trace.StartSpan(ctx, "/mine") defer span.End() @@ -305,11 +356,19 @@ minerLoop: } } +// MiningBase is the tipset on top of which we plan to construct our next block. +// Refer to godocs on GetBestMiningCandidate. type MiningBase struct { TipSet *types.TipSet NullRounds abi.ChainEpoch } +// GetBestMiningCandidate implements the fork choice rule from a miner's +// perspective. +// +// It obtains the current chain head (HEAD), and compares it to the last tipset +// we selected as our mining base (LAST). If HEAD's weight is larger than +// LAST's weight, it selects HEAD to build on. Else, it selects LAST. func (m *Miner) GetBestMiningCandidate(ctx context.Context) (*MiningBase, error) { m.lk.Lock() defer m.lk.Unlock() diff --git a/node/builder.go b/node/builder.go index ee0a66e53..ad8d43d9e 100644 --- a/node/builder.go +++ b/node/builder.go @@ -11,6 +11,7 @@ import ( "github.com/filecoin-project/go-state-types/abi" "github.com/filecoin-project/lotus/chain" "github.com/filecoin-project/lotus/chain/exchange" + rpcstmgr "github.com/filecoin-project/lotus/chain/stmgr/rpc" "github.com/filecoin-project/lotus/chain/store" "github.com/filecoin-project/lotus/chain/vm" "github.com/filecoin-project/lotus/chain/wallet" @@ -304,12 +305,13 @@ var ChainNode = Options( Override(new(*messagesigner.MessageSigner), messagesigner.NewMessageSigner), Override(new(*wallet.LocalWallet), wallet.NewWallet), Override(new(wallet.Default), From(new(*wallet.LocalWallet))), - Override(new(api.WalletAPI), From(new(wallet.MultiWallet))), + Override(new(api.Wallet), From(new(wallet.MultiWallet))), // Service: Payment channels - Override(new(*paychmgr.Store), paychmgr.NewStore), - Override(new(*paychmgr.Manager), paychmgr.NewManager), - Override(HandlePaymentChannelManagerKey, paychmgr.HandleManager), + Override(new(paychmgr.PaychAPI), From(new(modules.PaychAPI))), + Override(new(*paychmgr.Store), modules.NewPaychStore), + Override(new(*paychmgr.Manager), modules.NewManager), + Override(HandlePaymentChannelManagerKey, modules.HandlePaychManager), Override(SettlePaymentChannelsKey, settler.SettlePaymentChannels), // Markets (common) @@ -327,14 +329,16 @@ var ChainNode = Options( Override(new(storagemarket.StorageClientNode), storageadapter.NewClientNodeAdapter), Override(HandleMigrateClientFundsKey, modules.HandleMigrateClientFunds), + Override(new(*full.GasPriceCache), full.NewGasPriceCache), + // Lite node API ApplyIf(isLiteNode, Override(new(messagesigner.MpoolNonceAPI), From(new(modules.MpoolNonceAPI))), - Override(new(full.ChainModuleAPI), From(new(api.GatewayAPI))), - Override(new(full.GasModuleAPI), From(new(api.GatewayAPI))), - Override(new(full.MpoolModuleAPI), From(new(api.GatewayAPI))), - Override(new(full.StateModuleAPI), From(new(api.GatewayAPI))), - Override(new(stmgr.StateManagerAPI), modules.NewRPCStateManager), + Override(new(full.ChainModuleAPI), From(new(api.Gateway))), + Override(new(full.GasModuleAPI), From(new(api.Gateway))), + Override(new(full.MpoolModuleAPI), From(new(api.Gateway))), + Override(new(full.StateModuleAPI), From(new(api.Gateway))), + Override(new(stmgr.StateManagerAPI), rpcstmgr.NewRPCStateManager), ), // Full node API / service startup @@ -725,3 +729,19 @@ func Test() Option { Override(new(*storageadapter.DealPublisher), storageadapter.NewDealPublisher(nil, storageadapter.PublishMsgConfig{})), ) } + +// For 3rd party dep injection. + +func WithRepoType(repoType repo.RepoType) func(s *Settings) error { + return func(s *Settings) error { + s.nodeType = repoType + return nil + } +} + +func WithInvokesKey(i invoke, resApi interface{}) func(s *Settings) error { + return func(s *Settings) error { + s.invokes[i] = fx.Populate(resApi) + return nil + } +} diff --git a/node/config/def.go b/node/config/def.go index ec7d0ad60..63099516b 100644 --- a/node/config/def.go +++ b/node/config/def.go @@ -236,6 +236,7 @@ func DefaultStorageMiner() *StorageMiner { MaxSealingSectors: 0, MaxSealingSectorsForDeals: 0, WaitDealsDelay: Duration(time.Hour * 6), + AlwaysKeepUnsealedCopy: true, }, Storage: sectorstorage.SealerConfig{ diff --git a/node/impl/client/client.go b/node/impl/client/client.go index 0576fcbf4..c80642332 100644 --- a/node/impl/client/client.go +++ b/node/impl/client/client.go @@ -61,6 +61,7 @@ import ( "github.com/filecoin-project/lotus/node/impl/paych" "github.com/filecoin-project/lotus/node/modules/dtypes" "github.com/filecoin-project/lotus/node/repo/importmgr" + "github.com/filecoin-project/lotus/node/repo/retrievalstoremgr" ) var DefaultHashFunction = uint64(mh.BLAKE2B_MIN + 31) @@ -81,6 +82,7 @@ type API struct { Chain *store.ChainStore Imports dtypes.ClientImportMgr + Mds dtypes.ClientMultiDstore CombinedBstore dtypes.ClientBlockstore // TODO: try to remove RetrievalStoreMgr dtypes.ClientRetrievalStoreManager @@ -369,10 +371,14 @@ func (a *API) newDealInfo(ctx context.Context, v storagemarket.ClientDeal) api.D // 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.newDealInfoWithTransfer(transferCh, v) + + di := a.newDealInfoWithTransfer(transferCh, v) + di.DealStages = v.DealStages + return di } func (a *API) newDealInfoWithTransfer(transferCh *api.DataTransferChannel, v storagemarket.ClientDeal) api.DealInfo { @@ -577,6 +583,29 @@ func (a *API) ClientListImports(ctx context.Context) ([]api.Import, error) { return out, nil } +func (a *API) ClientCancelRetrievalDeal(ctx context.Context, dealID retrievalmarket.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 (a *API) ClientRetrieve(ctx context.Context, order api.RetrievalOrder, ref *api.FileRef) error { events := make(chan marketevents.RetrievalEvent) go a.clientRetrieve(ctx, order, ref, events) @@ -657,86 +686,102 @@ func (a *API) clientRetrieve(ctx context.Context, order api.RetrievalOrder, ref } } - if order.MinerPeer.ID == "" { - mi, err := a.StateMinerInfo(ctx, order.Miner, types.EmptyTSK) - if err != nil { - finish(err) + var store retrievalstoremgr.RetrievalStore + + if order.LocalStore == nil { + if order.MinerPeer == nil || order.MinerPeer.ID == "" { + mi, err := a.StateMinerInfo(ctx, order.Miner, types.EmptyTSK) + if err != nil { + finish(err) + return + } + + order.MinerPeer = &retrievalmarket.RetrievalPeer{ + ID: *mi.PeerId, + Address: order.Miner, + } + } + + if order.Size == 0 { + finish(xerrors.Errorf("cannot make retrieval deal for zero bytes")) return } - order.MinerPeer = retrievalmarket.RetrievalPeer{ - ID: *mi.PeerId, - Address: order.Miner, + /*id, st, err := a.imgr().NewStore() + if err != nil { + return err } - } + if err := a.imgr().AddLabel(id, "source", "retrieval"); err != nil { + return err + }*/ - if order.Size == 0 { - finish(xerrors.Errorf("cannot make retrieval deal for zero bytes")) - return - } + ppb := types.BigDiv(order.Total, types.NewInt(order.Size)) - /*id, st, err := a.imgr().NewStore() - if err != nil { - return err - } - if err := a.imgr().AddLabel(id, "source", "retrieval"); err != nil { - return err - }*/ + params, err := rm.NewParamsV1(ppb, order.PaymentInterval, order.PaymentIntervalIncrease, shared.AllSelector(), order.Piece, order.UnsealPrice) + if err != nil { + finish(xerrors.Errorf("Error in retrieval params: %s", err)) + return + } - ppb := types.BigDiv(order.Total, types.NewInt(order.Size)) + store, err = a.RetrievalStoreMgr.NewStore() + if err != nil { + finish(xerrors.Errorf("Error setting up new store: %w", err)) + return + } - params, err := rm.NewParamsV1(ppb, order.PaymentInterval, order.PaymentIntervalIncrease, shared.AllSelector(), order.Piece, order.UnsealPrice) - if err != nil { - finish(xerrors.Errorf("Error in retrieval params: %s", err)) - return - } + defer func() { + _ = a.RetrievalStoreMgr.ReleaseStore(store) + }() - store, err := a.RetrievalStoreMgr.NewStore() - if err != nil { - finish(xerrors.Errorf("Error setting up new store: %w", err)) - return - } - - defer func() { - _ = a.RetrievalStoreMgr.ReleaseStore(store) - }() - - // Subscribe to events before retrieving to avoid losing events. - subscribeEvents := make(chan retrievalSubscribeEvent, 1) - subscribeCtx, cancel := context.WithCancel(ctx) - defer cancel() - unsubscribe := a.Retrieval.SubscribeToEvents(func(event rm.ClientEvent, state rm.ClientDealState) { - // We'll check the deal IDs inside readSubscribeEvents. - if state.PayloadCID.Equals(order.Root) { - select { - case <-subscribeCtx.Done(): - case subscribeEvents <- retrievalSubscribeEvent{event, state}: + // Subscribe to events before retrieving to avoid losing events. + subscribeEvents := make(chan retrievalSubscribeEvent, 1) + subscribeCtx, cancel := context.WithCancel(ctx) + defer cancel() + unsubscribe := a.Retrieval.SubscribeToEvents(func(event rm.ClientEvent, state rm.ClientDealState) { + // We'll check the deal IDs inside readSubscribeEvents. + if state.PayloadCID.Equals(order.Root) { + select { + case <-subscribeCtx.Done(): + case subscribeEvents <- retrievalSubscribeEvent{event, state}: + } } + }) + + dealID, err := a.Retrieval.Retrieve( + ctx, + order.Root, + params, + order.Total, + *order.MinerPeer, + order.Client, + order.Miner, + store.StoreID()) + + if err != nil { + unsubscribe() + finish(xerrors.Errorf("Retrieve failed: %w", err)) + return } - }) - dealID, err := a.Retrieval.Retrieve( - ctx, - order.Root, - params, - order.Total, - order.MinerPeer, - order.Client, - order.Miner, - store.StoreID()) + err = readSubscribeEvents(ctx, dealID, subscribeEvents, events) - if err != nil { unsubscribe() - finish(xerrors.Errorf("Retrieve failed: %w", err)) - return - } + if err != nil { + finish(xerrors.Errorf("Retrieve: %w", err)) + return + } + } else { + // local retrieval + st, err := ((*multistore.MultiStore)(a.Mds)).Get(*order.LocalStore) + if err != nil { + finish(xerrors.Errorf("Retrieve: %w", err)) + return + } - err = readSubscribeEvents(ctx, dealID, subscribeEvents, events) - - unsubscribe() - if err != nil { - finish(xerrors.Errorf("Retrieve: %w", err)) - return + store = &multiStoreRetrievalStore{ + storeID: *order.LocalStore, + store: st, + } } // If ref is nil, it only fetches the data into the configured blockstore. @@ -776,6 +821,19 @@ func (a *API) clientRetrieve(ctx context.Context, order api.RetrievalOrder, ref return } +type multiStoreRetrievalStore struct { + storeID multistore.StoreID + store *multistore.Store +} + +func (mrs *multiStoreRetrievalStore) StoreID() *multistore.StoreID { + return &mrs.storeID +} + +func (mrs *multiStoreRetrievalStore) DAGService() ipld.DAGService { + return mrs.store.DAG +} + func (a *API) ClientQueryAsk(ctx context.Context, p peer.ID, miner address.Address) (*storagemarket.StorageAsk, error) { mi, err := a.StateMinerInfo(ctx, miner, types.EmptyTSK) if err != nil { diff --git a/node/impl/common/common.go b/node/impl/common/common.go index 389e2fbc6..7d99fb42a 100644 --- a/node/impl/common/common.go +++ b/node/impl/common/common.go @@ -24,6 +24,7 @@ import ( "github.com/filecoin-project/go-jsonrpc/auth" "github.com/filecoin-project/lotus/api" + apitypes "github.com/filecoin-project/lotus/api/types" "github.com/filecoin-project/lotus/build" "github.com/filecoin-project/lotus/node/modules/dtypes" "github.com/filecoin-project/lotus/node/modules/lp2p" @@ -207,6 +208,10 @@ func (a *CommonAPI) NetBandwidthStatsByProtocol(ctx context.Context) (map[protoc return a.Reporter.GetBandwidthByProtocol(), nil } +func (a *CommonAPI) Discover(ctx context.Context) (apitypes.OpenRPCDocument, error) { + return build.OpenRPCDiscoverJSON_Full(), nil +} + func (a *CommonAPI) ID(context.Context) (peer.ID, error) { return a.Host.ID(), nil } diff --git a/node/impl/full/gas.go b/node/impl/full/gas.go index ec7074e5b..3d9889c10 100644 --- a/node/impl/full/gas.go +++ b/node/impl/full/gas.go @@ -8,6 +8,7 @@ import ( "github.com/filecoin-project/lotus/chain/actors/builtin" "github.com/filecoin-project/lotus/chain/actors/builtin/paych" + lru "github.com/hashicorp/golang-lru" "go.uber.org/fx" "golang.org/x/xerrors" @@ -39,6 +40,8 @@ type GasModule struct { Chain *store.ChainStore Mpool *messagepool.MessagePool GetMaxFee dtypes.DefaultMaxFeeFunc + + PriceCache *GasPriceCache } var _ GasModuleAPI = (*GasModule)(nil) @@ -51,6 +54,53 @@ type GasAPI struct { Stmgr *stmgr.StateManager Chain *store.ChainStore Mpool *messagepool.MessagePool + + PriceCache *GasPriceCache +} + +func NewGasPriceCache() *GasPriceCache { + // 50 because we usually won't access more than 40 + c, err := lru.New2Q(50) + if err != nil { + // err only if parameter is bad + panic(err) + } + + return &GasPriceCache{ + c: c, + } +} + +type GasPriceCache struct { + c *lru.TwoQueueCache +} + +type GasMeta struct { + Price big.Int + Limit int64 +} + +func (g *GasPriceCache) GetTSGasStats(cstore *store.ChainStore, ts *types.TipSet) ([]GasMeta, error) { + i, has := g.c.Get(ts.Key()) + if has { + return i.([]GasMeta), nil + } + + var prices []GasMeta + msgs, err := cstore.MessagesForTipset(ts) + if err != nil { + return nil, xerrors.Errorf("loading messages: %w", err) + } + for _, msg := range msgs { + prices = append(prices, GasMeta{ + Price: msg.VMMessage().GasPremium, + Limit: msg.VMMessage().GasLimit, + }) + } + + g.c.Add(ts.Key(), prices) + + return prices, nil } const MinGasPremium = 100e3 @@ -88,24 +138,19 @@ func gasEstimateFeeCap(cstore *store.ChainStore, msg *types.Message, maxqueueblk return out, nil } -type gasMeta struct { - price big.Int - limit int64 -} - // finds 55th percntile instead of median to put negative pressure on gas price -func medianGasPremium(prices []gasMeta, blocks int) abi.TokenAmount { +func medianGasPremium(prices []GasMeta, blocks int) abi.TokenAmount { sort.Slice(prices, func(i, j int) bool { // sort desc by price - return prices[i].price.GreaterThan(prices[j].price) + return prices[i].Price.GreaterThan(prices[j].Price) }) at := build.BlockGasTarget * int64(blocks) / 2 // 50th at += build.BlockGasTarget * int64(blocks) / (2 * 20) // move 5% further prev1, prev2 := big.Zero(), big.Zero() for _, price := range prices { - prev1, prev2 = price.price, prev1 - at -= price.limit + prev1, prev2 = price.Price, prev1 + at -= price.Limit if at < 0 { break } @@ -126,7 +171,7 @@ func (a *GasAPI) GasEstimateGasPremium( gaslimit int64, _ types.TipSetKey, ) (types.BigInt, error) { - return gasEstimateGasPremium(a.Chain, nblocksincl) + return gasEstimateGasPremium(a.Chain, a.PriceCache, nblocksincl) } func (m *GasModule) GasEstimateGasPremium( ctx context.Context, @@ -135,14 +180,14 @@ func (m *GasModule) GasEstimateGasPremium( gaslimit int64, _ types.TipSetKey, ) (types.BigInt, error) { - return gasEstimateGasPremium(m.Chain, nblocksincl) + return gasEstimateGasPremium(m.Chain, m.PriceCache, nblocksincl) } -func gasEstimateGasPremium(cstore *store.ChainStore, nblocksincl uint64) (types.BigInt, error) { +func gasEstimateGasPremium(cstore *store.ChainStore, cache *GasPriceCache, nblocksincl uint64) (types.BigInt, error) { if nblocksincl == 0 { nblocksincl = 1 } - var prices []gasMeta + var prices []GasMeta var blocks int ts := cstore.GetHeaviestTipSet() @@ -157,17 +202,11 @@ func gasEstimateGasPremium(cstore *store.ChainStore, nblocksincl uint64) (types. } blocks += len(pts.Blocks()) - - msgs, err := cstore.MessagesForTipset(pts) + meta, err := cache.GetTSGasStats(cstore, pts) if err != nil { - return types.BigInt{}, xerrors.Errorf("loading messages: %w", err) - } - for _, msg := range msgs { - prices = append(prices, gasMeta{ - price: msg.VMMessage().GasPremium, - limit: msg.VMMessage().GasLimit, - }) + return types.BigInt{}, err } + prices = append(prices, meta...) ts = pts } diff --git a/node/impl/full/gas_test.go b/node/impl/full/gas_test.go index 2452ab807..028e039ce 100644 --- a/node/impl/full/gas_test.go +++ b/node/impl/full/gas_test.go @@ -12,27 +12,27 @@ import ( ) func TestMedian(t *testing.T) { - require.Equal(t, types.NewInt(5), medianGasPremium([]gasMeta{ + require.Equal(t, types.NewInt(5), medianGasPremium([]GasMeta{ {big.NewInt(5), build.BlockGasTarget}, }, 1)) - require.Equal(t, types.NewInt(10), medianGasPremium([]gasMeta{ + require.Equal(t, types.NewInt(10), medianGasPremium([]GasMeta{ {big.NewInt(5), build.BlockGasTarget}, {big.NewInt(10), build.BlockGasTarget}, }, 1)) - require.Equal(t, types.NewInt(15), medianGasPremium([]gasMeta{ + require.Equal(t, types.NewInt(15), medianGasPremium([]GasMeta{ {big.NewInt(10), build.BlockGasTarget / 2}, {big.NewInt(20), build.BlockGasTarget / 2}, }, 1)) - require.Equal(t, types.NewInt(25), medianGasPremium([]gasMeta{ + require.Equal(t, types.NewInt(25), medianGasPremium([]GasMeta{ {big.NewInt(10), build.BlockGasTarget / 2}, {big.NewInt(20), build.BlockGasTarget / 2}, {big.NewInt(30), build.BlockGasTarget / 2}, }, 1)) - require.Equal(t, types.NewInt(15), medianGasPremium([]gasMeta{ + require.Equal(t, types.NewInt(15), medianGasPremium([]GasMeta{ {big.NewInt(10), build.BlockGasTarget / 2}, {big.NewInt(20), build.BlockGasTarget / 2}, {big.NewInt(30), build.BlockGasTarget / 2}, diff --git a/node/impl/full/state.go b/node/impl/full/state.go index 90e059f80..7fcd9dc13 100644 --- a/node/impl/full/state.go +++ b/node/impl/full/state.go @@ -76,7 +76,7 @@ type StateAPI struct { // TODO: the wallet here is only needed because we have the MinerCreateBlock // API attached to the state API. It probably should live somewhere better - Wallet api.WalletAPI + Wallet api.Wallet DefWallet wallet.Default StateModuleAPI diff --git a/node/impl/full/wallet.go b/node/impl/full/wallet.go index 80ae65576..ae2550d77 100644 --- a/node/impl/full/wallet.go +++ b/node/impl/full/wallet.go @@ -22,7 +22,7 @@ type WalletAPI struct { StateManagerAPI stmgr.StateManagerAPI Default wallet.Default - api.WalletAPI + api.Wallet } func (a *WalletAPI) WalletBalance(ctx context.Context, addr address.Address) (types.BigInt, error) { @@ -40,7 +40,7 @@ func (a *WalletAPI) WalletSign(ctx context.Context, k address.Address, msg []byt if err != nil { return nil, xerrors.Errorf("failed to resolve ID address: %w", keyAddr) } - return a.WalletAPI.WalletSign(ctx, keyAddr, msg, api.MsgMeta{ + return a.Wallet.WalletSign(ctx, keyAddr, msg, api.MsgMeta{ Type: api.MTUnknown, }) } @@ -56,7 +56,7 @@ func (a *WalletAPI) WalletSignMessage(ctx context.Context, k address.Address, ms return nil, xerrors.Errorf("serializing message: %w", err) } - sig, err := a.WalletAPI.WalletSign(ctx, keyAddr, mb.Cid().Bytes(), api.MsgMeta{ + sig, err := a.Wallet.WalletSign(ctx, keyAddr, mb.Cid().Bytes(), api.MsgMeta{ Type: api.MTChainMsg, Extra: mb.RawData(), }) diff --git a/node/impl/remoteworker.go b/node/impl/remoteworker.go index b6ef43c7c..1369dc248 100644 --- a/node/impl/remoteworker.go +++ b/node/impl/remoteworker.go @@ -16,7 +16,7 @@ import ( ) type remoteWorker struct { - api.WorkerAPI + api.Worker closer jsonrpc.ClientCloser } diff --git a/node/impl/storminer.go b/node/impl/storminer.go index cde168bea..cad886e2d 100644 --- a/node/impl/storminer.go +++ b/node/impl/storminer.go @@ -8,6 +8,10 @@ import ( "strconv" "time" + "github.com/filecoin-project/lotus/chain/actors/builtin" + "github.com/filecoin-project/lotus/chain/gen" + + "github.com/filecoin-project/lotus/build" "github.com/google/uuid" "github.com/ipfs/go-cid" "github.com/libp2p/go-libp2p-core/host" @@ -31,6 +35,7 @@ import ( "github.com/filecoin-project/lotus/api" "github.com/filecoin-project/lotus/api/apistruct" + apitypes "github.com/filecoin-project/lotus/api/types" "github.com/filecoin-project/lotus/chain/types" "github.com/filecoin-project/lotus/markets/storageadapter" "github.com/filecoin-project/lotus/miner" @@ -61,7 +66,8 @@ type StorageMinerAPI struct { AddrSel *storage.AddressSelector DealPublisher *storageadapter.DealPublisher - DS dtypes.MetadataDS + Epp gen.WinningPoStProver + DS dtypes.MetadataDS ConsiderOnlineStorageDealsConfigFunc dtypes.ConsiderOnlineStorageDealsConfigFunc SetConsiderOnlineStorageDealsConfigFunc dtypes.SetConsiderOnlineStorageDealsConfigFunc @@ -690,4 +696,12 @@ func (sm *StorageMinerAPI) ActorAddressConfig(ctx context.Context) (api.AddressC return sm.AddrSel.AddressConfig, nil } +func (sm *StorageMinerAPI) Discover(ctx context.Context) (apitypes.OpenRPCDocument, error) { + return build.OpenRPCDiscoverJSON_Miner(), nil +} + +func (sm *StorageMinerAPI) ComputeProof(ctx context.Context, ssi []builtin.SectorInfo, rand abi.PoStRandomness) ([]builtin.PoStProof, error) { + return sm.Epp.ComputeProof(ctx, ssi, rand) +} + var _ api.StorageMiner = &StorageMinerAPI{} diff --git a/node/modules/client.go b/node/modules/client.go index da6a4cd83..d54347835 100644 --- a/node/modules/client.go +++ b/node/modules/client.go @@ -7,12 +7,10 @@ import ( "path/filepath" "time" - "github.com/filecoin-project/go-multistore" - "github.com/filecoin-project/go-state-types/abi" + "go.uber.org/fx" "golang.org/x/xerrors" - "go.uber.org/fx" - + "github.com/filecoin-project/go-data-transfer/channelmonitor" dtimpl "github.com/filecoin-project/go-data-transfer/impl" dtnet "github.com/filecoin-project/go-data-transfer/network" dtgstransport "github.com/filecoin-project/go-data-transfer/transport/graphsync" @@ -25,6 +23,8 @@ import ( storageimpl "github.com/filecoin-project/go-fil-markets/storagemarket/impl" "github.com/filecoin-project/go-fil-markets/storagemarket/impl/requestvalidation" smnet "github.com/filecoin-project/go-fil-markets/storagemarket/network" + "github.com/filecoin-project/go-multistore" + "github.com/filecoin-project/go-state-types/abi" "github.com/filecoin-project/go-storedcounter" "github.com/ipfs/go-datastore" "github.com/ipfs/go-datastore/namespace" @@ -121,8 +121,6 @@ func RegisterClientValidator(crv dtypes.ClientRequestValidator, dtm dtypes.Clien // 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) { - sc := storedcounter.New(ds, datastore.NewKey("/datatransfer/client/counter")) - // go-data-transfer protocol retries: // 1s, 5s, 25s, 2m5s, 5m x 11 ~= 1 hour dtRetryParams := dtnet.RetryParameters(time.Second, 5*time.Minute, 15, 5) @@ -135,9 +133,30 @@ func NewClientGraphsyncDataTransfer(lc fx.Lifecycle, h host.Host, gs dtypes.Grap return nil, err } - // data-transfer push channel restart configuration - dtRestartConfig := dtimpl.PushChannelRestartConfig(time.Minute, 10, 1024, 10*time.Minute, 3) - dt, err := dtimpl.NewDataTransfer(dtDs, filepath.Join(r.Path(), "data-transfer"), net, transport, sc, dtRestartConfig) + // data-transfer push / pull channel restart configuration: + dtRestartConfig := dtimpl.ChannelRestartConfig(channelmonitor.Config{ + // For now only monitor push channels (for storage deals) + MonitorPushChannels: true, + // TODO: Enable pull channel monitoring (for retrievals) when the + // following issue has been fixed: + // https://github.com/filecoin-project/go-data-transfer/issues/172 + MonitorPullChannels: false, + // Wait up to 30s for the other side to respond to an Open channel message + AcceptTimeout: 30 * time.Second, + // Send a restart message if the data rate falls below 1024 bytes / minute + Interval: time.Minute, + MinBytesTransferred: 1024, + // Perform check 10 times / minute + ChecksPerInterval: 10, + // 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, + // Wait up to 30s for the other side to send a Complete message once all + // data has been sent / received + CompleteTimeout: 30 * time.Second, + }) + dt, err := dtimpl.NewDataTransfer(dtDs, filepath.Join(r.Path(), "data-transfer"), net, transport, dtRestartConfig) if err != nil { return nil, err } diff --git a/node/modules/paych.go b/node/modules/paych.go new file mode 100644 index 000000000..a9fd25a3e --- /dev/null +++ b/node/modules/paych.go @@ -0,0 +1,45 @@ +package modules + +import ( + "context" + + "github.com/filecoin-project/lotus/chain/stmgr" + "github.com/filecoin-project/lotus/node/impl/full" + "github.com/filecoin-project/lotus/node/modules/dtypes" + "github.com/filecoin-project/lotus/node/modules/helpers" + "github.com/filecoin-project/lotus/paychmgr" + "github.com/ipfs/go-datastore" + "github.com/ipfs/go-datastore/namespace" + "go.uber.org/fx" +) + +func NewManager(mctx helpers.MetricsCtx, lc fx.Lifecycle, sm stmgr.StateManagerAPI, pchstore *paychmgr.Store, api paychmgr.PaychAPI) *paychmgr.Manager { + ctx := helpers.LifecycleCtx(mctx, lc) + ctx, shutdown := context.WithCancel(ctx) + + return paychmgr.NewManager(ctx, shutdown, sm, pchstore, api) +} + +func NewPaychStore(ds dtypes.MetadataDS) *paychmgr.Store { + ds = namespace.Wrap(ds, datastore.NewKey("/paych/")) + return paychmgr.NewStore(ds) +} + +type PaychAPI struct { + fx.In + + full.MpoolAPI + full.StateAPI +} + +// HandlePaychManager is called by dependency injection to set up hooks +func HandlePaychManager(lc fx.Lifecycle, pm *paychmgr.Manager) { + lc.Append(fx.Hook{ + OnStart: func(ctx context.Context) error { + return pm.Start() + }, + OnStop: func(context.Context) error { + return pm.Stop() + }, + }) +} diff --git a/node/modules/storageminer.go b/node/modules/storageminer.go index d89474eee..1781d0493 100644 --- a/node/modules/storageminer.go +++ b/node/modules/storageminer.go @@ -330,7 +330,6 @@ func HandleMigrateProviderFunds(lc fx.Lifecycle, ds dtypes.MetadataDS, node api. // NewProviderDAGServiceDataTransfer returns a data transfer manager that just // uses the provider's Staging DAG service for transfers func NewProviderDAGServiceDataTransfer(lc fx.Lifecycle, h host.Host, gs dtypes.StagingGraphsync, ds dtypes.MetadataDS, r repo.LockedRepo) (dtypes.ProviderDataTransfer, error) { - sc := storedcounter.New(ds, datastore.NewKey("/datatransfer/provider/counter")) net := dtnet.NewFromLibp2pHost(h) dtDs := namespace.Wrap(ds, datastore.NewKey("/datatransfer/provider/transfers")) @@ -340,7 +339,7 @@ func NewProviderDAGServiceDataTransfer(lc fx.Lifecycle, h host.Host, gs dtypes.S return nil, err } - dt, err := dtimpl.NewDataTransfer(dtDs, filepath.Join(r.Path(), "data-transfer"), net, transport, sc) + dt, err := dtimpl.NewDataTransfer(dtDs, filepath.Join(r.Path(), "data-transfer"), net, transport) if err != nil { return nil, err } diff --git a/node/node_test.go b/node/node_test.go index fb1f1e810..a246ff65b 100644 --- a/node/node_test.go +++ b/node/node_test.go @@ -58,6 +58,9 @@ func TestAPIDealFlow(t *testing.T) { t.Run("TestPublishDealsBatching", func(t *testing.T) { test.TestPublishDealsBatching(t, builder.MockSbBuilder, blockTime, dealStartEpoch) }) + t.Run("TestBatchDealInput", func(t *testing.T) { + test.TestBatchDealInput(t, builder.MockSbBuilder, blockTime, dealStartEpoch) + }) } func TestAPIDealFlowReal(t *testing.T) { diff --git a/node/repo/fsrepo.go b/node/repo/fsrepo.go index d96a5e645..a40ae62d0 100644 --- a/node/repo/fsrepo.go +++ b/node/repo/fsrepo.go @@ -545,17 +545,31 @@ func (fsr *fsLockedRepo) Get(name string) (types.KeyInfo, error) { return res, nil } +const KTrashPrefix = "trash-" + // Put saves key info under given name func (fsr *fsLockedRepo) Put(name string, info types.KeyInfo) error { + return fsr.put(name, info, 0) +} + +func (fsr *fsLockedRepo) put(rawName string, info types.KeyInfo, retries int) error { if err := fsr.stillValid(); err != nil { return err } + name := rawName + if retries > 0 { + name = fmt.Sprintf("%s-%d", rawName, retries) + } + encName := base32.RawStdEncoding.EncodeToString([]byte(name)) keyPath := fsr.join(fsKeystore, encName) _, err := os.Stat(keyPath) - if err == nil { + if err == nil && strings.HasPrefix(name, KTrashPrefix) { + // retry writing the trash-prefixed file with a number suffix + return fsr.put(rawName, info, retries+1) + } else if err == nil { return xerrors.Errorf("checking key before put '%s': %w", name, types.ErrKeyExists) } else if !os.IsNotExist(err) { return xerrors.Errorf("checking key before put '%s': %w", name, err) diff --git a/paychmgr/manager.go b/paychmgr/manager.go index 5e0aa88ce..e9700bc9d 100644 --- a/paychmgr/manager.go +++ b/paychmgr/manager.go @@ -8,7 +8,6 @@ import ( "github.com/ipfs/go-cid" "github.com/ipfs/go-datastore" logging "github.com/ipfs/go-log/v2" - "go.uber.org/fx" xerrors "golang.org/x/xerrors" "github.com/filecoin-project/go-address" @@ -19,22 +18,12 @@ import ( "github.com/filecoin-project/lotus/chain/actors/builtin/paych" "github.com/filecoin-project/lotus/chain/stmgr" "github.com/filecoin-project/lotus/chain/types" - "github.com/filecoin-project/lotus/node/impl/full" - "github.com/filecoin-project/lotus/node/modules/helpers" ) var log = logging.Logger("paych") var errProofNotSupported = errors.New("payment channel proof parameter is not supported") -// PaychAPI is used by dependency injection to pass the consituent APIs to NewManager() -type PaychAPI struct { - fx.In - - full.MpoolAPI - full.StateAPI -} - // stateManagerAPI defines the methods needed from StateManager type stateManagerAPI interface { ResolveToKeyAddress(ctx context.Context, addr address.Address, ts *types.TipSet) (address.Address, error) @@ -43,7 +32,7 @@ type stateManagerAPI interface { } // paychAPI defines the API methods needed by the payment channel manager -type paychAPI interface { +type PaychAPI interface { StateAccountKey(context.Context, address.Address, types.TipSetKey) (address.Address, error) StateWaitMsg(ctx context.Context, msg cid.Cid, confidence uint64) (*api.MsgLookup, error) MpoolPushMessage(ctx context.Context, msg *types.Message, maxFee *api.MessageSendSpec) (*types.SignedMessage, error) @@ -55,13 +44,13 @@ type paychAPI interface { // managerAPI defines all methods needed by the manager type managerAPI interface { stateManagerAPI - paychAPI + PaychAPI } // managerAPIImpl is used to create a composite that implements managerAPI type managerAPIImpl struct { stmgr.StateManagerAPI - paychAPI + PaychAPI } type Manager struct { @@ -77,11 +66,8 @@ type Manager struct { channels map[string]*channelAccessor } -func NewManager(mctx helpers.MetricsCtx, lc fx.Lifecycle, sm stmgr.StateManagerAPI, pchstore *Store, api PaychAPI) *Manager { - ctx := helpers.LifecycleCtx(mctx, lc) - ctx, shutdown := context.WithCancel(ctx) - - impl := &managerAPIImpl{StateManagerAPI: sm, paychAPI: &api} +func NewManager(ctx context.Context, shutdown func(), sm stmgr.StateManagerAPI, pchstore *Store, api PaychAPI) *Manager { + impl := &managerAPIImpl{StateManagerAPI: sm, PaychAPI: api} return &Manager{ ctx: ctx, shutdown: shutdown, @@ -103,18 +89,6 @@ func newManager(pchstore *Store, pchapi managerAPI) (*Manager, error) { return pm, pm.Start() } -// HandleManager is called by dependency injection to set up hooks -func HandleManager(lc fx.Lifecycle, pm *Manager) { - lc.Append(fx.Hook{ - OnStart: func(ctx context.Context) error { - return pm.Start() - }, - OnStop: func(context.Context) error { - return pm.Stop() - }, - }) -} - // Start restarts tracking of any messages that were sent to chain. func (pm *Manager) Start() error { return pm.restartPending() diff --git a/paychmgr/paych_test.go b/paychmgr/paych_test.go index 8557dfb63..04ed5ce5c 100644 --- a/paychmgr/paych_test.go +++ b/paychmgr/paych_test.go @@ -23,6 +23,7 @@ import ( paychmock "github.com/filecoin-project/lotus/chain/actors/builtin/paych/mock" "github.com/filecoin-project/lotus/chain/types" "github.com/filecoin-project/lotus/lib/sigs" + _ "github.com/filecoin-project/lotus/lib/sigs/secp" ) func TestCheckVoucherValid(t *testing.T) { diff --git a/paychmgr/store.go b/paychmgr/store.go index a17ad1fcd..343149f93 100644 --- a/paychmgr/store.go +++ b/paychmgr/store.go @@ -14,14 +14,12 @@ import ( cborutil "github.com/filecoin-project/go-cbor-util" "github.com/ipfs/go-cid" "github.com/ipfs/go-datastore" - "github.com/ipfs/go-datastore/namespace" dsq "github.com/ipfs/go-datastore/query" "github.com/filecoin-project/go-address" cborrpc "github.com/filecoin-project/go-cbor-util" "github.com/filecoin-project/lotus/chain/actors/builtin/paych" - "github.com/filecoin-project/lotus/node/modules/dtypes" ) var ErrChannelNotTracked = errors.New("channel not tracked") @@ -30,8 +28,7 @@ type Store struct { ds datastore.Batching } -func NewStore(ds dtypes.MetadataDS) *Store { - ds = namespace.Wrap(ds, datastore.NewKey("/paych/")) +func NewStore(ds datastore.Batching) *Store { return &Store{ ds: ds, } diff --git a/testplans/lotus-soup/go.mod b/testplans/lotus-soup/go.mod index 9974fe81c..918b1f508 100644 --- a/testplans/lotus-soup/go.mod +++ b/testplans/lotus-soup/go.mod @@ -8,11 +8,11 @@ require ( github.com/davecgh/go-spew v1.1.1 github.com/drand/drand v1.2.1 github.com/filecoin-project/go-address v0.0.5 - github.com/filecoin-project/go-fil-markets v1.1.7 - github.com/filecoin-project/go-jsonrpc v0.1.2 - github.com/filecoin-project/go-state-types v0.0.0-20210119062722-4adba5aaea71 + github.com/filecoin-project/go-fil-markets v1.1.9 + github.com/filecoin-project/go-jsonrpc v0.1.4-0.20210217175800-45ea43ac2bec + github.com/filecoin-project/go-state-types v0.1.0 github.com/filecoin-project/go-storedcounter v0.0.0-20200421200003-1c99c62e8a5b - github.com/filecoin-project/lotus v1.5.0-pre3.0.20210209162308-5a3b9839540b + github.com/filecoin-project/lotus v1.5.2 github.com/filecoin-project/specs-actors v0.9.13 github.com/google/uuid v1.1.2 github.com/gorilla/mux v1.7.4 diff --git a/testplans/lotus-soup/go.sum b/testplans/lotus-soup/go.sum index 083fbafa4..67eb30cba 100644 --- a/testplans/lotus-soup/go.sum +++ b/testplans/lotus-soup/go.sum @@ -38,12 +38,12 @@ github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym github.com/DATA-DOG/go-sqlmock v1.3.3/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM= github.com/DataDog/zstd v1.4.1 h1:3oxKN3wbHibqx897utPC2LTQU4J+IHWWJO+glkAkpFM= github.com/DataDog/zstd v1.4.1/go.mod h1:1jcaCB/ufaK+sKp1NBhlGmpz41jOoPQ35bpF36t7BBo= +github.com/GeertJohan/go.incremental v1.0.0 h1:7AH+pY1XUgQE4Y1HcXYaMqAI0m9yrFqo/jt0CW30vsg= github.com/GeertJohan/go.incremental v1.0.0/go.mod h1:6fAjUhbVuX1KcMD3c8TEgVUqmo4seqhv0i0kdATSkM0= github.com/GeertJohan/go.rice v1.0.0 h1:KkI6O9uMaQU3VEKaj01ulavtF7o1fWT7+pk/4voiMLQ= github.com/GeertJohan/go.rice v1.0.0/go.mod h1:eH6gbSOAUv07dQuZVnBmoDP8mgsM1rtixis4Tib9if0= github.com/Gurpartap/async v0.0.0-20180927173644-4f7f499dd9ee h1:8doiS7ib3zi6/K172oDhSKU0dJ/miJramo9NITOMyZQ= github.com/Gurpartap/async v0.0.0-20180927173644-4f7f499dd9ee/go.mod h1:W0GbEAA4uFNYOGG2cJpmFJ04E6SD1NLELPYZB57/7AY= -github.com/Jeffail/gabs v1.4.0/go.mod h1:6xMvQMK4k33lb7GUUpaAPh6nKMmemQeg5d4gn7/bOXc= 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/OneOfOne/xxhash v1.2.2 h1:KMrpdQIwFcEqXDklaen+P1axHaj9BSKzvpUUfnHldSE= @@ -61,6 +61,7 @@ github.com/acarl005/stripansi v0.0.0-20180116102854-5a71ef0e047d/go.mod h1:asat6 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/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw= +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/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= @@ -253,31 +254,30 @@ github.com/filecoin-project/go-amt-ipld/v3 v3.0.0/go.mod h1:Qa95YNAbtoVCTSVtX38a github.com/filecoin-project/go-bitfield v0.2.0/go.mod h1:CNl9WG8hgR5mttCnUErjcQjGvuiZjRqK9rHVBsQF4oM= github.com/filecoin-project/go-bitfield v0.2.3 h1:pedK/7maYF06Z+BYJf2OeFFqIDEh6SP6mIOlLFpYXGs= github.com/filecoin-project/go-bitfield v0.2.3/go.mod h1:CNl9WG8hgR5mttCnUErjcQjGvuiZjRqK9rHVBsQF4oM= +github.com/filecoin-project/go-bitfield v0.2.4 h1:uZ7MeE+XfM5lqrHJZ93OnhQKc/rveW8p9au0C68JPgk= +github.com/filecoin-project/go-bitfield v0.2.4/go.mod h1:CNl9WG8hgR5mttCnUErjcQjGvuiZjRqK9rHVBsQF4oM= github.com/filecoin-project/go-cbor-util v0.0.0-20191219014500-08c40a1e63a2 h1:av5fw6wmm58FYMgJeoB/lK9XXrgdugYiTqkdxjTy9k8= github.com/filecoin-project/go-cbor-util v0.0.0-20191219014500-08c40a1e63a2/go.mod h1:pqTiPHobNkOVM5thSRsHYjyQfq7O5QSCMhvuu9JoDlg= github.com/filecoin-project/go-commp-utils v0.0.0-20201119054358-b88f7a96a434 h1:0kHszkYP3hgApcjl5x4rpwONhN9+j7XDobf6at5XfHs= github.com/filecoin-project/go-commp-utils v0.0.0-20201119054358-b88f7a96a434/go.mod h1:6s95K91mCyHY51RPWECZieD3SGWTqIFLf1mPOes9l5U= github.com/filecoin-project/go-crypto v0.0.0-20191218222705-effae4ea9f03 h1:2pMXdBnCiXjfCYx/hLqFxccPoqsSveQFxVLvNxy9bus= github.com/filecoin-project/go-crypto v0.0.0-20191218222705-effae4ea9f03/go.mod h1:+viYnvGtUTgJRdy6oaeF4MTFKAfatX071MPDPBL11EQ= -github.com/filecoin-project/go-data-transfer v1.0.1/go.mod h1:UxvfUAY9v3ub0a21BSK9u3pB2aq30Y0KMsG+w9/ysyo= -github.com/filecoin-project/go-data-transfer v1.2.7 h1:WE5Cpp9eMt5BDoWOVR64QegSn6bwHQaDzyyjVU377Y0= -github.com/filecoin-project/go-data-transfer v1.2.7/go.mod h1:mvjZ+C3NkBX10JP4JMu27DCjUouHFjHwUGh+Xc4yvDA= github.com/filecoin-project/go-ds-versioning v0.1.0 h1:y/X6UksYTsK8TLCI7rttCKEvl8btmWxyFMEeeWGUxIQ= github.com/filecoin-project/go-ds-versioning v0.1.0/go.mod h1:mp16rb4i2QPmxBnmanUx8i/XANp+PFCCJWiAb+VW4/s= github.com/filecoin-project/go-fil-commcid v0.0.0-20200716160307-8f644712406f/go.mod h1:Eaox7Hvus1JgPrL5+M3+h7aSPHc0cVqpSxA+TxIEpZQ= github.com/filecoin-project/go-fil-commcid v0.0.0-20201016201715-d41df56b4f6a h1:hyJ+pUm/4U4RdEZBlg6k8Ma4rDiuvqyGpoICXAxwsTg= 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-markets v1.0.5-0.20201113164554-c5eba40d5335/go.mod h1:AJySOJC00JRWEZzRG2KsfUnqEf5ITXxeX09BE9N4f9c= -github.com/filecoin-project/go-fil-markets v1.1.7 h1:7yy7alIDWzUxljxZhGmG3+wvaU4Ty5QDMbPmdZeaIJ8= -github.com/filecoin-project/go-fil-markets v1.1.7/go.mod h1:6oTRaAsHnCqhi3mpZqdvnWIzH6QzHQc4dbhJrI9/BfQ= +github.com/filecoin-project/go-fil-markets v1.1.9 h1:sA0NIEOpy7brZaeXeNgdXg5pvHaBtD5OTRlraOUbI0w= +github.com/filecoin-project/go-fil-markets v1.1.9/go.mod h1:0yQu5gvrjFoAIyzPSSJ+xUdCG83vjInAFbTswIB5/hk= 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= github.com/filecoin-project/go-hamt-ipld/v2 v2.0.0/go.mod h1:7aWZdaQ1b16BVoQUYR+eEvrDCGJoPLxFpDynFjYfBjI= github.com/filecoin-project/go-hamt-ipld/v3 v3.0.1 h1:zbzs46G7bOctkZ+JUX3xirrj0RaEsi+27dtlsgrTNBg= github.com/filecoin-project/go-hamt-ipld/v3 v3.0.1/go.mod h1:gXpNmr3oQx8l3o7qkGyDjJjYSRX7hp/FGOStdqrWyDI= -github.com/filecoin-project/go-jsonrpc v0.1.2 h1:MTebUawBHLxxY9gDi1WXuGc89TWIDmsgoDqeZSk9KRw= -github.com/filecoin-project/go-jsonrpc v0.1.2/go.mod h1:XBBpuKIMaXIIzeqzO1iucq4GvbF8CxmXRFoezRh+Cx4= +github.com/filecoin-project/go-jsonrpc v0.1.4-0.20210217175800-45ea43ac2bec h1:rGI5I7fdU4viManxmDdbk5deZO7afe6L1Wc04dAmlOM= +github.com/filecoin-project/go-jsonrpc v0.1.4-0.20210217175800-45ea43ac2bec/go.mod h1:XBBpuKIMaXIIzeqzO1iucq4GvbF8CxmXRFoezRh+Cx4= github.com/filecoin-project/go-multistore v0.0.3 h1:vaRBY4YiA2UZFPK57RNuewypB8u0DzzQwqsL0XarpnI= github.com/filecoin-project/go-multistore v0.0.3/go.mod h1:kaNqCC4IhU4B1uyr7YWFHd23TL4KM32aChS0jNkyUvQ= github.com/filecoin-project/go-padreader v0.0.0-20200903213702-ed5fae088b20 h1:+/4aUeUoKr6AKfPE3mBhXA5spIV6UcKdTYDPNU2Tdmg= @@ -288,16 +288,16 @@ github.com/filecoin-project/go-state-types v0.0.0-20200903145444-247639ffa6ad/go github.com/filecoin-project/go-state-types v0.0.0-20200904021452-1883f36ca2f4/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.0.0-20210119062722-4adba5aaea71 h1:Cas/CUB4ybYpdxvW7LouaydE16cpwdq3vvS3qgZuU+Q= -github.com/filecoin-project/go-state-types v0.0.0-20210119062722-4adba5aaea71/go.mod h1:ezYnPf0bNkTsDibL/psSz5dy4B5awOJ/E7P2Saeep8g= +github.com/filecoin-project/go-state-types v0.1.0 h1:9r2HCSMMCmyMfGyMKxQtv0GKp6VT/m5GgVk8EhYbLJU= +github.com/filecoin-project/go-state-types v0.1.0/go.mod h1:ezYnPf0bNkTsDibL/psSz5dy4B5awOJ/E7P2Saeep8g= github.com/filecoin-project/go-statemachine v0.0.0-20200925024713-05bd7c71fbfe h1:dF8u+LEWeIcTcfUcCf3WFVlc81Fr2JKg8zPzIbBDKDw= github.com/filecoin-project/go-statemachine v0.0.0-20200925024713-05bd7c71fbfe/go.mod h1:FGwQgZAt2Gh5mjlwJUlVB62JeYdo+if0xWxSEfBD9ig= github.com/filecoin-project/go-statestore v0.1.0 h1:t56reH59843TwXHkMcwyuayStBIiWBRilQjQ+5IiwdQ= github.com/filecoin-project/go-statestore v0.1.0/go.mod h1:LFc9hD+fRxPqiHiaqUEZOinUJB4WARkRfNl10O7kTnI= github.com/filecoin-project/go-storedcounter v0.0.0-20200421200003-1c99c62e8a5b h1:fkRZSPrYpk42PV3/lIXiL0LHetxde7vyYYvSsttQtfg= github.com/filecoin-project/go-storedcounter v0.0.0-20200421200003-1c99c62e8a5b/go.mod h1:Q0GQOBtKf1oE10eSXSlhN45kDBdGvEcVOqMiffqX+N8= -github.com/filecoin-project/lotus v1.5.0-pre3.0.20210209162308-5a3b9839540b h1:6L8LdxQDksFInGRmYbCrujBc7fEHip13T6UQX6iTk+I= -github.com/filecoin-project/lotus v1.5.0-pre3.0.20210209162308-5a3b9839540b/go.mod h1:frbnLE7QVAsmwe5XwTI6P0ZjjpGvA5/h1cM6yg2zhYM= +github.com/filecoin-project/lotus v1.5.2 h1:JXMTx9HYJ1G/sRPceNs4ZmGtYra5qpD22f3qDr2i0Zc= +github.com/filecoin-project/lotus v1.5.2/go.mod h1:ogeUSGizrAVxRbETP7Xe2muIXvxSyf+OfIb0kS4q3DQ= github.com/filecoin-project/specs-actors v0.9.4/go.mod h1:BStZQzx5x7TmCkLv0Bpa07U6cPKol6fd3w9KjMPZ6Z4= github.com/filecoin-project/specs-actors v0.9.12/go.mod h1:TS1AW/7LbG+615j4NsjMK1qlpAwaFsG9w0V2tg2gSao= github.com/filecoin-project/specs-actors v0.9.13 h1:rUEOQouefi9fuVY/2HOroROJlZbOzWYXXeIh41KF2M4= @@ -306,8 +306,8 @@ github.com/filecoin-project/specs-actors/v2 v2.0.1/go.mod h1:v2NZVYinNIKA9acEMBm github.com/filecoin-project/specs-actors/v2 v2.3.2/go.mod h1:UuJQLoTx/HPvvWeqlIFmC/ywlOLHNe8SNQ3OunFbu2Y= github.com/filecoin-project/specs-actors/v2 v2.3.4 h1:NZK2oMCcA71wNsUzDBmLQyRMzcCnX9tDGvwZ53G67j8= github.com/filecoin-project/specs-actors/v2 v2.3.4/go.mod h1:UuJQLoTx/HPvvWeqlIFmC/ywlOLHNe8SNQ3OunFbu2Y= -github.com/filecoin-project/specs-actors/v3 v3.0.1-0.20210128235937-57195d8909b1 h1:I6mvbwANIoToUZ37cYmuLyDKbPlAUxWnp0fJOZnlTz4= -github.com/filecoin-project/specs-actors/v3 v3.0.1-0.20210128235937-57195d8909b1/go.mod h1:NL24TPjJGyU7fh1ztpUyYcoZi3TmRKNEI0huPYmhObA= +github.com/filecoin-project/specs-actors/v3 v3.0.3 h1:bq9B1Jnq+Z0A+Yj3KnYhN3kcTpUyP6Umo3MZgai0BRE= +github.com/filecoin-project/specs-actors/v3 v3.0.3/go.mod h1:oMcmEed6B7H/wHabM3RQphTIhq0ibAKsbpYs+bQ/uxQ= github.com/filecoin-project/specs-storage v0.1.1-0.20201105051918-5188d9774506 h1:Ur/l2+6qN+lQiqjozWWc5p9UDaAMDZKTlDS98oRnlIw= github.com/filecoin-project/specs-storage v0.1.1-0.20201105051918-5188d9774506/go.mod h1:nJRRM7Aa9XVvygr3W9k6xGF46RWzr2zxF/iGoAIfA/g= github.com/filecoin-project/test-vectors/schema v0.0.5/go.mod h1:iQ9QXLpYWL3m7warwvK1JC/pTri8mnfEmKygNDqqY6E= @@ -531,6 +531,8 @@ github.com/ipfs/go-bitswap v0.3.2/go.mod h1:AyWWfN3moBzQX0banEtfKOfbXb3ZeoOeXnZG github.com/ipfs/go-block-format v0.0.1/go.mod h1:DK/YYcsSUIVAFNwo/KZCdIIbpN0ROH/baNLgayt4pFc= github.com/ipfs/go-block-format v0.0.2 h1:qPDvcP19izTjU8rgo6p7gTXZlkMkF5bz5G3fqIsSCPE= github.com/ipfs/go-block-format v0.0.2/go.mod h1:AWR46JfpcObNfg3ok2JHDUfdiHRgWhJgCQF+KIgOPJY= +github.com/ipfs/go-block-format v0.0.3 h1:r8t66QstRp/pd/or4dpnbVfXT5Gt7lOqRvC+/dDTpMc= +github.com/ipfs/go-block-format v0.0.3/go.mod h1:4LmD4ZUw0mhO+JSKdpWwrzATiEfM7WWgQ8H5l6P8MVk= github.com/ipfs/go-blockservice v0.0.3/go.mod h1:/NNihwTi6V2Yr6g8wBI+BSwPuURpBRMtYNGrlxZ8KuI= github.com/ipfs/go-blockservice v0.0.7/go.mod h1:EOfb9k/Y878ZTRY/CH0x5+ATtaipfbRhbvNSdgc/7So= github.com/ipfs/go-blockservice v0.1.0/go.mod h1:hzmMScl1kXHg3M2BjTymbVPjv627N7sYcvYaKbop39M= @@ -586,10 +588,11 @@ github.com/ipfs/go-filestore v1.0.0/go.mod h1:/XOCuNtIe2f1YPbiXdYvD0BKLA0JR1MgPi github.com/ipfs/go-fs-lock v0.0.6 h1:sn3TWwNVQqSeNjlWy6zQ1uUGAZrV3hPOyEA6y1/N2a0= github.com/ipfs/go-fs-lock v0.0.6/go.mod h1:OTR+Rj9sHiRubJh3dRhD15Juhd/+w6VPOY28L7zESmM= github.com/ipfs/go-graphsync v0.1.0/go.mod h1:jMXfqIEDFukLPZHqDPp8tJMbHO9Rmeb9CEGevngQbmE= -github.com/ipfs/go-graphsync v0.4.2/go.mod h1:/VmbZTUdUMTbNkgzAiCEucIIAU3BkLE2cZrDCVUhyi0= github.com/ipfs/go-graphsync v0.4.3/go.mod h1:mPOwDYv128gf8gxPFgXnz4fNrSYPsWyqisJ7ych+XDY= github.com/ipfs/go-graphsync v0.5.2 h1:USD+daaSC+7pLHCxROThSaF6SF7WYXF03sjrta0rCfA= github.com/ipfs/go-graphsync v0.5.2/go.mod h1:e2ZxnClqBBYAtd901g9vXMJzS47labjAtOzsWtOzKNk= +github.com/ipfs/go-graphsync v0.6.0 h1:x6UvDUGA7wjaKNqx5Vbo7FGT8aJ5ryYA0dMQ5jN3dF0= +github.com/ipfs/go-graphsync v0.6.0/go.mod h1:e2ZxnClqBBYAtd901g9vXMJzS47labjAtOzsWtOzKNk= github.com/ipfs/go-hamt-ipld v0.1.1/go.mod h1:1EZCr2v0jlCnhpa+aZ0JZYp8Tt2w16+JJOAVz17YcDk= 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= @@ -727,6 +730,7 @@ github.com/jbenet/goprocess v0.1.4 h1:DRGOFReOMqqDNXwW70QkacFW0YN9QnwLV0Vqk+3oU0 github.com/jbenet/goprocess v0.1.4/go.mod h1:5yspPrukOVuOLORacaBi858NqyClJPQxYZlqdZVfqY4= github.com/jellevandenhooff/dkim v0.0.0-20150330215556-f50fe3d243e1/go.mod h1:E0B/fFc00Y+Rasa88328GlI/XbtyysCtTHZS8h7IrBU= 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/jmespath/go-jmespath v0.3.0/go.mod h1:9QtRXoHjLGCJ5IBSaohpXITPlowMeeYCZ7fLUTSywik= @@ -960,8 +964,8 @@ github.com/libp2p/go-libp2p-protocol v0.1.0/go.mod h1:KQPHpAabB57XQxGrXCNvbL6UEX github.com/libp2p/go-libp2p-pubsub v0.1.1/go.mod h1:ZwlKzRSe1eGvSIdU5bD7+8RZN/Uzw0t1Bp9R1znpR/Q= github.com/libp2p/go-libp2p-pubsub v0.3.2-0.20200527132641-c0712c6e92cf/go.mod h1:TxPOBuo1FPdsTjFnv+FGZbNbWYsp74Culx+4ViQpato= github.com/libp2p/go-libp2p-pubsub v0.3.2/go.mod h1:Uss7/Cfz872KggNb+doCVPHeCDmXB7z500m/R8DaAUk= -github.com/libp2p/go-libp2p-pubsub v0.4.1 h1:j4umIg5nyus+sqNfU+FWvb9aeYFQH/A+nDFhWj+8yy8= -github.com/libp2p/go-libp2p-pubsub v0.4.1/go.mod h1:izkeMLvz6Ht8yAISXjx60XUQZMq9ZMe5h2ih4dLIBIQ= +github.com/libp2p/go-libp2p-pubsub v0.4.2-0.20210212194758-6c1addf493eb h1:HExLcdXn8fgtXPciUw97O5NNhBn31dt6d9fVUD4cngo= +github.com/libp2p/go-libp2p-pubsub v0.4.2-0.20210212194758-6c1addf493eb/go.mod h1:izkeMLvz6Ht8yAISXjx60XUQZMq9ZMe5h2ih4dLIBIQ= github.com/libp2p/go-libp2p-pubsub-tracer v0.0.0-20200626141350-e730b32bf1e6 h1:2lH7rMlvDPSvXeOR+g7FE6aqiEwxtpxWKQL8uigk5fQ= github.com/libp2p/go-libp2p-pubsub-tracer v0.0.0-20200626141350-e730b32bf1e6/go.mod h1:8ZodgKS4qRLayfw9FDKDd9DX4C16/GMofDxSldG8QPI= github.com/libp2p/go-libp2p-quic-transport v0.1.1/go.mod h1:wqG/jzhF3Pu2NrhJEvE+IE0NTHNXslOPn9JQzyCAxzU= @@ -1254,9 +1258,14 @@ github.com/nats-io/nkeys v0.1.3/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxzi 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/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= +github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/nikkolasg/hexjson v0.0.0-20181101101858-78e39397e00c h1:5bFTChQxSKNwy8ALwOebjekYExl9HTT9urdawqC95tA= github.com/nikkolasg/hexjson v0.0.0-20181101101858-78e39397e00c/go.mod h1:7qN3Y0BvzRUf4LofcoJplQL10lsFDb4PYlePTVwrP28= +github.com/nkovacs/streamquote v0.0.0-20170412213628-49af9bddb229 h1:E2B8qYyeSgv5MXpmzZXRNp8IAQ4vjxIjhpAf5hv/tAg= github.com/nkovacs/streamquote v0.0.0-20170412213628-49af9bddb229/go.mod h1:0aYXnNPJ8l7uZxf45rWW1a/uME32OF0rhiYGNQ2oF2E= +github.com/nonsense/go-data-transfer v0.0.2 h1:WmkpzXYsGFeNTCpuEtJXJauT0qehWJsKITWWqTOFDzE= +github.com/nonsense/go-data-transfer v0.0.2/go.mod h1:n8kbDQXWrY1c4UgfMa9KERxNCWbOTDwdNhf2MpN9dpo= 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= @@ -1494,7 +1503,9 @@ github.com/urfave/cli v1.22.2/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtX github.com/urfave/cli/v2 v2.0.0/go.mod h1:SE9GqnLQmjVa0iPEY0f1w3ygNIYcIJ0OKPMoW2caLfQ= github.com/urfave/cli/v2 v2.2.0 h1:JTTnM6wKzdA0Jqodd966MVj4vWbbquZykeX1sKbe2C4= github.com/urfave/cli/v2 v2.2.0/go.mod h1:SE9GqnLQmjVa0iPEY0f1w3ygNIYcIJ0OKPMoW2caLfQ= +github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw= github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= +github.com/valyala/fasttemplate v1.0.1 h1:tY9CJiPnMXf1ERmG2EyK7gNUd+c6RKGD0IfU8WdUSz8= 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= @@ -1523,6 +1534,8 @@ github.com/whyrusleeping/cbor-gen v0.0.0-20200812213548-958ddffe352c/go.mod h1:f 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 h1:7HzUKl5d/dELS9lLeT4W6YvliZx+s9k/eOOIdHKrA/w= github.com/whyrusleeping/cbor-gen v0.0.0-20210118024343-169e9d70c0c2/go.mod h1:fgkXqYy7bV2cFeIEOkVTZS/WjXARfBqSH6Q2qHL33hQ= +github.com/whyrusleeping/cbor-gen v0.0.0-20210219115102-f37d292932f2 h1:bsUlNhdmbtlfdLVXAVfuvKQ01RnWAM09TVrJkI7NZs4= +github.com/whyrusleeping/cbor-gen v0.0.0-20210219115102-f37d292932f2/go.mod h1:fgkXqYy7bV2cFeIEOkVTZS/WjXARfBqSH6Q2qHL33hQ= github.com/whyrusleeping/chunker v0.0.0-20181014151217-fe64bd25879f h1:jQa4QT2UP9WYv2nzyawpKMOCl+Z/jW7djv2/J50lj9E= github.com/whyrusleeping/chunker v0.0.0-20181014151217-fe64bd25879f/go.mod h1:p9UJB6dDgdPgMJZs7UjUOdulKyRr9fqkS+6JKAInPy8= github.com/whyrusleeping/go-ctrlnet v0.0.0-20180313164037-f564fbbdaa95/go.mod h1:SJqKCCPXRfBFCwXjfNT/skfsceF7+MBFLI2OrvuRA7g= @@ -1821,6 +1834,8 @@ golang.org/x/sys v0.0.0-20200812155832-6a926be9bd1d/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200926100807-9d91bd62050c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f h1:+Nyd8tzPX9R7BWHguqsrbFdRx3WQ/1ib8I44HXV5yTA= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68 h1:nxC68pudNYkKU6jWhgrqdreuFiOQWj1Fs7T3VrH4Pjw= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1967,6 +1982,8 @@ gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8 gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU= +gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= 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= diff --git a/tools/packer/etc/motd b/tools/packer/etc/motd index 78e97e1c6..5966d972b 100644 --- a/tools/packer/etc/motd +++ b/tools/packer/etc/motd @@ -52,6 +52,13 @@ You only need to do this once, after which, you can enable and start the miner. +Do you want to access your lotus daemon remotely? Learn how to setup token authentication +and use client libraries from lotus docs. + +https://docs.filecoin.io/build/lotus/enable-remote-api-access/ + + + For more information, see https://docs.filecoin.io/ Found a bug? let us know! https://github.com/filecoin-project/lotus Chat with us on slack! https://filecoinproject.slack.com/archives/CEGN061C5 diff --git a/tools/packer/homedir/bashrc b/tools/packer/homedir/bashrc index 8bda25044..db4dbd0b6 100644 --- a/tools/packer/homedir/bashrc +++ b/tools/packer/homedir/bashrc @@ -1,5 +1,12 @@ PS1="[\h \w] ⨎ " export PROMT_DIRTRIM=1 + +# Where to find the lotus repo export LOTUS_PATH=/var/lib/lotus -export LOTUS_MINER_PATH=/var/lib/lotus-miner + +# The miner is not running in this image by default. +# export LOTUS_MINER_PATH=/var/lib/lotus-miner + +# To access the lotus node remotely, the following environment variable may be used. +# export FULLNODE_API_INFO=:/ip4//tcp/1234/http diff --git a/tools/packer/lotus.pkr.hcl b/tools/packer/lotus.pkr.hcl index b67e59f76..8ef41613b 100644 --- a/tools/packer/lotus.pkr.hcl +++ b/tools/packer/lotus.pkr.hcl @@ -20,7 +20,23 @@ locals { source "amazon-ebs" "lotus" { ami_name = "lotus-${var.lotus_network}-${var.git_tag}-${local.timestamp}" ami_regions = [ + "ap-east-1", + "ap-northeast-1", + "ap-northeast-2", + "ap-northeast-3", + "ap-south-1", + "ap-southeast-1", + "ap-southeast-2", + "ca-central-1", + "eu-central-1", + "eu-north-1", + "eu-west-1", + "eu-west-2", + "eu-west-3", + "sa-east-1", "us-east-1", + "us-east-2", + "us-west-1", "us-west-2", ] ami_groups = [ @@ -37,7 +53,7 @@ source "amazon-ebs" "lotus" { instance_type = "t2.micro" source_ami_filter { filters = { - name = "ubuntu-minimal/images/*ubuntu-focal-20.04-amd64-minimal*" + name = "ubuntu/images/*ubuntu-focal-20.04-amd64-server-*" root-device-type = "ebs" virtualization-type = "hvm" } @@ -85,6 +101,10 @@ build { source = "./tools/packer/systemd/lotus-miner.service" destination = "lotus-miner.service" } + provisioner "file" { + source = "./tools/packer/repo/config.toml" + destination = "config.toml" + } provisioner "file" { source = "./tools/packer/etc/motd" destination = "motd" diff --git a/tools/packer/repo/config.toml b/tools/packer/repo/config.toml new file mode 100644 index 000000000..b8cbf0ec3 --- /dev/null +++ b/tools/packer/repo/config.toml @@ -0,0 +1,36 @@ +[API] +ListenAddress = "/ip4/0.0.0.0/tcp/1234/http" +# RemoteListenAddress = "" +# Timeout = "30s" +# +[Libp2p] +ListenAddresses = ["/ip4/0.0.0.0/tcp/5678", "/ip6/::/tcp/5678"] +# AnnounceAddresses = [] +# NoAnnounceAddresses = [] +# ConnMgrLow = 150 +# ConnMgrHigh = 180 +# ConnMgrGrace = "20s" +# +[Pubsub] +# Bootstrapper = false +# RemoteTracer = "/dns4/pubsub-tracer.filecoin.io/tcp/4001/p2p/QmTd6UvR47vUidRNZ1ZKXHrAFhqTJAD27rKL9XYghEKgKX" +# +[Client] +# UseIpfs = false +# IpfsOnlineMode = false +# IpfsMAddr = "" +# IpfsUseForRetrieval = false +# SimultaneousTransfers = 20 +# +[Metrics] +# Nickname = "" +# HeadNotifs = false +# +[Wallet] +# RemoteBackend = "" +# EnableLedger = false +# DisableLocal = false +# +[Fees] +# DefaultMaxFee = "0.007 FIL" +# diff --git a/tools/packer/setup.sh b/tools/packer/setup.sh index d7d21664a..04d06a7d1 100644 --- a/tools/packer/setup.sh +++ b/tools/packer/setup.sh @@ -22,11 +22,14 @@ MANAGED_FILES=( /lib/systemd/system/lotus-daemon.service /lib/systemd/system/lotus-miner.service /etc/motd + /var/lib/lotus/config.toml ) # install libs. -apt update -apt -y install libhwloc15 ocl-icd-libopencl1 +export DEBIAN_FRONTEND=noninteractive +apt-get update +apt-get -y install libhwloc15 ocl-icd-libopencl1 ufw +apt-get -y upgrade -q -y -u -o Dpkg::Options::="--force-confold" ln -s /usr/lib/x86_64-linux-gnu/libhwloc.so.15 /usr/lib/x86_64-linux-gnu/libhwloc.so.5 # Create lotus user @@ -55,3 +58,10 @@ done # Enable services systemctl daemon-reload systemctl enable lotus-daemon + +# Setup firewall +ufw enable +ufw default deny incoming +ufw default allow outgoing +ufw allow ssh +ufw allow 5678 #libp2p