mycognosist / solar

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

Event driven connections with message passing #81

Closed mycognosist closed 8 months ago

mycognosist commented 8 months ago

This PR introduces a major refactor of the TCP connection life-cycle handling.

Connection data (including the TCP stream) is now passed to the connection manager and each phase of the cycle is handled there. This deviates from the previous approach where data was passed between various methods and the connection manager was mostly playing the role of registering connections and logging the steps. The connection life-cycle should now be easier to follow.

The refactor was prompted by my early explorations into adding EBT support. I soon realised that I needed to be able to take ownership of the stream in order to run an EBT loop.

Replication has been successfully tested between two solar instances and a solar and Patchwork instance.

mycognosist commented 8 months ago

Note: the build currently fails because I have temporarily changed the kuska-ssb dependency to a local path. This is because I had to commit changes to kuska-handshake and am awaiting a PR merge (https://github.com/Kuska-ssb/handshake/pull/80).