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

Register plugin hook explicit deserialize #3647

Conversation

rustyrussell
Copy link
Contributor

Noticed flakiness in #3611 where the payload replacement sometimes didn't work. The underlying reason is that we had the keysend plugin also on the htlc_accepted hook, and we only processed the results from the final hook.

To be fair, @cdecker's original hook design explicitly separated the demarshalling from the callback step; I've returned to a similar mode, but only for chained hooks. We could probably convert the rest after release.

Unfortunately, this means #3611 would need rebasing on this PR :(

We have several of these, and they're not always called obvious things like
"delete" or "free".  `STEALS` provides a strong hint here.

I only added it to a couple I knew about off the top of my head.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
@rustyrussell rustyrussell added this to the 0.8.2 milestone Apr 15, 2020
@rustyrussell rustyrussell requested a review from cdecker April 15, 2020 07:29
@rustyrussell rustyrussell force-pushed the register-plugin-hook-explicit-deserialize branch from 7a3afba to 7aa0403 Compare April 15, 2020 10:15
…s explicit.

They callback must take ownership of the payload (almost all do, but
now it's explicit).

And since the payload and cb_arg arguments to plugin_hook_call_() are
always identical, make them a single parameter.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
One is called on every plugin return, and tells us whether to continue;
the other is only called if every plugin says ok.

This works for things like payload replacement, where we need to process
the results from each plugin, not just the final one!

We should probably turn everything into a chained callback next
release.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
@rustyrussell rustyrussell force-pushed the register-plugin-hook-explicit-deserialize branch from 7aa0403 to c1ee2ab Compare April 15, 2020 10:22
@rustyrussell rustyrussell merged commit deac099 into ElementsProject:master Apr 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant