Skip to content
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

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

Conversation

calvinrzachman
Copy link

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.
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