Skip to content

Commit

Permalink
Update to go-data-transfer v1.14.0 / go-libp2p v0.18.0-rc1 (#669)
Browse files Browse the repository at this point in the history
* update go-libp2p@v0.18.0-rc1

* fix mocknet.New invocation

* update go-data-transfer@v1.14.0-rc1

* fix tests

* feat(deps): update to go-data-transfer v1-14

Co-authored-by: vyzo <vyzo@hackzen.org>
  • Loading branch information
hannahhoward and vyzo authored Jan 20, 2022
1 parent 8d45bb7 commit c110c61
Show file tree
Hide file tree
Showing 9 changed files with 163 additions and 119 deletions.
22 changes: 11 additions & 11 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ require (
github.com/filecoin-project/go-address v0.0.5
github.com/filecoin-project/go-cbor-util v0.0.0-20191219014500-08c40a1e63a2
github.com/filecoin-project/go-commp-utils v0.1.3
github.com/filecoin-project/go-data-transfer v1.12.0
github.com/filecoin-project/go-ds-versioning v0.0.0-20211206185234-508abd7c2aff
github.com/filecoin-project/go-data-transfer v1.14.0
github.com/filecoin-project/go-ds-versioning v0.1.1
github.com/filecoin-project/go-fil-commcid v0.1.0
github.com/filecoin-project/go-fil-commp-hashhash v0.1.0
github.com/filecoin-project/go-padreader v0.0.0-20210723183308-812a16dc01b1
Expand All @@ -25,7 +25,7 @@ require (
github.com/ipfs/go-cidutil v0.0.2
github.com/ipfs/go-datastore v0.5.1
github.com/ipfs/go-filestore v1.1.0
github.com/ipfs/go-graphsync v0.11.0
github.com/ipfs/go-graphsync v0.12.0
github.com/ipfs/go-ipfs-blockstore v1.1.2
github.com/ipfs/go-ipfs-blocksutil v0.0.1
github.com/ipfs/go-ipfs-chunker v0.0.5
Expand All @@ -34,19 +34,19 @@ require (
github.com/ipfs/go-ipfs-files v0.0.8
github.com/ipfs/go-ipld-cbor v0.0.5
github.com/ipfs/go-ipld-format v0.2.0
github.com/ipfs/go-log/v2 v2.3.0
github.com/ipfs/go-log/v2 v2.5.0
github.com/ipfs/go-merkledag v0.5.1
github.com/ipfs/go-unixfs v0.2.6
github.com/ipfs/go-unixfs v0.3.1
github.com/ipld/go-car v0.3.3-0.20211210032800-e6f244225a16
github.com/ipld/go-car/v2 v2.1.1-0.20211211000942-be2525f6bf2d
github.com/ipld/go-ipld-prime v0.14.3-0.20211207234443-319145880958
github.com/ipld/go-car/v2 v2.1.1
github.com/ipld/go-ipld-prime v0.14.4
github.com/jbenet/go-random v0.0.0-20190219211222-123a90aedc0c
github.com/jpillora/backoff v1.0.0
github.com/libp2p/go-libp2p v0.16.0
github.com/libp2p/go-libp2p-core v0.11.0
github.com/multiformats/go-multiaddr v0.4.0
github.com/libp2p/go-libp2p v0.18.0-rc1
github.com/libp2p/go-libp2p-core v0.14.0
github.com/multiformats/go-multiaddr v0.5.0
github.com/multiformats/go-multibase v0.0.3
github.com/multiformats/go-multicodec v0.3.1-0.20210902112759-1539a079fd61
github.com/multiformats/go-multicodec v0.3.1-0.20211210143421-a526f306ed2c
github.com/multiformats/go-multihash v0.1.0
github.com/multiformats/go-varint v0.0.6
github.com/petar/GoLLRB v0.0.0-20210522233825-ae3b015fd3e9
Expand Down
211 changes: 121 additions & 90 deletions go.sum

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions retrievalmarket/impl/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,8 @@ func requireSetupTestClientAndProvider(ctx context.Context, t *testing.T, payChA
})

gs1 := graphsyncimpl.New(ctx, network.NewFromLibp2pHost(testData.Host1), testData.LinkSystem1)
dtTransport1 := dtgstransport.NewTransport(testData.Host1.ID(), gs1, testData.DTNet1)
dt1, err := dtimpl.NewDataTransfer(testData.DTStore1, testData.DTTmpDir1, testData.DTNet1, dtTransport1)
dtTransport1 := dtgstransport.NewTransport(testData.Host1.ID(), gs1)
dt1, err := dtimpl.NewDataTransfer(testData.DTStore1, testData.DTNet1, dtTransport1)
require.NoError(t, err)
testutil.StartAndWaitForReady(ctx, t, dt1)
require.NoError(t, err)
Expand Down Expand Up @@ -154,8 +154,8 @@ func requireSetupTestClientAndProvider(ctx context.Context, t *testing.T, payChA
paymentAddress := address.TestAddress2

gs2 := graphsyncimpl.New(ctx, network.NewFromLibp2pHost(testData.Host2), testData.LinkSystem2)
dtTransport2 := dtgstransport.NewTransport(testData.Host2.ID(), gs2, testData.DTNet2)
dt2, err := dtimpl.NewDataTransfer(testData.DTStore2, testData.DTTmpDir2, testData.DTNet2, dtTransport2)
dtTransport2 := dtgstransport.NewTransport(testData.Host2.ID(), gs2)
dt2, err := dtimpl.NewDataTransfer(testData.DTStore2, testData.DTNet2, dtTransport2)
require.NoError(t, err)
testutil.StartAndWaitForReady(ctx, t, dt2)
require.NoError(t, err)
Expand Down Expand Up @@ -648,8 +648,8 @@ func setupClient(
})

gs1 := graphsyncimpl.New(ctx, network.NewFromLibp2pHost(testData.Host1), testData.LinkSystem1)
dtTransport1 := dtgstransport.NewTransport(testData.Host1.ID(), gs1, testData.DTNet1)
dt1, err := dtimpl.NewDataTransfer(testData.DTStore1, testData.DTTmpDir1, testData.DTNet1, dtTransport1)
dtTransport1 := dtgstransport.NewTransport(testData.Host1.ID(), gs1)
dt1, err := dtimpl.NewDataTransfer(testData.DTStore1, testData.DTNet1, dtTransport1)
require.NoError(t, err)
testutil.StartAndWaitForReady(ctx, t, dt1)
require.NoError(t, err)
Expand Down Expand Up @@ -688,8 +688,8 @@ func setupProvider(
pieceStore.ExpectPiece(expectedPiece, pieceInfo)

gs2 := graphsyncimpl.New(ctx, network.NewFromLibp2pHost(testData.Host2), testData.LinkSystem2)
dtTransport2 := dtgstransport.NewTransport(testData.Host2.ID(), gs2, testData.DTNet2)
dt2, err := dtimpl.NewDataTransfer(testData.DTStore2, testData.DTTmpDir2, testData.DTNet2, dtTransport2)
dtTransport2 := dtgstransport.NewTransport(testData.Host2.ID(), gs2)
dt2, err := dtimpl.NewDataTransfer(testData.DTStore2, testData.DTNet2, dtTransport2)
require.NoError(t, err)
testutil.StartAndWaitForReady(ctx, t, dt2)
require.NoError(t, err)
Expand Down
4 changes: 2 additions & 2 deletions retrievalmarket/retrieval_restart_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ func TestBounceConnectionDealTransferOngoing(t *testing.T) {
td.DTNet1 = dtnet.NewFromLibp2pHost(td.Host1, dtClientNetRetry)
depGen := dependencies.NewDepGenerator()
depGen.ClientNewDataTransfer = func(ds datastore.Batching, dir string, transferNetwork dtnet.DataTransferNetwork, transport datatransfer.Transport) (datatransfer.Manager, error) {
return dtimpl.NewDataTransfer(ds, dir, transferNetwork, transport, restartConf)
return dtimpl.NewDataTransfer(ds, transferNetwork, transport, restartConf)
}
deps := depGen.New(t, bgCtx, td, testnodes.NewStorageMarketState(), "", noOpDelay, noOpDelay)
providerNode := testnodes2.NewTestRetrievalProviderNode()
Expand Down Expand Up @@ -227,7 +227,7 @@ func TestBounceConnectionDealTransferUnsealing(t *testing.T) {
td.DTNet1 = dtnet.NewFromLibp2pHost(td.Host1, dtClientNetRetry)
depGen := dependencies.NewDepGenerator()
depGen.ClientNewDataTransfer = func(ds datastore.Batching, dir string, transferNetwork dtnet.DataTransferNetwork, transport datatransfer.Transport) (datatransfer.Manager, error) {
return dtimpl.NewDataTransfer(ds, dir, transferNetwork, transport, restartConf)
return dtimpl.NewDataTransfer(ds, transferNetwork, transport, restartConf)
}
deps := depGen.New(t, bgCtx, td, testnodes.NewStorageMarketState(), "", noOpDelay, noOpDelay)
providerNode := testnodes2.NewTestRetrievalProviderNode()
Expand Down
2 changes: 1 addition & 1 deletion shared_testutil/mocknet.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ func NewLibp2pTestData(ctx context.Context, t *testing.T) *Libp2pTestData {
// setup an IPLD link system for bstore 2
testData.LinkSystem2 = storeutil.LinkSystemForBlockstore(testData.Bs2)

mn := mocknet.New(ctx)
mn := mocknet.New()

// setup network
testData.Host1, err = mn.GenPeer()
Expand Down
13 changes: 13 additions & 0 deletions shared_testutil/testchannel.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,19 @@ func (tc *TestChannel) ReceivedCids() []cid.Cid {
return tc.receivedCids
}

// TODO actual implementation of those
func (tc *TestChannel) MissingCids() []cid.Cid {
return nil
}

func (tc *TestChannel) QueuedCidsTotal() int64 {
return 0
}

func (tc *TestChannel) SentCidsTotal() int64 {
return 0
}

// Voucher returns the voucher for this data transfer
func (tc *TestChannel) Voucher() datatransfer.Voucher {
return tc.vouchers[0]
Expand Down
4 changes: 2 additions & 2 deletions storagemarket/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ func TestRestartOnlyProviderDataTransfer(t *testing.T) {
smState := testnodes.NewStorageMarketState()
depGen := dependencies.NewDepGenerator()
depGen.ClientNewDataTransfer = func(ds datastore.Batching, dir string, transferNetwork dtnet.DataTransferNetwork, transport datatransfer.Transport) (datatransfer.Manager, error) {
return dtimpl.NewDataTransfer(ds, dir, transferNetwork, transport, restartConf)
return dtimpl.NewDataTransfer(ds, transferNetwork, transport, restartConf)
}
deps := depGen.New(t, ctx, td, smState, "", noOpDelay, noOpDelay)
h := testharness.NewHarnessWithTestData(t, td, deps, true, false)
Expand Down Expand Up @@ -791,7 +791,7 @@ func TestBounceConnectionDataTransfer(t *testing.T) {
smState := testnodes.NewStorageMarketState()
depGen := dependencies.NewDepGenerator()
depGen.ClientNewDataTransfer = func(ds datastore.Batching, dir string, transferNetwork dtnet.DataTransferNetwork, transport datatransfer.Transport) (datatransfer.Manager, error) {
return dtimpl.NewDataTransfer(ds, dir, transferNetwork, transport, restartConf)
return dtimpl.NewDataTransfer(ds, transferNetwork, transport, restartConf)
}
deps := depGen.New(t, ctx, td, smState, "", noOpDelay, noOpDelay)
h := testharness.NewHarnessWithTestData(t, td, deps, true, false)
Expand Down
6 changes: 3 additions & 3 deletions storagemarket/testharness/dependencies/dependencies.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ func NewDependenciesWithTestData(t *testing.T,
type NewDataTransfer func(ds datastore.Batching, cidListsDir string, dataTransferNetwork network2.DataTransferNetwork, transport datatransfer.Transport) (datatransfer.Manager, error)

func defaultNewDataTransfer(ds datastore.Batching, dir string, transferNetwork network2.DataTransferNetwork, transport datatransfer.Transport) (datatransfer.Manager, error) {
return dtimpl.NewDataTransfer(ds, dir, transferNetwork, transport)
return dtimpl.NewDataTransfer(ds, transferNetwork, transport)
}

type DepGenerator struct {
Expand Down Expand Up @@ -148,7 +148,7 @@ func (gen *DepGenerator) New(
// create provider and client

gs1 := graphsyncimpl.New(ctx, network.NewFromLibp2pHost(td.Host1), td.LinkSystem1)
dtTransport1 := dtgstransport.NewTransport(td.Host1.ID(), gs1, td.DTNet1)
dtTransport1 := dtgstransport.NewTransport(td.Host1.ID(), gs1)
dt1, err := gen.ClientNewDataTransfer(td.DTStore1, td.DTTmpDir1, td.DTNet1, dtTransport1)
require.NoError(t, err)
testutil.StartAndWaitForReady(ctx, t, dt1)
Expand All @@ -158,7 +158,7 @@ func (gen *DepGenerator) New(
shared_testutil.StartAndWaitForReady(ctx, t, discovery)

gs2 := graphsyncimpl.New(ctx, network.NewFromLibp2pHost(td.Host2), td.LinkSystem2)
dtTransport2 := dtgstransport.NewTransport(td.Host2.ID(), gs2, td.DTNet2)
dtTransport2 := dtgstransport.NewTransport(td.Host2.ID(), gs2)
dt2, err := gen.ProviderNewDataTransfer(td.DTStore2, td.DTTmpDir2, td.DTNet2, dtTransport2)
require.NoError(t, err)
testutil.StartAndWaitForReady(ctx, t, dt2)
Expand Down
4 changes: 2 additions & 2 deletions storagemarket/testharness/testharness.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,8 @@ func NewHarnessWithTestData(t *testing.T, td *shared_testutil.Libp2pTestData, de

func (h *StorageHarness) CreateNewProvider(t *testing.T, ctx context.Context, td *shared_testutil.Libp2pTestData) storagemarket.StorageProvider {
gs2 := graphsyncimpl.New(ctx, gsnetwork.NewFromLibp2pHost(td.Host2), td.LinkSystem2)
dtTransport2 := dtgstransport.NewTransport(td.Host2.ID(), gs2, td.DTNet2)
dt2, err := dtimpl.NewDataTransfer(td.DTStore2, td.DTTmpDir2, td.DTNet2, dtTransport2)
dtTransport2 := dtgstransport.NewTransport(td.Host2.ID(), gs2)
dt2, err := dtimpl.NewDataTransfer(td.DTStore2, td.DTNet2, dtTransport2)
require.NoError(t, err)
testutil.StartAndWaitForReady(ctx, t, dt2)

Expand Down

0 comments on commit c110c61

Please sign in to comment.