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

Remove legacy onion support, simplify internal APIs #5639

Merged

Commits on Sep 28, 2022

  1. tests: add onion-test-vector from "BOLT 4: Remove legacy format, make…

    … var_onion_optin compulsory."
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Sep 28, 2022
    Configuration menu
    Copy the full SHA
    42b304c View commit details
    Browse the repository at this point in the history
  2. common/onion: remove all trace of legacy parsing.

    We still have an "enum forward_style" for the database, where old-style
    forwards can still exist.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    Changelog-Removed: Protocol: we no longer forward HTLCs with legacy onions.
    rustyrussell committed Sep 28, 2022
    Configuration menu
    Copy the full SHA
    0da6f30 View commit details
    Browse the repository at this point in the history
  3. common/onion: expunge all trace of different onion styles.

    In particular, remove special routines to pull length: it's there,
    take it and check it yourself.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Sep 28, 2022
    Configuration menu
    Copy the full SHA
    fe36020 View commit details
    Browse the repository at this point in the history
  4. sphinx: rename confusing functions, ensure valid payloads.

    "sphinx_add_hop" takes a literal hop to include,
    "sphinx_add_modern_hop" prepends the length.  Now we always prepend a
    length, make it clear that the literal version is a shortcut:
    
    * sphinx_add_hop -> sphinx_add_hop_has_length
    * sphinx_add_modern_hop -> sphinx_add_hop
    
    In addition, we check that length is actually correct!  This means
    `createonion` can no longer create legacy or otherwise-invalid onions:
    fix tests and update man page to remove legacy usage.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    Changelog-Changed: JSON-RPC: `createonion` no longer allows non-TLV-style payloads.
    rustyrussell committed Sep 28, 2022
    Configuration menu
    Copy the full SHA
    8530c4e View commit details
    Browse the repository at this point in the history