mycognosist / solar

A minimal Secure Scuttlebutt replication node.
Other
22 stars 2 forks source link

Improved EBT session tracking #91

Closed mycognosist closed 8 months ago

mycognosist commented 8 months ago

Active EBT sessions were previously tracked primarily using the request ID. This becomes problematic when multiple EBT sessions are active at the same time, since every peer starts with request number 1. Since each new connection is assigned a unique ID, this provides a natural mechanism for more accurately associating session events with a given peer.

The connection ID is now included in SendMessage and SendClock events. The MUXRPC EBT handler, upon receiving such an event, can then compare the connection ID against the connection ID it was invoked with - acting only if the two match. Other running instances of the handler will simply ignore those events which were not intended for them.

Session tracking still needs more work but there are steps in the right direction.

This PR is also in the process of making improvements to the handling of SessionConcluded, SessionTimeout and SessionError events.

Perhaps most importantly, this PR fixes https://github.com/mycognosist/solar/issues/89


There are still myriad entanglements between the EBT session manager and EBT MUXRPC handler; separation can come later.