This repository was archived by the owner on Aug 2, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 109
network: new stream! protocol and pull syncer implementation #1538
Merged
Merged
Changes from all commits
Commits
Show all changes
181 commits
Select commit
Hold shift + click to select a range
e8f8f4b
network/syncer: initial commit
acud 85884ec
network/newstream: pass bzz peer to run function
janos 7e316d4
network: pass bzz peer to retrieval run function
janos 5b0c155
network: pass the correct run function for retrieval protocol
janos a614719
network/newstream: remove notion of quit bins - no longer necessary
acud 2b4e37f
Revert "network/newstream: remove notion of quit bins - no longer nec…
acud 6dd176b
network/newstream: fix streams handling
acud c36fe30
network/newstream: fix loglines
acud 24743f4
all: fix linter
acud 3317445
network/newstream: add logging to see which test is failing
acud f5d1740
Revert "network/newstream: add logging to see which test is failing"
acud 345253a
network/newstream: clean logging
acud ee78cbb
network/newstream: adjust timeouts for travis
acud d3e7ada
network/newstream: remove test cases overlap
acud 2b391cf
network/newstream: remove overlapping tests, adjust test params for t…
acud 29161fc
network/newstream: comment tests
acud 1b1102f
network/newstream: exit clientSealBatch on stream quit
janos af33d8c
network/newstream: fix goroutine leak
acud 1b7c105
all: pull changes from master
acud 9117605
network/newstream: remove duplicate test
acud fcbcaf0
network/newstream: remove unused snapshot
janos e24bf84
network/newstream: clean up open offers in handleWantedHashes
janos a5091a4
chunk: avoid allocations in Address methods
janos d0a904b
Revert "chunk: avoid allocations in Address methods"
janos 7df6986
network/newstream: add comments, make PeerCursors return a JSON, remo…
acud 8e5b61e
network, storage: minor cleanup
acud cc0348f
network, storage: add more logging
acud 0fd11c1
network: add logging
acud ed4f430
network, storage: add more meaningful logging
acud ff7ad82
netstore: more meaningful logging
acud 6477971
network/newstream: use NetStore not LocalStore for chunk operations
janos 9b1618a
swarm: remove skip check tests
acud 995494d
network/newstream: implement stream pauser for tests and fix newSyncS…
janos 6a48c22
storage: cherry pick netstore panic change
acud 5c1be00
network/{newstream,retrieval,stream}: fix compilation errors
janos 83c6166
network/newstream: fix fileStore.GetAllReferences call in tests
janos 2f53ffd
network/newstream: remove unneeded conversions
janos 571ad55
network/newstream: decrease loglevel
acud 969e4ed
network: add test names for travis output
acud 641d119
network/newstream: fix goroutine leak on peer disconnect
acud 5f213bc
network/newstream: fixed possible few other leaks
acud cc96575
network/newstream: decrease params of test due to CI flaking
acud 7f21e3c
network/newstream: remove log
acud b18700d
remove test logs
acud 0c5e6ef
network/newstream: reduce log verbosity
acud 7318ca0
network/newstream: counting chunks by bin ids is unreliable after chu…
janos 2bf138c
network: reduce number of goroutines
acud 37b7d61
network, : change batch size, revert localstore files
acud 7768d63
revert change
acud 7dc99c7
network/newstream: increase batch timeout
acud 3fac3a0
network/newstream: apply janos fix, use context for put
acud f784f9e
storage: fix regression
acud a54beed
storage: fix regression
acud e98667d
retrieve: remove return, add test logline
acud e895ecf
storage: fix regression
acud a2886f9
network/newstream: fix ability to disable syncing
acud 70cd645
network/newstream: reinstate goroutine to see if performance improves
acud 7f48cee
all: check feasibility of changing filestore putter to localstore
acud 1bdc8bf
network/newstream: change batch timeout
acud 91ecfe6
network/newstream: add some time measurements, try to separate set an…
acud 9fa12b4
network/newstream: move set
acud 3947285
storage/netstore: move locks to prevent resource contention
acud fb4abbb
Revert "network/newstream: move set"
acud 214e597
Revert "network/newstream: add some time measurements, try to separat…
acud 267c27e
network/newstream: add some time measurements, try to separate set an…
acud 9f6cff7
network: rename metrics
acud 4b42eed
network/newstream: rename metrics
acud 8068c2a
network/newstream: add more metrics
acud d99f336
network/newstream: rename metrics
acud cefa178
network/newstream: change to gauge
acud 6da795c
network/newstream: fix metric
acud 82f3c66
network/newstream: fix compiliation errors
acud 508c54f
network/newstream: rename methods for clearer distinction on which si…
acud fcb0345
all: rename type to Registry
acud 76ee52b
network/newstream: reduce goroutines, prevent deadlock
acud a3e8c30
network/newstream: rename receivers, related tests
acud b2d6f22
network/newstream: remove underscores
acud 910e28f
Revert "network/newstream: reduce goroutines"
acud 6c22700
network/newstream: rename conflicting metrics
acud fcbb039
Revert "Revert "network/newstream: reduce goroutines""
acud 329a4c2
network/retrieve: fix logging and some metrics
acud 8a8a104
network/retrieval: fix dup metric
acud ea59871
chunk, storage: chunk.Store multiple chunk put
janos a4e946e
network/newstream: multiput integration
acud 164ad74
network/newstream: add more metrics to trace speed
acud 5ba18f5
network/newstream: change how metric is updated
acud 1d255c6
storage: add slow chunk metric
acud b0c8ccf
network/newstream: change batch size
acud b63c39b
all: try some rate limiting
acud 68c8c9a
network, storage: change pyramid chunker job limit, change metric
acud 7888f62
network/newstream: metrics
acud 2ed1b67
network/newstream: peer should drop on timeout
acud fd71540
network/newstream: change frame size to see performance impact
acud 9c9970e
network/newstream: add timer to see how long gets take
acud 683117e
network/newstream: adjust frame size
acud 6bb3362
network/newstream: experiment with adding cache
acud 96e40ca
network/newstream: change how metrics are updated
acud cae5c03
stream: add cache hit metric
acud 0374b5c
network: removed some log lines
acud 972935e
netstore: move lock
acud bf510a2
newstream: check cache before has
acud dceb1cd
newstream: remove semaphore
acud 0b055e0
stream: change maxframe
acud 1ee2736
stream: adjust batchsize and timeout
acud 99d2e90
Revert "all: check feasibility of changing filestore putter to locals…
acud b96cdc8
swarm: fix tags init
acud 3a06260
stream: integrate multi has
acud 8d6223c
netstore: has within GetOrCreateFetcher no longer necessary as callin…
acud d7079ce
network, storage: fix changes from cherry pick
acud b11210c
network/newstream: integrate localstore multi set
janos 7b97e39
netstore: voodoo
acud d11db84
stream: integrate multi has with cache
acud 8190844
stream: integrate multiget
acud 94fe7e1
stream: debug unsolicited chunks
acud b578ace
stream: batch size
acud c13ed96
network/newstream: sync provider MultiNeedData cleanup
janos dbbbae1
stream: interleave requests
acud eb09df5
batchsize
acud a2bd518
main: add mutex profile
acud 93a0e7a
stream: more granular lock
acud 894ed21
stream: remove panics
acud ef12c5a
storage: fix hasherstore seen check to happen when error is nil
acud 7fbf792
stream: clean up and simplify
acud 309fa5a
stream: cleanup
acud 9c3e915
stream: more cleanup
acud 7b52485
stream: more cleanups
acud 07a0607
sync_sym.go: add simulation
janos 1436818
network/newstream: remove unused variable
janos 7bda6bf
Merge branch 'master' into new-syncer-gs
acud 7834992
stream: cleanup
acud 49584be
stream: add comments, cleanup, remove duplicate code
acud 9a8b98e
stream: cleanup cleanup cleanup
acud 3d1ced6
Merge branch 'master' into new-syncer-gs
acud 174640e
stream: remove Roundtrip
acud 825cf24
Merge branch 'new-syncer-gs' of github.com:ethersphere/swarm into new…
acud 07e88bc
dockerfile: add perf!
acud 468512f
stream: increase batch size
acud 724efbc
Dockerfile: add kernel profiler to alltools image
acud 5684eba
all: check feasibility of changing filestore putter to localstore
acud 5edb70b
stream: increase batch size
acud 5471bdf
client: increase bitvector size again
acud c29204c
stream: fixed bug with full empty interval not sending back the corre…
acud 2cc03c3
smoke, stream: add more metrics, fix duplicate trackChunks
acud af0132c
retrieve: handle retrieve requests in a goroutine\
acud 3794ae2
retrieve: move goroutine launch to message handler
acud 2555544
netstore: move mutex for the 1+e11th time
acud edd5446
docker: change level
acud a8f5b17
network/newstream: set all chunks as synced in serverHandleWantedHashes
janos 5b243c1
stream: cleanup, more comments, reiterate cache semantics
acud 9b6d7d2
stream: fix compile err
acud 5c906db
newstream: add snapshot sync test
acud 8ebdefd
newstream: add snapshot sync test
acud 67d4f08
retrieve: skip peer which from findPeer which was not found in protoc…
acud 547e1a4
retrieve, stream: fix peers to skip, remove unused metric
acud 78a281c
api, network/newstream: add intervals to PeerStreams inspector response
janos 7ebc879
api: fix inspector
acud 2a2521f
network/newstream: add provider cursors to PeerInfo
janos 07e5e58
dockerfile: add jq and websocat
acud 3dd9fa1
api: convert peerInfo response to string
acud 6fd9eeb
api, network/newstream: return error from PeerInfo
janos 5308b68
api: inspector PeerStreams returns struct and add TestInspectorPeerSt…
janos ac6f356
network/newstream: truncate peer keys to 16 in PeerInfo
janos 133a909
api: inspector peer streams returns string, again
janos e1d38ee
network/newstream: add kademlia to PeerInfo response
janos 98aac6e
network/newstream: one intervals for registry in PeerInfo
janos c1b1dca
network/newstream: use bzz oaddr in peerStreamIntervalKey
janos 80b5705
smoke: change to bytes
acud 5e9024b
smoke: remove submitMetrics and add number of nodes metric
acud b00ce81
stream: move the locks again
acud c418705
network/newstream: encode sync stream keys with base 36 (#1727)
janos 6d466b9
stream: remove unnecessary shadowing
acud 120c034
network/stream: remove package
janos 9be1a68
network/simulation, pss, storage/localstore: fix tests
janos 61d7452
all: address some review comments
janos 4f311d3
network/stream/v2: fix BenchmarkHistoricalStream
janos 2a8bca9
Merge branch 'master' into new-syncer-gs
janos 94a4f83
Merge branch 'master' into new-syncer-gs
janos 0965d3c
network/stream/v2: enable TestSyncingViaGlobalSync on travis
janos 645f520
network/stream/v2: reduce TestSyncingViaGlobalSync test cases
janos ae2bf00
network/stream/v2: align want.remaining
janos 7b906c2
network/stream/v2: limit test cases on 386 arch
janos File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,66 @@ | ||
| package api | ||
|
|
||
| import ( | ||
| "crypto/rand" | ||
| "encoding/hex" | ||
| "io/ioutil" | ||
| "os" | ||
| "strings" | ||
| "testing" | ||
|
|
||
| "github.com/ethersphere/swarm/network" | ||
| stream "github.com/ethersphere/swarm/network/stream/v2" | ||
| "github.com/ethersphere/swarm/storage" | ||
| "github.com/ethersphere/swarm/storage/localstore" | ||
|
|
||
| "github.com/ethereum/go-ethereum/p2p/enode" | ||
| "github.com/ethereum/go-ethereum/rpc" | ||
| "github.com/ethersphere/swarm/state" | ||
| ) | ||
|
|
||
| // TestInspectorPeerStreams validates that response from RPC peerStream has at | ||
| // least some data. | ||
| func TestInspectorPeerStreams(t *testing.T) { | ||
| dir, err := ioutil.TempDir("", "swarm-") | ||
| if err != nil { | ||
| t.Fatal(err) | ||
| } | ||
| defer os.RemoveAll(dir) | ||
|
|
||
| baseKey := make([]byte, 32) | ||
| _, err = rand.Read(baseKey) | ||
| if err != nil { | ||
| t.Fatal(err) | ||
| } | ||
|
|
||
| localStore, err := localstore.New(dir, baseKey, &localstore.Options{}) | ||
| if err != nil { | ||
| t.Fatal(err) | ||
| } | ||
| netStore := storage.NewNetStore(localStore, baseKey, enode.ID{}) | ||
|
|
||
| i := NewInspector(nil, nil, netStore, stream.New(state.NewInmemoryStore(), baseKey, stream.NewSyncProvider(netStore, network.NewKademlia( | ||
| baseKey, | ||
| network.NewKadParams(), | ||
| ), false, false))) | ||
|
|
||
| server := rpc.NewServer() | ||
| if err := server.RegisterName("inspector", i); err != nil { | ||
| t.Fatal(err) | ||
| } | ||
|
|
||
| client := rpc.DialInProc(server) | ||
|
|
||
| var peerInfo string | ||
|
|
||
| err = client.Call(&peerInfo, "inspector_peerStreams") | ||
| if err != nil { | ||
| t.Fatal(err) | ||
| } | ||
|
|
||
| if !strings.Contains(peerInfo, `"base":"`+hex.EncodeToString(baseKey)[:16]+`"`) { | ||
| t.Error("missing base key in response") | ||
| } | ||
|
|
||
| t.Log(peerInfo) | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
comment exported functions