lightningdevkit / rust-lightning

A highly modular Bitcoin Lightning library written in Rust. It's rust-lightning, not Rusty's Lightning!
Other
1.16k stars 366 forks source link

Implement PendingHTLCsRelayable Event to split acceptance/relay checks #680

Open ariard opened 4 years ago

ariard commented 4 years ago

Currently, we apply both BOLT-2 incoming channels settings checks and BOLT-4 relay checks at update_add_htlc reception. We should split relay checks and get incoming HTLC acceptance generate a Event::PendingHTLCsRelayable. This event could be consumed by process_pending_htlc_relayable and should generate a PendingHTLCsForwardable. In between any kind of client custom function can be implemented support for stricter relay policy, on-the-flight generated outgoing zero-conf channel, delayed relay, trampoline-style of routing, ...

See further https://github.com/rust-bitcoin/rust-lightning/pull/670 and http://gnusha.org/rust-bitcoin/.

TheBlueMatt commented 4 years ago

This could also allow live-rebalancing on the client's end, which would be cool.

ariard commented 4 years ago

Also fix current bug : https://github.com/rust-bitcoin/rust-lightning/pull/633#discussion_r485199875

TheBlueMatt commented 3 years ago

Note that the bug at https://github.com/rust-bitcoin/rust-lightning/pull/633#discussion_r485199875 has been fixed in #690.

ariard commented 3 years ago

Might serve to address few timing attacks : https://github.com/rust-bitcoin/rust-lightning/pull/975#discussion_r661896452

ariard commented 3 years ago

Might serve as iptables for routing nodes : https://github.com/rust-bitcoin/rust-lightning/pull/975#discussion_r661903063

ariard commented 3 years ago

Maybe also addressing that at the same time : https://github.com/rust-bitcoin/rust-lightning/pull/1119#discussion_r732304989

TheBlueMatt commented 2 years ago

May need to rely on #1302

TheBlueMatt commented 2 years ago

Turns out we're not gonna rely on this for #1302, so there's no reason for this to have a very-soon milestone.