-
Notifications
You must be signed in to change notification settings - Fork 906
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
libplugin: use json stream helpers and add sanity tests #3480
libplugin: use json stream helpers and add sanity tests #3480
Conversation
5e8e9ca
to
f39e40f
Compare
Rebased after #3443 rebase. |
fc74bef
to
66c0ae3
Compare
Re-rebased :) |
66c0ae3
to
10dfa1f
Compare
10dfa1f
to
ede4582
Compare
I'm not really happy with the read after free fix, if there are suggestions.. |
The "technically correct" answer is to create the infrastructure to unregister options in ccan/opt. To do anything else risks duplicate options in the option table as we remove then re-add a plugin. Let me create that now... |
b5f41a9
to
9746a94
Compare
The usual json_stream starters and command_result enders.
This adds helpers to start and send a jsonrpc request using json_stream in order to benefit from the helpers. This then simplifies existing plugins RPC requests by using json_stream helpers.
We mark the test as xfail() as it exposes that libplugin's PLUGIN_RESTARTABLE was not taken into account !
As a separated commit because it was pre-existent (changelog + xfail test). This also fix a logical problem in lightningd/plugin_control: we were assuming a plugin started with 'plugin start' but which did not comport a 'dynamic' entry in its manifest to be dynamic, though it should have been treated as static. Changelog-fixed: plugins: Dynamic C plugins can now be managed when lightningd is up
Co-authored-by: Rusty Russell <[email protected]>
9746a94
to
45a06db
Compare
This also remove the now duplicate plugin_hook_unregister_all(), added in the tal destructor of the struct plugin.
45a06db
to
77e7f0f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ack 77e7f0f
* This undoes opt_register[_early]_[no]arg. Returns true if the option was | ||
* found, otherwise false. | ||
*/ | ||
bool opt_unregister(const char *names); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BTW, CCAN updates should be done via "make update-ccan" (optional: CCAN_NEW="". Assumes that ccan you want is in ../ccan.
Easy to fix this post, however.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did it this way then withdrawn it because of the huge diff, will fix!
@@ -791,6 +791,7 @@ def test_rpc_command_hook(node_factory): | |||
l1.rpc.plugin_stop('rpc_command.py') | |||
|
|||
|
|||
@flaky |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this now @flaky?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because it started failing randomly on Travis but I was not able to reproduce locally..
Btw, i can no longer restart Travis jobs.. Don't know if it's a perm error or anything
This is a follow-up to #3443 (based on it and implements the first of the left TODOs).
This moves all plugins from "raw"
jout
s to using higher-leveljson_stream
helpers.This also adds sanity functional tests for libplugin plugins, which uncovered a bug.