From 9628665a6dedcaa81be42589efe287c389d0f230 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Tue, 15 Sep 2020 14:23:08 +0930 Subject: [PATCH 1/6] lightningd: remove deprecated plugin entries. Signed-off-by: Rusty Russell Changelog-Removed: JSON API: `listconfigs` duplicated "plugin" paths (deprecated 0.8.0) --- lightningd/plugin.c | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/lightningd/plugin.c b/lightningd/plugin.c index 9220d77f357f..e5704b8d66a4 100644 --- a/lightningd/plugin.c +++ b/lightningd/plugin.c @@ -1559,18 +1559,8 @@ void json_add_opt_plugins_array(struct json_stream *response, void json_add_opt_plugins(struct json_stream *response, const struct plugins *plugins) { - struct plugin *p; - json_add_opt_plugins_array(response, "plugins", plugins, false); json_add_opt_plugins_array(response, "important-plugins", plugins, true); - - /* DEPRECATED: duplicated JSON "plugin" entries */ - if (deprecated_apis) { - list_for_each(&plugins->plugins, p, list) { - json_add_string(response, p->important ? "important-plugin" : "plugin", p->cmd); - } - } - } void json_add_opt_disable_plugins(struct json_stream *response, From 881bf933a710ba760aa16bbc1704b7c909d3c78f Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Tue, 15 Sep 2020 14:23:11 +0930 Subject: [PATCH 2/6] lightningd: remove deprecated per_hop_v0 in htlc hook. Changelog-Removed: JSON API: `htlc_accepted` hook `per_hop_v0` object removed (deprecated 0.8.0) Signed-off-by: Rusty Russell --- lightningd/peer_htlcs.c | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/lightningd/peer_htlcs.c b/lightningd/peer_htlcs.c index 5729b91729bc..c83abdcfe5f0 100644 --- a/lightningd/peer_htlcs.c +++ b/lightningd/peer_htlcs.c @@ -987,17 +987,6 @@ static void htlc_accepted_hook_serialize(struct htlc_accepted_hook_payload *p, if (p->payload) { switch (p->payload->type) { case ONION_V0_PAYLOAD: - if (deprecated_apis) { - json_object_start(s, "per_hop_v0"); - json_add_string(s, "realm", "00"); - json_add_short_channel_id(s, "short_channel_id", - p->payload->forward_channel); - json_add_amount_msat_only(s, "forward_amount", - p->payload->amt_to_forward); - json_add_u64(s, "outgoing_cltv_value", - p->payload->outgoing_cltv); - json_object_end(s); - } json_add_string(s, "type", "legacy"); break; From 89701bd34ca9200eea59d6c895a71ea5a4d5b846 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Tue, 15 Sep 2020 14:23:11 +0930 Subject: [PATCH 3/6] lightningd: remove deprecated return for `db_write` hook. Changelog-Removed: JSON API: The hook `db_write` can no longer return `true` (deprecated in 0.8.1) Signed-off-by: Rusty Russell --- lightningd/plugin_hook.c | 27 --------------------------- 1 file changed, 27 deletions(-) diff --git a/lightningd/plugin_hook.c b/lightningd/plugin_hook.c index 2d32d9f6fe2a..1551523967a1 100644 --- a/lightningd/plugin_hook.c +++ b/lightningd/plugin_hook.c @@ -299,33 +299,6 @@ static void db_hook_response(const char *buffer, const jsmntok_t *toks, fatal("Plugin returned an invalid response to the db_write " "hook: %s", buffer); -#ifdef COMPAT_V080 - /* For back-compatibility we allow to return a simple Boolean true. */ - if (deprecated_apis) { - bool resp; - if (json_to_bool(buffer, resulttok, &resp)) { - static bool warned = false; - /* If it fails, we must not commit to our db. */ - if (!resp) - fatal("Plugin returned failed db_write: %s.", - buffer); - if (!warned) { - warned = true; - log_unusual(ph_req->db->log, - "Plugin returned 'true' to " - "'db_hook'. " - "This is now deprecated and " - "you should return " - "{'result': 'continue'} " - "instead."); - } - /* Resume. */ - io_break(ph_req); - return; - } - } -#endif /* defined(COMPAT_V080) */ - /* We expect result: { 'result' : 'continue' }. * Anything else we abort. */ From 99fcb7a4760005c2f11c22f9efb6b2c210749a9b Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Tue, 15 Sep 2020 14:23:11 +0930 Subject: [PATCH 4/6] lightningd: remove deprecated rpc_command hook return. Signed-off-by: Rusty Russell Changelog-Removed: JSON API: The hook `rpc_command` returning `{"continue": true}` (deprecated 0.8.1) --- lightningd/jsonrpc.c | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/lightningd/jsonrpc.c b/lightningd/jsonrpc.c index fc4b83fd7337..49fa83fbb7c4 100644 --- a/lightningd/jsonrpc.c +++ b/lightningd/jsonrpc.c @@ -712,28 +712,6 @@ rpc_command_hook_callback(struct rpc_command_hook_payload *p STEALS, return was_pending(command_exec(p->cmd->jcon, p->cmd, p->buffer, p->request, params)); -#ifdef COMPAT_V080 - if (deprecated_apis) { - const jsmntok_t *tok_continue; - bool exec; - tok_continue = json_get_member(buffer, resulttok, "continue"); - if (tok_continue && json_to_bool(buffer, tok_continue, &exec) && exec) { - static bool warned = false; - if (!warned) { - warned = true; - log_unusual(p->cmd->ld->log, - "Plugin returned 'continue' : true " - "to rpc_command hook. " - "This is now deprecated and " - "you should return with " - "{'result': 'continue'} instead."); - } - return was_pending(command_exec(p->cmd->jcon, p->cmd, p->buffer, - p->request, params)); - } - } -#endif /* defined(COMPAT_V080) */ - innerresulttok = json_get_member(buffer, resulttok, "result"); if (innerresulttok) { if (json_tok_streq(buffer, innerresulttok, "continue")) { From b1f76e72767d0f94eb9ed115d631d598af42173e Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Tue, 15 Sep 2020 14:23:12 +0930 Subject: [PATCH 5/6] lightningd: remove deprecated result for `plugin stop`. Changelog-Removed: JSON API: `plugin stop` result with an empty ("") key (deprecated 0.8.1) Signed-off-by: Rusty Russell --- lightningd/plugin_control.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/lightningd/plugin_control.c b/lightningd/plugin_control.c index 047122a05e66..523c14d8c25f 100644 --- a/lightningd/plugin_control.c +++ b/lightningd/plugin_control.c @@ -114,10 +114,6 @@ plugin_dynamic_stop(struct command *cmd, const char *plugin_name) plugin_name); plugin_kill(p, "stopped by lightningd via RPC"); response = json_stream_success(cmd); - if (deprecated_apis) - json_add_string(response, "", - take(tal_fmt(NULL, "Successfully stopped %s.", - plugin_name))); json_add_string(response, "result", take(tal_fmt(NULL, "Successfully stopped %s.", plugin_name))); From 369c5991b5f84dca488f21d0c8233f7c13601df0 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Tue, 15 Sep 2020 14:23:12 +0930 Subject: [PATCH 6/6] lightningd: really remove relative plugins dirs. We promised this in 0.8.1! Signed-off-by: Rusty Russell Changelog-Removed: Plugin: Relative plugin paths are not relative to startup (deprecated v0.7.2.1) --- lightningd/plugin.c | 22 ++++------------------ 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/lightningd/plugin.c b/lightningd/plugin.c index e5704b8d66a4..476682beea71 100644 --- a/lightningd/plugin.c +++ b/lightningd/plugin.c @@ -1223,24 +1223,10 @@ char *add_plugin_dir(struct plugins *plugins, const char *dir, bool error_ok) struct plugin *p; if (!d) { - if (deprecated_apis && !path_is_abs(dir)) { - dir = path_join(tmpctx, - plugins->ld->original_directory, dir); - d = opendir(dir); - if (d) { - log_unusual(plugins->log, "DEPRECATED WARNING:" - " plugin-dir is now relative to" - " lightning-dir, please change to" - " plugin-dir=%s", - dir); - } - } - if (!d) { - if (!error_ok && errno == ENOENT) - return NULL; - return tal_fmt(NULL, "Failed to open plugin-dir %s: %s", - dir, strerror(errno)); - } + if (!error_ok && errno == ENOENT) + return NULL; + return tal_fmt(NULL, "Failed to open plugin-dir %s: %s", + dir, strerror(errno)); } while ((di = readdir(d)) != NULL) {