libp2p / observer-toolkit

🐣 [WIP] toolkit for building libp2p introspection widgets + a few useful out-of-the-box widgets
https://libp2p.io
MIT License
2 stars 2 forks source link

[WIP] Update protobuf def for event types and DHT status changes #50

Closed AlanSl closed 4 years ago

AlanSl commented 4 years ago

I need to think about this some more and sanity-check the UI-side implementation, then will request reviews so we'll be ready to discuss it with PL on Monday.

Basic thinking:

Events metadata

Trying to keep this to the minimum that allows us to better display events. Fallback would be to display everything as strings if this runtime data is missing or an event doesn't fit the provided schema.

If the person configuring the introspection is able to define event types like this, I don't think we need the event subscribe / unsubscribe signalling we discussed.

DHT changes

"Age in bucket" was pretty confusing before and doesn't fit so well with the livelier picture we now have of peers potentially moving back and forth between a full bucket and the "replacement candidate" list. Bucket number is essentially a boolean as it's always either 0 or the peer ID's kadamelia distance. So, I think it makes more sense for a state message to contain the current status and a list of timestamped changes to the peer's status that occurred during the state message's time interval. Then the UI would interpolate those changes the same way it does queries.

This makes the handling of peers more consistent with the handling of queries and ensures the timing of the UI displaying queries is consistent with the timing of the UI displaying peer state changes or movements to a bucket.

AlanSl commented 4 years ago

I've simplified this a little and am confident it'd be a workable approach.

AlanSl commented 4 years ago

Obsolete, done in other PRs