lightningdevkit / ldk-sample

Sample node implementation using LDK
Apache License 2.0
166 stars 94 forks source link

Cannot open channel from LDK #31

Closed t-bast closed 3 years ago

t-bast commented 3 years ago

I'm able to open channels eclair -> LDK but not the other way around. The LDK node crashes after receiving accept_channel:

> thread '<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: Custom { kind: Other, error: "Unexpected key fee_rate" }', src/bitcoind_client.rs:202:78
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Aborted (core dumped)

It looks like an issue with the bitcoind_client not understanding a field in the response (probably while trying to create the funding tx). I was using bitcoind 0.20.1 for this test.

jkczyz commented 3 years ago

Yup, looks like fee_rate(sat/vB) was added in 0.21 whereas feeRate (BTC/kvB) was the only option earlier.

t-bast commented 3 years ago

Right, if you only support bitcoind 0.21 (and higher) that works for me as well, I'll retry with that version.

t-bast commented 3 years ago

I updated to bitcoind 0.21.1 which fixed the previous panic, but now I'm seeing a different one:

> openchannel 03f1730317981052d10403126e197e421875711898411802e47067401eecd4fab3@localhost:9735 250000
EVENT: initiated channel with peer 03f1730317981052d10403126e197e421875711898411802e47067401eecd4fab3. 
> thread '<unnamed>' panicked at 'assertion failed: change_output_position == 0 || change_output_position == 1', src/main.rs:133:13
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Aborted (core dumped)

Unfortunately I don't see the tx in the logs, but I suspect there's simply no change output (is that correctly handled on your side)?

TheBlueMatt commented 3 years ago

Oops, yea, the sample was being lazy about calculating the change output, but we also don't even need to calculate it anymore since LDK started doing that a few versions ago. Should be fixed in #32.