diff --git a/app/client/apiface/network.go b/app/client/apiface/network.go index b95c832392..d2251597dd 100644 --- a/app/client/apiface/network.go +++ b/app/client/apiface/network.go @@ -22,7 +22,7 @@ type INetwork interface { // Rule[perm:read] NetworkFindProvidersAsync(ctx context.Context, key cid.Cid, count int) <-chan peer.AddrInfo // Rule[perm:read] - NetworkGetClosestPeers(ctx context.Context, key string) (<-chan peer.ID, error) + NetworkGetClosestPeers(ctx context.Context, key string) ([]peer.ID, error) // Rule[perm:read] NetworkFindPeer(ctx context.Context, peerID peer.ID) (peer.AddrInfo, error) // Rule[perm:read] diff --git a/app/client/apiface/v0api/network.go b/app/client/apiface/v0api/network.go index 1229741989..b909ee2240 100644 --- a/app/client/apiface/v0api/network.go +++ b/app/client/apiface/v0api/network.go @@ -21,7 +21,7 @@ type INetwork interface { // Rule[perm:read] NetworkFindProvidersAsync(ctx context.Context, key cid.Cid, count int) <-chan peer.AddrInfo // Rule[perm:admin] - NetworkGetClosestPeers(ctx context.Context, key string) (<-chan peer.ID, error) + NetworkGetClosestPeers(ctx context.Context, key string) ([]peer.ID, error) // Rule[perm:read] NetworkFindPeer(ctx context.Context, peerID peer.ID) (peer.AddrInfo, error) // Rule[perm:read] diff --git a/app/client/v0api/full.go b/app/client/v0api/full.go index 7fc28845de..a879cf51aa 100644 --- a/app/client/v0api/full.go +++ b/app/client/v0api/full.go @@ -726,7 +726,7 @@ type INetworkStruct struct { NetworkFindPeer func(p0 context.Context, p1 peer.ID) (peer.AddrInfo, error) `perm:"read"` NetworkFindProvidersAsync func(p0 context.Context, p1 cid.Cid, p2 int) <-chan peer.AddrInfo `perm:"read"` NetworkGetBandwidthStats func(p0 context.Context) metrics.Stats `perm:"admin"` - NetworkGetClosestPeers func(p0 context.Context, p1 string) (<-chan peer.ID, error) `perm:"admin"` + NetworkGetClosestPeers func(p0 context.Context, p1 string) ([]peer.ID, error) `perm:"admin"` NetworkGetPeerAddresses func(p0 context.Context) []ma.Multiaddr `perm:"admin"` NetworkGetPeerID func(p0 context.Context) peer.ID `perm:"admin"` NetworkPeers func(p0 context.Context, p1 bool, p2 bool, p3 bool) (*net.SwarmConnInfos, error) `perm:"read"` @@ -754,7 +754,7 @@ func (s *INetworkStruct) NetworkGetBandwidthStats(p0 context.Context) metrics.St return s.Internal.NetworkGetBandwidthStats(p0) } -func (s *INetworkStruct) NetworkGetClosestPeers(p0 context.Context, p1 string) (<-chan peer.ID, error) { +func (s *INetworkStruct) NetworkGetClosestPeers(p0 context.Context, p1 string) ([]peer.ID, error) { return s.Internal.NetworkGetClosestPeers(p0, p1) } diff --git a/app/node/builder.go b/app/node/builder.go index 5a9683417d..0183ffb7aa 100644 --- a/app/node/builder.go +++ b/app/node/builder.go @@ -4,14 +4,13 @@ import ( "context" "time" - chain2 "github.com/filecoin-project/venus/pkg/chain" - "github.com/filecoin-project/venus/pkg/jwtauth" - "github.com/filecoin-project/venus/pkg/util/ffiwrapper/impl" - types "github.com/filecoin-project/venus/venus-shared/chain" - "github.com/ipfs-force-community/metrics/ratelimit" logging "github.com/ipfs/go-log" + "github.com/libp2p/go-libp2p" + "github.com/pkg/errors" "golang.org/x/xerrors" + "github.com/ipfs-force-community/metrics/ratelimit" + "github.com/filecoin-project/venus/app/submodule/blockstore" "github.com/filecoin-project/venus/app/submodule/chain" config2 "github.com/filecoin-project/venus/app/submodule/config" @@ -26,13 +25,15 @@ import ( "github.com/filecoin-project/venus/app/submodule/storagenetworking" "github.com/filecoin-project/venus/app/submodule/syncer" "github.com/filecoin-project/venus/app/submodule/wallet" + chain2 "github.com/filecoin-project/venus/pkg/chain" "github.com/filecoin-project/venus/pkg/clock" "github.com/filecoin-project/venus/pkg/journal" + "github.com/filecoin-project/venus/pkg/jwtauth" "github.com/filecoin-project/venus/pkg/paychmgr" "github.com/filecoin-project/venus/pkg/repo" "github.com/filecoin-project/venus/pkg/util/ffiwrapper" - "github.com/libp2p/go-libp2p" - "github.com/pkg/errors" + "github.com/filecoin-project/venus/pkg/util/ffiwrapper/impl" + types "github.com/filecoin-project/venus/venus-shared/chain" ) // Builder is a helper to aid in the construction of a filecoin node. @@ -84,7 +85,7 @@ func (b *Builder) build(ctx context.Context) (*Node, error) { } // fetch genesis block id - b.genBlk, err = readGenesisCid(b.repo.ChainDatastore(), b.repo.Datastore()) + b.genBlk, err = readGenesisCid(ctx, b.repo.ChainDatastore(), b.repo.Datastore()) if err != nil { return nil, err } @@ -143,7 +144,7 @@ func (b *Builder) build(ctx context.Context) (*Node, error) { return nil, errors.Wrap(err, "failed to build node.wallet") } - nd.mpool, err = mpool.NewMpoolSubmodule((*builder)(b), nd.network, nd.chain, nd.wallet) + nd.mpool, err = mpool.NewMpoolSubmodule(ctx, (*builder)(b), nd.network, nd.chain, nd.wallet) if err != nil { return nil, errors.Wrap(err, "failed to build node.mpool") } diff --git a/app/node/helpers.go b/app/node/helpers.go index 614b6d2c16..9f8e49f8fc 100644 --- a/app/node/helpers.go +++ b/app/node/helpers.go @@ -2,6 +2,7 @@ package node import ( "bytes" + "context" "encoding/json" "github.com/ipfs/go-cid" @@ -15,8 +16,8 @@ import ( // readGenesisCid is a helper function that queries the provided datastore for // an entry with the genesisKey cid, returning if found. -func readGenesisCid(chainDs datastore.Datastore, bs blockstoreutil.Blockstore) (types.BlockHeader, error) { - bb, err := chainDs.Get(chain.GenesisKey) +func readGenesisCid(ctx context.Context, chainDs datastore.Datastore, bs blockstoreutil.Blockstore) (types.BlockHeader, error) { + bb, err := chainDs.Get(ctx, chain.GenesisKey) if err != nil { return types.BlockHeader{}, errors.Wrap(err, "failed to read genesisKey") } @@ -27,7 +28,7 @@ func readGenesisCid(chainDs datastore.Datastore, bs blockstoreutil.Blockstore) ( return types.BlockHeader{}, errors.Wrap(err, "failed to cast genesisCid") } - blkRawData, err := bs.Get(c) + blkRawData, err := bs.Get(ctx, c) if err != nil { return types.BlockHeader{}, errors.Wrap(err, "failed to read genesis block") } diff --git a/app/node/init.go b/app/node/init.go index 7387f3d063..e3b40d970a 100644 --- a/app/node/init.go +++ b/app/node/init.go @@ -77,19 +77,21 @@ func Init(ctx context.Context, r repo.Repo, gen genesis.InitFunc, opts ...InitOp return nil } -func initPeerKey(store fskeystore.Keystore, key acrypto.PrivKey) error { +func initPeerKey(store fskeystore.Keystore, pk acrypto.PrivKey) error { var err error - if key == nil { - key, _, err = acrypto.GenerateKeyPair(acrypto.RSA, defaultPeerKeyBits) + if pk == nil { + pk, _, err = acrypto.GenerateKeyPair(acrypto.RSA, defaultPeerKeyBits) if err != nil { return errors.Wrap(err, "failed to create peer key") } } - data, err := key.Bytes() + + kbytes, err := acrypto.MarshalPrivateKey(pk) if err != nil { return err } - if err := store.Put("self", data); err != nil { + + if err := store.Put("self", kbytes); err != nil { return errors.Wrap(err, "failed to store private key") } return nil diff --git a/app/node/node.go b/app/node/node.go index cc4a0fe3a7..97a8dc7153 100644 --- a/app/node/node.go +++ b/app/node/node.go @@ -189,7 +189,7 @@ func (node *Node) Start(ctx context.Context) error { return err } - err = node.paychan.Start() + err = node.paychan.Start(ctx) if err != nil { return err } diff --git a/app/node/test/node.go b/app/node/test/node.go index 27663dd690..1ecd417cc0 100644 --- a/app/node/test/node.go +++ b/app/node/test/node.go @@ -5,12 +5,6 @@ import ( "math/rand" "testing" - "github.com/filecoin-project/venus/pkg/util/ffiwrapper/impl" - types "github.com/filecoin-project/venus/venus-shared/chain" - - "github.com/filecoin-project/go-address" - "github.com/filecoin-project/venus/app/node" - "github.com/filecoin-project/venus/pkg/util/blockstoreutil" ds "github.com/ipfs/go-datastore" blockstore "github.com/ipfs/go-ipfs-blockstore" cbor "github.com/ipfs/go-ipld-cbor" @@ -18,12 +12,18 @@ import ( "github.com/libp2p/go-libp2p-core/peer" "github.com/stretchr/testify/require" + "github.com/filecoin-project/go-address" "github.com/filecoin-project/go-state-types/abi" + + "github.com/filecoin-project/venus/app/node" "github.com/filecoin-project/venus/fixtures/fortest" "github.com/filecoin-project/venus/pkg/config" "github.com/filecoin-project/venus/pkg/constants" + "github.com/filecoin-project/venus/pkg/util/blockstoreutil" + "github.com/filecoin-project/venus/pkg/util/ffiwrapper/impl" "github.com/filecoin-project/venus/pkg/wallet" gengen "github.com/filecoin-project/venus/tools/gengen/util" + types "github.com/filecoin-project/venus/venus-shared/chain" ) // ChainSeed is a generalized struct for configuring node @@ -63,15 +63,15 @@ func (cs *ChainSeed) GenesisInitFunc(cst cbor.IpldStore, bs blockstore.Blockstor } // GiveKey gives the given key to the given node -func (cs *ChainSeed) GiveKey(t *testing.T, nd *node.Node, key int) address.Address { +func (cs *ChainSeed) GiveKey(ctx context.Context, t *testing.T, nd *node.Node, key int) address.Address { t.Helper() bcks := nd.Wallet().Wallet.Backends(wallet.DSBackendType) require.Len(t, bcks, 1, "expected to get exactly one datastore backend") dsb := bcks[0].(*wallet.DSBackend) - _ = dsb.SetPassword(wallet.TestPassword) + _ = dsb.SetPassword(ctx, wallet.TestPassword) kinfo := cs.info.Keys[key] - require.NoError(t, dsb.ImportKey(kinfo)) + require.NoError(t, dsb.ImportKey(ctx, kinfo)) addr, err := kinfo.Address() require.NoError(t, err) diff --git a/app/node/test/setup.go b/app/node/test/setup.go index 0ab72e42f8..ccd4fe791b 100644 --- a/app/node/test/setup.go +++ b/app/node/test/setup.go @@ -47,7 +47,7 @@ func CreateBootstrapMiner(ctx context.Context, t *testing.T, seed *ChainSeed, ch WithBuilderOpt(node.MonkeyPatchSetProofTypeOption(constants.DevRegisteredSealProof)). Build(ctx) - addr := seed.GiveKey(t, bootstrapMiner, 0) + addr := seed.GiveKey(ctx, t, bootstrapMiner, 0) err := bootstrapMiner.ConfigModule().API().ConfigSet(ctx, "walletModule.defaultAddress", addr.String()) require.NoError(t, err) @@ -60,7 +60,7 @@ func CreateBootstrapMiner(ctx context.Context, t *testing.T, seed *ChainSeed, ch } func initNodeGenesisMiner(ctx context.Context, t *testing.T, nd *node.Node, seed *ChainSeed, minerIdx int) (address.Address, address.Address, error) { - seed.GiveKey(t, nd, minerIdx) + seed.GiveKey(ctx, t, nd, minerIdx) miner, owner := seed.GiveMiner(t, nd, 0) return miner, owner, nil diff --git a/app/submodule/blockstore/blockstore_api.go b/app/submodule/blockstore/blockstore_api.go index 8702fee067..1ed8e86d67 100644 --- a/app/submodule/blockstore/blockstore_api.go +++ b/app/submodule/blockstore/blockstore_api.go @@ -22,7 +22,7 @@ type blockstoreAPI struct { //nolint } func (blockstoreAPI *blockstoreAPI) ChainReadObj(ctx context.Context, ocid cid.Cid) ([]byte, error) { - blk, err := blockstoreAPI.blockstore.Blockstore.Get(ocid) + blk, err := blockstoreAPI.blockstore.Blockstore.Get(ctx, ocid) if err != nil { return nil, xerrors.Errorf("blockstore get: %w", err) } @@ -31,11 +31,11 @@ func (blockstoreAPI *blockstoreAPI) ChainReadObj(ctx context.Context, ocid cid.C } func (blockstoreAPI *blockstoreAPI) ChainDeleteObj(ctx context.Context, obj cid.Cid) error { - return blockstoreAPI.blockstore.Blockstore.DeleteBlock(obj) + return blockstoreAPI.blockstore.Blockstore.DeleteBlock(ctx, obj) } func (blockstoreAPI *blockstoreAPI) ChainHasObj(ctx context.Context, obj cid.Cid) (bool, error) { - return blockstoreAPI.blockstore.Blockstore.Has(obj) + return blockstoreAPI.blockstore.Blockstore.Has(ctx, obj) } func (blockstoreAPI *blockstoreAPI) ChainStatObj(ctx context.Context, obj cid.Cid, base cid.Cid) (apitypes.ObjStat, error) { diff --git a/app/submodule/chain/account_api.go b/app/submodule/chain/account_api.go index 86125c9e47..a68cab971b 100644 --- a/app/submodule/chain/account_api.go +++ b/app/submodule/chain/account_api.go @@ -23,7 +23,7 @@ func NewAccountAPI(chain *ChainSubmodule) v1api.IAccount { // StateAccountKey returns the public key address of the given ID address func (accountAPI *accountAPI) StateAccountKey(ctx context.Context, addr address.Address, tsk types.TipSetKey) (address.Address, error) { - ts, err := accountAPI.chain.ChainReader.GetTipSet(tsk) + ts, err := accountAPI.chain.ChainReader.GetTipSet(ctx, tsk) if err != nil { return address.Undef, xerrors.Errorf("loading tipset %s: %w", tsk, err) } diff --git a/app/submodule/chain/apibstore.go b/app/submodule/chain/apibstore.go index 29695e3353..ce418c6387 100644 --- a/app/submodule/chain/apibstore.go +++ b/app/submodule/chain/apibstore.go @@ -26,18 +26,18 @@ func NewAPIBlockstore(cio ChainIO) blockstore.Blockstore { } // DeleteBlock implements Blockstore.DeleteBlock. -func (a *apiBStore) DeleteBlock(cid.Cid) error { +func (a *apiBStore) DeleteBlock(context.Context, cid.Cid) error { return xerrors.New("not supported") } // Has implements Blockstore.Has. -func (a *apiBStore) Has(c cid.Cid) (bool, error) { - return a.api.ChainHasObj(context.TODO(), c) +func (a *apiBStore) Has(ctx context.Context, c cid.Cid) (bool, error) { + return a.api.ChainHasObj(ctx, c) } // Get implements Blockstore.Get. -func (a *apiBStore) Get(c cid.Cid) (blocks.Block, error) { - bb, err := a.api.ChainReadObj(context.TODO(), c) +func (a *apiBStore) Get(ctx context.Context, c cid.Cid) (blocks.Block, error) { + bb, err := a.api.ChainReadObj(ctx, c) if err != nil { return nil, err } @@ -45,8 +45,8 @@ func (a *apiBStore) Get(c cid.Cid) (blocks.Block, error) { } // GetSize implements Blockstore.GetSize. -func (a *apiBStore) GetSize(c cid.Cid) (int, error) { - bb, err := a.api.ChainReadObj(context.TODO(), c) +func (a *apiBStore) GetSize(ctx context.Context, c cid.Cid) (int, error) { + bb, err := a.api.ChainReadObj(ctx, c) if err != nil { return 0, err } @@ -54,12 +54,12 @@ func (a *apiBStore) GetSize(c cid.Cid) (int, error) { } // Put implements Blockstore.Put. -func (a *apiBStore) Put(blocks.Block) error { +func (a *apiBStore) Put(context.Context, blocks.Block) error { return xerrors.New("not supported") } // PutMany implements Blockstore.PutMany. -func (a *apiBStore) PutMany([]blocks.Block) error { +func (a *apiBStore) PutMany(context.Context, []blocks.Block) error { return xerrors.New("not supported") } diff --git a/app/submodule/chain/chaininfo_api.go b/app/submodule/chain/chaininfo_api.go index 9612905ffa..9f100b6444 100644 --- a/app/submodule/chain/chaininfo_api.go +++ b/app/submodule/chain/chaininfo_api.go @@ -43,7 +43,7 @@ func (cia *chainInfoAPI) BlockTime(ctx context.Context) time.Duration { // ChainLs returns an iterator of tipsets from specified head by tsKey to genesis func (cia *chainInfoAPI) ChainList(ctx context.Context, tsKey types.TipSetKey, count int) ([]types.TipSetKey, error) { - fromTS, err := cia.chain.ChainReader.GetTipSet(tsKey) + fromTS, err := cia.chain.ChainReader.GetTipSet(ctx, tsKey) if err != nil { return nil, xerrors.Errorf("could not retrieve network name %w", err) } @@ -88,7 +88,7 @@ func (cia *chainInfoAPI) ChainHead(ctx context.Context) (*types.TipSet, error) { // ChainSetHead sets `key` as the new head of this chain iff it exists in the nodes chain store. func (cia *chainInfoAPI) ChainSetHead(ctx context.Context, key types.TipSetKey) error { - ts, err := cia.chain.ChainReader.GetTipSet(key) + ts, err := cia.chain.ChainReader.GetTipSet(ctx, key) if err != nil { return err } @@ -97,14 +97,14 @@ func (cia *chainInfoAPI) ChainSetHead(ctx context.Context, key types.TipSetKey) // ChainTipSet returns the tipset at the given key func (cia *chainInfoAPI) ChainGetTipSet(ctx context.Context, key types.TipSetKey) (*types.TipSet, error) { - return cia.chain.ChainReader.GetTipSet(key) + return cia.chain.ChainReader.GetTipSet(ctx, key) } // 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. func (cia *chainInfoAPI) ChainGetTipSetByHeight(ctx context.Context, height abi.ChainEpoch, tsk types.TipSetKey) (*types.TipSet, error) { - ts, err := cia.chain.ChainReader.GetTipSet(tsk) + ts, err := cia.chain.ChainReader.GetTipSet(ctx, tsk) if err != nil { return nil, xerrors.Errorf("fail to load tipset %v", err) } @@ -115,7 +115,7 @@ func (cia *chainInfoAPI) ChainGetTipSetByHeight(ctx context.Context, height abi. // If there are no blocks at the specified epoch, the first non-nil tipset at a later epoch // will be returned. func (cia *chainInfoAPI) ChainGetTipSetAfterHeight(ctx context.Context, h abi.ChainEpoch, tsk types.TipSetKey) (*types.TipSet, error) { - ts, err := cia.chain.ChainReader.GetTipSet(tsk) + ts, err := cia.chain.ChainReader.GetTipSet(ctx, tsk) if err != nil { return nil, xerrors.Errorf("loading tipset %s: %w", tsk, err) } @@ -148,7 +148,7 @@ func (cia *chainInfoAPI) ChainGetBlock(ctx context.Context, id cid.Cid) (*types. // ChainGetMessage reads a message referenced by the specified CID from the // chain blockstore. func (cia *chainInfoAPI) ChainGetMessage(ctx context.Context, msgID cid.Cid) (*types.Message, error) { - msg, err := cia.chain.MessageStore.LoadMessage(msgID) + msg, err := cia.chain.MessageStore.LoadMessage(ctx, msgID) if err != nil { return nil, err } @@ -208,7 +208,7 @@ func (cia *chainInfoAPI) GetFullBlock(ctx context.Context, id cid.Cid) (*types.F // ChainGetMessagesInTipset returns message stores in current tipset func (cia *chainInfoAPI) ChainGetMessagesInTipset(ctx context.Context, key types.TipSetKey) ([]apitypes.Message, error) { - ts, err := cia.chain.ChainReader.GetTipSet(key) + ts, err := cia.chain.ChainReader.GetTipSet(ctx, key) if err != nil { return nil, err } @@ -246,7 +246,7 @@ func (cia *chainInfoAPI) ChainGetParentMessages(ctx context.Context, bcid cid.Ci } // TODO: need to get the number of messages better than this - pts, err := cia.chain.ChainReader.GetTipSet(types.NewTipSetKey(b.Parents...)) + pts, err := cia.chain.ChainReader.GetTipSet(ctx, types.NewTipSetKey(b.Parents...)) if err != nil { return nil, err } @@ -280,7 +280,7 @@ func (cia *chainInfoAPI) ChainGetParentReceipts(ctx context.Context, bcid cid.Ci } // TODO: need to get the number of messages better than this - pts, err := cia.chain.ChainReader.GetTipSet(types.NewTipSetKey(b.Parents...)) + pts, err := cia.chain.ChainReader.GetTipSet(ctx, types.NewTipSetKey(b.Parents...)) if err != nil { return nil, err } @@ -402,7 +402,7 @@ func (cia *chainInfoAPI) StateGetRandomnessFromBeacon(ctx context.Context, perso // StateNetworkVersion returns the network version at the given tipset func (cia *chainInfoAPI) StateNetworkVersion(ctx context.Context, tsk types.TipSetKey) (network.Version, error) { - ts, err := cia.chain.ChainReader.GetTipSet(tsk) + ts, err := cia.chain.ChainReader.GetTipSet(ctx, tsk) if err != nil { return network.VersionMax, xerrors.Errorf("loading tipset %s: %v", tsk, err) } @@ -410,7 +410,7 @@ func (cia *chainInfoAPI) StateNetworkVersion(ctx context.Context, tsk types.TipS } func (cia *chainInfoAPI) StateVerifiedRegistryRootKey(ctx context.Context, tsk types.TipSetKey) (address.Address, error) { - ts, err := cia.chain.ChainReader.GetTipSet(tsk) + ts, err := cia.chain.ChainReader.GetTipSet(ctx, tsk) if err != nil { return address.Undef, xerrors.Errorf("loading tipset %s: %v", tsk, err) } @@ -428,7 +428,7 @@ func (cia *chainInfoAPI) StateVerifiedRegistryRootKey(ctx context.Context, tsk t } func (cia *chainInfoAPI) StateVerifierStatus(ctx context.Context, addr address.Address, tsk types.TipSetKey) (*abi.StoragePower, error) { - ts, err := cia.chain.ChainReader.GetTipSet(tsk) + ts, err := cia.chain.ChainReader.GetTipSet(ctx, tsk) if err != nil { return nil, xerrors.Errorf("loading tipset %s: %v", tsk, err) } @@ -465,7 +465,7 @@ func (cia *chainInfoAPI) StateVerifierStatus(ctx context.Context, addr address.A // encountered or if the context is canceled. Otherwise, it waits forever for the message // to appear on chain. func (cia *chainInfoAPI) MessageWait(ctx context.Context, msgCid cid.Cid, confidence, lookback abi.ChainEpoch) (*apitypes.ChainMessage, error) { - chainMsg, err := cia.chain.MessageStore.LoadMessage(msgCid) + chainMsg, err := cia.chain.MessageStore.LoadMessage(ctx, msgCid) if err != nil { return nil, err } @@ -474,12 +474,12 @@ func (cia *chainInfoAPI) MessageWait(ctx context.Context, msgCid cid.Cid, confid // StateSearchMsg searches for a message in the chain, and returns its receipt and the tipset where it was executed func (cia *chainInfoAPI) StateSearchMsg(ctx context.Context, from types.TipSetKey, mCid cid.Cid, lookbackLimit abi.ChainEpoch, allowReplaced bool) (*apitypes.MsgLookup, error) { - chainMsg, err := cia.chain.MessageStore.LoadMessage(mCid) + chainMsg, err := cia.chain.MessageStore.LoadMessage(ctx, mCid) if err != nil { return nil, err } //todo add a api for head tipset directly - head, err := cia.chain.ChainReader.GetTipSet(from) + head, err := cia.chain.ChainReader.GetTipSet(ctx, from) if err != nil { return nil, err } @@ -502,7 +502,7 @@ func (cia *chainInfoAPI) StateSearchMsg(ctx context.Context, from types.TipSetKe // 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. func (cia *chainInfoAPI) StateWaitMsg(ctx context.Context, mCid cid.Cid, confidence uint64, lookbackLimit abi.ChainEpoch, allowReplaced bool) (*apitypes.MsgLookup, error) { - chainMsg, err := cia.chain.MessageStore.LoadMessage(mCid) + chainMsg, err := cia.chain.MessageStore.LoadMessage(ctx, mCid) if err != nil { return nil, err } @@ -522,7 +522,7 @@ func (cia *chainInfoAPI) StateWaitMsg(ctx context.Context, mCid cid.Cid, confide } func (cia *chainInfoAPI) ChainExport(ctx context.Context, nroots abi.ChainEpoch, skipoldmsgs bool, tsk types.TipSetKey) (<-chan []byte, error) { - ts, err := cia.chain.ChainReader.GetTipSet(tsk) + ts, err := cia.chain.ChainReader.GetTipSet(ctx, tsk) if err != nil { return nil, xerrors.Errorf("loading tipset %s: %v", tsk, err) } @@ -584,11 +584,11 @@ func (cia *chainInfoAPI) ChainExport(ctx context.Context, nroots abi.ChainEpoch, //``` // Would return `[revert(tBA), apply(tAB), apply(tAA)]` func (cia *chainInfoAPI) ChainGetPath(ctx context.Context, from types.TipSetKey, to types.TipSetKey) ([]*apitypes.HeadChange, error) { - fts, err := cia.chain.ChainReader.GetTipSet(from) + fts, err := cia.chain.ChainReader.GetTipSet(ctx, from) if err != nil { return nil, xerrors.Errorf("loading from tipset %s: %w", from, err) } - tts, err := cia.chain.ChainReader.GetTipSet(to) + tts, err := cia.chain.ChainReader.GetTipSet(ctx, to) if err != nil { return nil, xerrors.Errorf("loading to tipset %s: %w", to, err) } diff --git a/app/submodule/chain/miner_api.go b/app/submodule/chain/miner_api.go index 3baa614326..f7bf7db661 100644 --- a/app/submodule/chain/miner_api.go +++ b/app/submodule/chain/miner_api.go @@ -152,7 +152,7 @@ func (msa *minerStateAPI) StateMinerFaults(ctx context.Context, maddr address.Ad // StateMinerProvingDeadline calculates the deadline at some epoch for a proving period // and returns the deadline-related calculations. func (msa *minerStateAPI) StateMinerProvingDeadline(ctx context.Context, maddr address.Address, tsk types.TipSetKey) (*dline.Info, error) { - ts, err := msa.ChainReader.GetTipSet(tsk) + ts, err := msa.ChainReader.GetTipSet(ctx, tsk) if err != nil { return nil, xerrors.Errorf("GetTipset failed:%v", err) } @@ -336,7 +336,7 @@ var initialPledgeDen = big.NewInt(100) // StateMinerInitialPledgeCollateral returns the precommit deposit for the specified miner's sector func (msa *minerStateAPI) StateMinerPreCommitDepositForPower(ctx context.Context, maddr address.Address, pci miner.SectorPreCommitInfo, tsk types.TipSetKey) (big.Int, error) { - ts, err := msa.ChainReader.GetTipSet(tsk) + ts, err := msa.ChainReader.GetTipSet(ctx, tsk) if err != nil { return big.Int{}, err } @@ -397,7 +397,7 @@ func (msa *minerStateAPI) StateMinerPreCommitDepositForPower(ctx context.Context // StateMinerInitialPledgeCollateral returns the initial pledge collateral for the specified miner's sector func (msa *minerStateAPI) StateMinerInitialPledgeCollateral(ctx context.Context, maddr address.Address, pci miner.SectorPreCommitInfo, tsk types.TipSetKey) (big.Int, error) { - ts, err := msa.ChainReader.GetTipSet(tsk) + ts, err := msa.ChainReader.GetTipSet(ctx, tsk) if err != nil { return big.Int{}, xerrors.Errorf("loading tipset %s: %v", tsk, err) } @@ -474,7 +474,7 @@ func (msa *minerStateAPI) StateMinerInitialPledgeCollateral(ctx context.Context, // 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. func (msa *minerStateAPI) StateVMCirculatingSupplyInternal(ctx context.Context, tsk types.TipSetKey) (types.CirculatingSupply, error) { - ts, err := msa.ChainReader.GetTipSet(tsk) + ts, err := msa.ChainReader.GetTipSet(ctx, tsk) if err != nil { return types.CirculatingSupply{}, err } @@ -577,7 +577,7 @@ func (msa *minerStateAPI) StateMinerPower(ctx context.Context, addr address.Addr // StateMinerAvailableBalance returns the portion of a miner's balance that can be withdrawn or spent func (msa *minerStateAPI) StateMinerAvailableBalance(ctx context.Context, maddr address.Address, tsk types.TipSetKey) (big.Int, error) { - ts, err := msa.ChainReader.GetTipSet(tsk) + ts, err := msa.ChainReader.GetTipSet(ctx, tsk) if err != nil { return big.Int{}, xerrors.Errorf("failed to get tipset for %s, %v", tsk.String(), err) } diff --git a/app/submodule/mining/mining_api.go b/app/submodule/mining/mining_api.go index 8227f8754a..ad073205f7 100644 --- a/app/submodule/mining/mining_api.go +++ b/app/submodule/mining/mining_api.go @@ -36,7 +36,7 @@ type MiningAPI struct { //nolint //MinerGetBaseInfo get current miner information func (miningAPI *MiningAPI) MinerGetBaseInfo(ctx context.Context, maddr address.Address, round abi.ChainEpoch, tsk types.TipSetKey) (*apitypes.MiningBaseInfo, error) { chainStore := miningAPI.Ming.ChainModule.ChainReader - ts, err := chainStore.GetTipSet(tsk) + ts, err := chainStore.GetTipSet(ctx, tsk) if err != nil { return nil, xerrors.Errorf("failed to load tipset for mining base: %v", err) } @@ -44,7 +44,7 @@ func (miningAPI *MiningAPI) MinerGetBaseInfo(ctx context.Context, maddr address. if err != nil { return nil, xerrors.Errorf("failed to get tipset root for mining base: %v", err) } - prev, err := chainStore.GetLatestBeaconEntry(ts) + prev, err := chainStore.GetLatestBeaconEntry(ctx, ts) if err != nil { if os.Getenv("VENUS_IGNORE_DRAND") != "_yes_" { return nil, xerrors.Errorf("failed to get latest beacon entry: %v", err) @@ -120,7 +120,7 @@ func (miningAPI *MiningAPI) MinerGetBaseInfo(ctx context.Context, maddr address. return nil, err } - st, err := miningAPI.Ming.ChainModule.ChainReader.StateView(ts) + st, err := miningAPI.Ming.ChainModule.ChainReader.StateView(ctx, ts) if err != nil { return nil, xerrors.Errorf("failed to load latest state: %v", err) } @@ -170,7 +170,7 @@ func (miningAPI *MiningAPI) minerCreateBlock(ctx context.Context, bt *apitypes.B chainStore := miningAPI.Ming.ChainModule.ChainReader messageStore := miningAPI.Ming.ChainModule.MessageStore cfg := miningAPI.Ming.Config.Repo().Config() - pts, err := chainStore.GetTipSet(bt.Parents) + pts, err := chainStore.GetTipSet(ctx, bt.Parents) if err != nil { return nil, xerrors.Errorf("failed to load parent tipset: %v", err) } diff --git a/app/submodule/mpool/mpool_api.go b/app/submodule/mpool/mpool_api.go index 95aa14c3bc..3a9857dc09 100644 --- a/app/submodule/mpool/mpool_api.go +++ b/app/submodule/mpool/mpool_api.go @@ -35,7 +35,7 @@ func (a *MessagePoolAPI) MpoolPublishByAddr(ctx context.Context, addr address.Ad } func (a *MessagePoolAPI) MpoolPublishMessage(ctx context.Context, smsg *types.SignedMessage) error { - return a.mp.MPool.PublishMsg(smsg) + return a.mp.MPool.PublishMsg(ctx, smsg) } // MpoolPush pushes a signed message to mempool. @@ -58,7 +58,7 @@ func (a *MessagePoolAPI) MpoolGetConfig(context.Context) (*mptypes.MpoolConfig, // MpoolSetConfig sets the mpool config to (a copy of) the supplied config func (a *MessagePoolAPI) MpoolSetConfig(ctx context.Context, cfg *mptypes.MpoolConfig) error { - return a.mp.MPool.SetConfig(&messagepool.MpoolConfig{ + return a.mp.MPool.SetConfig(ctx, &messagepool.MpoolConfig{ PriorityAddrs: cfg.PriorityAddrs, SizeLimitHigh: cfg.SizeLimitHigh, SizeLimitLow: cfg.SizeLimitLow, @@ -126,7 +126,7 @@ func (a *MessagePoolAPI) MpoolPending(ctx context.Context, tsk types.TipSetKey) } // different blocks in tipsets - have, err := a.mp.MPool.MessagesForBlocks(ts.Blocks()) + have, err := a.mp.MPool.MessagesForBlocks(ctx, ts.Blocks()) if err != nil { return nil, xerrors.Errorf("getting messages for base ts: %w", err) } @@ -136,7 +136,7 @@ func (a *MessagePoolAPI) MpoolPending(ctx context.Context, tsk types.TipSetKey) } } - msgs, err := a.mp.MPool.MessagesForBlocks(ts.Blocks()) + msgs, err := a.mp.MPool.MessagesForBlocks(ctx, ts.Blocks()) if err != nil { return nil, xerrors.Errorf(": %w", err) } diff --git a/app/submodule/mpool/mpool_submodule.go b/app/submodule/mpool/mpool_submodule.go index f78b23e01a..32125fe19f 100644 --- a/app/submodule/mpool/mpool_submodule.go +++ b/app/submodule/mpool/mpool_submodule.go @@ -71,7 +71,7 @@ func OpenFilesystemJournal(lr repo.Repo) (journal.Journal, error) { return jrnl, err } -func NewMpoolSubmodule(cfg messagepoolConfig, +func NewMpoolSubmodule(ctx context.Context, cfg messagepoolConfig, network *network.NetworkSubmodule, chain *chain.ChainSubmodule, wallet *wallet.WalletSubmodule, @@ -82,7 +82,7 @@ func NewMpoolSubmodule(cfg messagepoolConfig, if err != nil { return nil, err } - mp, err := messagepool.New(mpp, chain.Stmgr, cfg.Repo().MetaDatastore(), + mp, err := messagepool.New(ctx, mpp, chain.Stmgr, cfg.Repo().MetaDatastore(), cfg.Repo().Config().NetworkParams.ForkUpgradeParam, cfg.Repo().Config().Mpool, network.NetworkName, j) if err != nil { diff --git a/app/submodule/network/libp2p.go b/app/submodule/network/libp2p.go index 6dbdb0e4c6..9f5d77aff2 100644 --- a/app/submodule/network/libp2p.go +++ b/app/submodule/network/libp2p.go @@ -32,7 +32,7 @@ func (h noopLibP2PHost) ID() peer.ID { return h.peerId } -func (noopLibP2PHost) Peerstore() peerstore.Peerstore { +func (noopLibP2PHost) Peerstore() (peerstore.Peerstore, error) { return pstoremem.NewPeerstore() } @@ -130,10 +130,6 @@ func (noopLibP2PNetwork) SetStreamHandler(net.StreamHandler) { panic("implement me") } -func (noopLibP2PNetwork) SetConnHandler(net.ConnHandler) { - panic("implement me") -} - func (noopLibP2PNetwork) NewStream(context.Context, peer.ID) (net.Stream, error) { panic("implement me") } diff --git a/app/submodule/network/network_api.go b/app/submodule/network/network_api.go index 7950fcf06c..212626b8f3 100644 --- a/app/submodule/network/network_api.go +++ b/app/submodule/network/network_api.go @@ -42,7 +42,7 @@ func (na *networkAPI) NetworkFindProvidersAsync(ctx context.Context, key cid.Cid } // NetworkGetClosestPeers issues a getClosestPeers query to the filecoin network. -func (na *networkAPI) NetworkGetClosestPeers(ctx context.Context, key string) (<-chan peer.ID, error) { +func (na *networkAPI) NetworkGetClosestPeers(ctx context.Context, key string) ([]peer.ID, error) { return na.network.Network.GetClosestPeers(ctx, key) } diff --git a/app/submodule/network/network_submodule.go b/app/submodule/network/network_submodule.go index e1b7fdf03c..5bf16d5b4f 100644 --- a/app/submodule/network/network_submodule.go +++ b/app/submodule/network/network_submodule.go @@ -10,34 +10,21 @@ import ( "strings" "time" - datatransfer "github.com/filecoin-project/go-data-transfer" - dtnet "github.com/filecoin-project/go-data-transfer/network" - dtgstransport "github.com/filecoin-project/go-data-transfer/transport/graphsync" - "github.com/filecoin-project/venus/pkg/repo" - "github.com/filecoin-project/venus/pkg/util/blockstoreutil" - types "github.com/filecoin-project/venus/venus-shared/chain" + "github.com/ipfs/go-bitswap" + bsnet "github.com/ipfs/go-bitswap/network" blocks "github.com/ipfs/go-block-format" bserv "github.com/ipfs/go-blockservice" + "github.com/ipfs/go-cid" "github.com/ipfs/go-datastore" "github.com/ipfs/go-datastore/namespace" - logging "github.com/ipfs/go-log" - - dtimpl "github.com/filecoin-project/go-data-transfer/impl" - "github.com/filecoin-project/venus/pkg/config" - "github.com/filecoin-project/venus/pkg/discovery" - "github.com/filecoin-project/venus/pkg/net" - appstate "github.com/filecoin-project/venus/pkg/state" - "github.com/ipfs/go-bitswap" - bsnet "github.com/ipfs/go-bitswap/network" - "github.com/ipfs/go-cid" "github.com/ipfs/go-graphsync" graphsyncimpl "github.com/ipfs/go-graphsync/impl" gsnet "github.com/ipfs/go-graphsync/network" "github.com/ipfs/go-graphsync/storeutil" exchange "github.com/ipfs/go-ipfs-exchange-interface" cbor "github.com/ipfs/go-ipld-cbor" + logging "github.com/ipfs/go-log" "github.com/libp2p/go-libp2p" - circuit "github.com/libp2p/go-libp2p-circuit" "github.com/libp2p/go-libp2p-core/host" p2pmetrics "github.com/libp2p/go-libp2p-core/metrics" smux "github.com/libp2p/go-libp2p-core/mux" @@ -49,7 +36,20 @@ import ( ma "github.com/multiformats/go-multiaddr" "github.com/pkg/errors" + datatransfer "github.com/filecoin-project/go-data-transfer" + 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" + apiwrapper "github.com/filecoin-project/venus/app/submodule/network/v0api" + "github.com/filecoin-project/venus/pkg/config" + "github.com/filecoin-project/venus/pkg/discovery" + "github.com/filecoin-project/venus/pkg/net" + "github.com/filecoin-project/venus/pkg/repo" + appstate "github.com/filecoin-project/venus/pkg/state" + "github.com/filecoin-project/venus/pkg/util/blockstoreutil" + types "github.com/filecoin-project/venus/venus-shared/chain" + v0api "github.com/filecoin-project/venus/venus-shared/api/chain/v0" v1api "github.com/filecoin-project/venus/venus-shared/api/chain/v1" ) @@ -217,9 +217,14 @@ func NewNetworkSubmodule(ctx context.Context, config networkConfig) (*NetworkSub //dataTransger //sc := storedcounter.New(repo.ChainDatastore(), datastore.NewKey("/datatransfer/api/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) + dtn := dtnet.NewFromLibp2pHost(peerHost, dtRetryParams) + dtNet := dtnet.NewFromLibp2pHost(peerHost) dtDs := namespace.Wrap(config.Repo().ChainDatastore(), datastore.NewKey("/datatransfer/api/transfers")) - transport := dtgstransport.NewTransport(peerHost.ID(), gsync) + transport := dtgstransport.NewTransport(peerHost.ID(), gsync, dtn) repoPath, err := config.Repo().Path() if err != nil { @@ -370,8 +375,7 @@ func buildHost(ctx context.Context, config networkConfig, libP2pOpts []libp2p.Op } relayHost, err := libp2p.New( - ctx, - libp2p.EnableRelay(circuit.OptHop), + libp2p.EnableRelay(), // TODO ? libp2p.EnableAutoRelay(), libp2p.Routing(makeDHTRightType), publicAddrFactory, @@ -384,14 +388,16 @@ func buildHost(ctx context.Context, config networkConfig, libP2pOpts []libp2p.Op } return relayHost, nil } - return libp2p.New( - ctx, + + opts := []libp2p.Option{ libp2p.UserAgent("venus"), libp2p.Routing(makeDHTRightType), libp2p.ChainOptions(libP2pOpts...), libp2p.Ping(true), libp2p.DisableRelay(), - ) + } + + return libp2p.New(opts...) } func makeSmuxTransportOption(mplexExp bool) libp2p.Option { diff --git a/app/submodule/paych/paych_api.go b/app/submodule/paych/paych_api.go index 8b1b316b47..3135d61ab3 100644 --- a/app/submodule/paych/paych_api.go +++ b/app/submodule/paych/paych_api.go @@ -36,11 +36,11 @@ func (a *PaychAPI) PaychGet(ctx context.Context, from, to address.Address, amt b } func (a *PaychAPI) PaychAvailableFunds(ctx context.Context, ch address.Address) (*apitypes.ChannelAvailableFunds, error) { - return a.paychMgr.AvailableFunds(ch) + return a.paychMgr.AvailableFunds(ctx, ch) } func (a *PaychAPI) PaychAvailableFundsByFromTo(ctx context.Context, from, to address.Address) (*apitypes.ChannelAvailableFunds, error) { - return a.paychMgr.AvailableFundsByFromTo(from, to) + return a.paychMgr.AvailableFundsByFromTo(ctx, from, to) } func (a *PaychAPI) PaychGetWaitReady(ctx context.Context, sentinel cid.Cid) (address.Address, error) { @@ -48,7 +48,7 @@ func (a *PaychAPI) PaychGetWaitReady(ctx context.Context, sentinel cid.Cid) (add } func (a *PaychAPI) PaychAllocateLane(ctx context.Context, ch address.Address) (uint64, error) { - return a.paychMgr.AllocateLane(ch) + return a.paychMgr.AllocateLane(ctx, ch) } func (a *PaychAPI) PaychNewPayment(ctx context.Context, from, to address.Address, vouchers []paychtypes.VoucherSpec) (*paychtypes.PaymentInfo, error) { @@ -61,7 +61,7 @@ func (a *PaychAPI) PaychNewPayment(ctx context.Context, from, to address.Address return nil, err } - lane, err := a.paychMgr.AllocateLane(ch.Channel) + lane, err := a.paychMgr.AllocateLane(ctx, ch.Channel) if err != nil { return nil, err } @@ -96,11 +96,11 @@ func (a *PaychAPI) PaychNewPayment(ctx context.Context, from, to address.Address } func (a *PaychAPI) PaychList(ctx context.Context) ([]address.Address, error) { - return a.paychMgr.ListChannels() + return a.paychMgr.ListChannels(ctx) } func (a *PaychAPI) PaychStatus(ctx context.Context, pch address.Address) (*paychtypes.Status, error) { - ci, err := a.paychMgr.GetChannelInfo(pch) + ci, err := a.paychMgr.GetChannelInfo(ctx, pch) if err != nil { return nil, err } diff --git a/app/submodule/paych/paych_submodule.go b/app/submodule/paych/paych_submodule.go index df460d3971..5e923b09f9 100644 --- a/app/submodule/paych/paych_submodule.go +++ b/app/submodule/paych/paych_submodule.go @@ -3,10 +3,11 @@ package paych import ( "context" + "github.com/ipfs/go-datastore" + "github.com/filecoin-project/venus/pkg/paychmgr" v0api "github.com/filecoin-project/venus/venus-shared/api/chain/v0" v1api "github.com/filecoin-project/venus/venus-shared/api/chain/v1" - "github.com/ipfs/go-datastore" ) //PaychSubmodule support paych related functions, including paych construction, extraction, query and other functions @@ -20,8 +21,8 @@ func NewPaychSubmodule(ctx context.Context, ds datastore.Batching, params *paych return &PaychSubmodule{mgr}, err } -func (ps *PaychSubmodule) Start() error { - return ps.pmgr.Start() +func (ps *PaychSubmodule) Start(ctx context.Context) error { + return ps.pmgr.Start(ctx) } func (ps *PaychSubmodule) Stop() { diff --git a/app/submodule/syncer/syncer_api.go b/app/submodule/syncer/syncer_api.go index a68ebe01b8..d21be52400 100644 --- a/app/submodule/syncer/syncer_api.go +++ b/app/submodule/syncer/syncer_api.go @@ -80,7 +80,7 @@ func (sa *syncerAPI) Concurrent(ctx context.Context) int64 { // ChainTipSetWeight computes weight for the specified tipset. func (sa *syncerAPI) ChainTipSetWeight(ctx context.Context, tsk types.TipSetKey) (big.Int, error) { - ts, err := sa.syncer.ChainModule.ChainReader.GetTipSet(tsk) + ts, err := sa.syncer.ChainModule.ChainReader.GetTipSet(ctx, tsk) if err != nil { return big.Int{}, err } @@ -102,17 +102,17 @@ func (sa *syncerAPI) SyncSubmitBlock(ctx context.Context, blk *types.BlockMsg) e return xerrors.Errorf("loading parent block: %v", err) } - if err := sa.syncer.SlashFilter.MinedBlock(blk.Header, parent.Height); err != nil { + if err := sa.syncer.SlashFilter.MinedBlock(ctx, blk.Header, parent.Height); err != nil { log.Errorf(" SLASH FILTER ERROR: %s", err) return xerrors.Errorf(" SLASH FILTER ERROR: %v", err) } // TODO: should we have some sort of fast path to adding a local block? - bmsgs, err := chainModule.MessageStore.LoadUnsignedMessagesFromCids(blk.BlsMessages) + bmsgs, err := chainModule.MessageStore.LoadUnsignedMessagesFromCids(ctx, blk.BlsMessages) if err != nil { return xerrors.Errorf("failed to load bls messages: %v", err) } - smsgs, err := chainModule.MessageStore.LoadSignedMessagesFromCids(blk.SecpkMessages) + smsgs, err := chainModule.MessageStore.LoadSignedMessagesFromCids(ctx, blk.SecpkMessages) if err != nil { return xerrors.Errorf("failed to load secpk message: %v", err) } @@ -123,7 +123,7 @@ func (sa *syncerAPI) SyncSubmitBlock(ctx context.Context, blk *types.BlockMsg) e SECPMessages: smsgs, } - if err := sa.syncer.BlockValidator.ValidateMsgMeta(fb); err != nil { + if err := sa.syncer.BlockValidator.ValidateMsgMeta(ctx, fb); err != nil { return xerrors.Errorf("provided messages did not match block: %v", err) } @@ -166,7 +166,7 @@ func (sa *syncerAPI) SyncSubmitBlock(ctx context.Context, blk *types.BlockMsg) e // tipset. func (sa *syncerAPI) StateCall(ctx context.Context, msg *types.Message, tsk types.TipSetKey) (*apitypes.InvocResult, error) { start := time.Now() - ts, err := sa.syncer.ChainModule.ChainReader.GetTipSet(tsk) + ts, err := sa.syncer.ChainModule.ChainReader.GetTipSet(ctx, tsk) if err != nil { return nil, xerrors.Errorf("loading tipset %s: %v", tsk, err) } diff --git a/app/submodule/syncer/syncer_submodule.go b/app/submodule/syncer/syncer_submodule.go index 0bddf403fd..fd7070ccb9 100644 --- a/app/submodule/syncer/syncer_submodule.go +++ b/app/submodule/syncer/syncer_submodule.go @@ -245,7 +245,7 @@ func (syncer *SyncerSubmodule) handleIncomingBlocks(ctx context.Context, msg pub // nolint func (syncer *SyncerSubmodule) loadLocalFullTipset(ctx context.Context, tsk types.TipSetKey) (*types.FullTipSet, error) { - ts, err := syncer.ChainModule.ChainReader.GetTipSet(tsk) + ts, err := syncer.ChainModule.ChainReader.GetTipSet(ctx, tsk) if err != nil { return nil, err } diff --git a/app/submodule/wallet/remotewallet/remote.go b/app/submodule/wallet/remotewallet/remote.go index 87cac4d09f..5f7a1bac32 100644 --- a/app/submodule/wallet/remotewallet/remote.go +++ b/app/submodule/wallet/remotewallet/remote.go @@ -19,7 +19,7 @@ type remoteWallet struct { Cancel func() } -func (w *remoteWallet) Addresses() []address.Address { +func (w *remoteWallet) Addresses(ctx context.Context) []address.Address { wallets, err := w.IWallet.WalletList(context.Background()) if err != nil { return make([]address.Address, 0) @@ -27,7 +27,7 @@ func (w *remoteWallet) Addresses() []address.Address { return wallets } -func (w *remoteWallet) HasPassword() bool { +func (w *remoteWallet) HasPassword(ctx context.Context) bool { return true } @@ -50,22 +50,22 @@ func SetupRemoteWallet(info string) (wallet.WalletIntersection, error) { }, nil } -func (w *remoteWallet) HasAddress(addr address.Address) bool { +func (w *remoteWallet) HasAddress(ctx context.Context, addr address.Address) bool { exist, err := w.IWallet.WalletHas(context.Background(), addr) if err != nil { return false } return exist } -func (w *remoteWallet) NewAddress(protocol address.Protocol) (address.Address, error) { +func (w *remoteWallet) NewAddress(ctx context.Context, protocol address.Protocol) (address.Address, error) { return w.IWallet.WalletNew(context.Background(), GetKeyType(protocol)) } -func (w *remoteWallet) Import(key *crypto.KeyInfo) (address.Address, error) { +func (w *remoteWallet) Import(ctx context.Context, key *crypto.KeyInfo) (address.Address, error) { return w.IWallet.WalletImport(context.Background(), ConvertRemoteKeyInfo(key)) } -func (w *remoteWallet) Export(addr address.Address, password string) (*crypto.KeyInfo, error) { +func (w *remoteWallet) Export(ctx context.Context, addr address.Address, password string) (*crypto.KeyInfo, error) { key, err := w.IWallet.WalletExport(context.Background(), addr) if err != nil { return nil, err @@ -73,6 +73,6 @@ func (w *remoteWallet) Export(addr address.Address, password string) (*crypto.Ke return ConvertLocalKeyInfo(key), nil } -func (w *remoteWallet) WalletSign(keyAddr address.Address, msg []byte, meta types.MsgMeta) (*crypto.Signature, error) { +func (w *remoteWallet) WalletSign(ctx context.Context, keyAddr address.Address, msg []byte, meta types.MsgMeta) (*crypto.Signature, error) { return w.IWallet.WalletSign(context.Background(), keyAddr, msg, meta) } diff --git a/app/submodule/wallet/wallet_api.go b/app/submodule/wallet/wallet_api.go index 7ddee55eba..781fc0f230 100644 --- a/app/submodule/wallet/wallet_api.go +++ b/app/submodule/wallet/wallet_api.go @@ -40,7 +40,7 @@ func (walletAPI *WalletAPI) WalletBalance(ctx context.Context, addr address.Addr // WalletHas indicates whether the given address is in the wallet. func (walletAPI *WalletAPI) WalletHas(ctx context.Context, addr address.Address) (bool, error) { - return walletAPI.adapter.HasAddress(addr), nil + return walletAPI.adapter.HasAddress(ctx, addr), nil } // SetWalletDefaultAddress set the specified address as the default in the config. @@ -67,7 +67,7 @@ func (walletAPI *WalletAPI) WalletDefaultAddress(ctx context.Context) (address.A // WalletAddresses gets addresses from the walletModule func (walletAPI *WalletAPI) WalletAddresses(ctx context.Context) []address.Address { - return walletAPI.adapter.Addresses() + return walletAPI.adapter.Addresses(ctx) } // SetWalletDefaultAddress set the specified address as the default in the config. @@ -86,13 +86,13 @@ func (walletAPI *WalletAPI) WalletSetDefault(ctx context.Context, addr address.A } // WalletNewAddress generates a new walletModule address -func (walletAPI *WalletAPI) WalletNewAddress(protocol address.Protocol) (address.Address, error) { - return walletAPI.adapter.NewAddress(protocol) +func (walletAPI *WalletAPI) WalletNewAddress(ctx context.Context, protocol address.Protocol) (address.Address, error) { + return walletAPI.adapter.NewAddress(ctx, protocol) } // WalletImport adds a given set of KeyInfos to the walletModule -func (walletAPI *WalletAPI) WalletImport(key *wtypes.KeyInfo) (address.Address, error) { - addr, err := walletAPI.adapter.Import(remotewallet.ConvertLocalKeyInfo(key)) +func (walletAPI *WalletAPI) WalletImport(ctx context.Context, key *wtypes.KeyInfo) (address.Address, error) { + addr, err := walletAPI.adapter.Import(ctx, remotewallet.ConvertLocalKeyInfo(key)) if err != nil { return address.Undef, err } @@ -100,8 +100,8 @@ func (walletAPI *WalletAPI) WalletImport(key *wtypes.KeyInfo) (address.Address, } // WalletExport returns the KeyInfos for the given walletModule addresses -func (walletAPI *WalletAPI) WalletExport(addr address.Address, password string) (*wtypes.KeyInfo, error) { - ki, err := walletAPI.adapter.Export(addr, password) +func (walletAPI *WalletAPI) WalletExport(ctx context.Context, addr address.Address, password string) (*wtypes.KeyInfo, error) { + ki, err := walletAPI.adapter.Export(ctx, addr, password) if err != nil { return nil, err } @@ -114,7 +114,7 @@ func (walletAPI *WalletAPI) WalletSign(ctx context.Context, k address.Address, m if err != nil { return nil, xerrors.Errorf("ResolveTokeyAddress failed:%v", err) } - return walletAPI.adapter.WalletSign(keyAddr, msg, meta) + return walletAPI.adapter.WalletSign(ctx, keyAddr, msg, meta) } // WalletSignMessage signs the given message using the given address. @@ -137,25 +137,25 @@ func (walletAPI *WalletAPI) WalletSignMessage(ctx context.Context, k address.Add // LockWallet lock wallet func (walletAPI *WalletAPI) LockWallet(ctx context.Context) error { - return walletAPI.walletModule.Wallet.LockWallet() + return walletAPI.walletModule.Wallet.LockWallet(ctx) } // UnLockWallet unlock wallet func (walletAPI *WalletAPI) UnLockWallet(ctx context.Context, password []byte) error { - return walletAPI.walletModule.Wallet.UnLockWallet(password) + return walletAPI.walletModule.Wallet.UnLockWallet(ctx, password) } // SetPassword set wallet password -func (walletAPI *WalletAPI) SetPassword(Context context.Context, password []byte) error { - return walletAPI.walletModule.Wallet.SetPassword(password) +func (walletAPI *WalletAPI) SetPassword(ctx context.Context, password []byte) error { + return walletAPI.walletModule.Wallet.SetPassword(ctx, password) } // HasPassword return whether the wallet has password -func (walletAPI *WalletAPI) HasPassword(Context context.Context) bool { - return walletAPI.adapter.HasPassword() +func (walletAPI *WalletAPI) HasPassword(ctx context.Context) bool { + return walletAPI.adapter.HasPassword(ctx) } // WalletState return wallet state -func (walletAPI *WalletAPI) WalletState(Context context.Context) int { - return walletAPI.walletModule.Wallet.WalletState() +func (walletAPI *WalletAPI) WalletState(ctx context.Context) int { + return walletAPI.walletModule.Wallet.WalletState(ctx) } diff --git a/app/submodule/wallet/wallet_submodule.go b/app/submodule/wallet/wallet_submodule.go index 51772ed24f..376547d204 100644 --- a/app/submodule/wallet/wallet_submodule.go +++ b/app/submodule/wallet/wallet_submodule.go @@ -45,7 +45,7 @@ func NewWalletSubmodule(ctx context.Context, if err != nil { return nil, errors.Wrap(err, "failed to get passphrase config") } - backend, err := wallet.NewDSBackend(repo.WalletDatastore(), passphraseCfg, password) + backend, err := wallet.NewDSBackend(ctx, repo.WalletDatastore(), passphraseCfg, password) if err != nil { return nil, errors.Wrap(err, "failed to set up walletModule backend") } diff --git a/cmd/address.go b/cmd/address.go index b274b65105..ce33c2ea2a 100644 --- a/cmd/address.go +++ b/cmd/address.go @@ -77,7 +77,7 @@ var addrsNewCmd = &cmds.Command{ return errWalletLocked } - addr, err := env.(*node.Env).WalletAPI.WalletNewAddress(protocol) + addr, err := env.(*node.Env).WalletAPI.WalletNewAddress(req.Context, protocol) if err != nil { return err } @@ -260,7 +260,7 @@ var walletImportCmd = &cmds.Command{ return err } - addr, err := env.(*node.Env).WalletAPI.WalletImport(&key) + addr, err := env.(*node.Env).WalletAPI.WalletImport(req.Context, &key) if err != nil { return err } @@ -303,7 +303,7 @@ var ( } pw := req.Arguments[1] - ki, err := env.(*node.Env).WalletAPI.WalletExport(addr, pw) + ki, err := env.(*node.Env).WalletAPI.WalletExport(req.Context, addr, pw) if err != nil { return err } diff --git a/cmd/address_integration_test.go b/cmd/address_integration_test.go index 9e80f47620..0e90883006 100644 --- a/cmd/address_integration_test.go +++ b/cmd/address_integration_test.go @@ -33,7 +33,7 @@ func TestAddressNewAndList(t *testing.T) { addrs := make([]address.Address, 10) var err error for i := 0; i < 10; i++ { - addrs[i], err = n.Wallet().API().WalletNewAddress(address.SECP256K1) + addrs[i], err = n.Wallet().API().WalletNewAddress(ctx, address.SECP256K1) require.NoError(t, err) } @@ -54,7 +54,7 @@ func TestWalletBalance(t *testing.T) { n, cmdClient, done := builder.BuildAndStartAPI(ctx) defer done() - addr, err := n.Wallet().API().WalletNewAddress(address.SECP256K1) + addr, err := n.Wallet().API().WalletNewAddress(ctx, address.SECP256K1) require.NoError(t, err) t.Log("[success] not found, zero") @@ -107,7 +107,7 @@ func TestWalletExportImportRoundTrip(t *testing.T) { n, cmdClient, done := builder.BuildAndStartAPI(ctx) defer done() - addr, err := n.Wallet().API().WalletNewAddress(address.SECP256K1) + addr, err := n.Wallet().API().WalletNewAddress(ctx, address.SECP256K1) require.NoError(t, err) // ./venus wallet ls diff --git a/cmd/daemon.go b/cmd/daemon.go index 1ff055760a..6f2de707b2 100644 --- a/cmd/daemon.go +++ b/cmd/daemon.go @@ -233,7 +233,7 @@ func daemonRun(req *cmds.Request, re cmds.ResponseEmitter) error { } importPath, _ := req.Options[ImportSnapshot].(string) if len(importPath) != 0 { - err := Import(rep, importPath) + err := Import(req.Context, rep, importPath) if err != nil { log.Errorf("failed to import snapshot, import path: %s, error: %s", importPath, err.Error()) return err @@ -368,7 +368,7 @@ func loadGenesis(ctx context.Context, rep repo.Repo, sourceName string, network defer func() { _ = source.Close() }() - genesisBlk, err := extractGenesisBlock(source, rep) + genesisBlk, err := extractGenesisBlock(ctx, source, rep) if err != nil { return nil, err } @@ -444,15 +444,15 @@ func openGenesisSource(sourceName string) (io.ReadCloser, error) { return source, nil } -func extractGenesisBlock(source io.ReadCloser, rep repo.Repo) (*types.BlockHeader, error) { +func extractGenesisBlock(ctx context.Context, source io.ReadCloser, rep repo.Repo) (*types.BlockHeader, error) { bs := rep.Datastore() - ch, err := car.LoadCar(bs, source) + ch, err := car.LoadCar(ctx, bs, source) if err != nil { return nil, err } // need to check if we are being handed a car file with a single genesis block or an entire chain. - bsBlk, err := bs.Get(ch.Roots[0]) + bsBlk, err := bs.Get(ctx, ch.Roots[0]) if err != nil { return nil, err } diff --git a/cmd/import.go b/cmd/import.go index 8925ce6a6c..078e79f9ed 100644 --- a/cmd/import.go +++ b/cmd/import.go @@ -21,11 +21,11 @@ var logImport = logging.Logger("commands/import") // Import cache tipset cids to store. // The value of the cached tipset CIDS is used as the check-point when running `venus daemon` -func Import(r repo.Repo, fileName string) error { - return importChain(r, fileName) +func Import(ctx context.Context, r repo.Repo, fileName string) error { + return importChain(ctx, r, fileName) } -func importChain(r repo.Repo, fname string) error { +func importChain(ctx context.Context, r repo.Repo, fname string) error { var rd io.Reader var l int64 if strings.HasPrefix(fname, "http://") || strings.HasPrefix(fname, "https://") { @@ -76,7 +76,7 @@ func importChain(r repo.Repo, fname string) error { bar.Units = pb.U_BYTES bar.Start() - tip, err := chainStore.Import(br) + tip, err := chainStore.Import(ctx, br) if err != nil { return xerrors.Errorf("importing chain failed: %s", err) } diff --git a/cmd/miner.go b/cmd/miner.go index ab921b6d95..721a876ae9 100644 --- a/cmd/miner.go +++ b/cmd/miner.go @@ -89,7 +89,7 @@ var newMinerCmd = &cmds.Command{ if env.(*node.Env).WalletAPI.WalletState(req.Context) == wallet.Lock { return errWalletLocked } - if worker, err = env.(*node.Env).WalletAPI.WalletNewAddress(address.BLS); err != nil { + if worker, err = env.(*node.Env).WalletAPI.WalletNewAddress(req.Context, address.BLS); err != nil { return err } } diff --git a/cmd/swarm.go b/cmd/swarm.go index 492958fbdc..1851d1c6d8 100644 --- a/cmd/swarm.go +++ b/cmd/swarm.go @@ -135,7 +135,7 @@ var queryDhtCmd = &cmds.Command{ go func() { defer cancel() - for p := range closestPeers { + for _, p := range closestPeers { routing.PublishQueryEvent(ctx, &routing.QueryEvent{ ID: p, Type: routing.FinalPeer, diff --git a/extern/filecoin-ffi b/extern/filecoin-ffi index ce7083b3d1..52d80081bf 160000 --- a/extern/filecoin-ffi +++ b/extern/filecoin-ffi @@ -1 +1 @@ -Subproject commit ce7083b3d187ec3bc41a68ab66567bd4f3be6dfc +Subproject commit 52d80081bfdd8a30bc44bcfe44cb0f299615b9f3 diff --git a/go.mod b/go.mod index 2b94584a0e..2f3c596ca6 100644 --- a/go.mod +++ b/go.mod @@ -12,7 +12,7 @@ require ( github.com/awnumar/memguard v0.22.2 github.com/bluele/gcache v0.0.0-20190518031135-bc40bd653833 github.com/detailyang/go-fallocate v0.0.0-20180908115635-432fa640bd2e - github.com/dgraph-io/badger/v2 v2.2007.2 + github.com/dgraph-io/badger/v2 v2.2007.3 github.com/docker/distribution v2.7.1+incompatible // indirect github.com/docker/docker v0.7.3-0.20190315170154-87d593639c77 github.com/docker/go-connections v0.4.0 // indirect @@ -27,15 +27,14 @@ require ( github.com/filecoin-project/go-cbor-util v0.0.0-20201016124514-d0bbec7bfcc4 github.com/filecoin-project/go-commp-utils v0.1.3 github.com/filecoin-project/go-crypto v0.0.0-20191218222705-effae4ea9f03 - github.com/filecoin-project/go-data-transfer v1.10.1 + github.com/filecoin-project/go-data-transfer v1.12.0 github.com/filecoin-project/go-fil-commcid v0.0.0-20201016201715-d41df56b4f6a github.com/filecoin-project/go-jsonrpc v0.1.4-0.20210217175800-45ea43ac2bec github.com/filecoin-project/go-leb128 v0.0.0-20190212224330-8d79a5489543 github.com/filecoin-project/go-paramfetch v0.0.2 github.com/filecoin-project/go-state-types v0.1.1 - github.com/filecoin-project/go-statestore v0.1.1 // indirect github.com/filecoin-project/specs-actors v0.9.14 - github.com/filecoin-project/specs-actors/v2 v2.3.5 + github.com/filecoin-project/specs-actors/v2 v2.3.6 github.com/filecoin-project/specs-actors/v3 v3.1.1 github.com/filecoin-project/specs-actors/v4 v4.0.1 github.com/filecoin-project/specs-actors/v5 v5.0.4 @@ -47,65 +46,64 @@ require ( github.com/gbrlsnchs/jwt/v3 v3.0.0 github.com/go-errors/errors v1.0.1 github.com/go-kit/kit v0.10.0 - github.com/golang/mock v1.4.4 + github.com/golang/mock v1.6.0 github.com/golang/snappy v0.0.2-0.20190904063534-ff6b7dc882cf // indirect github.com/golangci/gofmt v0.0.0-20190930125516-244bba706f1a github.com/golangci/golangci-lint v1.39.0 github.com/google/flatbuffers v2.0.0+incompatible // indirect github.com/google/go-github v17.0.0+incompatible - github.com/google/uuid v1.2.0 + github.com/google/uuid v1.3.0 github.com/hako/durafmt v0.0.0-20200710122514-c0fb7b4da026 github.com/hannahhoward/go-pubsub v0.0.0-20200423002714-8d62886cc36e - github.com/hashicorp/go-multierror v1.1.0 + github.com/hashicorp/go-multierror v1.1.1 github.com/hashicorp/golang-lru v0.5.4 github.com/howeyc/gopass v0.0.0-20190910152052-7cb4b85ec19c github.com/ipfs-force-community/metrics v1.0.1-0.20211022060227-11142a08b729 github.com/ipfs-force-community/venus-common-utils v0.0.0-20210714054928-2042a9040759 - github.com/ipfs/go-bitswap v0.3.2 + github.com/ipfs/go-bitswap v0.5.1 github.com/ipfs/go-block-format v0.0.3 - github.com/ipfs/go-blockservice v0.1.4 + github.com/ipfs/go-blockservice v0.2.1 github.com/ipfs/go-cid v0.1.0 - github.com/ipfs/go-datastore v0.4.5 - github.com/ipfs/go-ds-badger2 v0.1.1-0.20200708190120-187fc06f714e + github.com/ipfs/go-datastore v0.5.1 + github.com/ipfs/go-ds-badger2 v0.1.2 github.com/ipfs/go-fs-lock v0.0.6 - github.com/ipfs/go-graphsync v0.9.1 - github.com/ipfs/go-ipfs-blockstore v1.0.3 + github.com/ipfs/go-graphsync v0.11.0 + github.com/ipfs/go-ipfs-blockstore v1.1.2 github.com/ipfs/go-ipfs-chunker v0.0.5 github.com/ipfs/go-ipfs-cmdkit v0.0.1 github.com/ipfs/go-ipfs-cmds v0.5.0 - github.com/ipfs/go-ipfs-ds-help v1.0.0 - github.com/ipfs/go-ipfs-exchange-interface v0.0.1 - github.com/ipfs/go-ipfs-exchange-offline v0.0.1 + github.com/ipfs/go-ipfs-ds-help v1.1.0 + github.com/ipfs/go-ipfs-exchange-interface v0.1.0 + github.com/ipfs/go-ipfs-exchange-offline v0.1.1 github.com/ipfs/go-ipfs-files v0.0.8 - github.com/ipfs/go-ipfs-routing v0.1.0 - github.com/ipfs/go-ipld-cbor v0.0.5 + github.com/ipfs/go-ipfs-routing v0.2.1 + github.com/ipfs/go-ipld-cbor v0.0.6 github.com/ipfs/go-ipld-format v0.2.0 github.com/ipfs/go-log v1.0.5 - github.com/ipfs/go-log/v2 v2.3.0 - github.com/ipfs/go-merkledag v0.3.2 + github.com/ipfs/go-log/v2 v2.4.0 + github.com/ipfs/go-merkledag v0.5.1 github.com/ipfs/go-path v0.0.7 github.com/ipfs/go-unixfs v0.2.4 github.com/ipfs/iptb v1.4.0 - github.com/ipld/go-car v0.3.1-0.20210601190600-f512dac51e8e + github.com/ipld/go-car v0.3.3 github.com/jbenet/goprocess v0.1.4 github.com/jstemmer/go-junit-report v0.9.1 github.com/libp2p/go-eventbus v0.2.1 - github.com/libp2p/go-libp2p v0.14.2 - github.com/libp2p/go-libp2p-circuit v0.4.0 - github.com/libp2p/go-libp2p-core v0.8.5 - github.com/libp2p/go-libp2p-kad-dht v0.11.0 + github.com/libp2p/go-libp2p v0.17.0 + github.com/libp2p/go-libp2p-core v0.13.0 + github.com/libp2p/go-libp2p-kad-dht v0.15.0 github.com/libp2p/go-libp2p-mplex v0.4.1 - github.com/libp2p/go-libp2p-peerstore v0.2.7 - github.com/libp2p/go-libp2p-pubsub v0.4.2-0.20210212194758-6c1addf493eb - github.com/libp2p/go-libp2p-swarm v0.5.0 - github.com/libp2p/go-libp2p-yamux v0.5.4 + github.com/libp2p/go-libp2p-peerstore v0.6.0 + github.com/libp2p/go-libp2p-pubsub v0.6.0 + github.com/libp2p/go-libp2p-swarm v0.9.0 + github.com/libp2p/go-libp2p-yamux v0.7.0 github.com/minio/blake2b-simd v0.0.0-20160723061019-3f5f724cb5b1 github.com/mitchellh/go-homedir v1.1.0 github.com/mitchellh/mapstructure v1.4.1 // indirect github.com/morikuni/aec v1.0.0 // indirect - github.com/multiformats/go-multiaddr v0.3.3 + github.com/multiformats/go-multiaddr v0.4.0 github.com/multiformats/go-multiaddr-dns v0.3.1 - github.com/multiformats/go-multihash v0.0.15 + github.com/multiformats/go-multihash v0.1.0 github.com/opencontainers/go-digest v1.0.0 // indirect github.com/opencontainers/image-spec v1.0.1 // indirect github.com/patrickmn/go-cache v2.1.0+incompatible @@ -127,8 +125,8 @@ require ( github.com/whyrusleeping/pubsub v0.0.0-20190708150250-92bcb0691325 github.com/xorcare/golden v0.6.1-0.20191112154924-b87f686d7542 // indirect go.opencensus.io v0.23.0 - go.uber.org/zap v1.16.0 - golang.org/x/crypto v0.0.0-20210506145944-38f3c27a63bf + go.uber.org/zap v1.19.0 + golang.org/x/crypto v0.0.0-20210813211128-0a44fdfbc16e golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c golang.org/x/sync v0.0.0-20210220032951-036812b2e83c golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6 @@ -143,7 +141,6 @@ replace ( github.com/filecoin-project/filecoin-ffi => ./extern/filecoin-ffi github.com/filecoin-project/go-jsonrpc => github.com/ipfs-force-community/go-jsonrpc v0.1.4-0.20210731021807-68e5207079bc github.com/filecoin-project/test-vectors => ./extern/test-vectors - github.com/filecoin-project/venus => ./ github.com/golangci/golangci-lint => github.com/golangci/golangci-lint v1.39.0 github.com/ipfs/go-ipfs-cmds => github.com/ipfs-force-community/go-ipfs-cmds v0.6.1-0.20210521090123-4587df7fa0ab ) diff --git a/go.sum b/go.sum index 2d472ce903..4c3327a8d5 100644 --- a/go.sum +++ b/go.sum @@ -128,8 +128,9 @@ github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZw github.com/beevik/ntp v0.2.0/go.mod h1:hIHWr+l3+/clUnF44zdK+CWW7fO8dR5cIylAQ76NRpg= github.com/benbjohnson/clock v1.0.1/go.mod h1:bGMdMPoPVvcYyt1gHDf4J2KE153Yf9BuiUKYMaxlTDM= github.com/benbjohnson/clock v1.0.2/go.mod h1:bGMdMPoPVvcYyt1gHDf4J2KE153Yf9BuiUKYMaxlTDM= -github.com/benbjohnson/clock v1.0.3 h1:vkLuvpK4fmtSCuo60+yC63p7y0BmQ8gm5ZXGuBCJyXg= github.com/benbjohnson/clock v1.0.3/go.mod h1:bGMdMPoPVvcYyt1gHDf4J2KE153Yf9BuiUKYMaxlTDM= +github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8= +github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= @@ -151,12 +152,14 @@ github.com/btcsuite/btcd v0.0.0-20190523000118-16327141da8c/go.mod h1:3J08xEfcug github.com/btcsuite/btcd v0.0.0-20190605094302-a0d1e3e36d50/go.mod h1:3J08xEfcugPacsc34/LKRU2yO7YmuT8yt28J8k2+rrI= github.com/btcsuite/btcd v0.0.0-20190824003749-130ea5bddde3/go.mod h1:3J08xEfcugPacsc34/LKRU2yO7YmuT8yt28J8k2+rrI= github.com/btcsuite/btcd v0.20.1-beta/go.mod h1:wVuoA8VJLEcwgqHBwHmzLRazpKxTv13Px/pDuV7OomQ= -github.com/btcsuite/btcd v0.21.0-beta h1:At9hIZdJW0s9E/fAz28nrz6AmcNlSVucCH796ZteX1M= github.com/btcsuite/btcd v0.21.0-beta/go.mod h1:ZSWyehm27aAuS9bvkATT+Xte3hjHZ+MRgMY/8NJ7K94= +github.com/btcsuite/btcd v0.22.0-beta h1:LTDpDKUM5EeOFBPM8IXpinEcmZ6FWfNZbE3lfrfdnWo= +github.com/btcsuite/btcd v0.22.0-beta/go.mod h1:9n5ntfhhHQBIhUvlhDvD3Qg6fRUj4jkN0VB8L8svzOA= github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f/go.mod h1:TdznJufoqS23FtqVCzL0ZqgP5MqXbb4fg/WgDys70nA= github.com/btcsuite/btcutil v0.0.0-20190207003914-4c204d697803/go.mod h1:+5NJ2+qvTyV9exUAL/rxXi3DcLg2Ts+ymUAY5y4NvMg= github.com/btcsuite/btcutil v0.0.0-20190425235716-9e5f4b9a998d/go.mod h1:+5NJ2+qvTyV9exUAL/rxXi3DcLg2Ts+ymUAY5y4NvMg= github.com/btcsuite/btcutil v1.0.2/go.mod h1:j9HUFwoQRsZL3V4n+qG+CUnEGHOarIxfC3Le2Yhbcts= +github.com/btcsuite/btcutil v1.0.3-0.20201208143702-a53e38424cce/go.mod h1:0DVlHczLPewLcPGEIeUEzfOJhqGPQ0mJJRDBtD307+o= github.com/btcsuite/go-socks v0.0.0-20170105172521-4720035b7bfd/go.mod h1:HHNXQzUsZCxOoE+CPiyCTO6x34Zs86zZUiwtpXoGdtg= github.com/btcsuite/goleveldb v0.0.0-20160330041536-7834afc9e8cd/go.mod h1:F+uVaaLLH7j4eDXPRvw78tMflu7Ie2bzYOH4Y8rRKBY= github.com/btcsuite/goleveldb v1.0.0/go.mod h1:QiK9vBlgftBg6rWQIj6wFzbPfRjiykIEhBH4obrXJ/I= @@ -182,6 +185,8 @@ github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMn github.com/clbanning/x2j v0.0.0-20191024224557-825249438eec/go.mod h1:jMjuTZXRI4dUb/I5gc9Hdhagfvm9+RyrPryS/auMzxE= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= +github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= +github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= @@ -237,8 +242,8 @@ github.com/dgraph-io/badger v1.6.1/go.mod h1:FRmFw3uxvcpa8zG3Rxs0th+hCLIuaQg8HlN github.com/dgraph-io/badger v1.6.2 h1:mNw0qs90GVgGGWylh0umH5iag1j6n/PeJtNvL6KY/x8= github.com/dgraph-io/badger v1.6.2/go.mod h1:JW2yswe3V058sS0kZ2h/AXeDSqFjxnZcRrVH//y2UQE= github.com/dgraph-io/badger/v2 v2.0.3/go.mod h1:3KY8+bsP8wI0OEnQJAKpd4wIJW/Mm32yw2j/9FUVnIM= -github.com/dgraph-io/badger/v2 v2.2007.2 h1:EjjK0KqwaFMlPin1ajhP943VPENHJdEz1KLIegjaI3k= -github.com/dgraph-io/badger/v2 v2.2007.2/go.mod h1:26P/7fbL4kUZVEVKLAKXkBXKOydDmM2p1e+NhhnBCAE= +github.com/dgraph-io/badger/v2 v2.2007.3 h1:Sl9tQWz92WCbVSe8pj04Tkqlm2boW+KAxd+XSs58SQI= +github.com/dgraph-io/badger/v2 v2.2007.3/go.mod h1:26P/7fbL4kUZVEVKLAKXkBXKOydDmM2p1e+NhhnBCAE= github.com/dgraph-io/badger/v3 v3.2011.1 h1:Hmyof0WMEF/QtutX5SQHzIMnJQxb/IrSzhjckV2SD6g= github.com/dgraph-io/badger/v3 v3.2011.1/go.mod h1:0rLLrQpKVQAL0or/lBLMQznhr6dWWX7h5AKnmnqx268= github.com/dgraph-io/ristretto v0.0.2-0.20200115201040-8f368f2f2ab3/go.mod h1:KPxhHT9ZxKefz+PCeOGsrHpl1qZ7i70dGTu2u+Ahh6E= @@ -281,6 +286,8 @@ github.com/envoyproxy/go-control-plane v0.6.9/go.mod h1:SBwIajubJHhxtWwsL9s8ss4s github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= +github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= +github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ= github.com/envoyproxy/protoc-gen-validate v0.0.14/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/esimonov/ifshort v1.0.2 h1:K5s1W2fGfkoWXsFlxBNqT6J0ZCncPaKrGM5qe0bni68= @@ -312,10 +319,10 @@ github.com/filecoin-project/go-commp-utils v0.1.3 h1:rTxbkNXZU7FLgdkBk8RsQIEOuPO github.com/filecoin-project/go-commp-utils v0.1.3/go.mod h1:3ENlD1pZySaUout0p9ANQrY3fDFoXdqyX04J+dWpK30= 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.10.1 h1:YQNLwhizxkdfFxegAyrnn3l7WjgMjqDlqFzr18iWiYI= -github.com/filecoin-project/go-data-transfer v1.10.1/go.mod h1:CSDMCrPK2lVGodNB1wPEogjFvM9nVGyiL1GNbBRTSdw= -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-data-transfer v1.12.0 h1:y44x35JvB93kezahMURKizIa/aizGTPSHqi5cbAfTEo= +github.com/filecoin-project/go-data-transfer v1.12.0/go.mod h1:tDrD2jLU2TpVhd+5B8iqBp0fQRV4lP80WZccKXugjYc= +github.com/filecoin-project/go-ds-versioning v0.0.0-20211206185234-508abd7c2aff h1:2bG2ggVZ/rInd/YqUfRj4A5siGuYOPxxuD4I8nYLJF0= +github.com/filecoin-project/go-ds-versioning v0.0.0-20211206185234-508abd7c2aff/go.mod h1:C9/l9PnB1+mwPa26BBVpCjG/XQCB0yj/q5CK2J8X1I4= 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= @@ -342,15 +349,15 @@ github.com/filecoin-project/go-state-types v0.1.1/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 h1:ufMFq00VqnT2CAuDpcGnwLnCX1I/c3OROw/kXVNSTZk= -github.com/filecoin-project/go-statestore v0.1.1/go.mod h1:LFc9hD+fRxPqiHiaqUEZOinUJB4WARkRfNl10O7kTnI= +github.com/filecoin-project/go-statestore v0.2.0 h1:cRRO0aPLrxKQCZ2UOQbzFGn4WDNdofHZoGPjfNaAo5Q= +github.com/filecoin-project/go-statestore v0.2.0/go.mod h1:8sjBYbS35HwPzct7iT4lIXjLlYyPor80aU7t7a/Kspo= github.com/filecoin-project/specs-actors v0.9.4/go.mod h1:BStZQzx5x7TmCkLv0Bpa07U6cPKol6fd3w9KjMPZ6Z4= github.com/filecoin-project/specs-actors v0.9.13/go.mod h1:TS1AW/7LbG+615j4NsjMK1qlpAwaFsG9w0V2tg2gSao= github.com/filecoin-project/specs-actors v0.9.14 h1:68PVstg2UB3ZsMLF+DKFTAs/YKsqhKWynkr0IqmVRQY= github.com/filecoin-project/specs-actors v0.9.14/go.mod h1:TS1AW/7LbG+615j4NsjMK1qlpAwaFsG9w0V2tg2gSao= github.com/filecoin-project/specs-actors/v2 v2.3.5-0.20210114162132-5b58b773f4fb/go.mod h1:LljnY2Mn2homxZsmokJZCpRuhOPxfXhvcek5gWkmqAc= -github.com/filecoin-project/specs-actors/v2 v2.3.5 h1:PbT4tPlSXZ8sRgajhb4D8AOEmiaaZ+jg6tc6BBv8VQc= -github.com/filecoin-project/specs-actors/v2 v2.3.5/go.mod h1:LljnY2Mn2homxZsmokJZCpRuhOPxfXhvcek5gWkmqAc= +github.com/filecoin-project/specs-actors/v2 v2.3.6 h1:UxnWTfQd7JsOae39/aHCK0m1IBjdcyymCJfqxuSkn+g= +github.com/filecoin-project/specs-actors/v2 v2.3.6/go.mod h1:DJMpxVRXvev9t8P0XWA26RmTzN+MHiL9IlItVLT0zUc= github.com/filecoin-project/specs-actors/v3 v3.1.0/go.mod h1:mpynccOLlIRy0QnR008BwYBwT9fen+sPR13MA1VmMww= github.com/filecoin-project/specs-actors/v3 v3.1.1 h1:BE8fsns1GnEOxt1DTE5LxBK2FThXtWmCChgcJoHTg0E= github.com/filecoin-project/specs-actors/v3 v3.1.1/go.mod h1:mpynccOLlIRy0QnR008BwYBwT9fen+sPR13MA1VmMww= @@ -379,8 +386,9 @@ github.com/francoispqt/gojay v1.2.13 h1:d2m3sFjloqoIUQU3TsHBgj6qg/BVGlTBeHDUmyJn github.com/francoispqt/gojay v1.2.13/go.mod h1:ehT5mTG4ua4581f1++1WLG0vPdaA9HaiDsoyrBGkyDY= github.com/franela/goblin v0.0.0-20200105215937-c9ffbefa60db/go.mod h1:7dvUGVsVBjqR7JHJk0brhHOZYGmfBYOrK0ZhYMEtBr4= github.com/franela/goreq v0.0.0-20171204163338-bcd34c9993f8/go.mod h1:ZhphrRTfi2rbfLwlschooIH4+wKKDR4Pdxhh+TRoA20= -github.com/frankban/quicktest v1.11.3 h1:8sXhOn0uLys67V8EsXLc6eszDs8VXWxL3iRvebPhedY= github.com/frankban/quicktest v1.11.3/go.mod h1:wRf/ReqHper53s+kmmSZizM8NamnL3IM0I9ntUbOk+k= +github.com/frankban/quicktest v1.14.0 h1:+cqqvzZV87b4adx/5ayVOaYZ2CrvM4ejQvUdBzPPUss= +github.com/frankban/quicktest v1.14.0/go.mod h1:NeW+ay9A/U67EYXNFA1nPE8e/tnQv/09mUdL/ijj8og= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= @@ -441,6 +449,8 @@ github.com/go-sql-driver/mysql v1.6.0 h1:BCTh4TKNUYmOmMUcQ3IipzF5prigylS7XXjEkfC github.com/go-sql-driver/mysql v1.6.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= github.com/go-stack/stack v1.8.0 h1:5SgMzNM5HxrEjV0ww2lTmX6E2Izsfxas4+YHWRs3Lsk= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0 h1:p104kn46Q8WdvHunIJ9dAyjPVtrBPhSr3KT2yUst43I= +github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= github.com/go-toolsmith/astcast v1.0.0 h1:JojxlmI6STnFVG9yOImLeGREv8W2ocNUM+iOhR6jE7g= github.com/go-toolsmith/astcast v1.0.0/go.mod h1:mt2OdQTeAQcY4DQgPSArJjHCcOwlX+Wl/kwN+LbLGQ4= github.com/go-toolsmith/astcopy v1.0.0 h1:OMgl1b1MEpjFQ1m5ztEO06rz5CUd3oBv9RF7+DyvdG8= @@ -496,8 +506,9 @@ github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFU github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= github.com/golang/mock v1.4.1/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/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc= +github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs= github.com/golang/protobuf v1.1.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.0/go.mod h1:Qd/q+1AKNOZr9uGQzbzCmRO6sUih6GTPZv6a1/R87v0= @@ -515,8 +526,9 @@ github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QD github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= -github.com/golang/protobuf v1.5.1 h1:jAbXjIeW2ZSW2AwFxlGTDoc2CjI2XujLkV3ArsZFCvc= github.com/golang/protobuf v1.5.1/go.mod h1:DopwsBzvsk0Fs44TXzsVbJyPhcCPeIwnvohx4u74HPM= +github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= +github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.2-0.20190904063534-ff6b7dc882cf h1:gFVkHXmVAhEbxZVDln5V9GKrLaluNoFHDbrZwAWZgws= @@ -569,7 +581,6 @@ github.com/google/go-querystring v1.0.0 h1:Xkwi/a1rcvNg1PPYe5vI8GbeBY/jrVuDX5ASu github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gopacket v1.1.17/go.mod h1:UdDNZ1OO62aGYVnPhxT1U6aI7ukYtA/kB8vaU0diBUM= -github.com/google/gopacket v1.1.18/go.mod h1:UdDNZ1OO62aGYVnPhxT1U6aI7ukYtA/kB8vaU0diBUM= github.com/google/gopacket v1.1.19 h1:ves8RnFZPGiFnTS0uPQStjwru6uO6h+nlr9j6fL7kF8= github.com/google/gopacket v1.1.19/go.mod h1:iJ8V8n6KS+z2U1A8pUwu8bW5SyEMkXJB8Yo/Vo+TKTo= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= @@ -588,8 +599,9 @@ github.com/google/uuid v0.0.0-20161128191214-064e2069ce9c/go.mod h1:TIyPZe4Mgqvf github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.2.0 h1:qJYtXnJRWmpe7m/3XlyhrsLrEURqHRM2kxzoxXqyUDs= github.com/google/uuid v1.2.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= +github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go v2.0.0+incompatible/go.mod h1:SFVmujtThgffbyetf+mdk2eWhX2bMyUtNHzFKcPA9HY= github.com/googleapis/gax-go/v2 v2.0.3/go.mod h1:LLvjysVCY1JZeum8Z6l8qUty8fiNwE08qbEPm1M08qg= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= @@ -641,8 +653,9 @@ github.com/grpc-ecosystem/grpc-gateway v1.5.0/go.mod h1:RSKVYQBd5MCa4OVpNdGskqpg github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/grpc-ecosystem/grpc-gateway v1.12.1/go.mod h1:8XEsbTttt/W+VvjtQhLACqCisSPWTxCZ7sBRjU6iH9c= -github.com/grpc-ecosystem/grpc-gateway v1.14.6 h1:8ERzHx8aj1Sc47mu9n/AksaKCSWrMchFtkdrS4BIj5o= github.com/grpc-ecosystem/grpc-gateway v1.14.6/go.mod h1:zdiPV4Yse/1gnckTHtghG4GkDEdKCRJduHpTxT3/jcw= +github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo= +github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/grpc-ecosystem/grpc-opentracing v0.0.0-20180507213350-8e809c8a8645/go.mod h1:6iZfnjpejD4L/4DwD7NryNaJyCQdzwWwH2MWhCA90Kw= github.com/gxed/go-shellwords v1.0.3/go.mod h1:N7paucT91ByIjmVJHhvoarjoQnmsi3Jd3vH7VqgtMxQ= github.com/gxed/hashland/keccakpg v0.0.1/go.mod h1:kRzw3HkwxFU1mpmPP8v1WyQzwdGfmKFJ6tItnhQ67kU= @@ -663,8 +676,9 @@ github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtng github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= -github.com/hashicorp/go-multierror v1.1.0 h1:B9UzwGQJehnUY1yNrnwREHc3fGbC2xefo8g4TbElacI= github.com/hashicorp/go-multierror v1.1.0/go.mod h1:spPvp8C1qA32ftKqdAHm4hHTbPw+vmowP0z+KUhOZdA= +github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo= +github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= @@ -689,8 +703,9 @@ github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpO github.com/huandu/xstrings v1.0.0/go.mod h1:4qWG/gcEcfX4z/mBDHJ++3ReCw9ibxbsNJbcucJdbSo= github.com/huandu/xstrings v1.2.0/go.mod h1:DvyZB1rfVYsBIigL8HwpZgxHwXozlTgGqn63UyNX5k4= github.com/hudl/fargo v1.3.0/go.mod h1:y3CKSmjA+wD2gak7sUSXTAoopbhU08POFhmITJgmKTg= -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/goupnp v1.0.2 h1:RfGLP+h3mvisuWEyybxNq5Eft3NWhHLPeUN72kpKZoI= +github.com/huin/goupnp v1.0.2/go.mod h1:0dxJBVBHqTMjIUMkESDTNgOOx/Mw5wYIfyFmdzSamkM= github.com/huin/goutil v0.0.0-20170803182201-1ca381bf3150/go.mod h1:PpLOETDnJ0o3iZrZfqZzyLl6l7F3c6L1oWn7OICBi6o= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/imdario/mergo v0.3.4/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= @@ -717,18 +732,16 @@ github.com/ipfs/bbloom v0.0.4/go.mod h1:cS9YprKXpoZ9lT0n/Mw/a6/aFV6DTjTLYHeA+gyq github.com/ipfs/go-bitswap v0.0.9/go.mod h1:kAPf5qgn2W2DrgAcscZ3HrM9qh4pH+X8Fkk3UPrwvis= github.com/ipfs/go-bitswap v0.1.0/go.mod h1:FFJEf18E9izuCqUtHxbWEvq+reg7o4CW5wSAE1wsxj0= github.com/ipfs/go-bitswap v0.1.2/go.mod h1:qxSWS4NXGs7jQ6zQvoPY3+NmOfHHG47mhkiLzBpJQIs= -github.com/ipfs/go-bitswap v0.1.8/go.mod h1:TOWoxllhccevbWFUR2N7B1MTSVVge1s6XSMiCSA4MzM= -github.com/ipfs/go-bitswap v0.3.2 h1:TdKx7lpidYe2dMAKfdeNS26y6Pc/AZX/i8doI1GV210= -github.com/ipfs/go-bitswap v0.3.2/go.mod h1:AyWWfN3moBzQX0banEtfKOfbXb3ZeoOeXnZGNPV9S6w= +github.com/ipfs/go-bitswap v0.5.1 h1:721YAEDBnLIrvcIMkCHCdqp34hA8jwL9yKMkyJpSpco= +github.com/ipfs/go-bitswap v0.5.1/go.mod h1:P+ckC87ri1xFLvk74NlXdP0Kj9RmWAh4+H78sC6Qopo= 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/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.7/go.mod h1:EOfb9k/Y878ZTRY/CH0x5+ATtaipfbRhbvNSdgc/7So= github.com/ipfs/go-blockservice v0.1.0/go.mod h1:hzmMScl1kXHg3M2BjTymbVPjv627N7sYcvYaKbop39M= -github.com/ipfs/go-blockservice v0.1.3/go.mod h1:OTZhFpkgY48kNzbgyvcexW9cHrpjBYIjSR0KoDOFOLU= -github.com/ipfs/go-blockservice v0.1.4 h1:Vq+MlsH8000KbbUciRyYMEw/NNP8UAGmcqKi4uWmFGA= -github.com/ipfs/go-blockservice v0.1.4/go.mod h1:OTZhFpkgY48kNzbgyvcexW9cHrpjBYIjSR0KoDOFOLU= +github.com/ipfs/go-blockservice v0.2.1 h1:NJ4j/cwEfIg60rzAWcCIxRtOwbf6ZPK49MewNxObCPQ= +github.com/ipfs/go-blockservice v0.2.1/go.mod h1:k6SiwmgyYgs4M/qt+ww6amPeUH9EISLRBnvUurKJhi8= github.com/ipfs/go-cid v0.0.1/go.mod h1:GHWU/WuQdMPmIosc4Yn1bcCT7dSeX4lBafM7iqUPQvM= github.com/ipfs/go-cid v0.0.2/go.mod h1:GHWU/WuQdMPmIosc4Yn1bcCT7dSeX4lBafM7iqUPQvM= github.com/ipfs/go-cid v0.0.3/go.mod h1:GHWU/WuQdMPmIosc4Yn1bcCT7dSeX4lBafM7iqUPQvM= @@ -744,13 +757,14 @@ github.com/ipfs/go-datastore v0.0.1/go.mod h1:d4KVXhMt913cLBEI/PXAy6ko+W7e9AhyAK github.com/ipfs/go-datastore v0.0.5/go.mod h1:d4KVXhMt913cLBEI/PXAy6ko+W7e9AhyAKBGh803qeE= github.com/ipfs/go-datastore v0.1.0/go.mod h1:d4KVXhMt913cLBEI/PXAy6ko+W7e9AhyAKBGh803qeE= github.com/ipfs/go-datastore v0.1.1/go.mod h1:w38XXW9kVFNp57Zj5knbKWM2T+KOZCGDRVNdgPHtbHw= -github.com/ipfs/go-datastore v0.3.1/go.mod h1:w38XXW9kVFNp57Zj5knbKWM2T+KOZCGDRVNdgPHtbHw= github.com/ipfs/go-datastore v0.4.0/go.mod h1:SX/xMIKoCszPqp+z9JhPYCmoOoXTvaa13XEbGtsFUhA= github.com/ipfs/go-datastore v0.4.1/go.mod h1:SX/xMIKoCszPqp+z9JhPYCmoOoXTvaa13XEbGtsFUhA= -github.com/ipfs/go-datastore v0.4.2/go.mod h1:SX/xMIKoCszPqp+z9JhPYCmoOoXTvaa13XEbGtsFUhA= github.com/ipfs/go-datastore v0.4.4/go.mod h1:SX/xMIKoCszPqp+z9JhPYCmoOoXTvaa13XEbGtsFUhA= -github.com/ipfs/go-datastore v0.4.5 h1:cwOUcGMLdLPWgu3SlrCckCMznaGADbPqE0r8h768/Dg= github.com/ipfs/go-datastore v0.4.5/go.mod h1:eXTcaaiN6uOlVCLS9GjJUJtlvJfM3xk23w3fyfrmmJs= +github.com/ipfs/go-datastore v0.4.7-0.20211013204805-28a3721c2e66/go.mod h1:9zhEApYMTl17C8YDp7JmU7sQZi2/wqiYh73hakZ90Bk= +github.com/ipfs/go-datastore v0.5.0/go.mod h1:9zhEApYMTl17C8YDp7JmU7sQZi2/wqiYh73hakZ90Bk= +github.com/ipfs/go-datastore v0.5.1 h1:WkRhLuISI+XPD0uk3OskB0fYFSyqK8Ob5ZYew9Qa1nQ= +github.com/ipfs/go-datastore v0.5.1/go.mod h1:9zhEApYMTl17C8YDp7JmU7sQZi2/wqiYh73hakZ90Bk= github.com/ipfs/go-detect-race v0.0.1 h1:qX/xay2W3E4Q1U7d9lNs1sU9nvguX0a7319XbyQ6cOk= github.com/ipfs/go-detect-race v0.0.1/go.mod h1:8BNT7shDZPo99Q74BpGMK+4D8Mn4j46UU0LZ723meps= github.com/ipfs/go-ds-badger v0.0.2/go.mod h1:Y3QpeSFWQf6MopLTiZD+VT6IC1yZqaGmjvRcKeSGij8= @@ -758,28 +772,26 @@ github.com/ipfs/go-ds-badger v0.0.5/go.mod h1:g5AuuCGmr7efyzQhLL8MzwqcauPojGPUaH github.com/ipfs/go-ds-badger v0.0.7/go.mod h1:qt0/fWzZDoPW6jpQeqUjR5kBfhDNB65jd9YlmAvpQBk= github.com/ipfs/go-ds-badger v0.2.1/go.mod h1:Tx7l3aTph3FMFrRS838dcSJh+jjA7cX9DrGVwx/NOwE= github.com/ipfs/go-ds-badger v0.2.3/go.mod h1:pEYw0rgg3FIrywKKnL+Snr+w/LjJZVMTBRn4FS6UHUk= -github.com/ipfs/go-ds-badger v0.2.6/go.mod h1:02rnztVKA4aZwDuaRPTf8mpqcKmXP7mLl6JPxd14JHA= +github.com/ipfs/go-ds-badger v0.2.7/go.mod h1:02rnztVKA4aZwDuaRPTf8mpqcKmXP7mLl6JPxd14JHA= +github.com/ipfs/go-ds-badger v0.3.0/go.mod h1:1ke6mXNqeV8K3y5Ak2bAA0osoTfmxUdupVCGm4QUIek= github.com/ipfs/go-ds-badger2 v0.1.0/go.mod h1:pbR1p817OZbdId9EvLOhKBgUVTM3BMCSTan78lDDVaw= -github.com/ipfs/go-ds-badger2 v0.1.1-0.20200708190120-187fc06f714e h1:Xi1nil8K2lBOorBS6Ys7+hmUCzH8fr3U9ipdL/IrcEI= -github.com/ipfs/go-ds-badger2 v0.1.1-0.20200708190120-187fc06f714e/go.mod h1:lJnws7amT9Ehqzta0gwMrRsURU04caT0iRPr1W8AsOU= +github.com/ipfs/go-ds-badger2 v0.1.2 h1:sQc2q1gaXrv8YFNeUtxil0neuyDf9hnVHfLsi7lpXfE= +github.com/ipfs/go-ds-badger2 v0.1.2/go.mod h1:3FtQmDv6fMubygEfU43bsFelYpIiXX/XEYA54l9eCwg= github.com/ipfs/go-ds-leveldb v0.0.1/go.mod h1:feO8V3kubwsEF22n0YRQCffeb79OOYIykR4L04tMOYc= github.com/ipfs/go-ds-leveldb v0.1.0/go.mod h1:hqAW8y4bwX5LWcCtku2rFNX3vjDZCy5LZCg+cSZvYb8= github.com/ipfs/go-ds-leveldb v0.4.1/go.mod h1:jpbku/YqBSsBc1qgME8BkWS4AxzF2cEu1Ii2r79Hh9s= github.com/ipfs/go-ds-leveldb v0.4.2/go.mod h1:jpbku/YqBSsBc1qgME8BkWS4AxzF2cEu1Ii2r79Hh9s= -github.com/ipfs/go-filestore v1.0.0 h1:QR7ekKH+q2AGiWDc7W2Q0qHuYSRZGUJqUn0GsegEPb0= -github.com/ipfs/go-filestore v1.0.0/go.mod h1:/XOCuNtIe2f1YPbiXdYvD0BKLA0JR1MgPiFOdcuu9SM= +github.com/ipfs/go-ds-leveldb v0.5.0/go.mod h1:d3XG9RUDzQ6V4SHi8+Xgj9j1XuEk1z82lquxrVbml/Q= 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.9.1 h1:jo7ZaAZ3lal89RhKxKoRkPzIO8lmOY6KUWA1mDRZ2+U= -github.com/ipfs/go-graphsync v0.9.1/go.mod h1:J62ahWT9JbPsFL2UWsUM5rOu0lZJ0LOIH1chHdxGGcw= +github.com/ipfs/go-graphsync v0.11.0 h1:PiiD5CnoC3xEHMW8d6uBGqGcoTwiMB5d9CORIEyF6iA= +github.com/ipfs/go-graphsync v0.11.0/go.mod h1:wC+c8vGVjAHthsVIl8LKr37cUra2GOaMYcQNNmMxDqE= 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= -github.com/ipfs/go-ipfs-blockstore v0.1.4/go.mod h1:Jxm3XMVjh6R17WvxFEiyKBLUGr86HgIYJW/D/MwqeYQ= -github.com/ipfs/go-ipfs-blockstore v1.0.0/go.mod h1:knLVdhVU9L7CC4T+T4nvGdeUIPAXlnd9zmXfp+9MIjU= -github.com/ipfs/go-ipfs-blockstore v1.0.1/go.mod h1:MGNZlHNEnR4KGgPHM3/k8lBySIOK2Ve+0KjZubKlaOE= -github.com/ipfs/go-ipfs-blockstore v1.0.3 h1:RDhK6fdg5YsonkpMuMpdvk/pRtOQlrIRIybuQfkvB2M= -github.com/ipfs/go-ipfs-blockstore v1.0.3/go.mod h1:MGNZlHNEnR4KGgPHM3/k8lBySIOK2Ve+0KjZubKlaOE= +github.com/ipfs/go-ipfs-blockstore v0.2.1/go.mod h1:jGesd8EtCM3/zPgx+qr0/feTXGUeRai6adgwC+Q+JvE= +github.com/ipfs/go-ipfs-blockstore v1.1.0/go.mod h1:5QDUApRqpgPcfGstCxYeMnjt/DYQtXXdJVCvxHHuWVk= +github.com/ipfs/go-ipfs-blockstore v1.1.2 h1:WCXoZcMYnvOTmlpX+RSSnhVN0uCmbWTeepTGX5lgiXw= +github.com/ipfs/go-ipfs-blockstore v1.1.2/go.mod h1:w51tNR9y5+QXB0wkNcHt4O2aSZjTdqaEWaQdSxEyUOY= github.com/ipfs/go-ipfs-blocksutil v0.0.1 h1:Eh/H4pc1hsvhzsQoMEP3Bke/aW5P5rVM1IWFJMcGIPQ= github.com/ipfs/go-ipfs-blocksutil v0.0.1/go.mod h1:Yq4M86uIOmxmGPUHv/uI7uKqZNtLb449gwKqXjIsnRk= github.com/ipfs/go-ipfs-chunker v0.0.1/go.mod h1:tWewYK0we3+rMbOh7pPFGDyypCtvGcBFymgY4rSDLAw= @@ -792,12 +804,15 @@ github.com/ipfs/go-ipfs-delay v0.0.1 h1:r/UXYyRcddO6thwOnhiznIAiSvxMECGgtv35Xs1I github.com/ipfs/go-ipfs-delay v0.0.1/go.mod h1:8SP1YXK1M1kXuc4KJZINY3TQQ03J2rwBG9QfXmbRPrw= github.com/ipfs/go-ipfs-ds-help v0.0.1/go.mod h1:gtP9xRaZXqIQRh1HRpp595KbBEdgqWFxefeVKOV8sxo= github.com/ipfs/go-ipfs-ds-help v0.1.1/go.mod h1:SbBafGJuGsPI/QL3j9Fc5YPLeAu+SzOkI0gFwAg+mOs= -github.com/ipfs/go-ipfs-ds-help v1.0.0 h1:bEQ8hMGs80h0sR8O4tfDgV6B01aaF9qeTrujrTLYV3g= github.com/ipfs/go-ipfs-ds-help v1.0.0/go.mod h1:ujAbkeIgkKAWtxxNkoZHWLCyk5JpPoKnGyCcsoF6ueE= -github.com/ipfs/go-ipfs-exchange-interface v0.0.1 h1:LJXIo9W7CAmugqI+uofioIpRb6rY30GUu7G6LUfpMvM= +github.com/ipfs/go-ipfs-ds-help v1.1.0 h1:yLE2w9RAsl31LtfMt91tRZcrx+e61O5mDxFRR994w4Q= +github.com/ipfs/go-ipfs-ds-help v1.1.0/go.mod h1:YR5+6EaebOhfcqVCyqemItCLthrpVNot+rsOU/5IatU= github.com/ipfs/go-ipfs-exchange-interface v0.0.1/go.mod h1:c8MwfHjtQjPoDyiy9cFquVtVHkO9b9Ob3FG91qJnWCM= -github.com/ipfs/go-ipfs-exchange-offline v0.0.1 h1:P56jYKZF7lDDOLx5SotVh5KFxoY6C81I1NSHW1FxGew= +github.com/ipfs/go-ipfs-exchange-interface v0.1.0 h1:TiMekCrOGQuWYtZO3mf4YJXDIdNgnKWZ9IE3fGlnWfo= +github.com/ipfs/go-ipfs-exchange-interface v0.1.0/go.mod h1:ych7WPlyHqFvCi/uQI48zLZuAWVP5iTQPXEfVaw5WEI= github.com/ipfs/go-ipfs-exchange-offline v0.0.1/go.mod h1:WhHSFCVYX36H/anEKQboAzpUws3x7UeEGkzQc3iNkM0= +github.com/ipfs/go-ipfs-exchange-offline v0.1.1 h1:mEiXWdbMN6C7vtDG21Fphx8TGCbZPpQnz/496w/PL4g= +github.com/ipfs/go-ipfs-exchange-offline v0.1.1/go.mod h1:vTiBRIbzSwDD0OWm+i3xeT0mO7jG2cbJYatp3HPk5XY= github.com/ipfs/go-ipfs-files v0.0.3/go.mod h1:INEFm0LL2LWXBhNJ2PMIIb2w45hpXgPjNoE7yA8Y1d4= github.com/ipfs/go-ipfs-files v0.0.4/go.mod h1:INEFm0LL2LWXBhNJ2PMIIb2w45hpXgPjNoE7yA8Y1d4= github.com/ipfs/go-ipfs-files v0.0.8 h1:8o0oFJkJ8UkO/ABl8T6ac6tKF3+NIpj67aAB6ZpusRg= @@ -808,22 +823,27 @@ github.com/ipfs/go-ipfs-pq v0.0.1/go.mod h1:LWIqQpqfRG3fNc5XsnIhz/wQ2XXGyugQwls7 github.com/ipfs/go-ipfs-pq v0.0.2 h1:e1vOOW6MuOwG2lqxcLA+wEn93i/9laCY8sXAw76jFOY= github.com/ipfs/go-ipfs-pq v0.0.2/go.mod h1:LWIqQpqfRG3fNc5XsnIhz/wQ2XXGyugQwls7BgUmUfY= github.com/ipfs/go-ipfs-routing v0.0.1/go.mod h1:k76lf20iKFxQTjcJokbPM9iBXVXVZhcOwc360N4nuKs= -github.com/ipfs/go-ipfs-routing v0.1.0 h1:gAJTT1cEeeLj6/DlLX6t+NxD9fQe2ymTO6qWRDI/HQQ= github.com/ipfs/go-ipfs-routing v0.1.0/go.mod h1:hYoUkJLyAUKhF58tysKpids8RNDPO42BVMgK5dNsoqY= +github.com/ipfs/go-ipfs-routing v0.2.1 h1:E+whHWhJkdN9YeoHZNj5itzc+OR292AJ2uE9FFiW0BY= +github.com/ipfs/go-ipfs-routing v0.2.1/go.mod h1:xiNNiwgjmLqPS1cimvAw6EyB9rkVDbiocA4yY+wRNLM= github.com/ipfs/go-ipfs-util v0.0.1/go.mod h1:spsl5z8KUnrve+73pOhSVZND1SIxPW5RyBCNzQxlJBc= github.com/ipfs/go-ipfs-util v0.0.2 h1:59Sswnk1MFaiq+VcaknX7aYEyGyGDAA73ilhEK2POp8= github.com/ipfs/go-ipfs-util v0.0.2/go.mod h1:CbPtkWJzjLdEcezDns2XYaehFVNXG9zrdrtMecczcsQ= github.com/ipfs/go-ipld-cbor v0.0.2/go.mod h1:wTBtrQZA3SoFKMVkp6cn6HMRteIB1VsmHA0AQFOn7Nc= github.com/ipfs/go-ipld-cbor v0.0.3/go.mod h1:wTBtrQZA3SoFKMVkp6cn6HMRteIB1VsmHA0AQFOn7Nc= github.com/ipfs/go-ipld-cbor v0.0.4/go.mod h1:BkCduEx3XBCO6t2Sfo5BaHzuok7hbhdMm9Oh8B2Ftq4= -github.com/ipfs/go-ipld-cbor v0.0.5 h1:ovz4CHKogtG2KB/h1zUp5U0c/IzZrL435rCh5+K/5G8= github.com/ipfs/go-ipld-cbor v0.0.5/go.mod h1:BkCduEx3XBCO6t2Sfo5BaHzuok7hbhdMm9Oh8B2Ftq4= +github.com/ipfs/go-ipld-cbor v0.0.6-0.20211211231443-5d9b9e1f6fa8/go.mod h1:ssdxxaLJPXH7OjF5V4NSjBbcfh+evoR4ukuru0oPXMA= +github.com/ipfs/go-ipld-cbor v0.0.6 h1:pYuWHyvSpIsOOLw4Jy7NbBkCyzLDcl64Bf/LZW7eBQ0= +github.com/ipfs/go-ipld-cbor v0.0.6/go.mod h1:ssdxxaLJPXH7OjF5V4NSjBbcfh+evoR4ukuru0oPXMA= github.com/ipfs/go-ipld-format v0.0.1/go.mod h1:kyJtbkDALmFHv3QR6et67i35QzO3S0dCDnkOJhcZkms= github.com/ipfs/go-ipld-format v0.0.2/go.mod h1:4B6+FM2u9OJ9zCV+kSbgFAZlOrv1Hqbf0INGQgiKf9k= github.com/ipfs/go-ipld-format v0.2.0 h1:xGlJKkArkmBvowr+GMCX0FEZtkro71K1AwiKnL37mwA= github.com/ipfs/go-ipld-format v0.2.0/go.mod h1:3l3C1uKoadTPbeNfrDi+xMInYKlx2Cvg1BuydPSdzQs= -github.com/ipfs/go-ipns v0.0.2 h1:oq4ErrV4hNQ2Eim257RTYRgfOSV/s8BDaf9iIl4NwFs= -github.com/ipfs/go-ipns v0.0.2/go.mod h1:WChil4e0/m9cIINWLxZe1Jtf77oz5L05rO2ei/uKJ5U= +github.com/ipfs/go-ipld-legacy v0.1.0 h1:wxkkc4k8cnvIGIjPO0waJCe7SHEyFgl+yQdafdjGrpA= +github.com/ipfs/go-ipld-legacy v0.1.0/go.mod h1:86f5P/srAmh9GcIcWQR9lfFLZPrIyyXQeVlOWeeWEuI= +github.com/ipfs/go-ipns v0.1.2 h1:O/s/0ht+4Jl9+VoxoUo0zaHjnZUS+aBQIKTuzdZ/ucI= +github.com/ipfs/go-ipns v0.1.2/go.mod h1:ioQ0j02o6jdIVW+bmi18f4k2gRf0AV3kZ9KeHYHICnQ= github.com/ipfs/go-log v0.0.1/go.mod h1:kL1d2/hzSpI0thNYjiKfjanbVNU+IIGA/WnNESY9leM= github.com/ipfs/go-log v1.0.0/go.mod h1:JO7RzlMK6rA+CIxFMLOuB6Wf5b81GDiKElL7UPSIKjA= github.com/ipfs/go-log v1.0.1/go.mod h1:HuWlQttfN6FWNHRhlY5yMk/lW7evQC0HHGOxEwMRR8I= @@ -840,23 +860,22 @@ github.com/ipfs/go-log/v2 v2.0.8/go.mod h1:eZs4Xt4ZUJQFM3DlanGhy7TkwwawCZcSByscw github.com/ipfs/go-log/v2 v2.1.1/go.mod h1:2v2nsGfZsvvAJz13SyFzf9ObaqwHiHxsPLEHntrv9KM= github.com/ipfs/go-log/v2 v2.1.2-0.20200626104915-0016c0b4b3e4/go.mod h1:2v2nsGfZsvvAJz13SyFzf9ObaqwHiHxsPLEHntrv9KM= github.com/ipfs/go-log/v2 v2.1.3/go.mod h1:/8d0SH3Su5Ooc31QlL1WysJhvyOTDCjcCZ9Axpmri6g= -github.com/ipfs/go-log/v2 v2.3.0 h1:31Re/cPqFHpsRHgyVwjWADPoF0otB1WrjTy8ZFYwEZU= github.com/ipfs/go-log/v2 v2.3.0/go.mod h1:QqGoj30OTpnKaG/LKTGTxoP2mmQtjVMEnK72gynbe/g= +github.com/ipfs/go-log/v2 v2.4.0 h1:iR/2o9PGWanVJrBgIH5Ff8mPGOwpqLaPIAFqSnsdlzk= +github.com/ipfs/go-log/v2 v2.4.0/go.mod h1:nPZnh7Cj7lwS3LpRU5Mwr2ol1c2gXIEXuF6aywqrtmo= github.com/ipfs/go-merkledag v0.0.6/go.mod h1:QYPdnlvkOg7GnQRofu9XZimC5ZW5Wi3bKys/4GQQfto= github.com/ipfs/go-merkledag v0.2.3/go.mod h1:SQiXrtSts3KGNmgOzMICy5c0POOpUNQLvB3ClKnBAlk= github.com/ipfs/go-merkledag v0.2.4/go.mod h1:SQiXrtSts3KGNmgOzMICy5c0POOpUNQLvB3ClKnBAlk= -github.com/ipfs/go-merkledag v0.3.1/go.mod h1:fvkZNNZixVW6cKSZ/JfLlON5OlgTXNdRLz0p6QG/I2M= -github.com/ipfs/go-merkledag v0.3.2 h1:MRqj40QkrWkvPswXs4EfSslhZ4RVPRbxwX11js0t1xY= -github.com/ipfs/go-merkledag v0.3.2/go.mod h1:fvkZNNZixVW6cKSZ/JfLlON5OlgTXNdRLz0p6QG/I2M= +github.com/ipfs/go-merkledag v0.5.1 h1:tr17GPP5XtPhvPPiWtu20tSGZiZDuTaJRXBLcr79Umk= +github.com/ipfs/go-merkledag v0.5.1/go.mod h1:cLMZXx8J08idkp5+id62iVftUQV+HlYJ3PIhDfZsjA4= github.com/ipfs/go-metrics-interface v0.0.1 h1:j+cpbjYvu4R8zbleSs36gvB7jR+wsL2fGD6n0jO4kdg= github.com/ipfs/go-metrics-interface v0.0.1/go.mod h1:6s6euYU4zowdslK0GKHmqaIZ3j/b/tL7HTWtJ4VPgWY= github.com/ipfs/go-path v0.0.7 h1:H06hKMquQ0aYtHiHryOMLpQC1qC3QwXwkahcEVD51Ho= github.com/ipfs/go-path v0.0.7/go.mod h1:6KTKmeRnBXgqrTvzFrPV3CamxcgvXX/4z79tfAd2Sno= github.com/ipfs/go-peertaskqueue v0.0.4/go.mod h1:03H8fhyeMfKNFWqzYEVyMbcPUeYrqP1MX6Kd+aN+rMQ= github.com/ipfs/go-peertaskqueue v0.1.0/go.mod h1:Jmk3IyCcfl1W3jTW3YpghSwSEC6IJ3Vzz/jUmWw8Z0U= -github.com/ipfs/go-peertaskqueue v0.1.1/go.mod h1:Jmk3IyCcfl1W3jTW3YpghSwSEC6IJ3Vzz/jUmWw8Z0U= -github.com/ipfs/go-peertaskqueue v0.2.0 h1:2cSr7exUGKYyDeUyQ7P/nHPs9P7Ht/B+ROrpN1EJOjc= -github.com/ipfs/go-peertaskqueue v0.2.0/go.mod h1:5/eNrBEbtSKWCG+kQK8K8fGNixoYUnr+P7jivavs9lY= +github.com/ipfs/go-peertaskqueue v0.7.0 h1:VyO6G4sbzX80K58N60cCaHsSsypbUNs1GjO5seGNsQ0= +github.com/ipfs/go-peertaskqueue v0.7.0/go.mod h1:M/akTIE/z1jGNXMU7kFB4TeSEFvj68ow0Rrb04donIU= github.com/ipfs/go-unixfs v0.2.2-0.20190827150610-868af2e9e5cb/go.mod h1:IwAAgul1UQIcNZzKPYZWOCijryFBeCV79cNubPzol+k= github.com/ipfs/go-unixfs v0.2.4 h1:6NwppOXefWIyysZ4LR/qUBPvXd5//8J3jiMdvpbw6Lo= github.com/ipfs/go-unixfs v0.2.4/go.mod h1:SUdisfUjNoSDzzhGVxvCL9QO/nKdwXdr+gbMUdqcbYw= @@ -865,16 +884,17 @@ github.com/ipfs/go-verifcid v0.0.1/go.mod h1:5Hrva5KBeIog4A+UpqlaIU+DEstipcJYQQZ github.com/ipfs/iptb v1.4.0 h1:YFYTrCkLMRwk/35IMyC6+yjoQSHTEcNcefBStLJzgvo= github.com/ipfs/iptb v1.4.0/go.mod h1:1rzHpCYtNp87/+hTxG5TfCVn/yMY3dKnLn8tBiMfdmg= github.com/ipld/go-car v0.1.0/go.mod h1:RCWzaUh2i4mOEkB3W45Vc+9jnS/M6Qay5ooytiBHl3g= -github.com/ipld/go-car v0.3.1-0.20210601190600-f512dac51e8e h1:iTAJWTWEMe0Lx8JwRaIYrYgDuI9bVzkgogGz43Yv9Eo= -github.com/ipld/go-car v0.3.1-0.20210601190600-f512dac51e8e/go.mod h1:wUxBdwOLA9/0HZBi3fnTBzla0MuwlqgJLyrhOg1XaKI= -github.com/ipld/go-codec-dagpb v1.2.0/go.mod h1:6nBN7X7h8EOsEejZGqC7tej5drsdBAXbMHyBT+Fne5s= +github.com/ipld/go-car v0.3.3 h1:D6y+jvg9h2ZSv7GLUMWUwg5VTLy1E7Ak+uQw5orOg3I= +github.com/ipld/go-car v0.3.3/go.mod h1:/wkKF4908ULT4dFIFIUZYcfjAnj+KFnJvlh8Hsz1FbQ= github.com/ipld/go-codec-dagpb v1.3.0 h1:czTcaoAuNNyIYWs6Qe01DJ+sEX7B+1Z0LcXjSatMGe8= github.com/ipld/go-codec-dagpb v1.3.0/go.mod h1:ga4JTU3abYApDC3pZ00BC2RSvC3qfBb9MSJkMLSwnhA= github.com/ipld/go-ipld-prime v0.0.2-0.20191108012745-28a82f04c785/go.mod h1:bDDSvVz7vaK12FNvMeRYnpRFkSUPNQOiCYQezMD/P3w= github.com/ipld/go-ipld-prime v0.9.0/go.mod h1:KvBLMr4PX1gWptgkzRjVZCrLmSGcZCb/jioOQwCqZN8= +github.com/ipld/go-ipld-prime v0.9.1-0.20210324083106-dc342a9917db/go.mod h1:KvBLMr4PX1gWptgkzRjVZCrLmSGcZCb/jioOQwCqZN8= github.com/ipld/go-ipld-prime v0.11.0/go.mod h1:+WIAkokurHmZ/KwzDOMUuoeJgaRQktHtEaLglS3ZeV8= -github.com/ipld/go-ipld-prime v0.12.0 h1:JapyKWTsJgmhrPI7hfx4V798c/RClr85sXfBZnH1VIw= -github.com/ipld/go-ipld-prime v0.12.0/go.mod h1:hy8b93WleDMRKumOJnTIrr0MbbFbx9GD6Kzxa53Xppc= +github.com/ipld/go-ipld-prime v0.12.3/go.mod h1:PaeLYq8k6dJLmDUSLrzkEpoGV4PEfe/1OtFN/eALOc8= +github.com/ipld/go-ipld-prime v0.14.3-0.20211207234443-319145880958 h1:olscE5Sv+ts+N9YLQsIL9k6eS6y6CXMGRl5RCr2Cn/E= +github.com/ipld/go-ipld-prime v0.14.3-0.20211207234443-319145880958/go.mod h1:QcE4Y9n/ZZr8Ijg5bGPT0GqYWgZ1704nH0RDcQtgTP0= github.com/ipld/go-ipld-prime-proto v0.0.0-20191113031812-e32bd156a1e5/go.mod h1:gcvzoEDBjwycpXt3LBE061wT9f46szXGHAmj9uoP6fU= github.com/ipsn/go-secp256k1 v0.0.0-20180726113642-9d62b9f0bc52 h1:QG4CGBqCeuBo6aZlGAamSkxWdgWfZGeE49eUOWJPA4c= github.com/ipsn/go-secp256k1 v0.0.0-20180726113642-9d62b9f0bc52/go.mod h1:fdg+/X9Gg4AsAIzWpEHwnqd+QY3b7lajxyjE1m4hkq4= @@ -883,7 +903,6 @@ github.com/jackpal/go-nat-pmp v1.0.1/go.mod h1:QPH045xvCAeXUZOxsnwmrtiCoxIr9eob+ github.com/jackpal/go-nat-pmp v1.0.2 h1:KzKSgb7qkJvOUTqYl9/Hg/me3pWgBmERKrTGD7BdWus= github.com/jackpal/go-nat-pmp v1.0.2/go.mod h1:QPH045xvCAeXUZOxsnwmrtiCoxIr9eob+4orBN1SBKc= github.com/jbenet/go-cienv v0.0.0-20150120210510-1bb1476777ec/go.mod h1:rGaEvXB4uRSZMmzKNLoXvTu1sfx+1kv/DojUlPrSZGs= -github.com/jbenet/go-cienv v0.1.0 h1:Vc/s0QbQtoxX8MwwSLWWh+xNNZvM3Lw7NsTcHrvvhMc= github.com/jbenet/go-cienv v0.1.0/go.mod h1:TqNnHUmJgXau0nCzC7kXWeotg3J9W34CUv5Djy1+FlA= github.com/jbenet/go-random v0.0.0-20190219211222-123a90aedc0c h1:uUx61FiAa1GI6ZmVd2wf2vULeQZIKG66eybjNXKYCz4= github.com/jbenet/go-random v0.0.0-20190219211222-123a90aedc0c/go.mod h1:sdx1xVM9UuLw1tXnhJWN3piypTUO3vCIHYmG15KE/dU= @@ -958,19 +977,24 @@ github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+o github.com/kkdai/bstream v0.0.0-20161212061736-f391b8402d23/go.mod h1:J+Gs4SYgM6CZQHDETBtE9HaSEkGmuNXF86RwHhHUvq4= github.com/klauspost/compress v1.10.7/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.11.0/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= -github.com/klauspost/cpuid/v2 v2.0.4 h1:g0I61F2K2DjRHz1cnxlkNSBIaePVoJIjjnHui8QHbiw= +github.com/klauspost/compress v1.11.7 h1:0hzRabrMN4tSTvMfnL3SCv1ZGeAP23ynzodBgaHeMeg= +github.com/klauspost/compress v1.11.7/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/cpuid/v2 v2.0.4/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= +github.com/klauspost/cpuid/v2 v2.0.9 h1:lgaqFMSdTdQYdZ04uHyN2d/eKdOMyi2YLSvlQIBFYa4= +github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/koron/go-ssdp v0.0.0-20180514024734-4a0ed625a78b/go.mod h1:5Ky9EC2xfoUKUor0Hjgi2BJhCSXJfMOFlmyYrVKGQMk= -github.com/koron/go-ssdp v0.0.0-20191105050749-2e1c40ed0b5d h1:68u9r4wEvL3gYg2jvAOgROwZ3H+Y3hIDk4tbbmIjcYQ= github.com/koron/go-ssdp v0.0.0-20191105050749-2e1c40ed0b5d/go.mod h1:5Ky9EC2xfoUKUor0Hjgi2BJhCSXJfMOFlmyYrVKGQMk= +github.com/koron/go-ssdp v0.0.2 h1:fL3wAoyT6hXHQlORyXUW4Q23kkQpJRgEAYcZB5BR71o= +github.com/koron/go-ssdp v0.0.2/go.mod h1:XoLfkAiA2KeZsYh4DbHxD7h3nR2AZNqVQOa+LJuqPYs= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= -github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= +github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/pty v1.1.3/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= @@ -995,8 +1019,9 @@ github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/lib/pq v1.8.0/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/lib/pq v1.9.0/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/libp2p/go-addr-util v0.0.1/go.mod h1:4ac6O7n9rIAKB1dnd+s8IbbMXkt+oBpzX4/+RACcnlQ= -github.com/libp2p/go-addr-util v0.0.2 h1:7cWK5cdA5x72jX0g8iLrQWm5TRJZ6CzGdPEhWj7plWU= github.com/libp2p/go-addr-util v0.0.2/go.mod h1:Ecd6Fb3yIuLzq4bD7VcywcVSBtefcAwnUISBM3WG15E= +github.com/libp2p/go-addr-util v0.1.0 h1:acKsntI33w2bTU7tC9a0SaPimJGfSI0bFKC18ChxeVI= +github.com/libp2p/go-addr-util v0.1.0/go.mod h1:6I3ZYuFr2O/9D+SoyM0zEw0EF3YkldtTX406BpdQMqw= github.com/libp2p/go-buffer-pool v0.0.1/go.mod h1:xtyIz9PMobb13WaxR6Zo1Pd1zXJKYg0a8KiIvDp3TzQ= github.com/libp2p/go-buffer-pool v0.0.2 h1:QNK2iAFa8gjAe1SPz6mHSMuCcjs+X1wlHzeOSqcmlfs= github.com/libp2p/go-buffer-pool v0.0.2/go.mod h1:MvaB6xw5vOrDl8rYZGLFdKAuk/hRoRZd1Vi32+RXyFM= @@ -1006,8 +1031,9 @@ github.com/libp2p/go-conn-security v0.0.1/go.mod h1:bGmu51N0KU9IEjX7kl2PQjgZa40J github.com/libp2p/go-conn-security-multistream v0.0.2/go.mod h1:nc9vud7inQ+d6SO0I/6dSWrdMnHnzZNHeyUQqrAJulE= github.com/libp2p/go-conn-security-multistream v0.1.0/go.mod h1:aw6eD7LOsHEX7+2hJkDxw1MteijaVcI+/eP2/x3J1xc= github.com/libp2p/go-conn-security-multistream v0.2.0/go.mod h1:hZN4MjlNetKD3Rq5Jb/P5ohUnFLNzEAR4DLSzpn2QLU= -github.com/libp2p/go-conn-security-multistream v0.2.1 h1:ft6/POSK7F+vl/2qzegnHDaXFU0iWB4yVTYrioC6Zy0= github.com/libp2p/go-conn-security-multistream v0.2.1/go.mod h1:cR1d8gA0Hr59Fj6NhaTpFhJZrjSYuNmhpT2r25zYR70= +github.com/libp2p/go-conn-security-multistream v0.3.0 h1:9UCIKlBL1hC9u7nkMXpD1nkc/T53PKMAn3/k9ivBAVc= +github.com/libp2p/go-conn-security-multistream v0.3.0/go.mod h1:EEP47t4fw/bTelVmEzIDqSe69hO/ip52xBEhZMLWAHM= github.com/libp2p/go-eventbus v0.1.0/go.mod h1:vROgu5cs5T7cv7POWlWxBaVLxfSegC5UGQf8A2eEmx4= github.com/libp2p/go-eventbus v0.2.1 h1:VanAdErQnpTioN2TowqNcOijf6YwhuODe4pPKSDpxGc= github.com/libp2p/go-eventbus v0.2.1/go.mod h1:jc2S4SoEVPP48H9Wpzm5aiGwUCBMfGhVhhBjyhhCJs8= @@ -1024,12 +1050,14 @@ github.com/libp2p/go-libp2p v0.7.4/go.mod h1:oXsBlTLF1q7pxr+9w6lqzS1ILpyHsaBPniV github.com/libp2p/go-libp2p v0.8.1/go.mod h1:QRNH9pwdbEBpx5DTJYg+qxcVaDMAz3Ee/qDKwXujH5o= github.com/libp2p/go-libp2p v0.8.3/go.mod h1:EsH1A+8yoWK+L4iKcbPYu6MPluZ+CHWI9El8cTaefiM= github.com/libp2p/go-libp2p v0.9.2/go.mod h1:cunHNLDVus66Ct9iXXcjKRLdmHdFdHVe1TAnbubJQqQ= -github.com/libp2p/go-libp2p v0.12.0/go.mod h1:FpHZrfC1q7nA8jitvdjKBDF31hguaC676g/nT9PgQM0= -github.com/libp2p/go-libp2p v0.13.0/go.mod h1:pM0beYdACRfHO1WcJlp65WXyG2A6NqYM+t2DTVAJxMo= -github.com/libp2p/go-libp2p v0.14.2 h1:qs0ABtjjNjS+RIXT1uM7sMJEvIc0pq2nKR0VQxFXhHI= -github.com/libp2p/go-libp2p v0.14.2/go.mod h1:0PQMADQEjCM2l8cSMYDpTgsb8gr6Zq7i4LUgq1mlW2E= -github.com/libp2p/go-libp2p-asn-util v0.0.0-20200825225859-85005c6cf052 h1:BM7aaOF7RpmNn9+9g6uTjGJ0cTzWr5j9i9IKeun2M8U= +github.com/libp2p/go-libp2p v0.14.3/go.mod h1:d12V4PdKbpL0T1/gsUNN8DfgMuRPDX8bS2QxCZlwRH0= +github.com/libp2p/go-libp2p v0.14.4/go.mod h1:EIRU0Of4J5S8rkockZM7eJp2S0UrCyi55m2kJVru3rM= +github.com/libp2p/go-libp2p v0.16.0/go.mod h1:ump42BsirwAWxKzsCiFnTtN1Yc+DuPu76fyMX364/O4= +github.com/libp2p/go-libp2p v0.17.0 h1:8l4GV401OSd4dFRyHDtIT/mEzdh/aQGoFC8xshYgm5M= +github.com/libp2p/go-libp2p v0.17.0/go.mod h1:Fkin50rsGdv5mm5BshBUtPRZknt9esfmYXBOYcwOTgw= github.com/libp2p/go-libp2p-asn-util v0.0.0-20200825225859-85005c6cf052/go.mod h1:nRMRTab+kZuk0LnKZpxhOVH/ndsdr2Nr//Zltc/vwgo= +github.com/libp2p/go-libp2p-asn-util v0.1.0 h1:rABPCO77SjdbJ/eJ/ynIo8vWICy1VEnL5JAxJbQLo1E= +github.com/libp2p/go-libp2p-asn-util v0.1.0/go.mod h1:wu+AnM9Ii2KgO5jMmS1rz9dvzTdj8BXqsPR9HR0XB7I= github.com/libp2p/go-libp2p-autonat v0.0.6/go.mod h1:uZneLdOkZHro35xIhpbtTzLlgYturpu4J5+0cZK3MqE= github.com/libp2p/go-libp2p-autonat v0.1.0/go.mod h1:1tLf2yXxiE/oKGtDwPYWTSYG3PtvYlJmg7NeVtPRqH8= github.com/libp2p/go-libp2p-autonat v0.1.1/go.mod h1:OXqkeGOY2xJVWKAGV2inNF5aKN/djNA3fdpCWloIudE= @@ -1037,15 +1065,17 @@ github.com/libp2p/go-libp2p-autonat v0.2.0/go.mod h1:DX+9teU4pEEoZUqR1PiMlqliONQ github.com/libp2p/go-libp2p-autonat v0.2.1/go.mod h1:MWtAhV5Ko1l6QBsHQNSuM6b1sRkXrpk0/LqCr+vCVxI= github.com/libp2p/go-libp2p-autonat v0.2.2/go.mod h1:HsM62HkqZmHR2k1xgX34WuWDzk/nBwNHoeyyT4IWV6A= github.com/libp2p/go-libp2p-autonat v0.2.3/go.mod h1:2U6bNWCNsAG9LEbwccBDQbjzQ8Krdjge1jLTE9rdoMM= -github.com/libp2p/go-libp2p-autonat v0.4.0/go.mod h1:YxaJlpr81FhdOv3W3BTconZPfhaYivRdf53g+S2wobk= -github.com/libp2p/go-libp2p-autonat v0.4.2 h1:YMp7StMi2dof+baaxkbxaizXjY1RPvU71CXfxExzcUU= github.com/libp2p/go-libp2p-autonat v0.4.2/go.mod h1:YxaJlpr81FhdOv3W3BTconZPfhaYivRdf53g+S2wobk= +github.com/libp2p/go-libp2p-autonat v0.6.0/go.mod h1:bFC6kY8jwzNNWoqc8iGE57vsfwyJ/lP4O4DOV1e0B2o= +github.com/libp2p/go-libp2p-autonat v0.7.0 h1:rCP5s+A2dlhM1Xd66wurE0k7S7pPmM0D+FlqqSBXxks= +github.com/libp2p/go-libp2p-autonat v0.7.0/go.mod h1:uPvPn6J7cN+LCfFwW5tpOYvAz5NvPTc4iBamTV/WDMg= github.com/libp2p/go-libp2p-blankhost v0.0.1/go.mod h1:Ibpbw/7cPPYwFb7PACIWdvxxv0t0XCCI10t7czjAjTc= github.com/libp2p/go-libp2p-blankhost v0.1.1/go.mod h1:pf2fvdLJPsC1FsVrNP3DUUvMzUts2dsLLBEpo1vW1ro= github.com/libp2p/go-libp2p-blankhost v0.1.4/go.mod h1:oJF0saYsAXQCSfDq254GMNmLNz6ZTHTOvtF4ZydUvwU= github.com/libp2p/go-libp2p-blankhost v0.1.6/go.mod h1:jONCAJqEP+Z8T6EQviGL4JsQcLx1LgTGtVqFNY8EMfQ= -github.com/libp2p/go-libp2p-blankhost v0.2.0 h1:3EsGAi0CBGcZ33GwRuXEYJLLPoVWyXJ1bcJzAJjINkk= github.com/libp2p/go-libp2p-blankhost v0.2.0/go.mod h1:eduNKXGTioTuQAUcZ5epXi9vMl+t4d8ugUBRQ4SqaNQ= +github.com/libp2p/go-libp2p-blankhost v0.3.0 h1:kTnLArltMabZlzY63pgGDA4kkUcLkBFSM98zBssn/IY= +github.com/libp2p/go-libp2p-blankhost v0.3.0/go.mod h1:urPC+7U01nCGgJ3ZsV8jdwTp6Ji9ID0dMTvq+aJ+nZU= github.com/libp2p/go-libp2p-circuit v0.0.9/go.mod h1:uU+IBvEQzCu953/ps7bYzC/D/R0Ho2A9LfKVVCatlqU= github.com/libp2p/go-libp2p-circuit v0.1.0/go.mod h1:Ahq4cY3V9VJcHcn1SBXjr78AbFkZeIRmfunbA7pmFh8= github.com/libp2p/go-libp2p-circuit v0.1.4/go.mod h1:CY67BrEjKNDhdTk8UgBX1Y/H5c3xkAcs3gnksxY7osU= @@ -1081,8 +1111,14 @@ github.com/libp2p/go-libp2p-core v0.7.0/go.mod h1:FfewUH/YpvWbEB+ZY9AQRQ4TAD8sJB github.com/libp2p/go-libp2p-core v0.8.0/go.mod h1:FfewUH/YpvWbEB+ZY9AQRQ4TAD8sJBt/G1rVvhz5XT8= github.com/libp2p/go-libp2p-core v0.8.1/go.mod h1:FfewUH/YpvWbEB+ZY9AQRQ4TAD8sJBt/G1rVvhz5XT8= github.com/libp2p/go-libp2p-core v0.8.2/go.mod h1:FfewUH/YpvWbEB+ZY9AQRQ4TAD8sJBt/G1rVvhz5XT8= -github.com/libp2p/go-libp2p-core v0.8.5 h1:aEgbIcPGsKy6zYcC+5AJivYFedhYa4sW7mIpWpUaLKw= github.com/libp2p/go-libp2p-core v0.8.5/go.mod h1:FfewUH/YpvWbEB+ZY9AQRQ4TAD8sJBt/G1rVvhz5XT8= +github.com/libp2p/go-libp2p-core v0.8.6/go.mod h1:dgHr0l0hIKfWpGpqAMbpo19pen9wJfdCGv51mTmdpmM= +github.com/libp2p/go-libp2p-core v0.9.0/go.mod h1:ESsbz31oC3C1AvMJoGx26RTuCkNhmkSRCqZ0kQtJ2/8= +github.com/libp2p/go-libp2p-core v0.10.0/go.mod h1:ECdxehoYosLYHgDDFa2N4yE8Y7aQRAMf0sX9mf2sbGg= +github.com/libp2p/go-libp2p-core v0.11.0/go.mod h1:ECdxehoYosLYHgDDFa2N4yE8Y7aQRAMf0sX9mf2sbGg= +github.com/libp2p/go-libp2p-core v0.12.0/go.mod h1:ECdxehoYosLYHgDDFa2N4yE8Y7aQRAMf0sX9mf2sbGg= +github.com/libp2p/go-libp2p-core v0.13.0 h1:IFG/s8dN6JN2OTrXX9eq2wNU/Zlz2KLdwZUp5FplgXI= +github.com/libp2p/go-libp2p-core v0.13.0/go.mod h1:ECdxehoYosLYHgDDFa2N4yE8Y7aQRAMf0sX9mf2sbGg= github.com/libp2p/go-libp2p-crypto v0.0.1/go.mod h1:yJkNyDmO341d5wwXxDUGO0LykUVT72ImHNUqh5D/dBE= github.com/libp2p/go-libp2p-crypto v0.0.2/go.mod h1:eETI5OUfBnvARGOHrJz2eWNyTUxEGZnBxMcbUjfIj4I= github.com/libp2p/go-libp2p-crypto v0.1.0/go.mod h1:sPUokVISZiy+nNuTTH/TY+leRSxnFj/2GLjtOTW90hI= @@ -1091,16 +1127,18 @@ github.com/libp2p/go-libp2p-discovery v0.1.0/go.mod h1:4F/x+aldVHjHDHuX85x1zWoFT github.com/libp2p/go-libp2p-discovery v0.2.0/go.mod h1:s4VGaxYMbw4+4+tsoQTqh7wfxg97AEdo4GYBt6BadWg= github.com/libp2p/go-libp2p-discovery v0.3.0/go.mod h1:o03drFnz9BVAZdzC/QUQ+NeQOu38Fu7LJGEOK2gQltw= github.com/libp2p/go-libp2p-discovery v0.4.0/go.mod h1:bZ0aJSrFc/eX2llP0ryhb1kpgkPyTo23SJ5b7UQCMh4= -github.com/libp2p/go-libp2p-discovery v0.5.0 h1:Qfl+e5+lfDgwdrXdu4YNCWyEo3fWuP+WgN9mN0iWviQ= github.com/libp2p/go-libp2p-discovery v0.5.0/go.mod h1:+srtPIU9gDaBNu//UHvcdliKBIcr4SfDcm0/PfPJLug= +github.com/libp2p/go-libp2p-discovery v0.6.0 h1:1XdPmhMJr8Tmj/yUfkJMIi8mgwWrLUsCB3bMxdT+DSo= +github.com/libp2p/go-libp2p-discovery v0.6.0/go.mod h1:/u1voHt0tKIe5oIA1RHBKQLVCWPna2dXmPNHc2zR9S8= github.com/libp2p/go-libp2p-host v0.0.1/go.mod h1:qWd+H1yuU0m5CwzAkvbSjqKairayEHdR5MMl7Cwa7Go= github.com/libp2p/go-libp2p-host v0.0.3/go.mod h1:Y/qPyA6C8j2coYyos1dfRm0I8+nvd4TGrDGt4tA7JR8= github.com/libp2p/go-libp2p-interface-connmgr v0.0.1/go.mod h1:GarlRLH0LdeWcLnYM/SaBykKFl9U5JFnbBGruAk/D5k= github.com/libp2p/go-libp2p-interface-connmgr v0.0.4/go.mod h1:GarlRLH0LdeWcLnYM/SaBykKFl9U5JFnbBGruAk/D5k= github.com/libp2p/go-libp2p-interface-connmgr v0.0.5/go.mod h1:GarlRLH0LdeWcLnYM/SaBykKFl9U5JFnbBGruAk/D5k= github.com/libp2p/go-libp2p-interface-pnet v0.0.1/go.mod h1:el9jHpQAXK5dnTpKA4yfCNBZXvrzdOU75zz+C6ryp3k= -github.com/libp2p/go-libp2p-kad-dht v0.11.0 h1:ZLhlmDKsFiOkPhTzfEqBrMy/1Tqx+Dk6UgbHM5//IQM= -github.com/libp2p/go-libp2p-kad-dht v0.11.0/go.mod h1:5ojtR2acDPqh/jXf5orWy8YGb8bHQDS+qeDcoscL/PI= +github.com/libp2p/go-libp2p-kad-dht v0.15.0 h1:Ke+Oj78gX5UDXnA6HBdrgvi+fStJxgYTDa51U0TsCLo= +github.com/libp2p/go-libp2p-kad-dht v0.15.0/go.mod h1:rZtPxYu1TnHHz6n1RggdGrxUX/tA1C2/Wiw3ZMUDrU0= +github.com/libp2p/go-libp2p-kbucket v0.3.1/go.mod h1:oyjT5O7tS9CQurok++ERgc46YLwEpuGoFq9ubvoUOio= github.com/libp2p/go-libp2p-kbucket v0.4.7 h1:spZAcgxifvFZHBD8tErvppbnNiKA5uokDu3CV7axu70= github.com/libp2p/go-libp2p-kbucket v0.4.7/go.mod h1:XyVo99AfQH0foSf176k4jY1xUJ2+jUJIZCSDm7r2YKk= github.com/libp2p/go-libp2p-loggables v0.0.1/go.mod h1:lDipDlBNYbpyqyPX/KcoO+eq0sJYEVR2JgOexcivchg= @@ -1112,22 +1150,23 @@ github.com/libp2p/go-libp2p-mplex v0.2.0/go.mod h1:Ejl9IyjvXJ0T9iqUTE1jpYATQ9NM3 github.com/libp2p/go-libp2p-mplex v0.2.1/go.mod h1:SC99Rxs8Vuzrf/6WhmH41kNn13TiYdAWNYHrwImKLnE= github.com/libp2p/go-libp2p-mplex v0.2.2/go.mod h1:74S9eum0tVQdAfFiKxAyKzNdSuLqw5oadDq7+L/FELo= github.com/libp2p/go-libp2p-mplex v0.2.3/go.mod h1:CK3p2+9qH9x+7ER/gWWDYJ3QW5ZxWDkm+dVvjfuG3ek= -github.com/libp2p/go-libp2p-mplex v0.3.0/go.mod h1:l9QWxRbbb5/hQMECEb908GbS9Sm2UAR2KFZKUJEynEs= github.com/libp2p/go-libp2p-mplex v0.4.0/go.mod h1:yCyWJE2sc6TBTnFpjvLuEJgTSw/u+MamvzILKdX7asw= github.com/libp2p/go-libp2p-mplex v0.4.1 h1:/pyhkP1nLwjG3OM+VuaNJkQT/Pqq73WzB3aDN3Fx1sc= github.com/libp2p/go-libp2p-mplex v0.4.1/go.mod h1:cmy+3GfqfM1PceHTLL7zQzAAYaryDu6iPSC+CIb094g= github.com/libp2p/go-libp2p-nat v0.0.4/go.mod h1:N9Js/zVtAXqaeT99cXgTV9e75KpnWCvVOiGzlcHmBbY= github.com/libp2p/go-libp2p-nat v0.0.5/go.mod h1:1qubaE5bTZMJE+E/uu2URroMbzdubFz1ChgiN79yKPE= -github.com/libp2p/go-libp2p-nat v0.0.6 h1:wMWis3kYynCbHoyKLPBEMu4YRLltbm8Mk08HGSfvTkU= github.com/libp2p/go-libp2p-nat v0.0.6/go.mod h1:iV59LVhB3IkFvS6S6sauVTSOrNEANnINbI/fkaLimiw= +github.com/libp2p/go-libp2p-nat v0.1.0 h1:vigUi2MEN+fwghe5ijpScxtbbDz+L/6y8XwlzYOJgSY= +github.com/libp2p/go-libp2p-nat v0.1.0/go.mod h1:DQzAG+QbDYjN1/C3B6vXucLtz3u9rEonLVPtZVzQqks= github.com/libp2p/go-libp2p-net v0.0.1/go.mod h1:Yt3zgmlsHOgUWSXmt5V/Jpz9upuJBE8EgNU9DrCcR8c= github.com/libp2p/go-libp2p-net v0.0.2/go.mod h1:Yt3zgmlsHOgUWSXmt5V/Jpz9upuJBE8EgNU9DrCcR8c= github.com/libp2p/go-libp2p-netutil v0.0.1/go.mod h1:GdusFvujWZI9Vt0X5BKqwWWmZFxecf9Gt03cKxm2f/Q= github.com/libp2p/go-libp2p-netutil v0.1.0 h1:zscYDNVEcGxyUpMd0JReUZTrpMfia8PmLKcKF72EAMQ= github.com/libp2p/go-libp2p-netutil v0.1.0/go.mod h1:3Qv/aDqtMLTUyQeundkKsA+YCThNdbQD54k3TqjpbFU= github.com/libp2p/go-libp2p-noise v0.1.1/go.mod h1:QDFLdKX7nluB7DEnlVPbz7xlLHdwHFA9HiohJRr3vwM= -github.com/libp2p/go-libp2p-noise v0.2.0 h1:wmk5nhB9a2w2RxMOyvsoKjizgJOEaJdfAakr0jN8gds= github.com/libp2p/go-libp2p-noise v0.2.0/go.mod h1:IEbYhBBzGyvdLBoxxULL/SGbJARhUeqlO8lVSREYu2Q= +github.com/libp2p/go-libp2p-noise v0.3.0 h1:NCVH7evhVt9njbTQshzT7N1S3Q6fjj9M11FCgfH5+cA= +github.com/libp2p/go-libp2p-noise v0.3.0/go.mod h1:JNjHbociDJKHD64KTkzGnzqJ0FEV5gHJa6AB00kbCNQ= github.com/libp2p/go-libp2p-peer v0.0.1/go.mod h1:nXQvOBbwVqoP+T5Y5nCjeH4sP9IX/J0AMzcDUVruVoo= github.com/libp2p/go-libp2p-peer v0.1.1/go.mod h1:jkF12jGB4Gk/IOo+yomm+7oLWxF278F7UnrYUQ1Q8es= github.com/libp2p/go-libp2p-peer v0.2.0/go.mod h1:RCffaCvUyW2CJmG2gAWVqwePwW7JMgxjsHm7+J5kjWY= @@ -1142,17 +1181,24 @@ github.com/libp2p/go-libp2p-peerstore v0.2.2/go.mod h1:NQxhNjWxf1d4w6PihR8btWIRj github.com/libp2p/go-libp2p-peerstore v0.2.3/go.mod h1:K8ljLdFn590GMttg/luh4caB/3g0vKuY01psze0upRw= github.com/libp2p/go-libp2p-peerstore v0.2.4/go.mod h1:ss/TWTgHZTMpsU/oKVVPQCGuDHItOpf2W8RxAi50P2s= github.com/libp2p/go-libp2p-peerstore v0.2.6/go.mod h1:ss/TWTgHZTMpsU/oKVVPQCGuDHItOpf2W8RxAi50P2s= -github.com/libp2p/go-libp2p-peerstore v0.2.7 h1:83JoLxyR9OYTnNfB5vvFqvMUv/xDNa6NoPHnENhBsGw= github.com/libp2p/go-libp2p-peerstore v0.2.7/go.mod h1:ss/TWTgHZTMpsU/oKVVPQCGuDHItOpf2W8RxAi50P2s= +github.com/libp2p/go-libp2p-peerstore v0.2.8/go.mod h1:gGiPlXdz7mIHd2vfAsHzBNAMqSDkt2UBFwgcITgw1lA= +github.com/libp2p/go-libp2p-peerstore v0.4.0/go.mod h1:rDJUFyzEWPpXpEwywkcTYYzDHlwza8riYMaUzaN6hX0= +github.com/libp2p/go-libp2p-peerstore v0.6.0 h1:HJminhQSGISBIRb93N6WK3t6Fa8OOTnHd/VBjL4mY5A= +github.com/libp2p/go-libp2p-peerstore v0.6.0/go.mod h1:DGEmKdXrcYpK9Jha3sS7MhqYdInxJy84bIPtSu65bKc= github.com/libp2p/go-libp2p-pnet v0.2.0 h1:J6htxttBipJujEjz1y0a5+eYoiPcFHhSYHH6na5f0/k= github.com/libp2p/go-libp2p-pnet v0.2.0/go.mod h1:Qqvq6JH/oMZGwqs3N1Fqhv8NVhrdYcO0BW4wssv21LA= github.com/libp2p/go-libp2p-protocol v0.0.1/go.mod h1:Af9n4PiruirSDjHycM1QuiMi/1VZNHYcK8cLgFJLZ4s= github.com/libp2p/go-libp2p-protocol v0.1.0/go.mod h1:KQPHpAabB57XQxGrXCNvbL6UEXfQqUgC/1adR2Xtflk= 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.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-quic-transport v0.10.0 h1:koDCbWD9CCHwcHZL3/WEvP2A+e/o5/W5L3QS/2SPMA0= +github.com/libp2p/go-libp2p-pubsub v0.6.0 h1:98+RXuEWW17U6cAijK1yaTf6mw/B+n5yPA421z+dlo0= +github.com/libp2p/go-libp2p-pubsub v0.6.0/go.mod h1:nJv87QM2cU0w45KPR1rZicq+FmFIOD16zmT+ep1nOmg= github.com/libp2p/go-libp2p-quic-transport v0.10.0/go.mod h1:RfJbZ8IqXIhxBRm5hqUEJqjiiY8xmEuq3HUDS993MkA= +github.com/libp2p/go-libp2p-quic-transport v0.11.2/go.mod h1:wlanzKtIh6pHrq+0U3p3DY9PJfGqxMgPaGKaK5LifwQ= +github.com/libp2p/go-libp2p-quic-transport v0.13.0/go.mod h1:39/ZWJ1TW/jx1iFkKzzUg00W6tDJh73FC0xYudjr7Hc= +github.com/libp2p/go-libp2p-quic-transport v0.15.0/go.mod h1:wv4uGwjcqe8Mhjj7N/Ic0aKjA+/10UnMlSzLO0yRpYQ= +github.com/libp2p/go-libp2p-quic-transport v0.15.2 h1:wHBEceRy+1/8Ec8dAIyr+/P7L2YefIGprPVy5LrMM+k= +github.com/libp2p/go-libp2p-quic-transport v0.15.2/go.mod h1:wv4uGwjcqe8Mhjj7N/Ic0aKjA+/10UnMlSzLO0yRpYQ= github.com/libp2p/go-libp2p-record v0.0.1/go.mod h1:grzqg263Rug/sRex85QrDOLntdFAymLDLm7lxMgU79Q= github.com/libp2p/go-libp2p-record v0.1.0/go.mod h1:ujNc8iuE5dlKWVy6wuL6dd58t0n7xI4hAIl8pE6wu5Q= github.com/libp2p/go-libp2p-record v0.1.1/go.mod h1:VRgKajOyMVgP/F0L5g3kH7SVskp17vFi2xheb5uMJtg= @@ -1173,10 +1219,11 @@ github.com/libp2p/go-libp2p-swarm v0.2.3/go.mod h1:P2VO/EpxRyDxtChXz/VPVXyTnszHv github.com/libp2p/go-libp2p-swarm v0.2.4/go.mod h1:/xIpHFPPh3wmSthtxdGbkHZ0OET1h/GGZes8Wku/M5Y= github.com/libp2p/go-libp2p-swarm v0.2.8/go.mod h1:JQKMGSth4SMqonruY0a8yjlPVIkb0mdNSwckW7OYziM= github.com/libp2p/go-libp2p-swarm v0.3.0/go.mod h1:hdv95GWCTmzkgeJpP+GK/9D9puJegb7H57B5hWQR5Kk= -github.com/libp2p/go-libp2p-swarm v0.3.1/go.mod h1:hdv95GWCTmzkgeJpP+GK/9D9puJegb7H57B5hWQR5Kk= -github.com/libp2p/go-libp2p-swarm v0.4.0/go.mod h1:XVFcO52VoLoo0eitSxNQWYq4D6sydGOweTOAjJNraCw= -github.com/libp2p/go-libp2p-swarm v0.5.0 h1:HIK0z3Eqoo8ugmN8YqWAhD2RORgR+3iNXYG4U2PFd1E= github.com/libp2p/go-libp2p-swarm v0.5.0/go.mod h1:sU9i6BoHE0Ve5SKz3y9WfKrh8dUat6JknzUehFx8xW4= +github.com/libp2p/go-libp2p-swarm v0.5.3/go.mod h1:NBn7eNW2lu568L7Ns9wdFrOhgRlkRnIDg0FLKbuu3i8= +github.com/libp2p/go-libp2p-swarm v0.8.0/go.mod h1:sOMp6dPuqco0r0GHTzfVheVBh6UEL0L1lXUZ5ot2Fvc= +github.com/libp2p/go-libp2p-swarm v0.9.0 h1:LdWjHDVjPMYt3NCG2EHcQiIP8XzA8BHhHz8ZLAYol2Y= +github.com/libp2p/go-libp2p-swarm v0.9.0/go.mod h1:2f8d8uxTJmpeqHF/1ujjdXZp+98nNIbujVOMEZxCbZ8= github.com/libp2p/go-libp2p-testing v0.0.1/go.mod h1:gvchhf3FQOtBdr+eFUABet5a4MBLK8jM3V4Zghvmi+E= github.com/libp2p/go-libp2p-testing v0.0.2/go.mod h1:gvchhf3FQOtBdr+eFUABet5a4MBLK8jM3V4Zghvmi+E= github.com/libp2p/go-libp2p-testing v0.0.3/go.mod h1:gvchhf3FQOtBdr+eFUABet5a4MBLK8jM3V4Zghvmi+E= @@ -1185,19 +1232,28 @@ github.com/libp2p/go-libp2p-testing v0.1.0/go.mod h1:xaZWMJrPUM5GlDBxCeGUi7kI4eq github.com/libp2p/go-libp2p-testing v0.1.1/go.mod h1:xaZWMJrPUM5GlDBxCeGUi7kI4eqnjVyavGroI2nxEM0= github.com/libp2p/go-libp2p-testing v0.1.2-0.20200422005655-8775583591d8/go.mod h1:Qy8sAncLKpwXtS2dSnDOP8ktexIAHKu+J+pnZOFZLTc= github.com/libp2p/go-libp2p-testing v0.3.0/go.mod h1:efZkql4UZ7OVsEfaxNHZPzIehtsBXMrXnCfJIgDti5g= -github.com/libp2p/go-libp2p-testing v0.4.0 h1:PrwHRi0IGqOwVQWR3xzgigSlhlLfxgfXgkHxr77EghQ= github.com/libp2p/go-libp2p-testing v0.4.0/go.mod h1:Q+PFXYoiYFN5CAEG2w3gLPEzotlKsNSbKQ/lImlOWF0= -github.com/libp2p/go-libp2p-tls v0.1.3 h1:twKMhMu44jQO+HgQK9X8NHO5HkeJu2QbhLzLJpa8oNM= +github.com/libp2p/go-libp2p-testing v0.4.2/go.mod h1:Q+PFXYoiYFN5CAEG2w3gLPEzotlKsNSbKQ/lImlOWF0= +github.com/libp2p/go-libp2p-testing v0.5.0/go.mod h1:QBk8fqIL1XNcno/l3/hhaIEn4aLRijpYOR+zVjjlh+A= +github.com/libp2p/go-libp2p-testing v0.6.0 h1:tV/wz6mS1VoAYA/5DGTiyzw9TJ+eXMCMvzU5VPLJSgg= +github.com/libp2p/go-libp2p-testing v0.6.0/go.mod h1:QBk8fqIL1XNcno/l3/hhaIEn4aLRijpYOR+zVjjlh+A= github.com/libp2p/go-libp2p-tls v0.1.3/go.mod h1:wZfuewxOndz5RTnCAxFliGjvYSDA40sKitV4c50uI1M= +github.com/libp2p/go-libp2p-tls v0.3.0/go.mod h1:fwF5X6PWGxm6IDRwF3V8AVCCj/hOd5oFlg+wo2FxJDY= +github.com/libp2p/go-libp2p-tls v0.3.1 h1:lsE2zYte+rZCEOHF72J1Fg3XK3dGQyKvI6i5ehJfEp0= +github.com/libp2p/go-libp2p-tls v0.3.1/go.mod h1:fwF5X6PWGxm6IDRwF3V8AVCCj/hOd5oFlg+wo2FxJDY= github.com/libp2p/go-libp2p-transport v0.0.1/go.mod h1:UzbUs9X+PHOSw7S3ZmeOxfnwaQY5vGDzZmKPod3N3tk= github.com/libp2p/go-libp2p-transport v0.0.5/go.mod h1:StoY3sx6IqsP6XKoabsPnHCwqKXWUMWU7Rfcsubee/A= github.com/libp2p/go-libp2p-transport-upgrader v0.0.4/go.mod h1:RGq+tupk+oj7PzL2kn/m1w6YXxcIAYJYeI90h6BGgUc= github.com/libp2p/go-libp2p-transport-upgrader v0.1.1/go.mod h1:IEtA6or8JUbsV07qPW4r01GnTenLW4oi3lOPbUMGJJA= github.com/libp2p/go-libp2p-transport-upgrader v0.2.0/go.mod h1:mQcrHj4asu6ArfSoMuyojOdjx73Q47cYD7s5+gZOlns= github.com/libp2p/go-libp2p-transport-upgrader v0.3.0/go.mod h1:i+SKzbRnvXdVbU3D1dwydnTmKRPXiAR/fyvi1dXuL4o= -github.com/libp2p/go-libp2p-transport-upgrader v0.4.0/go.mod h1:J4ko0ObtZSmgn5BX5AmegP+dK3CSnU2lMCKsSq/EY0s= -github.com/libp2p/go-libp2p-transport-upgrader v0.4.2 h1:4JsnbfJzgZeRS9AWN7B9dPqn/LY/HoQTlO9gtdJTIYM= github.com/libp2p/go-libp2p-transport-upgrader v0.4.2/go.mod h1:NR8ne1VwfreD5VIWIU62Agt/J18ekORFU/j1i2y8zvk= +github.com/libp2p/go-libp2p-transport-upgrader v0.4.3/go.mod h1:bpkldbOWXMrXhpZbSV1mQxTrefOg2Fi+k1ClDSA4ppw= +github.com/libp2p/go-libp2p-transport-upgrader v0.4.6/go.mod h1:JE0WQuQdy+uLZ5zOaI3Nw9dWGYJIA7mywEtP2lMvnyk= +github.com/libp2p/go-libp2p-transport-upgrader v0.5.0/go.mod h1:Rc+XODlB3yce7dvFV4q/RmyJGsFcCZRkeZMu/Zdg0mo= +github.com/libp2p/go-libp2p-transport-upgrader v0.6.0 h1:GfMCU+2aGGEm1zW3UcOz6wYSn8tXQalFfVfcww99i5A= +github.com/libp2p/go-libp2p-transport-upgrader v0.6.0/go.mod h1:1e07y1ZSZdHo9HPbuU8IztM1Cj+DR5twgycb4pnRzRo= +github.com/libp2p/go-libp2p-xor v0.0.0-20210714161855-5c005aca55db/go.mod h1:LSTM5yRnjGZbWNTA/hRwq2gGFrvRIbQJscoIL/u6InY= github.com/libp2p/go-libp2p-yamux v0.1.2/go.mod h1:xUoV/RmYkg6BW/qGxA9XJyg+HzXFYkeXbnhjmnYzKp8= github.com/libp2p/go-libp2p-yamux v0.1.3/go.mod h1:VGSQVrqkh6y4nm0189qqxMtvyBft44MOYYPpYKXiVt4= github.com/libp2p/go-libp2p-yamux v0.2.0/go.mod h1:Db2gU+XfLpm6E4rG5uGCFX6uXA8MEXOxFcRoXUODaK8= @@ -1208,9 +1264,10 @@ github.com/libp2p/go-libp2p-yamux v0.2.7/go.mod h1:X28ENrBMU/nm4I3Nx4sZ4dgjZ6VhL github.com/libp2p/go-libp2p-yamux v0.2.8/go.mod h1:/t6tDqeuZf0INZMTgd0WxIRbtK2EzI2h7HbFm9eAKI4= github.com/libp2p/go-libp2p-yamux v0.4.0/go.mod h1:+DWDjtFMzoAwYLVkNZftoucn7PelNoy5nm3tZ3/Zw30= github.com/libp2p/go-libp2p-yamux v0.5.0/go.mod h1:AyR8k5EzyM2QN9Bbdg6X1SkVVuqLwTGf0L4DFq9g6po= -github.com/libp2p/go-libp2p-yamux v0.5.1/go.mod h1:dowuvDu8CRWmr0iqySMiSxK+W0iL5cMVO9S94Y6gkv4= -github.com/libp2p/go-libp2p-yamux v0.5.4 h1:/UOPtT/6DHPtr3TtKXBHa6g0Le0szYuI33Xc/Xpd7fQ= github.com/libp2p/go-libp2p-yamux v0.5.4/go.mod h1:tfrXbyaTqqSU654GTvK3ocnSZL3BuHoeTSqhcel1wsE= +github.com/libp2p/go-libp2p-yamux v0.6.0/go.mod h1:MRhd6mAYnFRnSISp4M8i0ClV/j+mWHo2mYLifWGw33k= +github.com/libp2p/go-libp2p-yamux v0.7.0 h1:bVXHbTj/XH4uBBsPrg26BlDABk5WYRlssY73P0SjhPc= +github.com/libp2p/go-libp2p-yamux v0.7.0/go.mod h1:fMyA0CsPfHkIuBU0wjRGrCjTBFiXTXxG0k5M4ETv+08= github.com/libp2p/go-maddr-filter v0.0.1/go.mod h1:6eT12kSQMA9x2pvFQa+xesMKUBlj9VImZbj3B9FBH/Q= github.com/libp2p/go-maddr-filter v0.0.4/go.mod h1:6eT12kSQMA9x2pvFQa+xesMKUBlj9VImZbj3B9FBH/Q= github.com/libp2p/go-maddr-filter v0.0.5/go.mod h1:Jk+36PMfIqCJhAnaASRH83bdAvfDRp/w6ENFaC9bG+M= @@ -1227,14 +1284,17 @@ github.com/libp2p/go-mplex v0.3.0/go.mod h1:0Oy/A9PQlwBytDRp4wSkFnzHYDKcpLot35JQ github.com/libp2p/go-msgio v0.0.2/go.mod h1:63lBBgOTDKQL6EWazRMCwXsEeEeK9O2Cd+0+6OOuipQ= github.com/libp2p/go-msgio v0.0.3/go.mod h1:63lBBgOTDKQL6EWazRMCwXsEeEeK9O2Cd+0+6OOuipQ= github.com/libp2p/go-msgio v0.0.4/go.mod h1:63lBBgOTDKQL6EWazRMCwXsEeEeK9O2Cd+0+6OOuipQ= -github.com/libp2p/go-msgio v0.0.6 h1:lQ7Uc0kS1wb1EfRxO2Eir/RJoHkHn7t6o+EiwsYIKJA= github.com/libp2p/go-msgio v0.0.6/go.mod h1:4ecVB6d9f4BDSL5fqvPiC4A3KivjWn+Venn/1ALLMWA= +github.com/libp2p/go-msgio v0.1.0 h1:8Q7g/528ivAlfXTFWvWhVjTE8XG8sDTkRUKPYh9+5Q8= +github.com/libp2p/go-msgio v0.1.0/go.mod h1:eNlv2vy9V2X/kNldcZ+SShFE++o2Yjxwx6RAYsmgJnE= github.com/libp2p/go-nat v0.0.3/go.mod h1:88nUEt0k0JD45Bk93NIwDqjlhiOwOoV36GchpcVc1yI= github.com/libp2p/go-nat v0.0.4/go.mod h1:Nmw50VAvKuk38jUBcmNh6p9lUJLoODbJRvYAa/+KSDo= -github.com/libp2p/go-nat v0.0.5 h1:qxnwkco8RLKqVh1NmjQ+tJ8p8khNLFxuElYG/TwqW4Q= github.com/libp2p/go-nat v0.0.5/go.mod h1:B7NxsVNPZmRLvMOwiEO1scOSyjA56zxYAGv1yQgRkEU= +github.com/libp2p/go-nat v0.1.0 h1:MfVsH6DLcpa04Xr+p8hmVRG4juse0s3J8HyNWYHffXg= +github.com/libp2p/go-nat v0.1.0/go.mod h1:X7teVkwRHNInVNWQiO/tAiAVRwSr5zoRz4YSTC3uRBM= github.com/libp2p/go-netroute v0.1.2/go.mod h1:jZLDV+1PE8y5XxBySEBgbuVAXbhtuHSdmLPL2n9MKbk= github.com/libp2p/go-netroute v0.1.3/go.mod h1:jZLDV+1PE8y5XxBySEBgbuVAXbhtuHSdmLPL2n9MKbk= +github.com/libp2p/go-netroute v0.1.5/go.mod h1:V1SR3AaECRkEQCoFFzYwVYWvYIEtlxx89+O3qcpCl4A= github.com/libp2p/go-netroute v0.1.6 h1:ruPJStbYyXVYGQ81uzEDzuvbYRLKRrLvTYd33yomC38= github.com/libp2p/go-netroute v0.1.6/go.mod h1:AqhkMh0VuWmfgtxKPp3Oc1LdU5QSWS7wl0QLhSZqXxQ= github.com/libp2p/go-openssl v0.0.2/go.mod h1:v8Zw2ijCSWBQi8Pq5GAixw6DbFfa9u6VIYDXnvOXkc0= @@ -1244,12 +1304,15 @@ github.com/libp2p/go-openssl v0.0.5/go.mod h1:unDrJpgy3oFr+rqXsarWifmJuNnJR4chtO github.com/libp2p/go-openssl v0.0.7 h1:eCAzdLejcNVBzP/iZM9vqHnQm+XyCEbSSIheIPRGNsw= github.com/libp2p/go-openssl v0.0.7/go.mod h1:unDrJpgy3oFr+rqXsarWifmJuNnJR4chtO1HmaZjggc= github.com/libp2p/go-reuseport v0.0.1/go.mod h1:jn6RmB1ufnQwl0Q1f+YxAj8isJgDCQzaaxIFYDhcYEA= -github.com/libp2p/go-reuseport v0.0.2 h1:XSG94b1FJfGA01BUrT82imejHQyTxO4jEWqheyCXYvU= github.com/libp2p/go-reuseport v0.0.2/go.mod h1:SPD+5RwGC7rcnzngoYC86GjPzjSywuQyMVAheVBD9nQ= +github.com/libp2p/go-reuseport v0.1.0 h1:0ooKOx2iwyIkf339WCZ2HN3ujTDbkK0PjC7JVoP1AiM= +github.com/libp2p/go-reuseport v0.1.0/go.mod h1:bQVn9hmfcTaoo0c9v5pBhOarsU1eNOBZdaAd2hzXRKU= github.com/libp2p/go-reuseport-transport v0.0.2/go.mod h1:YkbSDrvjUVDL6b8XqriyA20obEtsW9BLkuOUyQAOCbs= github.com/libp2p/go-reuseport-transport v0.0.3/go.mod h1:Spv+MPft1exxARzP2Sruj2Wb5JSyHNncjf1Oi2dEbzM= -github.com/libp2p/go-reuseport-transport v0.0.4 h1:OZGz0RB620QDGpv300n1zaOcKGGAoGVf8h9txtt/1uM= github.com/libp2p/go-reuseport-transport v0.0.4/go.mod h1:trPa7r/7TJK/d+0hdBLOCGvpQQVOU74OXbNCIMkufGw= +github.com/libp2p/go-reuseport-transport v0.0.5/go.mod h1:TC62hhPc8qs5c/RoXDZG6YmjK+/YWUPC0yYmeUecbjc= +github.com/libp2p/go-reuseport-transport v0.1.0 h1:C3PHeHjmnz8m6f0uydObj02tMEoi7CyD1zuN7xQT8gc= +github.com/libp2p/go-reuseport-transport v0.1.0/go.mod h1:vev0C0uMkzriDY59yFHD9v+ujJvYmDQVLowvAjEOmfw= github.com/libp2p/go-sockaddr v0.0.2/go.mod h1:syPvOmNs24S3dFVGJA1/mrqdeijPxLV2Le3BRLKd68k= github.com/libp2p/go-sockaddr v0.1.0/go.mod h1:syPvOmNs24S3dFVGJA1/mrqdeijPxLV2Le3BRLKd68k= github.com/libp2p/go-sockaddr v0.1.1 h1:yD80l2ZOdGksnOyHrhxDdTDFrf7Oy+v3FMVArIRgZxQ= @@ -1264,8 +1327,11 @@ github.com/libp2p/go-tcp-transport v0.0.4/go.mod h1:+E8HvC8ezEVOxIo3V5vCK9l1y/19 github.com/libp2p/go-tcp-transport v0.1.0/go.mod h1:oJ8I5VXryj493DEJ7OsBieu8fcg2nHGctwtInJVpipc= github.com/libp2p/go-tcp-transport v0.1.1/go.mod h1:3HzGvLbx6etZjnFlERyakbaYPdfjg2pWP97dFZworkY= github.com/libp2p/go-tcp-transport v0.2.0/go.mod h1:vX2U0CnWimU4h0SGSEsg++AzvBcroCGYw28kh94oLe0= -github.com/libp2p/go-tcp-transport v0.2.1 h1:ExZiVQV+h+qL16fzCWtd1HSzPsqWottJ8KXwWaVi8Ns= -github.com/libp2p/go-tcp-transport v0.2.1/go.mod h1:zskiJ70MEfWz2MKxvFB/Pv+tPIB1PpPUrHIWQ8aFw7M= +github.com/libp2p/go-tcp-transport v0.2.3/go.mod h1:9dvr03yqrPyYGIEN6Dy5UvdJZjyPFvl1S/igQ5QD1SU= +github.com/libp2p/go-tcp-transport v0.2.4/go.mod h1:9dvr03yqrPyYGIEN6Dy5UvdJZjyPFvl1S/igQ5QD1SU= +github.com/libp2p/go-tcp-transport v0.2.7/go.mod h1:lue9p1b3VmZj1MhhEGB/etmvF/nBQ0X9CW2DutBT3MM= +github.com/libp2p/go-tcp-transport v0.4.0 h1:VDyg4j6en3OuXf90gfDQh5Sy9KowO9udnd0OU8PP6zg= +github.com/libp2p/go-tcp-transport v0.4.0/go.mod h1:0y52Rwrn4076xdJYu/51/qJIdxz+EWDAOG2S45sV3VI= github.com/libp2p/go-testutil v0.0.1/go.mod h1:iAcJc/DKJQanJ5ws2V+u5ywdL2n12X1WbbEG+Jjy69I= github.com/libp2p/go-testutil v0.1.0/go.mod h1:81b2n5HypcVyrCg/MJx4Wgfp/VHojytjVe/gLzZ2Ehc= github.com/libp2p/go-ws-transport v0.0.5/go.mod h1:Qbl4BxPfXXhhd/o0wcrgoaItHqA9tnZjoFZnxykuaXU= @@ -1273,8 +1339,9 @@ github.com/libp2p/go-ws-transport v0.1.0/go.mod h1:rjw1MG1LU9YDC6gzmwObkPd/Sqwhw github.com/libp2p/go-ws-transport v0.2.0/go.mod h1:9BHJz/4Q5A9ludYWKoGCFC5gUElzlHoKzu0yY9p/klM= github.com/libp2p/go-ws-transport v0.3.0/go.mod h1:bpgTJmRZAvVHrgHybCVyqoBmyLQ1fiZuEaBYusP5zsk= github.com/libp2p/go-ws-transport v0.3.1/go.mod h1:bpgTJmRZAvVHrgHybCVyqoBmyLQ1fiZuEaBYusP5zsk= -github.com/libp2p/go-ws-transport v0.4.0 h1:9tvtQ9xbws6cA5LvqdE6Ne3vcmGB4f1z9SByggk4s0k= github.com/libp2p/go-ws-transport v0.4.0/go.mod h1:EcIEKqf/7GDjth6ksuS/6p7R49V4CBY6/E7R/iyhYUA= +github.com/libp2p/go-ws-transport v0.5.0 h1:cO6x4P0v6PfxbKnxmf5cY2Ny4OPDGYkUqNvZzp/zdlo= +github.com/libp2p/go-ws-transport v0.5.0/go.mod h1:I2juo1dNTbl8BKSBYo98XY85kU2xds1iamArLvl8kNg= github.com/libp2p/go-yamux v1.2.1/go.mod h1:FGTiPvoV/3DVdgWpX+tM0OW3tsM+W5bSE3gZwqQTcow= github.com/libp2p/go-yamux v1.2.2/go.mod h1:FGTiPvoV/3DVdgWpX+tM0OW3tsM+W5bSE3gZwqQTcow= github.com/libp2p/go-yamux v1.2.3/go.mod h1:FGTiPvoV/3DVdgWpX+tM0OW3tsM+W5bSE3gZwqQTcow= @@ -1286,14 +1353,18 @@ github.com/libp2p/go-yamux v1.3.7/go.mod h1:fr7aVgmdNGJK+N1g+b6DW6VxzbRCjCOejR/h github.com/libp2p/go-yamux v1.4.0/go.mod h1:fr7aVgmdNGJK+N1g+b6DW6VxzbRCjCOejR/hkmpooHE= github.com/libp2p/go-yamux v1.4.1 h1:P1Fe9vF4th5JOxxgQvfbOHkrGqIZniTLf+ddhZp8YTI= github.com/libp2p/go-yamux v1.4.1/go.mod h1:fr7aVgmdNGJK+N1g+b6DW6VxzbRCjCOejR/hkmpooHE= -github.com/libp2p/go-yamux/v2 v2.0.0/go.mod h1:NVWira5+sVUIU6tu1JWvaRn1dRnG+cawOJiflsAM+7U= -github.com/libp2p/go-yamux/v2 v2.2.0 h1:RwtpYZ2/wVviZ5+3pjC8qdQ4TKnrak0/E01N1UWoAFU= github.com/libp2p/go-yamux/v2 v2.2.0/go.mod h1:3So6P6TV6r75R9jiBpiIKgU/66lOarCZjqROGxzPpPQ= +github.com/libp2p/go-yamux/v2 v2.3.0 h1:luRV68GS1vqqr6EFUjtu1kr51d+IbW0gSowu8emYWAI= +github.com/libp2p/go-yamux/v2 v2.3.0/go.mod h1:iTU+lOIn/2h0AgKcL49clNTwfEw+WSfDYrXe05EyKIs= +github.com/libp2p/zeroconf/v2 v2.1.1/go.mod h1:fuJqLnUwZTshS3U/bMRJ3+ow/v9oid1n0DmyYyNO1Xs= github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= github.com/logrusorgru/aurora v0.0.0-20181002194514-a7b3b318ed4e/go.mod h1:7rIyQOR62GCctdiQpZ/zOJlFyk6y+94wXzv6RNZgaR4= -github.com/lucas-clemente/quic-go v0.19.3 h1:eCDQqvGBB+kCTkA0XrAFtNe81FMa0/fn4QSoeAbmiF4= github.com/lucas-clemente/quic-go v0.19.3/go.mod h1:ADXpNbTQjq1hIzCpB+y/k5iz4n4z4IwqoLb94Kh5Hu8= +github.com/lucas-clemente/quic-go v0.21.2/go.mod h1:vF5M1XqhBAHgbjKcJOXY3JZz3GP0T3FQhz/uyOUS38Q= +github.com/lucas-clemente/quic-go v0.23.0/go.mod h1:paZuzjXCE5mj6sikVLMvqXk8lJV2AsqtJ6bDhjEfxx0= +github.com/lucas-clemente/quic-go v0.24.0 h1:ToR7SIIEdrgOhgVTHvPgdVRJfgVy+N0wQAagH7L4d5g= +github.com/lucas-clemente/quic-go v0.24.0/go.mod h1:paZuzjXCE5mj6sikVLMvqXk8lJV2AsqtJ6bDhjEfxx0= github.com/lufia/iostat v1.1.0/go.mod h1:rEPNA0xXgjHQjuI5Cy05sLlS2oRcSlWHRLrvh/AQ+Pg= github.com/lunixbochs/vtclean v1.0.0/go.mod h1:pHhQNgMf3btfWnGBVipUOjRYhoOsdGqdm/+2c2E2WMI= github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= @@ -1308,10 +1379,17 @@ github.com/mailru/easyjson v0.0.0-20190312143242-1de009706dbe/go.mod h1:C1wdFJiN github.com/maratori/testpackage v1.0.1 h1:QtJ5ZjqapShm0w5DosRjg0PRlSdAdlx+W6cCKoALdbQ= github.com/maratori/testpackage v1.0.1/go.mod h1:ddKdw+XG0Phzhx8BFDTKgpWP4i7MpApTE5fXSKAqwDU= github.com/marten-seemann/qpack v0.2.1/go.mod h1:F7Gl5L1jIgN1D11ucXefiuJS9UMVP2opoCp2jDKb7wc= -github.com/marten-seemann/qtls v0.10.0 h1:ECsuYUKalRL240rRD4Ri33ISb7kAQ3qGDlrrl55b2pc= github.com/marten-seemann/qtls v0.10.0/go.mod h1:UvMd1oaYDACI99/oZUYLzMCkBXQVT0aGm99sJhbT8hs= -github.com/marten-seemann/qtls-go1-15 v0.1.1 h1:LIH6K34bPVttyXnUWixk0bzH6/N07VxbSabxn5A5gZQ= github.com/marten-seemann/qtls-go1-15 v0.1.1/go.mod h1:GyFwywLKkRt+6mfU99csTEY1joMZz5vmB1WNZH3P81I= +github.com/marten-seemann/qtls-go1-15 v0.1.4/go.mod h1:GyFwywLKkRt+6mfU99csTEY1joMZz5vmB1WNZH3P81I= +github.com/marten-seemann/qtls-go1-15 v0.1.5/go.mod h1:GyFwywLKkRt+6mfU99csTEY1joMZz5vmB1WNZH3P81I= +github.com/marten-seemann/qtls-go1-16 v0.1.4 h1:xbHbOGGhrenVtII6Co8akhLEdrawwB2iHl5yhJRpnco= +github.com/marten-seemann/qtls-go1-16 v0.1.4/go.mod h1:gNpI2Ol+lRS3WwSOtIUUtRwZEQMXjYK+dQSBFbethAk= +github.com/marten-seemann/qtls-go1-17 v0.1.0-rc.1/go.mod h1:fz4HIxByo+LlWcreM4CZOYNuz3taBQ8rN2X6FqvaWo8= +github.com/marten-seemann/qtls-go1-17 v0.1.0 h1:P9ggrs5xtwiqXv/FHNwntmuLMNq3KaSIG93AtAZ48xk= +github.com/marten-seemann/qtls-go1-17 v0.1.0/go.mod h1:fz4HIxByo+LlWcreM4CZOYNuz3taBQ8rN2X6FqvaWo8= +github.com/marten-seemann/tcp v0.0.0-20210406111302-dfbc87cc63fd h1:br0buuQ854V8u83wA0rVZ8ttrq5CpaPZdvrK0LP2lOk= +github.com/marten-seemann/tcp v0.0.0-20210406111302-dfbc87cc63fd/go.mod h1:QuCEs1Nt24+FYQEqAAncTDPJIuGs+LxK1MCiFL25pMU= github.com/matoous/godox v0.0.0-20210227103229-6504466cf951 h1:pWxk9e//NbPwfxat7RXkts09K+dEBJWakUWwICVqYbA= github.com/matoous/godox v0.0.0-20210227103229-6504466cf951/go.mod h1:1BELzlh859Sh1c6+90blK8lbYy0kwQf1bYlBhBysy1s= github.com/matryer/moq v0.0.0-20190312154309-6cfb0558e1bd/go.mod h1:9ELz6aaclSIGnZBoaSLZ3NAl1VTufbOrXBPvtcy6WiQ= @@ -1330,8 +1408,9 @@ github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2y github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84= github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= -github.com/mattn/go-isatty v0.0.13 h1:qdl+GuBjcsKKDco5BsxPJlId98mSWNKqYA+Co0SC1yA= github.com/mattn/go-isatty v0.0.13/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= +github.com/mattn/go-isatty v0.0.14 h1:yVuAays6BHfxijgZPzw+3Zlu5yQgKGP2/hcQbHb7S9Y= +github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/mattn/go-runewidth v0.0.6/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= @@ -1360,12 +1439,18 @@ github.com/microcosm-cc/bluemonday v1.0.1/go.mod h1:hsXNsILzKxV+sX77C5b8FSuKF00v github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= github.com/miekg/dns v1.1.12/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= github.com/miekg/dns v1.1.28/go.mod h1:KNUDUusw/aVsxyTYZM1oqvCicbwhgbNgztCETuNZ7xM= -github.com/miekg/dns v1.1.31/go.mod h1:KNUDUusw/aVsxyTYZM1oqvCicbwhgbNgztCETuNZ7xM= github.com/miekg/dns v1.1.35/go.mod h1:KNUDUusw/aVsxyTYZM1oqvCicbwhgbNgztCETuNZ7xM= -github.com/miekg/dns v1.1.41 h1:WMszZWJG0XmzbK9FEmzH2TVcqYzFesusSIB41b8KHxY= github.com/miekg/dns v1.1.41/go.mod h1:p6aan82bvRIyn+zDIv9xYNUpwa73JcSh9BKwknJysuI= +github.com/miekg/dns v1.1.43 h1:JKfpVSCB84vrAmHzyrsxB5NAr5kLoMXZArPSw7Qlgyg= +github.com/miekg/dns v1.1.43/go.mod h1:+evo5L0630/F6ca/Z9+GAqzhjGyn8/c+TBaOyfEl0V4= github.com/miekg/pkcs11 v1.0.2/go.mod h1:XsNlhZGX73bx86s2hdc/FuaLm2CPZJemRLMA+WTFxgs= github.com/miekg/pkcs11 v1.0.3/go.mod h1:XsNlhZGX73bx86s2hdc/FuaLm2CPZJemRLMA+WTFxgs= +github.com/mikioh/tcp v0.0.0-20190314235350-803a9b46060c h1:bzE/A84HN25pxAuk9Eej1Kz9OUelF97nAc82bDquQI8= +github.com/mikioh/tcp v0.0.0-20190314235350-803a9b46060c/go.mod h1:0SQS9kMwD2VsyFEB++InYyBJroV/FRmBgcydeSUcJms= +github.com/mikioh/tcpinfo v0.0.0-20190314235526-30a79bb1804b h1:z78hV3sbSMAUoyUMM0I83AUIT6Hu17AWfgjzIbtrYFc= +github.com/mikioh/tcpinfo v0.0.0-20190314235526-30a79bb1804b/go.mod h1:lxPUiZwKoFL8DUUmalo2yJJUCxbPKtm8OKfqr2/FTNU= +github.com/mikioh/tcpopt v0.0.0-20190314235656-172688c1accc h1:PTfri+PuQmWDqERdnNMiD9ZejrlswWrCpBEZgWOiTrc= +github.com/mikioh/tcpopt v0.0.0-20190314235656-172688c1accc/go.mod h1:cGKTAVKx4SxOuR/czcZ/E2RSJ3sfHs8FpHhQ5CWMf9s= github.com/minio/blake2b-simd v0.0.0-20160723061019-3f5f724cb5b1 h1:lYpkrQH5ajf0OXOcUbGjvZxxijuBwbbmlSxLiuofa+g= github.com/minio/blake2b-simd v0.0.0-20160723061019-3f5f724cb5b1/go.mod h1:pD8RvIylQ358TN4wwqatJ8rNavkEINozVn9DtGI3dfQ= github.com/minio/sha256-simd v0.0.0-20190131020904-2d45a736cd16/go.mod h1:2FMWW+8GMoPweT6+pI63m9YE3Lmw4J71hV56Chs1E/U= @@ -1424,8 +1509,9 @@ github.com/multiformats/go-multiaddr v0.2.1/go.mod h1:s/Apk6IyxfvMjDafnhJgJ3/46z github.com/multiformats/go-multiaddr v0.2.2/go.mod h1:NtfXiOtHvghW9KojvtySjH5y0u0xW5UouOmQQrn6a3Y= github.com/multiformats/go-multiaddr v0.3.0/go.mod h1:dF9kph9wfJ+3VLAaeBqo9Of8x4fJxp6ggJGteB8HQTI= github.com/multiformats/go-multiaddr v0.3.1/go.mod h1:uPbspcUPd5AfaP6ql3ujFY+QWzmBD8uLLL4bXW0XfGc= -github.com/multiformats/go-multiaddr v0.3.3 h1:vo2OTSAqnENB2rLk79pLtr+uhj+VAzSe3uef5q0lRSs= github.com/multiformats/go-multiaddr v0.3.3/go.mod h1:lCKNGP1EQ1eZ35Za2wlqnabm9xQkib3fyB+nZXHLag0= +github.com/multiformats/go-multiaddr v0.4.0 h1:hL/K4ZJhJ5PTw3nwylq9lGU5yArzcAroZmex1ghSEkQ= +github.com/multiformats/go-multiaddr v0.4.0/go.mod h1:YcpyLH8ZPudLxQlemYBPhSm0/oCXAT8Z4mzFpyoPyRc= github.com/multiformats/go-multiaddr-dns v0.0.1/go.mod h1:9kWcqw/Pj6FwxAwW38n/9403szc57zJPs45fmnznu3Q= github.com/multiformats/go-multiaddr-dns v0.0.2/go.mod h1:9kWcqw/Pj6FwxAwW38n/9403szc57zJPs45fmnznu3Q= github.com/multiformats/go-multiaddr-dns v0.2.0/go.mod h1:TJ5pr5bBO7Y1B18djPuRsVkduhQH2YqYSbxWJzYGdK0= @@ -1441,12 +1527,14 @@ github.com/multiformats/go-multiaddr-net v0.1.2/go.mod h1:QsWt3XK/3hwvNxZJp92iMQ github.com/multiformats/go-multiaddr-net v0.1.3/go.mod h1:ilNnaM9HbmVFqsb/qcNysjCu4PVONlrBZpHIrw/qQuA= github.com/multiformats/go-multiaddr-net v0.1.4/go.mod h1:ilNnaM9HbmVFqsb/qcNysjCu4PVONlrBZpHIrw/qQuA= github.com/multiformats/go-multiaddr-net v0.1.5/go.mod h1:ilNnaM9HbmVFqsb/qcNysjCu4PVONlrBZpHIrw/qQuA= -github.com/multiformats/go-multiaddr-net v0.2.0 h1:MSXRGN0mFymt6B1yo/6BPnIRpLPEnKgQNvVfCX5VDJk= github.com/multiformats/go-multiaddr-net v0.2.0/go.mod h1:gGdH3UXny6U3cKKYCvpXI5rnK7YaOIEOPVDI9tsJbEA= github.com/multiformats/go-multibase v0.0.1/go.mod h1:bja2MqRZ3ggyXtZSEDKpl0uO/gviWFaSteVbWT51qgs= github.com/multiformats/go-multibase v0.0.2/go.mod h1:bja2MqRZ3ggyXtZSEDKpl0uO/gviWFaSteVbWT51qgs= github.com/multiformats/go-multibase v0.0.3 h1:l/B6bJDQjvQ5G52jw4QGSYeOTZoAwIO77RblWplfIqk= github.com/multiformats/go-multibase v0.0.3/go.mod h1:5+1R4eQrT3PkYZ24C3W2Ue2tPwIdYQD509ZjSb5y9Oc= +github.com/multiformats/go-multicodec v0.2.0/go.mod h1:/y4YVwkfMyry5kFbMTbLJKErhycTIftytRV+llXdyS4= +github.com/multiformats/go-multicodec v0.3.0 h1:tstDwfIjiHbnIjeM5Lp+pMrSeN+LCMsEwOrkPmWm03A= +github.com/multiformats/go-multicodec v0.3.0/go.mod h1:qGGaQmioCDh+TeFOnxrbU0DaIPw8yFgAZgFG0V7p1qQ= github.com/multiformats/go-multihash v0.0.1/go.mod h1:w/5tugSrLEbWqlcgJabL3oHFKTwfvkofsjW2Qa1ct4U= github.com/multiformats/go-multihash v0.0.5/go.mod h1:lt/HCbqlQwlPBz7lv0sQCdtfcMtlJvakRUn/0Ual8po= github.com/multiformats/go-multihash v0.0.8/go.mod h1:YSLudS+Pi8NHE7o6tb3D8vrpKa63epEDmG8nTduyAew= @@ -1454,13 +1542,13 @@ github.com/multiformats/go-multihash v0.0.9/go.mod h1:YSLudS+Pi8NHE7o6tb3D8vrpKa github.com/multiformats/go-multihash v0.0.10/go.mod h1:YSLudS+Pi8NHE7o6tb3D8vrpKa63epEDmG8nTduyAew= github.com/multiformats/go-multihash v0.0.13/go.mod h1:VdAWLKTwram9oKAatUcLxBNUjdtcVwxObEQBtRfuyjc= github.com/multiformats/go-multihash v0.0.14/go.mod h1:VdAWLKTwram9oKAatUcLxBNUjdtcVwxObEQBtRfuyjc= -github.com/multiformats/go-multihash v0.0.15 h1:hWOPdrNqDjwHDx82vsYGSDZNyktOJJ2dzZJzFkOV1jM= github.com/multiformats/go-multihash v0.0.15/go.mod h1:D6aZrWNLFTV/ynMpKsNtB40mJzmCl4jb1alC0OvHiHg= +github.com/multiformats/go-multihash v0.1.0 h1:CgAgwqk3//SVEw3T+6DqI4mWMyRuDwZtOWcJT0q9+EA= +github.com/multiformats/go-multihash v0.1.0/go.mod h1:RJlXsxt6vHGaia+S8We0ErjhojtKzPP2AH4+kYM7k84= github.com/multiformats/go-multistream v0.0.1/go.mod h1:fJTiDfXJVmItycydCnNx4+wSzZ5NwG2FEVAI30fiovg= github.com/multiformats/go-multistream v0.0.4/go.mod h1:fJTiDfXJVmItycydCnNx4+wSzZ5NwG2FEVAI30fiovg= github.com/multiformats/go-multistream v0.1.0/go.mod h1:fJTiDfXJVmItycydCnNx4+wSzZ5NwG2FEVAI30fiovg= github.com/multiformats/go-multistream v0.1.1/go.mod h1:KmHZ40hzVxiaiwlj3MEbYgK9JFk2/9UktWZAF54Du38= -github.com/multiformats/go-multistream v0.2.0/go.mod h1:5GZPQZbkWOLOn3J2y4Y99vVW7vOfsAflxARk3x14o6k= github.com/multiformats/go-multistream v0.2.1/go.mod h1:5GZPQZbkWOLOn3J2y4Y99vVW7vOfsAflxARk3x14o6k= github.com/multiformats/go-multistream v0.2.2 h1:TCYu1BHTDr1F/Qm75qwYISQdzGcRdC21nFgQW7l7GBo= github.com/multiformats/go-multistream v0.2.2/go.mod h1:UIcnm7Zuo8HKG+HkWgfQsGL+/MIEhyTqbODbIUwSXKs= @@ -1512,16 +1600,19 @@ github.com/onsi/ginkgo v1.10.3/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+ github.com/onsi/ginkgo v1.12.0/go.mod h1:oUhWkIvk5aDxtKvDDuw8gItl8pKl42LzjC9KZE0HfGg= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= -github.com/onsi/ginkgo v1.15.0 h1:1V1NfVQR87RtWAgp1lv9JZJ5Jap+XFGKPi00andXGi4= github.com/onsi/ginkgo v1.15.0/go.mod h1:hF8qUzuuC8DJGygJH3726JnCZX4MYbRB8yFfISqnKUg= +github.com/onsi/ginkgo v1.16.2/go.mod h1:CObGmKUOKaSC0RjmoAK7tKyn4Azo5P2IWuoMnvwxz1E= +github.com/onsi/ginkgo v1.16.4 h1:29JGrr5oVBm5ulCWet69zQkzWipVXIol6ygQUe/EzNc= +github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= github.com/onsi/gomega v1.4.1/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.5.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.9.0/go.mod h1:Ho0h+IUsWyvy1OpqCwxlQ/21gkhVunqlU8fDGcoTdcA= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= -github.com/onsi/gomega v1.10.5 h1:7n6FEkpFmfCoo2t+YYqXH0evK+a9ICQz0xcAy9dYcaQ= github.com/onsi/gomega v1.10.5/go.mod h1:gza4q3jKQJijlu05nKWRCW/GavJumGt8aNRxWg7mt48= +github.com/onsi/gomega v1.13.0 h1:7lLHu94wT9Ij0o6EWWclhu0aOh32VxhkwEJvzuWPeak= +github.com/onsi/gomega v1.13.0/go.mod h1:lRk9szgn8TxENtWd0Tp4c3wjlRfMTMH27I+3Je41yGY= github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= @@ -1587,6 +1678,7 @@ github.com/prometheus/client_golang v1.4.1/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3O github.com/prometheus/client_golang v1.6.0/go.mod h1:ZLOG9ck3JLRdB5MgO8f+lLTe83AXG6ro35rLTxvnIl4= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= github.com/prometheus/client_golang v1.9.0/go.mod h1:FqZLKOZnGdFAhOK4nqGHa7D66IdsO+O441Eve7ptJDU= +github.com/prometheus/client_golang v1.10.0/go.mod h1:WJM3cc3yu7XKBKa/I8WeZm+V3eltZnBwfENSU7mdogU= github.com/prometheus/client_golang v1.11.0 h1:HNkLOAEQMIDv/K+04rukrLx6ch7msSRwf3/SASFAGtQ= github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= @@ -1605,9 +1697,11 @@ github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt2 github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.15.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= +github.com/prometheus/common v0.18.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= -github.com/prometheus/common v0.28.0 h1:vGVfV9KrDTvWt5boZO0I19g2E3CsWfpPPKZM9dt3mEw= github.com/prometheus/common v0.28.0/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= +github.com/prometheus/common v0.30.0 h1:JEkYlQnpzrzQFxi6gnukFPdQ+ac82oRhzMcIduJu/Ug= +github.com/prometheus/common v0.30.0/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= github.com/prometheus/node_exporter v1.0.0-rc.0.0.20200428091818-01054558c289/go.mod h1:FGbBv5OPKjch+jNUJmEQpMZytIdyW0NdBtWFcfSKusc= github.com/prometheus/procfs v0.0.0-20180725123919-05ee40e3a273/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= @@ -1619,8 +1713,9 @@ github.com/prometheus/procfs v0.0.11/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4 github.com/prometheus/procfs v0.1.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.2.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= -github.com/prometheus/procfs v0.6.0 h1:mxy4L2jP6qMonqmq+aTtOx1ifVWUgG/TAmntgbh3xv4= github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= +github.com/prometheus/procfs v0.7.3 h1:4jVXhlkAyzOScmCkXBTOLRLTz8EeU+eyjrwB/EPq0VU= +github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= github.com/prometheus/statsd_exporter v0.20.0/go.mod h1:YL3FWCG8JBBtaUSxAg4Gz2ZYu22bS84XM89ZQXXTWmQ= github.com/prometheus/statsd_exporter v0.21.0 h1:hA05Q5RFeIjgwKIYEdFd59xu5Wwaznf33yKI+pyX6T8= github.com/prometheus/statsd_exporter v0.21.0/go.mod h1:rbT83sZq2V+p73lHhPZfMc3MLCHmSHelCh9hSGYNLTQ= @@ -1646,6 +1741,8 @@ github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0/go.mod h1:qq github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= +github.com/rogpeppe/go-internal v1.6.2 h1:aIihoIOHCiLZHxyoNQ+ABL4NKhFTgKLBdMLyEAh98m0= github.com/rogpeppe/go-internal v1.6.2/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= github.com/rs/cors v1.7.0 h1:+88SsELBHx5r+hZ8TCkggzSstaWNbDvThkVK8H6f9ik= github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= @@ -1834,6 +1931,7 @@ github.com/valyala/tcplisten v0.0.0-20161114210144-ceec8f93295a/go.mod h1:v3UYOV github.com/viant/assertly v0.4.8/go.mod h1:aGifi++jvCrUaklKEKT0BU95igDNaqkvz+49uaYMPRU= github.com/viant/toolbox v0.24.0/go.mod h1:OxMCG57V0PXuIP2HNQrtJf2CjqdmbrOx5EkMILuUhzM= github.com/viki-org/dnscache v0.0.0-20130720023526-c70c1f23c5d8/go.mod h1:dniwbG03GafCjFohMDmz6Zc6oCuiqgH6tGNyXTkHzXE= +github.com/wangjia184/sortedset v0.0.0-20160527075905-f5d03557ba30/go.mod h1:YkocrP2K2tcw938x9gCOmT5G5eCD6jsTz0SZuyAqwIE= github.com/warpfork/go-testmark v0.3.0 h1:Q81c4u7hT+BR5kNfNQhEF0VT2pmL7+Kk0wD+ORYl7iA= github.com/warpfork/go-testmark v0.3.0/go.mod h1:jhEf8FVxd+F17juRubpmut64NEG6I2rgkUhlcqqXwE0= github.com/warpfork/go-wish v0.0.0-20180510122957-5ad1f5abf436/go.mod h1:x6AKhvSSexNrVSrViXSHUEbICjmGXhtgABaHIySUSGw= @@ -1894,6 +1992,7 @@ github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= go.dedis.ch/fixbuf v1.0.3 h1:hGcV9Cd/znUxlusJ64eAlExS+5cJDIyTyEG+otu5wQs= go.dedis.ch/fixbuf v1.0.3/go.mod h1:yzJMt34Wa5xD37V5RTdmp38cz3QhMagdGoem9anUalw= go.dedis.ch/kyber/v3 v3.0.4/go.mod h1:OzvaEnPvKlyrWyp3kGXlFdp7ap1VC6RkZDTaPikqhsQ= @@ -1921,29 +2020,39 @@ go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= go.opencensus.io v0.23.0 h1:gqCw0LfLxScz8irSi8exQc7fyQ0fKQU/qnC/X8+V/1M= go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= +go.opentelemetry.io/otel v0.20.0/go.mod h1:Y3ugLH2oa81t5QO+Lty+zXf8zC9L26ax4Nzoxm/dooo= +go.opentelemetry.io/otel/metric v0.20.0/go.mod h1:598I5tYlH1vzBjn+BTuhzTCSb/9debfNp6R3s7Pr1eU= +go.opentelemetry.io/otel/oteltest v0.20.0/go.mod h1:L7bgKf9ZB7qCwT9Up7i9/pn0PWIa9FqQ2IQ8LoxiGnw= +go.opentelemetry.io/otel/trace v0.20.0/go.mod h1:6GjCW8zgDjwGHGa6GkyeB8+/5vjT16gUEi0Nf1iBdgw= +go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= go.starlark.net v0.0.0-20190702223751-32f345186213/go.mod h1:c1/X6cHgvdXj6pUlmWKMkuqRnW4K8x2vwt6JAaaircg= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= go.uber.org/atomic v1.5.1/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= -go.uber.org/atomic v1.7.0 h1:ADUqmZGgLDDfbSL9ZmPxKTybcoEYHgpYfELNoN+7hsw= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= -go.uber.org/goleak v1.0.0 h1:qsup4IcBdlmsnGfqyLl4Ntn3C2XCCuKAE7DwHpScyUo= +go.uber.org/atomic v1.9.0 h1:ECmE8Bn/WFTYwEW/bpKD3M8VtR/zQVbavAoalC1PYyE= +go.uber.org/atomic v1.9.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/goleak v1.0.0/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A= +go.uber.org/goleak v1.1.10 h1:z+mqJhf6ss6BSfSM671tgKyZBFPTTJM+HLxnhPC3wu0= +go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= go.uber.org/multierr v1.4.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU= -go.uber.org/multierr v1.6.0 h1:y6IPFStTAIT5Ytl7/XYmHvzXQ7S3g/IeZW9hyZ5thw4= go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= +go.uber.org/multierr v1.7.0 h1:zaiO/rmgFjbmCXdSYJWQcdvOCsthmdaHfr3Gm2Kx4Ec= +go.uber.org/multierr v1.7.0/go.mod h1:7EAYxJLBy9rStEaz58O2t4Uvip6FSURkq8/ppBp95ak= go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= go.uber.org/zap v1.14.1/go.mod h1:Mb2vm2krFEG5DV0W9qcHBYFtp/Wku1cvYaqPsS/WYfc= go.uber.org/zap v1.15.0/go.mod h1:Mb2vm2krFEG5DV0W9qcHBYFtp/Wku1cvYaqPsS/WYfc= -go.uber.org/zap v1.16.0 h1:uFRZXykJGK9lLY4HtgSw44DnIcAM+kRBP7x5m+NpAOM= go.uber.org/zap v1.16.0/go.mod h1:MA8QOfq0BHJwdXa996Y4dYkAqRKB8/1K1QMMZVaNZjQ= +go.uber.org/zap v1.18.1/go.mod h1:xg/QME4nWcxGxrpdeYfq7UvYrLh66cuVKdrbD1XF/NI= +go.uber.org/zap v1.19.0 h1:mZQZefskPPCMIBCSEH0v2/iUqqLrYtaeqwD6FUGUnFE= +go.uber.org/zap v1.19.0/go.mod h1:xg/QME4nWcxGxrpdeYfq7UvYrLh66cuVKdrbD1XF/NI= go4.org v0.0.0-20180809161055-417644f6feb5/go.mod h1:MkTOUMDaeVYJUOUsaDXIhWPZYa1yOyC1qaOBpL57BhE= go4.org v0.0.0-20200411211856-f5505b9728dd h1:BNJlw5kRTzdmyfh5U8F93HA2OwkP7ZGwA51eJ/0wKOU= go4.org v0.0.0-20200411211856-f5505b9728dd/go.mod h1:CIiUVy99QCPfoE13bO4EZaz5GZMZXMSBGhxRdsvzbkg= @@ -1987,8 +2096,9 @@ golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= -golang.org/x/crypto v0.0.0-20210506145944-38f3c27a63bf h1:B2n+Zi5QeYRDAEodEu72OS36gmTWjgpXr2+cWcBW90o= golang.org/x/crypto v0.0.0-20210506145944-38f3c27a63bf/go.mod h1:P+XmwS30IXTQdn5tA2iutPOUgjI07+tq3H3K9MVA1s8= +golang.org/x/crypto v0.0.0-20210813211128-0a44fdfbc16e h1:VvfwVmMH40bpMeizC9/K7ipM5Qjucuu16RWfneFPyhQ= +golang.org/x/crypto v0.0.0-20210813211128-0a44fdfbc16e/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/exp v0.0.0-20181106170214-d68db9428509/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -2024,8 +2134,9 @@ golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzB golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.4.1 h1:Kvvh58BN8Y9/lBi7hTekvtMpm07eUZ0ck5pRHpsMWrY= golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.4.2 h1:Gz96sIWK3OalVv/I/qNygP42zyoKp3xptRVCWRFEBvo= +golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/net v0.0.0-20180719180050-a680a1efc54d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -2078,14 +2189,20 @@ golang.org/x/net v0.0.0-20200602114024-627f9648deb9/go.mod h1:qpuaurCH72eLCgpAm/ 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-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20200904194848-62affa334b73/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201202161906-c7110b5ffcbb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc= +golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20210423184538-5f58ad60dda6/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= -golang.org/x/net v0.0.0-20210525063256-abc453219eb5 h1:wjuX4b5yYQnEQHzd+CBcrcC6OVR2J1CN6mUy0oSxIPo= +golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20210813160813-60bc85c4be6d h1:LO7XpTYMwTqxjLcGWPijK3vRXg1aWdlNOVOHRq45d7c= +golang.org/x/net v0.0.0-20210813160813-60bc85c4be6d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= 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= @@ -2155,6 +2272,7 @@ golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20191115151921-52ab43148777/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191206220618-eeba5f6aabab/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191220142924-d4481acd189f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -2192,9 +2310,17 @@ golang.org/x/sys v0.0.0-20210217105451-b926d437f341/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210228012217-479acdf4ea46/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210303074136-134d130e1a04/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210309074719-68d13333faf2/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210317225723-c4fcb01b228e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210426080607-c94f62235c83/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210511113859-b0526f3d8744/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210816183151-1e6c022a8912/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6 h1:foEbQz/B0Oz6YIqu/69kfXPYeFQAuuMYFkjaqXzl5Wo= golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= @@ -2206,8 +2332,9 @@ golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3 golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.6 h1:aRYxNxv6iGQlyVaZmk6ZgYEDa+Jg18DxebPSrd6bg1M= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= +golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -2311,8 +2438,8 @@ golang.org/x/tools v0.0.0-20210101214203-2dba1e4ea05c/go.mod h1:emZCQorbCU4vsT4f golang.org/x/tools v0.0.0-20210104081019-d8d6ddbec6ee/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= -golang.org/x/tools v0.1.1-0.20210225150353-54dc8c5edb56 h1:g3QwFWCjsUzBtcQIcI+CYmiL/0i0BxTJjQp54GGDLEM= -golang.org/x/tools v0.1.1-0.20210225150353-54dc8c5edb56/go.mod h1:9bzcO0MWcOuT0tm1iBGzDVPshzfwoVvREIui8C+MHqU= +golang.org/x/tools v0.1.1 h1:wGiQel/hW0NnEkJUk8lbzkX2gFJU6PFxf1v5OlCfuOs= +golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -2419,8 +2546,11 @@ google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3Iji google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.33.2 h1:EQyQC3sa8M+p6Ulc8yy9SWSS2GVwyRc83gAbG8lrl4o= +google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= +google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= +google.golang.org/grpc v1.40.0 h1:AGJ0Ih4mHjSeibYkFGh1dD9KJ/eOtZ93I6hoHhukQ5Q= +google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= @@ -2468,8 +2598,9 @@ gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gorm.io/driver/mysql v1.1.1 h1:yr1bpyqiwuSPJ4aGGUX9nu46RHXlF8RASQVb1QQNcvo= gorm.io/driver/mysql v1.1.1/go.mod h1:KdrTanmfLPPyAOeYGyG+UpDys7/7eeWT1zCq+oekYnU= gorm.io/gorm v1.21.9/go.mod h1:F+OptMscr0P2F2qU97WT1WimdH9GaQPoDW7AYd5i2Y0= @@ -2488,6 +2619,8 @@ honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9 honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.1.3 h1:qTakTkI6ni6LFD5sBwwsdSO+AQqbSIxOauHTTQKZ/7o= honnef.co/go/tools v0.1.3/go.mod h1:NgwopIslSNH47DimFoV78dnkksY2EFtX0ajyb3K/las= +lukechampine.com/blake3 v1.1.6 h1:H3cROdztr7RCfoaTpGZFQsrqvweFLrqS73j7L7cmR5c= +lukechampine.com/blake3 v1.1.6/go.mod h1:tkKEOtDkNtklkXtLNEOGNq5tcV90tJiA1vAA12R78LA= 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= diff --git a/pkg/chain/chain_index.go b/pkg/chain/chain_index.go index cbc5d134a7..381d1a6ed4 100644 --- a/pkg/chain/chain_index.go +++ b/pkg/chain/chain_index.go @@ -41,12 +41,12 @@ type lbEntry struct { // the tipset within the skiplength is directly obtained by reading the database. // if the height difference exceeds the skiplength, the tipset is read from caching. // if the caching fails, the tipset is obtained by reading the database and updating the cache -func (ci *ChainIndex) GetTipSetByHeight(_ context.Context, from *types.TipSet, to abi.ChainEpoch) (*types.TipSet, error) { +func (ci *ChainIndex) GetTipSetByHeight(ctx context.Context, from *types.TipSet, to abi.ChainEpoch) (*types.TipSet, error) { if from.Height()-to <= ci.skipLength { - return ci.walkBack(from, to) + return ci.walkBack(ctx, from, to) } - rounded, err := ci.roundDown(from) + rounded, err := ci.roundDown(ctx, from) if err != nil { return nil, err } @@ -56,7 +56,7 @@ func (ci *ChainIndex) GetTipSetByHeight(_ context.Context, from *types.TipSet, t for { cval, ok := ci.skipCache.Get(cur) if !ok { - fc, err := ci.fillCache(cur) + fc, err := ci.fillCache(ctx, cur) if err != nil { return nil, err } @@ -67,7 +67,7 @@ func (ci *ChainIndex) GetTipSetByHeight(_ context.Context, from *types.TipSet, t if lbe.ts.Height() == to || lbe.parentHeight < to { return lbe.ts, nil } else if to > lbe.targetHeight { - return ci.walkBack(lbe.ts, to) + return ci.walkBack(ctx, lbe.ts, to) } cur = lbe.target @@ -75,12 +75,12 @@ func (ci *ChainIndex) GetTipSetByHeight(_ context.Context, from *types.TipSet, t } //GetTipsetByHeightWithoutCache get the tipset of specific height by reading the database directly -func (ci *ChainIndex) GetTipsetByHeightWithoutCache(from *types.TipSet, to abi.ChainEpoch) (*types.TipSet, error) { - return ci.walkBack(from, to) +func (ci *ChainIndex) GetTipsetByHeightWithoutCache(ctx context.Context, from *types.TipSet, to abi.ChainEpoch) (*types.TipSet, error) { + return ci.walkBack(ctx, from, to) } -func (ci *ChainIndex) fillCache(tsk types.TipSetKey) (*lbEntry, error) { - ts, err := ci.loadTipSet(tsk) +func (ci *ChainIndex) fillCache(ctx context.Context, tsk types.TipSetKey) (*lbEntry, error) { + ts, err := ci.loadTipSet(ctx, tsk) if err != nil { return nil, err } @@ -95,7 +95,7 @@ func (ci *ChainIndex) fillCache(tsk types.TipSetKey) (*lbEntry, error) { // will either be equal to ts.Height, or at least > ts.Parent.Height() rheight := ci.roundHeight(ts.Height()) - parent, err := ci.loadTipSet(ts.Parents()) + parent, err := ci.loadTipSet(ctx, ts.Parents()) if err != nil { return nil, err } @@ -109,7 +109,7 @@ func (ci *ChainIndex) fillCache(tsk types.TipSetKey) (*lbEntry, error) { if parent.Height() < rheight { skipTarget = parent } else { - skipTarget, err = ci.walkBack(parent, rheight) + skipTarget, err = ci.walkBack(ctx, parent, rheight) if err != nil { return nil, xerrors.Errorf("fillCache walkback: %s", err) } @@ -131,10 +131,10 @@ func (ci *ChainIndex) roundHeight(h abi.ChainEpoch) abi.ChainEpoch { return (h / ci.skipLength) * ci.skipLength } -func (ci *ChainIndex) roundDown(ts *types.TipSet) (*types.TipSet, error) { +func (ci *ChainIndex) roundDown(ctx context.Context, ts *types.TipSet) (*types.TipSet, error) { target := ci.roundHeight(ts.Height()) - rounded, err := ci.walkBack(ts, target) + rounded, err := ci.walkBack(ctx, ts, target) if err != nil { return nil, err } @@ -142,7 +142,7 @@ func (ci *ChainIndex) roundDown(ts *types.TipSet) (*types.TipSet, error) { return rounded, nil } -func (ci *ChainIndex) walkBack(from *types.TipSet, to abi.ChainEpoch) (*types.TipSet, error) { +func (ci *ChainIndex) walkBack(ctx context.Context, from *types.TipSet, to abi.ChainEpoch) (*types.TipSet, error) { if to > from.Height() { return nil, xerrors.Errorf("looking for tipset with height greater than start point") } @@ -154,7 +154,7 @@ func (ci *ChainIndex) walkBack(from *types.TipSet, to abi.ChainEpoch) (*types.Ti ts := from for { - pts, err := ci.loadTipSet(ts.Parents()) + pts, err := ci.loadTipSet(ctx, ts.Parents()) if err != nil { return nil, err } diff --git a/pkg/chain/message_store.go b/pkg/chain/message_store.go index 9e213947d5..2b797ae64c 100644 --- a/pkg/chain/message_store.go +++ b/pkg/chain/message_store.go @@ -33,8 +33,8 @@ type MessageProvider interface { LoadTipSetMessage(ctx context.Context, ts *types.TipSet) ([]types.BlockMessagesInfo, error) LoadMetaMessages(context.Context, cid.Cid) ([]*types.SignedMessage, []*types.Message, error) ReadMsgMetaCids(ctx context.Context, mmc cid.Cid) ([]cid.Cid, []cid.Cid, error) - LoadUnsignedMessagesFromCids(blsCids []cid.Cid) ([]*types.Message, error) - LoadSignedMessagesFromCids(secpCids []cid.Cid) ([]*types.SignedMessage, error) + LoadUnsignedMessagesFromCids(ctx context.Context, blsCids []cid.Cid) ([]*types.Message, error) + LoadSignedMessagesFromCids(ctx context.Context, secpCids []cid.Cid) ([]*types.SignedMessage, error) LoadReceipts(context.Context, cid.Cid) ([]types.MessageReceipt, error) LoadTxMeta(context.Context, cid.Cid) (types.MessageRoot, error) } @@ -73,7 +73,7 @@ func (ms *MessageStore) LoadMetaMessages(ctx context.Context, metaCid cid.Cid) ( } // load secp messages from cids - secpMsgs, err := ms.LoadSignedMessagesFromCids(secpCids) + secpMsgs, err := ms.LoadSignedMessagesFromCids(ctx, secpCids) if err != nil { return nil, nil, err } @@ -84,7 +84,7 @@ func (ms *MessageStore) LoadMetaMessages(ctx context.Context, metaCid cid.Cid) ( } // load bls messages from cids - blsMsgs, err := ms.LoadUnsignedMessagesFromCids(blsCids) + blsMsgs, err := ms.LoadUnsignedMessagesFromCids(ctx, blsCids) if err != nil { return nil, nil, err } @@ -112,8 +112,8 @@ func (ms *MessageStore) ReadMsgMetaCids(ctx context.Context, mmc cid.Cid) ([]cid //LoadMessage load message of specify message cid //First get the unsigned message. If it is not found, then get the signed message. If still not found, an error will be returned -func (ms *MessageStore) LoadMessage(mid cid.Cid) (types.ChainMsg, error) { - m, err := ms.LoadUnsignedMessage(mid) +func (ms *MessageStore) LoadMessage(ctx context.Context, mid cid.Cid) (types.ChainMsg, error) { + m, err := ms.LoadUnsignedMessage(ctx, mid) if err == nil { return m, nil } @@ -122,12 +122,12 @@ func (ms *MessageStore) LoadMessage(mid cid.Cid) (types.ChainMsg, error) { log.Warnf("GetCMessage: unexpected error getting unsigned message: %s", err) } - return ms.LoadSignedMessage(mid) + return ms.LoadSignedMessage(ctx, mid) } //LoadUnsignedMessage load unsigned messages in tipset -func (ms *MessageStore) LoadUnsignedMessage(mid cid.Cid) (*types.Message, error) { - messageBlock, err := ms.bs.Get(mid) +func (ms *MessageStore) LoadUnsignedMessage(ctx context.Context, mid cid.Cid) (*types.Message, error) { + messageBlock, err := ms.bs.Get(ctx, mid) if err != nil { return nil, errors.Wrapf(err, "failed to get bls message %s", mid) } @@ -139,8 +139,8 @@ func (ms *MessageStore) LoadUnsignedMessage(mid cid.Cid) (*types.Message, error) } //LoadUnsignedMessagesFromCids load unsigned messages of cid array -func (ms *MessageStore) LoadSignedMessage(mid cid.Cid) (*types.SignedMessage, error) { - messageBlock, err := ms.bs.Get(mid) +func (ms *MessageStore) LoadSignedMessage(ctx context.Context, mid cid.Cid) (*types.SignedMessage, error) { + messageBlock, err := ms.bs.Get(ctx, mid) if err != nil { return nil, errors.Wrapf(err, "failed to get bls message %s", mid) } @@ -154,10 +154,10 @@ func (ms *MessageStore) LoadSignedMessage(mid cid.Cid) (*types.SignedMessage, er } //LoadUnsignedMessagesFromCids load unsigned messages of cid array -func (ms *MessageStore) LoadUnsignedMessagesFromCids(blsCids []cid.Cid) ([]*types.Message, error) { +func (ms *MessageStore) LoadUnsignedMessagesFromCids(ctx context.Context, blsCids []cid.Cid) ([]*types.Message, error) { blsMsgs := make([]*types.Message, len(blsCids)) for i, c := range blsCids { - message, err := ms.LoadUnsignedMessage(c) + message, err := ms.LoadUnsignedMessage(ctx, c) if err != nil { return nil, err } @@ -167,10 +167,10 @@ func (ms *MessageStore) LoadUnsignedMessagesFromCids(blsCids []cid.Cid) ([]*type } //LoadSignedMessagesFromCids load signed messages of cid array -func (ms *MessageStore) LoadSignedMessagesFromCids(secpCids []cid.Cid) ([]*types.SignedMessage, error) { +func (ms *MessageStore) LoadSignedMessagesFromCids(ctx context.Context, secpCids []cid.Cid) ([]*types.SignedMessage, error) { secpMsgs := make([]*types.SignedMessage, len(secpCids)) for i, c := range secpCids { - message, err := ms.LoadSignedMessage(c) + message, err := ms.LoadSignedMessage(ctx, c) if err != nil { return nil, err } @@ -374,7 +374,7 @@ func (ms *MessageStore) loadAMTCids(ctx context.Context, c cid.Cid) ([]cid.Cid, // LoadTxMeta loads the secproot, blsroot data from the message store func (ms *MessageStore) LoadTxMeta(ctx context.Context, c cid.Cid) (types.MessageRoot, error) { - metaBlock, err := ms.bs.Get(c) + metaBlock, err := ms.bs.Get(ctx, c) if err != nil { return types.MessageRoot{}, errors.Wrapf(err, "failed to get tx meta %s", c) } diff --git a/pkg/chain/randomness.go b/pkg/chain/randomness.go index b79eb8aa8d..48bfdbd1aa 100644 --- a/pkg/chain/randomness.go +++ b/pkg/chain/randomness.go @@ -91,8 +91,8 @@ type RandomnessSource interface { } type TipSetByHeight interface { - GetTipSet(key types.TipSetKey) (*types.TipSet, error) - GetTipSetByHeight(ctx context.Context, ts *types.TipSet, h abi.ChainEpoch, prev bool) (*types.TipSet, error) + GetTipSet(context.Context, types.TipSetKey) (*types.TipSet, error) + GetTipSetByHeight(context.Context, *types.TipSet, abi.ChainEpoch, bool) (*types.TipSet, error) } var _ RandomnessSource = (*ChainRandomnessSource)(nil) @@ -109,7 +109,7 @@ func NewChainRandomnessSource(reader TipSetByHeight, head types.TipSetKey, beaco } func (c *ChainRandomnessSource) GetBeaconRandomnessTipset(ctx context.Context, randEpoch abi.ChainEpoch, lookback bool) (*types.TipSet, error) { - ts, err := c.reader.GetTipSet(c.head) + ts, err := c.reader.GetTipSet(ctx, c.head) if err != nil { return nil, err } @@ -138,7 +138,7 @@ func (c *ChainRandomnessSource) GetBeaconRandomnessTipset(ctx context.Context, r // should blend in some distinguishing value (such as the epoch itself) into a hash of this ticket. func (c *ChainRandomnessSource) GetChainRandomness(ctx context.Context, epoch abi.ChainEpoch, lookback bool) (types.Ticket, error) { if !c.head.IsEmpty() { - start, err := c.reader.GetTipSet(c.head) + start, err := c.reader.GetTipSet(ctx, c.head) if err != nil { return types.Ticket{}, err } @@ -251,7 +251,7 @@ func (c *ChainRandomnessSource) extractBeaconEntryForEpoch(ctx context.Context, } } - next, err := c.reader.GetTipSet(randTS.Parents()) + next, err := c.reader.GetTipSet(ctx, randTS.Parents()) if err != nil { return nil, xerrors.Errorf("failed to load parents when searching back for beacon entry: %w", err) } diff --git a/pkg/chain/reorg_test.go b/pkg/chain/reorg_test.go index dcc4d5a398..bc155c4ae5 100644 --- a/pkg/chain/reorg_test.go +++ b/pkg/chain/reorg_test.go @@ -72,13 +72,13 @@ func TestReorgDiffSubset(t *testing.T) { // This function returns the forked head, the main head and the common ancestor. func getForkOldNewCommon(ctx context.Context, t *testing.T, builder *chain.Builder, a, b, c int) (*types.TipSet, *types.TipSet, *types.TipSet) { // Add "a" tipsets to the head of the chainStore. - commonHead := builder.AppendManyOn(a, types.UndefTipSet) + commonHead := builder.AppendManyOn(ctx, a, types.UndefTipSet) oldHead := commonHead if c > 0 { - oldHead = builder.AppendManyOn(c, commonHead) + oldHead = builder.AppendManyOn(ctx, c, commonHead) } - newHead := builder.AppendManyOn(b, commonHead) + newHead := builder.AppendManyOn(ctx, b, commonHead) return oldHead, newHead, commonHead } @@ -88,9 +88,9 @@ func getForkOldNewCommon(ctx context.Context, t *testing.T, builder *chain.Build // consists of this single block and another block together forming a tipset // that is a superset of the forked head. func getSubsetOldNewCommon(ctx context.Context, t *testing.T, builder *chain.Builder, a int) (*types.TipSet, *types.TipSet, *types.TipSet) { - commonHead := builder.AppendManyBlocksOnBlocks(a) - block1 := builder.AppendBlockOnBlocks(commonHead) - block2 := builder.AppendBlockOnBlocks(commonHead) + commonHead := builder.AppendManyBlocksOnBlocks(ctx, a) + block1 := builder.AppendBlockOnBlocks(ctx, commonHead) + block2 := builder.AppendBlockOnBlocks(ctx, commonHead) oldHead := testhelpers.RequireNewTipSet(t, block1) superset := testhelpers.RequireNewTipSet(t, block1, block2) diff --git a/pkg/chain/store.go b/pkg/chain/store.go index e68fbb8dcb..d3ea6ece66 100644 --- a/pkg/chain/store.go +++ b/pkg/chain/store.go @@ -9,13 +9,6 @@ import ( "runtime/debug" "sync" - "github.com/filecoin-project/go-state-types/network" - "github.com/filecoin-project/venus/pkg/state" - - "github.com/filecoin-project/go-address" - "github.com/filecoin-project/go-state-types/abi" - "github.com/filecoin-project/go-state-types/big" - blockadt "github.com/filecoin-project/specs-actors/actors/util/adt" lru "github.com/hashicorp/golang-lru" "github.com/ipfs/go-cid" "github.com/ipfs/go-datastore" @@ -30,11 +23,19 @@ import ( "go.opencensus.io/trace" "golang.org/x/xerrors" + "github.com/filecoin-project/go-address" + "github.com/filecoin-project/go-state-types/abi" + "github.com/filecoin-project/go-state-types/big" + "github.com/filecoin-project/go-state-types/network" + blockadt "github.com/filecoin-project/specs-actors/actors/util/adt" + "github.com/filecoin-project/venus/pkg/constants" "github.com/filecoin-project/venus/pkg/metrics/tracing" "github.com/filecoin-project/venus/pkg/repo" + "github.com/filecoin-project/venus/pkg/state" "github.com/filecoin-project/venus/pkg/state/tree" "github.com/filecoin-project/venus/pkg/util" + "github.com/filecoin-project/venus/venus-shared/actors/adt" "github.com/filecoin-project/venus/venus-shared/actors/builtin" _init "github.com/filecoin-project/venus/venus-shared/actors/builtin/init" @@ -76,7 +77,7 @@ var HeadKey = datastore.NewKey("/chain/heaviestTipSet") var ErrNotifeeDone = errors.New("notifee is done and should be removed") -type loadTipSetFunc func(types.TipSetKey) (*types.TipSet, error) +type loadTipSetFunc func(context.Context, types.TipSetKey) (*types.TipSet, error) // ReorgNotifee represents a callback that gets called upon reorgs. type ReorgNotifee func(rev, app []*types.TipSet) error @@ -168,7 +169,7 @@ func NewStore(chainDs repo.Datastore, store.chainIndex = NewChainIndex(store.GetTipSet) store.circulatingSupplyCalculator = circulatiingSupplyCalculator - val, err := store.ds.Get(CheckPoint) + val, err := store.ds.Get(context.TODO(), CheckPoint) if err != nil { store.checkPoint = types.NewTipSetKey(genesisCid) } else { @@ -180,8 +181,8 @@ func NewStore(chainDs repo.Datastore, return store } -func (store *Store) rollbackToTipset(key types.TipSetKey) error { - var target, err = store.GetTipSet(key) +func (store *Store) rollbackToTipset(ctx context.Context, key types.TipSetKey) error { + var target, err = store.GetTipSet(ctx, key) if err != nil { return err } @@ -190,7 +191,7 @@ func (store *Store) rollbackToTipset(key types.TipSetKey) error { var head *types.TipSet - if head, err = store.loadHead(); err != nil { + if head, err = store.loadHead(ctx); err != nil { return err } @@ -203,7 +204,7 @@ func (store *Store) rollbackToTipset(key types.TipSetKey) error { for !head.Equals(target) && head.Height() > target.Height() { toRemoveTS = append(toRemoveTS, head) - if head, err = store.GetTipSet(head.Parents()); err != nil { + if head, err = store.GetTipSet(ctx, head.Parents()); err != nil { return err } } @@ -213,7 +214,7 @@ func (store *Store) rollbackToTipset(key types.TipSetKey) error { } for _, ts := range toRemoveTS { - _ = store.DeleteTipSetMetadata(ts) + _ = store.DeleteTipSetMetadata(ctx, ts) } return store.SetHead(context.TODO(), head) @@ -248,12 +249,12 @@ func (store *Store) Load(ctx context.Context) (err error) { log.Warnf("can't unmarshal environment tipsetkey:%s", vch) headKey = types.EmptyTSK } - if err = store.rollbackToTipset(headKey); err != nil { + if err = store.rollbackToTipset(ctx, headKey); err != nil { return xerrors.Errorf("rollback to tipset(%s) failed:%v", headKey.String(), err) } } - if headTS, err = store.loadHead(); err != nil { + if headTS, err = store.loadHead(ctx); err != nil { return err } @@ -262,8 +263,8 @@ func (store *Store) Load(ctx context.Context) (err error) { // but it's sure that it's parent state is stored.. if headTS.Height() > abi.ChainEpoch(0) { var meta *TipSetMetadata - if meta, err = store.LoadTipsetMetadata(headTS); err != nil || meta == nil { - if headTS, err = store.GetTipSet(headTS.Parents()); err != nil { + if meta, err = store.LoadTipsetMetadata(ctx, headTS); err != nil || meta == nil { + if headTS, err = store.GetTipSet(ctx, headTS.Parents()); err != nil { return err } } @@ -275,13 +276,13 @@ func (store *Store) Load(ctx context.Context) (err error) { // Provide tipsets directly from the block store, not from the tipset index which is // being rebuilt by this traversal. tipsetProvider := TipSetProviderFromBlocks(ctx, store) - for iterator := IterAncestors(ctx, tipsetProvider, headTS); !iterator.Complete(); err = iterator.Next() { + for iterator := IterAncestors(ctx, tipsetProvider, headTS); !iterator.Complete(); err = iterator.Next(ctx) { if err != nil { return err } ts := iterator.Value() - tipSetMetadata, err := store.LoadTipsetMetadata(ts) + tipSetMetadata, err := store.LoadTipsetMetadata(ctx, ts) if err != nil { return err } @@ -298,8 +299,8 @@ func (store *Store) Load(ctx context.Context) (err error) { } // loadHead loads the latest known head from disk. -func (store *Store) loadHead() (*types.TipSet, error) { - tskBytes, err := store.ds.Get(HeadKey) +func (store *Store) loadHead(ctx context.Context) (*types.TipSet, error) { + tskBytes, err := store.ds.Get(ctx, HeadKey) if err != nil { return nil, errors.Wrap(err, "failed to read HeadKey") } @@ -310,15 +311,15 @@ func (store *Store) loadHead() (*types.TipSet, error) { return nil, errors.Wrap(err, "failed to cast headCids") } - return store.GetTipSet(tsk) + return store.GetTipSet(ctx, tsk) } //LoadTipsetMetadata load tipset status (state root and reciepts) -func (store *Store) LoadTipsetMetadata(ts *types.TipSet) (*TipSetMetadata, error) { +func (store *Store) LoadTipsetMetadata(ctx context.Context, ts *types.TipSet) (*TipSetMetadata, error) { h := ts.Height() key := datastore.NewKey(makeKey(ts.String(), h)) - tsStateBytes, err := store.ds.Get(key) + tsStateBytes, err := store.ds.Get(ctx, key) if err != nil { return nil, errors.Wrapf(err, "failed to read tipset key %s", ts.String()) } @@ -341,7 +342,7 @@ func (store *Store) PutTipSetMetadata(ctx context.Context, tsm *TipSetMetadata) store.tipIndex.Put(tsm) // Persist the state mapping. - if err := store.writeTipSetMetadata(tsm); err != nil { + if err := store.writeTipSetMetadata(ctx, tsm); err != nil { return err } @@ -353,7 +354,7 @@ func (store *Store) Ls(ctx context.Context, fromTS *types.TipSet, count int) ([] tipsets := []*types.TipSet{fromTS} fromKey := fromTS.Parents() for i := 0; i < count-1; i++ { - ts, err := store.GetTipSet(fromKey) + ts, err := store.GetTipSet(ctx, fromKey) if err != nil { return nil, err } @@ -380,7 +381,7 @@ func (store *Store) PutObject(ctx context.Context, obj interface{}) (cid.Cid, er } // GetTipSet returns the tipset identified by `key`. -func (store *Store) GetTipSet(key types.TipSetKey) (*types.TipSet, error) { +func (store *Store) GetTipSet(ctx context.Context, key types.TipSetKey) (*types.TipSet, error) { if key.IsEmpty() { return store.GetHead(), nil } @@ -433,7 +434,7 @@ func (store *Store) GetTipSetByHeight(ctx context.Context, ts *types.TipSet, h a if lbts.Height() < h { log.Warnf("chain index returned the wrong tipset at height %d, using slow retrieval", h) - lbts, err = store.chainIndex.GetTipsetByHeightWithoutCache(ts, h) + lbts, err = store.chainIndex.GetTipsetByHeightWithoutCache(ctx, ts, h) if err != nil { return nil, err } @@ -443,7 +444,7 @@ func (store *Store) GetTipSetByHeight(ctx context.Context, ts *types.TipSet, h a return lbts, nil } - return store.GetTipSet(lbts.Parents()) + return store.GetTipSet(ctx, lbts.Parents()) } // GetTipSetState returns the aggregate state of the tipset identified by `key`. @@ -451,7 +452,7 @@ func (store *Store) GetTipSetState(ctx context.Context, ts *types.TipSet) (tree. if ts == nil { ts = store.head } - stateCid, err := store.tipIndex.GetTipSetStateRoot(ts) + stateCid, err := store.tipIndex.GetTipSetStateRoot(ctx, ts) if err != nil { return nil, err } @@ -464,17 +465,17 @@ func (store *Store) GetGenesisBlock(ctx context.Context) (*types.BlockHeader, er } // GetTipSetStateRoot returns the aggregate state root CID of the tipset identified by `key`. -func (store *Store) GetTipSetStateRoot(key *types.TipSet) (cid.Cid, error) { - return store.tipIndex.GetTipSetStateRoot(key) +func (store *Store) GetTipSetStateRoot(ctx context.Context, key *types.TipSet) (cid.Cid, error) { + return store.tipIndex.GetTipSetStateRoot(ctx, key) } // GetTipSetReceiptsRoot returns the root CID of the message receipts for the tipset identified by `key`. -func (store *Store) GetTipSetReceiptsRoot(key *types.TipSet) (cid.Cid, error) { - return store.tipIndex.GetTipSetReceiptsRoot(key) +func (store *Store) GetTipSetReceiptsRoot(ctx context.Context, key *types.TipSet) (cid.Cid, error) { + return store.tipIndex.GetTipSetReceiptsRoot(ctx, key) } -func (store *Store) GetTipsetMetadata(ts *types.TipSet) (*TipSetMetadata, error) { - tsStat, err := store.tipIndex.Get(ts) +func (store *Store) GetTipsetMetadata(ctx context.Context, ts *types.TipSet) (*TipSetMetadata, error) { + tsStat, err := store.tipIndex.Get(ctx, ts) if err != nil { return nil, err } @@ -487,12 +488,12 @@ func (store *Store) GetTipsetMetadata(ts *types.TipSet) (*TipSetMetadata, error) // HasTipSetAndState returns true iff the default store's tipindex is indexing // the tipset identified by `key`. func (store *Store) HasTipSetAndState(ctx context.Context, ts *types.TipSet) bool { - return store.tipIndex.Has(ts) + return store.tipIndex.Has(ctx, ts) } //GetLatestBeaconEntry get latest beacon from the height. there're no beacon values in the block, try to //get beacon in the parents tipset. the max find depth is 20. -func (store *Store) GetLatestBeaconEntry(ts *types.TipSet) (*types.BeaconEntry, error) { +func (store *Store) GetLatestBeaconEntry(ctx context.Context, ts *types.TipSet) (*types.BeaconEntry, error) { cur := ts for i := 0; i < 20; i++ { cbe := cur.At(0).BeaconEntries @@ -504,7 +505,7 @@ func (store *Store) GetLatestBeaconEntry(ts *types.TipSet) (*types.BeaconEntry, return nil, xerrors.Errorf("made it back to genesis block without finding beacon entry") } - next, err := store.GetTipSet(cur.Parents()) + next, err := store.GetTipSet(ctx, cur.Parents()) if err != nil { return nil, xerrors.Errorf("failed to load parents when searching back for latest beacon entry: %w", err) } @@ -521,7 +522,7 @@ func (store *Store) GetLatestBeaconEntry(ts *types.TipSet) (*types.BeaconEntry, } // nolint -func (store *Store) walkBack(from *types.TipSet, to abi.ChainEpoch) (*types.TipSet, error) { +func (store *Store) walkBack(ctx context.Context, from *types.TipSet, to abi.ChainEpoch) (*types.TipSet, error) { if to > from.Height() { return nil, xerrors.Errorf("looking for tipset with height greater than start point") } @@ -533,7 +534,7 @@ func (store *Store) walkBack(from *types.TipSet, to abi.ChainEpoch) (*types.TipS ts := from for { - pts, err := store.GetTipSet(ts.Parents()) + pts, err := store.GetTipSet(ctx, ts.Parents()) if err != nil { return nil, err } @@ -747,12 +748,12 @@ func (store *Store) writeHead(ctx context.Context, cids types.TipSetKey) error { return err } - return store.ds.Put(HeadKey, buf.Bytes()) + return store.ds.Put(ctx, HeadKey, buf.Bytes()) } // writeTipSetMetadata writes the tipset key and the state root id to the // datastore. -func (store *Store) writeTipSetMetadata(tsm *TipSetMetadata) error { +func (store *Store) writeTipSetMetadata(ctx context.Context, tsm *TipSetMetadata) error { if tsm.TipSetStateRoot == cid.Undef { return errors.New("attempting to write state root cid.Undef") } @@ -774,15 +775,15 @@ func (store *Store) writeTipSetMetadata(tsm *TipSetMetadata) error { h := tsm.TipSet.Height() key := datastore.NewKey(makeKey(tsm.TipSet.String(), h)) - return store.ds.Put(key, buf.Bytes()) + return store.ds.Put(ctx, key, buf.Bytes()) } // deleteTipSetMetadata delete the state root id from the datastore for the tipset key. -func (store *Store) DeleteTipSetMetadata(ts *types.TipSet) error { // nolint +func (store *Store) DeleteTipSetMetadata(ctx context.Context, ts *types.TipSet) error { // nolint store.tipIndex.Del(ts) h := ts.Height() key := datastore.NewKey(makeKey(ts.String(), h)) - return store.ds.Delete(key) + return store.ds.Delete(ctx, key) } // GetHead returns the current head tipset cids. @@ -807,12 +808,12 @@ func (store *Store) GenesisRootCid() cid.Cid { return genesis.ParentStateRoot } -func recurseLinks(bs blockstore.Blockstore, walked *cid.Set, root cid.Cid, in []cid.Cid) ([]cid.Cid, error) { +func recurseLinks(ctx context.Context, bs blockstore.Blockstore, walked *cid.Set, root cid.Cid, in []cid.Cid) ([]cid.Cid, error) { if root.Prefix().Codec != cid.DagCBOR { return in, nil } - data, err := bs.Get(root) + data, err := bs.Get(ctx, root) if err != nil { return nil, xerrors.Errorf("recurse links get (%s) failed: %w", root, err) } @@ -831,7 +832,7 @@ func recurseLinks(bs blockstore.Blockstore, walked *cid.Set, root cid.Cid, in [] in = append(in, c) var err error - in, err = recurseLinks(bs, walked, c, in) + in, err = recurseLinks(ctx, bs, walked, c, in) if err != nil { rerr = err } @@ -854,7 +855,7 @@ func (store *Store) Export(ctx context.Context, ts *types.TipSet, inclRecentRoot } return store.WalkSnapshot(ctx, ts, inclRecentRoots, skipOldMsgs, true, func(c cid.Cid) error { - blk, err := store.bsstore.Get(c) + blk, err := store.bsstore.Get(ctx, c) if err != nil { return xerrors.Errorf("writing object to car, bs.Get: %w", err) } @@ -887,7 +888,7 @@ func (store *Store) WalkSnapshot(ctx context.Context, ts *types.TipSet, inclRece return err } - data, err := store.bsstore.Get(blk) + data, err := store.bsstore.Get(ctx, blk) if err != nil { return xerrors.Errorf("getting block: %w", err) } @@ -907,7 +908,7 @@ func (store *Store) WalkSnapshot(ctx context.Context, ts *types.TipSet, inclRece var cids []cid.Cid if !skipOldMsgs || b.Height > ts.Height()-inclRecentRoots { if walked.Visit(b.Messages) { - mcids, err := recurseLinks(store.bsstore, walked, b.Messages, []cid.Cid{b.Messages}) + mcids, err := recurseLinks(ctx, store.bsstore, walked, b.Messages, []cid.Cid{b.Messages}) if err != nil { return xerrors.Errorf("recursing messages failed: %w", err) } @@ -926,7 +927,7 @@ func (store *Store) WalkSnapshot(ctx context.Context, ts *types.TipSet, inclRece if b.Height == 0 || b.Height > ts.Height()-inclRecentRoots { if walked.Visit(b.ParentStateRoot) { - cids, err := recurseLinks(store.bsstore, walked, b.ParentStateRoot, []cid.Cid{b.ParentStateRoot}) + cids, err := recurseLinks(ctx, store.bsstore, walked, b.ParentStateRoot, []cid.Cid{b.ParentStateRoot}) if err != nil { return xerrors.Errorf("recursing genesis state failed: %w", err) } @@ -972,13 +973,13 @@ func (store *Store) WalkSnapshot(ctx context.Context, ts *types.TipSet, inclRece } //Import import a car file into local db -func (store *Store) Import(r io.Reader) (*types.TipSet, error) { - header, err := car.LoadCar(store.bsstore, r) +func (store *Store) Import(ctx context.Context, r io.Reader) (*types.TipSet, error) { + header, err := car.LoadCar(ctx, store.bsstore, r) if err != nil { return nil, xerrors.Errorf("loadcar failed: %w", err) } - root, err := store.GetTipSet(types.NewTipSetKey(header.Roots...)) + root, err := store.GetTipSet(ctx, types.NewTipSetKey(header.Roots...)) if err != nil { return nil, xerrors.Errorf("failed to load root tipset from chainfile: %w", err) } @@ -999,7 +1000,7 @@ func (store *Store) Import(r io.Reader) (*types.TipSet, error) { break } curTipsetKey := curTipset.Parents() - curParentTipset, err := store.GetTipSet(curTipsetKey) + curParentTipset, err := store.GetTipSet(ctx, curTipsetKey) if err != nil { return nil, xerrors.Errorf("failed to load root tipset from chainfile: %w", err) } @@ -1021,7 +1022,7 @@ func (store *Store) Import(r io.Reader) (*types.TipSet, error) { } if root.Height() > 0 { - root, err = store.GetTipSet(root.Parents()) + root, err = store.GetTipSet(ctx, root.Parents()) if err != nil { return nil, xerrors.Errorf("failed to load root tipset from chainfile: %w", err) } @@ -1042,7 +1043,7 @@ func (store *Store) WriteCheckPoint(ctx context.Context, cids types.TipSetKey) e if err != nil { return err } - return store.ds.Put(CheckPoint, buf.Bytes()) + return store.ds.Put(ctx, CheckPoint, buf.Bytes()) } func (store *Store) GetCirculatingSupplyDetailed(ctx context.Context, height abi.ChainEpoch, st tree.Tree) (types.CirculatingSupply, error) { @@ -1051,12 +1052,12 @@ func (store *Store) GetCirculatingSupplyDetailed(ctx context.Context, height abi //StateCirculatingSupply get circulate supply at specify epoch func (store *Store) StateCirculatingSupply(ctx context.Context, tsk types.TipSetKey) (abi.TokenAmount, error) { - ts, err := store.GetTipSet(tsk) + ts, err := store.GetTipSet(ctx, tsk) if err != nil { return abi.TokenAmount{}, err } - root, err := store.GetTipSetStateRoot(ts) + root, err := store.GetTipSetStateRoot(ctx, ts) if err != nil { return abi.TokenAmount{}, err } @@ -1183,7 +1184,7 @@ func (store *Store) ReorgOps(a, b *types.TipSet) ([]*types.TipSet, []*types.TipS // // If an error happens along the way, we return the error with nil slices. // todo should move this code into store.ReorgOps. anywhere use this function should invoke store.ReorgOps -func ReorgOps(lts func(types.TipSetKey) (*types.TipSet, error), a, b *types.TipSet) ([]*types.TipSet, []*types.TipSet, error) { +func ReorgOps(lts func(context.Context, types.TipSetKey) (*types.TipSet, error), a, b *types.TipSet) ([]*types.TipSet, []*types.TipSet, error) { left := a right := b @@ -1191,7 +1192,7 @@ func ReorgOps(lts func(types.TipSetKey) (*types.TipSet, error), a, b *types.TipS for !left.Equals(right) { if left.Height() > right.Height() { leftChain = append(leftChain, left) - par, err := lts(left.Parents()) + par, err := lts(context.TODO(), left.Parents()) if err != nil { return nil, nil, err } @@ -1199,7 +1200,7 @@ func ReorgOps(lts func(types.TipSetKey) (*types.TipSet, error), a, b *types.TipS left = par } else { rightChain = append(rightChain, right) - par, err := lts(right.Parents()) + par, err := lts(context.TODO(), right.Parents()) if err != nil { log.Infof("failed to fetch right.Parents: %s", err) return nil, nil, err @@ -1214,8 +1215,8 @@ func ReorgOps(lts func(types.TipSetKey) (*types.TipSet, error), a, b *types.TipS } // PutMessage put message in local db -func (store *Store) PutMessage(m storable) (cid.Cid, error) { - return PutMessage(store.bsstore, m) +func (store *Store) PutMessage(ctx context.Context, m storable) (cid.Cid, error) { + return PutMessage(ctx, store.bsstore, m) } // Blockstore return local blockstore @@ -1257,7 +1258,7 @@ func (store *Store) GetLookbackTipSetForRound(ctx context.Context, ts *types.Tip if lbr >= h { // This should never happen at this point, but may happen before // network version 3 (where the lookback was only 10 blocks). - st, err := store.GetTipSetStateRoot(ts) + st, err := store.GetTipSetStateRoot(ctx, ts) if err != nil { return nil, cid.Undef, err } @@ -1276,7 +1277,7 @@ func (store *Store) GetLookbackTipSetForRound(ctx context.Context, ts *types.Tip } pKey := nextTS.Parents() - lbts, err := store.GetTipSet(pKey) + lbts, err := store.GetTipSet(ctx, pKey) if err != nil { return nil, cid.Undef, xerrors.Errorf("failed to resolve lookback tipset: %v", err) } @@ -1339,7 +1340,7 @@ func (store *Store) LookupID(ctx context.Context, ts *types.TipSet, addr address // ResolveToKeyAddr get key address of specify address. //if ths addr is bls/secpk address, return directly, other get the pubkey and generate address func (store *Store) ResolveToKeyAddr(ctx context.Context, ts *types.TipSet, addr address.Address) (address.Address, error) { - st, err := store.StateView(ts) + st, err := store.StateView(ctx, ts) if err != nil { return address.Undef, errors.Wrap(err, "failed to load latest state") } @@ -1348,11 +1349,11 @@ func (store *Store) ResolveToKeyAddr(ctx context.Context, ts *types.TipSet, addr } // StateView return state view at ts epoch -func (store *Store) StateView(ts *types.TipSet) (*state.View, error) { +func (store *Store) StateView(ctx context.Context, ts *types.TipSet) (*state.View, error) { if ts == nil { ts = store.head } - root, err := store.GetTipSetStateRoot(ts) + root, err := store.GetTipSetStateRoot(ctx, ts) if err != nil { return nil, errors.Wrapf(err, "failed to get state root for %s", ts.Key().String()) } @@ -1361,11 +1362,11 @@ func (store *Store) StateView(ts *types.TipSet) (*state.View, error) { } // AccountView return account view at ts state -func (store *Store) AccountView(ts *types.TipSet) (state.AccountView, error) { +func (store *Store) AccountView(ctx context.Context, ts *types.TipSet) (state.AccountView, error) { if ts == nil { ts = store.head } - root, err := store.GetTipSetStateRoot(ts) + root, err := store.GetTipSetStateRoot(ctx, ts) if err != nil { return nil, errors.Wrapf(err, "failed to get state root for %s", ts.Key().String()) } diff --git a/pkg/chain/store_test.go b/pkg/chain/store_test.go index e0e2bb1f9f..d9c5e159cf 100644 --- a/pkg/chain/store_test.go +++ b/pkg/chain/store_test.go @@ -47,7 +47,7 @@ func newChainStore(r repo.Repo, genTS *types.TipSet) *CborBlockStore { // requirePutTestChain puts the count tipsets preceding head in the source to // the input chain store. func requirePutTestChain(ctx context.Context, t *testing.T, cborStore *CborBlockStore, head types.TipSetKey, source *chain.Builder, count int) { - tss := source.RequireTipSets(head, count) + tss := source.RequireTipSets(ctx, head, count) for _, ts := range tss { tsas := &chain.TipSetMetadata{ TipSet: ts, @@ -103,10 +103,10 @@ func TestGetByKey(t *testing.T) { cs := newChainStore(r, genTS) // Construct test chain data - link1 := builder.AppendOn(genTS, 2) - link2 := builder.AppendOn(link1, 3) - link3 := builder.AppendOn(link2, 1) - link4 := builder.BuildOn(link3, 2, func(bb *chain.BlockBuilder, i int) { bb.IncHeight(2) }) + link1 := builder.AppendOn(ctx, genTS, 2) + link2 := builder.AppendOn(ctx, link1, 3) + link3 := builder.AppendOn(ctx, link2, 1) + link4 := builder.BuildOn(ctx, link3, 2, func(bb *chain.BlockBuilder, i int) { bb.IncHeight(2) }) // Put the test chain to the store requirePutTestChain(ctx, t, cs, link4.Key(), builder, 5) @@ -148,16 +148,16 @@ func TestRevertChange(t *testing.T) { cs := newChainStore(builder.Repo(), genTS) genesis := builder.Genesis() - link1 := builder.AppendOn(genesis, 1) - link2 := builder.AppendOn(link1, 1) - link3 := builder.AppendOn(link2, 1) + link1 := builder.AppendOn(ctx, genesis, 1) + link2 := builder.AppendOn(ctx, link1, 1) + link3 := builder.AppendOn(ctx, link2, 1) err := cs.SetHead(ctx, link3) require.NoError(t, err) - link4 := builder.AppendOn(genesis, 2) - link5 := builder.AppendOn(link4, 2) - link6 := builder.AppendOn(link5, 2) + link4 := builder.AppendOn(ctx, genesis, 2) + link5 := builder.AppendOn(ctx, link4, 2) + link6 := builder.AppendOn(ctx, link5, 2) ch := cs.SubHeadChanges(ctx) currentA := <-ch @@ -211,6 +211,7 @@ func assertSetHead(t *testing.T, cborStore *CborBlockStore, ts *types.TipSet) { func TestHead(t *testing.T) { tf.UnitTest(t) + ctx := context.TODO() builder := chain.NewBuilder(t, address.Undef) genTS := builder.Genesis() r := builder.Repo() @@ -220,10 +221,10 @@ func TestHead(t *testing.T) { Store: chain.NewStore(r.ChainDatastore(), bs, genTS.At(0).Cid(), chain.NewMockCirculatingSupplyCalculator()), } // Construct test chain data - link1 := builder.AppendOn(genTS, 2) - link2 := builder.AppendOn(link1, 3) - link3 := builder.AppendOn(link2, 1) - link4 := builder.BuildOn(link3, 2, func(bb *chain.BlockBuilder, i int) { bb.IncHeight(2) }) + link1 := builder.AppendOn(ctx, genTS, 2) + link2 := builder.AppendOn(ctx, link1, 3) + link3 := builder.AppendOn(ctx, link2, 1) + link4 := builder.BuildOn(ctx, link3, 2, func(bb *chain.BlockBuilder, i int) { bb.IncHeight(2) }) // Head starts as an empty cid set assert.Equal(t, types.UndefTipSet, cs.GetHead()) @@ -258,10 +259,10 @@ func TestHeadEvents(t *testing.T) { genTS := builder.Genesis() chainStore := newChainStore(builder.Repo(), genTS) // Construct test chain data - link1 := builder.AppendOn(genTS, 2) - link2 := builder.AppendOn(link1, 3) - link3 := builder.AppendOn(link2, 1) - link4 := builder.BuildOn(link3, 2, func(bb *chain.BlockBuilder, i int) { bb.IncHeight(2) }) + link1 := builder.AppendOn(ctx, genTS, 2) + link2 := builder.AppendOn(ctx, link1, 3) + link3 := builder.AppendOn(ctx, link2, 1) + link4 := builder.BuildOn(ctx, link3, 2, func(bb *chain.BlockBuilder, i int) { bb.IncHeight(2) }) assertSetHead(t, chainStore, genTS) @@ -315,10 +316,10 @@ func TestLoadAndReboot(t *testing.T) { cst := cbor.NewCborStore(bs) // Construct test chain data - link1 := builder.AppendOn(genTS, 2) - link2 := builder.AppendOn(link1, 3) - link3 := builder.AppendOn(link2, 1) - link4 := builder.BuildOn(link3, 2, func(bb *chain.BlockBuilder, i int) { bb.IncHeight(2) }) + link1 := builder.AppendOn(ctx, genTS, 2) + link2 := builder.AppendOn(ctx, link1, 3) + link3 := builder.AppendOn(ctx, link2, 1) + link4 := builder.BuildOn(ctx, link3, 2, func(bb *chain.BlockBuilder, i int) { bb.IncHeight(2) }) // Add blocks to blockstore requirePutBlocksToCborStore(t, cst, genTS.ToSlice()...) @@ -356,17 +357,17 @@ func TestLoadAndReboot(t *testing.T) { } func requireGetTipSet(ctx context.Context, t *testing.T, chainStore *CborBlockStore, key types.TipSetKey) *types.TipSet { - ts, err := chainStore.GetTipSet(key) + ts, err := chainStore.GetTipSet(ctx, key) require.NoError(t, err) return ts } type tipSetStateRootGetter interface { - GetTipSetStateRoot(*types.TipSet) (cid.Cid, error) + GetTipSetStateRoot(context.Context, *types.TipSet) (cid.Cid, error) } func requireGetTipSetStateRoot(ctx context.Context, t *testing.T, chainStore tipSetStateRootGetter, ts *types.TipSet) cid.Cid { - stateCid, err := chainStore.GetTipSetStateRoot(ts) + stateCid, err := chainStore.GetTipSetStateRoot(ctx, ts) require.NoError(t, err) return stateCid } diff --git a/pkg/chain/testing.go b/pkg/chain/testing.go index 66569ad8ef..5c2ec22cc7 100644 --- a/pkg/chain/testing.go +++ b/pkg/chain/testing.go @@ -256,22 +256,22 @@ func NewBuilderWithDeps(t *testing.T, miner address.Address, sb StateBuilder, st } // AppendBlockOnBlocks creates and returns a new block child of `parents`, with no messages. -func (f *Builder) AppendBlockOnBlocks(parents ...*types.BlockHeader) *types.BlockHeader { +func (f *Builder) AppendBlockOnBlocks(ctx context.Context, parents ...*types.BlockHeader) *types.BlockHeader { var tip *types.TipSet if len(parents) > 0 { tip = testhelpers.RequireNewTipSet(f.t, parents...) } - return f.AppendBlockOn(tip) + return f.AppendBlockOn(ctx, tip) } // AppendBlockOn creates and returns a new block child of `parent`, with no messages. -func (f *Builder) AppendBlockOn(parent *types.TipSet) *types.BlockHeader { - return f.Build(parent, 1, nil).At(0) +func (f *Builder) AppendBlockOn(ctx context.Context, parent *types.TipSet) *types.BlockHeader { + return f.Build(ctx, parent, 1, nil).At(0) } // AppendOn creates and returns a new `width`-block tipset child of `parents`, with no messages. -func (f *Builder) AppendOn(parent *types.TipSet, width int) *types.TipSet { - return f.Build(parent, width, nil) +func (f *Builder) AppendOn(ctx context.Context, parent *types.TipSet, width int) *types.TipSet { + return f.Build(ctx, parent, width, nil) } func (f *Builder) FlushHead(ctx context.Context) error { @@ -280,48 +280,48 @@ func (f *Builder) FlushHead(ctx context.Context) error { } // AppendManyBlocksOnBlocks appends `height` blocks to the chain. -func (f *Builder) AppendManyBlocksOnBlocks(height int, parents ...*types.BlockHeader) *types.BlockHeader { +func (f *Builder) AppendManyBlocksOnBlocks(ctx context.Context, height int, parents ...*types.BlockHeader) *types.BlockHeader { var tip *types.TipSet if len(parents) > 0 { tip = testhelpers.RequireNewTipSet(f.t, parents...) } - return f.BuildManyOn(height, tip, nil).At(0) + return f.BuildManyOn(ctx, height, tip, nil).At(0) } // AppendManyBlocksOn appends `height` blocks to the chain. -func (f *Builder) AppendManyBlocksOn(height int, parent *types.TipSet) *types.BlockHeader { - return f.BuildManyOn(height, parent, nil).At(0) +func (f *Builder) AppendManyBlocksOn(ctx context.Context, height int, parent *types.TipSet) *types.BlockHeader { + return f.BuildManyOn(ctx, height, parent, nil).At(0) } // AppendManyOn appends `height` tipsets to the chain. -func (f *Builder) AppendManyOn(height int, parent *types.TipSet) *types.TipSet { - return f.BuildManyOn(height, parent, nil) +func (f *Builder) AppendManyOn(ctx context.Context, height int, parent *types.TipSet) *types.TipSet { + return f.BuildManyOn(ctx, height, parent, nil) } // BuildOnBlock creates and returns a new block child of singleton tipset `parent`. See Build. -func (f *Builder) BuildOnBlock(parent *types.BlockHeader, build func(b *BlockBuilder)) *types.BlockHeader { +func (f *Builder) BuildOnBlock(ctx context.Context, parent *types.BlockHeader, build func(b *BlockBuilder)) *types.BlockHeader { var tip *types.TipSet if parent != nil { tip = testhelpers.RequireNewTipSet(f.t, parent) } - return f.BuildOneOn(tip, build).At(0) + return f.BuildOneOn(ctx, tip, build).At(0) } // BuildOneOn creates and returns a new single-block tipset child of `parent`. -func (f *Builder) BuildOneOn(parent *types.TipSet, build func(b *BlockBuilder)) *types.TipSet { - return f.Build(parent, 1, singleBuilder(build)) +func (f *Builder) BuildOneOn(ctx context.Context, parent *types.TipSet, build func(b *BlockBuilder)) *types.TipSet { + return f.Build(ctx, parent, 1, singleBuilder(build)) } // BuildOn creates and returns a new `width` block tipset child of `parent`. -func (f *Builder) BuildOn(parent *types.TipSet, width int, build func(b *BlockBuilder, i int)) *types.TipSet { - return f.Build(parent, width, build) +func (f *Builder) BuildOn(ctx context.Context, parent *types.TipSet, width int, build func(b *BlockBuilder, i int)) *types.TipSet { + return f.Build(ctx, parent, width, build) } // BuildManyOn builds a chain by invoking Build `height` times. -func (f *Builder) BuildManyOn(height int, parent *types.TipSet, build func(b *BlockBuilder)) *types.TipSet { +func (f *Builder) BuildManyOn(ctx context.Context, height int, parent *types.TipSet, build func(b *BlockBuilder)) *types.TipSet { require.True(f.t, height > 0, "") for i := 0; i < height; i++ { - parent = f.Build(parent, 1, singleBuilder(build)) + parent = f.Build(ctx, parent, 1, singleBuilder(build)) } return parent } @@ -331,7 +331,7 @@ func (f *Builder) BuildManyOn(height int, parent *types.TipSet, build func(b *Bl // Note: the blocks will all have the same miner, which is unrealistic and forbidden by consensus; // generalise this to random miner addresses when that is rejected by the syncer. // The `build` function is invoked to modify the block before it is stored. -func (f *Builder) Build(parent *types.TipSet, width int, build func(b *BlockBuilder, i int)) *types.TipSet { +func (f *Builder) Build(ctx context.Context, parent *types.TipSet, width int, build func(b *BlockBuilder, i int)) *types.TipSet { tip := f.BuildOrphaTipset(parent, width, build) for _, block := range tip.Blocks() { @@ -341,7 +341,7 @@ func (f *Builder) Build(parent *types.TipSet, width int, build func(b *BlockBuil } // Compute and remember state for the tipset. - stateRoot, _ := f.ComputeState(tip) + stateRoot, _ := f.ComputeState(ctx, tip) f.tipStateCids[tip.Key().String()] = stateRoot return tip } @@ -398,7 +398,7 @@ func (f *Builder) BuildOrphaTipset(parent *types.TipSet, width int, build func(b // Compute state root for this block. ctx := context.Background() - prevState := f.StateForKey(parent.Key()) + prevState := f.StateForKey(ctx, parent.Key()) smsgs, umsgs, err := f.mstore.LoadMetaMessages(ctx, b.Messages) require.NoError(f.t, err) @@ -426,29 +426,29 @@ func (f *Builder) BuildOrphaTipset(parent *types.TipSet, width int, build func(b } // StateForKey loads (or computes) the state root for a tipset key. -func (f *Builder) StateForKey(key types.TipSetKey) cid.Cid { +func (f *Builder) StateForKey(ctx context.Context, key types.TipSetKey) cid.Cid { state, found := f.tipStateCids[key.String()] if found { return state } // No state yet computed for this tip (perhaps because the blocks in it have not previously // been considered together as a tipset). - tip, err := f.GetTipSet(key) + tip, err := f.GetTipSet(ctx, key) require.NoError(f.t, err) - state, _ = f.ComputeState(tip) + state, _ = f.ComputeState(ctx, tip) return state } // GetBlockstoreValue gets data straight out of the underlying blockstore by cid func (f *Builder) GetBlockstoreValue(ctx context.Context, c cid.Cid) (blocks.Block, error) { - return f.bs.Get(c) + return f.bs.Get(ctx, c) } // ComputeState computes the state for a tipset from its parent state. -func (f *Builder) ComputeState(tip *types.TipSet) (cid.Cid, []types.MessageReceipt) { +func (f *Builder) ComputeState(ctx context.Context, tip *types.TipSet) (cid.Cid, []types.MessageReceipt) { parentKey := tip.Parents() // Load the state of the parent tipset and compute the required state (recursively). - prev := f.StateForKey(parentKey) + prev := f.StateForKey(ctx, parentKey) blockMsgInfo := f.tipMessages(tip) state, receipt, err := f.stateBuilder.ComputeState(prev, blockMsgInfo) require.NoError(f.t, err) @@ -652,7 +652,7 @@ func (e *FakeStateEvaluator) RunStateTransition(ctx context.Context, ts *types.T return cid.Undef, cid.Undef, ctx.Err() } } - if m, _ := e.ChainStore.LoadTipsetMetadata(ts); m != nil { + if m, _ := e.ChainStore.LoadTipsetMetadata(ctx, ts); m != nil { e.stLk.Unlock() return m.TipSetStateRoot, m.TipSetReceipts, nil } @@ -695,7 +695,7 @@ func (e *FakeStateEvaluator) RunStateTransition(ctx context.Context, ts *types.T } func (e *FakeStateEvaluator) ValidateFullBlock(ctx context.Context, blk *types.BlockHeader) error { - parent, err := e.ChainStore.GetTipSet(types.NewTipSetKey(blk.Parents...)) + parent, err := e.ChainStore.GetTipSet(ctx, types.NewTipSetKey(blk.Parents...)) if err != nil { return err } @@ -762,8 +762,7 @@ func (f *Builder) GetBlocksByIds(ctx context.Context, cids []cid.Cid) ([]*types. } // GetTipSet returns the tipset identified by `key`. -func (f *Builder) GetTipSet(key types.TipSetKey) (*types.TipSet, error) { - ctx := context.Background() +func (f *Builder) GetTipSet(ctx context.Context, key types.TipSetKey) (*types.TipSet, error) { var blocks []*types.BlockHeader for _, bid := range key.Cids() { var blk types.BlockHeader @@ -779,7 +778,7 @@ func (f *Builder) GetTipSet(key types.TipSetKey) (*types.TipSet, error) { func (f *Builder) FetchTipSets(ctx context.Context, key types.TipSetKey, from peer.ID, done func(t *types.TipSet) (bool, error)) ([]*types.TipSet, error) { var tips []*types.TipSet for { - tip, err := f.GetTipSet(key) + tip, err := f.GetTipSet(ctx, key) if err != nil { return nil, err } @@ -819,7 +818,7 @@ func (f *Builder) GetTipSetByHeight(ctx context.Context, ts *types.TipSet, h abi } for { - ts = f.RequireTipSet(ts.Parents()) + ts = f.RequireTipSet(ctx, ts.Parents()) height := ts.Height() if height >= 0 && height == h { return ts, nil @@ -830,17 +829,17 @@ func (f *Builder) GetTipSetByHeight(ctx context.Context, ts *types.TipSet, h abi } // RequireTipSet returns a tipset by key, which must exist. -func (f *Builder) RequireTipSet(key types.TipSetKey) *types.TipSet { - tip, err := f.GetTipSet(key) +func (f *Builder) RequireTipSet(ctx context.Context, key types.TipSetKey) *types.TipSet { + tip, err := f.GetTipSet(ctx, key) require.NoError(f.t, err) return tip } // RequireTipSets returns a chain of tipsets from key, which must exist and be long enough. -func (f *Builder) RequireTipSets(head types.TipSetKey, count int) []*types.TipSet { +func (f *Builder) RequireTipSets(ctx context.Context, head types.TipSetKey, count int) []*types.TipSet { var tips []*types.TipSet for i := 0; i < count; i++ { - tip := f.RequireTipSet(head) + tip := f.RequireTipSet(ctx, head) tips = append(tips, tip) head = tip.Parents() } @@ -867,12 +866,12 @@ func (f *Builder) StoreTxMeta(ctx context.Context, meta types.MessageRoot) (cid. return f.mstore.StoreTxMeta(ctx, meta) } -func (f *Builder) LoadUnsignedMessagesFromCids(blsCids []cid.Cid) ([]*types.Message, error) { - return f.mstore.LoadUnsignedMessagesFromCids(blsCids) +func (f *Builder) LoadUnsignedMessagesFromCids(ctx context.Context, blsCids []cid.Cid) ([]*types.Message, error) { + return f.mstore.LoadUnsignedMessagesFromCids(ctx, blsCids) } -func (f *Builder) LoadSignedMessagesFromCids(secpCids []cid.Cid) ([]*types.SignedMessage, error) { - return f.mstore.LoadSignedMessagesFromCids(secpCids) +func (f *Builder) LoadSignedMessagesFromCids(ctx context.Context, secpCids []cid.Cid) ([]*types.SignedMessage, error) { + return f.mstore.LoadSignedMessagesFromCids(ctx, secpCids) } // LoadMessages returns the message collections tracked by the builder. @@ -886,7 +885,7 @@ func (f *Builder) ReadMsgMetaCids(ctx context.Context, metaCid cid.Cid) ([]cid.C // /// exchange ///// func (f *Builder) GetBlocks(ctx context.Context, tsk types.TipSetKey, count int) ([]*types.TipSet, error) { - ts, err := f.GetTipSet(tsk) + ts, err := f.GetTipSet(ctx, tsk) if err != nil { return nil, err } @@ -895,7 +894,7 @@ func (f *Builder) GetBlocks(ctx context.Context, tsk types.TipSetKey, count int) if ts.Height() == 0 { break } - ts, err = f.GetTipSet(ts.Parents()) + ts, err = f.GetTipSet(ctx, ts.Parents()) if err != nil { return nil, err } @@ -907,7 +906,7 @@ func (f *Builder) GetBlocks(ctx context.Context, tsk types.TipSetKey, count int) func (f *Builder) GetChainMessages(ctx context.Context, tipsets []*types.TipSet) ([]*exchange.CompactedMessages, error) { result := []*exchange.CompactedMessages{} for _, ts := range tipsets { - bmsgs, bmincl, smsgs, smincl, err := exchange.GatherMessages(f, f.mstore, ts) + bmsgs, bmincl, smsgs, smincl, err := exchange.GatherMessages(ctx, f, f.mstore, ts) if err != nil { return nil, err } @@ -932,11 +931,11 @@ func (f *Builder) GeneratorGenesis() *types.TipSet { require.NoError(f.t, err) source := ioutil.NopCloser(bytes.NewReader(b)) - ch, err := car.LoadCar(f.bs, source) + ch, err := car.LoadCar(context.Background(), f.bs, source) require.NoError(f.t, err) // need to check if we are being handed a car file with a single genesis block or an entire chain. - bsBlk, err := f.bs.Get(ch.Roots[0]) + bsBlk, err := f.bs.Get(context.Background(), ch.Roots[0]) require.NoError(f.t, err) cur, err := types.DecodeBlock(bsBlk.RawData()) diff --git a/pkg/chain/tip_index.go b/pkg/chain/tip_index.go index 53a09e699a..d1c0fbb99e 100644 --- a/pkg/chain/tip_index.go +++ b/pkg/chain/tip_index.go @@ -1,6 +1,7 @@ package chain import ( + "context" "fmt" "sync" @@ -32,8 +33,8 @@ type TipSetMetadata struct { } type tipLoader interface { - GetTipSet(key types.TipSetKey) (*types.TipSet, error) - LoadTipsetMetadata(ts *types.TipSet) (*TipSetMetadata, error) + GetTipSet(ctx context.Context, key types.TipSetKey) (*types.TipSet, error) + LoadTipsetMetadata(ctx context.Context, ts *types.TipSet) (*TipSetMetadata, error) } // TipStateCache tracks tipsets and their states by tipset block ids. @@ -68,12 +69,12 @@ func (ti *TipStateCache) Put(tsm *TipSetMetadata) { } // Get returns the tipset given by the input ID and its state. -func (ti *TipStateCache) Get(ts *types.TipSet) (TSState, error) { +func (ti *TipStateCache) Get(ctx context.Context, ts *types.TipSet) (TSState, error) { ti.l.RLock() state, ok := ti.cache[ts.String()] ti.l.RUnlock() if !ok { - tipSetMetadata, err := ti.loader.LoadTipsetMetadata(ts) + tipSetMetadata, err := ti.loader.LoadTipsetMetadata(ctx, ts) if err != nil { return TSState{}, xerrors.New("state not exit") } @@ -88,8 +89,8 @@ func (ti *TipStateCache) Get(ts *types.TipSet) (TSState, error) { } // GetTipSetStateRoot returns the tipsetStateRoot from func (ti *TipStateCache) Get(tsKey string). -func (ti *TipStateCache) GetTipSetStateRoot(ts *types.TipSet) (cid.Cid, error) { - state, err := ti.Get(ts) +func (ti *TipStateCache) GetTipSetStateRoot(ctx context.Context, ts *types.TipSet) (cid.Cid, error) { + state, err := ti.Get(ctx, ts) if err != nil { return cid.Cid{}, err } @@ -97,8 +98,8 @@ func (ti *TipStateCache) GetTipSetStateRoot(ts *types.TipSet) (cid.Cid, error) { } // GetTipSetReceiptsRoot returns the tipsetReceipts from func (ti *TipStateCache) Get(tsKey string). -func (ti *TipStateCache) GetTipSetReceiptsRoot(ts *types.TipSet) (cid.Cid, error) { - state, err := ti.Get(ts) +func (ti *TipStateCache) GetTipSetReceiptsRoot(ctx context.Context, ts *types.TipSet) (cid.Cid, error) { + state, err := ti.Get(ctx, ts) if err != nil { return cid.Cid{}, err } @@ -107,8 +108,8 @@ func (ti *TipStateCache) GetTipSetReceiptsRoot(ts *types.TipSet) (cid.Cid, error // Has returns true iff the tipset with the input ID is stored in // the TipStateCache. -func (ti *TipStateCache) Has(ts *types.TipSet) bool { - _, err := ti.Get(ts) +func (ti *TipStateCache) Has(ctx context.Context, ts *types.TipSet) bool { + _, err := ti.Get(ctx, ts) return err == nil } diff --git a/pkg/chain/traversal.go b/pkg/chain/traversal.go index 34b886c505..e3580ca3a1 100644 --- a/pkg/chain/traversal.go +++ b/pkg/chain/traversal.go @@ -11,7 +11,7 @@ import ( // TipSetProvider provides tipsets for traversal. type TipSetProvider interface { - GetTipSet(tsKey types.TipSetKey) (*types.TipSet, error) + GetTipSet(ctx context.Context, tsKey types.TipSetKey) (*types.TipSet, error) } // IterAncestors returns an iterator over tipset ancestors, yielding first the start tipset and @@ -38,7 +38,7 @@ func (it *TipsetIterator) Complete() bool { } // Next advances the iterator to the next value. -func (it *TipsetIterator) Next() error { +func (it *TipsetIterator) Next(ctx context.Context) error { select { case <-it.ctx.Done(): return it.ctx.Err() @@ -48,7 +48,7 @@ func (it *TipsetIterator) Next() error { } else { var err error parentKey := it.value.Parents() - it.value, err = it.store.GetTipSet(parentKey) + it.value, err = it.store.GetTipSet(ctx, parentKey) return err } return nil @@ -86,7 +86,7 @@ func TipSetProviderFromBlocks(ctx context.Context, blocks BlockProvider) TipSetP } // GetTipSet loads the blocks for a tipset. -func (p *tipsetFromBlockProvider) GetTipSet(tsKey types.TipSetKey) (*types.TipSet, error) { +func (p *tipsetFromBlockProvider) GetTipSet(ctx context.Context, tsKey types.TipSetKey) (*types.TipSet, error) { return LoadTipSetBlocks(p.ctx, p.blocks, tsKey) } @@ -97,7 +97,7 @@ func CollectTipsToCommonAncestor(ctx context.Context, store TipSetProvider, oldH oldIter := IterAncestors(ctx, store, oldHead) newIter := IterAncestors(ctx, store, newHead) - commonAncestor, err := FindCommonAncestor(oldIter, newIter) + commonAncestor, err := FindCommonAncestor(ctx, oldIter, newIter) if err != nil { return } @@ -123,7 +123,7 @@ var ErrNoCommonAncestor = errors.New("no common ancestor") // FindCommonAncestor returns the common ancestor of the two tipsets pointed to // by the input iterators. If they share no common ancestor ErrNoCommonAncestor // will be returned. -func FindCommonAncestor(leftIter, rightIter *TipsetIterator) (*types.TipSet, error) { +func FindCommonAncestor(ctx context.Context, leftIter, rightIter *TipsetIterator) (*types.TipSet, error) { for !rightIter.Complete() && !leftIter.Complete() { left := leftIter.Value() right := rightIter.Value() @@ -140,13 +140,13 @@ func FindCommonAncestor(leftIter, rightIter *TipsetIterator) (*types.TipSet, err // point to a tipset at the same height or higher than the // other pointer's tipset. if rightHeight >= leftHeight { - if err := rightIter.Next(); err != nil { + if err := rightIter.Next(ctx); err != nil { return nil, err } } if leftHeight >= rightHeight { - if err := leftIter.Next(); err != nil { + if err := leftIter.Next(ctx); err != nil { return nil, err } } @@ -160,7 +160,7 @@ func CollectTipSetsOfHeightAtLeast(ctx context.Context, iterator *TipsetIterator var ret []*types.TipSet var err error var h abi.ChainEpoch - for ; !iterator.Complete(); err = iterator.Next() { + for ; !iterator.Complete(); err = iterator.Next(ctx) { if err != nil { return nil, err } @@ -177,7 +177,7 @@ func CollectTipSetsOfHeightAtLeast(ctx context.Context, iterator *TipsetIterator func FindLatestDRAND(ctx context.Context, start *types.TipSet, reader TipSetProvider) (*types.BeaconEntry, error) { iterator := IterAncestors(ctx, reader, start) var err error - for ; !iterator.Complete(); err = iterator.Next() { + for ; !iterator.Complete(); err = iterator.Next(ctx) { if err != nil { return nil, err } diff --git a/pkg/chain/traversal_test.go b/pkg/chain/traversal_test.go index 56f11fd6a0..f2732921a7 100644 --- a/pkg/chain/traversal_test.go +++ b/pkg/chain/traversal_test.go @@ -25,10 +25,10 @@ func TestIterAncestors(t *testing.T) { ctx := context.Background() store := chain.NewBuilder(t, miner) - root := store.AppendBlockOnBlocks() - b11 := store.AppendBlockOnBlocks(root) - b12 := store.AppendBlockOnBlocks(root) - b21 := store.AppendBlockOnBlocks(b11, b12) + root := store.AppendBlockOnBlocks(ctx) + b11 := store.AppendBlockOnBlocks(ctx, root) + b12 := store.AppendBlockOnBlocks(ctx, root) + b21 := store.AppendBlockOnBlocks(ctx, b11, b12) t0 := testhelpers.RequireNewTipSet(t, root) t1 := testhelpers.RequireNewTipSet(t, b11, b12) @@ -38,15 +38,15 @@ func TestIterAncestors(t *testing.T) { assert.False(t, it.Complete()) assert.True(t, t2.Equals(it.Value())) - assert.NoError(t, it.Next()) + assert.NoError(t, it.Next(ctx)) assert.False(t, it.Complete()) assert.True(t, t1.Equals(it.Value())) - assert.NoError(t, it.Next()) + assert.NoError(t, it.Next(ctx)) assert.False(t, it.Complete()) assert.True(t, t0.Equals(it.Value())) - assert.NoError(t, it.Next()) + assert.NoError(t, it.Next(ctx)) assert.True(t, it.Complete()) }) @@ -54,10 +54,10 @@ func TestIterAncestors(t *testing.T) { ctx, cancel := context.WithCancel(context.Background()) store := chain.NewBuilder(t, miner) - root := store.AppendBlockOnBlocks() - b11 := store.AppendBlockOnBlocks(root) - b12 := store.AppendBlockOnBlocks(root) - b21 := store.AppendBlockOnBlocks(b11, b12) + root := store.AppendBlockOnBlocks(ctx) + b11 := store.AppendBlockOnBlocks(ctx, root) + b12 := store.AppendBlockOnBlocks(ctx, root) + b21 := store.AppendBlockOnBlocks(ctx, b11, b12) testhelpers.RequireNewTipSet(t, root) t1 := testhelpers.RequireNewTipSet(t, b11, b12) @@ -67,13 +67,13 @@ func TestIterAncestors(t *testing.T) { assert.False(t, it.Complete()) assert.True(t, t2.Equals(it.Value())) - assert.NoError(t, it.Next()) + assert.NoError(t, it.Next(ctx)) assert.False(t, it.Complete()) assert.True(t, t1.Equals(it.Value())) cancel() - assert.Error(t, it.Next()) + assert.Error(t, it.Next(ctx)) }) } @@ -84,7 +84,7 @@ func TestCollectTipSetsOfHeightAtLeast(t *testing.T) { builder := chain.NewBuilder(t, address.Undef) chainLen := 15 - head := builder.AppendManyOn(chainLen, types.UndefTipSet) + head := builder.AppendManyOn(ctx, chainLen, types.UndefTipSet) stopHeight := abi.ChainEpoch(4) iterator := chain.IterAncestors(ctx, builder, head) @@ -104,7 +104,7 @@ func TestCollectTipSetsOfHeightAtLeastZero(t *testing.T) { builder := chain.NewBuilder(t, address.Undef) chainLen := 25 - head := builder.AppendManyOn(chainLen, types.UndefTipSet) + head := builder.AppendManyOn(ctx, chainLen, types.UndefTipSet) stopHeight := abi.ChainEpoch(0) iterator := chain.IterAncestors(ctx, builder, head) @@ -125,15 +125,15 @@ func TestCollectTipSetsOfHeightAtLeastStartingEpochIsNull(t *testing.T) { head := builder.Genesis() // Add 30 tipsets to the head of the chainStore. - head = builder.AppendManyOn(30, head) + head = builder.AppendManyOn(ctx, 30, head) // Now add 10 null blocks and 1 tipset. - head = builder.BuildOneOn(head, func(b *chain.BlockBuilder) { + head = builder.BuildOneOn(ctx, head, func(b *chain.BlockBuilder) { b.IncHeight(10) }) // Now add 19 more tipsets. - head = builder.AppendManyOn(19, head) + head = builder.AppendManyOn(ctx, 19, head) stopHeight := abi.ChainEpoch(35) iterator := chain.IterAncestors(ctx, builder, head) @@ -152,10 +152,10 @@ func TestFindCommonAncestorSameChain(t *testing.T) { builder := chain.NewBuilder(t, address.Undef) head := builder.Genesis() // Add 30 tipsets to the head of the chainStore. - head = builder.AppendManyOn(30, head) + head = builder.AppendManyOn(ctx, 30, head) headIterOne := chain.IterAncestors(ctx, builder, head) headIterTwo := chain.IterAncestors(ctx, builder, head) - commonAncestor, err := chain.FindCommonAncestor(headIterOne, headIterTwo) + commonAncestor, err := chain.FindCommonAncestor(ctx, headIterOne, headIterTwo) assert.NoError(t, err) assert.Equal(t, head, commonAncestor) } @@ -167,19 +167,19 @@ func TestFindCommonAncestorFork(t *testing.T) { head := builder.Genesis() // Add 3 tipsets to the head of the chainStore. - commonHeadTip := builder.AppendManyOn(3, head) + commonHeadTip := builder.AppendManyOn(ctx, 3, head) // Grow the fork chain lenFork := 10 - forkHead := builder.AppendManyOn(lenFork, commonHeadTip) + forkHead := builder.AppendManyOn(ctx, lenFork, commonHeadTip) // Grow the main chain lenMainChain := 14 - mainHead := builder.AppendManyOn(lenMainChain, commonHeadTip) + mainHead := builder.AppendManyOn(ctx, lenMainChain, commonHeadTip) forkItr := chain.IterAncestors(ctx, builder, forkHead) mainItr := chain.IterAncestors(ctx, builder, mainHead) - commonAncestor, err := chain.FindCommonAncestor(mainItr, forkItr) + commonAncestor, err := chain.FindCommonAncestor(ctx, mainItr, forkItr) assert.NoError(t, err) assert.ObjectsAreEqualValues(commonHeadTip, commonAncestor) } @@ -191,15 +191,15 @@ func TestFindCommonAncestorNoFork(t *testing.T) { head := builder.Genesis() // Add 30 tipsets to the head of the chainStore. - head = builder.AppendManyOn(30, head) + head = builder.AppendManyOn(ctx, 30, head) headIterOne := chain.IterAncestors(ctx, builder, head) // Now add 19 more tipsets. expectedAncestor := head - head = builder.AppendManyOn(19, head) + head = builder.AppendManyOn(ctx, 19, head) headIterTwo := chain.IterAncestors(ctx, builder, head) - commonAncestor, err := chain.FindCommonAncestor(headIterOne, headIterTwo) + commonAncestor, err := chain.FindCommonAncestor(ctx, headIterOne, headIterTwo) assert.NoError(t, err) assert.True(t, expectedAncestor.Equals(commonAncestor)) } @@ -213,19 +213,19 @@ func TestFindCommonAncestorNullBlockFork(t *testing.T) { head := builder.Genesis() // Add 10 tipsets to the head of the chainStore. - commonHead := builder.AppendManyOn(10, head) + commonHead := builder.AppendManyOn(ctx, 10, head) // From the common ancestor, add a block following a null block. - headAfterNull := builder.BuildOneOn(commonHead, func(b *chain.BlockBuilder) { + headAfterNull := builder.BuildOneOn(ctx, commonHead, func(b *chain.BlockBuilder) { b.IncHeight(1) }) afterNullItr := chain.IterAncestors(ctx, builder, headAfterNull) // Add a block (with no null) on another fork. - headNoNull := builder.AppendOn(commonHead, 1) + headNoNull := builder.AppendOn(ctx, commonHead, 1) noNullItr := chain.IterAncestors(ctx, builder, headNoNull) - commonAncestor, err := chain.FindCommonAncestor(afterNullItr, noNullItr) + commonAncestor, err := chain.FindCommonAncestor(ctx, afterNullItr, noNullItr) assert.NoError(t, err) assert.ObjectsAreEqualValues(commonHead, commonAncestor) } diff --git a/pkg/chain/utils.go b/pkg/chain/utils.go index 1fa8f27b38..8362cf6bd4 100644 --- a/pkg/chain/utils.go +++ b/pkg/chain/utils.go @@ -1,6 +1,7 @@ package chain import ( + "context" "reflect" "runtime" "strings" @@ -108,13 +109,13 @@ type storable interface { ToStorageBlock() (blockFormat.Block, error) } -func PutMessage(bs blockstoreutil.Blockstore, m storable) (cid.Cid, error) { +func PutMessage(ctx context.Context, bs blockstoreutil.Blockstore, m storable) (cid.Cid, error) { b, err := m.ToStorageBlock() if err != nil { return cid.Undef, err } - if err := bs.Put(b); err != nil { + if err := bs.Put(ctx, b); err != nil { return cid.Undef, err } diff --git a/pkg/chain/waiter.go b/pkg/chain/waiter.go index 0d29d2fb03..50dc1b86d9 100644 --- a/pkg/chain/waiter.go +++ b/pkg/chain/waiter.go @@ -27,10 +27,10 @@ type MsgLookup struct { // Abstracts over a store of blockchain state. type waiterChainReader interface { GetHead() *types.TipSet - GetTipSet(types.TipSetKey) (*types.TipSet, error) + GetTipSet(context.Context, types.TipSetKey) (*types.TipSet, error) LookupID(context.Context, *types.TipSet, address.Address) (address.Address, error) GetActorAt(context.Context, *types.TipSet, address.Address) (*types.Actor, error) - GetTipSetReceiptsRoot(*types.TipSet) (cid.Cid, error) + GetTipSetReceiptsRoot(context.Context, *types.TipSet) (cid.Cid, error) SubHeadChanges(context.Context) chan []*apitypes.HeadChange } @@ -137,12 +137,12 @@ func (w *Waiter) findMessage(ctx context.Context, from *types.TipSet, m types.Ch return nil, false, nil } - pts, err := w.chainReader.GetTipSet(cur.Parents()) + pts, err := w.chainReader.GetTipSet(ctx, cur.Parents()) if err != nil { return nil, false, xerrors.Errorf("failed to load tipset during msg wait searchback: %w", err) } - grandParent, err := w.chainReader.GetTipSet(pts.Parents()) + grandParent, err := w.chainReader.GetTipSet(ctx, pts.Parents()) if err != nil { return nil, false, xerrors.Errorf("failed to load tipset during msg wait searchback: %w", err) } @@ -279,7 +279,7 @@ func (w *Waiter) receiptForTipset(ctx context.Context, ts *types.TipSet, msg typ return nil, false, nil } - pts, err := w.chainReader.GetTipSet(ts.Parents()) + pts, err := w.chainReader.GetTipSet(ctx, ts.Parents()) if err != nil { return nil, false, err } diff --git a/pkg/chainsync/exchange/server.go b/pkg/chainsync/exchange/server.go index 85e82119fa..4ffd3d0305 100644 --- a/pkg/chainsync/exchange/server.go +++ b/pkg/chainsync/exchange/server.go @@ -22,14 +22,14 @@ import ( var exchangeServerLog = logging.Logger("exchange.server") type chainReader interface { - GetTipSet(types.TipSetKey) (*types.TipSet, error) + GetTipSet(context.Context, types.TipSetKey) (*types.TipSet, error) } type messageStore interface { ReadMsgMetaCids(ctx context.Context, mmc cid.Cid) ([]cid.Cid, []cid.Cid, error) - LoadUnsignedMessagesFromCids(cids []cid.Cid) ([]*types.Message, error) - LoadSignedMessagesFromCids(cids []cid.Cid) ([]*types.SignedMessage, error) + LoadUnsignedMessagesFromCids(ctx context.Context, cids []cid.Cid) ([]*types.Message, error) + LoadSignedMessagesFromCids(ctx context.Context, cids []cid.Cid) ([]*types.SignedMessage, error) } // server implements exchange.Server. It services requests for the @@ -157,7 +157,7 @@ func (s *server) serviceRequest(ctx context.Context, req *validatedRequest) (*Re _, span := trace.StartSpan(ctx, "chainxchg.ServiceRequest") defer span.End() - chain, err := collectChainSegment(s.cr, s.mr, req) + chain, err := collectChainSegment(ctx, s.cr, s.mr, req) if err != nil { exchangeServerLog.Warn("block sync request: collectChainSegment failed: ", err) return &Response{ @@ -177,13 +177,13 @@ func (s *server) serviceRequest(ctx context.Context, req *validatedRequest) (*Re }, nil } -func collectChainSegment(cr chainReader, mr messageStore, req *validatedRequest) ([]*BSTipSet, error) { +func collectChainSegment(ctx context.Context, cr chainReader, mr messageStore, req *validatedRequest) ([]*BSTipSet, error) { var bstips []*BSTipSet cur := req.head for { var bst BSTipSet - ts, err := cr.GetTipSet(cur) + ts, err := cr.GetTipSet(ctx, cur) if err != nil { return nil, xerrors.Errorf("failed loading tipset %s: %w", cur, err) } @@ -193,7 +193,7 @@ func collectChainSegment(cr chainReader, mr messageStore, req *validatedRequest) } if req.options.IncludeMessages { - bmsgs, bmincl, smsgs, smincl, err := GatherMessages(cr, mr, ts) + bmsgs, bmincl, smsgs, smincl, err := GatherMessages(ctx, cr, mr, ts) if err != nil { return nil, xerrors.Errorf("gather messages failed: %w", err) } @@ -218,7 +218,7 @@ func collectChainSegment(cr chainReader, mr messageStore, req *validatedRequest) } } -func GatherMessages(cr chainReader, mr messageStore, ts *types.TipSet) ([]*types.Message, [][]uint64, []*types.SignedMessage, [][]uint64, error) { +func GatherMessages(ctx context.Context, cr chainReader, mr messageStore, ts *types.TipSet) ([]*types.Message, [][]uint64, []*types.SignedMessage, [][]uint64, error) { blsmsgmap := make(map[cid.Cid]uint64) secpkmsgmap := make(map[cid.Cid]uint64) var secpkincl, blsincl [][]uint64 @@ -258,12 +258,12 @@ func GatherMessages(cr chainReader, mr messageStore, ts *types.TipSet) ([]*types secpkincl = append(secpkincl, smi) } - blsmsgs, err := mr.LoadUnsignedMessagesFromCids(blscids) + blsmsgs, err := mr.LoadUnsignedMessagesFromCids(ctx, blscids) if err != nil { return nil, nil, nil, nil, err } - secpkmsgs, err := mr.LoadSignedMessagesFromCids(secpkcids) + secpkmsgs, err := mr.LoadSignedMessagesFromCids(ctx, secpkcids) if err != nil { return nil, nil, nil, nil, err } diff --git a/pkg/chainsync/slashfilter/mysqldb.go b/pkg/chainsync/slashfilter/mysqldb.go index 7735011371..d0932e3d31 100644 --- a/pkg/chainsync/slashfilter/mysqldb.go +++ b/pkg/chainsync/slashfilter/mysqldb.go @@ -1,6 +1,7 @@ package slashfilter import ( + "context" "time" "github.com/filecoin-project/go-state-types/abi" @@ -107,7 +108,7 @@ func (f *MysqlSlashFilter) checkSameParentFault(bh *types.BlockHeader) error { } //MinedBlock check whether the block mined is slash -func (f *MysqlSlashFilter) MinedBlock(bh *types.BlockHeader, parentEpoch abi.ChainEpoch) error { +func (f *MysqlSlashFilter) MinedBlock(ctx context.Context, bh *types.BlockHeader, parentEpoch abi.ChainEpoch) error { if err := f.checkSameHeightFault(bh); err != nil { return err } diff --git a/pkg/chainsync/slashfilter/slashfilter.go b/pkg/chainsync/slashfilter/slashfilter.go index 9b7b52a1ff..f25bf2f6b2 100644 --- a/pkg/chainsync/slashfilter/slashfilter.go +++ b/pkg/chainsync/slashfilter/slashfilter.go @@ -1,6 +1,7 @@ package slashfilter import ( + "context" "fmt" "golang.org/x/xerrors" @@ -15,7 +16,7 @@ import ( //ISlashFilter used to detect whether the miner mined a invalidated block , support local db and mysql storage type ISlashFilter interface { - MinedBlock(bh *types.BlockHeader, parentEpoch abi.ChainEpoch) error + MinedBlock(ctx context.Context, bh *types.BlockHeader, parentEpoch abi.ChainEpoch) error } //LocalSlashFilter use badger db to save mined block for detect slash consensus block @@ -33,11 +34,11 @@ func NewLocalSlashFilter(dstore ds.Batching) ISlashFilter { } //MinedBlock check whether the block mined is slash -func (f *LocalSlashFilter) MinedBlock(bh *types.BlockHeader, parentEpoch abi.ChainEpoch) error { +func (f *LocalSlashFilter) MinedBlock(ctx context.Context, bh *types.BlockHeader, parentEpoch abi.ChainEpoch) error { epochKey := ds.NewKey(fmt.Sprintf("/%s/%d", bh.Miner, bh.Height)) { // double-fork mining (2 blocks at one epoch) - if err := checkFault(f.byEpoch, epochKey, bh, "double-fork mining faults"); err != nil { + if err := checkFault(ctx, f.byEpoch, epochKey, bh, "double-fork mining faults"); err != nil { return err } } @@ -45,7 +46,7 @@ func (f *LocalSlashFilter) MinedBlock(bh *types.BlockHeader, parentEpoch abi.Cha parentsKey := ds.NewKey(fmt.Sprintf("/%s/%s", bh.Miner, types.NewTipSetKey(bh.Parents...).String())) { // time-offset mining faults (2 blocks with the same parents) - if err := checkFault(f.byParents, parentsKey, bh, "time-offset mining faults"); err != nil { + if err := checkFault(ctx, f.byParents, parentsKey, bh, "time-offset mining faults"); err != nil { return err } } @@ -55,14 +56,14 @@ func (f *LocalSlashFilter) MinedBlock(bh *types.BlockHeader, parentEpoch abi.Cha // First check if we have mined a block on the parent epoch parentEpochKey := ds.NewKey(fmt.Sprintf("/%s/%d", bh.Miner, parentEpoch)) - have, err := f.byEpoch.Has(parentEpochKey) + have, err := f.byEpoch.Has(ctx, parentEpochKey) if err != nil { return err } if have { // If we had, make sure it's in our parent tipset - cidb, err := f.byEpoch.Get(parentEpochKey) + cidb, err := f.byEpoch.Get(ctx, parentEpochKey) if err != nil { return xerrors.Errorf("getting other block cid: %w", err) } @@ -85,25 +86,25 @@ func (f *LocalSlashFilter) MinedBlock(bh *types.BlockHeader, parentEpoch abi.Cha } } - if err := f.byParents.Put(parentsKey, bh.Cid().Bytes()); err != nil { + if err := f.byParents.Put(ctx, parentsKey, bh.Cid().Bytes()); err != nil { return xerrors.Errorf("putting byEpoch entry: %w", err) } - if err := f.byEpoch.Put(epochKey, bh.Cid().Bytes()); err != nil { + if err := f.byEpoch.Put(ctx, epochKey, bh.Cid().Bytes()); err != nil { return xerrors.Errorf("putting byEpoch entry: %w", err) } return nil } -func checkFault(t ds.Datastore, key ds.Key, bh *types.BlockHeader, faultType string) error { - fault, err := t.Has(key) +func checkFault(ctx context.Context, t ds.Datastore, key ds.Key, bh *types.BlockHeader, faultType string) error { + fault, err := t.Has(ctx, key) if err != nil { return err } if fault { - cidb, err := t.Get(key) + cidb, err := t.Get(ctx, key) if err != nil { return xerrors.Errorf("getting other block cid: %w", err) } diff --git a/pkg/chainsync/syncer/syncer.go b/pkg/chainsync/syncer/syncer.go index 888b0cb716..f5c0f49a00 100644 --- a/pkg/chainsync/syncer/syncer.go +++ b/pkg/chainsync/syncer/syncer.go @@ -84,14 +84,14 @@ type BlockValidator interface { // ChainReaderWriter reads and writes the chain bsstore. type ChainReaderWriter interface { GetHead() *types.TipSet - GetTipSet(types.TipSetKey) (*types.TipSet, error) - GetTipSetStateRoot(*types.TipSet) (cid.Cid, error) - GetTipSetReceiptsRoot(*types.TipSet) (cid.Cid, error) + GetTipSet(context.Context, types.TipSetKey) (*types.TipSet, error) + GetTipSetStateRoot(context.Context, *types.TipSet) (cid.Cid, error) + GetTipSetReceiptsRoot(context.Context, *types.TipSet) (cid.Cid, error) HasTipSetAndState(context.Context, *types.TipSet) bool - GetTipsetMetadata(*types.TipSet) (*chain.TipSetMetadata, error) + GetTipsetMetadata(context.Context, *types.TipSet) (*chain.TipSetMetadata, error) PutTipSetMetadata(context.Context, *chain.TipSetMetadata) error SetHead(context.Context, *types.TipSet) error - GetLatestBeaconEntry(*types.TipSet) (*types.BeaconEntry, error) + GetLatestBeaconEntry(context.Context, *types.TipSet) (*types.BeaconEntry, error) GetGenesisBlock(context.Context) (*types.BlockHeader, error) } @@ -282,7 +282,7 @@ func (syncer *Syncer) HandleNewTipSet(ctx context.Context, target *syncTypes.Tar } func (syncer *Syncer) syncSegement(ctx context.Context, target *syncTypes.Target, tipsets []*types.TipSet) error { - parent, err := syncer.chainStore.GetTipSet(tipsets[0].Parents()) + parent, err := syncer.chainStore.GetTipSet(ctx, tipsets[0].Parents()) if err != nil { return err } @@ -364,7 +364,7 @@ func (syncer *Syncer) fetchChainBlocks(ctx context.Context, knownTip *types.TipS count := 0 loop: for chainTipsets[len(chainTipsets)-1].Height() > untilHeight { - tipSet, err := syncer.chainStore.GetTipSet(targetTip.Parents()) + tipSet, err := syncer.chainStore.GetTipSet(ctx, targetTip.Parents()) if err == nil { chainTipsets = append(chainTipsets, tipSet) targetTip = tipSet @@ -414,7 +414,7 @@ loop: return chainTipsets, nil } - knownParent, err := syncer.chainStore.GetTipSet(knownTip.Parents()) + knownParent, err := syncer.chainStore.GetTipSet(ctx, knownTip.Parents()) if err != nil { return nil, xerrors.Errorf("failed to load next local tipset: %w", err) } @@ -469,7 +469,7 @@ func (syncer *Syncer) syncFork(ctx context.Context, incoming *types.TipSet, know return nil, err } - nts, err := syncer.chainStore.GetTipSet(known.Parents()) + nts, err := syncer.chainStore.GetTipSet(ctx, known.Parents()) if err != nil { return nil, xerrors.Errorf("failed to load next local tipset: %w", err) } @@ -489,7 +489,7 @@ func (syncer *Syncer) syncFork(ctx context.Context, incoming *types.TipSet, know if nts.Height() < tips[cur].Height() { cur++ } else { - nts, err = syncer.chainStore.GetTipSet(nts.Parents()) + nts, err = syncer.chainStore.GetTipSet(ctx, nts.Parents()) if err != nil { return nil, xerrors.Errorf("loading next local tipset: %w", err) } @@ -618,7 +618,7 @@ func (syncer *Syncer) SetHead(ctx context.Context, ts *types.TipSet) error { // If it is the heaviest update the chainStore. if heavier { - exceeds, err := syncer.exceedsForkLength(head, ts) + exceeds, err := syncer.exceedsForkLength(ctx, head, ts) if err != nil { return err } @@ -639,7 +639,7 @@ func (syncer *Syncer) SetHead(ctx context.Context, ts *types.TipSet) error { // FIXME: We may want to replace some of the logic in `syncFork()` with this. // `syncFork()` counts the length on both sides of the fork at the moment (we // need to settle on that) but here we just enforce it on the `synced` side. -func (syncer *Syncer) exceedsForkLength(synced, external *types.TipSet) (bool, error) { +func (syncer *Syncer) exceedsForkLength(ctx context.Context, synced, external *types.TipSet) (bool, error) { if synced == nil || external == nil { // FIXME: If `cs.heaviest` is nil we should just bypass the entire // `MaybeTakeHeavierTipSet` logic (instead of each of the called @@ -664,7 +664,7 @@ func (syncer *Syncer) exceedsForkLength(synced, external *types.TipSet) (bool, e return true, nil } - external, err = syncer.chainStore.GetTipSet(external.Parents()) + external, err = syncer.chainStore.GetTipSet(ctx, external.Parents()) if err != nil { return false, xerrors.Errorf("failed to load parent tipset in external chain: %w", err) } @@ -687,7 +687,7 @@ func (syncer *Syncer) exceedsForkLength(synced, external *types.TipSet) (bool, e // there is no common ancestor. return true, nil } - synced, err = syncer.chainStore.GetTipSet(synced.Parents()) + synced, err = syncer.chainStore.GetTipSet(ctx, synced.Parents()) if err != nil { return false, xerrors.Errorf("failed to load parent tipset in synced chain: %w", err) } diff --git a/pkg/chainsync/syncer/syncer_integration_test.go b/pkg/chainsync/syncer/syncer_integration_test.go index 4c688328f1..85ab655006 100644 --- a/pkg/chainsync/syncer/syncer_integration_test.go +++ b/pkg/chainsync/syncer/syncer_integration_test.go @@ -46,9 +46,9 @@ func TestLoadFork(t *testing.T) { require.NoError(t, err) - base := builder.AppendManyOn(3, genesis) - left := builder.AppendManyOn(4, base) - right := builder.AppendManyOn(3, base) + base := builder.AppendManyOn(ctx, 3, genesis) + left := builder.AppendManyOn(ctx, 4, base) + right := builder.AppendManyOn(ctx, 3, base) leftTarget := &types.Target{ Base: nil, @@ -78,7 +78,7 @@ func TestLoadFork(t *testing.T) { // tipsets can be reconstructed. The chain builder used for testing doesn't do that, so do // it manually here. for _, tip := range []*types2.TipSet{left, right} { - for itr := chain.IterAncestors(ctx, builder, tip); !itr.Complete(); require.NoError(t, itr.Next()) { + for itr := chain.IterAncestors(ctx, builder, tip); !itr.Complete(); require.NoError(t, itr.Next(ctx)) { for _, block := range itr.Value().ToSlice() { _, err := builder.Cstore().Put(ctx, block) require.NoError(t, err) diff --git a/pkg/chainsync/syncer/syncer_test.go b/pkg/chainsync/syncer/syncer_test.go index ded1dbc988..559c15c8c5 100644 --- a/pkg/chainsync/syncer/syncer_test.go +++ b/pkg/chainsync/syncer/syncer_test.go @@ -31,7 +31,7 @@ func TestOneBlock(t *testing.T) { tf.UnitTest(t) ctx := context.Background() builder, syncer := setup(ctx, t) - t1 := builder.AppendOn(builder.Genesis(), 1) + t1 := builder.AppendOn(ctx, builder.Genesis(), 1) target := &syncTypes.Target{ Base: nil, Current: nil, @@ -55,7 +55,7 @@ func TestMultiBlockTip(t *testing.T) { builder, syncer := setup(ctx, t) genesis := builder.Store().GetHead() - tip := builder.AppendOn(genesis, 2) + tip := builder.AppendOn(ctx, genesis, 2) target := &syncTypes.Target{ Base: nil, Current: nil, @@ -68,7 +68,7 @@ func TestMultiBlockTip(t *testing.T) { assert.NoError(t, syncer.HandleNewTipSet(ctx, target)) assert.NoError(t, builder.FlushHead(ctx)) - verifyTip(t, builder.Store(), tip, builder.StateForKey(tip.Key())) + verifyTip(t, builder.Store(), tip, builder.StateForKey(ctx, tip.Key())) verifyHead(t, builder.Store(), tip) } @@ -78,13 +78,13 @@ func TestChainIncremental(t *testing.T) { builder, syncer := setup(ctx, t) genesis := builder.Store().GetHead() - t1 := builder.AppendOn(genesis, 2) + t1 := builder.AppendOn(ctx, genesis, 2) - t2 := builder.AppendOn(t1, 3) + t2 := builder.AppendOn(ctx, t1, 3) - t3 := builder.AppendOn(t2, 1) + t3 := builder.AppendOn(ctx, t2, 1) - t4 := builder.AppendOn(t3, 2) + t4 := builder.AppendOn(ctx, t3, 2) target1 := &syncTypes.Target{ Base: nil, @@ -122,22 +122,22 @@ func TestChainIncremental(t *testing.T) { } assert.NoError(t, syncer.HandleNewTipSet(ctx, target1)) assert.NoError(t, builder.FlushHead(ctx)) - verifyTip(t, builder.Store(), t1, builder.StateForKey(t1.Key())) + verifyTip(t, builder.Store(), t1, builder.StateForKey(ctx, t1.Key())) verifyHead(t, builder.Store(), t1) assert.NoError(t, syncer.HandleNewTipSet(ctx, target2)) assert.NoError(t, builder.FlushHead(ctx)) - verifyTip(t, builder.Store(), t2, builder.StateForKey(t2.Key())) + verifyTip(t, builder.Store(), t2, builder.StateForKey(ctx, t2.Key())) verifyHead(t, builder.Store(), t2) assert.NoError(t, syncer.HandleNewTipSet(ctx, target3)) assert.NoError(t, builder.FlushHead(ctx)) - verifyTip(t, builder.Store(), t3, builder.StateForKey(t3.Key())) + verifyTip(t, builder.Store(), t3, builder.StateForKey(ctx, t3.Key())) verifyHead(t, builder.Store(), t3) assert.NoError(t, syncer.HandleNewTipSet(ctx, target4)) assert.NoError(t, builder.FlushHead(ctx)) - verifyTip(t, builder.Store(), t4, builder.StateForKey(t4.Key())) + verifyTip(t, builder.Store(), t4, builder.StateForKey(ctx, t4.Key())) verifyHead(t, builder.Store(), t4) } @@ -147,10 +147,10 @@ func TestChainJump(t *testing.T) { builder, syncer := setup(ctx, t) genesis := builder.Store().GetHead() - t1 := builder.AppendOn(genesis, 2) - t2 := builder.AppendOn(t1, 3) - t3 := builder.AppendOn(t2, 1) - t4 := builder.AppendOn(t3, 2) + t1 := builder.AppendOn(ctx, genesis, 2) + t2 := builder.AppendOn(ctx, t1, 3) + t3 := builder.AppendOn(ctx, t2, 1) + t4 := builder.AppendOn(ctx, t3, 2) target1 := &syncTypes.Target{ Base: nil, @@ -162,10 +162,10 @@ func TestChainJump(t *testing.T) { } assert.NoError(t, syncer.HandleNewTipSet(ctx, target1)) assert.NoError(t, builder.FlushHead(ctx)) - verifyTip(t, builder.Store(), t1, builder.StateForKey(t1.Key())) - verifyTip(t, builder.Store(), t2, builder.StateForKey(t2.Key())) - verifyTip(t, builder.Store(), t3, builder.StateForKey(t3.Key())) - verifyTip(t, builder.Store(), t4, builder.StateForKey(t4.Key())) + verifyTip(t, builder.Store(), t1, builder.StateForKey(ctx, t1.Key())) + verifyTip(t, builder.Store(), t2, builder.StateForKey(ctx, t2.Key())) + verifyTip(t, builder.Store(), t3, builder.StateForKey(ctx, t3.Key())) + verifyTip(t, builder.Store(), t4, builder.StateForKey(ctx, t4.Key())) verifyHead(t, builder.Store(), t4) } @@ -175,13 +175,13 @@ func TestIgnoreLightFork(t *testing.T) { builder, syncer := setup(ctx, t) genesis := builder.Store().GetHead() - forkbase := builder.AppendOn(genesis, 1) - forkHead := builder.AppendOn(forkbase, 1) + forkbase := builder.AppendOn(ctx, genesis, 1) + forkHead := builder.AppendOn(ctx, forkbase, 1) - t1 := builder.AppendOn(forkbase, 1) - t2 := builder.AppendOn(t1, 1) - t3 := builder.AppendOn(t2, 1) - t4 := builder.AppendOn(t3, 1) + t1 := builder.AppendOn(ctx, forkbase, 1) + t2 := builder.AppendOn(ctx, t1, 1) + t3 := builder.AppendOn(ctx, t2, 1) + t4 := builder.AppendOn(ctx, t3, 1) // Sync heaviest branch first. target4 := &syncTypes.Target{ @@ -194,7 +194,7 @@ func TestIgnoreLightFork(t *testing.T) { } assert.NoError(t, syncer.HandleNewTipSet(ctx, target4)) assert.NoError(t, builder.FlushHead(ctx)) - verifyTip(t, builder.Store(), t4, builder.StateForKey(t4.Key())) + verifyTip(t, builder.Store(), t4, builder.StateForKey(ctx, t4.Key())) verifyHead(t, builder.Store(), t4) // Lighter fork is processed but not change head. @@ -218,18 +218,18 @@ func TestAcceptHeavierFork(t *testing.T) { builder, syncer := setup(ctx, t) genesis := builder.Store().GetHead() - forkbase := builder.AppendOn(genesis, 1) + forkbase := builder.AppendOn(ctx, genesis, 1) - main1 := builder.AppendOn(forkbase, 1) - main2 := builder.AppendOn(main1, 1) - main3 := builder.AppendOn(main2, 1) - main4 := builder.AppendOn(main3, 1) + main1 := builder.AppendOn(ctx, forkbase, 1) + main2 := builder.AppendOn(ctx, main1, 1) + main3 := builder.AppendOn(ctx, main2, 1) + main4 := builder.AppendOn(ctx, main3, 1) // Fork is heavier with more blocks, despite shorter (with default fake weighing function // from FakeStateEvaluator). - fork1 := builder.AppendOn(forkbase, 3) - fork2 := builder.AppendOn(fork1, 1) - fork3 := builder.AppendOn(fork2, 1) + fork1 := builder.AppendOn(ctx, forkbase, 3) + fork2 := builder.AppendOn(ctx, fork1, 1) + fork3 := builder.AppendOn(ctx, fork2, 1) main4Target := &syncTypes.Target{ Base: nil, @@ -241,7 +241,7 @@ func TestAcceptHeavierFork(t *testing.T) { } assert.NoError(t, syncer.HandleNewTipSet(ctx, main4Target)) assert.NoError(t, builder.FlushHead(ctx)) - verifyTip(t, builder.Store(), main4, builder.StateForKey(main4.Key())) + verifyTip(t, builder.Store(), main4, builder.StateForKey(ctx, main4.Key())) verifyHead(t, builder.Store(), main4) // Heavier fork updates head3 @@ -255,9 +255,9 @@ func TestAcceptHeavierFork(t *testing.T) { } assert.NoError(t, syncer.HandleNewTipSet(ctx, fork3Target)) assert.NoError(t, builder.FlushHead(ctx)) - verifyTip(t, builder.Store(), fork1, builder.StateForKey(fork1.Key())) - verifyTip(t, builder.Store(), fork2, builder.StateForKey(fork2.Key())) - verifyTip(t, builder.Store(), fork3, builder.StateForKey(fork3.Key())) + verifyTip(t, builder.Store(), fork1, builder.StateForKey(ctx, fork1.Key())) + verifyTip(t, builder.Store(), fork2, builder.StateForKey(ctx, fork2.Key())) + verifyTip(t, builder.Store(), fork3, builder.StateForKey(ctx, fork3.Key())) verifyHead(t, builder.Store(), fork3) } @@ -267,7 +267,7 @@ func TestRejectFinalityFork(t *testing.T) { builder, s := setup(ctx, t) genesis := builder.Store().GetHead() - head := builder.AppendManyOn(int(policy.ChainFinality+2), genesis) + head := builder.AppendManyOn(ctx, int(policy.ChainFinality+2), genesis) target := &syncTypes.Target{ Base: nil, Current: nil, @@ -281,10 +281,10 @@ func TestRejectFinalityFork(t *testing.T) { // Differentiate fork for a new chain. Fork has FinalityEpochs + 1 // blocks on top of genesis so forkFinalityBase is more than FinalityEpochs // behind head - forkFinalityBase := builder.BuildOneOn(genesis, func(bb *chain.BlockBuilder) { + forkFinalityBase := builder.BuildOneOn(ctx, genesis, func(bb *chain.BlockBuilder) { bb.SetTicket([]byte{0xbe}) }) - forkFinalityHead := builder.AppendManyOn(int(policy.ChainFinality), forkFinalityBase) + forkFinalityHead := builder.AppendManyOn(ctx, int(policy.ChainFinality), forkFinalityBase) forkHeadTarget := &syncTypes.Target{ Base: nil, Current: nil, @@ -302,7 +302,7 @@ func TestNoUncessesaryFetch(t *testing.T) { builder, s := setup(ctx, t) genesis := builder.Store().GetHead() - head := builder.AppendManyOn(4, genesis) + head := builder.AppendManyOn(ctx, 4, genesis) target := &syncTypes.Target{ Base: nil, Current: nil, @@ -361,8 +361,8 @@ func TestSubsetParent(t *testing.T) { genesis := builder.Store().GetHead() // Set up chain with {A1, A2} -> {B1, B2, B3} - tipA1A2 := builder.AppendOn(genesis, 2) - tipB1B2B3 := builder.AppendOn(tipA1A2, 3) + tipA1A2 := builder.AppendOn(ctx, genesis, 2) + tipB1B2B3 := builder.AppendOn(ctx, tipA1A2, 3) target1 := &syncTypes.Target{ Base: nil, Current: nil, @@ -376,7 +376,7 @@ func TestSubsetParent(t *testing.T) { // Sync one tipset with a parent equal to a subset of an existing // tipset in the bsstore: {B1, B2} -> {C1, C2} tipB1B2 := testhelpers.RequireNewTipSet(t, tipB1B2B3.At(0), tipB1B2B3.At(1)) - tipC1C2 := builder.AppendOn(tipB1B2, 2) + tipC1C2 := builder.AppendOn(ctx, tipB1B2, 2) target2 := &syncTypes.Target{ Base: nil, @@ -391,7 +391,7 @@ func TestSubsetParent(t *testing.T) { // Sync another tipset with a parent equal to a subset of the tipset // just synced: C1 -> D1 tipC1 := testhelpers.RequireNewTipSet(t, tipC1C2.At(0)) - tipD1OnC1 := builder.AppendOn(tipC1, 1) + tipD1OnC1 := builder.AppendOn(ctx, tipC1, 1) target3 := &syncTypes.Target{ Base: nil, @@ -404,7 +404,7 @@ func TestSubsetParent(t *testing.T) { assert.NoError(t, s.HandleNewTipSet(ctx, target3)) // A full parent also works fine: {C1, C2} -> D1 - tipD1OnC1C2 := builder.AppendOn(tipC1C2, 1) + tipD1OnC1C2 := builder.AppendOn(ctx, tipC1C2, 1) target4 := &syncTypes.Target{ Base: nil, Current: nil, @@ -430,8 +430,8 @@ func TestBlockNotLinkedRejected(t *testing.T) { require.True(t, genesis.Equals(gen2)) // The syncer fails to fetch this block so cannot sync it. - b1 := shadowBuilder.AppendOn(genesis, 1) - b2 := shadowBuilder.AppendOn(b1, 1) + b1 := shadowBuilder.AppendOn(ctx, genesis, 1) + b2 := shadowBuilder.AppendOn(ctx, b1, 1) target1 := &syncTypes.Target{ Base: nil, Current: nil, @@ -443,7 +443,7 @@ func TestBlockNotLinkedRejected(t *testing.T) { assert.Error(t, syncer.HandleNewTipSet(ctx, target1)) // Make the same block available from the syncer's builder - builder.AppendBlockOn(genesis) + builder.AppendBlockOn(ctx, genesis) target2 := &syncTypes.Target{ Base: nil, Current: nil, @@ -510,7 +510,7 @@ func TestSemanticallyBadTipSetFails(t *testing.T) { m2 := mm.NewSignedMessage(alice, 1) m3 := mm.NewSignedMessage(alice, 3) - link1 := builder.BuildOneOn(genesis, func(bb *chain.BlockBuilder) { + link1 := builder.BuildOneOn(ctx, genesis, func(bb *chain.BlockBuilder) { bb.AddMessages( []*types.SignedMessage{m1, m2, m3}, []*types.Message{}, @@ -543,7 +543,7 @@ func TestStoresMessageReceipts(t *testing.T) { keys := testhelpers.MustGenerateKeyInfo(1, 42) mm := testhelpers.NewMessageMaker(t, keys) alice := mm.Addresses()[0] - t1 := builder.Build(genesis, 4, func(b *chain.BlockBuilder, i int) { + t1 := builder.Build(ctx, genesis, 4, func(b *chain.BlockBuilder, i int) { b.AddMessages([]*types.SignedMessage{}, []*types.Message{mm.NewUnsignedMessage(alice, uint64(i))}) }) @@ -557,7 +557,7 @@ func TestStoresMessageReceipts(t *testing.T) { } assert.NoError(t, syncer.HandleNewTipSet(ctx, target1)) - receiptsCid, err := builder.Store().GetTipSetReceiptsRoot(t1) + receiptsCid, err := builder.Store().GetTipSetReceiptsRoot(ctx, t1) require.NoError(t, err) @@ -605,17 +605,19 @@ func setupWithValidator(ctx context.Context, t *testing.T, builder *chain.Builde // Sub-interface of the bsstore used for verification. type syncStoreReader interface { GetHead() *types.TipSet - GetTipSet(types.TipSetKey) (*types.TipSet, error) - GetTipSetStateRoot(*types.TipSet) (cid.Cid, error) + GetTipSet(context.Context, types.TipSetKey) (*types.TipSet, error) + GetTipSetStateRoot(context.Context, *types.TipSet) (cid.Cid, error) } // Verifies that a tipset and associated state root are stored in the chain bsstore. func verifyTip(t *testing.T, store syncStoreReader, tip *types.TipSet, stateRoot cid.Cid) { - foundTip, err := store.GetTipSet(tip.Key()) + ctx := context.Background() + + foundTip, err := store.GetTipSet(ctx, tip.Key()) require.NoError(t, err) test.Equal(t, tip, foundTip) - foundState, err := store.GetTipSetStateRoot(tip) + foundState, err := store.GetTipSetStateRoot(ctx, tip) require.NoError(t, err) test.Equal(t, stateRoot, foundState) } diff --git a/pkg/consensus/block_validator.go b/pkg/consensus/block_validator.go index 71731d979a..e38c712679 100644 --- a/pkg/consensus/block_validator.go +++ b/pkg/consensus/block_validator.go @@ -140,7 +140,7 @@ func (bv *BlockValidator) ValidateFullBlock(ctx context.Context, blk *types.Bloc } func (bv *BlockValidator) validateBlock(ctx context.Context, blk *types.BlockHeader) error { - parent, err := bv.chainState.GetTipSet(types.NewTipSetKey(blk.Parents...)) + parent, err := bv.chainState.GetTipSet(ctx, types.NewTipSetKey(blk.Parents...)) if err != nil { return xerrors.Errorf("load parent tipset failed %w", err) } @@ -168,7 +168,7 @@ func (bv *BlockValidator) validateBlock(ctx context.Context, blk *types.BlockHea } // get parent beacon - prevBeacon, err := bv.chainState.GetLatestBeaconEntry(parent) + prevBeacon, err := bv.chainState.GetLatestBeaconEntry(ctx, parent) if err != nil { return xerrors.Errorf("failed to get latest beacon entry: %w", err) } @@ -514,7 +514,7 @@ func (bv *BlockValidator) beaconBaseEntry(ctx context.Context, blk *types.BlockH return &blk.BeaconEntries[len(blk.BeaconEntries)-1], nil } - parent, err := bv.chainState.GetTipSet(types.NewTipSetKey(blk.Parents...)) + parent, err := bv.chainState.GetTipSet(ctx, types.NewTipSetKey(blk.Parents...)) if err != nil { return nil, err } @@ -883,7 +883,7 @@ func (bv *BlockValidator) checkBlockMessages(ctx context.Context, sigValidator * // ValidateMsgMeta performs structural and content hash validation of the // messages within this block. If validation passes, it stores the messages in // the underlying IPLD block store. -func (bv *BlockValidator) ValidateMsgMeta(fblk *types.FullBlock) error { +func (bv *BlockValidator) ValidateMsgMeta(ctx context.Context, fblk *types.FullBlock) error { if msgc := len(fblk.BLSMessages) + len(fblk.SECPMessages); msgc > constants.BlockMessageLimit { return xerrors.Errorf("block %s has too many messages (%d)", fblk.Header.Cid(), msgc) } @@ -898,7 +898,7 @@ func (bv *BlockValidator) ValidateMsgMeta(fblk *types.FullBlock) error { var bcids, scids []cid.Cid for _, m := range fblk.BLSMessages { - c, err := chain.PutMessage(blockstore, m) + c, err := chain.PutMessage(ctx, blockstore, m) if err != nil { return xerrors.Errorf("putting bls message to blockstore after msgmeta computation: %v", err) } @@ -906,7 +906,7 @@ func (bv *BlockValidator) ValidateMsgMeta(fblk *types.FullBlock) error { } for _, m := range fblk.SECPMessages { - c, err := chain.PutMessage(blockstore, m) + c, err := chain.PutMessage(ctx, blockstore, m) if err != nil { return xerrors.Errorf("putting bls message to blockstore after msgmeta computation: %w", err) } diff --git a/pkg/consensus/expected.go b/pkg/consensus/expected.go index 6ee870b118..f9718ac541 100644 --- a/pkg/consensus/expected.go +++ b/pkg/consensus/expected.go @@ -81,20 +81,22 @@ type StateViewer interface { } type chainReader interface { - GetTipSet(types.TipSetKey) (*types.TipSet, error) + GetTipSet(ctx context.Context, key types.TipSetKey) (*types.TipSet, error) GetHead() *types.TipSet - StateView(ts *types.TipSet) (*appstate.View, error) - GetTipSetStateRoot(*types.TipSet) (cid.Cid, error) - GetTipSetReceiptsRoot(*types.TipSet) (cid.Cid, error) + StateView(ctx context.Context, ts *types.TipSet) (*appstate.View, error) + GetTipSetStateRoot(context.Context, *types.TipSet) (cid.Cid, error) + GetTipSetReceiptsRoot(context.Context, *types.TipSet) (cid.Cid, error) GetGenesisBlock(context.Context) (*types.BlockHeader, error) - GetLatestBeaconEntry(*types.TipSet) (*types.BeaconEntry, error) + GetLatestBeaconEntry(context.Context, *types.TipSet) (*types.BeaconEntry, error) GetTipSetByHeight(context.Context, *types.TipSet, abi.ChainEpoch, bool) (*types.TipSet, error) GetCirculatingSupplyDetailed(context.Context, abi.ChainEpoch, tree.Tree) (types.CirculatingSupply, error) GetLookbackTipSetForRound(ctx context.Context, ts *types.TipSet, round abi.ChainEpoch, version network.Version) (*types.TipSet, cid.Cid, error) - GetTipsetMetadata(*types.TipSet) (*chain.TipSetMetadata, error) + GetTipsetMetadata(context.Context, *types.TipSet) (*chain.TipSetMetadata, error) PutTipSetMetadata(context.Context, *chain.TipSetMetadata) error } +var _ chainReader = (*chain.Store)(nil) + // Expected implements expected consensus. type Expected struct { // cstore is used for loading state trees during message running. @@ -133,6 +135,8 @@ type Expected struct { blockValidator *BlockValidator } + + // NewExpected is the constructor for the Expected consenus.Protocol module. func NewExpected(cs cbor.IpldStore, bs blockstore.Blockstore, @@ -190,7 +194,7 @@ func (c *Expected) RunStateTransition(ctx context.Context, ts *types.TipSet) (ci return ts.Blocks()[0].ParentStateRoot, ts.Blocks()[0].ParentMessageReceipts, nil } else if ts.Height() > 0 { parent := ts.Parents() - if pts, err = c.chainState.GetTipSet(parent); err != nil { + if pts, err = c.chainState.GetTipSet(ctx, parent); err != nil { return cid.Undef, cid.Undef, err } } else { @@ -205,7 +209,7 @@ func (c *Expected) RunStateTransition(ctx context.Context, ts *types.TipSet) (ci } return dertail.FilCirculating, nil }, - LookbackStateGetter: vmcontext.LookbackStateGetterForTipset(c.chainState, c.fork, ts), + LookbackStateGetter: vmcontext.LookbackStateGetterForTipset(ctx, c.chainState, c.fork, ts), NtwkVersionGetter: c.fork.GetNtwkVersion, Rnd: NewHeadRandomness(c.rnd, ts.Key()), BaseFee: ts.At(0).ParentBaseFee, diff --git a/pkg/consensus/message_validator.go b/pkg/consensus/message_validator.go index a1fcad7118..c1f7e1f0c7 100644 --- a/pkg/consensus/message_validator.go +++ b/pkg/consensus/message_validator.go @@ -139,7 +139,7 @@ type MessageSignatureValidator struct { // signatureValidatorAPI allows the validator to access state needed for signature checking type signatureValidatorAPI interface { GetHead() *types.TipSet - GetTipSet(types.TipSetKey) (*types.TipSet, error) + GetTipSet(context.Context, types.TipSetKey) (*types.TipSet, error) AccountView(ts *types.TipSet) (state.AccountView, error) } diff --git a/pkg/consensus/message_validator_test.go b/pkg/consensus/message_validator_test.go index ade771b464..b08bbea75c 100644 --- a/pkg/consensus/message_validator_test.go +++ b/pkg/consensus/message_validator_test.go @@ -150,7 +150,7 @@ func (api *FakeIngestionValidatorAPI) GetHead() *types.TipSet { return ts } -func (api *FakeIngestionValidatorAPI) GetTipSet(key types.TipSetKey) (*types.TipSet, error) { +func (api *FakeIngestionValidatorAPI) GetTipSet(ctx context.Context, key types.TipSetKey) (*types.TipSet, error) { return types.NewTipSet([]*types.BlockHeader{api.Block}) } diff --git a/pkg/consensus/ticket.go b/pkg/consensus/ticket.go index e3c3a9c830..a6d036178e 100644 --- a/pkg/consensus/ticket.go +++ b/pkg/consensus/ticket.go @@ -21,7 +21,7 @@ type ChainSampler interface { } type tipsetLoader interface { - GetTipSet(types.TipSetKey) (*types.TipSet, error) + GetTipSet(context.Context, types.TipSetKey) (*types.TipSet, error) } // TicketMachine uses a VRF and VDF to generate deterministic, unpredictable @@ -72,7 +72,7 @@ func (tm TicketMachine) ticketVRFRandomness(ctx context.Context, base types.TipS } if bSmokeHeight { // todo - ts, err := tm.tipsetLoader.GetTipSet(base) + ts, err := tm.tipsetLoader.GetTipSet(ctx, base) if err != nil { return nil, err } diff --git a/pkg/consensus/ticket_test.go b/pkg/consensus/ticket_test.go index 39b0685763..a8caa2d5a8 100644 --- a/pkg/consensus/ticket_test.go +++ b/pkg/consensus/ticket_test.go @@ -121,6 +121,6 @@ func newMockTipsetLoader(tsk *types.TipSet) *mockTipsetLoader { return &mockTipsetLoader{tsk: tsk} } -func (m *mockTipsetLoader) GetTipSet(tsk types.TipSetKey) (*types.TipSet, error) { +func (m *mockTipsetLoader) GetTipSet(ctx context.Context, tsk types.TipSetKey) (*types.TipSet, error) { return m.tsk, nil } diff --git a/pkg/consensusfault/check.go b/pkg/consensusfault/check.go index 7ac95b6fbf..1e6a4eb57c 100644 --- a/pkg/consensusfault/check.go +++ b/pkg/consensusfault/check.go @@ -31,7 +31,7 @@ type FaultStateView interface { // Chain state required for checking consensus fault reports. type chainReader interface { - GetTipSet(types.TipSetKey) (*types.TipSet, error) + GetTipSet(context.Context, types.TipSetKey) (*types.TipSet, error) } // Checks the validity of reported consensus faults. diff --git a/pkg/discovery/hello_protocol.go b/pkg/discovery/hello_protocol.go index 5d45756c52..25f46766af 100644 --- a/pkg/discovery/hello_protocol.go +++ b/pkg/discovery/hello_protocol.go @@ -190,7 +190,7 @@ func (h *HelloProtocolHandler) handleNewStream(s net.Stream) { } func (h *HelloProtocolHandler) loadLocalFullTipset(ctx context.Context, tsk types.TipSetKey) (*types.FullTipSet, error) { - ts, err := h.chainStore.GetTipSet(tsk) + ts, err := h.chainStore.GetTipSet(ctx, tsk) if err != nil { return nil, err } diff --git a/pkg/discovery/hello_protocol_test.go b/pkg/discovery/hello_protocol_test.go index ffc443aa65..a62c4db833 100644 --- a/pkg/discovery/hello_protocol_test.go +++ b/pkg/discovery/hello_protocol_test.go @@ -58,8 +58,8 @@ func TestHelloHandshake(t *testing.T) { genesisA := builder.Genesis() store := builder.Store() mstore := builder.Mstore() - heavy1 := builder.AppendOn(genesisA, 1) - heavy2 := builder.AppendOn(heavy1, 1) + heavy1 := builder.AppendOn(ctx, genesisA, 1) + heavy2 := builder.AppendOn(ctx, heavy1, 1) msc1, msc2 := new(mockHelloCallback), new(mockHelloCallback) hg1, hg2 := &mockHeaviestGetter{heavy1}, &mockHeaviestGetter{heavy2} @@ -117,11 +117,11 @@ func TestHelloBadGenesis(t *testing.T) { store := builder.Store() mstore := builder.Mstore() - genesisA := builder.AppendOn(types.UndefTipSet, 1) - genesisB := builder.AppendOn(types.UndefTipSet, 1) + genesisA := builder.AppendOn(ctx, types.UndefTipSet, 1) + genesisB := builder.AppendOn(ctx, types.UndefTipSet, 1) - heavy1 := builder.AppendOn(genesisA, 1) - heavy2 := builder.AppendOn(heavy1, 1) + heavy1 := builder.AppendOn(ctx, genesisA, 1) + heavy2 := builder.AppendOn(ctx, heavy1, 1) msc1, msc2 := new(mockHelloCallback), new(mockHelloCallback) hg1, hg2 := &mockHeaviestGetter{heavy1}, &mockHeaviestGetter{heavy2} @@ -164,9 +164,9 @@ func TestHelloMultiBlock(t *testing.T) { genesisTipset := builder.Genesis() assert.Equal(t, 1, genesisTipset.Len()) - heavy1 := builder.AppendOn(genesisTipset, 3) - heavy1 = builder.AppendOn(heavy1, 3) - heavy2 := builder.AppendOn(heavy1, 3) + heavy1 := builder.AppendOn(ctx, genesisTipset, 3) + heavy1 = builder.AppendOn(ctx, heavy1, 3) + heavy2 := builder.AppendOn(ctx, heavy1, 3) msc1, msc2 := new(mockHelloCallback), new(mockHelloCallback) hg1, hg2 := &mockHeaviestGetter{heavy1}, &mockHeaviestGetter{heavy2} diff --git a/pkg/events/events_test.go b/pkg/events/events_test.go index 82d5f5bc65..490046291a 100644 --- a/pkg/events/events_test.go +++ b/pkg/events/events_test.go @@ -120,7 +120,7 @@ func (fcs *fakeCS) ChainGetPath(ctx context.Context, from, to types.TipSetKey) ( } // copied from the chainstore - revert, apply, err := chain.ReorgOps(func(tsk types.TipSetKey) (*types.TipSet, error) { + revert, apply, err := chain.ReorgOps(func(ctx context.Context, tsk types.TipSetKey) (*types.TipSet, error) { return fcs.ChainGetTipSet(ctx, tsk) }, fromTS, toTS) if err != nil { diff --git a/pkg/events/state/mock/api.go b/pkg/events/state/mock/api.go index dd8e6ed3a0..eda198b22a 100644 --- a/pkg/events/state/mock/api.go +++ b/pkg/events/state/mock/api.go @@ -29,11 +29,11 @@ func NewMockAPI(bs blockstore.Blockstore) *MockAPI { } func (m *MockAPI) ChainHasObj(ctx context.Context, c cid.Cid) (bool, error) { - return m.bs.Has(c) + return m.bs.Has(ctx, c) } func (m *MockAPI) ChainReadObj(ctx context.Context, c cid.Cid) ([]byte, error) { - blk, err := m.bs.Get(c) + blk, err := m.bs.Get(ctx, c) if err != nil { return nil, xerrors.Errorf("blockstore get: %w", err) } diff --git a/pkg/fork/fork.go b/pkg/fork/fork.go index f18d30eb48..5bed606f3e 100644 --- a/pkg/fork/fork.go +++ b/pkg/fork/fork.go @@ -352,7 +352,7 @@ func (us UpgradeSchedule) Validate() error { type chainReader interface { GetHead() *types.TipSet - GetTipSet(types.TipSetKey) (*types.TipSet, error) + GetTipSet(context.Context, types.TipSetKey) (*types.TipSet, error) GetTipSetByHeight(context.Context, *types.TipSet, abi.ChainEpoch, bool) (*types.TipSet, error) GetTipSetState(context.Context, *types.TipSet) (vmstate.Tree, error) GetGenesisBlock(context.Context) (*types.BlockHeader, error) @@ -682,7 +682,7 @@ func (c *ChainFork) UpgradeFaucetBurnRecovery(ctx context.Context, cache Migrati return cid.Undef, xerrors.Errorf("failed to get tipset at lookback height: %v", err) } - pts, err := c.cr.GetTipSet(lbts.Parents()) + pts, err := c.cr.GetTipSet(ctx, lbts.Parents()) if err != nil { return cid.Undef, xerrors.Errorf("failed to get tipset : %v", err) } @@ -1258,13 +1258,13 @@ func linksForObj(blk ipfsblock.Block, cb func(cid.Cid)) error { } } -func copyRec(from, to blockstore.Blockstore, root cid.Cid, cp func(ipfsblock.Block) error) error { +func copyRec(ctx context.Context, from, to blockstore.Blockstore, root cid.Cid, cp func(ipfsblock.Block) error) error { if root.Prefix().MhType == 0 { // identity cid, skip return nil } - blk, err := from.Get(root) + blk, err := from.Get(ctx, root) if err != nil { return xerrors.Errorf("get %s failed: %v", root, err) } @@ -1289,7 +1289,7 @@ func copyRec(from, to blockstore.Blockstore, root cid.Cid, cp func(ipfsblock.Blo } } else { // If we have an object, we already have its children, skip the object. - has, err := to.Has(link) + has, err := to.Has(ctx, link) if err != nil { lerr = xerrors.Errorf("has: %v", err) return @@ -1299,7 +1299,7 @@ func copyRec(from, to blockstore.Blockstore, root cid.Cid, cp func(ipfsblock.Blo } } - if err := copyRec(from, to, link, cp); err != nil { + if err := copyRec(ctx, from, to, link, cp); err != nil { lerr = err return } @@ -1336,7 +1336,7 @@ func Copy(ctx context.Context, from, to blockstore.Blockstore, root cid.Cid) err go func() { for b := range toFlush { - if err := to.PutMany(b); err != nil { + if err := to.PutMany(ctx, b); err != nil { close(freeBufs) errFlushChan <- xerrors.Errorf("batch put in copy: %v", err) return @@ -1365,7 +1365,7 @@ func Copy(ctx context.Context, from, to blockstore.Blockstore, root cid.Cid) err return nil } - if err := copyRec(from, to, root, batchCp); err != nil { + if err := copyRec(ctx, from, to, root, batchCp); err != nil { return xerrors.Errorf("copyRec: %v", err) } diff --git a/pkg/gen/genesis/genesis.go b/pkg/gen/genesis/genesis.go index 0385174a7e..04735f4c9b 100644 --- a/pkg/gen/genesis/genesis.go +++ b/pkg/gen/genesis/genesis.go @@ -601,7 +601,7 @@ func MakeGenesisBlock(ctx context.Context, rep repo.Repo, bs bstore.Blockstore, if err != nil { return nil, xerrors.Errorf("serializing msgmeta failed: %w", err) } - if err := bs.Put(mmb); err != nil { + if err := bs.Put(ctx, mmb); err != nil { return nil, xerrors.Errorf("putting msgmeta block to blockstore: %w", err) } @@ -631,7 +631,7 @@ func MakeGenesisBlock(ctx context.Context, rep repo.Repo, bs bstore.Blockstore, return nil, xerrors.Errorf("filecoinGenesisCid != gblk.Cid") } - if err := bs.Put(gblk); err != nil { + if err := bs.Put(ctx, gblk); err != nil { return nil, xerrors.Errorf("failed writing filecoin genesis block to blockstore: %w", err) } @@ -662,7 +662,7 @@ func MakeGenesisBlock(ctx context.Context, rep repo.Repo, bs bstore.Blockstore, return nil, xerrors.Errorf("serializing block header failed: %w", err) } - if err := bs.Put(sb); err != nil { + if err := bs.Put(ctx, sb); err != nil { return nil, xerrors.Errorf("putting header to blockstore: %w", err) } diff --git a/pkg/genesis/init.go b/pkg/genesis/init.go index 7c2b4f66c8..bf564664ec 100644 --- a/pkg/genesis/init.go +++ b/pkg/genesis/init.go @@ -50,7 +50,7 @@ func Init(ctx context.Context, r repo.Repo, bs bstore.Blockstore, cst cbor.IpldS return nil, errors.Wrap(err, "failed to marshal genesis cid") } - if err = r.ChainDatastore().Put(chain.GenesisKey, val); err != nil { + if err = r.ChainDatastore().Put(ctx, chain.GenesisKey, val); err != nil { return nil, errors.Wrap(err, "failed to persist genesis cid") } diff --git a/pkg/market/fundmanager.go b/pkg/market/fundmanager.go index 0fc7664542..d026d4b804 100644 --- a/pkg/market/fundmanager.go +++ b/pkg/market/fundmanager.go @@ -70,7 +70,7 @@ func (fm *FundManager) Stop() { fm.shutdown() } -func (fm *FundManager) Start() error { +func (fm *FundManager) Start(ctx context.Context) error { fm.lk.Lock() defer fm.lk.Unlock() @@ -79,11 +79,11 @@ func (fm *FundManager) Start() error { // - in State() only load addresses with in-progress messages // - load the others just-in-time from getFundedAddress // - delete(fm.fundedAddrs, addr) when the queue has been processed - return fm.str.forEach(func(state *FundedAddressState) { + return fm.str.forEach(ctx, func(state *FundedAddressState) { fa := newFundedAddress(fm, state.Addr) fa.state = state fm.fundedAddrs[fa.state.Addr] = fa - fa.start() + fa.start(ctx) }) } @@ -169,13 +169,13 @@ func newFundedAddress(fm *FundManager, addr address.Address) *fundedAddress { // If there is an in-progress on-chain message, don't submit any more messages // on chain until it completes -func (a *fundedAddress) start() { +func (a *fundedAddress) start(ctx context.Context) { a.lk.Lock() defer a.lk.Unlock() if a.state.MsgCid != nil { a.debugf("restart: wait for %s", a.state.MsgCid) - a.startWaitForResults(*a.state.MsgCid) + a.startWaitForResults(ctx, *a.state.MsgCid) } } @@ -208,7 +208,7 @@ func (a *fundedAddress) requestAndWait(ctx context.Context, wallet address.Addre a.lk.Unlock() // Process the queue - go a.process() + go a.process(ctx) // Wait for the results select { @@ -228,7 +228,7 @@ func (a *fundedAddress) onProcessStart(fn func() bool) { } // Process queued requests -func (a *fundedAddress) process() { +func (a *fundedAddress) process(ctx context.Context) { a.lk.Lock() defer a.lk.Unlock() @@ -257,7 +257,7 @@ func (a *fundedAddress) process() { if haveReservations { res, err := a.processReservations(a.reservations, a.releases) if err == nil { - a.applyStateChange(res.msgCid, res.amtReserved) + a.applyStateChange(ctx, res.msgCid, res.amtReserved) } a.reservations = filterOutProcessedReqs(a.reservations) a.releases = filterOutProcessedReqs(a.releases) @@ -268,7 +268,7 @@ func (a *fundedAddress) process() { if haveWithdrawals && a.state.MsgCid == nil && len(a.reservations) == 0 { withdrawalCid, err := a.processWithdrawals(a.withdrawals) if err == nil && withdrawalCid != cid.Undef { - a.applyStateChange(&withdrawalCid, types.EmptyInt) + a.applyStateChange(ctx, &withdrawalCid, types.EmptyInt) } a.withdrawals = filterOutProcessedReqs(a.withdrawals) } @@ -276,11 +276,11 @@ func (a *fundedAddress) process() { // If a message was sent on-chain if a.state.MsgCid != nil { // Start waiting for results of message (async) - a.startWaitForResults(*a.state.MsgCid) + a.startWaitForResults(ctx, *a.state.MsgCid) } // Process any remaining queued requests - go a.process() + go a.process(ctx) } // Filter out completed requests @@ -295,24 +295,24 @@ func filterOutProcessedReqs(reqs []*fundRequest) []*fundRequest { } // Apply the results of processing queues and save to the datastore -func (a *fundedAddress) applyStateChange(msgCid *cid.Cid, amtReserved abi.TokenAmount) { +func (a *fundedAddress) applyStateChange(ctx context.Context, msgCid *cid.Cid, amtReserved abi.TokenAmount) { a.state.MsgCid = msgCid if !amtReserved.Nil() { a.state.AmtReserved = amtReserved } - a.saveState() + a.saveState(ctx) } // Clear the pending message cid so that a new message can be sent -func (a *fundedAddress) clearWaitState() { +func (a *fundedAddress) clearWaitState(ctx context.Context) { a.state.MsgCid = nil - a.saveState() + a.saveState(ctx) } // Save state to datastore -func (a *fundedAddress) saveState() { +func (a *fundedAddress) saveState(ctx context.Context) { // Not much we can do if saving to the datastore fails, just log - err := a.str.save(a.state) + err := a.str.save(ctx, a.state) if err != nil { log.Errorf("saving state to store for addr %s: %w", a.state.Addr, err) } @@ -563,7 +563,7 @@ func (a *fundedAddress) processWithdrawals(withdrawals []*fundRequest) (msgCid c } // asynchonously wait for results of message -func (a *fundedAddress) startWaitForResults(msgCid cid.Cid) { +func (a *fundedAddress) startWaitForResults(ctx context.Context, msgCid cid.Cid) { go func() { err := a.env.WaitMsg(a.ctx, msgCid) if err != nil { @@ -574,10 +574,10 @@ func (a *fundedAddress) startWaitForResults(msgCid cid.Cid) { a.lk.Lock() a.debugf("complete wait") - a.clearWaitState() + a.clearWaitState(ctx) a.lk.Unlock() - a.process() + a.process(ctx) }() } diff --git a/pkg/market/fundmanager_test.go b/pkg/market/fundmanager_test.go index 71c055caeb..71d53f96f8 100644 --- a/pkg/market/fundmanager_test.go +++ b/pkg/market/fundmanager_test.go @@ -3,31 +3,30 @@ package market import ( "bytes" "context" - - "github.com/filecoin-project/go-state-types/big" - "github.com/filecoin-project/venus/pkg/config" - tf "github.com/filecoin-project/venus/pkg/testhelpers/testflags" - "github.com/filecoin-project/venus/pkg/wallet" - apitypes "github.com/filecoin-project/venus/venus-shared/api/chain" - types "github.com/filecoin-project/venus/venus-shared/chain" - "github.com/stretchr/testify/assert" - - "github.com/filecoin-project/venus/venus-shared/actors/builtin/market" - "github.com/ipfs/go-datastore" - "sync" "testing" "time" "github.com/filecoin-project/go-address" "github.com/filecoin-project/go-state-types/abi" + "github.com/filecoin-project/go-state-types/big" + "github.com/ipfs/go-cid" + "github.com/ipfs/go-datastore" + ds_sync "github.com/ipfs/go-datastore/sync" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + + "github.com/filecoin-project/venus/venus-shared/actors/builtin/market" tutils "github.com/filecoin-project/specs-actors/v6/support/testing" + + "github.com/filecoin-project/venus/pkg/config" _ "github.com/filecoin-project/venus/pkg/crypto/bls" _ "github.com/filecoin-project/venus/pkg/crypto/secp" - "github.com/ipfs/go-cid" - ds_sync "github.com/ipfs/go-datastore/sync" - "github.com/stretchr/testify/require" + tf "github.com/filecoin-project/venus/pkg/testhelpers/testflags" + "github.com/filecoin-project/venus/pkg/wallet" + apitypes "github.com/filecoin-project/venus/venus-shared/api/chain" + types "github.com/filecoin-project/venus/venus-shared/chain" ) // TestFundManagerBasic verifies that the basic fund manager operations work @@ -213,9 +212,10 @@ func TestFundManagerReserveByWallet(t *testing.T) { s := setup(t) defer s.fm.Stop() - walletAddrA, err := s.wllt.NewAddress(address.SECP256K1) + ctx := context.Background() + walletAddrA, err := s.wllt.NewAddress(ctx, address.SECP256K1) require.NoError(t, err) - walletAddrB, err := s.wllt.NewAddress(address.SECP256K1) + walletAddrB, err := s.wllt.NewAddress(ctx, address.SECP256K1) require.NoError(t, err) // Wait until all the reservation requests are queued up @@ -401,9 +401,11 @@ func TestFundManagerWithdrawByWallet(t *testing.T) { tf.UnitTest(t) s := setup(t) defer s.fm.Stop() - walletAddrA, err := s.wllt.NewAddress(address.SECP256K1) + + ctx := context.Background() + walletAddrA, err := s.wllt.NewAddress(ctx, address.SECP256K1) require.NoError(t, err) - walletAddrB, err := s.wllt.NewAddress(address.SECP256K1) + walletAddrB, err := s.wllt.NewAddress(ctx, address.SECP256K1) require.NoError(t, err) // Reserve 10 @@ -511,6 +513,8 @@ func TestFundManagerRestart(t *testing.T) { s := setup(t) defer s.fm.Stop() + ctx := context.Background() + acctAddr2 := tutils.NewActorAddr(t, "addr2") // Address 1: Reserve 10 @@ -538,7 +542,7 @@ func TestFundManagerRestart(t *testing.T) { // Restart mockAPIAfter := s.mockAPI fmAfter := newFundManager(mockAPIAfter, s.ds) - err = fmAfter.Start() + err = fmAfter.Start(ctx) require.NoError(t, err) amt3 := abi.NewTokenAmount(9) @@ -629,11 +633,11 @@ func setup(t *testing.T) *scaffold { ctx := context.Background() t.Log("create a backend") ds := datastore.NewMapDatastore() - fs, err := wallet.NewDSBackend(ds, config.TestPassphraseConfig(), wallet.TestPassword) + fs, err := wallet.NewDSBackend(ctx, ds, config.TestPassphraseConfig(), wallet.TestPassword) assert.NoError(t, err) t.Log("create a wallet with a single backend") wllt := wallet.New(fs) - walletAddr, err := wllt.NewAddress(address.SECP256K1) + walletAddr, err := wllt.NewAddress(ctx, address.SECP256K1) if err != nil { t.Fatal(err) } diff --git a/pkg/market/store.go b/pkg/market/store.go index 9b58dcc011..16a37c60e0 100644 --- a/pkg/market/store.go +++ b/pkg/market/store.go @@ -2,6 +2,7 @@ package market import ( "bytes" + "context" "github.com/filecoin-project/venus/pkg/repo" @@ -28,7 +29,7 @@ func newStore(ds repo.Datastore) *Store { } // save the state to the datastore -func (ps *Store) save(state *FundedAddressState) error { +func (ps *Store) save(ctx context.Context, state *FundedAddressState) error { k := dskeyForAddr(state.Addr) b, err := cborrpc.Dump(state) @@ -36,15 +37,15 @@ func (ps *Store) save(state *FundedAddressState) error { return err } - return ps.ds.Put(k, b) + return ps.ds.Put(ctx, k, b) } // get the state for the given address // nolint -func (ps *Store) get(addr address.Address) (*FundedAddressState, error) { +func (ps *Store) get(ctx context.Context, addr address.Address) (*FundedAddressState, error) { k := dskeyForAddr(addr) - data, err := ps.ds.Get(k) + data, err := ps.ds.Get(ctx, k) if err != nil { return nil, err } @@ -58,8 +59,8 @@ func (ps *Store) get(addr address.Address) (*FundedAddressState, error) { } // forEach calls iter with each address in the datastore -func (ps *Store) forEach(iter func(*FundedAddressState)) error { - res, err := ps.ds.Query(dsq.Query{Prefix: dsKeyAddr}) +func (ps *Store) forEach(ctx context.Context, iter func(*FundedAddressState)) error { + res, err := ps.ds.Query(ctx, dsq.Query{Prefix: dsKeyAddr}) if err != nil { return err } diff --git a/pkg/messagepool/config.go b/pkg/messagepool/config.go index d866400b90..a54e313404 100644 --- a/pkg/messagepool/config.go +++ b/pkg/messagepool/config.go @@ -1,6 +1,7 @@ package messagepool import ( + "context" "encoding/json" "fmt" "time" @@ -36,8 +37,8 @@ func (mc *MpoolConfig) Clone() *MpoolConfig { return r } -func loadConfig(ds repo.Datastore) (*MpoolConfig, error) { - haveCfg, err := ds.Has(ConfigKey) +func loadConfig(ctx context.Context, ds repo.Datastore) (*MpoolConfig, error) { + haveCfg, err := ds.Has(ctx, ConfigKey) if err != nil { return nil, err } @@ -46,7 +47,7 @@ func loadConfig(ds repo.Datastore) (*MpoolConfig, error) { return DefaultConfig(), nil } - cfgBytes, err := ds.Get(ConfigKey) + cfgBytes, err := ds.Get(ctx, ConfigKey) if err != nil { return nil, err } @@ -55,12 +56,12 @@ func loadConfig(ds repo.Datastore) (*MpoolConfig, error) { return cfg, err } -func saveConfig(cfg *MpoolConfig, ds repo.Datastore) error { +func saveConfig(ctx context.Context, cfg *MpoolConfig, ds repo.Datastore) error { cfgBytes, err := json.Marshal(cfg) if err != nil { return err } - return ds.Put(ConfigKey, cfgBytes) + return ds.Put(ctx, ConfigKey, cfgBytes) } func (mp *MessagePool) GetConfig() *MpoolConfig { @@ -80,7 +81,7 @@ func validateConfg(cfg *MpoolConfig) error { return nil } -func (mp *MessagePool) SetConfig(cfg *MpoolConfig) error { +func (mp *MessagePool) SetConfig(ctx context.Context, cfg *MpoolConfig) error { if err := validateConfg(cfg); err != nil { return err } @@ -88,7 +89,7 @@ func (mp *MessagePool) SetConfig(cfg *MpoolConfig) error { mp.cfgLk.Lock() mp.cfg = cfg - err := saveConfig(cfg, mp.ds) + err := saveConfig(ctx, cfg, mp.ds) if err != nil { log.Warnf("error persisting mpool config: %s", err) } diff --git a/pkg/messagepool/gas.go b/pkg/messagepool/gas.go index 17a9384250..f0675878da 100644 --- a/pkg/messagepool/gas.go +++ b/pkg/messagepool/gas.go @@ -49,14 +49,14 @@ func NewGasPriceCache() *GasPriceCache { } } -func (g *GasPriceCache) GetTSGasStats(provider Provider, ts *types.TipSet) ([]GasMeta, error) { +func (g *GasPriceCache) GetTSGasStats(ctx context.Context, provider Provider, ts *types.TipSet) ([]GasMeta, error) { i, has := g.c.Get(ts.Key()) if has { return i.([]GasMeta), nil } var prices []GasMeta - msgs, err := provider.MessagesForTipset(ts) + msgs, err := provider.MessagesForTipset(ctx, ts) if err != nil { return nil, xerrors.Errorf("loading messages: %w", err) } @@ -78,7 +78,7 @@ func (mp *MessagePool) GasEstimateFeeCap( maxqueueblks int64, tsk types.TipSetKey, ) (big.Int, error) { - ts, err := mp.api.ChainHead() + ts, err := mp.api.ChainHead(ctx) if err != nil { return types.NewGasFeeCap(0), err } @@ -137,7 +137,7 @@ func (mp *MessagePool) GasEstimateGasPremium( var prices []GasMeta var blocks int - ts, err := mp.api.ChainHead() + ts, err := mp.api.ChainHead(ctx) if err != nil { return big.Int{}, err } @@ -147,13 +147,13 @@ func (mp *MessagePool) GasEstimateGasPremium( break // genesis } - pts, err := mp.api.LoadTipSet(ts.Parents()) + pts, err := mp.api.LoadTipSet(ctx, ts.Parents()) if err != nil { return types.BigInt{}, err } blocks += len(pts.Blocks()) - meta, err := cache.GetTSGasStats(mp.api, pts) + meta, err := cache.GetTSGasStats(ctx, mp.api, pts) if err != nil { return types.BigInt{}, err } @@ -186,13 +186,13 @@ func (mp *MessagePool) GasEstimateGasPremium( func (mp *MessagePool) GasEstimateGasLimit(ctx context.Context, msgIn *types.Message, tsk types.TipSetKey) (int64, error) { if tsk.IsEmpty() { - ts, err := mp.api.ChainHead() + ts, err := mp.api.ChainHead(ctx) if err != nil { return -1, xerrors.Errorf("getting head: %v", err) } tsk = ts.Key() } - currTS, err := mp.api.ChainTipSet(tsk) + currTS, err := mp.api.ChainTipSet(ctx, tsk) if err != nil { return -1, xerrors.Errorf("getting tipset: %w", err) } @@ -234,7 +234,7 @@ func (mp *MessagePool) evalMessageGasLimit(ctx context.Context, msgIn *types.Mes break } - ts, err = mp.api.ChainTipSet(ts.Parents()) + ts, err = mp.api.ChainTipSet(ctx, ts.Parents()) if err != nil { return -1, xerrors.Errorf("getting parent tipset: %v", err) } @@ -247,7 +247,7 @@ func (mp *MessagePool) evalMessageGasLimit(ctx context.Context, msgIn *types.Mes } // Special case for PaymentChannel collect, which is deleting actor - pts, err := mp.api.ChainTipSet(ts.Parents()) + pts, err := mp.api.ChainTipSet(ctx, ts.Parents()) if err != nil { _ = err // somewhat ignore it as it can happen and we just want to detect @@ -316,7 +316,7 @@ func (mp *MessagePool) GasBatchEstimateMessageGas(ctx context.Context, estimateM } // ChainTipSet will determine if tsk is empty - currTS, err := mp.api.ChainTipSet(tsk) + currTS, err := mp.api.ChainTipSet(ctx, tsk) if err != nil { return nil, xerrors.Errorf("getting tipset: %w", err) } diff --git a/pkg/messagepool/messagepool.go b/pkg/messagepool/messagepool.go index 6938953f5c..d0ab1081b9 100644 --- a/pkg/messagepool/messagepool.go +++ b/pkg/messagepool/messagepool.go @@ -370,7 +370,8 @@ func (ms *msgSet) toSlice() []*types.SignedMessage { return set } -func New(api Provider, +func New(ctx context.Context, + api Provider, sm *statemanger.Stmgr, ds repo.Datastore, forkParams *config.ForkUpgradeConfig, @@ -381,7 +382,7 @@ func New(api Provider, cache, _ := lru.New2Q(constants.BlsSignatureCacheSize) verifcache, _ := lru.New2Q(constants.VerifSigCacheSize) - cfg, err := loadConfig(ds) + cfg, err := loadConfig(ctx, ds) if err != nil { return nil, xerrors.Errorf("error loading mpool config: %v", err) } @@ -428,7 +429,7 @@ func New(api Provider, ctx, cancel := context.WithCancel(context.TODO()) // load the current tipset and subscribe to head changes _before_ loading local messages - mp.curTS = api.SubscribeHeadChanges(func(rev, app []*types.TipSet) error { + mp.curTS = api.SubscribeHeadChanges(ctx, func(rev, app []*types.TipSet) error { err := mp.HeadChange(ctx, rev, app) if err != nil { log.Errorf("mpool head notif handler error: %+v", err) @@ -594,7 +595,7 @@ func (mp *MessagePool) PublishMsgForWallet(ctx context.Context, addr address.Add continue } - err = mp.api.PubSubPublish(msgsub.Topic(mp.netName), msgb) + err = mp.api.PubSubPublish(ctx, msgsub.Topic(mp.netName), msgb) if err != nil { log.Errorf("could not publish: %s", err) continue @@ -604,13 +605,13 @@ func (mp *MessagePool) PublishMsgForWallet(ctx context.Context, addr address.Add return nil } -func (mp *MessagePool) PublishMsg(smsg *types.SignedMessage) error { +func (mp *MessagePool) PublishMsg(ctx context.Context, smsg *types.SignedMessage) error { msgb, err := smsg.Serialize() if err != nil { return xerrors.Errorf("could not serialize: %s", err) } - err = mp.api.PubSubPublish(msgsub.Topic(mp.netName), msgb) + err = mp.api.PubSubPublish(ctx, msgsub.Topic(mp.netName), msgb) if err != nil { return xerrors.Errorf("could not publish: %s", err) } @@ -671,7 +672,7 @@ func (mp *MessagePool) addLocal(ctx context.Context, m *types.SignedMessage) err msgb := buf.Bytes() c := m.Cid() - if err := mp.localMsgs.Put(datastore.NewKey(string(c.Bytes())), msgb); err != nil { + if err := mp.localMsgs.Put(ctx, datastore.NewKey(string(c.Bytes())), msgb); err != nil { return xerrors.Errorf("persisting local message: %v", err) } @@ -758,7 +759,7 @@ func (mp *MessagePool) Push(ctx context.Context, m *types.SignedMessage) (cid.Ci return cid.Undef, xerrors.Errorf("error serializing message: %v", err) } - err = mp.api.PubSubPublish(msgsub.Topic(mp.netName), buf.Bytes()) + err = mp.api.PubSubPublish(ctx, msgsub.Topic(mp.netName), buf.Bytes()) if err != nil { return cid.Undef, xerrors.Errorf("error publishing message: %v", err) } @@ -971,12 +972,12 @@ func (mp *MessagePool) addLocked(ctx context.Context, m *types.SignedMessage, st mp.blsSigCache.Add(m.Cid(), m.Signature) } - if _, err := mp.api.PutMessage(m); err != nil { + if _, err := mp.api.PutMessage(ctx, m); err != nil { log.Warnf("mpooladd sm.PutMessage failed: %s", err) return err } - if _, err := mp.api.PutMessage(&m.Message); err != nil { + if _, err := mp.api.PutMessage(ctx, &m.Message); err != nil { log.Warnf("mpooladd sm.PutMessage failed: %s", err) return err } @@ -1044,10 +1045,10 @@ func (mp *MessagePool) GetNonce(ctx context.Context, addr address.Address, _ typ } // GetActor should not be used. It is only here to satisfy interface mess caused by lite node handling -func (mp *MessagePool) GetActor(_ context.Context, addr address.Address, _ types.TipSetKey) (*types.Actor, error) { +func (mp *MessagePool) GetActor(ctx context.Context, addr address.Address, _ types.TipSetKey) (*types.Actor, error) { mp.curTSLk.Lock() defer mp.curTSLk.Unlock() - return mp.api.GetActorAfter(addr, mp.curTS) + return mp.api.GetActorAfter(ctx, addr, mp.curTS) } func (mp *MessagePool) getNonceLocked(ctx context.Context, addr address.Address, curTS *types.TipSet) (uint64, error) { @@ -1076,7 +1077,7 @@ func (mp *MessagePool) getNonceLocked(ctx context.Context, addr address.Address, } func (mp *MessagePool) getStateNonce(ctx context.Context, addr address.Address, curTS *types.TipSet) (uint64, error) { - act, err := mp.api.GetActorAfter(addr, curTS) + act, err := mp.api.GetActorAfter(ctx, addr, curTS) if err != nil { return 0, err } @@ -1085,7 +1086,7 @@ func (mp *MessagePool) getStateNonce(ctx context.Context, addr address.Address, } func (mp *MessagePool) getStateBalance(ctx context.Context, addr address.Address, ts *types.TipSet) (big.Int, error) { - act, err := mp.api.GetActorAfter(addr, ts) + act, err := mp.api.GetActorAfter(ctx, addr, ts) if err != nil { return big.Zero(), err } @@ -1125,7 +1126,7 @@ func (mp *MessagePool) PushUntrusted(ctx context.Context, m *types.SignedMessage return cid.Undef, xerrors.Errorf("error serializing message: %v", err) } - err = mp.api.PubSubPublish(msgsub.Topic(mp.netName), buf.Bytes()) + err = mp.api.PubSubPublish(ctx, msgsub.Topic(mp.netName), buf.Bytes()) if err != nil { return cid.Undef, xerrors.Errorf("error publishing message: %v", err) } @@ -1265,7 +1266,7 @@ func (mp *MessagePool) HeadChange(ctx context.Context, revert []*types.TipSet, a for _, ts := range revert { tsKey := ts.Parents() - pts, err := mp.api.LoadTipSet(tsKey) + pts, err := mp.api.LoadTipSet(ctx, tsKey) if err != nil { log.Errorf("error loading reverted tipset parent: %s", err) merr = multierror.Append(merr, err) @@ -1274,7 +1275,7 @@ func (mp *MessagePool) HeadChange(ctx context.Context, revert []*types.TipSet, a mp.curTS = pts - msgs, err := mp.MessagesForBlocks(ts.Blocks()) + msgs, err := mp.MessagesForBlocks(ctx, ts.Blocks()) if err != nil { log.Errorf("error retrieving messages for reverted block: %s", err) merr = multierror.Append(merr, err) @@ -1290,7 +1291,7 @@ func (mp *MessagePool) HeadChange(ctx context.Context, revert []*types.TipSet, a mp.curTS = ts for _, b := range ts.Blocks() { - bmsgs, smsgs, err := mp.api.MessagesForBlock(b) + bmsgs, smsgs, err := mp.api.MessagesForBlock(ctx, b) if err != nil { xerr := xerrors.Errorf("failed to get messages for apply block %s(height %d) (msgroot = %s): %v", b.Cid(), b.Height, b.Messages, err) log.Errorf("error retrieving messages for block: %s", xerr) @@ -1346,7 +1347,7 @@ func (mp *MessagePool) HeadChange(ctx context.Context, revert []*types.TipSet, a for a, bkt := range buckets { // TODO that might not be correct with GatActorAfter but it is only debug code - act, err := mp.api.GetActorAfter(a, ts) + act, err := mp.api.GetActorAfter(ctx, a, ts) if err != nil { log.Debugf("%s, err: %s\n", a, err) continue @@ -1397,7 +1398,7 @@ func (mp *MessagePool) HeadChange(ctx context.Context, revert []*types.TipSet, a return merr } -func (mp *MessagePool) runHeadChange(from *types.TipSet, to *types.TipSet, rmsgs map[address.Address]map[uint64]*types.SignedMessage) error { +func (mp *MessagePool) runHeadChange(ctx context.Context, from *types.TipSet, to *types.TipSet, rmsgs map[address.Address]map[uint64]*types.SignedMessage) error { add := func(m *types.SignedMessage) { s, ok := rmsgs[m.Message.From] if !ok { @@ -1427,7 +1428,7 @@ func (mp *MessagePool) runHeadChange(from *types.TipSet, to *types.TipSet, rmsgs var merr error for _, ts := range revert { - msgs, err := mp.MessagesForBlocks(ts.Blocks()) + msgs, err := mp.MessagesForBlocks(ctx, ts.Blocks()) if err != nil { log.Errorf("error retrieving messages for reverted block: %s", err) merr = multierror.Append(merr, err) @@ -1441,7 +1442,7 @@ func (mp *MessagePool) runHeadChange(from *types.TipSet, to *types.TipSet, rmsgs for _, ts := range apply { for _, b := range ts.Blocks() { - bmsgs, smsgs, err := mp.api.MessagesForBlock(b) + bmsgs, smsgs, err := mp.api.MessagesForBlock(context.TODO(), b) if err != nil { xerr := xerrors.Errorf("failed to get messages for apply block %s(height %d) (msgroot = %s): %v", b.Cid(), b.Height, b.Messages, err) log.Errorf("error retrieving messages for block: %s", xerr) @@ -1466,11 +1467,11 @@ type statBucket struct { msgs map[uint64]*types.SignedMessage } -func (mp *MessagePool) MessagesForBlocks(blks []*types.BlockHeader) ([]*types.SignedMessage, error) { +func (mp *MessagePool) MessagesForBlocks(ctx context.Context, blks []*types.BlockHeader) ([]*types.SignedMessage, error) { out := make([]*types.SignedMessage, 0) for _, b := range blks { - bmsgs, smsgs, err := mp.api.MessagesForBlock(b) + bmsgs, smsgs, err := mp.api.MessagesForBlock(ctx, b) if err != nil { return nil, xerrors.Errorf("failed to get messages for apply block %s(height %d) (msgroot = %s): %v", b.Cid(), b.Height, b.Messages, err) } @@ -1541,7 +1542,7 @@ func (mp *MessagePool) loadLocal(ctx context.Context) error { return nil } - res, err := mp.localMsgs.Query(query.Query{}) + res, err := mp.localMsgs.Query(ctx, query.Query{}) if err != nil { return xerrors.Errorf("query local messages: %v", err) } @@ -1589,7 +1590,7 @@ func (mp *MessagePool) Clear(ctx context.Context, local bool) { if ok { for _, m := range mset.msgs { - err := mp.localMsgs.Delete(datastore.NewKey(string(m.Cid().Bytes()))) + err := mp.localMsgs.Delete(ctx, datastore.NewKey(string(m.Cid().Bytes()))) if err != nil { log.Warnf("error deleting local message: %s", err) } diff --git a/pkg/messagepool/messagepool_test.go b/pkg/messagepool/messagepool_test.go index c17216e280..f95e2ff30d 100644 --- a/pkg/messagepool/messagepool_test.go +++ b/pkg/messagepool/messagepool_test.go @@ -66,7 +66,7 @@ func mkMessage(from, to address.Address, nonce uint64, w *wallet.Wallet) *types. } c := msg.Cid() - sig, err := w.WalletSign(from, c.Bytes(), wtypes.MsgMeta{}) + sig, err := w.WalletSign(context.Background(), from, c.Bytes(), wtypes.MsgMeta{}) if err != nil { panic(err) } @@ -185,20 +185,20 @@ func (tma *testMpoolAPI) setBlockMessages(h *types.BlockHeader, msgs ...*types.S tma.bmsgs[h.Cid()] = msgs } -func (tma *testMpoolAPI) ChainHead() (*types.TipSet, error) { +func (tma *testMpoolAPI) ChainHead(ctx context.Context) (*types.TipSet, error) { return &types.TipSet{}, nil } -func (tma *testMpoolAPI) ChainTipSet(key types.TipSetKey) (*types.TipSet, error) { +func (tma *testMpoolAPI) ChainTipSet(ctx context.Context, key types.TipSetKey) (*types.TipSet, error) { return &types.TipSet{}, nil } -func (tma *testMpoolAPI) SubscribeHeadChanges(cb func(rev, app []*types.TipSet) error) *types.TipSet { +func (tma *testMpoolAPI) SubscribeHeadChanges(ctx context.Context, cb func(rev, app []*types.TipSet) error) *types.TipSet { tma.cb = cb return tma.tipsets[0] } -func (tma *testMpoolAPI) PutMessage(m types.ChainMsg) (cid.Cid, error) { +func (tma *testMpoolAPI) PutMessage(ctx context.Context, m types.ChainMsg) (cid.Cid, error) { return cid.Undef, nil } @@ -206,12 +206,12 @@ func (tma *testMpoolAPI) IsLite() bool { return false } -func (tma *testMpoolAPI) PubSubPublish(string, []byte) error { +func (tma *testMpoolAPI) PubSubPublish(context.Context, string, []byte) error { tma.published++ return nil } -func (tma *testMpoolAPI) GetActorAfter(addr address.Address, ts *types.TipSet) (*types.Actor, error) { +func (tma *testMpoolAPI) GetActorAfter(ctx context.Context, addr address.Address, ts *types.TipSet) (*types.Actor, error) { // regression check for load bug if ts == nil { panic("GetActorAfter called with nil tipset") @@ -266,16 +266,16 @@ func (tma *testMpoolAPI) StateAccountKey(ctx context.Context, addr address.Addre return addr, nil } -func (tma *testMpoolAPI) MessagesForBlock(h *types.BlockHeader) ([]*types.Message, []*types.SignedMessage, error) { +func (tma *testMpoolAPI) MessagesForBlock(ctx context.Context, h *types.BlockHeader) ([]*types.Message, []*types.SignedMessage, error) { return nil, tma.bmsgs[h.Cid()], nil } -func (tma *testMpoolAPI) MessagesForTipset(ts *types.TipSet) ([]types.ChainMsg, error) { +func (tma *testMpoolAPI) MessagesForTipset(ctx context.Context, ts *types.TipSet) ([]types.ChainMsg, error) { if len(ts.Blocks()) != 1 { panic("cant deal with multiblock tipsets in this test") } - bm, sm, err := tma.MessagesForBlock(ts.Blocks()[0]) + bm, sm, err := tma.MessagesForBlock(ctx, ts.Blocks()[0]) if err != nil { return nil, err } @@ -292,7 +292,7 @@ func (tma *testMpoolAPI) MessagesForTipset(ts *types.TipSet) ([]types.ChainMsg, return out, nil } -func (tma *testMpoolAPI) LoadTipSet(tsk types.TipSetKey) (*types.TipSet, error) { +func (tma *testMpoolAPI) LoadTipSet(ctx context.Context, tsk types.TipSetKey) (*types.TipSet, error) { for _, ts := range tma.tipsets { if tsk.Equals(ts.Key()) { return ts, nil @@ -332,7 +332,7 @@ func mustAdd(t *testing.T, mp *MessagePool, msg *types.SignedMessage) { func newWalletAndMpool(t *testing.T, tma *testMpoolAPI) (*wallet.Wallet, *MessagePool) { ds := datastore.NewMapDatastore() - mp, err := New(tma, nil, ds, config.DefaultForkUpgradeParam, config.DefaultMessagePoolParam, "mptest", nil) + mp, err := New(context.Background(), tma, nil, ds, config.DefaultForkUpgradeParam, config.DefaultMessagePoolParam, "mptest", nil) if err != nil { t.Fatal(err) } @@ -342,7 +342,7 @@ func newWalletAndMpool(t *testing.T, tma *testMpoolAPI) (*wallet.Wallet, *Messag func newWallet(t *testing.T) *wallet.Wallet { r := repo.NewInMemoryRepo() - backend, err := wallet.NewDSBackend(r.WalletDatastore(), r.Config().Wallet.PassphraseConfig, wallet.TestPassword) + backend, err := wallet.NewDSBackend(context.Background(), r.WalletDatastore(), r.Config().Wallet.PassphraseConfig, wallet.TestPassword) assert.NoError(t, err) return wallet.New(backend) @@ -357,7 +357,7 @@ func TestMessagePool(t *testing.T) { a := tma.nextBlock() - sender, err := w.NewAddress(address.SECP256K1) + sender, err := w.NewAddress(context.Background(), address.SECP256K1) if err != nil { t.Fatal(err) } @@ -386,7 +386,7 @@ func TestCheckMessageBig(t *testing.T) { tma := newTestMpoolAPI() w, mp := newWalletAndMpool(t, tma) - from, err := w.NewAddress(address.SECP256K1) + from, err := w.NewAddress(context.Background(), address.SECP256K1) assert.NoError(t, err) tma.setBalance(from, 1000e9) @@ -405,7 +405,7 @@ func TestCheckMessageBig(t *testing.T) { Params: make([]byte, 41<<10), // 41KiB payload } - sig, err := w.WalletSign(from, msg.Cid().Bytes(), wtypes.MsgMeta{}) + sig, err := w.WalletSign(context.Background(), from, msg.Cid().Bytes(), wtypes.MsgMeta{}) if err != nil { panic(err) } @@ -428,7 +428,7 @@ func TestCheckMessageBig(t *testing.T) { Params: make([]byte, 64<<10), // 64KiB payload } - sig, err := w.WalletSign(from, msg.Cid().Bytes(), wtypes.MsgMeta{}) + sig, err := w.WalletSign(context.Background(), from, msg.Cid().Bytes(), wtypes.MsgMeta{}) if err != nil { panic(err) } @@ -450,7 +450,7 @@ func TestMessagePoolMessagesInEachBlock(t *testing.T) { a := tma.nextBlock() - sender, err := w.NewAddress(address.SECP256K1) + sender, err := w.NewAddress(context.Background(), address.SECP256K1) if err != nil { t.Fatal(err) } @@ -492,7 +492,7 @@ func TestRevertMessages(t *testing.T) { a := tma.nextBlock() b := tma.nextBlock() - sender, err := w.NewAddress(address.SECP256K1) + sender, err := w.NewAddress(context.Background(), address.SECP256K1) if err != nil { t.Fatal(err) } @@ -547,7 +547,7 @@ func TestPruningSimple(t *testing.T) { a := tma.nextBlock() tma.applyBlock(t, a) - sender, err := w.NewAddress(address.SECP256K1) + sender, err := w.NewAddress(context.Background(), address.SECP256K1) if err != nil { t.Fatal(err) } @@ -585,21 +585,21 @@ func TestLoadLocal(t *testing.T) { tma := newTestMpoolAPI() ds := datastore.NewMapDatastore() - mp, err := New(tma, nil, ds, config.DefaultForkUpgradeParam, config.DefaultMessagePoolParam, "mptest", nil) + mp, err := New(context.Background(), tma, nil, ds, config.DefaultForkUpgradeParam, config.DefaultMessagePoolParam, "mptest", nil) if err != nil { t.Fatal(err) } // the actors w1 := newWallet(t) - a1, err := w1.NewAddress(address.SECP256K1) + a1, err := w1.NewAddress(context.Background(), address.SECP256K1) if err != nil { t.Fatal(err) } w2 := newWallet(t) - a2, err := w2.NewAddress(address.SECP256K1) + a2, err := w2.NewAddress(context.Background(), address.SECP256K1) if err != nil { t.Fatal(err) } @@ -621,7 +621,7 @@ func TestLoadLocal(t *testing.T) { t.Fatal(err) } - mp, err = New(tma, nil, ds, config.DefaultForkUpgradeParam, config.DefaultMessagePoolParam, "mptest", nil) + mp, err = New(context.Background(), tma, nil, ds, config.DefaultForkUpgradeParam, config.DefaultMessagePoolParam, "mptest", nil) if err != nil { t.Fatal(err) } @@ -652,20 +652,20 @@ func TestClearAll(t *testing.T) { tma := newTestMpoolAPI() ds := datastore.NewMapDatastore() - mp, err := New(tma, nil, ds, config.DefaultForkUpgradeParam, config.DefaultMessagePoolParam, "mptest", nil) + mp, err := New(context.Background(), tma, nil, ds, config.DefaultForkUpgradeParam, config.DefaultMessagePoolParam, "mptest", nil) if err != nil { t.Fatal(err) } // the actors w1 := newWallet(t) - a1, err := w1.NewAddress(address.SECP256K1) + a1, err := w1.NewAddress(context.Background(), address.SECP256K1) if err != nil { t.Fatal(err) } w2 := newWallet(t) - a2, err := w2.NewAddress(address.SECP256K1) + a2, err := w2.NewAddress(context.Background(), address.SECP256K1) if err != nil { t.Fatal(err) } @@ -700,20 +700,20 @@ func TestClearNonLocal(t *testing.T) { tma := newTestMpoolAPI() ds := datastore.NewMapDatastore() - mp, err := New(tma, nil, ds, config.DefaultForkUpgradeParam, config.DefaultMessagePoolParam, "mptest", nil) + mp, err := New(context.Background(), tma, nil, ds, config.DefaultForkUpgradeParam, config.DefaultMessagePoolParam, "mptest", nil) if err != nil { t.Fatal(err) } // the actors w1 := newWallet(t) - a1, err := w1.NewAddress(address.SECP256K1) + a1, err := w1.NewAddress(context.Background(), address.SECP256K1) if err != nil { t.Fatal(err) } w2 := newWallet(t) - a2, err := w2.NewAddress(address.SECP256K1) + a2, err := w2.NewAddress(context.Background(), address.SECP256K1) if err != nil { t.Fatal(err) } @@ -755,20 +755,20 @@ func TestUpdates(t *testing.T) { tma := newTestMpoolAPI() ds := datastore.NewMapDatastore() - mp, err := New(tma, nil, ds, config.DefaultForkUpgradeParam, config.DefaultMessagePoolParam, "mptest", nil) + mp, err := New(context.Background(), tma, nil, ds, config.DefaultForkUpgradeParam, config.DefaultMessagePoolParam, "mptest", nil) if err != nil { t.Fatal(err) } // the actors w1 := newWallet(t) - a1, err := w1.NewAddress(address.SECP256K1) + a1, err := w1.NewAddress(context.Background(), address.SECP256K1) if err != nil { t.Fatal(err) } w2 := newWallet(t) - a2, err := w2.NewAddress(address.SECP256K1) + a2, err := w2.NewAddress(context.Background(), address.SECP256K1) if err != nil { t.Fatal(err) } diff --git a/pkg/messagepool/messagesigner.go b/pkg/messagepool/messagesigner.go index 32ee6643d9..87953c873b 100644 --- a/pkg/messagepool/messagesigner.go +++ b/pkg/messagepool/messagesigner.go @@ -62,7 +62,7 @@ func (ms *MessageSigner) SignMessage(ctx context.Context, msg *types.Message, cb return nil, xerrors.Errorf("serializing message: %w", err) } - sig, err := ms.wallet.WalletSign(msg.From, mb.Cid().Bytes(), mptypes.MsgMeta{ + sig, err := ms.wallet.WalletSign(ctx, msg.From, mb.Cid().Bytes(), mptypes.MsgMeta{ Type: mptypes.MTChainMsg, Extra: mb.RawData(), }) @@ -81,7 +81,7 @@ func (ms *MessageSigner) SignMessage(ctx context.Context, msg *types.Message, cb } // If the callback executed successfully, write the nonce to the datastore - if err := ms.saveNonce(msg.From, nonce); err != nil { + if err := ms.saveNonce(ctx, msg.From, nonce); err != nil { return nil, xerrors.Errorf("failed to save nonce: %w", err) } @@ -102,7 +102,7 @@ func (ms *MessageSigner) nextNonce(ctx context.Context, addr address.Address) (u // Get the next nonce for this address from the datastore addrNonceKey := ms.dstoreKey(addr) - dsNonceBytes, err := ms.ds.Get(addrNonceKey) + dsNonceBytes, err := ms.ds.Get(ctx, addrNonceKey) switch { case xerrors.Is(err, datastore.ErrNotFound): @@ -136,7 +136,7 @@ func (ms *MessageSigner) nextNonce(ctx context.Context, addr address.Address) (u // saveNonce increments the nonce for this address and writes it to the // datastore -func (ms *MessageSigner) saveNonce(addr address.Address, nonce uint64) error { +func (ms *MessageSigner) saveNonce(ctx context.Context, addr address.Address, nonce uint64) error { // Increment the nonce nonce++ @@ -147,7 +147,7 @@ func (ms *MessageSigner) saveNonce(addr address.Address, nonce uint64) error { if err != nil { return xerrors.Errorf("failed to marshall nonce: %w", err) } - err = ms.ds.Put(addrNonceKey, buf.Bytes()) + err = ms.ds.Put(ctx, addrNonceKey, buf.Bytes()) if err != nil { return xerrors.Errorf("failed to write nonce to datastore: %w", err) } diff --git a/pkg/messagepool/messagesigner_test.go b/pkg/messagepool/messagesigner_test.go index 94a876f30c..15bd2db492 100644 --- a/pkg/messagepool/messagesigner_test.go +++ b/pkg/messagepool/messagesigner_test.go @@ -5,25 +5,19 @@ import ( "sync" "testing" - "github.com/filecoin-project/venus/pkg/repo" - types "github.com/filecoin-project/venus/venus-shared/chain" - "github.com/stretchr/testify/assert" - - "golang.org/x/xerrors" - - "github.com/filecoin-project/venus/pkg/wallet" - - "github.com/stretchr/testify/require" - - ds_sync "github.com/ipfs/go-datastore/sync" - "github.com/filecoin-project/go-address" - - tf "github.com/filecoin-project/venus/pkg/testhelpers/testflags" + "github.com/filecoin-project/venus/pkg/wallet" "github.com/ipfs/go-datastore" + ds_sync "github.com/ipfs/go-datastore/sync" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "golang.org/x/xerrors" _ "github.com/filecoin-project/venus/pkg/crypto/bls" _ "github.com/filecoin-project/venus/pkg/crypto/secp" + "github.com/filecoin-project/venus/pkg/repo" + tf "github.com/filecoin-project/venus/pkg/testhelpers/testflags" + types "github.com/filecoin-project/venus/venus-shared/chain" ) type mockMpool struct { @@ -59,18 +53,18 @@ func TestMessageSignerSignMessage(t *testing.T) { ctx := context.Background() r := repo.NewInMemoryRepo() - backend, err := wallet.NewDSBackend(r.WalletDatastore(), r.Config().Wallet.PassphraseConfig, wallet.TestPassword) + backend, err := wallet.NewDSBackend(ctx, r.WalletDatastore(), r.Config().Wallet.PassphraseConfig, wallet.TestPassword) assert.NoError(t, err) w := wallet.New(backend) - from1, err := w.NewAddress(address.SECP256K1) + from1, err := w.NewAddress(ctx, address.SECP256K1) require.NoError(t, err) - from2, err := w.NewAddress(address.SECP256K1) + from2, err := w.NewAddress(ctx, address.SECP256K1) require.NoError(t, err) - to1, err := w.NewAddress(address.SECP256K1) + to1, err := w.NewAddress(ctx, address.SECP256K1) require.NoError(t, err) - to2, err := w.NewAddress(address.SECP256K1) + to2, err := w.NewAddress(ctx, address.SECP256K1) require.NoError(t, err) type msgSpec struct { diff --git a/pkg/messagepool/provider.go b/pkg/messagepool/provider.go index 67e93abcf2..d6ba9ae8a4 100644 --- a/pkg/messagepool/provider.go +++ b/pkg/messagepool/provider.go @@ -23,17 +23,17 @@ var ( ) type Provider interface { - ChainHead() (*types.TipSet, error) - ChainTipSet(types.TipSetKey) (*types.TipSet, error) - SubscribeHeadChanges(func(rev, app []*types.TipSet) error) *types.TipSet - PutMessage(m types.ChainMsg) (cid.Cid, error) - PubSubPublish(string, []byte) error - GetActorAfter(address.Address, *types.TipSet) (*types.Actor, error) + ChainHead(ctx context.Context) (*types.TipSet, error) + ChainTipSet(context.Context, types.TipSetKey) (*types.TipSet, error) + SubscribeHeadChanges(context.Context, func(rev, app []*types.TipSet) error) *types.TipSet + PutMessage(context.Context, types.ChainMsg) (cid.Cid, error) + PubSubPublish(context.Context, string, []byte) error + GetActorAfter(context.Context, address.Address, *types.TipSet) (*types.Actor, error) StateAccountKeyAtFinality(context.Context, address.Address, *types.TipSet) (address.Address, error) StateAccountKey(context.Context, address.Address, *types.TipSet) (address.Address, error) - MessagesForBlock(block2 *types.BlockHeader) ([]*types.Message, []*types.SignedMessage, error) - MessagesForTipset(*types.TipSet) ([]types.ChainMsg, error) - LoadTipSet(tsk types.TipSetKey) (*types.TipSet, error) + MessagesForBlock(context.Context, *types.BlockHeader) ([]*types.Message, []*types.SignedMessage, error) + MessagesForTipset(context.Context, *types.TipSet) ([]types.ChainMsg, error) + LoadTipSet(context.Context, types.TipSetKey) (*types.TipSet, error) ChainComputeBaseFee(ctx context.Context, ts *types.TipSet) (tbig.Int, error) IsLite() bool } @@ -68,7 +68,7 @@ func (mpp *mpoolProvider) IsLite() bool { return mpp.lite != nil } -func (mpp *mpoolProvider) SubscribeHeadChanges(cb func(rev, app []*types.TipSet) error) *types.TipSet { +func (mpp *mpoolProvider) SubscribeHeadChanges(ctx context.Context, cb func(rev, app []*types.TipSet) error) *types.TipSet { mpp.sm.SubscribeHeadChanges( chain.WrapHeadChangeCoalescer( cb, @@ -79,23 +79,23 @@ func (mpp *mpoolProvider) SubscribeHeadChanges(cb func(rev, app []*types.TipSet) return mpp.sm.GetHead() } -func (mpp *mpoolProvider) ChainHead() (*types.TipSet, error) { +func (mpp *mpoolProvider) ChainHead(context.Context) (*types.TipSet, error) { return mpp.sm.GetHead(), nil } -func (mpp *mpoolProvider) ChainTipSet(key types.TipSetKey) (*types.TipSet, error) { - return mpp.sm.GetTipSet(key) +func (mpp *mpoolProvider) ChainTipSet(ctx context.Context, key types.TipSetKey) (*types.TipSet, error) { + return mpp.sm.GetTipSet(ctx, key) } -func (mpp *mpoolProvider) PutMessage(m types.ChainMsg) (cid.Cid, error) { - return mpp.sm.PutMessage(m) +func (mpp *mpoolProvider) PutMessage(ctx context.Context, m types.ChainMsg) (cid.Cid, error) { + return mpp.sm.PutMessage(ctx, m) } -func (mpp *mpoolProvider) PubSubPublish(k string, v []byte) error { +func (mpp *mpoolProvider) PubSubPublish(ctx context.Context, k string, v []byte) error { return mpp.ps.Publish(k, v) // nolint } -func (mpp *mpoolProvider) GetActorAfter(addr address.Address, ts *types.TipSet) (*types.Actor, error) { +func (mpp *mpoolProvider) GetActorAfter(ctx context.Context, addr address.Address, ts *types.TipSet) (*types.Actor, error) { if mpp.IsLite() { n, err := mpp.lite.GetNonce(context.TODO(), addr, ts.Key()) if err != nil { @@ -137,17 +137,17 @@ func (mpp *mpoolProvider) StateAccountKey(ctx context.Context, addr address.Addr return mpp.stmgr.ResolveToKeyAddress(ctx, addr, ts) } -func (mpp *mpoolProvider) MessagesForBlock(h *types.BlockHeader) ([]*types.Message, []*types.SignedMessage, error) { +func (mpp *mpoolProvider) MessagesForBlock(ctx context.Context, h *types.BlockHeader) ([]*types.Message, []*types.SignedMessage, error) { secpMsgs, blsMsgs, err := mpp.cms.LoadMetaMessages(context.TODO(), h.Messages) return blsMsgs, secpMsgs, err } -func (mpp *mpoolProvider) MessagesForTipset(ts *types.TipSet) ([]types.ChainMsg, error) { +func (mpp *mpoolProvider) MessagesForTipset(ctx context.Context, ts *types.TipSet) ([]types.ChainMsg, error) { return mpp.cms.MessagesForTipset(ts) } -func (mpp *mpoolProvider) LoadTipSet(tsk types.TipSetKey) (*types.TipSet, error) { - return mpp.sm.GetTipSet(tsk) +func (mpp *mpoolProvider) LoadTipSet(ctx context.Context, tsk types.TipSetKey) (*types.TipSet, error) { + return mpp.sm.GetTipSet(ctx, tsk) } func (mpp *mpoolProvider) ChainComputeBaseFee(ctx context.Context, ts *types.TipSet) (tbig.Int, error) { diff --git a/pkg/messagepool/pruning.go b/pkg/messagepool/pruning.go index f0380897c6..373f715584 100644 --- a/pkg/messagepool/pruning.go +++ b/pkg/messagepool/pruning.go @@ -48,7 +48,7 @@ func (mp *MessagePool) pruneMessages(ctx context.Context, ts *types.TipSet) erro } baseFeeLowerBound := getBaseFeeLowerBound(baseFee, baseFeeLowerBoundFactor) - pending, _ := mp.getPendingMessages(ts, ts) + pending, _ := mp.getPendingMessages(ctx, ts, ts) // protected actors -- not pruned protected := make(map[address.Address]struct{}) @@ -85,7 +85,7 @@ func (mp *MessagePool) pruneMessages(ctx context.Context, ts *types.TipSet) erro for _, m := range mset { pruneMsgs[m.Message.Cid()] = m } - actorChains := mp.createMessageChains(actor, mset, baseFeeLowerBound, ts) + actorChains := mp.createMessageChains(ctx, actor, mset, baseFeeLowerBound, ts) chains = append(chains, actorChains...) } diff --git a/pkg/messagepool/repub.go b/pkg/messagepool/repub.go index 927b483b70..fe3da1b9b8 100644 --- a/pkg/messagepool/repub.go +++ b/pkg/messagepool/repub.go @@ -62,7 +62,7 @@ func (mp *MessagePool) republishPendingMessages(ctx context.Context) error { // chains that might become profitable in the next 20 blocks. // We still check the lowerBound condition for individual messages so that we don't send // messages that will be rejected by the mpool spam protector, so this is safe to do. - next := mp.createMessageChains(actor, mset, baseFeeLowerBound, ts) + next := mp.createMessageChains(ctx, actor, mset, baseFeeLowerBound, ts) chains = append(chains, next...) } @@ -136,7 +136,7 @@ LOOP: return xerrors.Errorf("cannot serialize message: %v", err) } - err = mp.api.PubSubPublish(msgsub.Topic(mp.netName), buf.Bytes()) + err = mp.api.PubSubPublish(ctx, msgsub.Topic(mp.netName), buf.Bytes()) if err != nil { return xerrors.Errorf("cannot publish: %v", err) } diff --git a/pkg/messagepool/repub_test.go b/pkg/messagepool/repub_test.go index 277757b2ae..b8312565a1 100644 --- a/pkg/messagepool/repub_test.go +++ b/pkg/messagepool/repub_test.go @@ -26,20 +26,21 @@ func TestRepubMessages(t *testing.T) { tma := newTestMpoolAPI() ds := datastore.NewMapDatastore() - mp, err := New(tma, nil, ds, config.DefaultForkUpgradeParam, config.DefaultMessagePoolParam, "mptest", nil) + mp, err := New(context.Background(), tma, nil, ds, config.DefaultForkUpgradeParam, config.DefaultMessagePoolParam, "mptest", nil) if err != nil { t.Fatal(err) } // the actors + ctx := context.Background() w1 := newWallet(t) - a1, err := w1.NewAddress(address.SECP256K1) + a1, err := w1.NewAddress(ctx, address.SECP256K1) if err != nil { t.Fatal(err) } w2 := newWallet(t) - a2, err := w2.NewAddress(address.SECP256K1) + a2, err := w2.NewAddress(ctx, address.SECP256K1) if err != nil { t.Fatal(err) } diff --git a/pkg/messagepool/selection.go b/pkg/messagepool/selection.go index f43504cc25..c156392b9a 100644 --- a/pkg/messagepool/selection.go +++ b/pkg/messagepool/selection.go @@ -82,7 +82,7 @@ func (mp *MessagePool) MultipleSelectMessages(ctx context.Context, ts *types.Tip // Load messages for the target tipset; if it is the same as the current tipset in the mpool // then this is just the pending messages - pending, err := mp.getPendingMessages(mp.curTS, ts) + pending, err := mp.getPendingMessages(ctx, mp.curTS, ts) if err != nil { return nil, err } @@ -155,7 +155,7 @@ func (mp *MessagePool) multiSelectMessagesOptimal(ctx context.Context, curTS, ts startChains := time.Now() var chains []*msgChain for actor, mset := range pending { - next := mp.createMessageChains(actor, mset, baseFee, ts) + next := mp.createMessageChains(ctx, actor, mset, baseFee, ts) chains = append(chains, next...) } if dt := time.Since(startChains); dt > time.Millisecond { @@ -452,7 +452,7 @@ func (mp *MessagePool) selectMessagesOptimal(ctx context.Context, curTS, ts *typ // 0. Load messages from the target tipset; if it is the same as the current tipset in // the mpool, then this is just the pending messages - pending, err := mp.getPendingMessages(curTS, ts) + pending, err := mp.getPendingMessages(ctx, curTS, ts) if err != nil { return nil, err } @@ -479,7 +479,7 @@ func (mp *MessagePool) selectMessagesOptimal(ctx context.Context, curTS, ts *typ startChains := time.Now() var chains []*msgChain for actor, mset := range pending { - next := mp.createMessageChains(actor, mset, baseFee, ts) + next := mp.createMessageChains(ctx, actor, mset, baseFee, ts) chains = append(chains, next...) } if dt := time.Since(startChains); dt > time.Millisecond { @@ -796,7 +796,7 @@ func (mp *MessagePool) multiSelectMessagesGreedy(ctx context.Context, curTS, ts startChains := time.Now() var chains []*msgChain for actor, mset := range pending { - next := mp.createMessageChains(actor, mset, baseFee, ts) + next := mp.createMessageChains(ctx, actor, mset, baseFee, ts) chains = append(chains, next...) } if dt := time.Since(startChains); dt > time.Millisecond { @@ -905,7 +905,7 @@ func (mp *MessagePool) selectMessagesGreedy(ctx context.Context, curTS, ts *type // 0. Load messages for the target tipset; if it is the same as the current tipset in the mpool // then this is just the pending messages - pending, err := mp.getPendingMessages(curTS, ts) + pending, err := mp.getPendingMessages(ctx, curTS, ts) if err != nil { return nil, err } @@ -932,7 +932,7 @@ func (mp *MessagePool) selectMessagesGreedy(ctx context.Context, curTS, ts *type startChains := time.Now() var chains []*msgChain for actor, mset := range pending { - next := mp.createMessageChains(actor, mset, baseFee, ts) + next := mp.createMessageChains(ctx, actor, mset, baseFee, ts) chains = append(chains, next...) } if dt := time.Since(startChains); dt > time.Millisecond { @@ -1057,7 +1057,7 @@ func (mp *MessagePool) selectPriorityMessages(ctx context.Context, pending map[a // remove actor from pending set as we are already processed these messages delete(pending, pk) // create chains for the priority actor - next := mp.createMessageChains(actor, mset, baseFee, ts) + next := mp.createMessageChains(ctx, actor, mset, baseFee, ts) chains = append(chains, next...) } } @@ -1141,7 +1141,7 @@ tailLoop: return result, gasLimit } -func (mp *MessagePool) getPendingMessages(curTS, ts *types.TipSet) (map[address.Address]map[uint64]*types.SignedMessage, error) { +func (mp *MessagePool) getPendingMessages(ctx context.Context, curTS, ts *types.TipSet) (map[address.Address]map[uint64]*types.SignedMessage, error) { start := time.Now() result := make(map[address.Address]map[uint64]*types.SignedMessage) @@ -1177,7 +1177,7 @@ func (mp *MessagePool) getPendingMessages(curTS, ts *types.TipSet) (map[address. return result, nil } - if err := mp.runHeadChange(curTS, ts, result); err != nil { + if err := mp.runHeadChange(ctx, curTS, ts, result); err != nil { return nil, xerrors.Errorf("failed to process difference between mpool head and given head: %v", err) } @@ -1208,7 +1208,7 @@ func (*MessagePool) getGasPerf(gasReward *big.Int, gasLimit int64) float64 { return r } -func (mp *MessagePool) createMessageChains(actor address.Address, mset map[uint64]*types.SignedMessage, baseFee types.BigInt, ts *types.TipSet) []*msgChain { +func (mp *MessagePool) createMessageChains(ctx context.Context, actor address.Address, mset map[uint64]*types.SignedMessage, baseFee types.BigInt, ts *types.TipSet) []*msgChain { // collect all messages msgs := make([]*types.SignedMessage, 0, len(mset)) for _, m := range mset { @@ -1227,7 +1227,7 @@ func (mp *MessagePool) createMessageChains(actor address.Address, mset map[uint6 // cannot exceed the block limit; drop all messages that exceed the limit // - the total gasReward cannot exceed the actor's balance; drop all messages that exceed // the balance - a, err := mp.api.GetActorAfter(actor, ts) + a, err := mp.api.GetActorAfter(ctx, actor, ts) if err != nil { log.Errorf("failed to load actor state, not building chain for %s: %w", actor, err) return nil diff --git a/pkg/messagepool/selection_test.go b/pkg/messagepool/selection_test.go index 813780d2da..9a68e464a4 100644 --- a/pkg/messagepool/selection_test.go +++ b/pkg/messagepool/selection_test.go @@ -54,7 +54,7 @@ func makeTestMessage(w *wallet.Wallet, from, to address.Address, nonce uint64, g } c := msg.Cid() - sig, err := w.WalletSign(from, c.Bytes(), mtypes.MsgMeta{}) + sig, err := w.WalletSign(context.Background(), from, c.Bytes(), mtypes.MsgMeta{}) if err != nil { panic(err) } @@ -67,7 +67,7 @@ func makeTestMessage(w *wallet.Wallet, from, to address.Address, nonce uint64, g func makeTestMpool() (*MessagePool, *testMpoolAPI) { tma := newTestMpoolAPI() ds := datastore.NewMapDatastore() - mp, err := New(tma, nil, ds, config.DefaultForkUpgradeParam, config.DefaultMessagePoolParam, "test", nil) + mp, err := New(context.Background(), tma, nil, ds, config.DefaultForkUpgradeParam, config.DefaultMessagePoolParam, "test", nil) if err != nil { panic(err) } @@ -82,13 +82,13 @@ func TestMessageChains(t *testing.T) { // the actors w1 := newWallet(t) - a1, err := w1.NewAddress(address.SECP256K1) + a1, err := w1.NewAddress(context.Background(), address.SECP256K1) if err != nil { t.Fatal(err) } w2 := newWallet(t) - a2, err := w2.NewAddress(address.SECP256K1) + a2, err := w2.NewAddress(context.Background(), address.SECP256K1) if err != nil { t.Fatal(err) } @@ -111,7 +111,7 @@ func TestMessageChains(t *testing.T) { } baseFee := tbig.NewInt(0) - chains := mp.createMessageChains(a1, mset, baseFee, ts) + chains := mp.createMessageChains(context.Background(), a1, mset, baseFee, ts) if len(chains) != 1 { t.Fatal("expected a single chain") } @@ -132,7 +132,7 @@ func TestMessageChains(t *testing.T) { mset[uint64(i)] = m } - chains = mp.createMessageChains(a1, mset, baseFee, ts) + chains = mp.createMessageChains(context.Background(), a1, mset, baseFee, ts) if len(chains) != 10 { t.Fatal("expected 10 chains") } @@ -156,7 +156,7 @@ func TestMessageChains(t *testing.T) { mset[uint64(i)] = m } - chains = mp.createMessageChains(a1, mset, baseFee, ts) + chains = mp.createMessageChains(context.Background(), a1, mset, baseFee, ts) if len(chains) != 2 { t.Fatal("expected 1 chain") } @@ -187,7 +187,7 @@ func TestMessageChains(t *testing.T) { mset[uint64(i)] = m } - chains = mp.createMessageChains(a1, mset, baseFee, ts) + chains = mp.createMessageChains(context.Background(), a1, mset, baseFee, ts) if len(chains) != 4 { t.Fatal("expected 4 chains") } @@ -220,7 +220,7 @@ func TestMessageChains(t *testing.T) { mset[uint64(i)] = m } - chains = mp.createMessageChains(a1, mset, baseFee, ts) + chains = mp.createMessageChains(context.Background(), a1, mset, baseFee, ts) if len(chains) != 1 { t.Fatal("expected a single chain") } @@ -246,7 +246,7 @@ func TestMessageChains(t *testing.T) { mset[uint64(i)] = m } - chains = mp.createMessageChains(a1, mset, baseFee, ts) + chains = mp.createMessageChains(context.Background(), a1, mset, baseFee, ts) if len(chains) != 1 { t.Fatal("expected a single chain") } @@ -269,7 +269,7 @@ func TestMessageChains(t *testing.T) { mset[uint64(i)] = makeTestMessage(w1, a1, a2, uint64(i), gasLimit, uint64(i+1)) } - chains = mp.createMessageChains(a1, mset, baseFee, ts) + chains = mp.createMessageChains(context.Background(), a1, mset, baseFee, ts) if len(chains) != 1 { t.Fatal("expected a single chain") } @@ -290,7 +290,7 @@ func TestMessageChains(t *testing.T) { mset[uint64(i)] = makeTestMessage(w1, a1, a2, uint64(i), gasLimit, uint64(i+1)) } - chains = mp.createMessageChains(a1, mset, baseFee, ts) + chains = mp.createMessageChains(context.Background(), a1, mset, baseFee, ts) if len(chains) != 1 { t.Fatalf("expected a single chain: got %d", len(chains)) } @@ -314,13 +314,13 @@ func TestMessageChainSkipping(t *testing.T) { // the actors w1 := newWallet(t) - a1, err := w1.NewAddress(address.SECP256K1) + a1, err := w1.NewAddress(context.Background(), address.SECP256K1) if err != nil { t.Fatal(err) } w2 := newWallet(t) - a2, err := w2.NewAddress(address.SECP256K1) + a2, err := w2.NewAddress(context.Background(), address.SECP256K1) if err != nil { t.Fatal(err) } @@ -341,7 +341,7 @@ func TestMessageChainSkipping(t *testing.T) { mset[uint64(i)] = m } - chains := mp.createMessageChains(a1, mset, baseFee, ts) + chains := mp.createMessageChains(context.Background(), a1, mset, baseFee, ts) if len(chains) != 4 { t.Fatalf("expected 4 chains, got %d", len(chains)) } @@ -384,13 +384,13 @@ func TestBasicMessageSelection(t *testing.T) { // the actors w1 := newWallet(t) - a1, err := w1.NewAddress(address.SECP256K1) + a1, err := w1.NewAddress(context.Background(), address.SECP256K1) if err != nil { t.Fatal(err) } w2 := newWallet(t) - a2, err := w2.NewAddress(address.SECP256K1) + a2, err := w2.NewAddress(context.Background(), address.SECP256K1) if err != nil { t.Fatal(err) } @@ -522,13 +522,13 @@ func TestMessageSelectionTrimming(t *testing.T) { // the actors w1 := newWallet(t) - a1, err := w1.NewAddress(address.SECP256K1) + a1, err := w1.NewAddress(context.Background(), address.SECP256K1) if err != nil { t.Fatal(err) } w2 := newWallet(t) - a2, err := w2.NewAddress(address.SECP256K1) + a2, err := w2.NewAddress(context.Background(), address.SECP256K1) if err != nil { t.Fatal(err) } @@ -579,13 +579,13 @@ func TestPriorityMessageSelection(t *testing.T) { // the actors w1 := newWallet(t) - a1, err := w1.NewAddress(address.SECP256K1) + a1, err := w1.NewAddress(context.Background(), address.SECP256K1) if err != nil { t.Fatal(err) } w2 := newWallet(t) - a2, err := w2.NewAddress(address.SECP256K1) + a2, err := w2.NewAddress(context.Background(), address.SECP256K1) if err != nil { t.Fatal(err) } @@ -652,13 +652,13 @@ func TestPriorityMessageSelection2(t *testing.T) { // the actors w1 := newWallet(t) - a1, err := w1.NewAddress(address.SECP256K1) + a1, err := w1.NewAddress(context.Background(), address.SECP256K1) if err != nil { t.Fatal(err) } w2 := newWallet(t) - a2, err := w2.NewAddress(address.SECP256K1) + a2, err := w2.NewAddress(context.Background(), address.SECP256K1) if err != nil { t.Fatal(err) } @@ -715,13 +715,13 @@ func TestPriorityMessageSelection3(t *testing.T) { // the actors w1 := newWallet(t) - a1, err := w1.NewAddress(address.SECP256K1) + a1, err := w1.NewAddress(context.Background(), address.SECP256K1) if err != nil { t.Fatal(err) } w2 := newWallet(t) - a2, err := w2.NewAddress(address.SECP256K1) + a2, err := w2.NewAddress(context.Background(), address.SECP256K1) if err != nil { t.Fatal(err) } @@ -806,13 +806,13 @@ func TestOptimalMessageSelection1(t *testing.T) { // the actors w1 := newWallet(t) - a1, err := w1.NewAddress(address.SECP256K1) + a1, err := w1.NewAddress(context.Background(), address.SECP256K1) if err != nil { t.Fatal(err) } w2 := newWallet(t) - a2, err := w2.NewAddress(address.SECP256K1) + a2, err := w2.NewAddress(context.Background(), address.SECP256K1) if err != nil { t.Fatal(err) } @@ -867,13 +867,13 @@ func TestOptimalMessageSelection2(t *testing.T) { // the actors w1 := newWallet(t) - a1, err := w1.NewAddress(address.SECP256K1) + a1, err := w1.NewAddress(context.Background(), address.SECP256K1) if err != nil { t.Fatal(err) } w2 := newWallet(t) - a2, err := w2.NewAddress(address.SECP256K1) + a2, err := w2.NewAddress(context.Background(), address.SECP256K1) if err != nil { t.Fatal(err) } @@ -946,7 +946,7 @@ func TestOptimalMessageSelection3(t *testing.T) { for i := 0; i < nActors; i++ { w := newWallet(t) - a, err := w.NewAddress(address.SECP256K1) + a, err := w.NewAddress(context.Background(), address.SECP256K1) if err != nil { t.Fatal(err) } @@ -1023,7 +1023,7 @@ func testCompetitiveMessageSelection(t *testing.T, rng *rand.Rand, getPremium fu for i := 0; i < nActors; i++ { w := newWallet(t) - a, err := w.NewAddress(address.SECP256K1) + a, err := w.NewAddress(context.Background(), address.SECP256K1) if err != nil { t.Fatal(err) } @@ -1312,7 +1312,7 @@ readLoop: if !ok { w := newWallet(t) - a, err := w.NewAddress(address.SECP256K1) + a, err := w.NewAddress(context.Background(), address.SECP256K1) if err != nil { t.Fatal(err) } @@ -1331,7 +1331,7 @@ readLoop: m.Message.Nonce -= baseNonce c := m.Message.Cid() - sig, err := w.WalletSign(localActor, c.Bytes(), mtypes.MsgMeta{}) + sig, err := w.WalletSign(context.Background(), localActor, c.Bytes(), mtypes.MsgMeta{}) if err != nil { t.Fatal(err) } diff --git a/pkg/metrics/heartbeat_test.go b/pkg/metrics/heartbeat_test.go index 1526c69d67..091b72a781 100644 --- a/pkg/metrics/heartbeat_test.go +++ b/pkg/metrics/heartbeat_test.go @@ -56,7 +56,7 @@ func newEndpoint(t *testing.T, port int) endpoint { libp2p.Identity(priv), } - basicHost, err := libp2p.New(context.Background(), opts...) + basicHost, err := libp2p.New(opts...) if err != nil { t.Fatal(err) } diff --git a/pkg/net/blocksub/validator_test.go b/pkg/net/blocksub/validator_test.go index 4f45bc7bdc..8d898972ad 100644 --- a/pkg/net/blocksub/validator_test.go +++ b/pkg/net/blocksub/validator_test.go @@ -28,8 +28,8 @@ func TestBlockTopicValidator(t *testing.T) { builder := chain.NewBuilder(t, address.Undef) pid1 := th.RequireIntPeerID(t, 1) - goodBlk := builder.BuildOnBlock(nil, func(b *chain.BlockBuilder) {}) - badBlk := builder.BuildOnBlock(nil, func(b *chain.BlockBuilder) { + goodBlk := builder.BuildOnBlock(ctx, nil, func(b *chain.BlockBuilder) {}) + badBlk := builder.BuildOnBlock(ctx, nil, func(b *chain.BlockBuilder) { b.IncHeight(1) }) diff --git a/pkg/net/router.go b/pkg/net/router.go index 8c4574ad48..c208d23c5a 100644 --- a/pkg/net/router.go +++ b/pkg/net/router.go @@ -49,7 +49,7 @@ func (r *Router) FindPeer(ctx context.Context, peerID peer.ID) (peer.AddrInfo, e // GetClosestPeers returns a channel of the K closest peers to the given key, // K is the 'K Bucket' parameter of the Kademlia DHT protocol. -func (r *Router) GetClosestPeers(ctx context.Context, key string) (<-chan peer.ID, error) { +func (r *Router) GetClosestPeers(ctx context.Context, key string) ([]peer.ID, error) { ipfsDHT, ok := r.routing.(*dht.IpfsDHT) if !ok { return nil, errors.New("underlying routing should be pointer of IpfsDHT") diff --git a/pkg/paychmgr/accessorcache.go b/pkg/paychmgr/accessorcache.go index 176fbdd118..ee6e4b57ab 100644 --- a/pkg/paychmgr/accessorcache.go +++ b/pkg/paychmgr/accessorcache.go @@ -1,6 +1,9 @@ package paychmgr -import "github.com/filecoin-project/go-address" +import ( + "context" + "github.com/filecoin-project/go-address" +) // accessorByFromTo gets a channel accessor for a given from / to pair. // The channel accessor facilitates locking a channel so that operations @@ -36,10 +39,10 @@ func (pm *Manager) accessorByFromTo(from address.Address, to address.Address) (* // The channel accessor facilitates locking a channel so that operations // must be performed sequentially on a channel (but can be performed at // the same time on different channels). -func (pm *Manager) accessorByAddress(ch address.Address) (*channelAccessor, error) { +func (pm *Manager) accessorByAddress(ctx context.Context, ch address.Address) (*channelAccessor, error) { // Get the channel from / to pm.lk.RLock() - channelInfo, err := pm.store.ByAddress(ch) + channelInfo, err := pm.store.ByAddress(ctx, ch) pm.lk.RUnlock() if err != nil { return nil, err diff --git a/pkg/paychmgr/manager.go b/pkg/paychmgr/manager.go index ee6611e90a..64dcd620f1 100644 --- a/pkg/paychmgr/manager.go +++ b/pkg/paychmgr/manager.go @@ -69,23 +69,23 @@ func NewManager(ctx context.Context, ds datastore.Batching, params *ManagerParam channels: make(map[string]*channelAccessor), pchapi: impl, } - return pm, pm.Start() + return pm, pm.Start(ctx) } // newManager is used by the tests to supply mocks -func newManager(pchStore *Store, pchapi managerAPI) (*Manager, error) { +func newManager(ctx context.Context, pchStore *Store, pchapi managerAPI) (*Manager, error) { pm := &Manager{ store: pchStore, sa: &stateAccessor{sm: pchapi}, channels: make(map[string]*channelAccessor), pchapi: pchapi, } - return pm, pm.Start() + return pm, pm.Start(ctx) } // Start restarts tracking of any messages that were sent to chain. -func (pm *Manager) Start() error { - return pm.restartPending() +func (pm *Manager) Start(ctx context.Context) error { + return pm.restartPending(ctx) } // Stop shuts down any processes used by the manager @@ -102,27 +102,27 @@ func (pm *Manager) GetPaych(ctx context.Context, from, to address.Address, amt b return chanAccessor.getPaych(ctx, amt) } -func (pm *Manager) AvailableFunds(ch address.Address) (*apitypes.ChannelAvailableFunds, error) { - ca, err := pm.accessorByAddress(ch) +func (pm *Manager) AvailableFunds(ctx context.Context, ch address.Address) (*apitypes.ChannelAvailableFunds, error) { + ca, err := pm.accessorByAddress(ctx, ch) if err != nil { return nil, err } - ci, err := ca.getChannelInfo(ch) + ci, err := ca.getChannelInfo(ctx, ch) if err != nil { return nil, err } - return ca.availableFunds(ci.ChannelID) + return ca.availableFunds(ctx, ci.ChannelID) } -func (pm *Manager) AvailableFundsByFromTo(from address.Address, to address.Address) (*apitypes.ChannelAvailableFunds, error) { +func (pm *Manager) AvailableFundsByFromTo(ctx context.Context, from address.Address, to address.Address) (*apitypes.ChannelAvailableFunds, error) { ca, err := pm.accessorByFromTo(from, to) if err != nil { return nil, err } - ci, err := ca.outboundActiveByFromTo(from, to) + ci, err := ca.outboundActiveByFromTo(ctx, from, to) if err == ErrChannelNotTracked { // If there is no active channel between from / to we still want to // return an empty ChannelAvailableFunds, so that clients can check @@ -143,7 +143,7 @@ func (pm *Manager) AvailableFundsByFromTo(from address.Address, to address.Addre return nil, err } - return ca.availableFunds(ci.ChannelID) + return ca.availableFunds(ctx, ci.ChannelID) } // GetPaychWaitReady waits until the create channel / add funds message with the @@ -152,7 +152,7 @@ func (pm *Manager) AvailableFundsByFromTo(from address.Address, to address.Addre func (pm *Manager) GetPaychWaitReady(ctx context.Context, mcid cid.Cid) (address.Address, error) { // Find the channel associated with the message CID pm.lk.Lock() - ci, err := pm.store.ByMessageCid(mcid) + ci, err := pm.store.ByMessageCid(ctx, mcid) pm.lk.Unlock() if err != nil { @@ -170,25 +170,25 @@ func (pm *Manager) GetPaychWaitReady(ctx context.Context, mcid cid.Cid) (address return chanAccessor.getPaychWaitReady(ctx, mcid) } -func (pm *Manager) ListChannels() ([]address.Address, error) { +func (pm *Manager) ListChannels(ctx context.Context) ([]address.Address, error) { // Need to take an exclusive lock here so that channel operations can't run // in parallel (see channelLock) pm.lk.Lock() defer pm.lk.Unlock() - return pm.store.ListChannels() + return pm.store.ListChannels(ctx) } -func (pm *Manager) GetChannelInfo(addr address.Address) (*ChannelInfo, error) { - ca, err := pm.accessorByAddress(addr) +func (pm *Manager) GetChannelInfo(ctx context.Context, addr address.Address) (*ChannelInfo, error) { + ca, err := pm.accessorByAddress(ctx, addr) if err != nil { return nil, err } - return ca.getChannelInfo(addr) + return ca.getChannelInfo(ctx, addr) } func (pm *Manager) CreateVoucher(ctx context.Context, ch address.Address, voucher paych.SignedVoucher) (*paychtypes.VoucherCreateResult, error) { - ca, err := pm.accessorByAddress(ch) + ca, err := pm.accessorByAddress(ctx, ch) if err != nil { return nil, err } @@ -214,7 +214,7 @@ func (pm *Manager) CheckVoucherSpendable(ctx context.Context, ch address.Address if len(proof) > 0 { return false, errProofNotSupported } - ca, err := pm.accessorByAddress(ch) + ca, err := pm.accessorByAddress(ctx, ch) if err != nil { return false, err } @@ -228,7 +228,7 @@ func (pm *Manager) AddVoucherOutbound(ctx context.Context, ch address.Address, s if len(proof) > 0 { return big.NewInt(0), errProofNotSupported } - ca, err := pm.accessorByAddress(ch) + ca, err := pm.accessorByAddress(ctx, ch) if err != nil { return big.NewInt(0), err } @@ -274,7 +274,7 @@ func (pm *Manager) trackInboundChannel(ctx context.Context, ch address.Address) defer pm.lk.Unlock() // Check if channel is in store - ci, err := pm.store.ByAddress(ch) + ci, err := pm.store.ByAddress(ctx, ch) if err == nil { // Channel is in store, so it's already being tracked return ci, nil @@ -307,7 +307,7 @@ func (pm *Manager) trackInboundChannel(ctx context.Context, ch address.Address) } // Save channel to store - return pm.store.TrackChannel(stateCi) + return pm.store.TrackChannel(ctx, stateCi) } // TODO: secret vs proof doesn't make sense, there is only one, not two @@ -315,23 +315,23 @@ func (pm *Manager) SubmitVoucher(ctx context.Context, ch address.Address, sv *pa if len(proof) > 0 { return cid.Undef, errProofNotSupported } - ca, err := pm.accessorByAddress(ch) + ca, err := pm.accessorByAddress(ctx, ch) if err != nil { return cid.Undef, err } return ca.submitVoucher(ctx, ch, sv, secret) } -func (pm *Manager) AllocateLane(ch address.Address) (uint64, error) { - ca, err := pm.accessorByAddress(ch) +func (pm *Manager) AllocateLane(ctx context.Context, ch address.Address) (uint64, error) { + ca, err := pm.accessorByAddress(ctx, ch) if err != nil { return 0, err } - return ca.allocateLane(ch) + return ca.allocateLane(ctx, ch) } func (pm *Manager) ListVouchers(ctx context.Context, ch address.Address) ([]*VoucherInfo, error) { - ca, err := pm.accessorByAddress(ch) + ca, err := pm.accessorByAddress(ctx, ch) if err != nil { return nil, err } @@ -339,7 +339,7 @@ func (pm *Manager) ListVouchers(ctx context.Context, ch address.Address) ([]*Vou } func (pm *Manager) Settle(ctx context.Context, addr address.Address) (cid.Cid, error) { - ca, err := pm.accessorByAddress(addr) + ca, err := pm.accessorByAddress(ctx, addr) if err != nil { return cid.Undef, err } @@ -347,7 +347,7 @@ func (pm *Manager) Settle(ctx context.Context, addr address.Address) (cid.Cid, e } func (pm *Manager) Collect(ctx context.Context, addr address.Address) (cid.Cid, error) { - ca, err := pm.accessorByAddress(addr) + ca, err := pm.accessorByAddress(ctx, addr) if err != nil { return cid.Undef, err } diff --git a/pkg/paychmgr/paych.go b/pkg/paychmgr/paych.go index 99a88406d7..74430ca3f8 100644 --- a/pkg/paychmgr/paych.go +++ b/pkg/paychmgr/paych.go @@ -96,18 +96,18 @@ func (ca *channelAccessor) messageBuilder(ctx context.Context, from address.Addr return paych.Message(ver, from), nil } -func (ca *channelAccessor) getChannelInfo(addr address.Address) (*ChannelInfo, error) { +func (ca *channelAccessor) getChannelInfo(ctx context.Context, addr address.Address) (*ChannelInfo, error) { ca.lk.Lock() defer ca.lk.Unlock() - return ca.store.ByAddress(addr) + return ca.store.ByAddress(ctx, addr) } -func (ca *channelAccessor) outboundActiveByFromTo(from, to address.Address) (*ChannelInfo, error) { +func (ca *channelAccessor) outboundActiveByFromTo(ctx context.Context, from, to address.Address) (*ChannelInfo, error) { ca.lk.Lock() defer ca.lk.Unlock() - return ca.store.OutboundActiveByFromTo(from, to) + return ca.store.OutboundActiveByFromTo(ctx, from, to) } // createVoucher creates a voucher with the given specification, setting its @@ -119,7 +119,7 @@ func (ca *channelAccessor) createVoucher(ctx context.Context, ch address.Address defer ca.lk.Unlock() // Find the channel for the voucher - ci, err := ca.store.ByAddress(ch) + ci, err := ca.store.ByAddress(ctx, ch) if err != nil { return nil, xerrors.Errorf("failed to get channel info by address: %w", err) } @@ -229,7 +229,7 @@ func (ca *channelAccessor) checkVoucherValidUnlocked(ctx context.Context, ch add } // Check the voucher against the highest known voucher nonce / value - laneStates, err := ca.laneState(pchState, ch) + laneStates, err := ca.laneState(ctx, pchState, ch) if err != nil { return nil, err } @@ -298,7 +298,7 @@ func (ca *channelAccessor) checkVoucherSpendable(ctx context.Context, ch address return false, err } - ci, err := ca.store.ByAddress(ch) + ci, err := ca.store.ByAddress(ctx, ch) if err != nil { return false, err } @@ -351,7 +351,7 @@ func (ca *channelAccessor) addVoucher(ctx context.Context, ch address.Address, s } func (ca *channelAccessor) addVoucherUnlocked(ctx context.Context, ch address.Address, sv *paych.SignedVoucher, minDelta big.Int) (big.Int, error) { - ci, err := ca.store.ByAddress(ch) + ci, err := ca.store.ByAddress(ctx, ch) if err != nil { return big.Int{}, err } @@ -400,14 +400,14 @@ func (ca *channelAccessor) addVoucherUnlocked(ctx context.Context, ch address.Ad ci.NextLane = sv.Lane + 1 } - return delta, ca.store.putChannelInfo(ci) + return delta, ca.store.putChannelInfo(ctx, ci) } func (ca *channelAccessor) submitVoucher(ctx context.Context, ch address.Address, sv *paych.SignedVoucher, secret []byte) (cid.Cid, error) { ca.lk.Lock() defer ca.lk.Unlock() - ci, err := ca.store.ByAddress(ch) + ci, err := ca.store.ByAddress(ctx, ch) if err != nil { return cid.Undef, err } @@ -453,18 +453,18 @@ func (ca *channelAccessor) submitVoucher(ctx context.Context, ch address.Address } // Mark the voucher and any lower-nonce vouchers as having been submitted - err = ca.store.MarkVoucherSubmitted(ci, sv) + err = ca.store.MarkVoucherSubmitted(ctx, ci, sv) if err != nil { return cid.Undef, err } return smsg.Cid(), nil } -func (ca *channelAccessor) allocateLane(ch address.Address) (uint64, error) { +func (ca *channelAccessor) allocateLane(ctx context.Context, ch address.Address) (uint64, error) { ca.lk.Lock() defer ca.lk.Unlock() - return ca.store.AllocateLane(ch) + return ca.store.AllocateLane(ctx, ch) } func (ca *channelAccessor) listVouchers(ctx context.Context, ch address.Address) ([]*VoucherInfo, error) { @@ -473,12 +473,12 @@ func (ca *channelAccessor) listVouchers(ctx context.Context, ch address.Address) // TODO: just having a passthrough method like this feels odd. Seems like // there should be some filtering we're doing here - return ca.store.VouchersForPaych(ch) + return ca.store.VouchersForPaych(ctx, ch) } // laneState gets the LaneStates from chain, then applies all vouchers in // the data store over the chain state -func (ca *channelAccessor) laneState(state paych.State, ch address.Address) (map[uint64]paych.LaneState, error) { +func (ca *channelAccessor) laneState(ctx context.Context, state paych.State, ch address.Address) (map[uint64]paych.LaneState, error) { // TODO: we probably want to call UpdateChannelState with all vouchers to be fully correct // (but technically dont't need to) @@ -500,7 +500,7 @@ func (ca *channelAccessor) laneState(state paych.State, ch address.Address) (map } // Apply locally stored vouchers - vouchers, err := ca.store.VouchersForPaych(ch) + vouchers, err := ca.store.VouchersForPaych(ctx, ch) if err != nil && err != ErrChannelNotTracked { return nil, err } @@ -582,7 +582,7 @@ func (ca *channelAccessor) settle(ctx context.Context, ch address.Address) (cid. ca.lk.Lock() defer ca.lk.Unlock() - ci, err := ca.store.ByAddress(ch) + ci, err := ca.store.ByAddress(ctx, ch) if err != nil { return cid.Undef, err } @@ -601,7 +601,7 @@ func (ca *channelAccessor) settle(ctx context.Context, ch address.Address) (cid. } ci.Settling = true - err = ca.store.putChannelInfo(ci) + err = ca.store.putChannelInfo(ctx, ci) if err != nil { log.Errorf("Error marking channel as settled: %s", err) } @@ -612,7 +612,7 @@ func (ca *channelAccessor) collect(ctx context.Context, ch address.Address) (cid ca.lk.Lock() defer ca.lk.Unlock() - ci, err := ca.store.ByAddress(ch) + ci, err := ca.store.ByAddress(ctx, ch) if err != nil { return cid.Undef, err } diff --git a/pkg/paychmgr/paych_test.go b/pkg/paychmgr/paych_test.go index c1c56a2162..fb690ab891 100644 --- a/pkg/paychmgr/paych_test.go +++ b/pkg/paychmgr/paych_test.go @@ -214,7 +214,7 @@ func TestCheckVoucherValid(t *testing.T) { // Create a manager store := NewStore(ds_sync.MutexWrap(ds.NewMapDatastore())) - mgr, err := newManager(store, mock) + mgr, err := newManager(ctx, store, mock) require.NoError(t, err) // Add channel To address to wallet @@ -360,16 +360,16 @@ func TestAddVoucherNextLane(t *testing.T) { _, err := s.mgr.AddVoucherOutbound(ctx, s.ch, sv, nil, minDelta) require.NoError(t, err) - ci, err := s.mgr.GetChannelInfo(s.ch) + ci, err := s.mgr.GetChannelInfo(ctx, s.ch) require.NoError(t, err) require.EqualValues(t, ci.NextLane, 3) // Allocate a lane (should be lane 3) - lane, err := s.mgr.AllocateLane(s.ch) + lane, err := s.mgr.AllocateLane(ctx, s.ch) require.NoError(t, err) require.EqualValues(t, lane, 3) - ci, err = s.mgr.GetChannelInfo(s.ch) + ci, err = s.mgr.GetChannelInfo(ctx, s.ch) require.NoError(t, err) require.EqualValues(t, ci.NextLane, 4) @@ -379,7 +379,7 @@ func TestAddVoucherNextLane(t *testing.T) { _, err = s.mgr.AddVoucherOutbound(ctx, s.ch, sv, nil, minDelta) require.NoError(t, err) - ci, err = s.mgr.GetChannelInfo(s.ch) + ci, err = s.mgr.GetChannelInfo(ctx, s.ch) require.NoError(t, err) require.EqualValues(t, ci.NextLane, 4) @@ -389,7 +389,7 @@ func TestAddVoucherNextLane(t *testing.T) { _, err = s.mgr.AddVoucherOutbound(ctx, s.ch, sv, nil, minDelta) require.NoError(t, err) - ci, err = s.mgr.GetChannelInfo(s.ch) + ci, err = s.mgr.GetChannelInfo(ctx, s.ch) require.NoError(t, err) require.EqualValues(t, ci.NextLane, 8) } @@ -399,13 +399,15 @@ func TestAllocateLane(t *testing.T) { // Set up a manager with a single payment channel s := testSetupMgrWithChannel(t) + ctx := context.Background() + // First lane should be 0 - lane, err := s.mgr.AllocateLane(s.ch) + lane, err := s.mgr.AllocateLane(ctx, s.ch) require.NoError(t, err) require.EqualValues(t, lane, 0) // Next lane should be 1 - lane, err = s.mgr.AllocateLane(s.ch) + lane, err = s.mgr.AllocateLane(ctx, s.ch) require.NoError(t, err) require.EqualValues(t, lane, 1) } @@ -441,7 +443,7 @@ func TestAllocateLaneWithExistingLaneState(t *testing.T) { mock.setPaychState(ch, act, paychmock.NewMockPayChState(fromAcct, toAcct, abi.ChainEpoch(0), make(map[uint64]paych.LaneState))) - mgr, err := newManager(store, mock) + mgr, err := newManager(ctx, store, mock) require.NoError(t, err) // Create a voucher on lane 2 @@ -455,7 +457,7 @@ func TestAllocateLaneWithExistingLaneState(t *testing.T) { require.NoError(t, err) // Allocate lane should return the next lane (lane 3) - lane, err := mgr.AllocateLane(ch) + lane, err := mgr.AllocateLane(ctx, ch) require.NoError(t, err) require.EqualValues(t, 3, lane) } @@ -489,7 +491,7 @@ func TestAddVoucherInboundWalletKey(t *testing.T) { // Create a manager store := NewStore(ds_sync.MutexWrap(ds.NewMapDatastore())) - mgr, err := newManager(store, mock) + mgr, err := newManager(ctx, store, mock) require.NoError(t, err) // Add a voucher @@ -727,6 +729,7 @@ type testScaffold struct { } func testSetupMgrWithChannel(t *testing.T) *testScaffold { + ctx := context.Background() fromKeyPrivate, fromKeyPublic := testGenerateKeyPair(t) ch := tutils.NewIDAddr(t, 100) @@ -750,7 +753,7 @@ func testSetupMgrWithChannel(t *testing.T) *testScaffold { mock.setPaychState(ch, act, paychmock.NewMockPayChState(fromAcct, toAcct, abi.ChainEpoch(0), make(map[uint64]paych.LaneState))) store := NewStore(ds_sync.MutexWrap(ds.NewMapDatastore())) - mgr, err := newManager(store, mock) + mgr, err := newManager(ctx, store, mock) require.NoError(t, err) // Create the channel in the manager's store @@ -760,7 +763,7 @@ func testSetupMgrWithChannel(t *testing.T) *testScaffold { Target: toAcct, Direction: DirOutbound, } - err = mgr.store.putChannelInfo(ci) + err = mgr.store.putChannelInfo(ctx, ci) require.NoError(t, err) // Add the from signing key to the wallet diff --git a/pkg/paychmgr/paychget_test.go b/pkg/paychmgr/paychget_test.go index 68c8bc4762..51ecdab7c1 100644 --- a/pkg/paychmgr/paychget_test.go +++ b/pkg/paychmgr/paychget_test.go @@ -56,7 +56,7 @@ func TestPaychGetCreateChannelMsg(t *testing.T) { mock := newMockManagerAPI() defer mock.close() - mgr, err := newManager(store, mock) + mgr, err := newManager(ctx, store, mock) require.NoError(t, err) amt := big.NewInt(10) @@ -84,7 +84,7 @@ func TestPaychGetCreateChannelThenAddFunds(t *testing.T) { mock := newMockManagerAPI() defer mock.close() - mgr, err := newManager(store, mock) + mgr, err := newManager(ctx, store, mock) require.NoError(t, err) // Send create message for a channel with value 10 @@ -93,7 +93,7 @@ func TestPaychGetCreateChannelThenAddFunds(t *testing.T) { require.NoError(t, err) // Should have no channels yet (message sent but channel not created) - cis, err := mgr.ListChannels() + cis, err := mgr.ListChannels(ctx) require.NoError(t, err) require.Len(t, cis, 0) @@ -118,7 +118,7 @@ func TestPaychGetCreateChannelThenAddFunds(t *testing.T) { require.NotEqual(t, createMsgCid, addFundsMsgCid) // Should have one channel, whose address is the channel that was created - cis, err := mgr.ListChannels() + cis, err := mgr.ListChannels(ctx) require.NoError(t, err) require.Len(t, cis, 1) require.Equal(t, ch, cis[0]) @@ -127,7 +127,7 @@ func TestPaychGetCreateChannelThenAddFunds(t *testing.T) { // channel). // PendingAmount should be amount sent in second GetPaych // (second GetPaych triggered add funds, which has not yet been confirmed) - ci, err := mgr.GetChannelInfo(ch) + ci, err := mgr.GetChannelInfo(ctx, ch) require.NoError(t, err) require.EqualValues(t, 10, ci.Amount.Int64()) require.EqualValues(t, 5, ci.PendingAmount.Int64()) @@ -141,13 +141,13 @@ func TestPaychGetCreateChannelThenAddFunds(t *testing.T) { require.NoError(t, err) // Should still have one channel - cis, err = mgr.ListChannels() + cis, err = mgr.ListChannels(ctx) require.NoError(t, err) require.Len(t, cis, 1) require.Equal(t, ch, cis[0]) // Channel amount should include last amount sent to GetPaych - ci, err = mgr.GetChannelInfo(ch) + ci, err = mgr.GetChannelInfo(ctx, ch) require.NoError(t, err) require.EqualValues(t, 15, ci.Amount.Int64()) require.EqualValues(t, 0, ci.PendingAmount.Int64()) @@ -174,7 +174,7 @@ func TestPaychGetCreateChannelWithErrorThenCreateAgain(t *testing.T) { mock := newMockManagerAPI() defer mock.close() - mgr, err := newManager(store, mock) + mgr, err := newManager(ctx, store, mock) require.NoError(t, err) // Send create message for a channel @@ -210,12 +210,12 @@ func TestPaychGetCreateChannelWithErrorThenCreateAgain(t *testing.T) { require.NoError(t, err) // Should have one channel, whose address is the channel that was created - cis, err := mgr.ListChannels() + cis, err := mgr.ListChannels(ctx) require.NoError(t, err) require.Len(t, cis, 1) require.Equal(t, ch, cis[0]) - ci, err := mgr.GetChannelInfo(ch) + ci, err := mgr.GetChannelInfo(ctx, ch) require.NoError(t, err) require.Equal(t, amt2, ci.Amount) }() @@ -240,7 +240,7 @@ func TestPaychGetRecoverAfterError(t *testing.T) { mock := newMockManagerAPI() defer mock.close() - mgr, err := newManager(store, mock) + mgr, err := newManager(ctx, store, mock) require.NoError(t, err) // Send create message for a channel @@ -267,12 +267,12 @@ func TestPaychGetRecoverAfterError(t *testing.T) { require.NoError(t, err) // Should have one channel, whose address is the channel that was created - cis, err := mgr.ListChannels() + cis, err := mgr.ListChannels(ctx) require.NoError(t, err) require.Len(t, cis, 1) require.Equal(t, ch, cis[0]) - ci, err := mgr.GetChannelInfo(ch) + ci, err := mgr.GetChannelInfo(ctx, ch) require.NoError(t, err) require.Equal(t, amt2, ci.Amount) require.EqualValues(t, 0, ci.PendingAmount.Int64()) @@ -293,7 +293,7 @@ func TestPaychGetRecoverAfterAddFundsError(t *testing.T) { mock := newMockManagerAPI() defer mock.close() - mgr, err := newManager(store, mock) + mgr, err := newManager(ctx, store, mock) require.NoError(t, err) // Send create message for a channel @@ -320,12 +320,12 @@ func TestPaychGetRecoverAfterAddFundsError(t *testing.T) { require.Error(t, err) // Should have one channel, whose address is the channel that was created - cis, err := mgr.ListChannels() + cis, err := mgr.ListChannels(ctx) require.NoError(t, err) require.Len(t, cis, 1) require.Equal(t, ch, cis[0]) - ci, err := mgr.GetChannelInfo(ch) + ci, err := mgr.GetChannelInfo(ctx, ch) require.NoError(t, err) require.Equal(t, amt, ci.Amount) require.EqualValues(t, 0, ci.PendingAmount.Int64()) @@ -347,13 +347,13 @@ func TestPaychGetRecoverAfterAddFundsError(t *testing.T) { require.NoError(t, err) // Should have one channel, whose address is the channel that was created - cis, err = mgr.ListChannels() + cis, err = mgr.ListChannels(ctx) require.NoError(t, err) require.Len(t, cis, 1) require.Equal(t, ch, cis[0]) // Amount should include amount for successful add funds msg - ci, err = mgr.GetChannelInfo(ch) + ci, err = mgr.GetChannelInfo(ctx, ch) require.NoError(t, err) require.Equal(t, amt.Int64()+amt3.Int64(), ci.Amount.Int64()) require.EqualValues(t, 0, ci.PendingAmount.Int64()) @@ -375,7 +375,7 @@ func TestPaychGetRestartAfterCreateChannelMsg(t *testing.T) { mock := newMockManagerAPI() - mgr, err := newManager(store, mock) + mgr, err := newManager(ctx, store, mock) require.NoError(t, err) // Send create message for a channel with value 10 @@ -390,11 +390,11 @@ func TestPaychGetRestartAfterCreateChannelMsg(t *testing.T) { mock2 := newMockManagerAPI() defer mock2.close() - mgr2, err := newManager(store, mock2) + mgr2, err := newManager(ctx, store, mock2) require.NoError(t, err) // Should have no channels yet (message sent but channel not created) - cis, err := mgr2.ListChannels() + cis, err := mgr2.ListChannels(ctx) require.NoError(t, err) require.Len(t, cis, 0) @@ -419,7 +419,7 @@ func TestPaychGetRestartAfterCreateChannelMsg(t *testing.T) { require.NotEqual(t, createMsgCid, addFundsMsgCid) // Should have one channel, whose address is the channel that was created - cis, err := mgr2.ListChannels() + cis, err := mgr2.ListChannels(ctx) require.NoError(t, err) require.Len(t, cis, 1) require.Equal(t, ch, cis[0]) @@ -428,7 +428,7 @@ func TestPaychGetRestartAfterCreateChannelMsg(t *testing.T) { // channel). // PendingAmount should be amount sent in second GetPaych // (second GetPaych triggered add funds, which has not yet been confirmed) - ci, err := mgr2.GetChannelInfo(ch) + ci, err := mgr2.GetChannelInfo(ctx, ch) require.NoError(t, err) require.EqualValues(t, 10, ci.Amount.Int64()) require.EqualValues(t, 5, ci.PendingAmount.Int64()) @@ -455,7 +455,7 @@ func TestPaychGetRestartAfterAddFundsMsg(t *testing.T) { mock := newMockManagerAPI() - mgr, err := newManager(store, mock) + mgr, err := newManager(ctx, store, mock) require.NoError(t, err) // Send create message for a channel @@ -479,7 +479,7 @@ func TestPaychGetRestartAfterAddFundsMsg(t *testing.T) { mock2 := newMockManagerAPI() defer mock2.close() - mgr2, err := newManager(store, mock2) + mgr2, err := newManager(ctx, store, mock2) require.NoError(t, err) // Send success add funds response @@ -492,13 +492,13 @@ func TestPaychGetRestartAfterAddFundsMsg(t *testing.T) { require.NoError(t, err) // Should have one channel, whose address is the channel that was created - cis, err := mgr2.ListChannels() + cis, err := mgr2.ListChannels(ctx) require.NoError(t, err) require.Len(t, cis, 1) require.Equal(t, ch, cis[0]) // Amount should include amount for successful add funds msg - ci, err := mgr2.GetChannelInfo(ch) + ci, err := mgr2.GetChannelInfo(ctx, ch) require.NoError(t, err) require.Equal(t, amt.Int64()+amt2.Int64(), ci.Amount.Int64()) require.EqualValues(t, 0, ci.PendingAmount.Int64()) @@ -519,7 +519,7 @@ func TestPaychGetWait(t *testing.T) { mock := newMockManagerAPI() defer mock.close() - mgr, err := newManager(store, mock) + mgr, err := newManager(ctx, store, mock) require.NoError(t, err) // 1. Get @@ -577,7 +577,7 @@ func TestPaychGetWaitErr(t *testing.T) { mock := newMockManagerAPI() defer mock.close() - mgr, err := newManager(store, mock) + mgr, err := newManager(ctx, store, mock) require.NoError(t, err) // 1. Create channel @@ -625,7 +625,7 @@ func TestPaychGetWaitCtx(t *testing.T) { mock := newMockManagerAPI() defer mock.close() - mgr, err := newManager(store, mock) + mgr, err := newManager(ctx, store, mock) require.NoError(t, err) amt := big.NewInt(10) @@ -656,7 +656,7 @@ func TestPaychGetMergeAddFunds(t *testing.T) { mock := newMockManagerAPI() defer mock.close() - mgr, err := newManager(store, mock) + mgr, err := newManager(ctx, store, mock) require.NoError(t, err) // Send create message for a channel with value 10 @@ -755,7 +755,7 @@ func TestPaychGetMergeAddFundsCtxCancelOne(t *testing.T) { mock := newMockManagerAPI() defer mock.close() - mgr, err := newManager(store, mock) + mgr, err := newManager(ctx, store, mock) require.NoError(t, err) // Send create message for a channel with value 10 @@ -853,7 +853,7 @@ func TestPaychGetMergeAddFundsCtxCancelAll(t *testing.T) { mock := newMockManagerAPI() defer mock.close() - mgr, err := newManager(store, mock) + mgr, err := newManager(ctx, store, mock) require.NoError(t, err) // Send create message for a channel with value 10 @@ -931,11 +931,11 @@ func TestPaychAvailableFunds(t *testing.T) { mock := newMockManagerAPI() defer mock.close() - mgr, err := newManager(store, mock) + mgr, err := newManager(ctx, store, mock) require.NoError(t, err) // No channel created yet so available funds should be all zeroes - av, err := mgr.AvailableFundsByFromTo(from, to) + av, err := mgr.AvailableFundsByFromTo(ctx, from, to) require.NoError(t, err) require.Nil(t, av.Channel) require.Nil(t, av.PendingWaitSentinel) @@ -950,7 +950,7 @@ func TestPaychAvailableFunds(t *testing.T) { require.NoError(t, err) // Available funds should reflect create channel message sent - av, err = mgr.AvailableFundsByFromTo(from, to) + av, err = mgr.AvailableFundsByFromTo(ctx, from, to) require.NoError(t, err) require.Nil(t, av.Channel) require.EqualValues(t, 0, av.ConfirmedAmt.Int64()) @@ -979,7 +979,7 @@ func TestPaychAvailableFunds(t *testing.T) { waitForQueueSize(t, mgr, from, to, 1) // Available funds should now include queued funds - av, err = mgr.AvailableFundsByFromTo(from, to) + av, err = mgr.AvailableFundsByFromTo(ctx, from, to) require.NoError(t, err) require.Nil(t, av.Channel) require.NotNil(t, av.PendingWaitSentinel) @@ -1014,7 +1014,7 @@ func TestPaychAvailableFunds(t *testing.T) { // Available funds should now include the channel and also a wait sentinel // for the add funds message - av, err = mgr.AvailableFunds(ch) + av, err = mgr.AvailableFunds(ctx, ch) require.NoError(t, err) require.NotNil(t, av.Channel) require.NotNil(t, av.PendingWaitSentinel) @@ -1036,7 +1036,7 @@ func TestPaychAvailableFunds(t *testing.T) { require.NoError(t, err) // Available funds should no longer have a wait sentinel - av, err = mgr.AvailableFunds(ch) + av, err = mgr.AvailableFunds(ctx, ch) require.NoError(t, err) require.NotNil(t, av.Channel) require.Nil(t, av.PendingWaitSentinel) @@ -1057,7 +1057,7 @@ func TestPaychAvailableFunds(t *testing.T) { _, err = mgr.AddVoucherOutbound(ctx, ch, voucher, nil, big.NewInt(0)) require.NoError(t, err) - av, err = mgr.AvailableFunds(ch) + av, err = mgr.AvailableFunds(ctx, ch) require.NoError(t, err) require.NotNil(t, av.Channel) require.Nil(t, av.PendingWaitSentinel) diff --git a/pkg/paychmgr/paychvoucherfunds_test.go b/pkg/paychmgr/paychvoucherfunds_test.go index 2bbab71cef..1dbcb9478d 100644 --- a/pkg/paychmgr/paychvoucherfunds_test.go +++ b/pkg/paychmgr/paychvoucherfunds_test.go @@ -44,7 +44,7 @@ func TestPaychAddVoucherAfterAddFunds(t *testing.T) { mock.setAccountAddress(toAcct, to) mock.addSigningKey(fromKeyPrivate) - mgr, err := newManager(store, mock) + mgr, err := newManager(ctx, store, mock) require.NoError(t, err) // Send create message for a channel with value 10 diff --git a/pkg/paychmgr/settle_test.go b/pkg/paychmgr/settle_test.go index f787a3b566..dfc14f579e 100644 --- a/pkg/paychmgr/settle_test.go +++ b/pkg/paychmgr/settle_test.go @@ -27,7 +27,7 @@ func TestPaychSettle(t *testing.T) { mock := newMockManagerAPI() defer mock.close() - mgr, err := newManager(store, mock) + mgr, err := newManager(ctx, store, mock) require.NoError(t, err) amt := big.NewInt(10) @@ -65,7 +65,7 @@ func TestPaychSettle(t *testing.T) { require.NotEqual(t, ch, ch2) // There should now be two channels - cis, err := mgr.ListChannels() + cis, err := mgr.ListChannels(ctx) require.NoError(t, err) require.Len(t, cis, 2) } diff --git a/pkg/paychmgr/settler/stl.go b/pkg/paychmgr/settler/stl.go index 4a14b7b73f..ce37d4e547 100644 --- a/pkg/paychmgr/settler/stl.go +++ b/pkg/paychmgr/settler/stl.go @@ -31,12 +31,12 @@ func NewSetter(mgr *paychmgr.Manager, chainInfoAPI paychmgr.IChainInfo) Settler return &settler{mgr, chainInfoAPI} } -func (o *settler) PaychList(context.Context) ([]address.Address, error) { - return o.mgr.ListChannels() +func (o *settler) PaychList(ctx context.Context) ([]address.Address, error) { + return o.mgr.ListChannels(ctx) } func (o *settler) PaychStatus(ctx context.Context, pch address.Address) (*paychtypes.Status, error) { - ci, err := o.mgr.GetChannelInfo(pch) + ci, err := o.mgr.GetChannelInfo(ctx, pch) if err != nil { return nil, err } diff --git a/pkg/paychmgr/simple.go b/pkg/paychmgr/simple.go index 8fc12cb077..ef1e9433c1 100644 --- a/pkg/paychmgr/simple.go +++ b/pkg/paychmgr/simple.go @@ -160,7 +160,7 @@ func (m *mergedFundsReq) sum() big.Int { func (ca *channelAccessor) getPaych(ctx context.Context, amt big.Int) (address.Address, cid.Cid, error) { // Add the request to add funds to a queue and wait for the result freq := newFundsReq(ctx, amt) - ca.enqueue(freq) + ca.enqueue(ctx, freq) select { case res := <-freq.promise: return res.channel, res.mcid, res.err @@ -171,16 +171,16 @@ func (ca *channelAccessor) getPaych(ctx context.Context, amt big.Int) (address.A } // Queue up an add funds operation -func (ca *channelAccessor) enqueue(task *fundsReq) { +func (ca *channelAccessor) enqueue(ctx context.Context, task *fundsReq) { ca.lk.Lock() defer ca.lk.Unlock() ca.fundsReqQueue = append(ca.fundsReqQueue, task) - go ca.processQueue("") // nolint: errcheck + go ca.processQueue(ctx, "") // nolint: errcheck } // Run the operations in the queue -func (ca *channelAccessor) processQueue(channelID string) (*apitypes.ChannelAvailableFunds, error) { +func (ca *channelAccessor) processQueue(ctx context.Context, channelID string) (*apitypes.ChannelAvailableFunds, error) { ca.lk.Lock() defer ca.lk.Unlock() @@ -189,7 +189,7 @@ func (ca *channelAccessor) processQueue(channelID string) (*apitypes.ChannelAvai // If there's nothing in the queue, bail out if len(ca.fundsReqQueue) == 0 { - return ca.currentAvailableFunds(channelID, big.NewInt(0)) + return ca.currentAvailableFunds(ctx, channelID, big.NewInt(0)) } // Merge all pending requests into one. @@ -200,7 +200,7 @@ func (ca *channelAccessor) processQueue(channelID string) (*apitypes.ChannelAvai if amt.IsZero() { // Note: The amount can be zero if requests are cancelled as we're // building the mergedFundsReq - return ca.currentAvailableFunds(channelID, amt) + return ca.currentAvailableFunds(ctx, channelID, amt) } res := ca.processTask(merged.ctx, amt) @@ -210,7 +210,7 @@ func (ca *channelAccessor) processQueue(channelID string) (*apitypes.ChannelAvai if res == nil { // Stop processing the fundsReqQueue and wait. When the event occurs it will // call processQueue() again - return ca.currentAvailableFunds(channelID, amt) + return ca.currentAvailableFunds(ctx, channelID, amt) } // Finished processing so clear the queue @@ -219,7 +219,7 @@ func (ca *channelAccessor) processQueue(channelID string) (*apitypes.ChannelAvai // Call the task callback with its results merged.onComplete(res) - return ca.currentAvailableFunds(channelID, big.NewInt(0)) + return ca.currentAvailableFunds(ctx, channelID, big.NewInt(0)) } // filterQueue filters cancelled requests out of the queue @@ -256,12 +256,12 @@ func (ca *channelAccessor) queueSize() int { // msgWaitComplete is called when the message for a previous task is confirmed // or there is an error. -func (ca *channelAccessor) msgWaitComplete(mcid cid.Cid, err error) { +func (ca *channelAccessor) msgWaitComplete(ctx context.Context, mcid cid.Cid, err error) { ca.lk.Lock() defer ca.lk.Unlock() // Save the message result to the store - dserr := ca.store.SaveMessageResult(mcid, err) + dserr := ca.store.SaveMessageResult(ctx, mcid, err) if dserr != nil { log.Errorf("saving message result: %s", dserr) } @@ -272,16 +272,16 @@ func (ca *channelAccessor) msgWaitComplete(mcid cid.Cid, err error) { // The queue may have been waiting for msg completion to proceed, so // process the next queue item if len(ca.fundsReqQueue) > 0 { - go ca.processQueue("") // nolint: errcheck + go ca.processQueue(ctx, "") // nolint: errcheck } } -func (ca *channelAccessor) currentAvailableFunds(channelID string, queuedAmt big.Int) (*apitypes.ChannelAvailableFunds, error) { +func (ca *channelAccessor) currentAvailableFunds(ctx context.Context, channelID string, queuedAmt big.Int) (*apitypes.ChannelAvailableFunds, error) { if len(channelID) == 0 { return nil, nil } - channelInfo, err := ca.store.ByChannelID(channelID) + channelInfo, err := ca.store.ByChannelID(ctx, channelID) if err != nil { return nil, err } @@ -303,7 +303,7 @@ func (ca *channelAccessor) currentAvailableFunds(channelID string, queuedAmt big return nil, err } - laneStates, err := ca.laneState(pchState, ch) + laneStates, err := ca.laneState(ctx, pchState, ch) if err != nil { return nil, err } @@ -338,7 +338,7 @@ func (ca *channelAccessor) processTask(ctx context.Context, amt big.Int) *paychF // Get the payment channel for the from/to addresses. // Note: It's ok if we get ErrChannelNotTracked. It just means we need to // create a channel. - channelInfo, err := ca.store.OutboundActiveByFromTo(ca.from, ca.to) + channelInfo, err := ca.store.OutboundActiveByFromTo(ctx, ca.from, ca.to) if err != nil && err != ErrChannelNotTracked { return &paychFundsRes{err: err} } @@ -393,26 +393,26 @@ func (ca *channelAccessor) createPaych(ctx context.Context, amt big.Int) (cid.Ci } mcid := smsg.Cid() // Create a new channel in the store - ci, err := ca.store.CreateChannel(ca.from, ca.to, mcid, amt) + ci, err := ca.store.CreateChannel(ctx, ca.from, ca.to, mcid, amt) if err != nil { log.Errorf("creating channel: %s", err) return cid.Undef, err } // Wait for the channel to be created on chain - go ca.waitForPaychCreateMsg(ci.ChannelID, mcid) + go ca.waitForPaychCreateMsg(ctx, ci.ChannelID, mcid) return mcid, nil } // waitForPaychCreateMsg waits for mcid to appear on chain and stores the robust address of the // created payment channel -func (ca *channelAccessor) waitForPaychCreateMsg(channelID string, mcid cid.Cid) { - err := ca.waitPaychCreateMsg(channelID, mcid) - ca.msgWaitComplete(mcid, err) +func (ca *channelAccessor) waitForPaychCreateMsg(ctx context.Context, channelID string, mcid cid.Cid) { + err := ca.waitPaychCreateMsg(ctx, channelID, mcid) + ca.msgWaitComplete(ctx, mcid, err) } -func (ca *channelAccessor) waitPaychCreateMsg(channelID string, mcid cid.Cid) error { +func (ca *channelAccessor) waitPaychCreateMsg(ctx context.Context, channelID string, mcid cid.Cid) error { mwait, err := ca.api.StateWaitMsg(ca.chctx, mcid, constants.MessageConfidence) if err != nil { log.Errorf("wait msg: %w", err) @@ -424,7 +424,7 @@ func (ca *channelAccessor) waitPaychCreateMsg(channelID string, mcid cid.Cid) er defer ca.lk.Unlock() // Channel creation failed, so remove the channel from the datastore - dserr := ca.store.RemoveChannel(channelID) + dserr := ca.store.RemoveChannel(ctx, channelID) if dserr != nil { log.Errorf("failed to remove channel %s: %s", channelID, dserr) } @@ -448,7 +448,7 @@ func (ca *channelAccessor) waitPaychCreateMsg(channelID string, mcid cid.Cid) er defer ca.lk.Unlock() // Store robust address of channel - ca.mutateChannelInfo(channelID, func(channelInfo *ChannelInfo) { + ca.mutateChannelInfo(ctx, channelID, func(channelInfo *ChannelInfo) { channelInfo.Channel = &decodedReturn.RobustAddress channelInfo.Amount = channelInfo.PendingAmount channelInfo.PendingAmount = big.NewInt(0) @@ -473,30 +473,30 @@ func (ca *channelAccessor) addFunds(ctx context.Context, channelInfo *ChannelInf } mcid := smsg.Cid() // Store the add funds message CID on the channel - ca.mutateChannelInfo(channelInfo.ChannelID, func(ci *ChannelInfo) { + ca.mutateChannelInfo(ctx, channelInfo.ChannelID, func(ci *ChannelInfo) { ci.PendingAmount = amt ci.AddFundsMsg = &mcid }) // Store a reference from the message CID to the channel, so that we can // look up the channel from the message CID - err = ca.store.SaveNewMessage(channelInfo.ChannelID, mcid) + err = ca.store.SaveNewMessage(ctx, channelInfo.ChannelID, mcid) if err != nil { log.Errorf("saving add funds message CID %s: %s", mcid, err) } - go ca.waitForAddFundsMsg(channelInfo.ChannelID, mcid) + go ca.waitForAddFundsMsg(ctx, channelInfo.ChannelID, mcid) return &mcid, nil } // waitForAddFundsMsg waits for mcid to appear on chain and returns error, if any -func (ca *channelAccessor) waitForAddFundsMsg(channelID string, mcid cid.Cid) { - err := ca.waitAddFundsMsg(channelID, mcid) - ca.msgWaitComplete(mcid, err) +func (ca *channelAccessor) waitForAddFundsMsg(ctx context.Context, channelID string, mcid cid.Cid) { + err := ca.waitAddFundsMsg(ctx, channelID, mcid) + ca.msgWaitComplete(ctx, mcid, err) } -func (ca *channelAccessor) waitAddFundsMsg(channelID string, mcid cid.Cid) error { +func (ca *channelAccessor) waitAddFundsMsg(ctx context.Context, channelID string, mcid cid.Cid) error { mwait, err := ca.api.StateWaitMsg(ca.chctx, mcid, constants.MessageConfidence) if err != nil { log.Error(err) @@ -510,7 +510,7 @@ func (ca *channelAccessor) waitAddFundsMsg(channelID string, mcid cid.Cid) error ca.lk.Lock() defer ca.lk.Unlock() - ca.mutateChannelInfo(channelID, func(channelInfo *ChannelInfo) { + ca.mutateChannelInfo(ctx, channelID, func(channelInfo *ChannelInfo) { channelInfo.PendingAmount = big.NewInt(0) channelInfo.AddFundsMsg = nil }) @@ -522,7 +522,7 @@ func (ca *channelAccessor) waitAddFundsMsg(channelID string, mcid cid.Cid) error defer ca.lk.Unlock() // Store updated amount - ca.mutateChannelInfo(channelID, func(channelInfo *ChannelInfo) { + ca.mutateChannelInfo(ctx, channelID, func(channelInfo *ChannelInfo) { channelInfo.Amount = big.Add(channelInfo.Amount, channelInfo.PendingAmount) channelInfo.PendingAmount = big.NewInt(0) channelInfo.AddFundsMsg = nil @@ -532,8 +532,8 @@ func (ca *channelAccessor) waitAddFundsMsg(channelID string, mcid cid.Cid) error } // Change the state of the channel in the store -func (ca *channelAccessor) mutateChannelInfo(channelID string, mutate func(*ChannelInfo)) { - channelInfo, err := ca.store.ByChannelID(channelID) +func (ca *channelAccessor) mutateChannelInfo(ctx context.Context, channelID string, mutate func(*ChannelInfo)) { + channelInfo, err := ca.store.ByChannelID(ctx, channelID) // If there's an error reading or writing to the store just log an error. // For now we're assuming it's unlikely to happen in practice. @@ -547,7 +547,7 @@ func (ca *channelAccessor) mutateChannelInfo(channelID string, mutate func(*Chan mutate(channelInfo) - err = ca.store.putChannelInfo(channelInfo) + err = ca.store.putChannelInfo(ctx, channelInfo) if err != nil { log.Errorf("Error writing channel info to store: %s", err) } @@ -558,8 +558,8 @@ func (ca *channelAccessor) mutateChannelInfo(channelID string, mutate func(*Chan // messages. // Outstanding messages can occur if a create / add funds message was sent and // then the system was shut down or crashed before the result was received. -func (pm *Manager) restartPending() error { - cis, err := pm.store.WithPendingAddFunds() +func (pm *Manager) restartPending(ctx context.Context) error { + cis, err := pm.store.WithPendingAddFunds(ctx) if err != nil { return err } @@ -573,16 +573,16 @@ func (pm *Manager) restartPending() error { if err != nil { return xerrors.Errorf("error initializing payment channel manager %s -> %s: %s", ci.Control, ci.Target, err) } - go ca.waitForPaychCreateMsg(ci.ChannelID, *ci.CreateMsg) + go ca.waitForPaychCreateMsg(ctx, ci.ChannelID, *ci.CreateMsg) return nil }) } else if ci.AddFundsMsg != nil { group.Go(func() error { - ca, err := pm.accessorByAddress(*ci.Channel) + ca, err := pm.accessorByAddress(ctx, *ci.Channel) if err != nil { return xerrors.Errorf("error initializing payment channel manager %s: %s", ci.Channel, err) } - go ca.waitForAddFundsMsg(ci.ChannelID, *ci.AddFundsMsg) + go ca.waitForAddFundsMsg(ctx, ci.ChannelID, *ci.AddFundsMsg) return nil }) } @@ -596,7 +596,7 @@ func (ca *channelAccessor) getPaychWaitReady(ctx context.Context, mcid cid.Cid) ca.lk.Lock() // First check if the message has completed - msgInfo, err := ca.store.GetMessage(mcid) + msgInfo, err := ca.store.GetMessage(ctx, mcid) if err != nil { ca.lk.Unlock() @@ -615,7 +615,7 @@ func (ca *channelAccessor) getPaychWaitReady(ctx context.Context, mcid cid.Cid) ca.lk.Unlock() // Get the channel address - ci, err := ca.store.ByMessageCid(mcid) + ci, err := ca.store.ByMessageCid(ctx, mcid) if err != nil { return address.Undef, err } @@ -658,7 +658,7 @@ func (ca *channelAccessor) msgPromise(ctx context.Context, mcid cid.Cid) chan on res := onMsgRes{err: err} if res.err == nil { // Get the channel associated with the message cid - ci, err := ca.store.ByMessageCid(mcid) + ci, err := ca.store.ByMessageCid(ctx, mcid) if err != nil { res.err = err } else { @@ -687,6 +687,6 @@ func (ca *channelAccessor) msgPromise(ctx context.Context, mcid cid.Cid) chan on return promise } -func (ca *channelAccessor) availableFunds(channelID string) (*apitypes.ChannelAvailableFunds, error) { - return ca.processQueue(channelID) +func (ca *channelAccessor) availableFunds(ctx context.Context, channelID string) (*apitypes.ChannelAvailableFunds, error) { + return ca.processQueue(ctx, channelID) } diff --git a/pkg/paychmgr/store.go b/pkg/paychmgr/store.go index eec3a4763a..67d941cbf6 100644 --- a/pkg/paychmgr/store.go +++ b/pkg/paychmgr/store.go @@ -2,6 +2,7 @@ package paychmgr import ( "bytes" + "context" "errors" "fmt" @@ -158,26 +159,26 @@ func (ci *ChannelInfo) wasVoucherSubmitted(sv *paych.SignedVoucher) (bool, error // TrackChannel stores a channel, returning an error if the channel was already // being tracked -func (ps *Store) TrackChannel(ci *ChannelInfo) (*ChannelInfo, error) { - _, err := ps.ByAddress(*ci.Channel) +func (ps *Store) TrackChannel(ctx context.Context, ci *ChannelInfo) (*ChannelInfo, error) { + _, err := ps.ByAddress(ctx, *ci.Channel) switch err { default: return nil, err case nil: return nil, fmt.Errorf("already tracking channel: %s", ci.Channel) case ErrChannelNotTracked: - err = ps.putChannelInfo(ci) + err = ps.putChannelInfo(ctx, ci) if err != nil { return nil, err } - return ps.ByAddress(*ci.Channel) + return ps.ByAddress(ctx, *ci.Channel) } } // ListChannels returns the addresses of all channels that have been created -func (ps *Store) ListChannels() ([]address.Address, error) { - cis, err := ps.findChans(func(ci *ChannelInfo) bool { +func (ps *Store) ListChannels(ctx context.Context) ([]address.Address, error) { + cis, err := ps.findChans(ctx, func(ci *ChannelInfo) bool { return ci.Channel != nil }, 0) if err != nil { @@ -194,8 +195,8 @@ func (ps *Store) ListChannels() ([]address.Address, error) { // findChan finds a single channel using the given filter. // If there isn't a channel that matches the filter, returns ErrChannelNotTracked -func (ps *Store) findChan(filter func(ci *ChannelInfo) bool) (*ChannelInfo, error) { - cis, err := ps.findChans(filter, 1) +func (ps *Store) findChan(ctx context.Context, filter func(ci *ChannelInfo) bool) (*ChannelInfo, error) { + cis, err := ps.findChans(ctx, filter, 1) if err != nil { return nil, err } @@ -209,8 +210,8 @@ func (ps *Store) findChan(filter func(ci *ChannelInfo) bool) (*ChannelInfo, erro // findChans loops over all channels, only including those that pass the filter. // max is the maximum number of channels to return. Set to zero to return unlimited channels. -func (ps *Store) findChans(filter func(*ChannelInfo) bool, max int) ([]ChannelInfo, error) { - res, err := ps.ds.Query(dsq.Query{Prefix: dsKeyChannelInfo}) +func (ps *Store) findChans(ctx context.Context, filter func(*ChannelInfo) bool, max int) ([]ChannelInfo, error) { + res, err := ps.ds.Query(ctx, dsq.Query{Prefix: dsKeyChannelInfo}) if err != nil { return nil, err } @@ -252,8 +253,8 @@ func (ps *Store) findChans(filter func(*ChannelInfo) bool, max int) ([]ChannelIn } // AllocateLane allocates a new lane for the given channel -func (ps *Store) AllocateLane(ch address.Address) (uint64, error) { - ci, err := ps.ByAddress(ch) +func (ps *Store) AllocateLane(ctx context.Context, ch address.Address) (uint64, error) { + ci, err := ps.ByAddress(ctx, ch) if err != nil { return 0, err } @@ -261,12 +262,12 @@ func (ps *Store) AllocateLane(ch address.Address) (uint64, error) { out := ci.NextLane ci.NextLane++ - return out, ps.putChannelInfo(ci) + return out, ps.putChannelInfo(ctx, ci) } // VouchersForPaych gets the vouchers for the given channel -func (ps *Store) VouchersForPaych(ch address.Address) ([]*VoucherInfo, error) { - ci, err := ps.ByAddress(ch) +func (ps *Store) VouchersForPaych(ctx context.Context, ch address.Address) ([]*VoucherInfo, error) { + ci, err := ps.ByAddress(ctx, ch) if err != nil { return nil, err } @@ -274,17 +275,17 @@ func (ps *Store) VouchersForPaych(ch address.Address) ([]*VoucherInfo, error) { return ci.Vouchers, nil } -func (ps *Store) MarkVoucherSubmitted(ci *ChannelInfo, sv *paych.SignedVoucher) error { +func (ps *Store) MarkVoucherSubmitted(ctx context.Context, ci *ChannelInfo, sv *paych.SignedVoucher) error { err := ci.markVoucherSubmitted(sv) if err != nil { return err } - return ps.putChannelInfo(ci) + return ps.putChannelInfo(ctx, ci) } // ByAddress gets the channel that matches the given address -func (ps *Store) ByAddress(addr address.Address) (*ChannelInfo, error) { - return ps.findChan(func(ci *ChannelInfo) bool { +func (ps *Store) ByAddress(ctx context.Context, addr address.Address) (*ChannelInfo, error) { + return ps.findChan(ctx, func(ci *ChannelInfo) bool { return ci.Channel != nil && *ci.Channel == addr }) } @@ -308,7 +309,7 @@ func dskeyForMsg(mcid cid.Cid) datastore.Key { } // SaveNewMessage is called when a message is sent -func (ps *Store) SaveNewMessage(channelID string, mcid cid.Cid) error { +func (ps *Store) SaveNewMessage(ctx context.Context, channelID string, mcid cid.Cid) error { k := dskeyForMsg(mcid) b, err := cborutil.Dump(&MsgInfo{ChannelID: channelID, MsgCid: mcid}) @@ -316,12 +317,12 @@ func (ps *Store) SaveNewMessage(channelID string, mcid cid.Cid) error { return err } - return ps.ds.Put(k, b) + return ps.ds.Put(ctx, k, b) } // SaveMessageResult is called when the result of a message is received -func (ps *Store) SaveMessageResult(mcid cid.Cid, msgErr error) error { - minfo, err := ps.GetMessage(mcid) +func (ps *Store) SaveMessageResult(ctx context.Context, mcid cid.Cid, msgErr error) error { + minfo, err := ps.GetMessage(ctx, mcid) if err != nil { return err } @@ -337,17 +338,17 @@ func (ps *Store) SaveMessageResult(mcid cid.Cid, msgErr error) error { return err } - return ps.ds.Put(k, b) + return ps.ds.Put(ctx, k, b) } // ByMessageCid gets the channel associated with a message -func (ps *Store) ByMessageCid(mcid cid.Cid) (*ChannelInfo, error) { - minfo, err := ps.GetMessage(mcid) +func (ps *Store) ByMessageCid(ctx context.Context, mcid cid.Cid) (*ChannelInfo, error) { + minfo, err := ps.GetMessage(ctx, mcid) if err != nil { return nil, err } - ci, err := ps.findChan(func(ci *ChannelInfo) bool { + ci, err := ps.findChan(ctx, func(ci *ChannelInfo) bool { return ci.ChannelID == minfo.ChannelID }) if err != nil { @@ -358,10 +359,10 @@ func (ps *Store) ByMessageCid(mcid cid.Cid) (*ChannelInfo, error) { } // GetMessage gets the message info for a given message CID -func (ps *Store) GetMessage(mcid cid.Cid) (*MsgInfo, error) { +func (ps *Store) GetMessage(ctx context.Context, mcid cid.Cid) (*MsgInfo, error) { k := dskeyForMsg(mcid) - val, err := ps.ds.Get(k) + val, err := ps.ds.Get(ctx, k) if err != nil { return nil, err } @@ -376,8 +377,8 @@ func (ps *Store) GetMessage(mcid cid.Cid) (*MsgInfo, error) { // OutboundActiveByFromTo looks for outbound channels that have not been // settled, with the given from / to addresses -func (ps *Store) OutboundActiveByFromTo(from address.Address, to address.Address) (*ChannelInfo, error) { - return ps.findChan(func(ci *ChannelInfo) bool { +func (ps *Store) OutboundActiveByFromTo(ctx context.Context, from address.Address, to address.Address) (*ChannelInfo, error) { + return ps.findChan(ctx, func(ci *ChannelInfo) bool { if ci.Direction != DirOutbound { return false } @@ -391,8 +392,8 @@ func (ps *Store) OutboundActiveByFromTo(from address.Address, to address.Address // WithPendingAddFunds is used on startup to find channels for which a // create channel or add funds message has been sent, but lotus shut down // before the response was received. -func (ps *Store) WithPendingAddFunds() ([]ChannelInfo, error) { - return ps.findChans(func(ci *ChannelInfo) bool { +func (ps *Store) WithPendingAddFunds(ctx context.Context) ([]ChannelInfo, error) { + return ps.findChans(ctx, func(ci *ChannelInfo) bool { if ci.Direction != DirOutbound { return false } @@ -401,10 +402,10 @@ func (ps *Store) WithPendingAddFunds() ([]ChannelInfo, error) { } // ByChannelID gets channel info by channel ID -func (ps *Store) ByChannelID(channelID string) (*ChannelInfo, error) { +func (ps *Store) ByChannelID(ctx context.Context, channelID string) (*ChannelInfo, error) { var stored ChannelInfo - res, err := ps.ds.Get(dskeyForChannel(channelID)) + res, err := ps.ds.Get(ctx, dskeyForChannel(channelID)) if err != nil { if err == datastore.ErrNotFound { return nil, ErrChannelNotTracked @@ -416,7 +417,7 @@ func (ps *Store) ByChannelID(channelID string) (*ChannelInfo, error) { } // CreateChannel creates an outbound channel for the given from / to -func (ps *Store) CreateChannel(from address.Address, to address.Address, createMsgCid cid.Cid, amt fbig.Int) (*ChannelInfo, error) { +func (ps *Store) CreateChannel(ctx context.Context, from address.Address, to address.Address, createMsgCid cid.Cid, amt fbig.Int) (*ChannelInfo, error) { ci := &ChannelInfo{ Direction: DirOutbound, NextLane: 0, @@ -427,13 +428,13 @@ func (ps *Store) CreateChannel(from address.Address, to address.Address, createM } // Save the new channel - err := ps.putChannelInfo(ci) + err := ps.putChannelInfo(ctx, ci) if err != nil { return nil, err } // Save a reference to the create message - err = ps.SaveNewMessage(ci.ChannelID, createMsgCid) + err = ps.SaveNewMessage(ctx, ci.ChannelID, createMsgCid) if err != nil { return nil, err } @@ -442,8 +443,8 @@ func (ps *Store) CreateChannel(from address.Address, to address.Address, createM } // RemoveChannel removes the channel with the given channel ID -func (ps *Store) RemoveChannel(channelID string) error { - return ps.ds.Delete(dskeyForChannel(channelID)) +func (ps *Store) RemoveChannel(ctx context.Context, channelID string) error { + return ps.ds.Delete(ctx, dskeyForChannel(channelID)) } // The datastore key used to identify the channel info @@ -452,7 +453,7 @@ func dskeyForChannel(channelID string) datastore.Key { } // putChannelInfo stores the channel info in the datastore -func (ps *Store) putChannelInfo(ci *ChannelInfo) error { +func (ps *Store) putChannelInfo(ctx context.Context, ci *ChannelInfo) error { if len(ci.ChannelID) == 0 { ci.ChannelID = uuid.New().String() } @@ -463,7 +464,7 @@ func (ps *Store) putChannelInfo(ci *ChannelInfo) error { return err } - return ps.ds.Put(k, b) + return ps.ds.Put(ctx, k, b) } // TODO: This is a hack to get around not being able to CBOR marshall a nil diff --git a/pkg/paychmgr/store_test.go b/pkg/paychmgr/store_test.go index 7546858e1f..1ab640be34 100644 --- a/pkg/paychmgr/store_test.go +++ b/pkg/paychmgr/store_test.go @@ -1,6 +1,7 @@ package paychmgr import ( + "context" tf "github.com/filecoin-project/venus/pkg/testhelpers/testflags" "testing" @@ -15,7 +16,8 @@ import ( func TestStore(t *testing.T) { tf.UnitTest(t) store := NewStore(ds_sync.MutexWrap(ds.NewMapDatastore())) - addrs, err := store.ListChannels() + ctx := context.Background() + addrs, err := store.ListChannels(ctx) require.NoError(t, err) require.Len(t, addrs, 0) @@ -40,19 +42,19 @@ func TestStore(t *testing.T) { } // Track the channel - _, err = store.TrackChannel(ci) + _, err = store.TrackChannel(ctx, ci) require.NoError(t, err) // Tracking same channel again should error - _, err = store.TrackChannel(ci) + _, err = store.TrackChannel(ctx, ci) require.Error(t, err) // Track another channel - _, err = store.TrackChannel(ci2) + _, err = store.TrackChannel(ctx, ci2) require.NoError(t, err) // List channels should include all channels - addrs, err = store.ListChannels() + addrs, err = store.ListChannels(ctx) require.NoError(t, err) require.Len(t, addrs, 2) t0100, err := address.NewIDAddress(100) @@ -63,25 +65,25 @@ func TestStore(t *testing.T) { require.Contains(t, addrs, t0200) // Request vouchers for channel - vouchers, err := store.VouchersForPaych(*ci.Channel) + vouchers, err := store.VouchersForPaych(ctx, *ci.Channel) require.NoError(t, err) require.Len(t, vouchers, 1) // Requesting voucher for non-existent channel should error - _, err = store.VouchersForPaych(tutils.NewIDAddr(t, 300)) + _, err = store.VouchersForPaych(ctx, tutils.NewIDAddr(t, 300)) require.Equal(t, err, ErrChannelNotTracked) // Allocate lane for channel - lane, err := store.AllocateLane(*ci.Channel) + lane, err := store.AllocateLane(ctx, *ci.Channel) require.NoError(t, err) require.Equal(t, lane, uint64(0)) // Allocate next lane for channel - lane, err = store.AllocateLane(*ci.Channel) + lane, err = store.AllocateLane(ctx, *ci.Channel) require.NoError(t, err) require.Equal(t, lane, uint64(1)) // Allocate next lane for non-existent channel should error - _, err = store.AllocateLane(tutils.NewIDAddr(t, 300)) + _, err = store.AllocateLane(ctx, tutils.NewIDAddr(t, 300)) require.Equal(t, err, ErrChannelNotTracked) } diff --git a/pkg/repo/fskeystore/fskeystore_test.go b/pkg/repo/fskeystore/fskeystore_test.go index 9254e9073e..ff705f57fb 100644 --- a/pkg/repo/fskeystore/fskeystore_test.go +++ b/pkg/repo/fskeystore/fskeystore_test.go @@ -12,7 +12,7 @@ import ( "github.com/stretchr/testify/assert" - ci "github.com/libp2p/go-libp2p-core/crypto" + "github.com/libp2p/go-libp2p-core/crypto" tf "github.com/filecoin-project/venus/pkg/testhelpers/testflags" ) @@ -258,15 +258,17 @@ func (rr rr) Read(b []byte) (int, error) { } func privKeyOrFatal(t *testing.T) []byte { - priv, _, err := ci.GenerateEd25519Key(rr{}) + priv, _, err := crypto.GenerateEd25519Key(rr{}) if err != nil { t.Fatal(err) } - data, err := priv.Bytes() + + kbytes, err := crypto.MarshalPrivateKey(priv) if err != nil { t.Fatal(err) } - return data + + return kbytes } func assertGetKey(ks Keystore, name string, exp []byte) error { diff --git a/pkg/repo/fsrepo_test.go b/pkg/repo/fsrepo_test.go index 4de39f69e6..fa50024001 100644 --- a/pkg/repo/fsrepo_test.go +++ b/pkg/repo/fsrepo_test.go @@ -1,6 +1,7 @@ package repo import ( + "context" "fmt" "io/ioutil" "os" @@ -132,13 +133,13 @@ func TestFSRepoRoundtrip(t *testing.T) { assert.NoError(t, err) assert.Equal(t, cfg, r.Config()) - assert.NoError(t, r.ChainDatastore().Put(ds.NewKey("beep"), []byte("boop"))) + assert.NoError(t, r.ChainDatastore().Put(context.Background(), ds.NewKey("beep"), []byte("boop"))) assert.NoError(t, r.Close()) r2, err := OpenFSRepo(repoPath, 42) assert.NoError(t, err) - val, err := r2.ChainDatastore().Get(ds.NewKey("beep")) + val, err := r2.ChainDatastore().Get(context.Background(), ds.NewKey("beep")) assert.NoError(t, err) assert.Equal(t, []byte("boop"), val) diff --git a/pkg/state/signer.go b/pkg/state/signer.go index 05ecfc0d76..882e65b728 100644 --- a/pkg/state/signer.go +++ b/pkg/state/signer.go @@ -39,7 +39,7 @@ func (s *Signer) SignBytes(ctx context.Context, data []byte, addr address.Addres if err != nil { return nil, err } - return s.wallet.SignBytes(data, signingAddr) + return s.wallet.SignBytes(ctx, data, signingAddr) } // HasAddress returns whether this signer can sign with the given address @@ -48,7 +48,7 @@ func (s *Signer) HasAddress(ctx context.Context, addr address.Address) (bool, er if err != nil { return false, err } - return s.wallet.HasAddress(signingAddr), nil + return s.wallet.HasAddress(ctx, signingAddr), nil } type HeadSignView struct { diff --git a/pkg/statemanger/call.go b/pkg/statemanger/call.go index 3d41b52dba..24851d44d5 100644 --- a/pkg/statemanger/call.go +++ b/pkg/statemanger/call.go @@ -40,7 +40,7 @@ func (s *Stmgr) CallWithGas(ctx context.Context, msg *types.Message, priorMsgs [ // height to have no fork, because we'll run it inside this // function before executing the given message. for ts.Height() > 0 && (s.fork.HasExpensiveFork(ctx, ts.Height()) || s.fork.HasExpensiveFork(ctx, ts.Height()-1)) { - ts, err = s.cs.GetTipSet(ts.Parents()) + ts, err = s.cs.GetTipSet(ctx, ts.Parents()) if err != nil { return nil, xerrors.Errorf("failed to find a non-forking epoch: %v", err) } @@ -64,7 +64,7 @@ func (s *Stmgr) CallWithGas(ctx context.Context, msg *types.Message, priorMsgs [ } return cs.FilCirculating, nil }, - LookbackStateGetter: vmcontext.LookbackStateGetterForTipset(s.cs, s.fork, ts), + LookbackStateGetter: vmcontext.LookbackStateGetterForTipset(ctx, s.cs, s.fork, ts), NtwkVersionGetter: s.fork.GetNtwkVersion, Rnd: consensus.NewHeadRandomness(s.rnd, ts.Key()), BaseFee: ts.At(0).ParentBaseFee, @@ -131,14 +131,14 @@ func (s *Stmgr) Call(ctx context.Context, msg *types.Message, ts *types.TipSet) // Search back till we find a height with no fork, or we reach the beginning. for ts.Height() > 0 && s.fork.HasExpensiveFork(ctx, ts.Height()-1) { var err error - ts, err = s.cs.GetTipSet(ts.Parents()) + ts, err = s.cs.GetTipSet(ctx, ts.Parents()) if err != nil { return nil, xerrors.Errorf("failed to find a non-forking epoch: %v", err) } } } - pts, err := s.cs.GetTipSet(ts.Parents()) + pts, err := s.cs.GetTipSet(ctx, ts.Parents()) if err != nil { return nil, xerrors.Errorf("failed to load parent tipset: %v", err) } @@ -196,7 +196,7 @@ func (s *Stmgr) Call(ctx context.Context, msg *types.Message, ts *types.TipSet) } return dertail.FilCirculating, nil }, - LookbackStateGetter: vmcontext.LookbackStateGetterForTipset(s.cs, s.fork, ts), + LookbackStateGetter: vmcontext.LookbackStateGetterForTipset(ctx, s.cs, s.fork, ts), NtwkVersionGetter: s.fork.GetNtwkVersion, Rnd: consensus.NewHeadRandomness(s.rnd, ts.Key()), BaseFee: ts.At(0).ParentBaseFee, diff --git a/pkg/statemanger/state_manger.go b/pkg/statemanger/state_manger.go index 995ccb1d03..c8e7b2f0bc 100644 --- a/pkg/statemanger/state_manger.go +++ b/pkg/statemanger/state_manger.go @@ -123,7 +123,7 @@ func (s *Stmgr) GetMarketState(ctx context.Context, ts *types.TipSet) (market.St } func (s *Stmgr) ParentStateTsk(ctx context.Context, tsk types.TipSetKey) (*types.TipSet, *tree.State, error) { - ts, err := s.cs.GetTipSet(tsk) + ts, err := s.cs.GetTipSet(ctx, tsk) if err != nil { return nil, nil, xerrors.Errorf("loading tipset %s: %w", tsk, err) } @@ -134,7 +134,7 @@ func (s *Stmgr) ParentState(ctx context.Context, ts *types.TipSet) (*types.TipSe if ts == nil { ts = s.cs.GetHead() } - parent, err := s.cs.GetTipSet(ts.Parents()) + parent, err := s.cs.GetTipSet(ctx, ts.Parents()) if err != nil { return nil, nil, xerrors.Errorf("find tipset(%s) parent failed:%w", ts.Key().String(), err) @@ -151,7 +151,7 @@ func (s *Stmgr) ParentState(ctx context.Context, ts *types.TipSet) (*types.TipSe } func (s *Stmgr) TipsetStateTsk(ctx context.Context, tsk types.TipSetKey) (*types.TipSet, *tree.State, error) { - ts, err := s.cs.GetTipSet(tsk) + ts, err := s.cs.GetTipSet(ctx, tsk) if err != nil { return nil, nil, xerrors.Errorf("load tipset(%s) failed:%v", tsk.String(), err) @@ -177,7 +177,7 @@ func (s *Stmgr) Rollback(ctx context.Context, pts, cts *types.TipSet) error { s.log.Infof("rollback chain head from(%d) to a valid tipset", pts.Height()) redo: s.stLk.Lock() - if err := s.cs.DeleteTipSetMetadata(pts); err != nil { + if err := s.cs.DeleteTipSetMetadata(ctx, pts); err != nil { s.stLk.Unlock() return err } @@ -191,7 +191,7 @@ redo: return err } else if !root.Equals(cts.At(0).ParentStateRoot) { cts = pts - if pts, err = s.cs.GetTipSet(cts.Parents()); err != nil { + if pts, err = s.cs.GetTipSet(ctx, cts.Parents()); err != nil { return err } goto redo @@ -228,7 +228,7 @@ func (s *Stmgr) RunStateTransition(ctx context.Context, ts *types.TipSet) (root } } - if meta, _ := s.cs.GetTipsetMetadata(ts); meta != nil { + if meta, _ := s.cs.GetTipsetMetadata(ctx, ts); meta != nil { s.stLk.Unlock() return meta.TipSetStateRoot, meta.TipSetReceipts, nil } @@ -264,7 +264,7 @@ func (s *Stmgr) RunStateTransition(ctx context.Context, ts *types.TipSet) (root // ctx context.Context, ts *types.TipSet, addr address.Address func (s *Stmgr) GetActorAtTsk(ctx context.Context, addr address.Address, tsk types.TipSetKey) (*types.Actor, error) { - ts, err := s.cs.GetTipSet(tsk) + ts, err := s.cs.GetTipSet(ctx, tsk) if err != nil { return nil, err } @@ -319,7 +319,7 @@ func (s *Stmgr) RunStateTransitionV2(ctx context.Context, ts *types.TipSet) (cid return state.stateRoot, state.receipt, nil } - if meta, _ := s.cs.GetTipsetMetadata(ts); meta != nil { + if meta, _ := s.cs.GetTipsetMetadata(ctx, ts); meta != nil { s.stLk.Unlock() return meta.TipSetStateRoot, meta.TipSetReceipts, nil } @@ -356,7 +356,7 @@ func (s *Stmgr) RunStateTransitionV2(ctx context.Context, ts *types.TipSet) (cid } func (s *Stmgr) ParentStateViewTsk(ctx context.Context, tsk types.TipSetKey) (*types.TipSet, *appstate.View, error) { - ts, err := s.cs.GetTipSet(tsk) + ts, err := s.cs.GetTipSet(ctx, tsk) if err != nil { return nil, nil, err } @@ -367,7 +367,7 @@ func (s *Stmgr) ParentStateView(ctx context.Context, ts *types.TipSet) (*types.T if ts == nil { ts = s.cs.GetHead() } - parent, err := s.cs.GetTipSet(ts.Parents()) + parent, err := s.cs.GetTipSet(ctx, ts.Parents()) if err != nil { return nil, nil, err } @@ -380,7 +380,7 @@ func (s *Stmgr) ParentStateView(ctx context.Context, ts *types.TipSet) (*types.T } func (s *Stmgr) StateViewTsk(ctx context.Context, tsk types.TipSetKey) (*types.TipSet, cid.Cid, *appstate.View, error) { - ts, err := s.cs.GetTipSet(tsk) + ts, err := s.cs.GetTipSet(ctx, tsk) if err != nil { return nil, cid.Undef, nil, err } @@ -394,7 +394,7 @@ func (s *Stmgr) StateView(ctx context.Context, ts *types.TipSet) (cid.Cid, *apps return cid.Undef, nil, err } - view, err := s.cs.StateView(ts) + view, err := s.cs.StateView(ctx, ts) if err != nil { return cid.Undef, nil, err } diff --git a/pkg/testhelpers/cid.go b/pkg/testhelpers/cid.go index 135976765e..5af7ca0203 100644 --- a/pkg/testhelpers/cid.go +++ b/pkg/testhelpers/cid.go @@ -4,15 +4,16 @@ import ( "context" "testing" - "github.com/filecoin-project/specs-actors/actors/util/adt" - "github.com/filecoin-project/venus/pkg/constants" - "github.com/filecoin-project/venus/pkg/util/blockstoreutil" - types "github.com/filecoin-project/venus/venus-shared/chain" "github.com/ipfs/go-cid" "github.com/ipfs/go-datastore" cbor "github.com/ipfs/go-ipld-cbor" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + + "github.com/filecoin-project/specs-actors/actors/util/adt" + "github.com/filecoin-project/venus/pkg/constants" + "github.com/filecoin-project/venus/pkg/util/blockstoreutil" + types "github.com/filecoin-project/venus/venus-shared/chain" ) // EmptyMessagesCID is the cid of an empty collection of messages. diff --git a/pkg/testhelpers/net.go b/pkg/testhelpers/net.go index 2ba8415d01..df376d124f 100644 --- a/pkg/testhelpers/net.go +++ b/pkg/testhelpers/net.go @@ -142,7 +142,7 @@ func newFakeStream() fakeStream { return fakeStream{} } func (fs fakeStream) ID() string { return "" } func (fs fakeStream) Protocol() protocol.ID { return fs.pid } // nolint: golint func (fs fakeStream) SetProtocol(id protocol.ID) { fs.pid = id } // nolint: golint -func (fs fakeStream) Stat() inet.Stat { panic("not implemented") } // nolint: golint +func (fs fakeStream) Stat() inet.Stats { panic("not implemented") } // nolint: golint func (fs fakeStream) Conn() inet.Conn { panic("not implemented") } // nolint: golint func (fs fakeStream) Write(_ []byte) (int, error) { return 1, nil } // nolint: golint func (fs fakeStream) Read(_ []byte) (int, error) { return 1, nil } // nolint: golint diff --git a/pkg/util/blockstoreutil/badger.go b/pkg/util/blockstoreutil/badger.go index 974f6534a0..f536e40fa8 100644 --- a/pkg/util/blockstoreutil/badger.go +++ b/pkg/util/blockstoreutil/badger.go @@ -178,7 +178,7 @@ func (b *BadgerBlockstore) ReadonlyDatastore() *TxBlockstore { // View implements blockstore.Viewer, which leverages zero-copy read-only // access to values. -func (b *BadgerBlockstore) View(cid cid.Cid, fn func([]byte) error) error { +func (b *BadgerBlockstore) View(ctx context.Context, cid cid.Cid, fn func([]byte) error) error { if atomic.LoadInt64(&b.state) != stateOpen { return ErrBlockstoreClosed } @@ -197,7 +197,7 @@ func (b *BadgerBlockstore) View(cid cid.Cid, fn func([]byte) error) error { } // Has implements blockstore.Has. -func (b *BadgerBlockstore) Has(cid cid.Cid) (bool, error) { +func (b *BadgerBlockstore) Has(ctx context.Context, cid cid.Cid) (bool, error) { if atomic.LoadInt64(&b.state) != stateOpen { return false, ErrBlockstoreClosed } @@ -225,7 +225,7 @@ func (b *BadgerBlockstore) Has(cid cid.Cid) (bool, error) { } // Get implements blockstore.Get. -func (b *BadgerBlockstore) Get(cid cid.Cid) (blocks.Block, error) { +func (b *BadgerBlockstore) Get(ctx context.Context, cid cid.Cid) (blocks.Block, error) { if !cid.Defined() { return nil, blockstore.ErrNotFound } @@ -268,7 +268,7 @@ func (b *BadgerBlockstore) Get(cid cid.Cid) (blocks.Block, error) { } // GetSize implements blockstore.GetSize. -func (b *BadgerBlockstore) GetSize(cid cid.Cid) (int, error) { +func (b *BadgerBlockstore) GetSize(ctx context.Context, cid cid.Cid) (int, error) { if atomic.LoadInt64(&b.state) != stateOpen { return -1, ErrBlockstoreClosed } @@ -299,7 +299,7 @@ func (b *BadgerBlockstore) GetSize(cid cid.Cid) (int, error) { } // Put implements blockstore.Put. -func (b *BadgerBlockstore) Put(block blocks.Block) error { +func (b *BadgerBlockstore) Put(ctx context.Context, block blocks.Block) error { if atomic.LoadInt64(&b.state) != stateOpen { return ErrBlockstoreClosed } @@ -323,7 +323,7 @@ func (b *BadgerBlockstore) Put(block blocks.Block) error { } // PutMany implements blockstore.PutMany. -func (b *BadgerBlockstore) PutMany(blks []blocks.Block) error { +func (b *BadgerBlockstore) PutMany(ctx context.Context, blks []blocks.Block) error { if atomic.LoadInt64(&b.state) != stateOpen { return ErrBlockstoreClosed } @@ -357,7 +357,7 @@ func (b *BadgerBlockstore) PutMany(blks []blocks.Block) error { } // DeleteBlock implements blockstore.DeleteBlock. -func (b *BadgerBlockstore) DeleteBlock(cid cid.Cid) error { +func (b *BadgerBlockstore) DeleteBlock(ctx context.Context, cid cid.Cid) error { if atomic.LoadInt64(&b.state) != stateOpen { return ErrBlockstoreClosed } diff --git a/pkg/util/blockstoreutil/buf_bstore.go b/pkg/util/blockstoreutil/buf_bstore.go index 58a32304e8..f6e05d2fcf 100644 --- a/pkg/util/blockstoreutil/buf_bstore.go +++ b/pkg/util/blockstoreutil/buf_bstore.go @@ -97,18 +97,18 @@ func (bs *BufferedBS) AllKeysChan(ctx context.Context) (<-chan cid.Cid, error) { return out, nil } -func (bs *BufferedBS) DeleteBlock(c cid.Cid) error { - if err := bs.read.DeleteBlock(c); err != nil { +func (bs *BufferedBS) DeleteBlock(ctx context.Context, c cid.Cid) error { + if err := bs.read.DeleteBlock(ctx, c); err != nil { return err } - return bs.write.DeleteBlock(c) + return bs.write.DeleteBlock(ctx, c) } -func (bs *BufferedBS) View(c cid.Cid, callback func([]byte) error) error { +func (bs *BufferedBS) View(ctx context.Context, c cid.Cid, callback func([]byte) error) error { if bs.writeviewer == nil || bs.readviewer == nil { // one of the stores isn't Viewer; fall back to pure Get behaviour. - blk, err := bs.Get(c) + blk, err := bs.Get(ctx, c) if err != nil { return err } @@ -116,16 +116,16 @@ func (bs *BufferedBS) View(c cid.Cid, callback func([]byte) error) error { } // both stores are viewable. - if err := bs.writeviewer.View(c, callback); err == ErrNotFound { + if err := bs.writeviewer.View(ctx, c, callback); err == ErrNotFound { // not found in write blockstore; fall through. } else { return err // propagate errors, or nil, i.e. found. } - return bs.readviewer.View(c, callback) + return bs.readviewer.View(ctx, c, callback) } -func (bs *BufferedBS) Get(c cid.Cid) (block.Block, error) { - if out, err := bs.write.Get(c); err != nil { +func (bs *BufferedBS) Get(ctx context.Context, c cid.Cid) (block.Block, error) { + if out, err := bs.write.Get(ctx, c); err != nil { if err != ErrNotFound { return nil, err } @@ -133,20 +133,20 @@ func (bs *BufferedBS) Get(c cid.Cid) (block.Block, error) { return out, nil } - return bs.read.Get(c) + return bs.read.Get(ctx, c) } -func (bs *BufferedBS) GetSize(c cid.Cid) (int, error) { - s, err := bs.read.GetSize(c) +func (bs *BufferedBS) GetSize(ctx context.Context, c cid.Cid) (int, error) { + s, err := bs.read.GetSize(ctx, c) if err == ErrNotFound || s == 0 { - return bs.write.GetSize(c) + return bs.write.GetSize(ctx, c) } return s, err } -func (bs *BufferedBS) Put(blk block.Block) error { - has, err := bs.read.Has(blk.Cid()) // TODO: consider dropping this check +func (bs *BufferedBS) Put(ctx context.Context, blk block.Block) error { + has, err := bs.read.Has(ctx, blk.Cid()) // TODO: consider dropping this check if err != nil { return err } @@ -155,11 +155,11 @@ func (bs *BufferedBS) Put(blk block.Block) error { return nil } - return bs.write.Put(blk) + return bs.write.Put(ctx, blk) } -func (bs *BufferedBS) Has(c cid.Cid) (bool, error) { - has, err := bs.write.Has(c) +func (bs *BufferedBS) Has(ctx context.Context, c cid.Cid) (bool, error) { + has, err := bs.write.Has(ctx, c) if err != nil { return false, err } @@ -167,7 +167,7 @@ func (bs *BufferedBS) Has(c cid.Cid) (bool, error) { return true, nil } - return bs.read.Has(c) + return bs.read.Has(ctx, c) } func (bs *BufferedBS) HashOnRead(hor bool) { @@ -175,8 +175,8 @@ func (bs *BufferedBS) HashOnRead(hor bool) { bs.write.HashOnRead(hor) } -func (bs *BufferedBS) PutMany(blks []block.Block) error { - return bs.write.PutMany(blks) +func (bs *BufferedBS) PutMany(ctx context.Context, blks []block.Block) error { + return bs.write.PutMany(ctx, blks) } func (bs *BufferedBS) Read() Blockstore { diff --git a/pkg/util/blockstoreutil/copy.go b/pkg/util/blockstoreutil/copy.go index d39d554649..cbbc6211c7 100644 --- a/pkg/util/blockstoreutil/copy.go +++ b/pkg/util/blockstoreutil/copy.go @@ -22,7 +22,7 @@ func CopyBlockstore(ctx context.Context, from, to Blockstore) error { // TODO: should probably expose better methods on the blockstore for this operation var blks []blocks.Block for c := range cids { - b, err := from.Get(c) + b, err := from.Get(ctx, c) if err != nil { return err } @@ -30,7 +30,7 @@ func CopyBlockstore(ctx context.Context, from, to Blockstore) error { blks = append(blks, b) } - if err := to.PutMany(blks); err != nil { + if err := to.PutMany(ctx, blks); err != nil { return err } @@ -72,7 +72,7 @@ func CopyParticial(ctx context.Context, from, to Blockstore, root cid.Cid) error go func() { for b := range toFlush { - if err := to.PutMany(b); err != nil { + if err := to.PutMany(ctx, b); err != nil { close(freeBufs) errFlushChan <- xerrors.Errorf("batch put in copy: %v", err) return @@ -101,7 +101,7 @@ func CopyParticial(ctx context.Context, from, to Blockstore, root cid.Cid) error return nil } - if err := copyRec(from, to, root, batchCp); err != nil { + if err := copyRec(ctx, from, to, root, batchCp); err != nil { return xerrors.Errorf("copyRec: %v", err) } @@ -121,13 +121,13 @@ func CopyParticial(ctx context.Context, from, to Blockstore, root cid.Cid) error return nil } -func copyRec(from, to Blockstore, root cid.Cid, cp func(blocks.Block) error) error { +func copyRec(ctx context.Context, from, to Blockstore, root cid.Cid, cp func(blocks.Block) error) error { if root.Prefix().MhType == 0 { // identity cid, skip return nil } - blk, err := from.Get(root) + blk, err := from.Get(ctx, root) if err != nil { return xerrors.Errorf("get %s failed: %v", root, err) } @@ -152,7 +152,7 @@ func copyRec(from, to Blockstore, root cid.Cid, cp func(blocks.Block) error) err } } else { // If we have an object, we already have its children, skip the object. - has, err := to.Has(link) + has, err := to.Has(ctx, link) if err != nil { lerr = xerrors.Errorf("has: %v", err) return @@ -162,7 +162,7 @@ func copyRec(from, to Blockstore, root cid.Cid, cp func(blocks.Block) error) err } } - if err := copyRec(from, to, link, cp); err != nil { + if err := copyRec(ctx, from, to, link, cp); err != nil { lerr = err return } diff --git a/pkg/util/blockstoreutil/memstore.go b/pkg/util/blockstoreutil/memstore.go index fe249b2e56..d53520e645 100644 --- a/pkg/util/blockstoreutil/memstore.go +++ b/pkg/util/blockstoreutil/memstore.go @@ -10,17 +10,17 @@ import ( // MemStore is a terminal blockstore that keeps blocks in memory. type MemStore map[cid.Cid]blocks.Block -func (m MemStore) DeleteBlock(k cid.Cid) error { +func (m MemStore) DeleteBlock(ctx context.Context, k cid.Cid) error { delete(m, k) return nil } -func (m MemStore) Has(k cid.Cid) (bool, error) { +func (m MemStore) Has(ctx context.Context, k cid.Cid) (bool, error) { _, ok := m[k] return ok, nil } -func (m MemStore) View(k cid.Cid, callback func([]byte) error) error { +func (m MemStore) View(ctx context.Context, k cid.Cid, callback func([]byte) error) error { b, ok := m[k] if !ok { return ErrNotFound @@ -28,7 +28,7 @@ func (m MemStore) View(k cid.Cid, callback func([]byte) error) error { return callback(b.RawData()) } -func (m MemStore) Get(k cid.Cid) (blocks.Block, error) { +func (m MemStore) Get(ctx context.Context, k cid.Cid) (blocks.Block, error) { b, ok := m[k] if !ok { return nil, ErrNotFound @@ -37,7 +37,7 @@ func (m MemStore) Get(k cid.Cid) (blocks.Block, error) { } // GetSize returns the CIDs mapped BlockSize -func (m MemStore) GetSize(k cid.Cid) (int, error) { +func (m MemStore) GetSize(ctx context.Context, k cid.Cid) (int, error) { b, ok := m[k] if !ok { return 0, ErrNotFound @@ -46,7 +46,7 @@ func (m MemStore) GetSize(k cid.Cid) (int, error) { } // Put puts a given block to the underlying datastore -func (m MemStore) Put(b blocks.Block) error { +func (m MemStore) Put(ctx context.Context, b blocks.Block) error { // Convert to a basic block for safety, but try to reuse the existing // block if it's already a basic block. k := b.Cid() @@ -64,9 +64,9 @@ func (m MemStore) Put(b blocks.Block) error { // PutMany puts a slice of blocks at the same time using batching // capabilities of the underlying datastore whenever possible. -func (m MemStore) PutMany(bs []blocks.Block) error { +func (m MemStore) PutMany(ctx context.Context, bs []blocks.Block) error { for _, b := range bs { - _ = m.Put(b) // can't fail + _ = m.Put(ctx, b) // can't fail } return nil } diff --git a/pkg/util/blockstoreutil/syncstore.go b/pkg/util/blockstoreutil/syncstore.go index faf0ae7be5..bdfb216f0f 100644 --- a/pkg/util/blockstoreutil/syncstore.go +++ b/pkg/util/blockstoreutil/syncstore.go @@ -13,42 +13,42 @@ type SyncStore struct { bs MemStore // specifically use a memStore to save indirection overhead. } -func (m *SyncStore) DeleteBlock(k cid.Cid) error { +func (m *SyncStore) DeleteBlock(ctx context.Context, k cid.Cid) error { m.mu.Lock() defer m.mu.Unlock() - return m.bs.DeleteBlock(k) + return m.bs.DeleteBlock(ctx, k) } -func (m *SyncStore) Has(k cid.Cid) (bool, error) { +func (m *SyncStore) Has(ctx context.Context, k cid.Cid) (bool, error) { m.mu.RLock() defer m.mu.RUnlock() - return m.bs.Has(k) + return m.bs.Has(ctx, k) } -func (m *SyncStore) Get(k cid.Cid) (blocks.Block, error) { +func (m *SyncStore) Get(ctx context.Context, k cid.Cid) (blocks.Block, error) { m.mu.RLock() defer m.mu.RUnlock() - return m.bs.Get(k) + return m.bs.Get(ctx, k) } // GetSize returns the CIDs mapped BlockSize -func (m *SyncStore) GetSize(k cid.Cid) (int, error) { +func (m *SyncStore) GetSize(ctx context.Context, k cid.Cid) (int, error) { m.mu.RLock() defer m.mu.RUnlock() - return m.bs.GetSize(k) + return m.bs.GetSize(ctx, k) } // Put puts a given block to the underlying datastore -func (m *SyncStore) Put(b blocks.Block) error { +func (m *SyncStore) Put(ctx context.Context, b blocks.Block) error { m.mu.Lock() defer m.mu.Unlock() - return m.bs.Put(b) + return m.bs.Put(ctx, b) } // PutMany puts a slice of blocks at the same time using batching // capabilities of the underlying datastore whenever possible. -func (m *SyncStore) PutMany(bs []blocks.Block) error { +func (m *SyncStore) PutMany(ctx context.Context, bs []blocks.Block) error { m.mu.Lock() defer m.mu.Unlock() - return m.bs.PutMany(bs) + return m.bs.PutMany(ctx, bs) } // AllKeysChan returns a channel from which diff --git a/pkg/util/blockstoreutil/view_blockstore.go b/pkg/util/blockstoreutil/view_blockstore.go index c83991c1d1..050f0e39f0 100644 --- a/pkg/util/blockstoreutil/view_blockstore.go +++ b/pkg/util/blockstoreutil/view_blockstore.go @@ -21,11 +21,11 @@ type TxBlockstore struct { keyTransform *keytransform.PrefixTransform } -func (txBlockstore *TxBlockstore) DeleteBlock(cid cid.Cid) error { +func (txBlockstore *TxBlockstore) DeleteBlock(ctx context.Context, cid cid.Cid) error { return xerrors.New("readonly blocksgtore") } -func (txBlockstore *TxBlockstore) Has(cid cid.Cid) (bool, error) { +func (txBlockstore *TxBlockstore) Has(ctx context.Context, cid cid.Cid) (bool, error) { key := txBlockstore.ConvertKey(cid) if txBlockstore.cache != nil { if _, has := txBlockstore.cache.Get(key.String()); has { @@ -44,7 +44,7 @@ func (txBlockstore *TxBlockstore) Has(cid cid.Cid) (bool, error) { } } -func (txBlockstore *TxBlockstore) Get(cid cid.Cid) (blocks.Block, error) { +func (txBlockstore *TxBlockstore) Get(ctx context.Context, cid cid.Cid) (blocks.Block, error) { if !cid.Defined() { return nil, ErrNotFound } @@ -80,7 +80,7 @@ func (txBlockstore *TxBlockstore) Get(cid cid.Cid) (blocks.Block, error) { return blk, nil } -func (txBlockstore *TxBlockstore) GetSize(cid cid.Cid) (int, error) { +func (txBlockstore *TxBlockstore) GetSize(ctx context.Context, cid cid.Cid) (int, error) { key := txBlockstore.ConvertKey(cid) if txBlockstore.cache != nil { if val, has := txBlockstore.cache.Get(key.String()); has { @@ -102,11 +102,11 @@ func (txBlockstore *TxBlockstore) GetSize(cid cid.Cid) (int, error) { return size, err } -func (txBlockstore *TxBlockstore) Put(block blocks.Block) error { +func (txBlockstore *TxBlockstore) Put(ctx context.Context, block blocks.Block) error { return xerrors.New("readonly blocksgtore") } -func (txBlockstore *TxBlockstore) PutMany(blocks []blocks.Block) error { +func (txBlockstore *TxBlockstore) PutMany(ctx context.Context, blocks []blocks.Block) error { return xerrors.New("readonly blocksgtore") } diff --git a/pkg/util/dag/dag_test.go b/pkg/util/dag/dag_test.go index f3c310faf9..e013a0bcc7 100644 --- a/pkg/util/dag/dag_test.go +++ b/pkg/util/dag/dag_test.go @@ -67,7 +67,7 @@ func TestDAGGet(t *testing.T) { ipldnode := chain.NewBuilder(t, address.Undef).Genesis().At(0).ToNode() // put into out dagservice - assert.NoError(t, blkserv.AddBlock(ipldnode)) + assert.NoError(t, blkserv.AddBlock(ctx, ipldnode)) res, err := dag.GetNode(ctx, ipldnode.Cid().String()) assert.NoError(t, err) diff --git a/pkg/vm/vmcontext/gas_charge_ipld.go b/pkg/vm/vmcontext/gas_charge_ipld.go index 881f5c881f..649f87ad3f 100644 --- a/pkg/vm/vmcontext/gas_charge_ipld.go +++ b/pkg/vm/vmcontext/gas_charge_ipld.go @@ -1,6 +1,7 @@ package vmcontext import ( + "context" "github.com/filecoin-project/venus/pkg/vm/gas" blocks "github.com/ipfs/go-block-format" "github.com/ipfs/go-cid" @@ -18,10 +19,10 @@ type GasChargeBlockStore struct { } //Get charge gas and than get the value of cid -func (bs *GasChargeBlockStore) Get(c cid.Cid) (blocks.Block, error) { +func (bs *GasChargeBlockStore) Get(ctx context.Context, c cid.Cid) (blocks.Block, error) { bs.gasTank.Charge(bs.pricelist.OnIpldGet(), "storage get %s", c) - blk, err := bs.inner.Get(c) + blk, err := bs.inner.Get(ctx, c) if err != nil { panic(xerrors.WithMessage(err, "failed to get block from blockstore")) } @@ -29,10 +30,10 @@ func (bs *GasChargeBlockStore) Get(c cid.Cid) (blocks.Block, error) { } //Put first charge gas and than save block -func (bs *GasChargeBlockStore) Put(blk blocks.Block) error { +func (bs *GasChargeBlockStore) Put(ctx context.Context, blk blocks.Block) error { bs.gasTank.Charge(bs.pricelist.OnIpldPut(len(blk.RawData())), "%s storage put %d bytes", blk.Cid(), len(blk.RawData())) - if err := bs.inner.Put(blk); err != nil { + if err := bs.inner.Put(ctx, blk); err != nil { panic(xerrors.WithMessage(err, "failed to write data to disk")) } return nil diff --git a/pkg/vm/vmcontext/types.go b/pkg/vm/vmcontext/types.go index 21f3527138..6207519baf 100644 --- a/pkg/vm/vmcontext/types.go +++ b/pkg/vm/vmcontext/types.go @@ -41,18 +41,18 @@ type VmOption struct { //nolint //ChainRandomness define randomness method in filecoin type ILookBack interface { - StateView(ts *types.TipSet) (*state.View, error) + StateView(ctx context.Context, ts *types.TipSet) (*state.View, error) GetLookbackTipSetForRound(ctx context.Context, ts *types.TipSet, round abi.ChainEpoch, version network.Version) (*types.TipSet, cid.Cid, error) } -func LookbackStateGetterForTipset(backer ILookBack, fork fork.IFork, ts *types.TipSet) LookbackStateGetter { +func LookbackStateGetterForTipset(ctx context.Context, backer ILookBack, fork fork.IFork, ts *types.TipSet) LookbackStateGetter { return func(ctx context.Context, round abi.ChainEpoch) (*state.View, error) { ver := fork.GetNtwkVersion(ctx, round) ts, _, err := backer.GetLookbackTipSetForRound(ctx, ts, round, ver) if err != nil { return nil, err } - return backer.StateView(ts) + return backer.StateView(ctx, ts) } } diff --git a/pkg/wallet/backend.go b/pkg/wallet/backend.go index 175ed455e2..971224a176 100644 --- a/pkg/wallet/backend.go +++ b/pkg/wallet/backend.go @@ -1,6 +1,7 @@ package wallet import ( + "context" "github.com/filecoin-project/go-address" "github.com/filecoin-project/venus/pkg/crypto" @@ -10,23 +11,23 @@ import ( // that can contain many addresses. type Backend interface { // Addresses returns a list of all accounts currently stored in this backend. - Addresses() []address.Address + Addresses(ctx context.Context) []address.Address // Contains returns true if this backend stores the passed in address. - HasAddress(address.Address) bool + HasAddress(context.Context, address.Address) bool // Sign cryptographically signs data with the private key associated with an address. - SignBytes([]byte, address.Address) (*crypto.Signature, error) + SignBytes(context.Context, []byte, address.Address) (*crypto.Signature, error) // GetKeyInfo will return the keyinfo associated with address `addr` // iff backend contains the addr. - GetKeyInfo(address.Address) (*crypto.KeyInfo, error) + GetKeyInfo(context.Context, address.Address) (*crypto.KeyInfo, error) - GetKeyInfoPassphrase(address.Address, []byte) (*crypto.KeyInfo, error) + GetKeyInfoPassphrase(context.Context, address.Address, []byte) (*crypto.KeyInfo, error) - LockWallet() error - UnLockWallet([]byte) error - WalletState() int + LockWallet(context.Context) error + UnLockWallet(context.Context, []byte) error + WalletState(context.Context) int } // Importer is a specialization of a wallet backend that can import @@ -35,5 +36,5 @@ type Backend interface { type Importer interface { // ImportKey imports the key described by the given keyinfo // into the backend - ImportKey(*crypto.KeyInfo) error + ImportKey(context.Context, *crypto.KeyInfo) error } diff --git a/pkg/wallet/dsbackend.go b/pkg/wallet/dsbackend.go index 84c11058ec..9b2f8edfaa 100644 --- a/pkg/wallet/dsbackend.go +++ b/pkg/wallet/dsbackend.go @@ -1,6 +1,7 @@ package wallet import ( + "context" "crypto/rand" "reflect" "strings" @@ -52,8 +53,8 @@ type DSBackend struct { var _ Backend = (*DSBackend)(nil) // NewDSBackend constructs a new backend using the passed in datastore. -func NewDSBackend(ds repo.Datastore, passphraseCfg config.PassphraseConfig, password []byte) (*DSBackend, error) { - result, err := ds.Query(dsq.Query{ +func NewDSBackend(ctx context.Context, ds repo.Datastore, passphraseCfg config.PassphraseConfig, password []byte) (*DSBackend, error) { + result, err := ds.Query(ctx, dsq.Query{ KeysOnly: true, }) if err != nil { @@ -82,7 +83,7 @@ func NewDSBackend(ds repo.Datastore, passphraseCfg config.PassphraseConfig, pass } if len(password) != 0 { - if err := backend.SetPassword(password); err != nil { + if err := backend.SetPassword(ctx, password); err != nil { return nil, err } } @@ -91,12 +92,12 @@ func NewDSBackend(ds repo.Datastore, passphraseCfg config.PassphraseConfig, pass } // ImportKey loads the address in `ai` and KeyInfo `ki` into the backend -func (backend *DSBackend) ImportKey(ki *crypto.KeyInfo) error { - return backend.putKeyInfo(ki) +func (backend *DSBackend) ImportKey(ctx context.Context, ki *crypto.KeyInfo) error { + return backend.putKeyInfo(ctx, ki) } // Addresses returns a list of all addresses that are stored in this backend. -func (backend *DSBackend) Addresses() []address.Address { +func (backend *DSBackend) Addresses(ctx context.Context) []address.Address { backend.lk.RLock() defer backend.lk.RUnlock() @@ -109,7 +110,7 @@ func (backend *DSBackend) Addresses() []address.Address { // HasAddress checks if the passed in address is stored in this backend. // Safe for concurrent access. -func (backend *DSBackend) HasAddress(addr address.Address) bool { +func (backend *DSBackend) HasAddress(ctx context.Context, addr address.Address) bool { backend.lk.RLock() defer backend.lk.RUnlock() @@ -119,42 +120,42 @@ func (backend *DSBackend) HasAddress(addr address.Address) bool { // NewAddress creates a new address and stores it. // Safe for concurrent access. -func (backend *DSBackend) NewAddress(protocol address.Protocol) (address.Address, error) { +func (backend *DSBackend) NewAddress(ctx context.Context, protocol address.Protocol) (address.Address, error) { switch protocol { case address.BLS: - return backend.newBLSAddress() + return backend.newBLSAddress(ctx) case address.SECP256K1: - return backend.newSecpAddress() + return backend.newSecpAddress(ctx) default: return address.Undef, errors.Errorf("Unknown address protocol %d", protocol) } } -func (backend *DSBackend) newSecpAddress() (address.Address, error) { +func (backend *DSBackend) newSecpAddress(ctx context.Context) (address.Address, error) { ki, err := crypto.NewSecpKeyFromSeed(rand.Reader) if err != nil { return address.Undef, err } - if err := backend.putKeyInfo(&ki); err != nil { + if err := backend.putKeyInfo(ctx, &ki); err != nil { return address.Undef, err } return ki.Address() } -func (backend *DSBackend) newBLSAddress() (address.Address, error) { +func (backend *DSBackend) newBLSAddress(ctx context.Context) (address.Address, error) { ki, err := crypto.NewBLSKeyFromSeed(rand.Reader) if err != nil { return address.Undef, err } - if err := backend.putKeyInfo(&ki); err != nil { + if err := backend.putKeyInfo(ctx, &ki); err != nil { return address.Undef, err } return ki.Address() } -func (backend *DSBackend) putKeyInfo(ki *crypto.KeyInfo) error { +func (backend *DSBackend) putKeyInfo(ctx context.Context, ki *crypto.KeyInfo) error { addr, err := ki.Address() if err != nil { return err @@ -177,7 +178,7 @@ func (backend *DSBackend) putKeyInfo(ki *crypto.KeyInfo) error { } backend.lk.Lock() - if err := backend.ds.Put(ds.NewKey(key.Address.String()), keyJSON); err != nil { + if err := backend.ds.Put(ctx, ds.NewKey(key.Address.String()), keyJSON); err != nil { return errors.Wrapf(err, "failed to store new address: %s", key.Address.String()) } backend.cache[addr] = struct{}{} @@ -188,7 +189,7 @@ func (backend *DSBackend) putKeyInfo(ki *crypto.KeyInfo) error { } // SignBytes cryptographically signs `data` using the private key `priv`. -func (backend *DSBackend) SignBytes(data []byte, addr address.Address) (*crypto.Signature, error) { +func (backend *DSBackend) SignBytes(ctx context.Context, data []byte, addr address.Address) (*crypto.Signature, error) { backend.lk.Lock() ki, found := backend.unLocked[addr] backend.lk.Unlock() @@ -207,15 +208,15 @@ func (backend *DSBackend) SignBytes(data []byte, addr address.Address) (*crypto. // GetKeyInfo will return the private & public keys associated with address `addr` // iff backend contains the addr. -func (backend *DSBackend) GetKeyInfo(addr address.Address) (*crypto.KeyInfo, error) { - if !backend.HasAddress(addr) { +func (backend *DSBackend) GetKeyInfo(ctx context.Context, addr address.Address) (*crypto.KeyInfo, error) { + if !backend.HasAddress(ctx, addr) { return nil, errors.New("backend does not contain address") } var key *Key err := backend.UsePassword(func(password []byte) error { var err error - key, err = backend.getKey(addr, password) + key, err = backend.getKey(ctx, addr, password) return err }) @@ -227,17 +228,17 @@ func (backend *DSBackend) GetKeyInfo(addr address.Address) (*crypto.KeyInfo, err } //GetKeyInfoPassphrase get private private key from wallet, get encrypt byte from db and decrypto it with password -func (backend *DSBackend) GetKeyInfoPassphrase(addr address.Address, password []byte) (*crypto.KeyInfo, error) { +func (backend *DSBackend) GetKeyInfoPassphrase(ctx context.Context, addr address.Address, password []byte) (*crypto.KeyInfo, error) { defer func() { for i := range password { password[i] = 0 } }() - if !backend.HasAddress(addr) { + if !backend.HasAddress(ctx, addr) { return nil, errors.New("backend does not contain address") } - key, err := backend.getKey(addr, password) + key, err := backend.getKey(ctx, addr, password) if err != nil { return nil, err } @@ -245,8 +246,8 @@ func (backend *DSBackend) GetKeyInfoPassphrase(addr address.Address, password [] return key.KeyInfo, nil } -func (backend *DSBackend) getKey(addr address.Address, password []byte) (*Key, error) { - b, err := backend.ds.Get(ds.NewKey(addr.String())) +func (backend *DSBackend) getKey(ctx context.Context, addr address.Address, password []byte) (*Key, error) { + b, err := backend.ds.Get(ctx, ds.NewKey(addr.String())) if err != nil { return nil, errors.Wrap(err, "failed to fetch private key from backend") } @@ -254,16 +255,16 @@ func (backend *DSBackend) getKey(addr address.Address, password []byte) (*Key, e return decryptKey(b, password) } -func (backend *DSBackend) LockWallet() error { +func (backend *DSBackend) LockWallet(ctx context.Context) error { if backend.state == Lock { return xerrors.Errorf("already locked") } - if len(backend.Addresses()) == 0 { + if len(backend.Addresses(ctx)) == 0 { return xerrors.Errorf("no address need lock") } - for _, addr := range backend.Addresses() { + for _, addr := range backend.Addresses(ctx) { backend.lk.Lock() delete(backend.unLocked, addr) backend.lk.Unlock() @@ -275,7 +276,7 @@ func (backend *DSBackend) LockWallet() error { } //UnLockWallet unlock wallet with password, decrypt local key in db and save to protected memory -func (backend *DSBackend) UnLockWallet(password []byte) error { +func (backend *DSBackend) UnLockWallet(ctx context.Context, password []byte) error { defer func() { for i := range password { password[i] = 0 @@ -285,12 +286,12 @@ func (backend *DSBackend) UnLockWallet(password []byte) error { return xerrors.Errorf("already unlocked") } - if len(backend.Addresses()) == 0 { + if len(backend.Addresses(ctx)) == 0 { return xerrors.Errorf("no address need unlock") } - for _, addr := range backend.Addresses() { - ki, err := backend.GetKeyInfoPassphrase(addr, password) + for _, addr := range backend.Addresses(ctx) { + ki, err := backend.GetKeyInfoPassphrase(ctx, addr, password) if err != nil { return err } @@ -305,13 +306,13 @@ func (backend *DSBackend) UnLockWallet(password []byte) error { } //SetPassword set password for wallet , and wallet used this password to encrypt private key -func (backend *DSBackend) SetPassword(password []byte) error { +func (backend *DSBackend) SetPassword(ctx context.Context, password []byte) error { if backend.password != nil { return ErrRepeatPassword } - for _, addr := range backend.Addresses() { - ki, err := backend.GetKeyInfoPassphrase(addr, password) + for _, addr := range backend.Addresses(ctx) { + ki, err := backend.GetKeyInfoPassphrase(ctx, addr, password) if err != nil { return err } @@ -334,7 +335,7 @@ func (backend *DSBackend) HasPassword() bool { } //WalletState return wallet state(lock/unlock) -func (backend *DSBackend) WalletState() int { +func (backend *DSBackend) WalletState(ctx context.Context) int { return backend.state } diff --git a/pkg/wallet/dsbackend_test.go b/pkg/wallet/dsbackend_test.go index 845ee9fc8a..9c3f6f492d 100644 --- a/pkg/wallet/dsbackend_test.go +++ b/pkg/wallet/dsbackend_test.go @@ -1,6 +1,7 @@ package wallet import ( + "context" "crypto/rand" "io" "sync" @@ -27,24 +28,25 @@ func TestDSBackendSimple(t *testing.T) { require.NoError(t, ds.Close()) }() - fs, err := NewDSBackend(ds, config.TestPassphraseConfig(), TestPassword) + ctx := context.Background() + fs, err := NewDSBackend(ctx, ds, config.TestPassphraseConfig(), TestPassword) assert.NoError(t, err) t.Log("empty address list on empty datastore") - assert.Len(t, fs.Addresses(), 0) + assert.Len(t, fs.Addresses(ctx), 0) t.Log("can create new address") - addr, err := fs.NewAddress(address.SECP256K1) + addr, err := fs.NewAddress(ctx, address.SECP256K1) assert.NoError(t, err) t.Log("address is stored") - assert.True(t, fs.HasAddress(addr)) + assert.True(t, fs.HasAddress(ctx, addr)) t.Log("address is stored in repo, and back when loading fresh in a new backend") - fs2, err := NewDSBackend(ds, config.TestPassphraseConfig(), []byte("test-password")) + fs2, err := NewDSBackend(ctx, ds, config.TestPassphraseConfig(), []byte("test-password")) assert.NoError(t, err) - assert.True(t, fs2.HasAddress(addr)) + assert.True(t, fs2.HasAddress(ctx, addr)) } func TestDSBackendKeyPairMatchAddress(t *testing.T) { @@ -55,18 +57,19 @@ func TestDSBackendKeyPairMatchAddress(t *testing.T) { require.NoError(t, ds.Close()) }() - fs, err := NewDSBackend(ds, config.TestPassphraseConfig(), TestPassword) + ctx := context.Background() + fs, err := NewDSBackend(ctx, ds, config.TestPassphraseConfig(), TestPassword) assert.NoError(t, err) t.Log("can create new address") - addr, err := fs.NewAddress(address.SECP256K1) + addr, err := fs.NewAddress(ctx, address.SECP256K1) assert.NoError(t, err) t.Log("address is stored") - assert.True(t, fs.HasAddress(addr)) + assert.True(t, fs.HasAddress(ctx, addr)) t.Log("address references to a secret key") - ki, err := fs.GetKeyInfo(addr) + ki, err := fs.GetKeyInfo(ctx, addr) assert.NoError(t, err) dAddr, err := ki.Address() @@ -84,32 +87,34 @@ func TestDSBackendErrorsForUnknownAddress(t *testing.T) { defer func() { require.NoError(t, ds1.Close()) }() - fs1, err := NewDSBackend(ds1, config.TestPassphraseConfig(), TestPassword) + + ctx := context.Background() + fs1, err := NewDSBackend(ctx, ds1, config.TestPassphraseConfig(), TestPassword) assert.NoError(t, err) ds2 := datastore.NewMapDatastore() defer func() { require.NoError(t, ds2.Close()) }() - fs2, err := NewDSBackend(ds2, config.TestPassphraseConfig(), TestPassword) + fs2, err := NewDSBackend(ctx, ds2, config.TestPassphraseConfig(), TestPassword) assert.NoError(t, err) t.Log("can create new address in fs1") - addr, err := fs1.NewAddress(address.SECP256K1) + addr, err := fs1.NewAddress(ctx, address.SECP256K1) assert.NoError(t, err) t.Log("address is stored fs1") - assert.True(t, fs1.HasAddress(addr)) + assert.True(t, fs1.HasAddress(ctx, addr)) t.Log("address is not stored fs2") - assert.False(t, fs2.HasAddress(addr)) + assert.False(t, fs2.HasAddress(ctx, addr)) t.Log("address references to a secret key in fs1") - _, err = fs1.GetKeyInfo(addr) + _, err = fs1.GetKeyInfo(ctx, addr) assert.NoError(t, err) t.Log("address does not references to a secret key in fs2") - _, err = fs2.GetKeyInfo(addr) + _, err = fs2.GetKeyInfo(ctx, addr) assert.Error(t, err) assert.Contains(t, "backend does not contain address", err.Error()) @@ -123,7 +128,8 @@ func TestDSBackendParallel(t *testing.T) { require.NoError(t, ds.Close()) }() - fs, err := NewDSBackend(ds, config.TestPassphraseConfig(), TestPassword) + ctx := context.Background() + fs, err := NewDSBackend(ctx, ds, config.TestPassphraseConfig(), TestPassword) assert.NoError(t, err) var wg sync.WaitGroup @@ -131,14 +137,14 @@ func TestDSBackendParallel(t *testing.T) { wg.Add(count) for i := 0; i < count; i++ { go func() { - _, err := fs.NewAddress(address.SECP256K1) + _, err := fs.NewAddress(ctx, address.SECP256K1) assert.NoError(t, err) wg.Done() }() } wg.Wait() - assert.Len(t, fs.Addresses(), 10) + assert.Len(t, fs.Addresses(ctx), 10) } func BenchmarkDSBackendSimple(b *testing.B) { @@ -147,12 +153,13 @@ func BenchmarkDSBackendSimple(b *testing.B) { require.NoError(b, ds.Close()) }() - fs, err := NewDSBackend(ds, config.TestPassphraseConfig(), TestPassword) + ctx := context.Background() + fs, err := NewDSBackend(ctx, ds, config.TestPassphraseConfig(), TestPassword) assert.NoError(b, err) corruptData := make([]byte, 32) for i := 0; i < b.N; i++ { - addr, err := fs.NewAddress(address.SECP256K1) + addr, err := fs.NewAddress(ctx, address.SECP256K1) assert.NoError(b, err) data := make([]byte, 32) @@ -160,7 +167,7 @@ func BenchmarkDSBackendSimple(b *testing.B) { assert.NoError(b, err) copy(corruptData, data) - signature, err := fs.SignBytes(data, addr) + signature, err := fs.SignBytes(ctx, data, addr) if err != nil { b.Log(len(signature.Data), signature) } diff --git a/pkg/wallet/passphrase_test.go b/pkg/wallet/passphrase_test.go index e7eda39dd3..48e8dae507 100644 --- a/pkg/wallet/passphrase_test.go +++ b/pkg/wallet/passphrase_test.go @@ -1,6 +1,7 @@ package wallet import ( + "context" "testing" "time" @@ -22,12 +23,12 @@ func TestEncrypKeyAndDecryptKey(t *testing.T) { require.NoError(t, ds.Close()) }() - fs, err := NewDSBackend(ds, config.TestPassphraseConfig(), TestPassword) + fs, err := NewDSBackend(context.Background(), ds, config.TestPassphraseConfig(), TestPassword) assert.NoError(t, err) w := New(fs) - - ki, err := w.NewKeyInfo() + ctx := context.Background() + ki, err := w.NewKeyInfo(ctx) assert.NoError(t, err) addr, err := ki.Address() diff --git a/pkg/wallet/signature_test.go b/pkg/wallet/signature_test.go index 06f2f03783..f76da07d51 100644 --- a/pkg/wallet/signature_test.go +++ b/pkg/wallet/signature_test.go @@ -9,6 +9,7 @@ package wallet import ( + "context" "testing" "github.com/filecoin-project/go-address" @@ -25,10 +26,10 @@ import ( func requireSignerAddr(t *testing.T) (*DSBackend, address.Address) { ds := datastore.NewMapDatastore() - fs, err := NewDSBackend(ds, config.TestPassphraseConfig(), TestPassword) + fs, err := NewDSBackend(context.Background(), ds, config.TestPassphraseConfig(), TestPassword) require.NoError(t, err) - addr, err := fs.NewAddress(address.SECP256K1) + addr, err := fs.NewAddress(context.Background(), address.SECP256K1) require.NoError(t, err) return fs, addr @@ -42,7 +43,7 @@ func TestSignatureOk(t *testing.T) { fs, addr := requireSignerAddr(t) data := []byte("THESE BYTES WILL BE SIGNED") - sig, err := fs.SignBytes(data, addr) + sig, err := fs.SignBytes(context.Background(), data, addr) require.NoError(t, err) assert.NoError(t, crypto.Verify(sig, addr, data)) @@ -65,7 +66,7 @@ func TestDataCorrupted(t *testing.T) { fs, addr := requireSignerAddr(t) data := []byte("THESE BYTES ARE SIGNED") - sig, err := fs.SignBytes(data, addr) + sig, err := fs.SignBytes(context.Background(), data, addr) require.NoError(t, err) corruptData := []byte("THESE BYTEZ ARE SIGNED") @@ -80,10 +81,10 @@ func TestInvalidAddress(t *testing.T) { fs, addr := requireSignerAddr(t) data := []byte("THESE BYTES ARE SIGNED") - sig, err := fs.SignBytes(data, addr) + sig, err := fs.SignBytes(context.Background(), data, addr) require.NoError(t, err) - badAddr, err := fs.NewAddress(address.SECP256K1) + badAddr, err := fs.NewAddress(context.Background(), address.SECP256K1) require.NoError(t, err) assert.Error(t, crypto.Verify(sig, badAddr, data)) @@ -96,7 +97,7 @@ func TestSignatureCorrupted(t *testing.T) { fs, addr := requireSignerAddr(t) data := []byte("THESE BYTES ARE SIGNED") - sig, err := fs.SignBytes(data, addr) + sig, err := fs.SignBytes(context.Background(), data, addr) require.NoError(t, err) sig.Data[0] = sig.Data[0] ^ 0xFF // This operation ensures sig is modified diff --git a/pkg/wallet/wallet.go b/pkg/wallet/wallet.go index 0e0b0eefef..df9479e27f 100644 --- a/pkg/wallet/wallet.go +++ b/pkg/wallet/wallet.go @@ -2,6 +2,7 @@ package wallet import ( "bytes" + "context" "fmt" "reflect" "sort" @@ -23,13 +24,13 @@ var walletLog = logging.Logger("wallet") // WalletIntersection // nolint type WalletIntersection interface { - HasAddress(a address.Address) bool - Addresses() []address.Address - NewAddress(p address.Protocol) (address.Address, error) - Import(ki *crypto.KeyInfo) (address.Address, error) - Export(addr address.Address, password string) (*crypto.KeyInfo, error) - WalletSign(keyAddr address.Address, msg []byte, meta types.MsgMeta) (*crypto.Signature, error) - HasPassword() bool + HasAddress(ctx context.Context, a address.Address) bool + Addresses(ctx context.Context) []address.Address + NewAddress(ctx context.Context, p address.Protocol) (address.Address, error) + Import(ctx context.Context, ki *crypto.KeyInfo) (address.Address, error) + Export(ctx context.Context, addr address.Address, password string) (*crypto.KeyInfo, error) + WalletSign(ctx context.Context, keyAddr address.Address, msg []byte, meta types.MsgMeta) (*crypto.Signature, error) + HasPassword(ctx context.Context) bool } var _ WalletIntersection = &Wallet{} @@ -58,21 +59,21 @@ func New(backends ...Backend) *Wallet { // HasAddress checks if the given address is stored. // Safe for concurrent access. -func (w *Wallet) HasAddress(a address.Address) bool { - _, err := w.Find(a) +func (w *Wallet) HasAddress(ctx context.Context, a address.Address) bool { + _, err := w.Find(ctx, a) return err == nil } // Find searches through all backends and returns the one storing the passed // in address. // Safe for concurrent access. -func (w *Wallet) Find(addr address.Address) (Backend, error) { +func (w *Wallet) Find(ctx context.Context, addr address.Address) (Backend, error) { w.lk.Lock() defer w.lk.Unlock() for _, backends := range w.backends { for _, backend := range backends { - if backend.HasAddress(addr) { + if backend.HasAddress(ctx, addr) { return backend, nil } } @@ -84,14 +85,14 @@ func (w *Wallet) Find(addr address.Address) (Backend, error) { // Addresses retrieves all stored addresses. // Safe for concurrent access. // Always sorted in the same order. -func (w *Wallet) Addresses() []address.Address { +func (w *Wallet) Addresses(ctx context.Context) []address.Address { w.lk.Lock() defer w.lk.Unlock() var out []address.Address for _, backends := range w.backends { for _, backend := range backends { - out = append(out, backend.Addresses()...) + out = append(out, backend.Addresses(ctx)...) } } sort.Slice(out, func(i, j int) bool { @@ -113,28 +114,28 @@ func (w *Wallet) Backends(typ reflect.Type) []Backend { // SignBytes cryptographically signs `data` using the private key corresponding to // address `addr` -func (w *Wallet) SignBytes(data []byte, addr address.Address) (*crypto.Signature, error) { +func (w *Wallet) SignBytes(ctx context.Context, data []byte, addr address.Address) (*crypto.Signature, error) { // Check that we are storing the address to sign for. - backend, err := w.Find(addr) + backend, err := w.Find(ctx, addr) if err != nil { return nil, errors.Wrapf(err, "could not find address: %s", addr) } - return backend.SignBytes(data, addr) + return backend.SignBytes(ctx, data, addr) } // NewAddress creates a new account address on the default wallet backend. -func (w *Wallet) NewAddress(p address.Protocol) (address.Address, error) { +func (w *Wallet) NewAddress(ctx context.Context, p address.Protocol) (address.Address, error) { backend, err := w.DSBacked() if err != nil { return address.Undef, err } - return backend.NewAddress(p) + return backend.NewAddress(ctx, p) } // GetPubKeyForAddress returns the public key in the keystore associated with // the given address. -func (w *Wallet) GetPubKeyForAddress(addr address.Address) ([]byte, error) { - info, err := w.keyInfoForAddr(addr) +func (w *Wallet) GetPubKeyForAddress(ctx context.Context, addr address.Address) ([]byte, error) { + info, err := w.keyInfoForAddr(ctx, addr) if err != nil { return nil, err } @@ -143,22 +144,22 @@ func (w *Wallet) GetPubKeyForAddress(addr address.Address) ([]byte, error) { } // NewKeyInfo creates a new KeyInfo struct in the wallet backend and returns it -func (w *Wallet) NewKeyInfo() (*crypto.KeyInfo, error) { - newAddr, err := w.NewAddress(address.BLS) +func (w *Wallet) NewKeyInfo(ctx context.Context) (*crypto.KeyInfo, error) { + newAddr, err := w.NewAddress(ctx, address.BLS) if err != nil { return &crypto.KeyInfo{}, err } - return w.keyInfoForAddr(newAddr) + return w.keyInfoForAddr(ctx, newAddr) } -func (w *Wallet) keyInfoForAddr(addr address.Address) (*crypto.KeyInfo, error) { - backend, err := w.Find(addr) +func (w *Wallet) keyInfoForAddr(ctx context.Context, addr address.Address) (*crypto.KeyInfo, error) { + backend, err := w.Find(ctx, addr) if err != nil { return &crypto.KeyInfo{}, err } - info, err := backend.GetKeyInfo(addr) + info, err := backend.GetKeyInfo(ctx, addr) if err != nil { return &crypto.KeyInfo{}, err } @@ -166,7 +167,7 @@ func (w *Wallet) keyInfoForAddr(addr address.Address) (*crypto.KeyInfo, error) { } // Import adds the given keyinfo to the wallet -func (w *Wallet) Import(ki *crypto.KeyInfo) (address.Address, error) { +func (w *Wallet) Import(ctx context.Context, ki *crypto.KeyInfo) (address.Address, error) { dsb := w.Backends(DSBackendType) if len(dsb) != 1 { return address.Undef, fmt.Errorf("expected exactly one datastore wallet backend") @@ -177,7 +178,7 @@ func (w *Wallet) Import(ki *crypto.KeyInfo) (address.Address, error) { return address.Undef, fmt.Errorf("datastore backend wallets should implement importer") } - if err := imp.ImportKey(ki); err != nil { + if err := imp.ImportKey(ctx, ki); err != nil { return address.Undef, err } @@ -189,13 +190,13 @@ func (w *Wallet) Import(ki *crypto.KeyInfo) (address.Address, error) { } // Export returns the KeyInfos for the given wallet addresses -func (w *Wallet) Export(addr address.Address, password string) (*crypto.KeyInfo, error) { - bck, err := w.Find(addr) +func (w *Wallet) Export(ctx context.Context, addr address.Address, password string) (*crypto.KeyInfo, error) { + bck, err := w.Find(ctx, addr) if err != nil { return nil, err } - ki, err := bck.GetKeyInfoPassphrase(addr, []byte(password)) + ki, err := bck.GetKeyInfoPassphrase(ctx, addr, []byte(password)) if err != nil { return nil, err } @@ -204,8 +205,8 @@ func (w *Wallet) Export(addr address.Address, password string) (*crypto.KeyInfo, } //WalletSign used to sign message with private key -func (w *Wallet) WalletSign(addr address.Address, msg []byte, meta types.MsgMeta) (*crypto.Signature, error) { - ki, err := w.Find(addr) +func (w *Wallet) WalletSign(ctx context.Context, addr address.Address, msg []byte, meta types.MsgMeta) (*crypto.Signature, error) { + ki, err := w.Find(ctx, addr) if err != nil { return nil, err } @@ -213,7 +214,7 @@ func (w *Wallet) WalletSign(addr address.Address, msg []byte, meta types.MsgMeta return nil, errors.Errorf("signing using key '%s': %v", addr.String(), ErrKeyInfoNotFound) } - return ki.SignBytes(msg, addr) + return ki.SignBytes(ctx, msg, addr) } //DSBacked return the first wallet backend @@ -228,36 +229,36 @@ func (w *Wallet) DSBacked() (*DSBackend, error) { } //LockWallet lock lock wallet -func (w *Wallet) LockWallet() error { +func (w *Wallet) LockWallet(ctx context.Context) error { backend, err := w.DSBacked() if err != nil { return err } - return backend.LockWallet() + return backend.LockWallet(ctx) } //UnLockWallet unlock local wallet with password -func (w *Wallet) UnLockWallet(password []byte) error { +func (w *Wallet) UnLockWallet(ctx context.Context, password []byte) error { backend, err := w.DSBacked() if err != nil { return err } - return backend.UnLockWallet(password) + return backend.UnLockWallet(ctx, password) } //SetPassword -func (w *Wallet) SetPassword(password []byte) error { +func (w *Wallet) SetPassword(ctx context.Context, password []byte) error { backend, err := w.DSBacked() if err != nil { return err } - return backend.SetPassword(password) + return backend.SetPassword(ctx, password) } //HasPassword return whether the password has been set in the wallet -func (w *Wallet) HasPassword() bool { +func (w *Wallet) HasPassword(ctx context.Context) bool { backend, err := w.DSBacked() if err != nil { walletLog.Errorf("get DSBacked failed: %v", err) @@ -267,11 +268,11 @@ func (w *Wallet) HasPassword() bool { } //WalletState return wallet state(lock/unlock) -func (w *Wallet) WalletState() int { +func (w *Wallet) WalletState(ctx context.Context) int { backend, err := w.DSBacked() if err != nil { walletLog.Errorf("get DSBacked failed: %v", err) return undetermined } - return backend.WalletState() + return backend.WalletState(ctx) } diff --git a/pkg/wallet/wallet_test.go b/pkg/wallet/wallet_test.go index 03f0c27bac..4031635bd1 100644 --- a/pkg/wallet/wallet_test.go +++ b/pkg/wallet/wallet_test.go @@ -2,6 +2,7 @@ package wallet import ( "bytes" + "context" "testing" "github.com/filecoin-project/venus/pkg/testhelpers" @@ -20,7 +21,7 @@ import ( func newWalletAndDSBackend(t *testing.T) (*Wallet, *DSBackend) { t.Log("create a backend") ds := datastore.NewMapDatastore() - fs, err := NewDSBackend(ds, config.TestPassphraseConfig(), TestPassword) + fs, err := NewDSBackend(context.Background(), ds, config.TestPassphraseConfig(), TestPassword) assert.NoError(t, err) t.Log("create a wallet with a single backend") @@ -35,39 +36,40 @@ func newWalletAndDSBackend(t *testing.T) (*Wallet, *DSBackend) { func TestWalletSimple(t *testing.T) { tf.UnitTest(t) + ctx := context.Background() w, fs := newWalletAndDSBackend(t) t.Log("create a new address in the backend") - addr, err := fs.NewAddress(address.SECP256K1) + addr, err := fs.NewAddress(context.Background(), address.SECP256K1) assert.NoError(t, err) t.Log("test HasAddress") - assert.True(t, w.HasAddress(addr)) + assert.True(t, w.HasAddress(ctx, addr)) t.Log("find backend") - backend, err := w.Find(addr) + backend, err := w.Find(ctx, addr) assert.NoError(t, err) assert.Equal(t, fs, backend) t.Log("find unknown address") randomAddr := testhelpers.NewForTestGetter()() - assert.False(t, w.HasAddress(randomAddr)) + assert.False(t, w.HasAddress(ctx, randomAddr)) t.Log("list all addresses") - list := w.Addresses() + list := w.Addresses(ctx) assert.Len(t, list, 1) assert.Equal(t, list[0], addr) t.Log("addresses are sorted") - addr2, err := fs.NewAddress(address.SECP256K1) + addr2, err := fs.NewAddress(context.Background(), address.SECP256K1) assert.NoError(t, err) if bytes.Compare(addr2.Bytes(), addr.Bytes()) < 0 { addr, addr2 = addr2, addr } for i := 0; i < 16; i++ { - list := w.Addresses() + list := w.Addresses(ctx) assert.Len(t, list, 2) assert.Equal(t, list[0], addr) assert.Equal(t, list[1], addr2) @@ -79,11 +81,12 @@ func TestWalletBLSKeys(t *testing.T) { w, wb := newWalletAndDSBackend(t) - addr, err := w.NewAddress(address.BLS) + ctx := context.Background() + addr, err := w.NewAddress(ctx, address.BLS) require.NoError(t, err) data := []byte("data to be signed") - sig, err := w.SignBytes(data, addr) + sig, err := w.SignBytes(ctx, data, addr) require.NoError(t, err) t.Run("address is BLS protocol", func(t *testing.T) { @@ -91,7 +94,7 @@ func TestWalletBLSKeys(t *testing.T) { }) t.Run("key uses BLS cryptography", func(t *testing.T) { - ki, err := wb.GetKeyInfo(addr) + ki, err := wb.GetKeyInfo(context.Background(), addr) require.NoError(t, err) assert.Equal(t, crypto.SigTypeBLS, ki.SigType) }) @@ -119,24 +122,25 @@ func TestWalletBLSKeys(t *testing.T) { func TestSimpleSignAndVerify(t *testing.T) { tf.UnitTest(t) + ctx := context.Background() w, fs := newWalletAndDSBackend(t) t.Log("create a new address in the backend") - addr, err := fs.NewAddress(address.SECP256K1) + addr, err := fs.NewAddress(context.Background(), address.SECP256K1) assert.NoError(t, err) t.Log("test HasAddress") - assert.True(t, w.HasAddress(addr)) + assert.True(t, w.HasAddress(ctx, addr)) t.Log("find backend") - backend, err := w.Find(addr) + backend, err := w.Find(ctx, addr) assert.NoError(t, err) assert.Equal(t, fs, backend) // data to sign dataA := []byte("THIS IS A SIGNED SLICE OF DATA") t.Log("sign content") - sig, err := w.SignBytes(dataA, addr) + sig, err := w.SignBytes(ctx, dataA, addr) assert.NoError(t, err) t.Log("verify signed content") @@ -153,32 +157,33 @@ func TestSimpleSignAndVerify(t *testing.T) { func TestSignErrorCases(t *testing.T) { tf.UnitTest(t) + ctx := context.Background() w1, fs1 := newWalletAndDSBackend(t) _, fs2 := newWalletAndDSBackend(t) t.Log("create a new address each backend") - addr1, err := fs1.NewAddress(address.SECP256K1) + addr1, err := fs1.NewAddress(context.Background(), address.SECP256K1) assert.NoError(t, err) - addr2, err := fs2.NewAddress(address.SECP256K1) + addr2, err := fs2.NewAddress(context.Background(), address.SECP256K1) assert.NoError(t, err) t.Log("test HasAddress") - assert.True(t, w1.HasAddress(addr1)) - assert.False(t, w1.HasAddress(addr2)) + assert.True(t, w1.HasAddress(ctx, addr1)) + assert.False(t, w1.HasAddress(ctx, addr2)) t.Log("find backends") - backend1, err := w1.Find(addr1) + backend1, err := w1.Find(ctx, addr1) assert.NoError(t, err) assert.Equal(t, fs1, backend1) t.Log("find backend fails for unknown address") - _, err = w1.Find(addr2) + _, err = w1.Find(ctx, addr2) assert.Error(t, err) // data to sign dataA := []byte("Set tab width to '1' and make everyone happy") t.Log("sign content") - _, err = w1.SignBytes(dataA, addr2) + _, err = w1.SignBytes(ctx, dataA, addr2) assert.Error(t, err) assert.Contains(t, err.Error(), "could not find address:") } diff --git a/tools/conformance/driver.go b/tools/conformance/driver.go index ce644a7bd6..10491946ce 100644 --- a/tools/conformance/driver.go +++ b/tools/conformance/driver.go @@ -118,7 +118,7 @@ func (d *Driver) ExecuteTipset(bs blockstore.Blockstore, chainDs ds.Batching, pr CircSupplyCalculator: func(context.Context, abi.ChainEpoch, tree.Tree) (abi.TokenAmount, error) { return big.Zero(), nil }, - LookbackStateGetter: vmcontext.LookbackStateGetterForTipset(chainStore, chainFork, nil), + LookbackStateGetter: vmcontext.LookbackStateGetterForTipset(context.TODO(), chainStore, chainFork, nil), NtwkVersionGetter: chainFork.GetNtwkVersion, Rnd: NewFixedRand(), BaseFee: big.NewFromGo(&tipset.BaseFee), @@ -250,17 +250,6 @@ func (d *Driver) ExecuteMessage(bs blockstore.Blockstore, params ExecuteMessageP //chainstore chainStore := chain.NewStore(chainDs, bs, cid.Undef, chain.NewMockCirculatingSupplyCalculator()) //load genesis from car - //drand - /* genBlk, err := chainStore.GetGenesisBlock(context.TODO()) - if err != nil { - return nil, cid.Undef, err - } - - drand, err := beacon.DefaultDrandIfaceFromConfig(genBlk.Timestamp) - if err != nil { - return nil, cid.Undef, err - }*/ - //chain fork chainFork, err := fork.NewChainFork(context.TODO(), chainStore, ipldStore, bs, &mainNetParams.Network) faultChecker := consensusfault.NewFaultChecker(chainStore, chainFork) @@ -273,7 +262,7 @@ func (d *Driver) ExecuteMessage(bs blockstore.Blockstore, params ExecuteMessageP CircSupplyCalculator: func(ctx context.Context, epoch abi.ChainEpoch, tree tree.Tree) (abi.TokenAmount, error) { return params.CircSupply, nil }, - LookbackStateGetter: vmcontext.LookbackStateGetterForTipset(chainStore, chainFork, nil), + LookbackStateGetter: vmcontext.LookbackStateGetterForTipset(context.TODO(), chainStore, chainFork, nil), NtwkVersionGetter: chainFork.GetNtwkVersion, Rnd: params.Rand, BaseFee: params.BaseFee, diff --git a/tools/conformance/runner.go b/tools/conformance/runner.go index 8655b25aeb..b8b824ad3f 100644 --- a/tools/conformance/runner.go +++ b/tools/conformance/runner.go @@ -224,7 +224,7 @@ func writeStateToTempCAR(bs blockstoreutil.Blockstore, roots ...cid.Cid) (string continue } // ignore things we don't have, the state tree is incomplete. - if has, err := bs.Has(link.Cid); err != nil { + if has, err := bs.Has(context.TODO(), link.Cid); err != nil { return nil, err } else if has { out = append(out, link) @@ -260,7 +260,7 @@ func LoadVectorCAR(vectorCAR schema.Base64EncodedBytes) (blockstoreutil.Blocksto defer r.Close() // nolint // Load the CAR embedded in the test vector into the blockstore. - _, err = car.LoadCar(bs, r) + _, err = car.LoadCar(context.TODO(), bs, r) if err != nil { return nil, fmt.Errorf("failed to load state tree car from test vector: %s", err) } diff --git a/tools/gengen/util/generator.go b/tools/gengen/util/generator.go index df7fd63574..ee1bf5128b 100644 --- a/tools/gengen/util/generator.go +++ b/tools/gengen/util/generator.go @@ -87,7 +87,7 @@ func NewGenesisGenerator(bs blockstore.Blockstore) *GenesisGenerator { NtwkVersionGetter: func(ctx context.Context, epoch abi.ChainEpoch) network.Version { return network.Version6 }, - LookbackStateGetter: vmcontext.LookbackStateGetterForTipset(chainStore, chainFork, nil), + LookbackStateGetter: vmcontext.LookbackStateGetterForTipset(context.TODO(), chainStore, chainFork, nil), Rnd: chainRand, BaseFee: abi.NewTokenAmount(InitialBaseFee), Epoch: 0, diff --git a/venus-devtool/go.mod b/venus-devtool/go.mod index d5ef15c0ac..835c3e7f7c 100644 --- a/venus-devtool/go.mod +++ b/venus-devtool/go.mod @@ -5,18 +5,19 @@ go 1.16 require ( github.com/filecoin-project/go-address v0.0.6 github.com/filecoin-project/go-bitfield v0.2.4 - github.com/filecoin-project/go-data-transfer v1.11.4 - github.com/filecoin-project/go-fil-markets v1.13.4 + github.com/filecoin-project/go-data-transfer v1.12.1 + github.com/filecoin-project/go-ds-versioning v0.1.0 // indirect + github.com/filecoin-project/go-fil-markets v1.14.1 github.com/filecoin-project/go-jsonrpc v0.1.5 github.com/filecoin-project/go-state-types v0.1.1 - github.com/filecoin-project/lotus v1.13.2-0.20211213233817-8a4246227153 + github.com/filecoin-project/lotus v1.13.2-0.20220103185743-9b11c4b31932 github.com/filecoin-project/venus v0.0.0-00010101000000-000000000000 github.com/ipfs/go-cid v0.1.0 - github.com/ipfs/go-graphsync v0.10.6 + github.com/ipfs/go-graphsync v0.11.5 github.com/ipfs/go-ipfs-http-client v0.1.0 // indirect github.com/ipld/go-ipld-selector-text-lite v0.0.1 - github.com/libp2p/go-libp2p-core v0.9.0 - github.com/libp2p/go-libp2p-pubsub v0.5.6 + github.com/libp2p/go-libp2p-core v0.13.0 + github.com/libp2p/go-libp2p-pubsub v0.6.0 github.com/multiformats/go-multiaddr v0.4.1 github.com/urfave/cli/v2 v2.3.0 github.com/whyrusleeping/cbor-gen v0.0.0-20211110122933-f57984553008 diff --git a/venus-devtool/go.sum b/venus-devtool/go.sum index 7f550ce677..cfe5b03408 100644 --- a/venus-devtool/go.sum +++ b/venus-devtool/go.sum @@ -182,7 +182,6 @@ github.com/casbin/casbin/v2 v2.37.0/go.mod h1:vByNa/Fchek0KZUgG5wEsl7iFsiviAYKRt github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= github.com/cenkalti/backoff/v4 v4.1.1/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/certifi/gocertifi v0.0.0-20200211180108-c7c1fbc02894/go.mod h1:sGbDF6GwGcLpkNXPUTkMRoywsNa/ol15pxFe6ERfguA= github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= @@ -205,11 +204,6 @@ github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGX github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= -github.com/cockroachdb/errors v1.2.4/go.mod h1:rQD95gz6FARkaKkQXUksEje/d9a6wBJoCr5oaCLELYA= -github.com/cockroachdb/logtags v0.0.0-20190617123548-eb05cc24525f/go.mod h1:i/u985jwjWRlyHXQbwatDASoW0RMlZ/3i9yJHE2xLkI= -github.com/cockroachdb/pebble v0.0.0-20200916222308-4e219a90ba5b/go.mod h1:hU7vhtrqonEphNF+xt8/lHdaBprxmV1h8BOGrd9XwmQ= -github.com/cockroachdb/pebble v0.0.0-20201001221639-879f3bfeef07/go.mod h1:hU7vhtrqonEphNF+xt8/lHdaBprxmV1h8BOGrd9XwmQ= -github.com/cockroachdb/redact v0.0.0-20200622112456-cd282804bbd3/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= 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= @@ -270,14 +264,15 @@ github.com/dgraph-io/badger v1.6.1/go.mod h1:FRmFw3uxvcpa8zG3Rxs0th+hCLIuaQg8HlN github.com/dgraph-io/badger v1.6.2 h1:mNw0qs90GVgGGWylh0umH5iag1j6n/PeJtNvL6KY/x8= github.com/dgraph-io/badger v1.6.2/go.mod h1:JW2yswe3V058sS0kZ2h/AXeDSqFjxnZcRrVH//y2UQE= github.com/dgraph-io/badger/v2 v2.0.3/go.mod h1:3KY8+bsP8wI0OEnQJAKpd4wIJW/Mm32yw2j/9FUVnIM= -github.com/dgraph-io/badger/v2 v2.2007.2 h1:EjjK0KqwaFMlPin1ajhP943VPENHJdEz1KLIegjaI3k= -github.com/dgraph-io/badger/v2 v2.2007.2/go.mod h1:26P/7fbL4kUZVEVKLAKXkBXKOydDmM2p1e+NhhnBCAE= +github.com/dgraph-io/badger/v2 v2.2007.3 h1:Sl9tQWz92WCbVSe8pj04Tkqlm2boW+KAxd+XSs58SQI= +github.com/dgraph-io/badger/v2 v2.2007.3/go.mod h1:26P/7fbL4kUZVEVKLAKXkBXKOydDmM2p1e+NhhnBCAE= github.com/dgraph-io/badger/v3 v3.2011.1/go.mod h1:0rLLrQpKVQAL0or/lBLMQznhr6dWWX7h5AKnmnqx268= github.com/dgraph-io/ristretto v0.0.2-0.20200115201040-8f368f2f2ab3/go.mod h1:KPxhHT9ZxKefz+PCeOGsrHpl1qZ7i70dGTu2u+Ahh6E= github.com/dgraph-io/ristretto v0.0.2/go.mod h1:KPxhHT9ZxKefz+PCeOGsrHpl1qZ7i70dGTu2u+Ahh6E= github.com/dgraph-io/ristretto v0.0.3-0.20200630154024-f66de99634de/go.mod h1:KPxhHT9ZxKefz+PCeOGsrHpl1qZ7i70dGTu2u+Ahh6E= -github.com/dgraph-io/ristretto v0.0.4-0.20210122082011-bb5d392ed82d h1:eQYOG6A4td1tht0NdJB9Ls6DsXRGb2Ft6X9REU/MbbE= github.com/dgraph-io/ristretto v0.0.4-0.20210122082011-bb5d392ed82d/go.mod h1:tv2ec8nA7vRpSYX7/MbP52ihrUMXIHit54CQMq8npXQ= +github.com/dgraph-io/ristretto v0.1.0 h1:Jv3CGQHp9OjuMBSne1485aDpUkTKEcUqF+jm/LuerPI= +github.com/dgraph-io/ristretto v0.1.0/go.mod h1:fux0lOrBhrVCJd3lcTHsIJhq1T2rokOu6v9Vcb3Q9ug= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgryski/go-farm v0.0.0-20190104051053-3adb47b1fb0f/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2 h1:tdlZCpZ/P9DhczCTSixgIKmwPv6+wP5DGjqLYw5SUiA= @@ -290,9 +285,11 @@ github.com/docker/go-units v0.4.0 h1:3uh0PgVws3nIA0Q+MwDC8yjEPf9zjRfZZWXZYDct3Tw github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= github.com/drand/bls12-381 v0.3.2/go.mod h1:dtcLgPtYT38L3NO6mPDYH0nbpc5tjPassDqiniuAt4Y= github.com/drand/drand v1.2.1/go.mod h1:j0P7RGmVaY7E/OuO2yQOcQj7OgeZCuhgu2gdv0JAm+g= +github.com/drand/drand v1.3.0/go.mod h1:D6kAVlxufq1gi71YCGfzN455JrXF4Q272ZJEG975fzo= github.com/drand/kyber v1.0.1-0.20200110225416-8de27ed8c0e2/go.mod h1:UpXoA0Upd1N9l4TvRPHr1qAUBBERj6JQ/mnKI3BPEmw= github.com/drand/kyber v1.0.2/go.mod h1:x6KOpK7avKj0GJ4emhXFP5n7M7W7ChAPmnQh/OL6vRw= github.com/drand/kyber v1.1.4/go.mod h1:9+IgTq7kadePhZg7eRwSD7+bA+bmvqRK+8DtmoV5a3U= +github.com/drand/kyber v1.1.7/go.mod h1:UkHLsI4W6+jT5PvNxmc0cvQAgppjTUpX+XCsN9TXmRo= github.com/drand/kyber-bls12381 v0.2.0/go.mod h1:zQip/bHdeEB6HFZSU3v+d3cQE0GaBVQw9aR2E7AdoeI= github.com/drand/kyber-bls12381 v0.2.1/go.mod h1:JwWn4nHO9Mp4F5qCie5sVIPQZ0X6cw8XAeMRvc/GXBE= github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= @@ -307,6 +304,7 @@ github.com/elastic/go-sysinfo v1.7.0/go.mod h1:i1ZYdU10oLNfRzq4vq62BEwD2fH8KaWh6 github.com/elastic/go-windows v1.0.0 h1:qLURgZFkkrYyTTkvYpsZIgf83AUsdIHfvlJaqaZ7aSY= github.com/elastic/go-windows v1.0.0/go.mod h1:TsU0Nrp7/y3+VwE82FoZF8gC/XFg/Elz6CcloAxnPgU= github.com/elastic/gosigar v0.12.0/go.mod h1:iXRIGg2tLnu7LBdpqzyQfGDEidKCfWcCMS0WKyPWoMs= +github.com/elastic/gosigar v0.14.1 h1:T0aQ7n/n2ZA9W7DmAnj60v+qzqKERdBgJBO1CG2W6rc= github.com/elastic/gosigar v0.14.1/go.mod h1:iXRIGg2tLnu7LBdpqzyQfGDEidKCfWcCMS0WKyPWoMs= github.com/ema/qdisc v0.0.0-20190904071900-b82c76788043/go.mod h1:ix4kG2zvdUd8kEKSW0ZTr1XLks0epFpI4j745DXxlNE= github.com/envoyproxy/go-control-plane v0.6.9/go.mod h1:SBwIajubJHhxtWwsL9s8ss4safvEdbitLhGGK48rN6g= @@ -330,25 +328,21 @@ github.com/fatih/color v1.10.0/go.mod h1:ELkj/draVOlAH/xkhN6mQ50Qd0MPOk5AAr3maGE github.com/fatih/color v1.12.0/go.mod h1:ELkj/draVOlAH/xkhN6mQ50Qd0MPOk5AAr3maGEBuJM= github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= github.com/fatih/structtag v1.2.0/go.mod h1:mBJUNpUnHmRKrKlQQlmCrh5PuhftFbNv8Ys4/aAZl94= -github.com/filecoin-project/dagstore v0.4.2/go.mod h1:WY5OoLfnwISCk6eASSF927KKPqLPIlTwmG1qHpA08KY= -github.com/filecoin-project/dagstore v0.4.3 h1:yeFl6+2BRY1gOVp/hrZuFa24s7LY0Qqkqx/Gh8lidZs= -github.com/filecoin-project/dagstore v0.4.3/go.mod h1:dm/91AO5UaDd3bABFjg/5fmRH99vvpS7g1mykqvz6KQ= -github.com/filecoin-project/filecoin-ffi v0.30.4-0.20200716204036-cddc56607e1d/go.mod h1:XE4rWG1P7zWPaC11Pkn1CVR20stqN52MnMkIrF4q6ZU= +github.com/filecoin-project/dagstore v0.4.3-0.20211211192320-72b849e131d2/go.mod h1:tlV8C11UljvFq3WWlMh2oMViEaVaPb6uT8eL/YQgDfk= +github.com/filecoin-project/dagstore v0.4.4 h1:luolWahhzp3ulRsapGKE7raoLE3n2cFkQUJjPyqUmF4= +github.com/filecoin-project/dagstore v0.4.4/go.mod h1:7BlOvaTJrFJ1Qemt5jHlLJ4VhDIuSIzGS0IwO/0AXPA= github.com/filecoin-project/filecoin-ffi v0.30.4-0.20200910194244-f640612a1a1f h1:vg/6KEAOBjICMaWj+xofJCp09HYRfpO3ZbJsnJo22pA= github.com/filecoin-project/filecoin-ffi v0.30.4-0.20200910194244-f640612a1a1f/go.mod h1:+If3s2VxyjZn+KGGZIoRXBDSFQ9xL404JBJGf4WhEj0= -github.com/filecoin-project/go-address v0.0.2-0.20200218010043-eb9bb40ed5be/go.mod h1:SAOwJoakQ8EPjwNIsiakIQKsoKdkcbx8U3IapgCg9R0= github.com/filecoin-project/go-address v0.0.3/go.mod h1:jr8JxKsYx+lQlQZmF5i2U0Z+cGQ59wMIps/8YW/lDj8= github.com/filecoin-project/go-address v0.0.5/go.mod h1:jr8JxKsYx+lQlQZmF5i2U0Z+cGQ59wMIps/8YW/lDj8= github.com/filecoin-project/go-address v0.0.6 h1:DWQtj38ax+ogHwyH3VULRIoT8E6loyXqsk/p81xoY7M= github.com/filecoin-project/go-address v0.0.6/go.mod h1:7B0/5DA13n6nHkB8bbGx1gWzG/dbTsZ0fgOJVGsM3TE= -github.com/filecoin-project/go-amt-ipld/v2 v2.0.1-0.20200424220931-6263827e49f2/go.mod h1:boRtQhzmxNocrMxOXo1NYn4oUc1NGvR8tEa79wApNXg= github.com/filecoin-project/go-amt-ipld/v2 v2.1.0/go.mod h1:nfFPoGyX0CU9SkXX8EoCcSuHN1XcbN0c6KBh7yvP5fs= github.com/filecoin-project/go-amt-ipld/v2 v2.1.1-0.20201006184820-924ee87a1349 h1:pIuR0dnMD0i+as8wNnjjHyQrnhP5O5bmba/lmgQeRgU= github.com/filecoin-project/go-amt-ipld/v2 v2.1.1-0.20201006184820-924ee87a1349/go.mod h1:vgmwKBkx+ca5OIeEvstiQgzAZnb7R6QaqE1oEDSqa6g= github.com/filecoin-project/go-amt-ipld/v3 v3.0.0/go.mod h1:Qa95YNAbtoVCTSVtX38aAC1ptBnJfPma1R/zZsKmx4o= github.com/filecoin-project/go-amt-ipld/v3 v3.1.0 h1:ZNJ9tEG5bE72vBWYiuh5bkxJVM3ViHNOmQ7qew9n6RE= github.com/filecoin-project/go-amt-ipld/v3 v3.1.0/go.mod h1:UjM2QhDFrrjD5s1CdnkJkat4ga+LqZBZgTMniypABRo= -github.com/filecoin-project/go-bitfield v0.0.1/go.mod h1:Ry9/iUlWSyjPUzlAvdnfy4Gtvrq4kWmWDztCU1yEgJY= 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.4 h1:uZ7MeE+XfM5lqrHJZ93OnhQKc/rveW8p9au0C68JPgk= @@ -357,17 +351,15 @@ github.com/filecoin-project/go-cbor-util v0.0.0-20191219014500-08c40a1e63a2/go.m github.com/filecoin-project/go-cbor-util v0.0.0-20201016124514-d0bbec7bfcc4/go.mod h1:pqTiPHobNkOVM5thSRsHYjyQfq7O5QSCMhvuu9JoDlg= github.com/filecoin-project/go-cbor-util v0.0.1 h1:E1LYZYTtjfAQwCReho0VXvbu8t3CYAVPiMx8EiV/VAs= github.com/filecoin-project/go-cbor-util v0.0.1/go.mod h1:pqTiPHobNkOVM5thSRsHYjyQfq7O5QSCMhvuu9JoDlg= -github.com/filecoin-project/go-commp-utils v0.1.1-0.20210427191551-70bf140d31c7/go.mod h1:6s95K91mCyHY51RPWECZieD3SGWTqIFLf1mPOes9l5U= -github.com/filecoin-project/go-commp-utils v0.1.2/go.mod h1:6s95K91mCyHY51RPWECZieD3SGWTqIFLf1mPOes9l5U= github.com/filecoin-project/go-commp-utils v0.1.3 h1:rTxbkNXZU7FLgdkBk8RsQIEOuPONHykEoX3xGk41Fkw= github.com/filecoin-project/go-commp-utils v0.1.3/go.mod h1:3ENlD1pZySaUout0p9ANQrY3fDFoXdqyX04J+dWpK30= github.com/filecoin-project/go-crypto v0.0.0-20191218222705-effae4ea9f03/go.mod h1:+viYnvGtUTgJRdy6oaeF4MTFKAfatX071MPDPBL11EQ= github.com/filecoin-project/go-crypto v0.0.1 h1:AcvpSGGCgjaY8y1az6AMfKQWreF/pWO2JJGLl6gCq6o= github.com/filecoin-project/go-crypto v0.0.1/go.mod h1:+viYnvGtUTgJRdy6oaeF4MTFKAfatX071MPDPBL11EQ= -github.com/filecoin-project/go-data-transfer v1.0.1/go.mod h1:UxvfUAY9v3ub0a21BSK9u3pB2aq30Y0KMsG+w9/ysyo= -github.com/filecoin-project/go-data-transfer v1.10.1/go.mod h1:CSDMCrPK2lVGodNB1wPEogjFvM9nVGyiL1GNbBRTSdw= -github.com/filecoin-project/go-data-transfer v1.11.4 h1:jKvlx0/C8HSyLRn/G1P9TjtfBtFU9jbCvCVFmWbyYVQ= -github.com/filecoin-project/go-data-transfer v1.11.4/go.mod h1:2MitLI0ebCkLlPKM7NRggP/t9d+gCcREUKkCKqWRCwU= +github.com/filecoin-project/go-data-transfer v1.12.0/go.mod h1:tDrD2jLU2TpVhd+5B8iqBp0fQRV4lP80WZccKXugjYc= +github.com/filecoin-project/go-data-transfer v1.12.1 h1:gAznAZKySVs2FS6T/vDq7R3f0DewLnxeROe0oOE6bZU= +github.com/filecoin-project/go-data-transfer v1.12.1/go.mod h1:j3HL645YiQFxcM+q7uPlGApILSqeweDABNgZQP7pDYU= +github.com/filecoin-project/go-ds-versioning v0.0.0-20211206185234-508abd7c2aff/go.mod h1:C9/l9PnB1+mwPa26BBVpCjG/XQCB0yj/q5CK2J8X1I4= 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= @@ -376,9 +368,8 @@ github.com/filecoin-project/go-fil-commcid v0.1.0 h1:3R4ds1A9r6cr8mvZBfMYxTS88Oq github.com/filecoin-project/go-fil-commcid v0.1.0/go.mod h1:Eaox7Hvus1JgPrL5+M3+h7aSPHc0cVqpSxA+TxIEpZQ= github.com/filecoin-project/go-fil-commp-hashhash v0.1.0 h1:imrrpZWEHRnNqqv0tN7LXep5bFEVOVmQWHJvl2mgsGo= github.com/filecoin-project/go-fil-commp-hashhash v0.1.0/go.mod h1:73S8WSEWh9vr0fDJVnKADhfIv/d6dCbAGaAGWbdJEI8= -github.com/filecoin-project/go-fil-markets v1.0.5-0.20201113164554-c5eba40d5335/go.mod h1:AJySOJC00JRWEZzRG2KsfUnqEf5ITXxeX09BE9N4f9c= -github.com/filecoin-project/go-fil-markets v1.13.4 h1:NAu+ACelR2mYsj+yJ4iLu8FGqWK50OnU5VF8axkLsSc= -github.com/filecoin-project/go-fil-markets v1.13.4/go.mod h1:aANjXD2XMHWnT2zWpyGWLsWLC24C4mHm0gRm85OpPWE= +github.com/filecoin-project/go-fil-markets v1.14.1 h1:Bx+TSbkAN8K97Hpjgu+MpeRFbXIKH/fNpNp1ZGAEH3I= +github.com/filecoin-project/go-fil-markets v1.14.1/go.mod h1:vXOHH3q2+zLk929W+lIq3etuDFTyJJ8nG2DwGHG2R1E= 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= @@ -387,7 +378,6 @@ github.com/filecoin-project/go-hamt-ipld/v3 v3.0.1/go.mod h1:gXpNmr3oQx8l3o7qkGy github.com/filecoin-project/go-hamt-ipld/v3 v3.1.0 h1:rVVNq0x6RGQIzCo1iiJlGFm9AGIZzeifggxtKMU7zmI= github.com/filecoin-project/go-hamt-ipld/v3 v3.1.0/go.mod h1:bxmzgT8tmeVQA1/gvBwFmYdT8SOFUwB3ovSUfG1Ux0g= github.com/filecoin-project/go-leb128 v0.0.0-20190212224330-8d79a5489543/go.mod h1:mjrHv1cDGJWDlGmC0eDc1E5VJr8DmL9XMUcaFwiuKg8= -github.com/filecoin-project/go-multistore v0.0.3/go.mod h1:kaNqCC4IhU4B1uyr7YWFHd23TL4KM32aChS0jNkyUvQ= github.com/filecoin-project/go-padreader v0.0.0-20200903213702-ed5fae088b20/go.mod h1:mPn+LRRd5gEKNAtc+r3ScpW2JRU/pj4NBKdADYWHiak= github.com/filecoin-project/go-padreader v0.0.0-20210723183308-812a16dc01b1/go.mod h1:VYVPJqwpsfmtoHnAmPx6MUwmrK6HIcDqZJiuZhtmfLQ= github.com/filecoin-project/go-padreader v0.0.1 h1:8h2tVy5HpoNbr2gBRr+WD6zV6VD6XHig+ynSGJg8ZOs= @@ -406,21 +396,18 @@ github.com/filecoin-project/go-statemachine v0.0.0-20200925024713-05bd7c71fbfe/g github.com/filecoin-project/go-statemachine v1.0.1 h1:LQ60+JDVjMdLxXmVFM2jjontzOYnfVE7u02CXV3WKSw= github.com/filecoin-project/go-statemachine v1.0.1/go.mod h1:jZdXXiHa61n4NmgWFG4w8tnqgvZVHYbJ3yW7+y8bF54= github.com/filecoin-project/go-statestore v0.1.0/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/go.mod h1:Q0GQOBtKf1oE10eSXSlhN45kDBdGvEcVOqMiffqX+N8= -github.com/filecoin-project/lotus v1.13.2-0.20211213233817-8a4246227153 h1:YDplDR4tT8a7cGAvUg5uhf9WschEMyt9aErAP5MjxBY= -github.com/filecoin-project/lotus v1.13.2-0.20211213233817-8a4246227153/go.mod h1:/gEkKgo2ms5Eycdoij8E5ye2J7ZFgdkJVgJ6Q+HljFA= -github.com/filecoin-project/specs-actors v0.6.1/go.mod h1:dRdy3cURykh2R8O/DKqy8olScl70rmIS7GrB4hB1IDY= +github.com/filecoin-project/go-statestore v0.2.0 h1:cRRO0aPLrxKQCZ2UOQbzFGn4WDNdofHZoGPjfNaAo5Q= +github.com/filecoin-project/go-statestore v0.2.0/go.mod h1:8sjBYbS35HwPzct7iT4lIXjLlYyPor80aU7t7a/Kspo= +github.com/filecoin-project/go-storedcounter v0.1.0/go.mod h1:4ceukaXi4vFURIoxYMfKzaRF5Xv/Pinh2oTnoxpv+z8= +github.com/filecoin-project/lotus v1.13.2-0.20220103185743-9b11c4b31932 h1:TR3RU+f3pAILoV9p3qjsZqDiwKLgB3ED+MkYznJot1Y= +github.com/filecoin-project/lotus v1.13.2-0.20220103185743-9b11c4b31932/go.mod h1:3rpFD76CLqowX/0mmreiT3CohlmHsU4+CXFk9v9MrYM= 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/go.mod h1:TS1AW/7LbG+615j4NsjMK1qlpAwaFsG9w0V2tg2gSao= github.com/filecoin-project/specs-actors v0.9.14 h1:68PVstg2UB3ZsMLF+DKFTAs/YKsqhKWynkr0IqmVRQY= github.com/filecoin-project/specs-actors v0.9.14/go.mod h1:TS1AW/7LbG+615j4NsjMK1qlpAwaFsG9w0V2tg2gSao= -github.com/filecoin-project/specs-actors/v2 v2.0.1/go.mod h1:v2NZVYinNIKA9acEMBm5wWXxqv5+frFEbekBFemYghY= github.com/filecoin-project/specs-actors/v2 v2.3.5-0.20210114162132-5b58b773f4fb/go.mod h1:LljnY2Mn2homxZsmokJZCpRuhOPxfXhvcek5gWkmqAc= -github.com/filecoin-project/specs-actors/v2 v2.3.5 h1:PbT4tPlSXZ8sRgajhb4D8AOEmiaaZ+jg6tc6BBv8VQc= -github.com/filecoin-project/specs-actors/v2 v2.3.5/go.mod h1:LljnY2Mn2homxZsmokJZCpRuhOPxfXhvcek5gWkmqAc= +github.com/filecoin-project/specs-actors/v2 v2.3.6 h1:UxnWTfQd7JsOae39/aHCK0m1IBjdcyymCJfqxuSkn+g= +github.com/filecoin-project/specs-actors/v2 v2.3.6/go.mod h1:DJMpxVRXvev9t8P0XWA26RmTzN+MHiL9IlItVLT0zUc= github.com/filecoin-project/specs-actors/v3 v3.1.0/go.mod h1:mpynccOLlIRy0QnR008BwYBwT9fen+sPR13MA1VmMww= github.com/filecoin-project/specs-actors/v3 v3.1.1 h1:BE8fsns1GnEOxt1DTE5LxBK2FThXtWmCChgcJoHTg0E= github.com/filecoin-project/specs-actors/v3 v3.1.1/go.mod h1:mpynccOLlIRy0QnR008BwYBwT9fen+sPR13MA1VmMww= @@ -435,8 +422,8 @@ github.com/filecoin-project/specs-actors/v6 v6.0.1/go.mod h1:V1AYfi5GkHXipx1mnVi github.com/filecoin-project/specs-actors/v7 v7.0.0-20211118013026-3dce48197cec h1:KV9vE+Sl2Y3qKsrpba4HcE7wHwK7v6O5U/S0xHbje6A= github.com/filecoin-project/specs-actors/v7 v7.0.0-20211118013026-3dce48197cec/go.mod h1:p6LIOFezA1rgRLMewbvdi3Pp6SAu+q9FtJ9CAleSjrE= github.com/filecoin-project/specs-storage v0.1.1-0.20201105051918-5188d9774506/go.mod h1:nJRRM7Aa9XVvygr3W9k6xGF46RWzr2zxF/iGoAIfA/g= -github.com/filecoin-project/specs-storage v0.1.1-0.20211202151826-2e51da61d454 h1:9II9Xf+jq5xAPQiS4rVoKIiALINa3loMC+ghyFYIrqQ= -github.com/filecoin-project/specs-storage v0.1.1-0.20211202151826-2e51da61d454/go.mod h1:nJRRM7Aa9XVvygr3W9k6xGF46RWzr2zxF/iGoAIfA/g= +github.com/filecoin-project/specs-storage v0.1.1-0.20211213202648-f14267c929ff h1:JO62nquOGhjoDf9+JkAcV+wsD5yhoyIKOMj70ZNdD3Q= +github.com/filecoin-project/specs-storage v0.1.1-0.20211213202648-f14267c929ff/go.mod h1:nJRRM7Aa9XVvygr3W9k6xGF46RWzr2zxF/iGoAIfA/g= github.com/filecoin-project/test-vectors/schema v0.0.5/go.mod h1:iQ9QXLpYWL3m7warwvK1JC/pTri8mnfEmKygNDqqY6E= github.com/filecoin-project/venus-auth v1.3.1-0.20210809053831-012d55d5f578/go.mod h1:/cbLZYvQhinVFUG4TP2Uy1o7LtF+guT21qZIMTmKk0g= github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc= @@ -462,8 +449,6 @@ github.com/gbrlsnchs/jwt/v3 v3.0.1/go.mod h1:AncDcjXz18xetI3A6STfXq2w+LuTx8pQ8bG github.com/gdamore/encoding v1.0.0/go.mod h1:alR0ol34c49FCSBLjhosxzcPHQbf2trDkoo5dl+VrEg= github.com/gdamore/tcell/v2 v2.2.0/go.mod h1:cTTuF84Dlj/RqmaCIV5p4w8uG1zWdk0SF6oBpwHp4fU= github.com/getkin/kin-openapi v0.13.0/go.mod h1:WGRs2ZMM1Q8LR1QBEwUxC6RJEfaBcD0s+pcEVXFuAjw= -github.com/getsentry/raven-go v0.2.0/go.mod h1:KungGk8q33+aIAZUIVWZDr2OfAEBsO49PX4NzFV5kcQ= -github.com/ghemawat/stream v0.0.0-20171120220530-696b145b53b9/go.mod h1:106OIgooyS7OzLDOpUGgm9fA3bQENb/cFSyyBmMoJDs= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= github.com/gin-gonic/gin v1.6.3/go.mod h1:75u5sXoLsGZoRN5Sgbi1eraJ4GU3++wFwWzhwvtwp4M= @@ -489,6 +474,11 @@ github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG github.com/go-logfmt/logfmt v0.5.1 h1:otpy5pqBCBZ1ng9RQ0dPu4PN7ba75Y/aA+UpowDyNVA= github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= github.com/go-logr/logr v0.4.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= +github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/logr v1.2.1 h1:DX7uPQ4WgAWfoh+NGGlbJQswnYIVvz0SRlLS3rPZQDA= +github.com/go-logr/logr v1.2.1/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/stdr v1.2.0 h1:j4LrlVXgrbIWO83mmQUnK0Hi+YnbD+vzrE1z/EphbFE= +github.com/go-logr/stdr v1.2.0/go.mod h1:YkVgnZu1ZjjL7xTxrfm/LLZBfkhTqSR1ydtm6jTKKwI= github.com/go-ole/go-ole v1.2.4/go.mod h1:XCwSNxSkXRo4vlyPy93sltvi/qJq0jqQhjqQNIwKuxM= github.com/go-ole/go-ole v1.2.5 h1:t4MGB5xEDZvXI+0rMjjsfBsD7yAgp/s9ZDkL1JndXwY= github.com/go-ole/go-ole v1.2.5/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= @@ -553,6 +543,8 @@ github.com/gogo/status v1.1.0/go.mod h1:BFv9nrluPLmrS0EmGVvLaPNmRosr9KapBYd5/hpY github.com/golang-jwt/jwt/v4 v4.0.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/glog v1.0.0 h1:nfP3RFugxnNRyKgeWd4oI1nYvXpxrx8ck8ZrcizshdQ= +github.com/golang/glog v1.0.0/go.mod h1:EWib/APOK0SL3dFbYqvxE3UYd8E6s1ouQ7iEp/0LWV4= github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -631,7 +623,6 @@ github.com/google/go-github v17.0.0+incompatible/go.mod h1:zLgOLi98H3fifZn+44m+u github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gopacket v1.1.17/go.mod h1:UdDNZ1OO62aGYVnPhxT1U6aI7ukYtA/kB8vaU0diBUM= -github.com/google/gopacket v1.1.18/go.mod h1:UdDNZ1OO62aGYVnPhxT1U6aI7ukYtA/kB8vaU0diBUM= github.com/google/gopacket v1.1.19 h1:ves8RnFZPGiFnTS0uPQStjwru6uO6h+nlr9j6fL7kF8= github.com/google/gopacket v1.1.19/go.mod h1:iJ8V8n6KS+z2U1A8pUwu8bW5SyEMkXJB8Yo/Vo+TKTo= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= @@ -788,22 +779,16 @@ github.com/ipfs/bbloom v0.0.4/go.mod h1:cS9YprKXpoZ9lT0n/Mw/a6/aFV6DTjTLYHeA+gyq github.com/ipfs/go-bitswap v0.0.9/go.mod h1:kAPf5qgn2W2DrgAcscZ3HrM9qh4pH+X8Fkk3UPrwvis= github.com/ipfs/go-bitswap v0.1.0/go.mod h1:FFJEf18E9izuCqUtHxbWEvq+reg7o4CW5wSAE1wsxj0= github.com/ipfs/go-bitswap v0.1.2/go.mod h1:qxSWS4NXGs7jQ6zQvoPY3+NmOfHHG47mhkiLzBpJQIs= -github.com/ipfs/go-bitswap v0.1.8/go.mod h1:TOWoxllhccevbWFUR2N7B1MTSVVge1s6XSMiCSA4MzM= -github.com/ipfs/go-bitswap v0.3.2/go.mod h1:AyWWfN3moBzQX0banEtfKOfbXb3ZeoOeXnZGNPV9S6w= -github.com/ipfs/go-bitswap v0.3.4 h1:AhJhRrG8xkxh6x87b4wWs+4U4y3DVB3doI8yFNqgQME= -github.com/ipfs/go-bitswap v0.3.4/go.mod h1:4T7fvNv/LmOys+21tnLzGKncMeeXUYUd1nUiJ2teMvI= +github.com/ipfs/go-bitswap v0.5.1 h1:721YAEDBnLIrvcIMkCHCdqp34hA8jwL9yKMkyJpSpco= +github.com/ipfs/go-bitswap v0.5.1/go.mod h1:P+ckC87ri1xFLvk74NlXdP0Kj9RmWAh4+H78sC6Qopo= 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/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.7/go.mod h1:EOfb9k/Y878ZTRY/CH0x5+ATtaipfbRhbvNSdgc/7So= github.com/ipfs/go-blockservice v0.1.0/go.mod h1:hzmMScl1kXHg3M2BjTymbVPjv627N7sYcvYaKbop39M= -github.com/ipfs/go-blockservice v0.1.3/go.mod h1:OTZhFpkgY48kNzbgyvcexW9cHrpjBYIjSR0KoDOFOLU= -github.com/ipfs/go-blockservice v0.1.4-0.20200624145336-a978cec6e834/go.mod h1:OTZhFpkgY48kNzbgyvcexW9cHrpjBYIjSR0KoDOFOLU= -github.com/ipfs/go-blockservice v0.1.4/go.mod h1:OTZhFpkgY48kNzbgyvcexW9cHrpjBYIjSR0KoDOFOLU= -github.com/ipfs/go-blockservice v0.1.5/go.mod h1:yLk8lBJCBRWRqerqCSVi3cE/Dncdt3vGC/PJMVKhLTY= -github.com/ipfs/go-blockservice v0.1.7 h1:yVe9te0M7ow8i+PPkx03YFSpxqzXx594d6h+34D6qMg= -github.com/ipfs/go-blockservice v0.1.7/go.mod h1:GmS+BAt4hrwBKkzE11AFDQUrnvqjwFatGS2MY7wOjEM= +github.com/ipfs/go-blockservice v0.2.1 h1:NJ4j/cwEfIg60rzAWcCIxRtOwbf6ZPK49MewNxObCPQ= +github.com/ipfs/go-blockservice v0.2.1/go.mod h1:k6SiwmgyYgs4M/qt+ww6amPeUH9EISLRBnvUurKJhi8= github.com/ipfs/go-cid v0.0.1/go.mod h1:GHWU/WuQdMPmIosc4Yn1bcCT7dSeX4lBafM7iqUPQvM= github.com/ipfs/go-cid v0.0.2/go.mod h1:GHWU/WuQdMPmIosc4Yn1bcCT7dSeX4lBafM7iqUPQvM= github.com/ipfs/go-cid v0.0.3/go.mod h1:GHWU/WuQdMPmIosc4Yn1bcCT7dSeX4lBafM7iqUPQvM= @@ -813,7 +798,6 @@ github.com/ipfs/go-cid v0.0.5/go.mod h1:plgt+Y5MnOey4vO4UlUazGqdbEXuFYitED67Fexh github.com/ipfs/go-cid v0.0.6-0.20200501230655-7c82f3b81c00/go.mod h1:plgt+Y5MnOey4vO4UlUazGqdbEXuFYitED67FexhXog= github.com/ipfs/go-cid v0.0.6/go.mod h1:6Ux9z5e+HpkQdckYoX1PG/6xqKspzlEIR5SDmgqgC/I= github.com/ipfs/go-cid v0.0.7/go.mod h1:6Ux9z5e+HpkQdckYoX1PG/6xqKspzlEIR5SDmgqgC/I= -github.com/ipfs/go-cid v0.0.8-0.20210716091050-de6c03deae1c/go.mod h1:rH5/Xv83Rfy8Rw6xG+id3DYAMUVmem1MowoKwdXmN2o= github.com/ipfs/go-cid v0.1.0 h1:YN33LQulcRHjfom/i25yoOZR4Telp1Hr/2RU3d0PnC0= github.com/ipfs/go-cid v0.1.0/go.mod h1:rH5/Xv83Rfy8Rw6xG+id3DYAMUVmem1MowoKwdXmN2o= github.com/ipfs/go-cidutil v0.0.2 h1:CNOboQf1t7Qp0nuNh8QMmhJs0+Q//bRL1axtCnIB1Yo= @@ -822,15 +806,15 @@ github.com/ipfs/go-datastore v0.0.1/go.mod h1:d4KVXhMt913cLBEI/PXAy6ko+W7e9AhyAK github.com/ipfs/go-datastore v0.0.5/go.mod h1:d4KVXhMt913cLBEI/PXAy6ko+W7e9AhyAKBGh803qeE= github.com/ipfs/go-datastore v0.1.0/go.mod h1:d4KVXhMt913cLBEI/PXAy6ko+W7e9AhyAKBGh803qeE= github.com/ipfs/go-datastore v0.1.1/go.mod h1:w38XXW9kVFNp57Zj5knbKWM2T+KOZCGDRVNdgPHtbHw= -github.com/ipfs/go-datastore v0.3.0/go.mod h1:w38XXW9kVFNp57Zj5knbKWM2T+KOZCGDRVNdgPHtbHw= github.com/ipfs/go-datastore v0.3.1/go.mod h1:w38XXW9kVFNp57Zj5knbKWM2T+KOZCGDRVNdgPHtbHw= github.com/ipfs/go-datastore v0.4.0/go.mod h1:SX/xMIKoCszPqp+z9JhPYCmoOoXTvaa13XEbGtsFUhA= github.com/ipfs/go-datastore v0.4.1/go.mod h1:SX/xMIKoCszPqp+z9JhPYCmoOoXTvaa13XEbGtsFUhA= -github.com/ipfs/go-datastore v0.4.2/go.mod h1:SX/xMIKoCszPqp+z9JhPYCmoOoXTvaa13XEbGtsFUhA= github.com/ipfs/go-datastore v0.4.4/go.mod h1:SX/xMIKoCszPqp+z9JhPYCmoOoXTvaa13XEbGtsFUhA= github.com/ipfs/go-datastore v0.4.5/go.mod h1:eXTcaaiN6uOlVCLS9GjJUJtlvJfM3xk23w3fyfrmmJs= -github.com/ipfs/go-datastore v0.4.6 h1:zU2cmweykxJ+ziXnA2cPtsLe8rdR/vrthOipLPuf6kc= -github.com/ipfs/go-datastore v0.4.6/go.mod h1:XSipLSc64rFKSFRFGo1ecQl+WhYce3K7frtpHkyPFUc= +github.com/ipfs/go-datastore v0.4.7-0.20211013204805-28a3721c2e66/go.mod h1:9zhEApYMTl17C8YDp7JmU7sQZi2/wqiYh73hakZ90Bk= +github.com/ipfs/go-datastore v0.5.0/go.mod h1:9zhEApYMTl17C8YDp7JmU7sQZi2/wqiYh73hakZ90Bk= +github.com/ipfs/go-datastore v0.5.1 h1:WkRhLuISI+XPD0uk3OskB0fYFSyqK8Ob5ZYew9Qa1nQ= +github.com/ipfs/go-datastore v0.5.1/go.mod h1:9zhEApYMTl17C8YDp7JmU7sQZi2/wqiYh73hakZ90Bk= github.com/ipfs/go-detect-race v0.0.1 h1:qX/xay2W3E4Q1U7d9lNs1sU9nvguX0a7319XbyQ6cOk= github.com/ipfs/go-detect-race v0.0.1/go.mod h1:8BNT7shDZPo99Q74BpGMK+4D8Mn4j46UU0LZ723meps= github.com/ipfs/go-ds-badger v0.0.2/go.mod h1:Y3QpeSFWQf6MopLTiZD+VT6IC1yZqaGmjvRcKeSGij8= @@ -838,41 +822,34 @@ github.com/ipfs/go-ds-badger v0.0.5/go.mod h1:g5AuuCGmr7efyzQhLL8MzwqcauPojGPUaH github.com/ipfs/go-ds-badger v0.0.7/go.mod h1:qt0/fWzZDoPW6jpQeqUjR5kBfhDNB65jd9YlmAvpQBk= github.com/ipfs/go-ds-badger v0.2.1/go.mod h1:Tx7l3aTph3FMFrRS838dcSJh+jjA7cX9DrGVwx/NOwE= github.com/ipfs/go-ds-badger v0.2.3/go.mod h1:pEYw0rgg3FIrywKKnL+Snr+w/LjJZVMTBRn4FS6UHUk= -github.com/ipfs/go-ds-badger v0.2.6/go.mod h1:02rnztVKA4aZwDuaRPTf8mpqcKmXP7mLl6JPxd14JHA= github.com/ipfs/go-ds-badger v0.2.7/go.mod h1:02rnztVKA4aZwDuaRPTf8mpqcKmXP7mLl6JPxd14JHA= +github.com/ipfs/go-ds-badger v0.3.0/go.mod h1:1ke6mXNqeV8K3y5Ak2bAA0osoTfmxUdupVCGm4QUIek= github.com/ipfs/go-ds-badger2 v0.1.0/go.mod h1:pbR1p817OZbdId9EvLOhKBgUVTM3BMCSTan78lDDVaw= -github.com/ipfs/go-ds-badger2 v0.1.1-0.20200708190120-187fc06f714e h1:Xi1nil8K2lBOorBS6Ys7+hmUCzH8fr3U9ipdL/IrcEI= -github.com/ipfs/go-ds-badger2 v0.1.1-0.20200708190120-187fc06f714e/go.mod h1:lJnws7amT9Ehqzta0gwMrRsURU04caT0iRPr1W8AsOU= +github.com/ipfs/go-ds-badger2 v0.1.2 h1:sQc2q1gaXrv8YFNeUtxil0neuyDf9hnVHfLsi7lpXfE= +github.com/ipfs/go-ds-badger2 v0.1.2/go.mod h1:3FtQmDv6fMubygEfU43bsFelYpIiXX/XEYA54l9eCwg= github.com/ipfs/go-ds-leveldb v0.0.1/go.mod h1:feO8V3kubwsEF22n0YRQCffeb79OOYIykR4L04tMOYc= github.com/ipfs/go-ds-leveldb v0.1.0/go.mod h1:hqAW8y4bwX5LWcCtku2rFNX3vjDZCy5LZCg+cSZvYb8= github.com/ipfs/go-ds-leveldb v0.4.1/go.mod h1:jpbku/YqBSsBc1qgME8BkWS4AxzF2cEu1Ii2r79Hh9s= -github.com/ipfs/go-ds-leveldb v0.4.2 h1:QmQoAJ9WkPMUfBLnu1sBVy0xWWlJPg0m4kRAiJL9iaw= github.com/ipfs/go-ds-leveldb v0.4.2/go.mod h1:jpbku/YqBSsBc1qgME8BkWS4AxzF2cEu1Ii2r79Hh9s= -github.com/ipfs/go-ds-measure v0.1.0 h1:vE4TyY4aeLeVgnnPBC5QzKIjKrqzha0NCujTfgvVbVQ= -github.com/ipfs/go-ds-measure v0.1.0/go.mod h1:1nDiFrhLlwArTME1Ees2XaBOl49OoCgd2A3f8EchMSY= -github.com/ipfs/go-ds-pebble v0.0.2-0.20200921225637-ce220f8ac459/go.mod h1:oh4liWHulKcDKVhCska5NLelE3MatWl+1FwSz3tY91g= -github.com/ipfs/go-filestore v1.0.0 h1:QR7ekKH+q2AGiWDc7W2Q0qHuYSRZGUJqUn0GsegEPb0= -github.com/ipfs/go-filestore v1.0.0/go.mod h1:/XOCuNtIe2f1YPbiXdYvD0BKLA0JR1MgPiFOdcuu9SM= +github.com/ipfs/go-ds-leveldb v0.5.0 h1:s++MEBbD3ZKc9/8/njrn4flZLnCuY9I79v94gBUNumo= +github.com/ipfs/go-ds-leveldb v0.5.0/go.mod h1:d3XG9RUDzQ6V4SHi8+Xgj9j1XuEk1z82lquxrVbml/Q= +github.com/ipfs/go-ds-measure v0.2.0 h1:sG4goQe0KDTccHMyT45CY1XyUbxe5VwTKpg2LjApYyQ= +github.com/ipfs/go-ds-measure v0.2.0/go.mod h1:SEUD/rE2PwRa4IQEC5FuNAmjJCyYObZr9UvVh8V3JxE= +github.com/ipfs/go-filestore v1.1.0 h1:Pu4tLBi1bucu6/HU9llaOmb9yLFk/sgP+pW764zNDoE= +github.com/ipfs/go-filestore v1.1.0/go.mod h1:6e1/5Y6NvLuCRdmda/KA4GUhXJQ3Uat6vcWm2DJfxc8= 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.9.1/go.mod h1:J62ahWT9JbPsFL2UWsUM5rOu0lZJ0LOIH1chHdxGGcw= -github.com/ipfs/go-graphsync v0.10.0/go.mod h1:cKIshzTaa5rCZjryH5xmSKZVGX9uk1wvwGvz2WEha5Y= -github.com/ipfs/go-graphsync v0.10.6 h1:GkYan4EoDslceHaqYo/hxktWtuZ7VmsyRXLdSmoCcBQ= -github.com/ipfs/go-graphsync v0.10.6/go.mod h1:tQMjWNDD/vSz80YLT/VvzrUmy58aF9lR1uCwSLzjWzI= -github.com/ipfs/go-hamt-ipld v0.0.15-0.20200131012125-dd88a59d3f2e/go.mod h1:9aQJu/i/TaRDW6jqB5U217dLIDopn50wxLdHXM2CTfE= +github.com/ipfs/go-graphsync v0.11.0/go.mod h1:wC+c8vGVjAHthsVIl8LKr37cUra2GOaMYcQNNmMxDqE= +github.com/ipfs/go-graphsync v0.11.5 h1:WA5hVxGBtcal6L6nqubKiqRolaZxbexOK3GumGFJRR4= +github.com/ipfs/go-graphsync v0.11.5/go.mod h1:+/sZqRwRCQRrV7NCzgBtufmr5QGpUE98XSa7NlsztmM= 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= -github.com/ipfs/go-ipfs-blockstore v0.1.4/go.mod h1:Jxm3XMVjh6R17WvxFEiyKBLUGr86HgIYJW/D/MwqeYQ= -github.com/ipfs/go-ipfs-blockstore v0.1.6/go.mod h1:Jxm3XMVjh6R17WvxFEiyKBLUGr86HgIYJW/D/MwqeYQ= -github.com/ipfs/go-ipfs-blockstore v1.0.0/go.mod h1:knLVdhVU9L7CC4T+T4nvGdeUIPAXlnd9zmXfp+9MIjU= -github.com/ipfs/go-ipfs-blockstore v1.0.1/go.mod h1:MGNZlHNEnR4KGgPHM3/k8lBySIOK2Ve+0KjZubKlaOE= -github.com/ipfs/go-ipfs-blockstore v1.0.3/go.mod h1:MGNZlHNEnR4KGgPHM3/k8lBySIOK2Ve+0KjZubKlaOE= -github.com/ipfs/go-ipfs-blockstore v1.0.4 h1:DZdeya9Vu4ttvlGheQPGrj6kWehXnYZRFCp9EsZQ1hI= -github.com/ipfs/go-ipfs-blockstore v1.0.4/go.mod h1:uL7/gTJ8QIZ3MtA3dWf+s1a0U3fJy2fcEZAsovpRp+w= +github.com/ipfs/go-ipfs-blockstore v0.2.1/go.mod h1:jGesd8EtCM3/zPgx+qr0/feTXGUeRai6adgwC+Q+JvE= +github.com/ipfs/go-ipfs-blockstore v1.1.0/go.mod h1:5QDUApRqpgPcfGstCxYeMnjt/DYQtXXdJVCvxHHuWVk= +github.com/ipfs/go-ipfs-blockstore v1.1.1/go.mod h1:w51tNR9y5+QXB0wkNcHt4O2aSZjTdqaEWaQdSxEyUOY= +github.com/ipfs/go-ipfs-blockstore v1.1.2 h1:WCXoZcMYnvOTmlpX+RSSnhVN0uCmbWTeepTGX5lgiXw= +github.com/ipfs/go-ipfs-blockstore v1.1.2/go.mod h1:w51tNR9y5+QXB0wkNcHt4O2aSZjTdqaEWaQdSxEyUOY= github.com/ipfs/go-ipfs-blocksutil v0.0.1 h1:Eh/H4pc1hsvhzsQoMEP3Bke/aW5P5rVM1IWFJMcGIPQ= github.com/ipfs/go-ipfs-blocksutil v0.0.1/go.mod h1:Yq4M86uIOmxmGPUHv/uI7uKqZNtLb449gwKqXjIsnRk= github.com/ipfs/go-ipfs-chunker v0.0.1/go.mod h1:tWewYK0we3+rMbOh7pPFGDyypCtvGcBFymgY4rSDLAw= @@ -886,12 +863,15 @@ github.com/ipfs/go-ipfs-delay v0.0.1 h1:r/UXYyRcddO6thwOnhiznIAiSvxMECGgtv35Xs1I github.com/ipfs/go-ipfs-delay v0.0.1/go.mod h1:8SP1YXK1M1kXuc4KJZINY3TQQ03J2rwBG9QfXmbRPrw= github.com/ipfs/go-ipfs-ds-help v0.0.1/go.mod h1:gtP9xRaZXqIQRh1HRpp595KbBEdgqWFxefeVKOV8sxo= github.com/ipfs/go-ipfs-ds-help v0.1.1/go.mod h1:SbBafGJuGsPI/QL3j9Fc5YPLeAu+SzOkI0gFwAg+mOs= -github.com/ipfs/go-ipfs-ds-help v1.0.0 h1:bEQ8hMGs80h0sR8O4tfDgV6B01aaF9qeTrujrTLYV3g= github.com/ipfs/go-ipfs-ds-help v1.0.0/go.mod h1:ujAbkeIgkKAWtxxNkoZHWLCyk5JpPoKnGyCcsoF6ueE= -github.com/ipfs/go-ipfs-exchange-interface v0.0.1 h1:LJXIo9W7CAmugqI+uofioIpRb6rY30GUu7G6LUfpMvM= +github.com/ipfs/go-ipfs-ds-help v1.1.0 h1:yLE2w9RAsl31LtfMt91tRZcrx+e61O5mDxFRR994w4Q= +github.com/ipfs/go-ipfs-ds-help v1.1.0/go.mod h1:YR5+6EaebOhfcqVCyqemItCLthrpVNot+rsOU/5IatU= github.com/ipfs/go-ipfs-exchange-interface v0.0.1/go.mod h1:c8MwfHjtQjPoDyiy9cFquVtVHkO9b9Ob3FG91qJnWCM= -github.com/ipfs/go-ipfs-exchange-offline v0.0.1 h1:P56jYKZF7lDDOLx5SotVh5KFxoY6C81I1NSHW1FxGew= +github.com/ipfs/go-ipfs-exchange-interface v0.1.0 h1:TiMekCrOGQuWYtZO3mf4YJXDIdNgnKWZ9IE3fGlnWfo= +github.com/ipfs/go-ipfs-exchange-interface v0.1.0/go.mod h1:ych7WPlyHqFvCi/uQI48zLZuAWVP5iTQPXEfVaw5WEI= github.com/ipfs/go-ipfs-exchange-offline v0.0.1/go.mod h1:WhHSFCVYX36H/anEKQboAzpUws3x7UeEGkzQc3iNkM0= +github.com/ipfs/go-ipfs-exchange-offline v0.1.1 h1:mEiXWdbMN6C7vtDG21Fphx8TGCbZPpQnz/496w/PL4g= +github.com/ipfs/go-ipfs-exchange-offline v0.1.1/go.mod h1:vTiBRIbzSwDD0OWm+i3xeT0mO7jG2cbJYatp3HPk5XY= github.com/ipfs/go-ipfs-files v0.0.3/go.mod h1:INEFm0LL2LWXBhNJ2PMIIb2w45hpXgPjNoE7yA8Y1d4= github.com/ipfs/go-ipfs-files v0.0.4/go.mod h1:INEFm0LL2LWXBhNJ2PMIIb2w45hpXgPjNoE7yA8Y1d4= github.com/ipfs/go-ipfs-files v0.0.8/go.mod h1:wiN/jSG8FKyk7N0WyctKSvq3ljIa2NNTiZB55kpTdOs= @@ -906,17 +886,19 @@ github.com/ipfs/go-ipfs-pq v0.0.1/go.mod h1:LWIqQpqfRG3fNc5XsnIhz/wQ2XXGyugQwls7 github.com/ipfs/go-ipfs-pq v0.0.2 h1:e1vOOW6MuOwG2lqxcLA+wEn93i/9laCY8sXAw76jFOY= github.com/ipfs/go-ipfs-pq v0.0.2/go.mod h1:LWIqQpqfRG3fNc5XsnIhz/wQ2XXGyugQwls7BgUmUfY= github.com/ipfs/go-ipfs-routing v0.0.1/go.mod h1:k76lf20iKFxQTjcJokbPM9iBXVXVZhcOwc360N4nuKs= -github.com/ipfs/go-ipfs-routing v0.1.0 h1:gAJTT1cEeeLj6/DlLX6t+NxD9fQe2ymTO6qWRDI/HQQ= github.com/ipfs/go-ipfs-routing v0.1.0/go.mod h1:hYoUkJLyAUKhF58tysKpids8RNDPO42BVMgK5dNsoqY= +github.com/ipfs/go-ipfs-routing v0.2.1 h1:E+whHWhJkdN9YeoHZNj5itzc+OR292AJ2uE9FFiW0BY= +github.com/ipfs/go-ipfs-routing v0.2.1/go.mod h1:xiNNiwgjmLqPS1cimvAw6EyB9rkVDbiocA4yY+wRNLM= github.com/ipfs/go-ipfs-util v0.0.1/go.mod h1:spsl5z8KUnrve+73pOhSVZND1SIxPW5RyBCNzQxlJBc= github.com/ipfs/go-ipfs-util v0.0.2 h1:59Sswnk1MFaiq+VcaknX7aYEyGyGDAA73ilhEK2POp8= github.com/ipfs/go-ipfs-util v0.0.2/go.mod h1:CbPtkWJzjLdEcezDns2XYaehFVNXG9zrdrtMecczcsQ= github.com/ipfs/go-ipld-cbor v0.0.2/go.mod h1:wTBtrQZA3SoFKMVkp6cn6HMRteIB1VsmHA0AQFOn7Nc= github.com/ipfs/go-ipld-cbor v0.0.3/go.mod h1:wTBtrQZA3SoFKMVkp6cn6HMRteIB1VsmHA0AQFOn7Nc= github.com/ipfs/go-ipld-cbor v0.0.4/go.mod h1:BkCduEx3XBCO6t2Sfo5BaHzuok7hbhdMm9Oh8B2Ftq4= -github.com/ipfs/go-ipld-cbor v0.0.5-0.20200204214505-252690b78669/go.mod h1:BkCduEx3XBCO6t2Sfo5BaHzuok7hbhdMm9Oh8B2Ftq4= -github.com/ipfs/go-ipld-cbor v0.0.5 h1:ovz4CHKogtG2KB/h1zUp5U0c/IzZrL435rCh5+K/5G8= github.com/ipfs/go-ipld-cbor v0.0.5/go.mod h1:BkCduEx3XBCO6t2Sfo5BaHzuok7hbhdMm9Oh8B2Ftq4= +github.com/ipfs/go-ipld-cbor v0.0.6-0.20211211231443-5d9b9e1f6fa8/go.mod h1:ssdxxaLJPXH7OjF5V4NSjBbcfh+evoR4ukuru0oPXMA= +github.com/ipfs/go-ipld-cbor v0.0.6 h1:pYuWHyvSpIsOOLw4Jy7NbBkCyzLDcl64Bf/LZW7eBQ0= +github.com/ipfs/go-ipld-cbor v0.0.6/go.mod h1:ssdxxaLJPXH7OjF5V4NSjBbcfh+evoR4ukuru0oPXMA= github.com/ipfs/go-ipld-format v0.0.1/go.mod h1:kyJtbkDALmFHv3QR6et67i35QzO3S0dCDnkOJhcZkms= github.com/ipfs/go-ipld-format v0.0.2/go.mod h1:4B6+FM2u9OJ9zCV+kSbgFAZlOrv1Hqbf0INGQgiKf9k= github.com/ipfs/go-ipld-format v0.2.0 h1:xGlJKkArkmBvowr+GMCX0FEZtkro71K1AwiKnL37mwA= @@ -924,7 +906,6 @@ github.com/ipfs/go-ipld-format v0.2.0/go.mod h1:3l3C1uKoadTPbeNfrDi+xMInYKlx2Cvg github.com/ipfs/go-ipld-legacy v0.1.0/go.mod h1:86f5P/srAmh9GcIcWQR9lfFLZPrIyyXQeVlOWeeWEuI= github.com/ipfs/go-ipld-legacy v0.1.1 h1:BvD8PEuqwBHLTKqlGFTHSwrwFOMkVESEvwIYwR2cdcc= github.com/ipfs/go-ipld-legacy v0.1.1/go.mod h1:8AyKFCjgRPsQFf15ZQgDB8Din4DML/fOmKZkkFkrIEg= -github.com/ipfs/go-ipns v0.0.2/go.mod h1:WChil4e0/m9cIINWLxZe1Jtf77oz5L05rO2ei/uKJ5U= github.com/ipfs/go-ipns v0.1.2/go.mod h1:ioQ0j02o6jdIVW+bmi18f4k2gRf0AV3kZ9KeHYHICnQ= github.com/ipfs/go-log v0.0.1/go.mod h1:kL1d2/hzSpI0thNYjiKfjanbVNU+IIGA/WnNESY9leM= github.com/ipfs/go-log v1.0.0/go.mod h1:JO7RzlMK6rA+CIxFMLOuB6Wf5b81GDiKElL7UPSIKjA= @@ -943,15 +924,15 @@ github.com/ipfs/go-log/v2 v2.1.1/go.mod h1:2v2nsGfZsvvAJz13SyFzf9ObaqwHiHxsPLEHn github.com/ipfs/go-log/v2 v2.1.2-0.20200626104915-0016c0b4b3e4/go.mod h1:2v2nsGfZsvvAJz13SyFzf9ObaqwHiHxsPLEHntrv9KM= github.com/ipfs/go-log/v2 v2.1.2/go.mod h1:2v2nsGfZsvvAJz13SyFzf9ObaqwHiHxsPLEHntrv9KM= github.com/ipfs/go-log/v2 v2.1.3/go.mod h1:/8d0SH3Su5Ooc31QlL1WysJhvyOTDCjcCZ9Axpmri6g= -github.com/ipfs/go-log/v2 v2.3.0 h1:31Re/cPqFHpsRHgyVwjWADPoF0otB1WrjTy8ZFYwEZU= github.com/ipfs/go-log/v2 v2.3.0/go.mod h1:QqGoj30OTpnKaG/LKTGTxoP2mmQtjVMEnK72gynbe/g= +github.com/ipfs/go-log/v2 v2.4.0 h1:iR/2o9PGWanVJrBgIH5Ff8mPGOwpqLaPIAFqSnsdlzk= +github.com/ipfs/go-log/v2 v2.4.0/go.mod h1:nPZnh7Cj7lwS3LpRU5Mwr2ol1c2gXIEXuF6aywqrtmo= github.com/ipfs/go-merkledag v0.0.6/go.mod h1:QYPdnlvkOg7GnQRofu9XZimC5ZW5Wi3bKys/4GQQfto= github.com/ipfs/go-merkledag v0.2.3/go.mod h1:SQiXrtSts3KGNmgOzMICy5c0POOpUNQLvB3ClKnBAlk= github.com/ipfs/go-merkledag v0.2.4/go.mod h1:SQiXrtSts3KGNmgOzMICy5c0POOpUNQLvB3ClKnBAlk= -github.com/ipfs/go-merkledag v0.3.1/go.mod h1:fvkZNNZixVW6cKSZ/JfLlON5OlgTXNdRLz0p6QG/I2M= github.com/ipfs/go-merkledag v0.3.2/go.mod h1:fvkZNNZixVW6cKSZ/JfLlON5OlgTXNdRLz0p6QG/I2M= -github.com/ipfs/go-merkledag v0.4.1 h1:CEEQZnwRkszN06oezuasHwDD823Xcr4p4zluUN9vXqs= -github.com/ipfs/go-merkledag v0.4.1/go.mod h1:56biPaS6e+IS0eXkEt6A8tG+BUQaEIFqDqJuFfQDBoE= +github.com/ipfs/go-merkledag v0.5.1 h1:tr17GPP5XtPhvPPiWtu20tSGZiZDuTaJRXBLcr79Umk= +github.com/ipfs/go-merkledag v0.5.1/go.mod h1:cLMZXx8J08idkp5+id62iVftUQV+HlYJ3PIhDfZsjA4= github.com/ipfs/go-metrics-interface v0.0.1 h1:j+cpbjYvu4R8zbleSs36gvB7jR+wsL2fGD6n0jO4kdg= github.com/ipfs/go-metrics-interface v0.0.1/go.mod h1:6s6euYU4zowdslK0GKHmqaIZ3j/b/tL7HTWtJ4VPgWY= github.com/ipfs/go-metrics-prometheus v0.0.2/go.mod h1:ELLU99AQQNi+zX6GCGm2lAgnzdSH3u5UVlCdqSXnEks= @@ -959,10 +940,9 @@ github.com/ipfs/go-path v0.0.7 h1:H06hKMquQ0aYtHiHryOMLpQC1qC3QwXwkahcEVD51Ho= github.com/ipfs/go-path v0.0.7/go.mod h1:6KTKmeRnBXgqrTvzFrPV3CamxcgvXX/4z79tfAd2Sno= github.com/ipfs/go-peertaskqueue v0.0.4/go.mod h1:03H8fhyeMfKNFWqzYEVyMbcPUeYrqP1MX6Kd+aN+rMQ= github.com/ipfs/go-peertaskqueue v0.1.0/go.mod h1:Jmk3IyCcfl1W3jTW3YpghSwSEC6IJ3Vzz/jUmWw8Z0U= -github.com/ipfs/go-peertaskqueue v0.1.1/go.mod h1:Jmk3IyCcfl1W3jTW3YpghSwSEC6IJ3Vzz/jUmWw8Z0U= -github.com/ipfs/go-peertaskqueue v0.2.0/go.mod h1:5/eNrBEbtSKWCG+kQK8K8fGNixoYUnr+P7jivavs9lY= -github.com/ipfs/go-peertaskqueue v0.6.0 h1:BT1/PuNViVomiz1PnnP5+WmKsTNHrxIDvkZrkj4JhOg= -github.com/ipfs/go-peertaskqueue v0.6.0/go.mod h1:M/akTIE/z1jGNXMU7kFB4TeSEFvj68ow0Rrb04donIU= +github.com/ipfs/go-peertaskqueue v0.7.0/go.mod h1:M/akTIE/z1jGNXMU7kFB4TeSEFvj68ow0Rrb04donIU= +github.com/ipfs/go-peertaskqueue v0.7.1 h1:7PLjon3RZwRQMgOTvYccZ+mjzkmds/7YzSWKFlBAypE= +github.com/ipfs/go-peertaskqueue v0.7.1/go.mod h1:M/akTIE/z1jGNXMU7kFB4TeSEFvj68ow0Rrb04donIU= github.com/ipfs/go-todocounter v0.0.1/go.mod h1:l5aErvQc8qKE2r7NDMjmq5UNAvuZy0rC8BHOplkWvZ4= github.com/ipfs/go-unixfs v0.2.2-0.20190827150610-868af2e9e5cb/go.mod h1:IwAAgul1UQIcNZzKPYZWOCijryFBeCV79cNubPzol+k= github.com/ipfs/go-unixfs v0.2.4/go.mod h1:SUdisfUjNoSDzzhGVxvCL9QO/nKdwXdr+gbMUdqcbYw= @@ -977,35 +957,27 @@ github.com/ipfs/iptb v1.4.0/go.mod h1:1rzHpCYtNp87/+hTxG5TfCVn/yMY3dKnLn8tBiMfdm github.com/ipfs/iptb-plugins v0.3.0 h1:C1rpq1o5lUZtaAOkLIox5akh6ba4uk/3RwWc6ttVxw0= github.com/ipfs/iptb-plugins v0.3.0/go.mod h1:5QtOvckeIw4bY86gSH4fgh3p3gCSMn3FmIKr4gaBncA= github.com/ipld/go-car v0.1.0/go.mod h1:RCWzaUh2i4mOEkB3W45Vc+9jnS/M6Qay5ooytiBHl3g= -github.com/ipld/go-car v0.1.1-0.20200923150018-8cdef32e2da4/go.mod h1:xrMEcuSq+D1vEwl+YAXsg/JfA98XGpXDwnkIL4Aimqw= -github.com/ipld/go-car v0.1.1-0.20201119040415-11b6074b6d4d/go.mod h1:2Gys8L8MJ6zkh1gktTSXreY63t4UbyvNp5JaudTyxHQ= -github.com/ipld/go-car v0.3.1-0.20210601190600-f512dac51e8e/go.mod h1:wUxBdwOLA9/0HZBi3fnTBzla0MuwlqgJLyrhOg1XaKI= -github.com/ipld/go-car v0.3.2-0.20211001225732-32d0d9933823 h1:8JMSJ0k71fU9lIUrpVwEdoX4KoxiTEX8cZG97v/hTDw= -github.com/ipld/go-car v0.3.2-0.20211001225732-32d0d9933823/go.mod h1:jSlTph+i/q1jLFoiKKeN69KGG0fXpwrcD0izu5C1Tpo= -github.com/ipld/go-car/v2 v2.0.0-beta1.0.20210721090610-5a9d1b217d25/go.mod h1:I2ACeeg6XNBe5pdh5TaR7Ambhfa7If9KXxmXgZsYENU= -github.com/ipld/go-car/v2 v2.0.2/go.mod h1:I2ACeeg6XNBe5pdh5TaR7Ambhfa7If9KXxmXgZsYENU= -github.com/ipld/go-car/v2 v2.1.0 h1:t8R/WXUSkfu1K1gpPk76mytCxsEdMjGcMIgpOq3/Cnw= -github.com/ipld/go-car/v2 v2.1.0/go.mod h1:Xr6GwkDhv8dtOtgHzOynAkIOg0t0YiPc5DxBPppWqZA= +github.com/ipld/go-car v0.3.3-0.20211210032800-e6f244225a16/go.mod h1:/wkKF4908ULT4dFIFIUZYcfjAnj+KFnJvlh8Hsz1FbQ= +github.com/ipld/go-car v0.3.3 h1:D6y+jvg9h2ZSv7GLUMWUwg5VTLy1E7Ak+uQw5orOg3I= +github.com/ipld/go-car v0.3.3/go.mod h1:/wkKF4908ULT4dFIFIUZYcfjAnj+KFnJvlh8Hsz1FbQ= +github.com/ipld/go-car/v2 v2.1.1-0.20211211000942-be2525f6bf2d/go.mod h1:+2Yvf0Z3wzkv7NeI69i8tuZ+ft7jyjPYIWZzeVNeFcI= +github.com/ipld/go-car/v2 v2.1.1 h1:saaKz4nC0AdfCGHLYKeXLGn8ivoPC54fyS55uyOLKwA= +github.com/ipld/go-car/v2 v2.1.1/go.mod h1:+2Yvf0Z3wzkv7NeI69i8tuZ+ft7jyjPYIWZzeVNeFcI= github.com/ipld/go-codec-dagpb v1.2.0/go.mod h1:6nBN7X7h8EOsEejZGqC7tej5drsdBAXbMHyBT+Fne5s= github.com/ipld/go-codec-dagpb v1.3.0 h1:czTcaoAuNNyIYWs6Qe01DJ+sEX7B+1Z0LcXjSatMGe8= github.com/ipld/go-codec-dagpb v1.3.0/go.mod h1:ga4JTU3abYApDC3pZ00BC2RSvC3qfBb9MSJkMLSwnhA= github.com/ipld/go-ipld-prime v0.0.2-0.20191108012745-28a82f04c785/go.mod h1:bDDSvVz7vaK12FNvMeRYnpRFkSUPNQOiCYQezMD/P3w= -github.com/ipld/go-ipld-prime v0.0.2-0.20200428162820-8b59dc292b8e/go.mod h1:uVIwe/u0H4VdKv3kaN1ck7uCb6yD9cFLS9/ELyXbsw8= -github.com/ipld/go-ipld-prime v0.5.1-0.20200828233916-988837377a7f/go.mod h1:0xEgdD6MKbZ1vF0GC+YcR/C4SQCAlRuOjIJ2i0HxqzM= -github.com/ipld/go-ipld-prime v0.5.1-0.20201021195245-109253e8a018/go.mod h1:0xEgdD6MKbZ1vF0GC+YcR/C4SQCAlRuOjIJ2i0HxqzM= github.com/ipld/go-ipld-prime v0.9.0/go.mod h1:KvBLMr4PX1gWptgkzRjVZCrLmSGcZCb/jioOQwCqZN8= github.com/ipld/go-ipld-prime v0.9.1-0.20210324083106-dc342a9917db/go.mod h1:KvBLMr4PX1gWptgkzRjVZCrLmSGcZCb/jioOQwCqZN8= github.com/ipld/go-ipld-prime v0.10.0/go.mod h1:KvBLMr4PX1gWptgkzRjVZCrLmSGcZCb/jioOQwCqZN8= github.com/ipld/go-ipld-prime v0.11.0/go.mod h1:+WIAkokurHmZ/KwzDOMUuoeJgaRQktHtEaLglS3ZeV8= -github.com/ipld/go-ipld-prime v0.12.0/go.mod h1:hy8b93WleDMRKumOJnTIrr0MbbFbx9GD6Kzxa53Xppc= -github.com/ipld/go-ipld-prime v0.12.3-0.20210930132912-0b3aef3ca569/go.mod h1:PaeLYq8k6dJLmDUSLrzkEpoGV4PEfe/1OtFN/eALOc8= github.com/ipld/go-ipld-prime v0.12.3/go.mod h1:PaeLYq8k6dJLmDUSLrzkEpoGV4PEfe/1OtFN/eALOc8= -github.com/ipld/go-ipld-prime v0.14.2 h1:P5fO2usnisXwrN/1sR5exCgEvINg/w/27EuYPKB/zx8= -github.com/ipld/go-ipld-prime v0.14.2/go.mod h1:QcE4Y9n/ZZr8Ijg5bGPT0GqYWgZ1704nH0RDcQtgTP0= +github.com/ipld/go-ipld-prime v0.14.0/go.mod h1:9ASQLwUFLptCov6lIYc70GRB4V7UTyLD0IJtrDJe6ZM= +github.com/ipld/go-ipld-prime v0.14.3-0.20211207234443-319145880958/go.mod h1:QcE4Y9n/ZZr8Ijg5bGPT0GqYWgZ1704nH0RDcQtgTP0= +github.com/ipld/go-ipld-prime v0.14.3 h1:cGUmxSws2IHurn00/iLMDapeXsnf9+FyAtYVy8G/JsQ= +github.com/ipld/go-ipld-prime v0.14.3/go.mod h1:QcE4Y9n/ZZr8Ijg5bGPT0GqYWgZ1704nH0RDcQtgTP0= github.com/ipld/go-ipld-prime-proto v0.0.0-20191113031812-e32bd156a1e5/go.mod h1:gcvzoEDBjwycpXt3LBE061wT9f46szXGHAmj9uoP6fU= -github.com/ipld/go-ipld-prime-proto v0.0.0-20200428191222-c1ffdadc01e1/go.mod h1:OAV6xBmuTLsPZ+epzKkPB1e25FHk/vCtyatkdHcArLs= -github.com/ipld/go-ipld-prime-proto v0.0.0-20200922192210-9a2bfd4440a6/go.mod h1:3pHYooM9Ea65jewRwrb2u5uHZCNkNTe9ABsVB+SrkH0= -github.com/ipld/go-ipld-prime-proto v0.1.0/go.mod h1:11zp8f3sHVgIqtb/c9Kr5ZGqpnCLF1IVTNOez9TopzE= +github.com/ipld/go-ipld-prime/storage/bsadapter v0.0.0-20211210234204-ce2a1c70cd73/go.mod h1:2PJ0JgxyB08t0b2WKrcuqI3di0V+5n6RS/LTUJhkoxY= github.com/ipld/go-ipld-selector-text-lite v0.0.1 h1:lNqFsQpBHc3p5xHob2KvEg/iM5dIFn6iw4L/Hh+kS1Y= github.com/ipld/go-ipld-selector-text-lite v0.0.1/go.mod h1:U2CQmFb+uWzfIEF3I1arrDa5rwtj00PrpiwwCO+k1RM= github.com/ipsn/go-secp256k1 v0.0.0-20180726113642-9d62b9f0bc52 h1:QG4CGBqCeuBo6aZlGAamSkxWdgWfZGeE49eUOWJPA4c= @@ -1045,6 +1017,7 @@ 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/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= github.com/jonboulle/clockwork v0.2.0/go.mod h1:Pkfl5aHPm1nk2H9h0bjmnJD/BcgbGXUBGnn1kMkgxc8= +github.com/jonboulle/clockwork v0.2.2/go.mod h1:Pkfl5aHPm1nk2H9h0bjmnJD/BcgbGXUBGnn1kMkgxc8= 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= @@ -1091,7 +1064,6 @@ github.com/klauspost/compress v1.13.6 h1:P76CopJELS0TiO2mebmnzgWaajssP/EszplttgQ github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= github.com/klauspost/cpuid/v2 v2.0.4/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= github.com/klauspost/cpuid/v2 v2.0.6/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= -github.com/klauspost/cpuid/v2 v2.0.8/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= github.com/klauspost/cpuid/v2 v2.0.9 h1:lgaqFMSdTdQYdZ04uHyN2d/eKdOMyi2YLSvlQIBFYa4= github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= @@ -1132,13 +1104,15 @@ github.com/libp2p/go-addr-util v0.1.0/go.mod h1:6I3ZYuFr2O/9D+SoyM0zEw0EF3YkldtT github.com/libp2p/go-buffer-pool v0.0.1/go.mod h1:xtyIz9PMobb13WaxR6Zo1Pd1zXJKYg0a8KiIvDp3TzQ= github.com/libp2p/go-buffer-pool v0.0.2 h1:QNK2iAFa8gjAe1SPz6mHSMuCcjs+X1wlHzeOSqcmlfs= github.com/libp2p/go-buffer-pool v0.0.2/go.mod h1:MvaB6xw5vOrDl8rYZGLFdKAuk/hRoRZd1Vi32+RXyFM= +github.com/libp2p/go-cidranger v1.1.0 h1:ewPN8EZ0dd1LSnrtuwd4709PXVcITVeuwbag38yPW7c= github.com/libp2p/go-cidranger v1.1.0/go.mod h1:KWZTfSr+r9qEo9OkI9/SIEeAtw+NNoU0dXIXt15Okic= github.com/libp2p/go-conn-security v0.0.1/go.mod h1:bGmu51N0KU9IEjX7kl2PQjgZa40JQWnayTvNMgD/vyk= github.com/libp2p/go-conn-security-multistream v0.0.2/go.mod h1:nc9vud7inQ+d6SO0I/6dSWrdMnHnzZNHeyUQqrAJulE= github.com/libp2p/go-conn-security-multistream v0.1.0/go.mod h1:aw6eD7LOsHEX7+2hJkDxw1MteijaVcI+/eP2/x3J1xc= github.com/libp2p/go-conn-security-multistream v0.2.0/go.mod h1:hZN4MjlNetKD3Rq5Jb/P5ohUnFLNzEAR4DLSzpn2QLU= -github.com/libp2p/go-conn-security-multistream v0.2.1 h1:ft6/POSK7F+vl/2qzegnHDaXFU0iWB4yVTYrioC6Zy0= github.com/libp2p/go-conn-security-multistream v0.2.1/go.mod h1:cR1d8gA0Hr59Fj6NhaTpFhJZrjSYuNmhpT2r25zYR70= +github.com/libp2p/go-conn-security-multistream v0.3.0 h1:9UCIKlBL1hC9u7nkMXpD1nkc/T53PKMAn3/k9ivBAVc= +github.com/libp2p/go-conn-security-multistream v0.3.0/go.mod h1:EEP47t4fw/bTelVmEzIDqSe69hO/ip52xBEhZMLWAHM= github.com/libp2p/go-eventbus v0.0.2/go.mod h1:Hr/yGlwxA/stuLnpMiu82lpNKpvRy3EaJxPu40XYOwk= github.com/libp2p/go-eventbus v0.1.0/go.mod h1:vROgu5cs5T7cv7POWlWxBaVLxfSegC5UGQf8A2eEmx4= github.com/libp2p/go-eventbus v0.2.1 h1:VanAdErQnpTioN2TowqNcOijf6YwhuODe4pPKSDpxGc= @@ -1152,22 +1126,20 @@ github.com/libp2p/go-libp2p v0.1.0/go.mod h1:6D/2OBauqLUoqcADOJpn9WbKqvaM07tDw68 github.com/libp2p/go-libp2p v0.1.1/go.mod h1:I00BRo1UuUSdpuc8Q2mN7yDF/oTUTRAX6JWpTiK9Rp8= github.com/libp2p/go-libp2p v0.3.1/go.mod h1:e6bwxbdYH1HqWTz8faTChKGR0BjPc8p+6SyP8GTTR7Y= github.com/libp2p/go-libp2p v0.4.0/go.mod h1:9EsEIf9p2UDuwtPd0DwJsAl0qXVxgAnuDGRvHbfATfI= -github.com/libp2p/go-libp2p v0.6.0/go.mod h1:mfKWI7Soz3ABX+XEBR61lGbg+ewyMtJHVt043oWeqwg= github.com/libp2p/go-libp2p v0.6.1/go.mod h1:CTFnWXogryAHjXAKEbOf1OWY+VeAP3lDMZkfEI5sT54= github.com/libp2p/go-libp2p v0.7.0/go.mod h1:hZJf8txWeCduQRDC/WSqBGMxaTHCOYHt2xSU1ivxn0k= github.com/libp2p/go-libp2p v0.7.4/go.mod h1:oXsBlTLF1q7pxr+9w6lqzS1ILpyHsaBPniVO7zIHGMw= github.com/libp2p/go-libp2p v0.8.1/go.mod h1:QRNH9pwdbEBpx5DTJYg+qxcVaDMAz3Ee/qDKwXujH5o= github.com/libp2p/go-libp2p v0.8.3/go.mod h1:EsH1A+8yoWK+L4iKcbPYu6MPluZ+CHWI9El8cTaefiM= github.com/libp2p/go-libp2p v0.9.2/go.mod h1:cunHNLDVus66Ct9iXXcjKRLdmHdFdHVe1TAnbubJQqQ= -github.com/libp2p/go-libp2p v0.10.0/go.mod h1:yBJNpb+mGJdgrwbKAKrhPU0u3ogyNFTfjJ6bdM+Q/G8= -github.com/libp2p/go-libp2p v0.12.0/go.mod h1:FpHZrfC1q7nA8jitvdjKBDF31hguaC676g/nT9PgQM0= -github.com/libp2p/go-libp2p v0.13.0/go.mod h1:pM0beYdACRfHO1WcJlp65WXyG2A6NqYM+t2DTVAJxMo= -github.com/libp2p/go-libp2p v0.14.0/go.mod h1:dsQrWLAoIn+GkHPN/U+yypizkHiB9tnv79Os+kSgQ4Q= -github.com/libp2p/go-libp2p v0.14.2/go.mod h1:0PQMADQEjCM2l8cSMYDpTgsb8gr6Zq7i4LUgq1mlW2E= +github.com/libp2p/go-libp2p v0.14.3/go.mod h1:d12V4PdKbpL0T1/gsUNN8DfgMuRPDX8bS2QxCZlwRH0= github.com/libp2p/go-libp2p v0.14.4/go.mod h1:EIRU0Of4J5S8rkockZM7eJp2S0UrCyi55m2kJVru3rM= -github.com/libp2p/go-libp2p v0.15.0 h1:jbMbdmtizfpvl1+oQuGJzfGhttAtuxUCavF3enwFncg= -github.com/libp2p/go-libp2p v0.15.0/go.mod h1:8Ljmwon0cZZYKrOCjFeLwQEK8bqR42dOheUZ1kSKhP0= +github.com/libp2p/go-libp2p v0.16.0/go.mod h1:ump42BsirwAWxKzsCiFnTtN1Yc+DuPu76fyMX364/O4= +github.com/libp2p/go-libp2p v0.17.0 h1:8l4GV401OSd4dFRyHDtIT/mEzdh/aQGoFC8xshYgm5M= +github.com/libp2p/go-libp2p v0.17.0/go.mod h1:Fkin50rsGdv5mm5BshBUtPRZknt9esfmYXBOYcwOTgw= github.com/libp2p/go-libp2p-asn-util v0.0.0-20200825225859-85005c6cf052/go.mod h1:nRMRTab+kZuk0LnKZpxhOVH/ndsdr2Nr//Zltc/vwgo= +github.com/libp2p/go-libp2p-asn-util v0.1.0 h1:rABPCO77SjdbJ/eJ/ynIo8vWICy1VEnL5JAxJbQLo1E= +github.com/libp2p/go-libp2p-asn-util v0.1.0/go.mod h1:wu+AnM9Ii2KgO5jMmS1rz9dvzTdj8BXqsPR9HR0XB7I= github.com/libp2p/go-libp2p-autonat v0.0.6/go.mod h1:uZneLdOkZHro35xIhpbtTzLlgYturpu4J5+0cZK3MqE= github.com/libp2p/go-libp2p-autonat v0.1.0/go.mod h1:1tLf2yXxiE/oKGtDwPYWTSYG3PtvYlJmg7NeVtPRqH8= github.com/libp2p/go-libp2p-autonat v0.1.1/go.mod h1:OXqkeGOY2xJVWKAGV2inNF5aKN/djNA3fdpCWloIudE= @@ -1175,17 +1147,19 @@ github.com/libp2p/go-libp2p-autonat v0.2.0/go.mod h1:DX+9teU4pEEoZUqR1PiMlqliONQ github.com/libp2p/go-libp2p-autonat v0.2.1/go.mod h1:MWtAhV5Ko1l6QBsHQNSuM6b1sRkXrpk0/LqCr+vCVxI= github.com/libp2p/go-libp2p-autonat v0.2.2/go.mod h1:HsM62HkqZmHR2k1xgX34WuWDzk/nBwNHoeyyT4IWV6A= github.com/libp2p/go-libp2p-autonat v0.2.3/go.mod h1:2U6bNWCNsAG9LEbwccBDQbjzQ8Krdjge1jLTE9rdoMM= -github.com/libp2p/go-libp2p-autonat v0.4.0/go.mod h1:YxaJlpr81FhdOv3W3BTconZPfhaYivRdf53g+S2wobk= -github.com/libp2p/go-libp2p-autonat v0.4.2 h1:YMp7StMi2dof+baaxkbxaizXjY1RPvU71CXfxExzcUU= github.com/libp2p/go-libp2p-autonat v0.4.2/go.mod h1:YxaJlpr81FhdOv3W3BTconZPfhaYivRdf53g+S2wobk= +github.com/libp2p/go-libp2p-autonat v0.6.0/go.mod h1:bFC6kY8jwzNNWoqc8iGE57vsfwyJ/lP4O4DOV1e0B2o= +github.com/libp2p/go-libp2p-autonat v0.7.0 h1:rCP5s+A2dlhM1Xd66wurE0k7S7pPmM0D+FlqqSBXxks= +github.com/libp2p/go-libp2p-autonat v0.7.0/go.mod h1:uPvPn6J7cN+LCfFwW5tpOYvAz5NvPTc4iBamTV/WDMg= github.com/libp2p/go-libp2p-autonat-svc v0.1.0/go.mod h1:fqi8Obl/z3R4PFVLm8xFtZ6PBL9MlV/xumymRFkKq5A= github.com/libp2p/go-libp2p-blankhost v0.0.1/go.mod h1:Ibpbw/7cPPYwFb7PACIWdvxxv0t0XCCI10t7czjAjTc= github.com/libp2p/go-libp2p-blankhost v0.1.1/go.mod h1:pf2fvdLJPsC1FsVrNP3DUUvMzUts2dsLLBEpo1vW1ro= github.com/libp2p/go-libp2p-blankhost v0.1.3/go.mod h1:KML1//wiKR8vuuJO0y3LUd1uLv+tlkGTAr3jC0S5cLg= github.com/libp2p/go-libp2p-blankhost v0.1.4/go.mod h1:oJF0saYsAXQCSfDq254GMNmLNz6ZTHTOvtF4ZydUvwU= github.com/libp2p/go-libp2p-blankhost v0.1.6/go.mod h1:jONCAJqEP+Z8T6EQviGL4JsQcLx1LgTGtVqFNY8EMfQ= -github.com/libp2p/go-libp2p-blankhost v0.2.0 h1:3EsGAi0CBGcZ33GwRuXEYJLLPoVWyXJ1bcJzAJjINkk= github.com/libp2p/go-libp2p-blankhost v0.2.0/go.mod h1:eduNKXGTioTuQAUcZ5epXi9vMl+t4d8ugUBRQ4SqaNQ= +github.com/libp2p/go-libp2p-blankhost v0.3.0 h1:kTnLArltMabZlzY63pgGDA4kkUcLkBFSM98zBssn/IY= +github.com/libp2p/go-libp2p-blankhost v0.3.0/go.mod h1:urPC+7U01nCGgJ3ZsV8jdwTp6Ji9ID0dMTvq+aJ+nZU= github.com/libp2p/go-libp2p-circuit v0.0.9/go.mod h1:uU+IBvEQzCu953/ps7bYzC/D/R0Ho2A9LfKVVCatlqU= github.com/libp2p/go-libp2p-circuit v0.1.0/go.mod h1:Ahq4cY3V9VJcHcn1SBXjr78AbFkZeIRmfunbA7pmFh8= github.com/libp2p/go-libp2p-circuit v0.1.1/go.mod h1:Ahq4cY3V9VJcHcn1SBXjr78AbFkZeIRmfunbA7pmFh8= @@ -1193,12 +1167,12 @@ github.com/libp2p/go-libp2p-circuit v0.1.3/go.mod h1:Xqh2TjSy8DD5iV2cCOMzdynd6h8 github.com/libp2p/go-libp2p-circuit v0.1.4/go.mod h1:CY67BrEjKNDhdTk8UgBX1Y/H5c3xkAcs3gnksxY7osU= github.com/libp2p/go-libp2p-circuit v0.2.1/go.mod h1:BXPwYDN5A8z4OEY9sOfr2DUQMLQvKt/6oku45YUmjIo= github.com/libp2p/go-libp2p-circuit v0.2.2/go.mod h1:nkG3iE01tR3FoQ2nMm06IUrCpCyJp1Eo4A1xYdpjfs4= -github.com/libp2p/go-libp2p-circuit v0.2.3/go.mod h1:nkG3iE01tR3FoQ2nMm06IUrCpCyJp1Eo4A1xYdpjfs4= github.com/libp2p/go-libp2p-circuit v0.4.0/go.mod h1:t/ktoFIUzM6uLQ+o1G6NuBl2ANhBKN9Bc8jRIk31MoA= github.com/libp2p/go-libp2p-connmgr v0.1.1/go.mod h1:wZxh8veAmU5qdrfJ0ZBLcU8oJe9L82ciVP/fl1VHjXk= github.com/libp2p/go-libp2p-connmgr v0.2.3/go.mod h1:Gqjg29zI8CwXX21zRxy6gOg8VYu3zVerJRt2KyktzH4= -github.com/libp2p/go-libp2p-connmgr v0.2.4 h1:TMS0vc0TCBomtQJyWr7fYxcVYYhx+q/2gF++G5Jkl/w= github.com/libp2p/go-libp2p-connmgr v0.2.4/go.mod h1:YV0b/RIm8NGPnnNWM7hG9Q38OeQiQfKhHCCs1++ufn0= +github.com/libp2p/go-libp2p-connmgr v0.3.0 h1:yerFXrYa0oxpuVsLlndwm/bLulouHYDcvFrY/4H4fx8= +github.com/libp2p/go-libp2p-connmgr v0.3.0/go.mod h1:RVoyPjJm0J9Vd1m6qUN2Tn7kJm4rL1Ml20pFsFgPGik= github.com/libp2p/go-libp2p-core v0.0.1/go.mod h1:g/VxnTZ/1ygHxH3dKok7Vno1VfpvGcGip57wjTU4fco= github.com/libp2p/go-libp2p-core v0.0.2/go.mod h1:9dAcntw/n46XycV4RnlBq3BpgrmyUi9LuoTNdPrbUco= github.com/libp2p/go-libp2p-core v0.0.3/go.mod h1:j+YQMNz9WNSkNezXOsahp9kwZBKBvxLpKD316QWSJXE= @@ -1228,8 +1202,12 @@ github.com/libp2p/go-libp2p-core v0.8.1/go.mod h1:FfewUH/YpvWbEB+ZY9AQRQ4TAD8sJB github.com/libp2p/go-libp2p-core v0.8.2/go.mod h1:FfewUH/YpvWbEB+ZY9AQRQ4TAD8sJBt/G1rVvhz5XT8= github.com/libp2p/go-libp2p-core v0.8.5/go.mod h1:FfewUH/YpvWbEB+ZY9AQRQ4TAD8sJBt/G1rVvhz5XT8= github.com/libp2p/go-libp2p-core v0.8.6/go.mod h1:dgHr0l0hIKfWpGpqAMbpo19pen9wJfdCGv51mTmdpmM= -github.com/libp2p/go-libp2p-core v0.9.0 h1:t97Mv0LIBZlP2FXVRNKKVzHJCIjbIWGxYptGId4+htU= github.com/libp2p/go-libp2p-core v0.9.0/go.mod h1:ESsbz31oC3C1AvMJoGx26RTuCkNhmkSRCqZ0kQtJ2/8= +github.com/libp2p/go-libp2p-core v0.10.0/go.mod h1:ECdxehoYosLYHgDDFa2N4yE8Y7aQRAMf0sX9mf2sbGg= +github.com/libp2p/go-libp2p-core v0.11.0/go.mod h1:ECdxehoYosLYHgDDFa2N4yE8Y7aQRAMf0sX9mf2sbGg= +github.com/libp2p/go-libp2p-core v0.12.0/go.mod h1:ECdxehoYosLYHgDDFa2N4yE8Y7aQRAMf0sX9mf2sbGg= +github.com/libp2p/go-libp2p-core v0.13.0 h1:IFG/s8dN6JN2OTrXX9eq2wNU/Zlz2KLdwZUp5FplgXI= +github.com/libp2p/go-libp2p-core v0.13.0/go.mod h1:ECdxehoYosLYHgDDFa2N4yE8Y7aQRAMf0sX9mf2sbGg= github.com/libp2p/go-libp2p-crypto v0.0.1/go.mod h1:yJkNyDmO341d5wwXxDUGO0LykUVT72ImHNUqh5D/dBE= github.com/libp2p/go-libp2p-crypto v0.0.2/go.mod h1:eETI5OUfBnvARGOHrJz2eWNyTUxEGZnBxMcbUjfIj4I= github.com/libp2p/go-libp2p-crypto v0.1.0/go.mod h1:sPUokVISZiy+nNuTTH/TY+leRSxnFj/2GLjtOTW90hI= @@ -1240,8 +1218,8 @@ github.com/libp2p/go-libp2p-discovery v0.2.0/go.mod h1:s4VGaxYMbw4+4+tsoQTqh7wfx github.com/libp2p/go-libp2p-discovery v0.3.0/go.mod h1:o03drFnz9BVAZdzC/QUQ+NeQOu38Fu7LJGEOK2gQltw= github.com/libp2p/go-libp2p-discovery v0.4.0/go.mod h1:bZ0aJSrFc/eX2llP0ryhb1kpgkPyTo23SJ5b7UQCMh4= github.com/libp2p/go-libp2p-discovery v0.5.0/go.mod h1:+srtPIU9gDaBNu//UHvcdliKBIcr4SfDcm0/PfPJLug= -github.com/libp2p/go-libp2p-discovery v0.5.1 h1:CJylx+h2+4+s68GvrM4pGNyfNhOYviWBPtVv5PA7sfo= -github.com/libp2p/go-libp2p-discovery v0.5.1/go.mod h1:+srtPIU9gDaBNu//UHvcdliKBIcr4SfDcm0/PfPJLug= +github.com/libp2p/go-libp2p-discovery v0.6.0 h1:1XdPmhMJr8Tmj/yUfkJMIi8mgwWrLUsCB3bMxdT+DSo= +github.com/libp2p/go-libp2p-discovery v0.6.0/go.mod h1:/u1voHt0tKIe5oIA1RHBKQLVCWPna2dXmPNHc2zR9S8= github.com/libp2p/go-libp2p-host v0.0.1/go.mod h1:qWd+H1yuU0m5CwzAkvbSjqKairayEHdR5MMl7Cwa7Go= github.com/libp2p/go-libp2p-host v0.0.3/go.mod h1:Y/qPyA6C8j2coYyos1dfRm0I8+nvd4TGrDGt4tA7JR8= github.com/libp2p/go-libp2p-interface-connmgr v0.0.1/go.mod h1:GarlRLH0LdeWcLnYM/SaBykKFl9U5JFnbBGruAk/D5k= @@ -1249,8 +1227,7 @@ github.com/libp2p/go-libp2p-interface-connmgr v0.0.4/go.mod h1:GarlRLH0LdeWcLnYM github.com/libp2p/go-libp2p-interface-connmgr v0.0.5/go.mod h1:GarlRLH0LdeWcLnYM/SaBykKFl9U5JFnbBGruAk/D5k= github.com/libp2p/go-libp2p-interface-pnet v0.0.1/go.mod h1:el9jHpQAXK5dnTpKA4yfCNBZXvrzdOU75zz+C6ryp3k= github.com/libp2p/go-libp2p-kad-dht v0.2.1/go.mod h1:k7ONOlup7HKzQ68dE6lSnp07cdxdkmnRa+6B4Fh9/w0= -github.com/libp2p/go-libp2p-kad-dht v0.11.0/go.mod h1:5ojtR2acDPqh/jXf5orWy8YGb8bHQDS+qeDcoscL/PI= -github.com/libp2p/go-libp2p-kad-dht v0.13.0/go.mod h1:NkGf28RNhPrcsGYWJHm6EH8ULkiJ2qxsWmpE7VTL3LI= +github.com/libp2p/go-libp2p-kad-dht v0.15.0/go.mod h1:rZtPxYu1TnHHz6n1RggdGrxUX/tA1C2/Wiw3ZMUDrU0= github.com/libp2p/go-libp2p-kbucket v0.2.1/go.mod h1:/Rtu8tqbJ4WQ2KTCOMJhggMukOLNLNPY1EtEWWLxUvc= github.com/libp2p/go-libp2p-kbucket v0.3.1/go.mod h1:oyjT5O7tS9CQurok++ERgc46YLwEpuGoFq9ubvoUOio= github.com/libp2p/go-libp2p-kbucket v0.4.7/go.mod h1:XyVo99AfQH0foSf176k4jY1xUJ2+jUJIZCSDm7r2YKk= @@ -1263,13 +1240,13 @@ github.com/libp2p/go-libp2p-mplex v0.2.0/go.mod h1:Ejl9IyjvXJ0T9iqUTE1jpYATQ9NM3 github.com/libp2p/go-libp2p-mplex v0.2.1/go.mod h1:SC99Rxs8Vuzrf/6WhmH41kNn13TiYdAWNYHrwImKLnE= github.com/libp2p/go-libp2p-mplex v0.2.2/go.mod h1:74S9eum0tVQdAfFiKxAyKzNdSuLqw5oadDq7+L/FELo= github.com/libp2p/go-libp2p-mplex v0.2.3/go.mod h1:CK3p2+9qH9x+7ER/gWWDYJ3QW5ZxWDkm+dVvjfuG3ek= -github.com/libp2p/go-libp2p-mplex v0.3.0/go.mod h1:l9QWxRbbb5/hQMECEb908GbS9Sm2UAR2KFZKUJEynEs= github.com/libp2p/go-libp2p-mplex v0.4.0/go.mod h1:yCyWJE2sc6TBTnFpjvLuEJgTSw/u+MamvzILKdX7asw= github.com/libp2p/go-libp2p-mplex v0.4.1/go.mod h1:cmy+3GfqfM1PceHTLL7zQzAAYaryDu6iPSC+CIb094g= github.com/libp2p/go-libp2p-nat v0.0.4/go.mod h1:N9Js/zVtAXqaeT99cXgTV9e75KpnWCvVOiGzlcHmBbY= github.com/libp2p/go-libp2p-nat v0.0.5/go.mod h1:1qubaE5bTZMJE+E/uu2URroMbzdubFz1ChgiN79yKPE= -github.com/libp2p/go-libp2p-nat v0.0.6 h1:wMWis3kYynCbHoyKLPBEMu4YRLltbm8Mk08HGSfvTkU= github.com/libp2p/go-libp2p-nat v0.0.6/go.mod h1:iV59LVhB3IkFvS6S6sauVTSOrNEANnINbI/fkaLimiw= +github.com/libp2p/go-libp2p-nat v0.1.0 h1:vigUi2MEN+fwghe5ijpScxtbbDz+L/6y8XwlzYOJgSY= +github.com/libp2p/go-libp2p-nat v0.1.0/go.mod h1:DQzAG+QbDYjN1/C3B6vXucLtz3u9rEonLVPtZVzQqks= github.com/libp2p/go-libp2p-net v0.0.1/go.mod h1:Yt3zgmlsHOgUWSXmt5V/Jpz9upuJBE8EgNU9DrCcR8c= github.com/libp2p/go-libp2p-net v0.0.2/go.mod h1:Yt3zgmlsHOgUWSXmt5V/Jpz9upuJBE8EgNU9DrCcR8c= github.com/libp2p/go-libp2p-netutil v0.0.1/go.mod h1:GdusFvujWZI9Vt0X5BKqwWWmZFxecf9Gt03cKxm2f/Q= @@ -1277,7 +1254,7 @@ github.com/libp2p/go-libp2p-netutil v0.1.0 h1:zscYDNVEcGxyUpMd0JReUZTrpMfia8PmLK github.com/libp2p/go-libp2p-netutil v0.1.0/go.mod h1:3Qv/aDqtMLTUyQeundkKsA+YCThNdbQD54k3TqjpbFU= github.com/libp2p/go-libp2p-noise v0.1.1/go.mod h1:QDFLdKX7nluB7DEnlVPbz7xlLHdwHFA9HiohJRr3vwM= github.com/libp2p/go-libp2p-noise v0.2.0/go.mod h1:IEbYhBBzGyvdLBoxxULL/SGbJARhUeqlO8lVSREYu2Q= -github.com/libp2p/go-libp2p-noise v0.2.2/go.mod h1:IEbYhBBzGyvdLBoxxULL/SGbJARhUeqlO8lVSREYu2Q= +github.com/libp2p/go-libp2p-noise v0.3.0/go.mod h1:JNjHbociDJKHD64KTkzGnzqJ0FEV5gHJa6AB00kbCNQ= github.com/libp2p/go-libp2p-peer v0.0.1/go.mod h1:nXQvOBbwVqoP+T5Y5nCjeH4sP9IX/J0AMzcDUVruVoo= github.com/libp2p/go-libp2p-peer v0.1.1/go.mod h1:jkF12jGB4Gk/IOo+yomm+7oLWxF278F7UnrYUQ1Q8es= github.com/libp2p/go-libp2p-peer v0.2.0/go.mod h1:RCffaCvUyW2CJmG2gAWVqwePwW7JMgxjsHm7+J5kjWY= @@ -1294,22 +1271,24 @@ github.com/libp2p/go-libp2p-peerstore v0.2.4/go.mod h1:ss/TWTgHZTMpsU/oKVVPQCGuD github.com/libp2p/go-libp2p-peerstore v0.2.6/go.mod h1:ss/TWTgHZTMpsU/oKVVPQCGuDHItOpf2W8RxAi50P2s= github.com/libp2p/go-libp2p-peerstore v0.2.7/go.mod h1:ss/TWTgHZTMpsU/oKVVPQCGuDHItOpf2W8RxAi50P2s= github.com/libp2p/go-libp2p-peerstore v0.2.8/go.mod h1:gGiPlXdz7mIHd2vfAsHzBNAMqSDkt2UBFwgcITgw1lA= -github.com/libp2p/go-libp2p-peerstore v0.3.0 h1:wp/G0+37+GLr7tu+wE+4GWNrA3uxKg6IPRigIMSS5oQ= -github.com/libp2p/go-libp2p-peerstore v0.3.0/go.mod h1:fNX9WlOENMvdx/YD7YO/5Hkrn8+lQIk5A39BHa1HIrM= +github.com/libp2p/go-libp2p-peerstore v0.4.0/go.mod h1:rDJUFyzEWPpXpEwywkcTYYzDHlwza8riYMaUzaN6hX0= +github.com/libp2p/go-libp2p-peerstore v0.6.0 h1:HJminhQSGISBIRb93N6WK3t6Fa8OOTnHd/VBjL4mY5A= +github.com/libp2p/go-libp2p-peerstore v0.6.0/go.mod h1:DGEmKdXrcYpK9Jha3sS7MhqYdInxJy84bIPtSu65bKc= github.com/libp2p/go-libp2p-pnet v0.2.0 h1:J6htxttBipJujEjz1y0a5+eYoiPcFHhSYHH6na5f0/k= github.com/libp2p/go-libp2p-pnet v0.2.0/go.mod h1:Qqvq6JH/oMZGwqs3N1Fqhv8NVhrdYcO0BW4wssv21LA= github.com/libp2p/go-libp2p-protocol v0.0.1/go.mod h1:Af9n4PiruirSDjHycM1QuiMi/1VZNHYcK8cLgFJLZ4s= github.com/libp2p/go-libp2p-protocol v0.1.0/go.mod h1:KQPHpAabB57XQxGrXCNvbL6UEXfQqUgC/1adR2Xtflk= 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.4.2-0.20210212194758-6c1addf493eb/go.mod h1:izkeMLvz6Ht8yAISXjx60XUQZMq9ZMe5h2ih4dLIBIQ= -github.com/libp2p/go-libp2p-pubsub v0.5.6 h1:YkO3gG9J1mQBEMRrM5obiG3JD0L8RcrzIpoeLeiYqH8= -github.com/libp2p/go-libp2p-pubsub v0.5.6/go.mod h1:gVOzwebXVdSMDQBTfH8ACO5EJ4SQrvsHqCmYsCZpD0E= +github.com/libp2p/go-libp2p-pubsub v0.6.0 h1:98+RXuEWW17U6cAijK1yaTf6mw/B+n5yPA421z+dlo0= +github.com/libp2p/go-libp2p-pubsub v0.6.0/go.mod h1:nJv87QM2cU0w45KPR1rZicq+FmFIOD16zmT+ep1nOmg= github.com/libp2p/go-libp2p-quic-transport v0.1.1/go.mod h1:wqG/jzhF3Pu2NrhJEvE+IE0NTHNXslOPn9JQzyCAxzU= -github.com/libp2p/go-libp2p-quic-transport v0.5.0/go.mod h1:IEcuC5MLxvZ5KuHKjRu+dr3LjCT1Be3rcD/4d8JrX8M= github.com/libp2p/go-libp2p-quic-transport v0.10.0/go.mod h1:RfJbZ8IqXIhxBRm5hqUEJqjiiY8xmEuq3HUDS993MkA= -github.com/libp2p/go-libp2p-quic-transport v0.11.2 h1:p1YQDZRHH4Cv2LPtHubqlQ9ggz4CKng/REZuXZbZMhM= github.com/libp2p/go-libp2p-quic-transport v0.11.2/go.mod h1:wlanzKtIh6pHrq+0U3p3DY9PJfGqxMgPaGKaK5LifwQ= +github.com/libp2p/go-libp2p-quic-transport v0.13.0/go.mod h1:39/ZWJ1TW/jx1iFkKzzUg00W6tDJh73FC0xYudjr7Hc= +github.com/libp2p/go-libp2p-quic-transport v0.15.0/go.mod h1:wv4uGwjcqe8Mhjj7N/Ic0aKjA+/10UnMlSzLO0yRpYQ= +github.com/libp2p/go-libp2p-quic-transport v0.15.2 h1:wHBEceRy+1/8Ec8dAIyr+/P7L2YefIGprPVy5LrMM+k= +github.com/libp2p/go-libp2p-quic-transport v0.15.2/go.mod h1:wv4uGwjcqe8Mhjj7N/Ic0aKjA+/10UnMlSzLO0yRpYQ= github.com/libp2p/go-libp2p-record v0.0.1/go.mod h1:grzqg263Rug/sRex85QrDOLntdFAymLDLm7lxMgU79Q= github.com/libp2p/go-libp2p-record v0.1.0/go.mod h1:ujNc8iuE5dlKWVy6wuL6dd58t0n7xI4hAIl8pE6wu5Q= github.com/libp2p/go-libp2p-record v0.1.1/go.mod h1:VRgKajOyMVgP/F0L5g3kH7SVskp17vFi2xheb5uMJtg= @@ -1330,14 +1309,13 @@ github.com/libp2p/go-libp2p-swarm v0.2.1/go.mod h1:x07b4zkMFo2EvgPV2bMTlNmdQc8i+ github.com/libp2p/go-libp2p-swarm v0.2.2/go.mod h1:fvmtQ0T1nErXym1/aa1uJEyN7JzaTNyBcHImCxRpPKU= github.com/libp2p/go-libp2p-swarm v0.2.3/go.mod h1:P2VO/EpxRyDxtChXz/VPVXyTnszHvokHKRhfkEgFKNM= github.com/libp2p/go-libp2p-swarm v0.2.4/go.mod h1:/xIpHFPPh3wmSthtxdGbkHZ0OET1h/GGZes8Wku/M5Y= -github.com/libp2p/go-libp2p-swarm v0.2.7/go.mod h1:ZSJ0Q+oq/B1JgfPHJAT2HTall+xYRNYp1xs4S2FBWKA= github.com/libp2p/go-libp2p-swarm v0.2.8/go.mod h1:JQKMGSth4SMqonruY0a8yjlPVIkb0mdNSwckW7OYziM= github.com/libp2p/go-libp2p-swarm v0.3.0/go.mod h1:hdv95GWCTmzkgeJpP+GK/9D9puJegb7H57B5hWQR5Kk= -github.com/libp2p/go-libp2p-swarm v0.3.1/go.mod h1:hdv95GWCTmzkgeJpP+GK/9D9puJegb7H57B5hWQR5Kk= -github.com/libp2p/go-libp2p-swarm v0.4.0/go.mod h1:XVFcO52VoLoo0eitSxNQWYq4D6sydGOweTOAjJNraCw= github.com/libp2p/go-libp2p-swarm v0.5.0/go.mod h1:sU9i6BoHE0Ve5SKz3y9WfKrh8dUat6JknzUehFx8xW4= -github.com/libp2p/go-libp2p-swarm v0.5.3 h1:hsYaD/y6+kZff1o1Mc56NcuwSg80lIphTS/zDk3mO4M= github.com/libp2p/go-libp2p-swarm v0.5.3/go.mod h1:NBn7eNW2lu568L7Ns9wdFrOhgRlkRnIDg0FLKbuu3i8= +github.com/libp2p/go-libp2p-swarm v0.8.0/go.mod h1:sOMp6dPuqco0r0GHTzfVheVBh6UEL0L1lXUZ5ot2Fvc= +github.com/libp2p/go-libp2p-swarm v0.9.0 h1:LdWjHDVjPMYt3NCG2EHcQiIP8XzA8BHhHz8ZLAYol2Y= +github.com/libp2p/go-libp2p-swarm v0.9.0/go.mod h1:2f8d8uxTJmpeqHF/1ujjdXZp+98nNIbujVOMEZxCbZ8= github.com/libp2p/go-libp2p-testing v0.0.1/go.mod h1:gvchhf3FQOtBdr+eFUABet5a4MBLK8jM3V4Zghvmi+E= github.com/libp2p/go-libp2p-testing v0.0.2/go.mod h1:gvchhf3FQOtBdr+eFUABet5a4MBLK8jM3V4Zghvmi+E= github.com/libp2p/go-libp2p-testing v0.0.3/go.mod h1:gvchhf3FQOtBdr+eFUABet5a4MBLK8jM3V4Zghvmi+E= @@ -1347,22 +1325,26 @@ github.com/libp2p/go-libp2p-testing v0.1.1/go.mod h1:xaZWMJrPUM5GlDBxCeGUi7kI4eq github.com/libp2p/go-libp2p-testing v0.1.2-0.20200422005655-8775583591d8/go.mod h1:Qy8sAncLKpwXtS2dSnDOP8ktexIAHKu+J+pnZOFZLTc= github.com/libp2p/go-libp2p-testing v0.3.0/go.mod h1:efZkql4UZ7OVsEfaxNHZPzIehtsBXMrXnCfJIgDti5g= github.com/libp2p/go-libp2p-testing v0.4.0/go.mod h1:Q+PFXYoiYFN5CAEG2w3gLPEzotlKsNSbKQ/lImlOWF0= -github.com/libp2p/go-libp2p-testing v0.4.2 h1:IOiA5mMigi+eEjf4J+B7fepDhsjtsoWA9QbsCqbNp5U= github.com/libp2p/go-libp2p-testing v0.4.2/go.mod h1:Q+PFXYoiYFN5CAEG2w3gLPEzotlKsNSbKQ/lImlOWF0= +github.com/libp2p/go-libp2p-testing v0.5.0/go.mod h1:QBk8fqIL1XNcno/l3/hhaIEn4aLRijpYOR+zVjjlh+A= +github.com/libp2p/go-libp2p-testing v0.6.0 h1:tV/wz6mS1VoAYA/5DGTiyzw9TJ+eXMCMvzU5VPLJSgg= +github.com/libp2p/go-libp2p-testing v0.6.0/go.mod h1:QBk8fqIL1XNcno/l3/hhaIEn4aLRijpYOR+zVjjlh+A= github.com/libp2p/go-libp2p-tls v0.1.3/go.mod h1:wZfuewxOndz5RTnCAxFliGjvYSDA40sKitV4c50uI1M= -github.com/libp2p/go-libp2p-tls v0.2.0 h1:N8i5wPiHudA+02sfW85R2nUbybPm7agjAywZc6pd3xA= -github.com/libp2p/go-libp2p-tls v0.2.0/go.mod h1:twrp2Ci4lE2GYspA1AnlYm+boYjqVruxDKJJj7s6xrc= +github.com/libp2p/go-libp2p-tls v0.3.0/go.mod h1:fwF5X6PWGxm6IDRwF3V8AVCCj/hOd5oFlg+wo2FxJDY= +github.com/libp2p/go-libp2p-tls v0.3.1 h1:lsE2zYte+rZCEOHF72J1Fg3XK3dGQyKvI6i5ehJfEp0= +github.com/libp2p/go-libp2p-tls v0.3.1/go.mod h1:fwF5X6PWGxm6IDRwF3V8AVCCj/hOd5oFlg+wo2FxJDY= github.com/libp2p/go-libp2p-transport v0.0.1/go.mod h1:UzbUs9X+PHOSw7S3ZmeOxfnwaQY5vGDzZmKPod3N3tk= github.com/libp2p/go-libp2p-transport v0.0.5/go.mod h1:StoY3sx6IqsP6XKoabsPnHCwqKXWUMWU7Rfcsubee/A= github.com/libp2p/go-libp2p-transport-upgrader v0.0.4/go.mod h1:RGq+tupk+oj7PzL2kn/m1w6YXxcIAYJYeI90h6BGgUc= github.com/libp2p/go-libp2p-transport-upgrader v0.1.1/go.mod h1:IEtA6or8JUbsV07qPW4r01GnTenLW4oi3lOPbUMGJJA= github.com/libp2p/go-libp2p-transport-upgrader v0.2.0/go.mod h1:mQcrHj4asu6ArfSoMuyojOdjx73Q47cYD7s5+gZOlns= github.com/libp2p/go-libp2p-transport-upgrader v0.3.0/go.mod h1:i+SKzbRnvXdVbU3D1dwydnTmKRPXiAR/fyvi1dXuL4o= -github.com/libp2p/go-libp2p-transport-upgrader v0.4.0/go.mod h1:J4ko0ObtZSmgn5BX5AmegP+dK3CSnU2lMCKsSq/EY0s= github.com/libp2p/go-libp2p-transport-upgrader v0.4.2/go.mod h1:NR8ne1VwfreD5VIWIU62Agt/J18ekORFU/j1i2y8zvk= github.com/libp2p/go-libp2p-transport-upgrader v0.4.3/go.mod h1:bpkldbOWXMrXhpZbSV1mQxTrefOg2Fi+k1ClDSA4ppw= -github.com/libp2p/go-libp2p-transport-upgrader v0.4.6 h1:SHt3g0FslnqIkEWF25YOB8UCOCTpGAVvHRWQYJ+veiI= github.com/libp2p/go-libp2p-transport-upgrader v0.4.6/go.mod h1:JE0WQuQdy+uLZ5zOaI3Nw9dWGYJIA7mywEtP2lMvnyk= +github.com/libp2p/go-libp2p-transport-upgrader v0.5.0/go.mod h1:Rc+XODlB3yce7dvFV4q/RmyJGsFcCZRkeZMu/Zdg0mo= +github.com/libp2p/go-libp2p-transport-upgrader v0.6.0 h1:GfMCU+2aGGEm1zW3UcOz6wYSn8tXQalFfVfcww99i5A= +github.com/libp2p/go-libp2p-transport-upgrader v0.6.0/go.mod h1:1e07y1ZSZdHo9HPbuU8IztM1Cj+DR5twgycb4pnRzRo= github.com/libp2p/go-libp2p-xor v0.0.0-20210714161855-5c005aca55db/go.mod h1:LSTM5yRnjGZbWNTA/hRwq2gGFrvRIbQJscoIL/u6InY= github.com/libp2p/go-libp2p-yamux v0.1.2/go.mod h1:xUoV/RmYkg6BW/qGxA9XJyg+HzXFYkeXbnhjmnYzKp8= github.com/libp2p/go-libp2p-yamux v0.1.3/go.mod h1:VGSQVrqkh6y4nm0189qqxMtvyBft44MOYYPpYKXiVt4= @@ -1374,10 +1356,10 @@ github.com/libp2p/go-libp2p-yamux v0.2.7/go.mod h1:X28ENrBMU/nm4I3Nx4sZ4dgjZ6VhL github.com/libp2p/go-libp2p-yamux v0.2.8/go.mod h1:/t6tDqeuZf0INZMTgd0WxIRbtK2EzI2h7HbFm9eAKI4= github.com/libp2p/go-libp2p-yamux v0.4.0/go.mod h1:+DWDjtFMzoAwYLVkNZftoucn7PelNoy5nm3tZ3/Zw30= github.com/libp2p/go-libp2p-yamux v0.5.0/go.mod h1:AyR8k5EzyM2QN9Bbdg6X1SkVVuqLwTGf0L4DFq9g6po= -github.com/libp2p/go-libp2p-yamux v0.5.1/go.mod h1:dowuvDu8CRWmr0iqySMiSxK+W0iL5cMVO9S94Y6gkv4= -github.com/libp2p/go-libp2p-yamux v0.5.3/go.mod h1:Vy3TMonBAfTMXHWopsMc8iX/XGRYrRlpUaMzaeuHV/s= -github.com/libp2p/go-libp2p-yamux v0.5.4 h1:/UOPtT/6DHPtr3TtKXBHa6g0Le0szYuI33Xc/Xpd7fQ= github.com/libp2p/go-libp2p-yamux v0.5.4/go.mod h1:tfrXbyaTqqSU654GTvK3ocnSZL3BuHoeTSqhcel1wsE= +github.com/libp2p/go-libp2p-yamux v0.6.0/go.mod h1:MRhd6mAYnFRnSISp4M8i0ClV/j+mWHo2mYLifWGw33k= +github.com/libp2p/go-libp2p-yamux v0.7.0 h1:bVXHbTj/XH4uBBsPrg26BlDABk5WYRlssY73P0SjhPc= +github.com/libp2p/go-libp2p-yamux v0.7.0/go.mod h1:fMyA0CsPfHkIuBU0wjRGrCjTBFiXTXxG0k5M4ETv+08= github.com/libp2p/go-maddr-filter v0.0.1/go.mod h1:6eT12kSQMA9x2pvFQa+xesMKUBlj9VImZbj3B9FBH/Q= github.com/libp2p/go-maddr-filter v0.0.4/go.mod h1:6eT12kSQMA9x2pvFQa+xesMKUBlj9VImZbj3B9FBH/Q= github.com/libp2p/go-maddr-filter v0.0.5/go.mod h1:Jk+36PMfIqCJhAnaASRH83bdAvfDRp/w6ENFaC9bG+M= @@ -1393,12 +1375,14 @@ github.com/libp2p/go-mplex v0.3.0/go.mod h1:0Oy/A9PQlwBytDRp4wSkFnzHYDKcpLot35JQ github.com/libp2p/go-msgio v0.0.2/go.mod h1:63lBBgOTDKQL6EWazRMCwXsEeEeK9O2Cd+0+6OOuipQ= github.com/libp2p/go-msgio v0.0.3/go.mod h1:63lBBgOTDKQL6EWazRMCwXsEeEeK9O2Cd+0+6OOuipQ= github.com/libp2p/go-msgio v0.0.4/go.mod h1:63lBBgOTDKQL6EWazRMCwXsEeEeK9O2Cd+0+6OOuipQ= -github.com/libp2p/go-msgio v0.0.6 h1:lQ7Uc0kS1wb1EfRxO2Eir/RJoHkHn7t6o+EiwsYIKJA= github.com/libp2p/go-msgio v0.0.6/go.mod h1:4ecVB6d9f4BDSL5fqvPiC4A3KivjWn+Venn/1ALLMWA= +github.com/libp2p/go-msgio v0.1.0 h1:8Q7g/528ivAlfXTFWvWhVjTE8XG8sDTkRUKPYh9+5Q8= +github.com/libp2p/go-msgio v0.1.0/go.mod h1:eNlv2vy9V2X/kNldcZ+SShFE++o2Yjxwx6RAYsmgJnE= github.com/libp2p/go-nat v0.0.3/go.mod h1:88nUEt0k0JD45Bk93NIwDqjlhiOwOoV36GchpcVc1yI= github.com/libp2p/go-nat v0.0.4/go.mod h1:Nmw50VAvKuk38jUBcmNh6p9lUJLoODbJRvYAa/+KSDo= -github.com/libp2p/go-nat v0.0.5 h1:qxnwkco8RLKqVh1NmjQ+tJ8p8khNLFxuElYG/TwqW4Q= github.com/libp2p/go-nat v0.0.5/go.mod h1:B7NxsVNPZmRLvMOwiEO1scOSyjA56zxYAGv1yQgRkEU= +github.com/libp2p/go-nat v0.1.0 h1:MfVsH6DLcpa04Xr+p8hmVRG4juse0s3J8HyNWYHffXg= +github.com/libp2p/go-nat v0.1.0/go.mod h1:X7teVkwRHNInVNWQiO/tAiAVRwSr5zoRz4YSTC3uRBM= github.com/libp2p/go-netroute v0.1.2/go.mod h1:jZLDV+1PE8y5XxBySEBgbuVAXbhtuHSdmLPL2n9MKbk= github.com/libp2p/go-netroute v0.1.3/go.mod h1:jZLDV+1PE8y5XxBySEBgbuVAXbhtuHSdmLPL2n9MKbk= github.com/libp2p/go-netroute v0.1.5/go.mod h1:V1SR3AaECRkEQCoFFzYwVYWvYIEtlxx89+O3qcpCl4A= @@ -1411,13 +1395,15 @@ github.com/libp2p/go-openssl v0.0.5/go.mod h1:unDrJpgy3oFr+rqXsarWifmJuNnJR4chtO github.com/libp2p/go-openssl v0.0.7 h1:eCAzdLejcNVBzP/iZM9vqHnQm+XyCEbSSIheIPRGNsw= github.com/libp2p/go-openssl v0.0.7/go.mod h1:unDrJpgy3oFr+rqXsarWifmJuNnJR4chtO1HmaZjggc= github.com/libp2p/go-reuseport v0.0.1/go.mod h1:jn6RmB1ufnQwl0Q1f+YxAj8isJgDCQzaaxIFYDhcYEA= -github.com/libp2p/go-reuseport v0.0.2 h1:XSG94b1FJfGA01BUrT82imejHQyTxO4jEWqheyCXYvU= github.com/libp2p/go-reuseport v0.0.2/go.mod h1:SPD+5RwGC7rcnzngoYC86GjPzjSywuQyMVAheVBD9nQ= +github.com/libp2p/go-reuseport v0.1.0 h1:0ooKOx2iwyIkf339WCZ2HN3ujTDbkK0PjC7JVoP1AiM= +github.com/libp2p/go-reuseport v0.1.0/go.mod h1:bQVn9hmfcTaoo0c9v5pBhOarsU1eNOBZdaAd2hzXRKU= github.com/libp2p/go-reuseport-transport v0.0.2/go.mod h1:YkbSDrvjUVDL6b8XqriyA20obEtsW9BLkuOUyQAOCbs= github.com/libp2p/go-reuseport-transport v0.0.3/go.mod h1:Spv+MPft1exxARzP2Sruj2Wb5JSyHNncjf1Oi2dEbzM= github.com/libp2p/go-reuseport-transport v0.0.4/go.mod h1:trPa7r/7TJK/d+0hdBLOCGvpQQVOU74OXbNCIMkufGw= -github.com/libp2p/go-reuseport-transport v0.0.5 h1:lJzi+vSYbyJj2faPKLxNGWEIBcaV/uJmyvsUxXy2mLw= github.com/libp2p/go-reuseport-transport v0.0.5/go.mod h1:TC62hhPc8qs5c/RoXDZG6YmjK+/YWUPC0yYmeUecbjc= +github.com/libp2p/go-reuseport-transport v0.1.0 h1:C3PHeHjmnz8m6f0uydObj02tMEoi7CyD1zuN7xQT8gc= +github.com/libp2p/go-reuseport-transport v0.1.0/go.mod h1:vev0C0uMkzriDY59yFHD9v+ujJvYmDQVLowvAjEOmfw= github.com/libp2p/go-sockaddr v0.0.2/go.mod h1:syPvOmNs24S3dFVGJA1/mrqdeijPxLV2Le3BRLKd68k= github.com/libp2p/go-sockaddr v0.1.0/go.mod h1:syPvOmNs24S3dFVGJA1/mrqdeijPxLV2Le3BRLKd68k= github.com/libp2p/go-sockaddr v0.1.1 h1:yD80l2ZOdGksnOyHrhxDdTDFrf7Oy+v3FMVArIRgZxQ= @@ -1432,11 +1418,11 @@ github.com/libp2p/go-tcp-transport v0.0.4/go.mod h1:+E8HvC8ezEVOxIo3V5vCK9l1y/19 github.com/libp2p/go-tcp-transport v0.1.0/go.mod h1:oJ8I5VXryj493DEJ7OsBieu8fcg2nHGctwtInJVpipc= github.com/libp2p/go-tcp-transport v0.1.1/go.mod h1:3HzGvLbx6etZjnFlERyakbaYPdfjg2pWP97dFZworkY= github.com/libp2p/go-tcp-transport v0.2.0/go.mod h1:vX2U0CnWimU4h0SGSEsg++AzvBcroCGYw28kh94oLe0= -github.com/libp2p/go-tcp-transport v0.2.1/go.mod h1:zskiJ70MEfWz2MKxvFB/Pv+tPIB1PpPUrHIWQ8aFw7M= +github.com/libp2p/go-tcp-transport v0.2.3/go.mod h1:9dvr03yqrPyYGIEN6Dy5UvdJZjyPFvl1S/igQ5QD1SU= github.com/libp2p/go-tcp-transport v0.2.4/go.mod h1:9dvr03yqrPyYGIEN6Dy5UvdJZjyPFvl1S/igQ5QD1SU= github.com/libp2p/go-tcp-transport v0.2.7/go.mod h1:lue9p1b3VmZj1MhhEGB/etmvF/nBQ0X9CW2DutBT3MM= -github.com/libp2p/go-tcp-transport v0.2.8 h1:aLjX+Nkz+kIz3uA56WtlGKRSAnKDvnqKmv1qF4EyyE4= -github.com/libp2p/go-tcp-transport v0.2.8/go.mod h1:64rSfVidkYPLqbzpcN2IwHY4pmgirp67h++hZ/rcndQ= +github.com/libp2p/go-tcp-transport v0.4.0 h1:VDyg4j6en3OuXf90gfDQh5Sy9KowO9udnd0OU8PP6zg= +github.com/libp2p/go-tcp-transport v0.4.0/go.mod h1:0y52Rwrn4076xdJYu/51/qJIdxz+EWDAOG2S45sV3VI= github.com/libp2p/go-testutil v0.0.1/go.mod h1:iAcJc/DKJQanJ5ws2V+u5ywdL2n12X1WbbEG+Jjy69I= github.com/libp2p/go-testutil v0.1.0/go.mod h1:81b2n5HypcVyrCg/MJx4Wgfp/VHojytjVe/gLzZ2Ehc= github.com/libp2p/go-ws-transport v0.0.5/go.mod h1:Qbl4BxPfXXhhd/o0wcrgoaItHqA9tnZjoFZnxykuaXU= @@ -1458,19 +1444,19 @@ github.com/libp2p/go-yamux v1.3.7/go.mod h1:fr7aVgmdNGJK+N1g+b6DW6VxzbRCjCOejR/h github.com/libp2p/go-yamux v1.4.0/go.mod h1:fr7aVgmdNGJK+N1g+b6DW6VxzbRCjCOejR/hkmpooHE= github.com/libp2p/go-yamux v1.4.1 h1:P1Fe9vF4th5JOxxgQvfbOHkrGqIZniTLf+ddhZp8YTI= github.com/libp2p/go-yamux v1.4.1/go.mod h1:fr7aVgmdNGJK+N1g+b6DW6VxzbRCjCOejR/hkmpooHE= -github.com/libp2p/go-yamux/v2 v2.0.0/go.mod h1:NVWira5+sVUIU6tu1JWvaRn1dRnG+cawOJiflsAM+7U= -github.com/libp2p/go-yamux/v2 v2.1.1/go.mod h1:3So6P6TV6r75R9jiBpiIKgU/66lOarCZjqROGxzPpPQ= -github.com/libp2p/go-yamux/v2 v2.2.0 h1:RwtpYZ2/wVviZ5+3pjC8qdQ4TKnrak0/E01N1UWoAFU= github.com/libp2p/go-yamux/v2 v2.2.0/go.mod h1:3So6P6TV6r75R9jiBpiIKgU/66lOarCZjqROGxzPpPQ= -github.com/libp2p/zeroconf/v2 v2.0.0/go.mod h1:J85R/d9joD8u8F9aHM8pBXygtG9W02enEwS+wWeL6yo= +github.com/libp2p/go-yamux/v2 v2.3.0 h1:luRV68GS1vqqr6EFUjtu1kr51d+IbW0gSowu8emYWAI= +github.com/libp2p/go-yamux/v2 v2.3.0/go.mod h1:iTU+lOIn/2h0AgKcL49clNTwfEw+WSfDYrXe05EyKIs= +github.com/libp2p/zeroconf/v2 v2.1.1/go.mod h1:fuJqLnUwZTshS3U/bMRJ3+ow/v9oid1n0DmyYyNO1Xs= github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= github.com/logrusorgru/aurora v0.0.0-20181002194514-a7b3b318ed4e/go.mod h1:7rIyQOR62GCctdiQpZ/zOJlFyk6y+94wXzv6RNZgaR4= github.com/lucas-clemente/quic-go v0.11.2/go.mod h1:PpMmPfPKO9nKJ/psF49ESTAGQSdfXxlg1otPbEB2nOw= -github.com/lucas-clemente/quic-go v0.16.0/go.mod h1:I0+fcNTdb9eS1ZcjQZbDVPGchJ86chcIxPALn9lEJqE= github.com/lucas-clemente/quic-go v0.19.3/go.mod h1:ADXpNbTQjq1hIzCpB+y/k5iz4n4z4IwqoLb94Kh5Hu8= -github.com/lucas-clemente/quic-go v0.21.2 h1:8LqqL7nBQFDUINadW0fHV/xSaCQJgmJC0Gv+qUnjd78= github.com/lucas-clemente/quic-go v0.21.2/go.mod h1:vF5M1XqhBAHgbjKcJOXY3JZz3GP0T3FQhz/uyOUS38Q= +github.com/lucas-clemente/quic-go v0.23.0/go.mod h1:paZuzjXCE5mj6sikVLMvqXk8lJV2AsqtJ6bDhjEfxx0= +github.com/lucas-clemente/quic-go v0.24.0 h1:ToR7SIIEdrgOhgVTHvPgdVRJfgVy+N0wQAagH7L4d5g= +github.com/lucas-clemente/quic-go v0.24.0/go.mod h1:paZuzjXCE5mj6sikVLMvqXk8lJV2AsqtJ6bDhjEfxx0= github.com/lucasb-eyer/go-colorful v1.0.3/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0= github.com/lufia/iostat v1.1.0/go.mod h1:rEPNA0xXgjHQjuI5Cy05sLlS2oRcSlWHRLrvh/AQ+Pg= github.com/lunixbochs/vtclean v1.0.0/go.mod h1:pHhQNgMf3btfWnGBVipUOjRYhoOsdGqdm/+2c2E2WMI= @@ -1487,19 +1473,17 @@ github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN github.com/mailru/easyjson v0.7.1/go.mod h1:KAzv3t3aY1NaHWoQz1+4F1ccyAH66Jk7yos7ldAVICs= github.com/mailru/easyjson v0.7.6/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= github.com/maratori/testpackage v1.0.1/go.mod h1:ddKdw+XG0Phzhx8BFDTKgpWP4i7MpApTE5fXSKAqwDU= -github.com/marten-seemann/qpack v0.1.0/go.mod h1:LFt1NU/Ptjip0C2CPkhimBz5CGE3WGDAUWqna+CNTrI= github.com/marten-seemann/qpack v0.2.1/go.mod h1:F7Gl5L1jIgN1D11ucXefiuJS9UMVP2opoCp2jDKb7wc= github.com/marten-seemann/qtls v0.2.3/go.mod h1:xzjG7avBwGGbdZ8dTGxlBnLArsVKLvwmjgmPuiQEcYk= -github.com/marten-seemann/qtls v0.9.1/go.mod h1:T1MmAdDPyISzxlK6kjRr0pcZFBVd1OZbBb/j3cvzHhk= github.com/marten-seemann/qtls v0.10.0/go.mod h1:UvMd1oaYDACI99/oZUYLzMCkBXQVT0aGm99sJhbT8hs= github.com/marten-seemann/qtls-go1-15 v0.1.1/go.mod h1:GyFwywLKkRt+6mfU99csTEY1joMZz5vmB1WNZH3P81I= github.com/marten-seemann/qtls-go1-15 v0.1.4/go.mod h1:GyFwywLKkRt+6mfU99csTEY1joMZz5vmB1WNZH3P81I= -github.com/marten-seemann/qtls-go1-15 v0.1.5 h1:Ci4EIUN6Rlb+D6GmLdej/bCQ4nPYNtVXQB+xjiXE1nk= github.com/marten-seemann/qtls-go1-15 v0.1.5/go.mod h1:GyFwywLKkRt+6mfU99csTEY1joMZz5vmB1WNZH3P81I= github.com/marten-seemann/qtls-go1-16 v0.1.4 h1:xbHbOGGhrenVtII6Co8akhLEdrawwB2iHl5yhJRpnco= github.com/marten-seemann/qtls-go1-16 v0.1.4/go.mod h1:gNpI2Ol+lRS3WwSOtIUUtRwZEQMXjYK+dQSBFbethAk= -github.com/marten-seemann/qtls-go1-17 v0.1.0-rc.1 h1:/rpmWuGvceLwwWuaKPdjpR4JJEUH0tq64/I3hvzaNLM= github.com/marten-seemann/qtls-go1-17 v0.1.0-rc.1/go.mod h1:fz4HIxByo+LlWcreM4CZOYNuz3taBQ8rN2X6FqvaWo8= +github.com/marten-seemann/qtls-go1-17 v0.1.0 h1:P9ggrs5xtwiqXv/FHNwntmuLMNq3KaSIG93AtAZ48xk= +github.com/marten-seemann/qtls-go1-17 v0.1.0/go.mod h1:fz4HIxByo+LlWcreM4CZOYNuz3taBQ8rN2X6FqvaWo8= github.com/marten-seemann/tcp v0.0.0-20210406111302-dfbc87cc63fd h1:br0buuQ854V8u83wA0rVZ8ttrq5CpaPZdvrK0LP2lOk= github.com/marten-seemann/tcp v0.0.0-20210406111302-dfbc87cc63fd/go.mod h1:QuCEs1Nt24+FYQEqAAncTDPJIuGs+LxK1MCiFL25pMU= github.com/matoous/godox v0.0.0-20210227103229-6504466cf951/go.mod h1:1BELzlh859Sh1c6+90blK8lbYy0kwQf1bYlBhBysy1s= @@ -1549,7 +1533,6 @@ github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3N github.com/miekg/dns v1.1.12/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= github.com/miekg/dns v1.1.26/go.mod h1:bPDLeHnStXmXAq1m/Ch/hvfNHr14JKNPMBo3VZKjuso= github.com/miekg/dns v1.1.28/go.mod h1:KNUDUusw/aVsxyTYZM1oqvCicbwhgbNgztCETuNZ7xM= -github.com/miekg/dns v1.1.31/go.mod h1:KNUDUusw/aVsxyTYZM1oqvCicbwhgbNgztCETuNZ7xM= github.com/miekg/dns v1.1.35/go.mod h1:KNUDUusw/aVsxyTYZM1oqvCicbwhgbNgztCETuNZ7xM= github.com/miekg/dns v1.1.41/go.mod h1:p6aan82bvRIyn+zDIv9xYNUpwa73JcSh9BKwknJysuI= github.com/miekg/dns v1.1.43 h1:JKfpVSCB84vrAmHzyrsxB5NAr5kLoMXZArPSw7Qlgyg= @@ -1636,8 +1619,6 @@ github.com/multiformats/go-multibase v0.0.2/go.mod h1:bja2MqRZ3ggyXtZSEDKpl0uO/g github.com/multiformats/go-multibase v0.0.3 h1:l/B6bJDQjvQ5G52jw4QGSYeOTZoAwIO77RblWplfIqk= github.com/multiformats/go-multibase v0.0.3/go.mod h1:5+1R4eQrT3PkYZ24C3W2Ue2tPwIdYQD509ZjSb5y9Oc= github.com/multiformats/go-multicodec v0.2.0/go.mod h1:/y4YVwkfMyry5kFbMTbLJKErhycTIftytRV+llXdyS4= -github.com/multiformats/go-multicodec v0.2.1-0.20210713081508-b421db6850ae/go.mod h1:qGGaQmioCDh+TeFOnxrbU0DaIPw8yFgAZgFG0V7p1qQ= -github.com/multiformats/go-multicodec v0.2.1-0.20210714093213-b2b5bd6fe68b/go.mod h1:qGGaQmioCDh+TeFOnxrbU0DaIPw8yFgAZgFG0V7p1qQ= github.com/multiformats/go-multicodec v0.3.0/go.mod h1:qGGaQmioCDh+TeFOnxrbU0DaIPw8yFgAZgFG0V7p1qQ= github.com/multiformats/go-multicodec v0.3.1-0.20210902112759-1539a079fd61 h1:ZrUuMKNgJ52qHPoQ+bx0h0uBfcWmN7Px+4uKSZeesiI= github.com/multiformats/go-multicodec v0.3.1-0.20210902112759-1539a079fd61/go.mod h1:1Hj/eHRaVWSXiSNNfcEPcwZleTmdNP81xlxDLnWU9GQ= @@ -1655,11 +1636,9 @@ github.com/multiformats/go-multistream v0.0.1/go.mod h1:fJTiDfXJVmItycydCnNx4+wS github.com/multiformats/go-multistream v0.0.4/go.mod h1:fJTiDfXJVmItycydCnNx4+wSzZ5NwG2FEVAI30fiovg= github.com/multiformats/go-multistream v0.1.0/go.mod h1:fJTiDfXJVmItycydCnNx4+wSzZ5NwG2FEVAI30fiovg= github.com/multiformats/go-multistream v0.1.1/go.mod h1:KmHZ40hzVxiaiwlj3MEbYgK9JFk2/9UktWZAF54Du38= -github.com/multiformats/go-multistream v0.2.0/go.mod h1:5GZPQZbkWOLOn3J2y4Y99vVW7vOfsAflxARk3x14o6k= github.com/multiformats/go-multistream v0.2.1/go.mod h1:5GZPQZbkWOLOn3J2y4Y99vVW7vOfsAflxARk3x14o6k= github.com/multiformats/go-multistream v0.2.2 h1:TCYu1BHTDr1F/Qm75qwYISQdzGcRdC21nFgQW7l7GBo= github.com/multiformats/go-multistream v0.2.2/go.mod h1:UIcnm7Zuo8HKG+HkWgfQsGL+/MIEhyTqbODbIUwSXKs= -github.com/multiformats/go-varint v0.0.2/go.mod h1:3Ls8CIEsrijN6+B7PbrXRPxHRPuXSrVKRY101jdMZYE= github.com/multiformats/go-varint v0.0.5/go.mod h1:3Ls8CIEsrijN6+B7PbrXRPxHRPuXSrVKRY101jdMZYE= github.com/multiformats/go-varint v0.0.6 h1:gk85QWKxh3TazbLxED/NlDVv8+q+ReFJk7Y2W/KhfNY= github.com/multiformats/go-varint v0.0.6/go.mod h1:3Ls8CIEsrijN6+B7PbrXRPxHRPuXSrVKRY101jdMZYE= @@ -1706,7 +1685,6 @@ github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+W github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.8.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.10.3/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.11.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.0/go.mod h1:oUhWkIvk5aDxtKvDDuw8gItl8pKl42LzjC9KZE0HfGg= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= @@ -1718,7 +1696,6 @@ github.com/onsi/gomega v1.4.1/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5 github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.5.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= -github.com/onsi/gomega v1.8.1/go.mod h1:Ho0h+IUsWyvy1OpqCwxlQ/21gkhVunqlU8fDGcoTdcA= github.com/onsi/gomega v1.9.0/go.mod h1:Ho0h+IUsWyvy1OpqCwxlQ/21gkhVunqlU8fDGcoTdcA= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/onsi/gomega v1.10.5/go.mod h1:gza4q3jKQJijlu05nKWRCW/GavJumGt8aNRxWg7mt48= @@ -1851,7 +1828,8 @@ github.com/quasilyte/go-ruleguard/rules v0.0.0-20210221215616-dfcc94e3dffd/go.mo github.com/quasilyte/regex/syntax v0.0.0-20200407221936-30656e2c4a95/go.mod h1:rlzQ04UMyJXu/aOvhd8qT+hvDrFpiwqp8MRXDY9szc0= github.com/raulk/clock v1.1.0 h1:dpb29+UKMbLqiU/jqIJptgLR1nn23HLgMY0sTCDza5Y= github.com/raulk/clock v1.1.0/go.mod h1:3MpVxdZ/ODBQDxbN+kzshf5OSZwPjtMDx6BBXBmOeY0= -github.com/raulk/go-watchdog v1.0.1/go.mod h1:lzSbAl5sh4rtI8tYHU01BWIDzgzqaQLj6RcA1i4mlqI= +github.com/raulk/go-watchdog v1.2.0 h1:konN75pw2BMmZ+AfuAm5rtFsWcJpKF3m02rKituuXNo= +github.com/raulk/go-watchdog v1.2.0/go.mod h1:lzSbAl5sh4rtI8tYHU01BWIDzgzqaQLj6RcA1i4mlqI= github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0 h1:OdAsTTz6OkFY5QxjkYwrChwuRruF69c169dPK26NUlk= github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= @@ -1976,7 +1954,6 @@ github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UV 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= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= @@ -2051,7 +2028,6 @@ github.com/whyrusleeping/cbor v0.0.0-20171005072247-63513f603b11 h1:5HZfQkwe0mIf github.com/whyrusleeping/cbor v0.0.0-20171005072247-63513f603b11/go.mod h1:Wlo/SzPmxVp6vXpGt/zaXhHH0fn4IxgqZc82aKg6bpQ= github.com/whyrusleeping/cbor-gen v0.0.0-20191216205031-b047b6acb3c0/go.mod h1:xdlJQaiqipF0HW+Mzpg7XRM3fWbGvfgFlcppuvlkIvY= github.com/whyrusleeping/cbor-gen v0.0.0-20200123233031-1cdf64d27158/go.mod h1:Xj/M2wWU+QdTdRbu/L/1dIZY8/Wb2K9pAhtroQuxJJI= -github.com/whyrusleeping/cbor-gen v0.0.0-20200402171437-3d27c146c105/go.mod h1:Xj/M2wWU+QdTdRbu/L/1dIZY8/Wb2K9pAhtroQuxJJI= github.com/whyrusleeping/cbor-gen v0.0.0-20200414195334-429a0b5e922e/go.mod h1:Xj/M2wWU+QdTdRbu/L/1dIZY8/Wb2K9pAhtroQuxJJI= github.com/whyrusleeping/cbor-gen v0.0.0-20200504204219-64967432584d/go.mod h1:W5MvapuoHRP8rz4vxjwCK1pDqF1aQcWsV5PZ+AHbqdg= github.com/whyrusleeping/cbor-gen v0.0.0-20200710004633-5379fc63235d/go.mod h1:fgkXqYy7bV2cFeIEOkVTZS/WjXARfBqSH6Q2qHL33hQ= @@ -2136,6 +2112,8 @@ go.opencensus.io v0.23.0 h1:gqCw0LfLxScz8irSi8exQc7fyQ0fKQU/qnC/X8+V/1M= go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= go.opentelemetry.io/otel v0.20.0/go.mod h1:Y3ugLH2oa81t5QO+Lty+zXf8zC9L26ax4Nzoxm/dooo= go.opentelemetry.io/otel v1.2.0/go.mod h1:aT17Fk0Z1Nor9e0uisf98LrntPGMnk4frBO9+dkf69I= +go.opentelemetry.io/otel v1.3.0 h1:APxLf0eiBwLl+SOXiJJCVYzA1OOJNyAoV8C5RNRyy7Y= +go.opentelemetry.io/otel v1.3.0/go.mod h1:PWIKzi6JCp7sM0k9yZ43VX+T345uNbAkDKwHVjb2PTs= go.opentelemetry.io/otel/bridge/opencensus v0.25.0/go.mod h1:dkZDdaNwLlIutxK2Kc2m3jwW2M1ISaNf8/rOYVwuVHs= go.opentelemetry.io/otel/exporters/jaeger v1.2.0/go.mod h1:KJLFbEMKTNPIfOxcg/WikIozEoKcPgJRz3Ce1vLlM8E= go.opentelemetry.io/otel/internal/metric v0.25.0/go.mod h1:Nhuw26QSX7d6n4duoqAFi5KOQR4AuzyMcl5eXOgwxtc= @@ -2143,11 +2121,14 @@ go.opentelemetry.io/otel/metric v0.20.0/go.mod h1:598I5tYlH1vzBjn+BTuhzTCSb/9deb go.opentelemetry.io/otel/metric v0.25.0/go.mod h1:E884FSpQfnJOMMUaq+05IWlJ4rjZpk2s/F1Ju+TEEm8= go.opentelemetry.io/otel/oteltest v0.20.0/go.mod h1:L7bgKf9ZB7qCwT9Up7i9/pn0PWIa9FqQ2IQ8LoxiGnw= go.opentelemetry.io/otel/sdk v0.20.0/go.mod h1:g/IcepuwNsoiX5Byy2nNV0ySUF1em498m7hBWC279Yc= +go.opentelemetry.io/otel/sdk v1.2.0 h1:wKN260u4DesJYhyjxDa7LRFkuhH7ncEVKU37LWcyNIo= go.opentelemetry.io/otel/sdk v1.2.0/go.mod h1:jNN8QtpvbsKhgaC6V5lHiejMoKD+V8uadoSafgHPx1U= go.opentelemetry.io/otel/sdk/export/metric v0.25.0/go.mod h1:Ej7NOa+WpN49EIcr1HMUYRvxXXCCnQCg2+ovdt2z8Pk= go.opentelemetry.io/otel/sdk/metric v0.25.0/go.mod h1:G4xzj4LvC6xDDSsVXpvRVclQCbofGGg4ZU2VKKtDRfg= go.opentelemetry.io/otel/trace v0.20.0/go.mod h1:6GjCW8zgDjwGHGa6GkyeB8+/5vjT16gUEi0Nf1iBdgw= go.opentelemetry.io/otel/trace v1.2.0/go.mod h1:N5FLswTubnxKxOJHM7XZC074qpeEdLy3CgAVsdMucK0= +go.opentelemetry.io/otel/trace v1.3.0 h1:doy8Hzb1RJ+I3yFhtDmwNc7tIyw1tNMOIsyPzp1NOGY= +go.opentelemetry.io/otel/trace v1.3.0/go.mod h1:c/VDhno8888bvQYmbYLqe41/Ldmr/KKunbvWM4/fEjk= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= go.starlark.net v0.0.0-20190702223751-32f345186213/go.mod h1:c1/X6cHgvdXj6pUlmWKMkuqRnW4K8x2vwt6JAaaircg= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= @@ -2214,7 +2195,6 @@ golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20191112222119-e1110fd1c708/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200115085410-6d4e4cb37c7d/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200117160349-530e935923ad/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200128174031-69ecbb4d6d5d/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200221231518-2aa609cf4a9d/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200311171314-f7b00557c8c4/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= @@ -2253,7 +2233,6 @@ golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= golang.org/x/exp v0.0.0-20200331195152-e8c3332aa8e5/go.mod h1:4M0jN8W1tt0AVLNr8HDosyJCDCDuyL9N9+3m7wDWgKw= -golang.org/x/exp v0.0.0-20200513190911-00229845015e/go.mod h1:4M0jN8W1tt0AVLNr8HDosyJCDCDuyL9N9+3m7wDWgKw= golang.org/x/exp v0.0.0-20210615023648-acb5c1269671/go.mod h1:DVyR6MI7P4kEQgvZJSj1fQGrWIi2RzIrfYWycwheUAc= golang.org/x/exp v0.0.0-20210714144626-1041f73d31d8/go.mod h1:DVyR6MI7P4kEQgvZJSj1fQGrWIi2RzIrfYWycwheUAc= golang.org/x/exp v0.0.0-20210715201039-d37aa40e8013 h1:Jp57DBw4K7mimZNA3F9f7CndVcUt4kJjmyJf2rzJHoI= @@ -2302,7 +2281,6 @@ golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73r golang.org/x/net v0.0.0-20190125091013-d26f9f9a57f3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190227160552-c95aed5357e7/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190228165749-92fc7df08ae7/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190313220215-9f648a60d977/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= @@ -2593,7 +2571,6 @@ golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc golang.org/x/tools v0.0.0-20200812195022-5ae4c3c160a0/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200820010801-b793a1359eac/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200827010519-17fd2f27a9e3/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200831203904-5a2aa26beb65/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE= golang.org/x/tools v0.0.0-20201001104356-43ebab892c4c/go.mod h1:z6u4i615ZeAfBE4XtMziQW1fSVJXACjjbWkB/mvPzlU= golang.org/x/tools v0.0.0-20201002184944-ecd9fd270d5d/go.mod h1:z6u4i615ZeAfBE4XtMziQW1fSVJXACjjbWkB/mvPzlU= @@ -2609,7 +2586,6 @@ golang.org/x/tools v0.0.0-20210101214203-2dba1e4ea05c/go.mod h1:emZCQorbCU4vsT4f golang.org/x/tools v0.0.0-20210104081019-d8d6ddbec6ee/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= -golang.org/x/tools v0.1.1-0.20210225150353-54dc8c5edb56/go.mod h1:9bzcO0MWcOuT0tm1iBGzDVPshzfwoVvREIui8C+MHqU= golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= diff --git a/venus-shared/api/api-document.md b/venus-shared/api/api-document.md index 60000c7e39..e33a55c10f 100644 --- a/venus-shared/api/api-document.md +++ b/venus-shared/api/api-document.md @@ -3104,7 +3104,12 @@ Inputs: ] ``` -Response: `"12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf"` +Response: +```json +[ + "12D3KooWGzxzKZYveHXtpG6AsrUJBcWxHBFS2HsEoGTxrMLvKXtf" +] +``` ### NetworkGetPeerAddresses @@ -5452,6 +5457,7 @@ Perms: admin Inputs: ```json [ + "t01234", "string value" ] ``` @@ -5483,7 +5489,15 @@ Response: `true` Perms: admin -Inputs: `null` +Inputs: +```json +[ + { + "Type": "bls", + "PrivateKey": "Ynl0ZSBhcnJheQ==" + } +] +``` Response: `"t01234"` @@ -5492,7 +5506,12 @@ Response: `"t01234"` Perms: write -Inputs: `null` +Inputs: +```json +[ + 7 +] +``` Response: `"t01234"` diff --git a/venus-shared/api/chain/v0/fullnode.go b/venus-shared/api/chain/v0/fullnode.go index 99e896b1e7..bd4498132a 100644 --- a/venus-shared/api/chain/v0/fullnode.go +++ b/venus-shared/api/chain/v0/fullnode.go @@ -2,7 +2,6 @@ package v0 //go:generate go run github.com/golang/mock/mockgen@v1.6.0 -destination=./mock/full.go -package=mock . FullNode - type FullNode interface { IBlockStore IChain diff --git a/venus-shared/api/chain/v0/mock/full.go b/venus-shared/api/chain/v0/mock/full.go index 4d488a0f64..051d499b14 100644 --- a/venus-shared/api/chain/v0/mock/full.go +++ b/venus-shared/api/chain/v0/mock/full.go @@ -1197,10 +1197,10 @@ func (mr *MockFullNodeMockRecorder) NetworkGetBandwidthStats(arg0 interface{}) * } // NetworkGetClosestPeers mocks base method. -func (m *MockFullNode) NetworkGetClosestPeers(arg0 context.Context, arg1 string) (<-chan peer.ID, error) { +func (m *MockFullNode) NetworkGetClosestPeers(arg0 context.Context, arg1 string) ([]peer.ID, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "NetworkGetClosestPeers", arg0, arg1) - ret0, _ := ret[0].(<-chan peer.ID) + ret0, _ := ret[0].([]peer.ID) ret1, _ := ret[1].(error) return ret0, ret1 } diff --git a/venus-shared/api/chain/v0/network.go b/venus-shared/api/chain/v0/network.go index 0c1bffb4ab..64c166c942 100644 --- a/venus-shared/api/chain/v0/network.go +++ b/venus-shared/api/chain/v0/network.go @@ -17,7 +17,7 @@ type INetwork interface { NetworkGetPeerAddresses(ctx context.Context) []ma.Multiaddr //perm:admin NetworkGetPeerID(ctx context.Context) peer.ID //perm:admin NetworkFindProvidersAsync(ctx context.Context, key cid.Cid, count int) <-chan peer.AddrInfo //perm:read - NetworkGetClosestPeers(ctx context.Context, key string) (<-chan peer.ID, error) //perm:read + NetworkGetClosestPeers(ctx context.Context, key string) ([]peer.ID, error) //perm:read NetworkFindPeer(ctx context.Context, peerID peer.ID) (peer.AddrInfo, error) //perm:read NetworkConnect(ctx context.Context, addrs []string) (<-chan net.ConnectionResult, error) //perm:read NetworkPeers(ctx context.Context, verbose, latency, streams bool) (*net.SwarmConnInfos, error) //perm:read diff --git a/venus-shared/api/chain/v0/proxy_gen.go b/venus-shared/api/chain/v0/proxy_gen.go index d067bc9699..a5f38e9d93 100644 --- a/venus-shared/api/chain/v0/proxy_gen.go +++ b/venus-shared/api/chain/v0/proxy_gen.go @@ -782,7 +782,7 @@ type INetworkStruct struct { NetworkGetBandwidthStats func(p0 context.Context) metrics.Stats `perm:"admin"` - NetworkGetClosestPeers func(p0 context.Context, p1 string) (<-chan peer.ID, error) `perm:"read"` + NetworkGetClosestPeers func(p0 context.Context, p1 string) ([]peer.ID, error) `perm:"read"` NetworkGetPeerAddresses func(p0 context.Context) []ma.Multiaddr `perm:"admin"` @@ -814,7 +814,7 @@ func (s *INetworkStruct) NetworkGetBandwidthStats(p0 context.Context) metrics.St return s.Internal.NetworkGetBandwidthStats(p0) } -func (s *INetworkStruct) NetworkGetClosestPeers(p0 context.Context, p1 string) (<-chan peer.ID, error) { +func (s *INetworkStruct) NetworkGetClosestPeers(p0 context.Context, p1 string) ([]peer.ID, error) { return s.Internal.NetworkGetClosestPeers(p0, p1) } @@ -1002,13 +1002,13 @@ type IWalletStruct struct { WalletDefaultAddress func(p0 context.Context) (address.Address, error) `perm:"write"` - WalletExport func(p0 address.Address, p1 string) (*wallet.KeyInfo, error) `perm:"admin"` + WalletExport func(p0 context.Context, p1 address.Address, p2 string) (*wallet.KeyInfo, error) `perm:"admin"` WalletHas func(p0 context.Context, p1 address.Address) (bool, error) `perm:"write"` - WalletImport func(p0 *wallet.KeyInfo) (address.Address, error) `perm:"admin"` + WalletImport func(p0 context.Context, p1 *wallet.KeyInfo) (address.Address, error) `perm:"admin"` - WalletNewAddress func(p0 address.Protocol) (address.Address, error) `perm:"write"` + WalletNewAddress func(p0 context.Context, p1 address.Protocol) (address.Address, error) `perm:"write"` WalletSetDefault func(p0 context.Context, p1 address.Address) error `perm:"write"` @@ -1048,20 +1048,20 @@ func (s *IWalletStruct) WalletDefaultAddress(p0 context.Context) (address.Addres return s.Internal.WalletDefaultAddress(p0) } -func (s *IWalletStruct) WalletExport(p0 address.Address, p1 string) (*wallet.KeyInfo, error) { - return s.Internal.WalletExport(p0, p1) +func (s *IWalletStruct) WalletExport(p0 context.Context, p1 address.Address, p2 string) (*wallet.KeyInfo, error) { + return s.Internal.WalletExport(p0, p1, p2) } func (s *IWalletStruct) WalletHas(p0 context.Context, p1 address.Address) (bool, error) { return s.Internal.WalletHas(p0, p1) } -func (s *IWalletStruct) WalletImport(p0 *wallet.KeyInfo) (address.Address, error) { - return s.Internal.WalletImport(p0) +func (s *IWalletStruct) WalletImport(p0 context.Context, p1 *wallet.KeyInfo) (address.Address, error) { + return s.Internal.WalletImport(p0, p1) } -func (s *IWalletStruct) WalletNewAddress(p0 address.Protocol) (address.Address, error) { - return s.Internal.WalletNewAddress(p0) +func (s *IWalletStruct) WalletNewAddress(p0 context.Context, p1 address.Protocol) (address.Address, error) { + return s.Internal.WalletNewAddress(p0, p1) } func (s *IWalletStruct) WalletSetDefault(p0 context.Context, p1 address.Address) error { diff --git a/venus-shared/api/chain/v0/wallet.go b/venus-shared/api/chain/v0/wallet.go index bed48a5e50..0272b2d3bf 100644 --- a/venus-shared/api/chain/v0/wallet.go +++ b/venus-shared/api/chain/v0/wallet.go @@ -13,10 +13,10 @@ import ( type IWallet interface { WalletSign(ctx context.Context, k address.Address, msg []byte, meta wallet.MsgMeta) (*crypto.Signature, error) //perm:sign - WalletExport(addr address.Address, password string) (*wallet.KeyInfo, error) //perm:admin - WalletImport(key *wallet.KeyInfo) (address.Address, error) //perm:admin + WalletExport(ctx context.Context, addr address.Address, password string) (*wallet.KeyInfo, error) //perm:admin + WalletImport(ctx context.Context, key *wallet.KeyInfo) (address.Address, error) //perm:admin WalletHas(ctx context.Context, addr address.Address) (bool, error) //perm:write - WalletNewAddress(protocol address.Protocol) (address.Address, error) //perm:write + WalletNewAddress(ctx context.Context, protocol address.Protocol) (address.Address, error) //perm:write WalletBalance(ctx context.Context, addr address.Address) (abi.TokenAmount, error) //perm:read WalletDefaultAddress(ctx context.Context) (address.Address, error) //perm:write WalletAddresses(ctx context.Context) []address.Address //perm:admin @@ -24,7 +24,7 @@ type IWallet interface { WalletSignMessage(ctx context.Context, k address.Address, msg *chain.Message) (*chain.SignedMessage, error) //perm:sign LockWallet(ctx context.Context) error //perm:admin UnLockWallet(ctx context.Context, password []byte) error //perm:admin - SetPassword(Context context.Context, password []byte) error //perm:admin - HasPassword(Context context.Context) bool //perm:admin - WalletState(Context context.Context) int //perm:admin + SetPassword(ctx context.Context, password []byte) error //perm:admin + HasPassword(ctx context.Context) bool //perm:admin + WalletState(ctx context.Context) int //perm:admin } diff --git a/venus-shared/api/chain/v1/mock/full.go b/venus-shared/api/chain/v1/mock/full.go index c8d8646ad6..d7ca9b2ac5 100644 --- a/venus-shared/api/chain/v1/mock/full.go +++ b/venus-shared/api/chain/v1/mock/full.go @@ -1257,10 +1257,10 @@ func (mr *MockFullNodeMockRecorder) NetworkGetBandwidthStats(arg0 interface{}) * } // NetworkGetClosestPeers mocks base method. -func (m *MockFullNode) NetworkGetClosestPeers(arg0 context.Context, arg1 string) (<-chan peer.ID, error) { +func (m *MockFullNode) NetworkGetClosestPeers(arg0 context.Context, arg1 string) ([]peer.ID, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "NetworkGetClosestPeers", arg0, arg1) - ret0, _ := ret[0].(<-chan peer.ID) + ret0, _ := ret[0].([]peer.ID) ret1, _ := ret[1].(error) return ret0, ret1 } diff --git a/venus-shared/api/chain/v1/network.go b/venus-shared/api/chain/v1/network.go index 1b1d291491..27529b2470 100644 --- a/venus-shared/api/chain/v1/network.go +++ b/venus-shared/api/chain/v1/network.go @@ -17,7 +17,7 @@ type INetwork interface { NetworkGetPeerAddresses(ctx context.Context) []ma.Multiaddr //perm:admin NetworkGetPeerID(ctx context.Context) peer.ID //perm:admin NetworkFindProvidersAsync(ctx context.Context, key cid.Cid, count int) <-chan peer.AddrInfo //perm:read - NetworkGetClosestPeers(ctx context.Context, key string) (<-chan peer.ID, error) //perm:read + NetworkGetClosestPeers(ctx context.Context, key string) ([]peer.ID, error) //perm:read NetworkFindPeer(ctx context.Context, peerID peer.ID) (peer.AddrInfo, error) //perm:read NetworkConnect(ctx context.Context, addrs []string) (<-chan net.ConnectionResult, error) //perm:read NetworkPeers(ctx context.Context, verbose, latency, streams bool) (*net.SwarmConnInfos, error) //perm:read diff --git a/venus-shared/api/chain/v1/proxy_gen.go b/venus-shared/api/chain/v1/proxy_gen.go index 860f7720ed..f129eee8bd 100644 --- a/venus-shared/api/chain/v1/proxy_gen.go +++ b/venus-shared/api/chain/v1/proxy_gen.go @@ -800,7 +800,7 @@ type INetworkStruct struct { NetworkGetBandwidthStats func(p0 context.Context) metrics.Stats `perm:"admin"` - NetworkGetClosestPeers func(p0 context.Context, p1 string) (<-chan peer.ID, error) `perm:"read"` + NetworkGetClosestPeers func(p0 context.Context, p1 string) ([]peer.ID, error) `perm:"read"` NetworkGetPeerAddresses func(p0 context.Context) []ma.Multiaddr `perm:"admin"` @@ -832,7 +832,7 @@ func (s *INetworkStruct) NetworkGetBandwidthStats(p0 context.Context) metrics.St return s.Internal.NetworkGetBandwidthStats(p0) } -func (s *INetworkStruct) NetworkGetClosestPeers(p0 context.Context, p1 string) (<-chan peer.ID, error) { +func (s *INetworkStruct) NetworkGetClosestPeers(p0 context.Context, p1 string) ([]peer.ID, error) { return s.Internal.NetworkGetClosestPeers(p0, p1) } @@ -1020,13 +1020,13 @@ type IWalletStruct struct { WalletDefaultAddress func(p0 context.Context) (address.Address, error) `perm:"write"` - WalletExport func(p0 address.Address, p1 string) (*wallet.KeyInfo, error) `perm:"admin"` + WalletExport func(p0 context.Context, p1 address.Address, p2 string) (*wallet.KeyInfo, error) `perm:"admin"` WalletHas func(p0 context.Context, p1 address.Address) (bool, error) `perm:"write"` - WalletImport func(p0 *wallet.KeyInfo) (address.Address, error) `perm:"admin"` + WalletImport func(p0 context.Context, p1 *wallet.KeyInfo) (address.Address, error) `perm:"admin"` - WalletNewAddress func(p0 address.Protocol) (address.Address, error) `perm:"write"` + WalletNewAddress func(p0 context.Context, p1 address.Protocol) (address.Address, error) `perm:"write"` WalletSetDefault func(p0 context.Context, p1 address.Address) error `perm:"write"` @@ -1066,20 +1066,20 @@ func (s *IWalletStruct) WalletDefaultAddress(p0 context.Context) (address.Addres return s.Internal.WalletDefaultAddress(p0) } -func (s *IWalletStruct) WalletExport(p0 address.Address, p1 string) (*wallet.KeyInfo, error) { - return s.Internal.WalletExport(p0, p1) +func (s *IWalletStruct) WalletExport(p0 context.Context, p1 address.Address, p2 string) (*wallet.KeyInfo, error) { + return s.Internal.WalletExport(p0, p1, p2) } func (s *IWalletStruct) WalletHas(p0 context.Context, p1 address.Address) (bool, error) { return s.Internal.WalletHas(p0, p1) } -func (s *IWalletStruct) WalletImport(p0 *wallet.KeyInfo) (address.Address, error) { - return s.Internal.WalletImport(p0) +func (s *IWalletStruct) WalletImport(p0 context.Context, p1 *wallet.KeyInfo) (address.Address, error) { + return s.Internal.WalletImport(p0, p1) } -func (s *IWalletStruct) WalletNewAddress(p0 address.Protocol) (address.Address, error) { - return s.Internal.WalletNewAddress(p0) +func (s *IWalletStruct) WalletNewAddress(p0 context.Context, p1 address.Protocol) (address.Address, error) { + return s.Internal.WalletNewAddress(p0, p1) } func (s *IWalletStruct) WalletSetDefault(p0 context.Context, p1 address.Address) error { diff --git a/venus-shared/api/chain/v1/wallet.go b/venus-shared/api/chain/v1/wallet.go index 42c1c5dd6e..20f47aad0e 100644 --- a/venus-shared/api/chain/v1/wallet.go +++ b/venus-shared/api/chain/v1/wallet.go @@ -13,10 +13,10 @@ import ( type IWallet interface { WalletSign(ctx context.Context, k address.Address, msg []byte, meta wallet.MsgMeta) (*crypto.Signature, error) //perm:sign - WalletExport(addr address.Address, password string) (*wallet.KeyInfo, error) //perm:admin - WalletImport(key *wallet.KeyInfo) (address.Address, error) //perm:admin + WalletExport(ctx context.Context, addr address.Address, password string) (*wallet.KeyInfo, error) //perm:admin + WalletImport(ctx context.Context, key *wallet.KeyInfo) (address.Address, error) //perm:admin WalletHas(ctx context.Context, addr address.Address) (bool, error) //perm:write - WalletNewAddress(protocol address.Protocol) (address.Address, error) //perm:write + WalletNewAddress(ctx context.Context, protocol address.Protocol) (address.Address, error) //perm:write WalletBalance(ctx context.Context, addr address.Address) (abi.TokenAmount, error) //perm:read WalletDefaultAddress(ctx context.Context) (address.Address, error) //perm:write WalletAddresses(ctx context.Context) []address.Address //perm:admin @@ -24,7 +24,7 @@ type IWallet interface { WalletSignMessage(ctx context.Context, k address.Address, msg *chain.Message) (*chain.SignedMessage, error) //perm:sign LockWallet(ctx context.Context) error //perm:admin UnLockWallet(ctx context.Context, password []byte) error //perm:admin - SetPassword(Context context.Context, password []byte) error //perm:admin - HasPassword(Context context.Context) bool //perm:admin - WalletState(Context context.Context) int //perm:admin + SetPassword(ctx context.Context, password []byte) error //perm:admin + HasPassword(ctx context.Context) bool //perm:admin + WalletState(ctx context.Context) int //perm:admin } diff --git a/venus-shared/chain/complex_provider_test.go b/venus-shared/chain/complex_provider_test.go index b237d4bdfd..7b645ec2ee 100644 --- a/venus-shared/chain/complex_provider_test.go +++ b/venus-shared/chain/complex_provider_test.go @@ -31,6 +31,7 @@ func TestBlockProvider(t *testing.T) { func TestComplexProvider(t *testing.T) { tf.UnitTest(t) + tests := map[string]func(*testing.T){ "Tipset": TestTipsetProvider, "Message": TestMessageProvider, diff --git a/venus-shared/chain/tipset_key.go b/venus-shared/chain/tipset_key.go index 3289b4807a..70838aa215 100644 --- a/venus-shared/chain/tipset_key.go +++ b/venus-shared/chain/tipset_key.go @@ -107,11 +107,11 @@ func (tsk TipSetKey) IsEmpty() bool { // We can assume that the relative order of members of one key is // maintained in the other since we assume that all ids are sorted // by corresponding newBlock ticket value. -func (tipsetKey TipSetKey) ContainsAll(other TipSetKey) bool { +func (tsk TipSetKey) ContainsAll(other TipSetKey) bool { // Since we assume the ids must have the same relative sorting we can // perform one pass over this set, advancing the other index whenever the // values match. - cids := tipsetKey.Cids() + cids := tsk.Cids() otherCids := other.Cids() otherIdx := 0 for i := 0; i < len(cids) && otherIdx < len(otherCids); i++ { @@ -124,9 +124,9 @@ func (tipsetKey TipSetKey) ContainsAll(other TipSetKey) bool { } // Has checks whether the set contains `id`. -func (tipsetKey TipSetKey) Has(id cid.Cid) bool { +func (tsk TipSetKey) Has(id cid.Cid) bool { // Find index of the first CID not less than id. - for _, cid := range tipsetKey.Cids() { + for _, cid := range tsk.Cids() { if cid == id { return true } @@ -135,11 +135,11 @@ func (tipsetKey TipSetKey) Has(id cid.Cid) bool { } // Equals checks whether the set contains exactly the same CIDs as another. -func (tipsetKey TipSetKey) Equals(other TipSetKey) bool { - return tipsetKey.value == other.value +func (tsk TipSetKey) Equals(other TipSetKey) bool { + return tsk.value == other.value } -func (tipsetKey *TipSetKey) UnmarshalCBOR(r io.Reader) error { +func (tsk *TipSetKey) UnmarshalCBOR(r io.Reader) error { br := cbg.GetPeeker(r) scratch := make([]byte, 8) maj, extra, err := cbg.CborReadHeaderBuf(br, scratch) @@ -165,13 +165,13 @@ func (tipsetKey *TipSetKey) UnmarshalCBOR(r io.Reader) error { } cids[i] = c } - tipsetKey.value = string(encodeKey(cids)) + tsk.value = string(encodeKey(cids)) } return nil } -func (tipsetKey TipSetKey) MarshalCBOR(w io.Writer) error { - cids := tipsetKey.Cids() +func (tsk TipSetKey) MarshalCBOR(w io.Writer) error { + cids := tsk.Cids() if len(cids) > cbg.MaxLength { return xerrors.Errorf("Slice value in field t.Parents was too long") }