maidsafe / safe_network

72 stars 40 forks source link

LocalFirst Swarm #1981

Closed joshuef closed 1 month ago

joshuef commented 1 month ago

As laid out nicely here https://github.com/libp2p/rust-libp2p/blob/master/docs/coding-guidelines.md#prioritize-local-work-over-new-work-from-a-remote

we now handle local cmds first, with higher priority, keeping latency for these low


This pull request primarily involves refactoring of the SwarmCmd structure into two separate structures: LocalSwarmCmd and NetworkSwarmCmd in the sn_networking/src/driver.rs and sn_networking/src/lib.rs files. This modification is aimed at separating local commands from network commands, improving the organization and readability of the code.

Here are the most important changes:

Refactoring of SwarmCmd:

These changes enhance the separation of concerns in the codebase, making it easier to manage and understand the different types of commands that can be sent in the network.