-
Notifications
You must be signed in to change notification settings - Fork 871
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
offers: fix our blinded path setting in invoices #7311
offers: fix our blinded path setting in invoices #7311
Conversation
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 83cb66d
I pile my ACK on top of the #7304 where thsi PR is based
I think by the next few days I should be able to test the iterop with ldk by running https://github.com/vincenzopalazzo/lampo.rs/blob/main/tests/tests/src/lampo_cln_tests.rs#L372
rpc_scan(p, "getchaininfo", | ||
take(json_out_obj(NULL, "last_height", "0")), | ||
"{headercount:%}", JSON_SCAN(json_to_u32, &blockheight)); |
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.
Bloody hell! good catch!
struct tlv_encrypted_data_tlv_payment_relay *payment_relay, | ||
struct tlv_encrypted_data_tlv_payment_constraints *payment_constraints, | ||
u8 *path_secret, | ||
struct pubkey *node_alias) | ||
{ | ||
struct tlv_encrypted_data_tlv *tlv = tlv_encrypted_data_tlv_new(tmpctx); | ||
|
||
tlv->short_channel_id = next_scid; | ||
tlv->next_node_id = cast_const(struct pubkey *, next_node_id); |
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 not know about this cast_const
, ccan
is like the std that C should have
83cb66d
to
79f155b
Compare
79f155b
to
e0275a7
Compare
trivial bolt quote and spelling fixup |
This demonstrates a number of issues reported by Carla: no surprise since there was no test! (We create a one-hop blinded path when we only have private channels). Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
At plugin startup, we don't have an accurate blockheight and can get 0! Fixes: ElementsProject#7161 Reported-by: @carlaKC Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Without this, it was broken because our peer will no longer forward via scids for private channels. We could use the scid alias, but the node id is right at hand. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
…info. It should probably be renamed "minimum_cltv_delta" or something. Fixes: ElementsProject#7179 Reported-by: @carlaKC Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
The spec has moved a bit here: the `outgoing_cltv_value` in the final onion is basically the blockheight now (plus the 1 block delta we give ourselves). Also, we were doubling ours, since p->min_final_cltv_expiry was already set to p->blindedpay->cltv_expiry_delta above. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
e0275a7
to
2f7d79e
Compare
Trivial rebase after other merges |
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 2f7d79e
offer = l3.rpc.offer(1000, 'test_pay_blindedpath_privchan') | ||
l1.rpc.decode(offer['bolt12']) | ||
|
||
inv = l2.rpc.fetchinvoice(offer['bolt12']) |
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 does l2 fetch rather than l1?
3c48438
into
ElementsProject:master
And fix pay to pay them properly too!
Thanks @carlaKC for the reports!
Closes: #7161
Closes: #7179