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

Deprecations and spec updates post-0.12 #5490

Merged
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
2003a1b
test: fix tlvs test in funding_locked tlv.
rustyrussell Sep 10, 2022
1657202
wire/test: neaten and complete tlv checks.
rustyrussell Sep 10, 2022
0bb9cc3
common: remove unused parameter "allow_deprecated" from parse_wireadd…
rustyrussell Sep 10, 2022
e241348
lightningd: remove double-wrapped rpc_command hook.
rustyrussell Sep 10, 2022
986a0c2
lightningd: always require "jsonrpc": "2.0" in request.
rustyrussell Sep 10, 2022
560b7ef
lightningd: don't allow old listforwards arg order.
rustyrussell Sep 10, 2022
13738d1
lightningd: do inline parsing for listforwards status parameter
rustyrussell Sep 10, 2022
c6b2832
plugins: require usage for plugin APIs.
rustyrussell Sep 10, 2022
ffd6b70
lightningd: remove `use_proxy_always` parameter to plugin init.
rustyrussell Sep 10, 2022
185be8d
listchannels: don't show "htlc_maximum_msat" if channel_update didn't…
rustyrussell Sep 10, 2022
b90ba77
offers: update to remove "vendor" and "timestamp" fields.
rustyrussell Sep 10, 2022
258cdf8
offers: remove backwards-compatiblity invoice_request signatures.
rustyrussell Sep 10, 2022
d3a573d
hsmtool: remove hsm_secret passwords on cmdline support in `dumponcha…
rustyrussell Sep 10, 2022
a0eeb0b
devtools/bolt-catchup.sh: a tool to update the specs, one commit at a…
rustyrussell Sep 10, 2022
00bce5e
doc: increase BOLT level to 03468e17563650fb9bfe58b2da4d1e5d28e92009
rustyrussell Sep 10, 2022
4543a7d
doc: update BOLTs to bc86304b4b0af5fd5ce9d24f74e2ebbceb7e2730
rustyrussell Sep 10, 2022
cbb569e
channeld/dualopend/lightningd: use channel_ready everywhere.
rustyrussell Sep 10, 2022
7580973
doc: upgrade to BOLTs 2ecc091f3484f7a3450e7f5543ae851edd1e0761
rustyrussell Sep 10, 2022
4d6efb4
doc: upgrade to BOLTs 341ec844f13c0c0abc4fe849059fbb98173f9766
rustyrussell Sep 10, 2022
380ee93
doc: include recent BOLT recommendation on grace period.
rustyrussell Sep 10, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 10 additions & 16 deletions lightningd/jsonrpc.c
Original file line number Diff line number Diff line change
Expand Up @@ -677,7 +677,7 @@ static void replace_command(struct rpc_command_hook_payload *p,
const char *buffer,
const jsmntok_t *replacetok)
{
const jsmntok_t *method = NULL, *params = NULL;
const jsmntok_t *method = NULL, *params = NULL, *jsonrpc;
const char *bad;

/* Must contain "method", "params" and "id" */
Expand Down Expand Up @@ -709,14 +709,10 @@ static void replace_command(struct rpc_command_hook_payload *p,
goto fail;
}

// deprecated phase to give the possibility to all to migrate and stay safe
// from this more restrictive change.
if (!deprecated_apis) {
const jsmntok_t *jsonrpc = json_get_member(buffer, replacetok, "jsonrpc");
if (!jsonrpc || jsonrpc->type != JSMN_STRING || !json_tok_streq(buffer, jsonrpc, "2.0")) {
bad = "jsonrpc: \"2.0\" must be specified in the request";
goto fail;
}
jsonrpc = json_get_member(buffer, replacetok, "jsonrpc");
if (!jsonrpc || jsonrpc->type != JSMN_STRING || !json_tok_streq(buffer, jsonrpc, "2.0")) {
bad = "jsonrpc: \"2.0\" must be specified in the request";
Copy link
Contributor

@Sjors Sjors Dec 3, 2022

Choose a reason for hiding this comment

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

I think this broke the BTCPay server integration… cc @NicolasDorier

btcpayserver/btcpayserver#4399

Copy link
Contributor

Choose a reason for hiding this comment

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

The broken part is the RPC library used inside it

goto fail;
}

was_pending(command_exec(p->cmd->jcon, p->cmd, buffer, replacetok,
Expand Down Expand Up @@ -853,7 +849,7 @@ REGISTER_PLUGIN_HOOK(rpc_command,
static struct command_result *
parse_request(struct json_connection *jcon, const jsmntok_t tok[])
{
const jsmntok_t *method, *id, *params;
const jsmntok_t *method, *id, *params, *jsonrpc;
struct command *c;
struct rpc_command_hook_payload *rpc_hook;
bool completed;
Expand Down Expand Up @@ -881,13 +877,11 @@ parse_request(struct json_connection *jcon, const jsmntok_t tok[])

// Adding a deprecated phase to make sure that all the Core Lightning wrapper
// can migrate all the frameworks
if (!deprecated_apis) {
const jsmntok_t *jsonrpc = json_get_member(jcon->buffer, tok, "jsonrpc");
jsonrpc = json_get_member(jcon->buffer, tok, "jsonrpc");

if (!jsonrpc || jsonrpc->type != JSMN_STRING || !json_tok_streq(jcon->buffer, jsonrpc, "2.0")) {
json_command_malformed(jcon, "null", "jsonrpc: \"2.0\" must be specified in the request");
return NULL;
}
if (!jsonrpc || jsonrpc->type != JSMN_STRING || !json_tok_streq(jcon->buffer, jsonrpc, "2.0")) {
json_command_malformed(jcon, "null", "jsonrpc: \"2.0\" must be specified in the request");
return NULL;
}

/* Allocate the command off of the `jsonrpc` object and not
Expand Down