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: Allow user to set featurebits #6881

Merged

Conversation

ErikDeSmedt
Copy link
Contributor

No description provided.

@ErikDeSmedt
Copy link
Contributor Author

This commit is good to go. The CI failed because of a flake?

@cdecker
Copy link
Member

cdecker commented Nov 17, 2023

Yes, looking into the failures they all look like flakes. I'll restart them, and during the next days I will add another flake-disable PR, based on the flakiness tracking.

Copy link
Collaborator

@nepet nepet left a comment

Choose a reason for hiding this comment

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

Looks good to me, just some minor nit-picking here ^^

ACK 46c1d14

plugins/src/lib.rs Outdated Show resolved Hide resolved
@@ -345,6 +358,7 @@ where
hooks: self.hooks.keys().map(|s| s.clone()).collect(),
rpcmethods,
notifications: self.notifications.clone(),
featurebits: self.featurebits.clone().to_message(),
Copy link
Collaborator

@nepet nepet Jan 12, 2024

Choose a reason for hiding this comment

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

Is this clone really needed? Can't call the to_message() method that returns a serializable struct (same struct as the "builder" but serde annotated) without cloning the builder struct?

I guess the "builder" is just for separation of concerns, as it contains the exact same fields as the message type?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I see your point here.

The FeatureBitBuilder is indeed for separation of concerns and was a bit overkill. I made it back into one type.

The problem here is not in the conversion of to_message(). The core problem is that the Builder must outlive the GetManifestResponse.

We could add a lifetime to GetManifestResponse and borrow the FeatureBits instead.
However, I don't think it's worth the engineering-time to save a few allocations at plugin-start.

@ErikDeSmedt ErikDeSmedt force-pushed the cln-plugin-set-featurebits branch 3 times, most recently from 6f40a8d to b222a74 Compare January 12, 2024 13:54
Copy link
Collaborator

@vincenzopalazzo vincenzopalazzo left a comment

Choose a reason for hiding this comment

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

ACK b222a74

plugins/src/lib.rs Outdated Show resolved Hide resolved
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.

@ErikDeSmedt I left one small comment regarding naming convention, but that's not important and we're splitting hairs at this point.

If you're happy ith the current state I'll merge it, or if you'd like to do a quick fixup I'll wait a couple of days 👍

ACK b222a74

@cdecker cdecker added this to the v24.02 milestone Jan 17, 2024
@ErikDeSmedt
Copy link
Contributor Author

@cdecker : I agree that FeatureBitsKind is a better name.

I've renamed it in a separate commit

@cdecker cdecker enabled auto-merge (rebase) January 31, 2024 12:02
@cdecker cdecker merged commit 085960b into ElementsProject:master Jan 31, 2024
31 of 36 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.

None yet

4 participants