Skip to content

route-blinding: recover blinding point from forwarding packages#37

Closed
calvinrzachman wants to merge 8 commits intocarlaKC:7298-3-forwardblindedroutesfrom
calvinrzachman:7298-3-forwardblindedroutes-calvin
Closed

route-blinding: recover blinding point from forwarding packages#37
calvinrzachman wants to merge 8 commits intocarlaKC:7298-3-forwardblindedroutesfrom
calvinrzachman:7298-3-forwardblindedroutes-calvin

Conversation

@calvinrzachman
Copy link
Copy Markdown

Change Description

Here's a not quick and very dirty set of commits which try to determine whether or not we need to worry about recovering blinding point from forwarding packages now that we persist HTLC extra data to disk as part of channldb.HTLC.

If you try adding and removing the last commit, you'll notice that the payment fails.

  • I have no clue if link_test.go is the best place to demonstrate this.
  • I also didn't spend much time optimizing anything. Just wanted to get something up to see if this concern is valid at all. Much of this I dug up from an branch from 2022!
  • There are a ton of logs if you run with -v which kind of show what's going on.
go test -tags="dev" -v -timeout 10s -run ^TestChannelLinkBlindHopReprocessing2024$ github.com/lightningnetwork/lnd/htlcswitch

NOTE: This is NOT intended for inclusion or merging alongside the rest of the route blinding code! Rather, it is meant to aid discussion on the relevance of restoring blinding points from forwarding packages!

This new hodl flag will prevent the switch from opening
circuits for ADDs it's attempting to forward. This simulates
arbitrary delays in the switch during forwarding and can be
leveraged to test the switch going down while trying to forward
a batch of HTLCs.
…dpkg

We expand our tests to verify that a forwarding node which
receives a blinded HTLC (bob) is able to restore the blinding
point from disk.

NOTE: He's only able to do so if he's revoked his local commitment.
@calvinrzachman calvinrzachman force-pushed the 7298-3-forwardblindedroutes-calvin branch from c0efd59 to 10c9653 Compare March 15, 2024 05:12
…ind hops

We expand the capability of the mockHopIterator such that it is able to
handle both normal and blind hops. The destinction is made via a check
for sentinel value which delineates the byte boundary between serialized
hops.

The implemenation is functional yet somewhat propietary in the sense that
it is specific to handling blind hops and not as general as it could be.
This lack of generality leaves the door open to eventual inclusion of the
full blown TLV serialization scheme into the mock iterator.

Without this or something like TLV we do not have a way to know
whether we should or even how to deserialize a variable length field like
the route blinding payload.

htlcswitch/mock: use TLV for route blinding payload

Allow the mock hop iterator to use TLV for the route blinding
deserialization. We assume the route blinding payload is already
serialized via TLV and add a length prefix before so it can be
properly parsed from the onion packet.
@calvinrzachman calvinrzachman force-pushed the 7298-3-forwardblindedroutes-calvin branch from 10c9653 to 2b397b2 Compare March 15, 2024 05:20
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.

1 participant