Uh oh!
There was an error while loading. Please reload this page.
Unify common message handler traits into one trait - #3594
Merged
wpaulino merged 3 commits intoMar 5, 2025
Conversation
tnull
reviewed
Feb 10, 2025
tnull
left a comment
Contributor
There was a problem hiding this comment.
Cool! Unfortunately currently breaks RUSTFLAGS=--cfg=async_payments
TheBlueMattforce-pushed
the
2025-02-peer-connected-trait
branch
from
February 10, 2025 14:10
7289b80 to
6562669CompareTheBlueMatt
commented
Feb 10, 2025
CollaboratorAuthor
Oops, fixed. |
tnull
commented
Feb 10, 2025
Contributor
Unfortunately |
TheBlueMattforce-pushed
the
2025-02-peer-connected-trait
branch
from
February 10, 2025 15:49
6562669 to
3fcd949CompareTheBlueMatt
commented
Feb 10, 2025
CollaboratorAuthor
Grr, I really need to fix the CI script so I can run it locally top-to-bottom :/ |
wpaulino
previously approved these changes
Feb 10, 2025
TheBlueMatt
commented
Feb 11, 2025
CollaboratorAuthor
Gonna at least wait for #3575 and maybe one of the followups for it. Should be pretty straightforward to rebase this. |
wpaulino
commented
Feb 26, 2025
Contributor
Needs a rebase now that the dependent PR was merged |
TheBlueMattforce-pushed
the
2025-02-peer-connected-trait
branch
from
February 26, 2025 21:39
3fcd949 to
d663e08CompareTheBlueMatt
commented
Feb 26, 2025
CollaboratorAuthor
Rebased, I think we can land this now. |
wpaulino
previously approved these changes
Feb 26, 2025
tnull
commented
Mar 3, 2025
Contributor
@TheBlueMatt Ah, seems unfortunately this needs another rebase before it can land. |
TheBlueMattforce-pushed
the
2025-02-peer-connected-trait
branch
from
March 4, 2025 02:04
d663e08 to
8e25fe9CompareTheBlueMatt
commented
Mar 4, 2025
CollaboratorAuthor
Sorry, rebased. |
tnull
commented
Mar 4, 2025
Contributor
CI unfortunately still broken: |
TheBlueMattforce-pushed
the
2025-02-peer-connected-trait
branch
from
March 5, 2025 01:26
8e25fe9 to
5291676CompareCollaboratorAuthor
Grrr, I fixed it locally and forgot to push. Had to rebase again anyway. |
Instead of having each `*MessageHandler` implement the same `peer_connected`, `peer_disconnected`, `provided_init_features`, and `provided_node_features` methods, here we pull them all out into one common trait and make all the message handlers extend it. Since `get_and_clear_pending_msg_events` was also common we also move that into the same trait, dropping the `MessageSendEventsProvider` trait. Best reviewed with `--color-moved`
`MessageSendEvent` got placed in the `events` module next to `Event` but it really doesn't make a whole lot of sense to be there (despite the superficially similar name). `MessageSendEvent`s aren't really "events" so much as simply queued messages, handled by the `PeerManager` rather than the user. Further, they're used entirely by structs implementing the traits in `ln::msgs` and basically define an enum over `ln::msgs` structs. Thus, it only really makes sense to have them in `ln::msgs`, which we do here.
TheBlueMattforce-pushed
the
2025-02-peer-connected-trait
branch
from
March 5, 2025 01:27
5291676 to
10a78d2Comparewpaulino
approved these changes
Mar 5, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Instead of having each
*MessageHandlerimplement the samepeer_connected,peer_disconnected,provided_init_features,and
provided_node_featuresmethods, here we pull them all outinto one common trait and make all the message handlers extend it.
Since
get_and_clear_pending_msg_eventswas also common we alsomove that into the same trait, dropping the
MessageSendEventsProvidertrait.As requested by @tnull.