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

Rune handling cleanups, new DEBUG_LIGHTNINGD option #7124

Conversation

rustyrussell
Copy link
Contributor

  1. Add DEBUG_LIGHTNINGD to pytest infra so we can attach debuggers to lightningd itself conveniently.
  2. We used to suppress _ in rune names of parameters, but runes was changed two years ago to allow _, so we should stop doing that. We allow both, for backwards compat.
  3. Make error messages clearer, which lead me to clean up one unexpected case.

@rustyrussell rustyrussell added this to the v24.05 milestone Mar 3, 2024
@rustyrussell rustyrussell force-pushed the guilt/createrune-remove-param-punct branch 2 times, most recently from 25a4395 to 50f8762 Compare March 8, 2024 02:30
@rustyrussell rustyrussell force-pushed the guilt/createrune-remove-param-punct branch from b16fb0a to b4a2de9 Compare March 18, 2024 22:40
…test.

We do this for DEBUG_SUBD already, but I wanted to debug the main lightningd.

(We rename --debugger to the more accurate --dev-debug-self)

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This reveals an inadequacy in our rune error reporting:
we complain a missing parameter is "not an integer field" instead
of "not present":

```
        # Rune requires amount_msat < 10,000!
>       with pytest.raises(RpcError, match='Not permitted: pnameamountmsat is not present') as exc_info:
E       AssertionError: Regex pattern did not match.
E        Regex: 'Not permitted: pnameamountmsat is not present'
E        Input: "RPC call failed: method: checkrune, payload: {'nodeid': '0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518', 'rune': 'b3hXuEM7Pqzk-C7HUw83xzvHOV7fmuGaWjdo-wHdfg89MCZtZXRob2Q9cGF5JnBuYW1lYW1vdW50bXNhdDwxMDAwMA==', 'method': 'pay', 'params': {'bolt11': 'lnbcrt123n1pj7flqdsp5ndqgxpwk2hf50gzm0d4ssgjnd90cwkrc8udh7lfr5x583jms7yqspp5kn5stlnkv70celgw4vmdva9m7a57drd2403vnx4whq2p5nawkh3sdq5v3jhxcmjd9c8g6t0dccsxqyjw5qcqp99qxpqysgqhrgp7wp640gyujxk0mz4l6e6dxmqp7fz8pnnpnnqjfxg2scvuzfpwlxrj332u72p5g709eqr8rwaueruce84h0qmh6kc5c2zxgg9q4qps4cu8k'}}, error: {'code': 1502, 'message': 'Not permitted: pnameamountmsat is not an integer field'}"
```

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Copy link
Collaborator

@vincenzopalazzo vincenzopalazzo left a comment

Choose a reason for hiding this comment

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

Concept-ACK b4a2de9

but it is missing a rebase before receive an ACK

@rustyrussell rustyrussell force-pushed the guilt/createrune-remove-param-punct branch from b4a2de9 to f1a4dd2 Compare March 19, 2024 23:01
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Rather than speaking 'rune' we should speak english in error messages.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Reported-by: @ShahanaFarooqui
Changelog-Changed: runes: named parameters (e.g. `pnameamountmsat`) no longer need to remove underscores (i.e. `pnameamount_msat` now works as expected).
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
@rustyrussell rustyrussell force-pushed the guilt/createrune-remove-param-punct branch from f1a4dd2 to 6540d29 Compare March 19, 2024 23:48
@rustyrussell rustyrussell merged commit 4816550 into ElementsProject:master Mar 20, 2024
35 checks passed
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.

runes: pname restrictions fail if the parameter has an underscore
2 participants