bolts icon indicating copy to clipboard operation
bolts copied to clipboard

BOLT 4: Remove legacy format, make var_onion_optin compulsory.

Open rustyrussell opened this issue 3 years ago • 15 comments

My measurements a few weeks ago reveal that only 5 nodes do not advertize this feature, of over 17000. I have a patch to remove support from c-lightning, too.

rustyrussell avatar Feb 22 '22 02:02 rustyrussell

Actually while updating eclair, I realized that we should also update the test vectors:

  • remove https://github.com/lightning/bolts/blob/master/bolt04/onion-test-v0.json
  • udpate https://github.com/lightning/bolts/blob/master/bolt04/onion-test-multi-frame.json to only contain variable-size payloads

That does mean a bit more work to do (sorry!).

t-bast avatar Feb 25 '22 10:02 t-bast

Hmm, I'm out of time to update the multiframe test, though you're right :(

rustyrussell avatar Feb 28 '22 02:02 rustyrussell

Ping @cdecker ?

rustyrussell avatar Feb 28 '22 02:02 rustyrussell

Concept ACK, we'll likely start with just making our existing feature bit required, as we have some existing tests that still assume this is relevant.

Roasbeef avatar Feb 28 '22 19:02 Roasbeef

I'm looking at our node's statistics, and a non-negligible portion (~30%) of the payments we relay are still using the legacy format. I'm afraid most nodes advertise the feature, but without actually using it by default when sending payments. Can you check relay statistics on your nodes to see if it matches what I'm seeing? Are all implementations always generating onion with the new format (and since which version)?

t-bast avatar Mar 25 '22 14:03 t-bast

Are all implementations always generating onion with the new format (and since which version)?

lnd has been generating with the new format as of version v0.8.0 (released October 2019). In our path finding code, we'll use the old/new depending on which feature bits the node advertises (so we support mixing old/new along a route).

Roasbeef avatar Mar 25 '22 22:03 Roasbeef

In our path finding code, we'll use the old/new depending on which feature bits the node advertises (so we support mixing old/new along a route).

In that case that's probably not the culprit since more than 99% of nodes (including ours) advertise var_onion_optin. I'm suspecting a popular wallet (or a few of them) is still using the legacy encoding for their payments...

t-bast avatar Mar 28 '22 06:03 t-bast

on c-lightning IRC we have a crash report due to the old onion format too!

my node seems to be crashing due to invalid onion messages Unexpected message WIRE_OBS2_ONION_MESSAGE: using master at commit 7abc491f4c214f2bcf9e8f2b9066ca05dee0342b

vincenzopalazzo avatar Mar 28 '22 09:03 vincenzopalazzo

on c-lightning IRC we have a crash report due to the old onion format too!

I find c-lightning should definitely not be crashing, even with the legacy encoding disabled it should simply fail the adds with a required_node_feature_missing or something similar, shouldn't it?

t-bast avatar Mar 28 '22 09:03 t-bast

Some ppl on Twitter hypothesized that maybe a lot of the traffic is actually probing. I know in the past, some systems/applications would use an API for lnd that accept a raw routes for probing. I dug into things on our end, and realized that unless a user is setting some custom TLV record in the route (also not using mpp/amp), we'll default to using the legacy payload (there's a bool that defaults to false). So this might be contributing to that 30% number mentioned above...

We have a new major release coming up, so this could be an opportunity to change our API to default to the modern payload (can't thing of any downside really).

Roasbeef avatar Mar 28 '22 19:03 Roasbeef

We've released version v0.14.3 of lnd which removes the ability for users to specify the legacy payload option using certain API calls. However if a node in the path needs the legacy format, then the normal path finding code will handle populating the correct payload.

Roasbeef avatar Apr 19 '22 22:04 Roasbeef

It looks like lnd's release really helped, we're now only seeing ~5% of the payments we relay use the legacy format. Hopefully in a few months that will drop below 1% and we can deprecate it.

t-bast avatar Jun 17 '22 15:06 t-bast

Hopefully in a few months that will drop below 1% and we can deprecate it.

Any good news here? :)

dunxen avatar Aug 18 '22 08:08 dunxen

We're still seeing payments use the legacy onion format... Over the last 3 days, 2,8% of relayed payments used it. Over the last week, 1,6% of relayed payments used it. I'd still wait a bit before releasing a version that rejects those payments.

t-bast avatar Aug 18 '22 08:08 t-bast

good news everyone

Payments using the legacy encoding have fallen below 0,2% of the total payments relayed on our node in the last week :tada: Let me know if other nodes see similar data, this is a good indication that we may be able to finally remove this soon!

t-bast avatar Sep 02 '22 11:09 t-bast

Payments using the legacy encoding have fallen below 0,2% of the total payments relayed on our node in the last week tada Let me know if other nodes see similar data, this is a good indication that we may be able to finally remove this soon!

Confirmed: my node has seen no legacy since 17 June (over 12000 htlcs fwd since then), and the one before that was 2 July.

He's dead, Jim!

rustyrussell avatar Sep 26 '22 21:09 rustyrussell

Squashed into a single commit, and included the test vector fixups. Will test them today...

rustyrussell avatar Sep 26 '22 21:09 rustyrussell

Ack test vectors!

rustyrussell avatar Sep 27 '22 01:09 rustyrussell