Skip to content

doc: name parsefeerate's parameter feerate, as lightningd does - #9703

Open
amartya1523 wants to merge 2 commits into
ElementsProject:masterfrom
amartya1523:fix/parsefeerate-schema-param
Open

amartya1523 wants to merge 2 commits into
ElementsProject:masterfrom
amartya1523:fix/parsefeerate-schema-param

Conversation

@amartya1523

Copy link
Copy Markdown
Contributor

json_parse_feerate() takes p_req("feerate", ...), and multifundchannel calls it with "feerate", but doc/schemas/parsefeerate.json (and so the man page and schema.json) names the parameter feerate_str. lightningd rejects a call that passes it by name the way the docs say, since it doesn't know feerate_str.

This renames it to feerate in the schema and regenerates contrib/msggen/msggen/schema.json. lightningd's behaviour doesn't change, and positional calls work the same as before. It's a leftover of the same kind #9471 fixed for required fields.

Test: test_parsefeerate_named_param calls it with a dict. pyln-testing validates named requests against the schema, so it fails before the rename. It's committed first as xfail(strict=True).

Checklist

  • The changelog has been updated in the relevant commit(s) according to the guidelines.
  • Tests have been added or modified to reflect the changes.
  • Documentation has been reviewed and updated as needed.
  • Related issues have been listed and linked, including any that this PR closes. (none)
  • Important All PRs must consider how to reverse any persistent changes for tools/lightning-downgrade (none)

lightningd's parsefeerate takes a parameter called `feerate` (that's
also how multifundchannel calls it), but the schema calls it
`feerate_str`, so passing it by name fails schema validation.

Changelog-None
json_parse_feerate() has always taken `feerate`, and multifundchannel
passes it by that name, but the schema (and so the man page) called it
`feerate_str`.  Anyone following the docs and passing it by name got a
"missing required parameter" error.  Positional calls are unaffected.

Changelog-Fixed: JSON-RPC: the `parsefeerate` documentation now names its parameter `feerate`, which is what lightningd actually accepts.
@amartya1523
amartya1523 requested a review from cdecker as a code owner November 6, 2026 15:17
"properties": {
"feerate_str": {
"feerate": {
"type": "string",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

the type should be feerate, not string?

Comment thread tests/test_misc.py
way), so the schema should accept it by name too."""
l1 = node_factory.get_node()

assert l1.rpc.call('parsefeerate', {'feerate': '9999perkw'}) == {'perkw': 9999}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

add assert l1.rpc.call('parsefeerate', {'feerate': 10000}) == {'perkw': 2500}

This branch has not been deployed

No deployments
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.

2 participants