Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[2/4] - peer: add new abstract message router #8520

Merged
merged 4 commits into from
Aug 16, 2024
Merged

Commits on Aug 15, 2024

  1. msgmux: add new abstract message router

    In this commit, we add a new abstract message router. Over time, the
    goal is that this message router replaces the logic we currently have in
    the readHandler (the giant switch for each message).
    
    With this new abstraction, can reduce the responsibilities of the
    readHandler to *just* reading messages off the wire and handing them off
    to the msg router. The readHandler no longer needs to know *where* the
    messages should go, or how they should be dispatched.
    
    This will be used in tandem with the new `protofsm` module in an
    upcoming PR implementing the new rbf-coop close.
    Roasbeef committed Aug 15, 2024
    Configuration menu
    Copy the full SHA
    f124195 View commit details
    Browse the repository at this point in the history
  2. peer: update readHandler to dispatch to msgRouter if set

    Over time with this, we should be able to significantly reduce the size
    of the peer.Brontide struct as we only need all those deps as the peer
    needs to recognize and handle each incoming wire message itself.
    Roasbeef committed Aug 15, 2024
    Configuration menu
    Copy the full SHA
    927aa84 View commit details
    Browse the repository at this point in the history
  3. multi: make MsgRouter available in the ImplementationCfg

    With this commit, we allow the `MsgRouter` to be available in the
    `ImplementationCfg`. With this, programs outside of lnd itself are able
    to now hook into the message processing flow to direct handle custom
    messages, and even normal wire messages.
    Roasbeef committed Aug 15, 2024
    Configuration menu
    Copy the full SHA
    b028af1 View commit details
    Browse the repository at this point in the history
  4. peer: don't stop global msg router

    In this commit, we fix a bug that would cause a global message router to
    be stopped anytime a peer disconnected. The global msg router only
    allows `Start` to be called once, so afterwards, no messages would
    properly be routed.
    Roasbeef committed Aug 15, 2024
    Configuration menu
    Copy the full SHA
    f09c517 View commit details
    Browse the repository at this point in the history