Support client_trusts_lsp=true on ldk-node#687
Conversation
|
👋 Thanks for assigning @joostjager as a reviewer! |
4927b73 to
27dc7b4
Compare
|
With LDK Node including this PR, I got a compilation error and had to add these imports It compiled after that, then I tried to do LSPS2 JIT onboarding, but it failed ("route not found" from the client side). Note sure if that's an issue with this PR or me. |
|
I’m sorry. This should have been a draft. I just cherry picked the commits from the old PR. I will make CI pass in the next few days |
|
Alright, @martinsaposnic please ping me for review as soon as this is ready! |
|
Any progress here? Thanks @martinsaposnic |
7835f72 to
97d9e53
Compare
|
@tnull this should be ready now. let me know if you have comments |
tnull
left a comment
There was a problem hiding this comment.
Actual code changes seem more or less trivial, but this PR needs some more cleanup.
tests/integration_tests_rust.rs
Outdated
| println!("Waiting for funding transaction to be broadcast... It will be there because LSP trusts the client, even though the client has not claimed it yet."); | ||
| let mut funding_tx_found = false; | ||
| for _ in 0..500 { | ||
| std::thread::sleep(std::time::Duration::from_millis(100)); |
There was a problem hiding this comment.
Ugh, let's avoid too many sleeps in tests please, as over time they will considerably slow down our CI for no reason. Please use wait_for_tx for stuff like this, which at least does some polling with back-off.
97d9e53 to
767c564
Compare
|
As discussed offline, I'm taking over here to ensure this lands in time for the upcoming 0.7-rc.1. Now added some fixups. |
joostjager
left a comment
There was a problem hiding this comment.
Just reviewed the fix up commits, as the preceding commits had already been reviewed.
| Ok(false) | ||
| } | ||
| ) -> bool { | ||
| self.lsps2_service.as_ref().map_or(false, |lsps2_service| { |
There was a problem hiding this comment.
Same q about error logging.
There was a problem hiding this comment.
See above, I think continuing and just logging on the manual-broadcast step is preferable.
tests/integration_tests_rust.rs
Outdated
| break; | ||
| } | ||
| for _ in 0..30 { | ||
| tokio::time::sleep(std::time::Duration::from_millis(100)).await; |
There was a problem hiding this comment.
In the happy flow, we are always waiting 3s I think. Is a loop necessary then? Maybe just delay 3s and check.
tests/integration_tests_rust.rs
Outdated
| Some(0) | ||
| ); | ||
|
|
||
| // No claim the JIT payment, which should release the funding transaction |
|
Let me know if I can squash. |
|
Now attached another commit that downgrades two explicit |
This does sound that we aren't able to fully distinguish between edge cases and actual misuse? I can see that this might be enough for now though. |
Implement changes introduced on lightningdevkit/rust-lightning#3838 as discussed, client_trusts_lsp is a flag set at startup.
Previously, we'd explicitly `panic` on an APIMisuseError. While this error type should still never happen, we avoid explicit panics in favor of `debug_assert`s here.
e2db7c7 to
039aad4
Compare
|
Awesome guys! Thanks. Could I test this from main? Any config / upgrade considerations to run? Or just the "client_trusts_lsp" flag to "true"? |
I'm curious as to how this onboarding flow should work. Would love some docs helping users understand the flow (happy path, unhappy path), and ready help in that regard. |
|
Oh, I think I get it. The test in this PR helped out. The server side just needs to add the The client needs to get the JIT invoice from a new function The client can plug in a custom hash to that function using the below code (I presume this is the safe/canonical way to do it): The client should keep track of that preimage (somehow) then upon the |
No, this isn't correct. You simple have to set |
|
Now opened #707 to expand on the docs a bit. |
|
Thank you. Will continue conversation at #707. |
implement changes introduced on lightningdevkit/rust-lightning#3838 for rust-lightning.
as discussed, client_trusts_lsp is a flag set at startup.