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

cln_plugin : Support wildcard subscriptions #7106

Merged

Conversation

ErikDeSmedt
Copy link
Contributor

In Core Lightning plugins can subscribe to notifications using a wildcard *.
When the wildcard is used the plugin will receive all notifications.

This behavior was not supported by cln_plugin.
The first 2 commits create a plug-in that listens to the the wildcard *-subscription
and test the behavior. It appears that cln_plugin accepts the subscription but fails when the first plug-in message
is received.

The last commit adapts the cln_plugin-crate to support the wildcard.

@ErikDeSmedt ErikDeSmedt requested a review from cdecker as a code owner February 23, 2024 10:54
@ErikDeSmedt
Copy link
Contributor Author

ErikDeSmedt commented Feb 23, 2024

This PR is also useful to support sending notifications over GRPC. (See #7084)

For this plug-in it is useful to subscribe to all notifications.

@ErikDeSmedt ErikDeSmedt force-pushed the rust_subscribe_wildcard branch from 7e0ee1f to ebf67c8 Compare February 23, 2024 13:50
@cdecker cdecker self-assigned this Mar 25, 2024
@cdecker cdecker added this to the v24.05 milestone Mar 25, 2024
tests/test_cln_rs.py Show resolved Hide resolved
Creates an example package that subscribes to all notifications and logs
them. This is useful for testing the behavior of subscribing to "*".

I've also edited the Makefile to ensure that `make` builds the example
and that `make clean` removes the example
This test reproduces a bug in the `cln-plugin`-crate.
Core Lightning supports a wildcard `*` that plugins can use to
subscribe to all notifications.

However, `cln-plugin` does not support this case.
It allows the developer to subscribe `*`.
But the plug-in crashes when the first notification is received
Adapts `cln_plugin` to make it support wildcard `*`-subscriptions.
@ErikDeSmedt ErikDeSmedt force-pushed the rust_subscribe_wildcard branch from ebf67c8 to e32e654 Compare March 25, 2024 15:25
@ErikDeSmedt
Copy link
Contributor Author

I think the issues addressed by @rustyrussell have been fixed.
@endothermicdev: Could you merge this one cause it blocks #7084

Copy link
Member

@cdecker cdecker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK e32e654

@endothermicdev endothermicdev merged commit f1dc64b into ElementsProject:master Apr 30, 2024
35 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants