ssbc / go-ssb

Go implementation of ssb (work in progress!)
https://scuttlebutt.nz
165 stars 23 forks source link

Follow up: EBT improvments #75

Open cryptix opened 3 years ago

cryptix commented 3 years ago

It would be really good to cover more of the unchecked tests in https://github.com/cryptoscope/ssb/pull/72#issuecomment-765297854

but mostly I'd love to see this stuff:

  1. [ ] Update the vector clock / want list not just once after connecting Currently the sets of feeds we want to receive is just send once when the connection is established. The JS documentation is a bit lacking about when to actually re-send those and thus confirm received messages. But also it doesn't send a clock update once we call sbot.Replicate(feed) - which means reception is delayed until a reconnect... at least this a part should be fixed before merging this.

  2. [ ] Implement a more scalable solution to canceling individual feed subscriptions Right now there is a context per feed. This works but is inefficient. Probably need to re-work the multisink so that they can be unsubscribed directly.

  3. [ ] Partition sets of feeds over multiple connections One of the advantages of ebt, other then not asking about feeds that didn't change, is receiving feeds from the best known source. For this we need a bit of heuristics, like ping to the peer and who has messages sooner.

Preliminary testing results: functional but a couple of glitches.

cryptix commented 3 years ago

@arj03 found a bug ( https://github.com/ssbc/epidemic-broadcast-trees/pull/42 ) where a peer received a message, confirmed it but then looses it somehow.

It's a great test case (dealing with misbehaving remote peers correctly). Reproducing this right now would require stopping the go-ssb peer, truncating the log, re-indexing and then connecting again.

"reboot" tests are on the table anyhow to check the state matrix persistence worked as intended.