Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gossipsub #67

Merged
merged 50 commits into from
Jul 11, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
8680a79
add Join/Leave to PubSubRouter interface
vyzo Feb 3, 2018
448f380
gossipsub: router outline
vyzo Feb 16, 2018
b09c9d1
check and mark seen messages prior to validation
vyzo Feb 19, 2018
458c75b
add TODO for reliable announcements
vyzo Feb 19, 2018
d610409
increase timeCache length to 120s
vyzo Feb 19, 2018
b867200
gossipsub: heartbeat timer
vyzo Feb 19, 2018
375c417
gossipsub publish
vyzo Feb 19, 2018
dd50a31
add gossipsub control messages
vyzo Feb 19, 2018
6a177a7
handle gossipsub control messages
vyzo Feb 19, 2018
e1fbe11
refactor Publish to use getPeers
vyzo Feb 19, 2018
34509d4
implement Join and Leave, refactor sendRPC
vyzo Feb 19, 2018
73da341
hearbeat preliminaries: overlay management
vyzo Feb 19, 2018
bc25116
clean peers that have left the topic on heartbeat
vyzo Feb 20, 2018
78618fc
maintain fanout peer lists on heartbeat
vyzo Feb 20, 2018
7251c64
control message piggybacking logic
vyzo Feb 20, 2018
74a10cf
piggybacking details
vyzo Feb 20, 2018
07875f1
implement flush
vyzo Feb 20, 2018
8fbc4e1
implement mcache
vyzo Feb 20, 2018
64d3599
shuffle peers
vyzo Feb 20, 2018
0e288dc
delete mesh before sending prunes on leave
vyzo Feb 20, 2018
c5fe290
reduce gossip amplification; don't send to mesh peers
vyzo Feb 20, 2018
bd29e81
history and gossip length are named constants
vyzo Feb 20, 2018
64cdbba
remove pending gossip and control messages on RemovePeer
vyzo Feb 20, 2018
599ccff
shift the message history window at the end of the heartbeat
vyzo Feb 21, 2018
060a9bb
mcache test
vyzo Feb 21, 2018
1f5959b
fix slice bounds issues; getCount takes care of the slicing
vyzo Feb 21, 2018
0a82522
basic gossipsub tests
vyzo Feb 21, 2018
626b04f
fix go vet issues in mcache test
vyzo Feb 21, 2018
66fc8ad
more gossipsub tests
vyzo Feb 21, 2018
5533949
finetune gossip test, add join grafting test
vyzo Feb 21, 2018
75787fb
moar gossipsub tests
vyzo Feb 21, 2018
3ecfbc2
better test for fanout maintenance
vyzo Feb 21, 2018
4667b0a
fanout sources should emit gossip too
vyzo Feb 21, 2018
e8c5cf0
test gossip propagation with IHAVE/IWANT cycle
vyzo Feb 21, 2018
ef73062
remove unnecessary and potentially harmful check from heartbeat
vyzo Feb 21, 2018
285c1f0
add test for graft/prune coalescing in heartbeat
vyzo Feb 21, 2018
af061f5
refactor sendGraftPrune out of heartbeat
vyzo Feb 22, 2018
bfb0664
retry dropped ANNOUNCE messages
vyzo Feb 22, 2018
009efeb
harden piggybackControl
vyzo Feb 22, 2018
f5d6cf3
TestGossipsubGraftPruneCoalesce is TestGossipsubGraftPruneRetry
vyzo Feb 22, 2018
a71eec5
test control message retry piggybacking
vyzo Feb 22, 2018
0824316
finetune GraftPruneRetry test, so that it doesn't get OOM killed
vyzo Feb 22, 2018
2544ae7
announce retry should check the pubsub context for cancellation
vyzo Mar 6, 2018
a39184a
smaller net sizes for tests that exercise full queues
vyzo Mar 6, 2018
c57d256
increase the flood length in TestGossipsubControlPiggyback
vyzo Mar 6, 2018
e8a91d3
document PubSubRouter interface
vyzo Mar 10, 2018
d6dfe83
refactor nextSeqno out of Publish
vyzo Mar 10, 2018
b490d11
make heartbeat interval a parameter, turn all gossipsub parameters in…
vyzo Mar 10, 2018
1dc8405
more docs for gossipsub router, expire fanout peers when we haven't p…
vyzo Mar 10, 2018
1b4fbb8
fix NewPubsub docstring
vyzo May 5, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions comm.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,3 +104,21 @@ func rpcWithSubs(subs ...*pb.RPC_SubOpts) *RPC {
func rpcWithMessages(msgs ...*pb.Message) *RPC {
return &RPC{RPC: pb.RPC{Publish: msgs}}
}

func rpcWithControl(msgs []*pb.Message,
ihave []*pb.ControlIHave,
iwant []*pb.ControlIWant,
graft []*pb.ControlGraft,
prune []*pb.ControlPrune) *RPC {
return &RPC{
RPC: pb.RPC{
Publish: msgs,
Control: &pb.ControlMessage{
Ihave: ihave,
Iwant: iwant,
Graft: graft,
Prune: prune,
},
},
}
}
4 changes: 4 additions & 0 deletions floodsub.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,3 +78,7 @@ func (fs *FloodSubRouter) Publish(from peer.ID, msg *pb.Message) {
}
}
}

func (fs *FloodSubRouter) Join(topic string) {}

func (fs *FloodSubRouter) Leave(topic string) {}
10 changes: 9 additions & 1 deletion floodsub_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,16 @@ func connect(t *testing.T, a, b host.Host) {
}

func sparseConnect(t *testing.T, hosts []host.Host) {
connectSome(t, hosts, 3)
}

func denseConnect(t *testing.T, hosts []host.Host) {
connectSome(t, hosts, 10)
}

func connectSome(t *testing.T, hosts []host.Host, d int) {
for i, a := range hosts {
for j := 0; j < 3; j++ {
for j := 0; j < d; j++ {
n := rand.Intn(len(hosts))
if n == i {
j--
Expand Down
Loading