Skip to content

Commit b0599c7

Browse files
authored
revert: integration of graphsync-v0.9.0 until we are ready to test the whole stack with it (#249)
1 parent 4472a8e commit b0599c7

24 files changed

+138
-206
lines changed

benchmarks/testinstance/testinstance.go

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,8 @@ func Close(instances []Instance) error {
109109
// Instance is a test instance of bitswap + dependencies for integration testing
110110
type Instance struct {
111111
Peer peer.ID
112-
LinkSystem ipld.LinkSystem
112+
Loader ipld.Loader
113+
Storer ipld.Storer
113114
BlockStore blockstore.Blockstore
114115
Graphsync graphsync.GraphExchange
115116
Manager datatransfer.Manager
@@ -163,8 +164,9 @@ func NewInstance(ctx context.Context, net tn.Network, tempDir string, diskBasedD
163164
return Instance{}, err
164165
}
165166

166-
linkSystem := storeutil.LinkSystemForBlockstore(bstore)
167-
gs := gsimpl.New(ctx, gsNet, linkSystem, gsimpl.RejectAllRequestsByDefault())
167+
loader := storeutil.LoaderForBlockstore(bstore)
168+
storer := storeutil.StorerForBlockstore(bstore)
169+
gs := gsimpl.New(ctx, gsNet, loader, storer, gsimpl.RejectAllRequestsByDefault())
168170
transport := gstransport.NewTransport(p, gs)
169171
dt, err := dtimpl.NewDataTransfer(namespace.Wrap(dstore, datastore.NewKey("/data-transfers/transfers")), os.TempDir(), dtNet, transport)
170172
if err != nil {
@@ -196,7 +198,8 @@ func NewInstance(ctx context.Context, net tn.Network, tempDir string, diskBasedD
196198
Peer: p,
197199
Graphsync: gs,
198200
Manager: dt,
199-
LinkSystem: linkSystem,
201+
Loader: loader,
202+
Storer: storer,
200203
BlockStore: bstore,
201204
blockstoreDelay: bsdelay,
202205
ds: dstore,

channels/channel_state.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ func (c channelState) BaseCID() cid.Cid { return c.baseCid }
8181
func (c channelState) Selector() ipld.Node {
8282
builder := basicnode.Prototype.Any.NewBuilder()
8383
reader := bytes.NewReader(c.selector.Raw)
84-
err := dagcbor.Decode(builder, reader)
84+
err := dagcbor.Decoder(builder, reader)
8585
if err != nil {
8686
log.Error(err)
8787
}

channels/channels_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@ func TestMigrationsV0(t *testing.T) {
436436

437437
allSelector := builder.NewSelectorSpecBuilder(basicnode.Prototype.Any).Matcher().Node()
438438
allSelectorBuf := new(bytes.Buffer)
439-
err := dagcbor.Encode(allSelector, allSelectorBuf)
439+
err := dagcbor.Encoder(allSelector, allSelectorBuf)
440440
require.NoError(t, err)
441441
allSelectorBytes := allSelectorBuf.Bytes()
442442

@@ -556,7 +556,7 @@ func TestMigrationsV1(t *testing.T) {
556556
receivedCids := make([][]cid.Cid, numChannels)
557557
allSelector := builder.NewSelectorSpecBuilder(basicnode.Prototype.Any).Matcher().Node()
558558
allSelectorBuf := new(bytes.Buffer)
559-
err := dagcbor.Encode(allSelector, allSelectorBuf)
559+
err := dagcbor.Encoder(allSelector, allSelectorBuf)
560560
require.NoError(t, err)
561561
allSelectorBytes := allSelectorBuf.Bytes()
562562
selfPeer := testutil.GeneratePeers(1)[0]

channels/internal/internalchannel_cbor_gen.go

Lines changed: 3 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

channels/internal/migrations/v0/v0_cbor_gen.go

Lines changed: 0 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

channels/internal/migrations/v1/v1_cbor_gen.go

Lines changed: 1 addition & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

encoding/encoding.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ func Encode(value Encodable) ([]byte, error) {
2727
}
2828
if ipldEncodable, ok := value.(ipld.Node); ok {
2929
buf := new(bytes.Buffer)
30-
err := dagcbor.Encode(ipldEncodable, buf)
30+
err := dagcbor.Encoder(ipldEncodable, buf)
3131
if err != nil {
3232
return nil, err
3333
}
@@ -79,7 +79,7 @@ type ipldDecoder struct {
7979
func (decoder *ipldDecoder) DecodeFromCbor(encoded []byte) (Encodable, error) {
8080
builder := decoder.style.NewBuilder()
8181
buf := bytes.NewReader(encoded)
82-
err := dagcbor.Decode(builder, buf)
82+
err := dagcbor.Decoder(builder, buf)
8383
if err != nil {
8484
return nil, err
8585
}

go.mod

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,33 +8,31 @@ require (
88
github.com/filecoin-project/go-statemachine v0.0.0-20200925024713-05bd7c71fbfe
99
github.com/hannahhoward/cbor-gen-for v0.0.0-20200817222906-ea96cece81f1
1010
github.com/hannahhoward/go-pubsub v0.0.0-20200423002714-8d62886cc36e
11-
github.com/ipfs/go-block-format v0.0.3
11+
github.com/ipfs/go-block-format v0.0.2
1212
github.com/ipfs/go-blockservice v0.1.3
1313
github.com/ipfs/go-cid v0.0.7
1414
github.com/ipfs/go-datastore v0.4.5
15-
github.com/ipfs/go-ds-badger v0.2.6
16-
github.com/ipfs/go-graphsync v0.9.0
15+
github.com/ipfs/go-ds-badger v0.2.3
16+
github.com/ipfs/go-graphsync v0.6.8
1717
github.com/ipfs/go-ipfs-blockstore v1.0.1
1818
github.com/ipfs/go-ipfs-blocksutil v0.0.1
1919
github.com/ipfs/go-ipfs-chunker v0.0.5
2020
github.com/ipfs/go-ipfs-delay v0.0.1
2121
github.com/ipfs/go-ipfs-exchange-offline v0.0.1
2222
github.com/ipfs/go-ipfs-files v0.0.8
23-
github.com/ipfs/go-ipld-cbor v0.0.5
23+
github.com/ipfs/go-ipld-cbor v0.0.4
2424
github.com/ipfs/go-ipld-format v0.2.0
2525
github.com/ipfs/go-log/v2 v2.1.1
2626
github.com/ipfs/go-merkledag v0.3.2
2727
github.com/ipfs/go-unixfs v0.2.4
28-
github.com/ipld/go-ipld-prime v0.12.0
28+
github.com/ipld/go-ipld-prime v0.5.1-0.20201021195245-109253e8a018
2929
github.com/jbenet/go-random v0.0.0-20190219211222-123a90aedc0c
3030
github.com/jpillora/backoff v1.0.0
31-
github.com/libp2p/go-libp2p v0.13.0
32-
github.com/libp2p/go-libp2p-core v0.8.5
33-
github.com/libp2p/go-libp2p-record v0.1.1 // indirect
31+
github.com/libp2p/go-libp2p v0.12.0
32+
github.com/libp2p/go-libp2p-core v0.7.0
3433
github.com/stretchr/testify v1.6.1
35-
github.com/whyrusleeping/cbor-gen v0.0.0-20210219115102-f37d292932f2
34+
github.com/whyrusleeping/cbor-gen v0.0.0-20200826160007-0b9f6c5fb163
3635
go.uber.org/atomic v1.6.0
37-
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9
38-
golang.org/x/tools v0.1.1-0.20210225150353-54dc8c5edb56 // indirect
36+
golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208
3937
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1
4038
)

0 commit comments

Comments
 (0)