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

New deprecation infrastructure #6936

Merged

Commits on Jan 24, 2024

  1. lightningd: clean up notification infrastructure.

    The `struct notification` lost type-safety, but avoided a redundant
    string.  The string is better, I think.
    
    Since all notifications now contain an object of same name (some have
    deprecated fields outside that), we can add helpers to do that, too.
    
    Also, add some const (easy to do now we're typesafe!)
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jan 24, 2024
    Configuration menu
    Copy the full SHA
    e82bb32 View commit details
    Browse the repository at this point in the history

Commits on Jan 25, 2024

  1. lightningd: remove msatoshi alias for amount_msat.

    Changelog-Removed: JSON-RPC: `invoice`, `sendonion`, `sendpay`, `pay`, `keysend`, `fetchinvoice`, `sendinvoice`: `msatoshi` argument (deprecated 0.12.0). Use `amount_msat`.
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jan 25, 2024
    Configuration menu
    Copy the full SHA
    46d426e View commit details
    Browse the repository at this point in the history
  2. common: remove no-longer-required p_req_dup_ok hack.

    This was for "msatoshi" and "amount_msat" in routes.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jan 25, 2024
    Configuration menu
    Copy the full SHA
    bf08247 View commit details
    Browse the repository at this point in the history
  3. common: remove parameter aliases.

    We currently don't have any!
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jan 25, 2024
    Configuration menu
    Copy the full SHA
    0247066 View commit details
    Browse the repository at this point in the history
  4. pyln-client: remove long-obsolete support for msatoshi arg.

    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jan 25, 2024
    Configuration menu
    Copy the full SHA
    3b13f1f View commit details
    Browse the repository at this point in the history
  5. wallet: remove P2SH support.

    Seriously, it's taproot time, let's get rid of p2sh wrapped segwit.
    
    Changelog-Removed: wallet: removal of p2sh-segwit addresses; newaddr won't issue them, we won't watch them for new funds (deprecated in *23.02*)
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jan 25, 2024
    Configuration menu
    Copy the full SHA
    138c302 View commit details
    Browse the repository at this point in the history
  6. funder: remove lease-fee-base-msat

    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    Changelog-Experimental: Plugins: `funder` option "lease-fee-base-msat" removed (deprecated in v0.11, use "lease-fee-base-sat")
    rustyrussell committed Jan 25, 2024
    Configuration menu
    Copy the full SHA
    5ad94d4 View commit details
    Browse the repository at this point in the history
  7. config: remove disable-ip-discovery

    Changelog-Removed: Config: `disable-ip-discovery` (deprecated in v23.02): use `announce-addr-discovered`
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jan 25, 2024
    Configuration menu
    Copy the full SHA
    ec0bfe0 View commit details
    Browse the repository at this point in the history
  8. lightningd: reuse code for "dynamic" getmanifest response parsing.

    And clean up weird indent.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jan 25, 2024
    Configuration menu
    Copy the full SHA
    681dec4 View commit details
    Browse the repository at this point in the history
  9. Makefile: add CLN_NEXT_VERSION, functions encoding deprecation schedule.

    Each feature has a name, and says when deprecation begins and ends.
    
    There's an API coming to allow you to re-enable on a per-feature basis
    even if it's ended (as long as it's not been removed from the code ofc!).
    
    Default end is 6 months after deprecation, i.e. we complain about it
    at that point, if we can detect its use.
    
    e.g, a standard deprecation in v24.05:
    
    v24.02: allowed
    v24.02 with mods: allowed
    
    master after v24.02: allowed unless deprecated APIs disabled.
    v24.05: allowed unless deprecated APIs disabled.
    v24.08: allowed unless deprecated APIs disabled.
    
    v24.11: allowed unless deprecated APIs disabled, but logs at BROKEN level.
    
    v25.02: allowed only if --i-promise-to-fix-broken-api-user=FEATURE.
    v25.05: code is actually removed.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jan 25, 2024
    Configuration menu
    Copy the full SHA
    7ed342b View commit details
    Browse the repository at this point in the history
  10. msggen: generalize version handling.

    Updating this every release was just busywork, and it turns out we don't actually
    care: if something is marked deprecated we want to make it optional, whenever
    it is for, and the only real test is if it was added before our lowest-supported
    version we can consider it non-optional.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jan 25, 2024
    Configuration menu
    Copy the full SHA
    a43dfe0 View commit details
    Browse the repository at this point in the history
  11. schemas: deprecated is now a range.

    Don't assume removal is +6 months, but have a start deprecation/end support range.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jan 25, 2024
    Configuration menu
    Copy the full SHA
    f3c9c38 View commit details
    Browse the repository at this point in the history
  12. plugins/sql: make columns an array of pointers.

    `struct column` has a dynamically allocated member, which is neater if
    it is a tal object itself (we allocated the member off the array, instead).
    We're about to add two new members, so clean this up first.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jan 25, 2024
    Configuration menu
    Copy the full SHA
    ee5a884 View commit details
    Browse the repository at this point in the history
  13. plugins/sql: do deprecations at request time, not schema loading.

    When we allow deprecation to be set per-connection, we need to
    generalize this approach.  Instead of filtering out deprecated
    fields at schema loading, we need to load them, then refuse
    to serve deprecated fields on a per-request basis.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jan 25, 2024
    Configuration menu
    Copy the full SHA
    f0d622e View commit details
    Browse the repository at this point in the history
  14. lightningd: i-promise-to-fix-broken-api-user option.

    This allows the user to specify the feature *by name*, and hopefully
    complain to the developer to fix their code, knowing it will be removed entirely
    in the next release!
    
    Changelog-Added: config: `i-promise-to-fix-broken-api-user` allows for a one-release re-enablement of long-deprecated features.
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jan 25, 2024
    Configuration menu
    Copy the full SHA
    6dcfa8c View commit details
    Browse the repository at this point in the history
  15. doc: start a list of current deprecations.

    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jan 25, 2024
    Configuration menu
    Copy the full SHA
    fef9b9d View commit details
    Browse the repository at this point in the history
  16. pytest: note where we use very deprecated features, so tests don't rb…

    …eak.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jan 25, 2024
    Configuration menu
    Copy the full SHA
    04e645d View commit details
    Browse the repository at this point in the history
  17. common: add command_deprecated_param_ok() and command_deprecated_out_…

    …ok()
    
    Generic helpers for libplugin and lightningd.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jan 25, 2024
    Configuration menu
    Copy the full SHA
    c9f7d23 View commit details
    Browse the repository at this point in the history
  18. plugins/sql: use per-command deprecations.

    In this case the cmd is `sql` but the field we're talking about is from
    a different command, so we need a new libplugin API.
    
    Note: there are still no deprecations in any tables used by `sql`, so this
    is a bit moot for now.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jan 25, 2024
    Configuration menu
    Copy the full SHA
    b80276e View commit details
    Browse the repository at this point in the history
  19. jsonrpc: add deprecations command to locally set deprecated apis on/off.

    This command allows more fine-grained testing, without having to change the config of the
    lightning node.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    Changelog-Added: JSON-RPC: `deprecations` to enable/disable deprecated APIs from this caller.
    rustyrussell committed Jan 25, 2024
    Configuration menu
    Copy the full SHA
    a564beb View commit details
    Browse the repository at this point in the history
  20. common: allow JSON-RPC parameters to specify deprecation versions.

    This infrastructure is use by both libplugin and lightningd.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jan 25, 2024
    Configuration menu
    Copy the full SHA
    249e61f View commit details
    Browse the repository at this point in the history
  21. plugins: allow deprecated for registered commands to be an array of…

    … versions.
    
    We still accept boolean: the plugin may not want to commit to a deprecation schedule.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    Changelog-Added: Plugins: rpcmethods and options can set `deprecated` to a pair of version strings, not just a boolean.
    rustyrussell committed Jan 25, 2024
    Configuration menu
    Copy the full SHA
    bb84579 View commit details
    Browse the repository at this point in the history
  22. plugins: allow plugin options deprecated to be an array of strings.

    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    Changelog-Added: Plugin: options and commands can specify deprecation start (and optional end) versions.
    rustyrussell committed Jan 25, 2024
    Configuration menu
    Copy the full SHA
    713c9e8 View commit details
    Browse the repository at this point in the history
  23. libplugin: support version strings for deprecations.

    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jan 25, 2024
    Configuration menu
    Copy the full SHA
    fdcae6f View commit details
    Browse the repository at this point in the history
  24. pyln.plugin: Allow deprecated to be a string.

    Type-checking in Python is so loose you could already do this, but this updates the
    mypy type annotations.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jan 25, 2024
    Configuration menu
    Copy the full SHA
    32b6bed View commit details
    Browse the repository at this point in the history
  25. lightningd: mark all internal deprecations by version.

    I did some CHANGELOG and git digging to see when these were deprecated, and
    some were very old (v0.8.2!).  But since they didn't warn users loudly, I
    chose to do so this release only.
    
    I renamed ld's `deprecated_apis` to `deprecated_ok` to make sure I
    caught them all.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jan 25, 2024
    Configuration menu
    Copy the full SHA
    976fed7 View commit details
    Browse the repository at this point in the history
  26. libplugin: get i-promise-to-fix-broken-api-user list from lightningd.

    This means it now covers plugin parameters too.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jan 25, 2024
    Configuration menu
    Copy the full SHA
    e55a03e View commit details
    Browse the repository at this point in the history
  27. plugins: allow plugins to get per-connection deprecated state.

    Unfortunately, this is awkward: we just copy through most requests,
    so we can't easily add a "deprecation" field to each one.  So we do
    a notification if the next command has a different deprecation status
    than the global one, but that requires opt-in from the plugin.
    
    We didn't previously document the subscriptions array, so do that now.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    Changelog-Added: Plugins: `deprecated_oneshot` notifiction subscription to change deprecated status for a single command.
    rustyrussell committed Jan 25, 2024
    Configuration menu
    Copy the full SHA
    0470ef7 View commit details
    Browse the repository at this point in the history
  28. libplugin: handle deprecated_oneshot notification.

    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jan 25, 2024
    Configuration menu
    Copy the full SHA
    28bd63c View commit details
    Browse the repository at this point in the history
  29. plugins/bcli: use per-command deprecation flags.

    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jan 25, 2024
    Configuration menu
    Copy the full SHA
    f354795 View commit details
    Browse the repository at this point in the history
  30. commando: use deprecation API for missing ids.

    In this case we don't have a matching "command", so we need a special
    API.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jan 25, 2024
    Configuration menu
    Copy the full SHA
    1c63b21 View commit details
    Browse the repository at this point in the history
  31. libplugin: remove global deprecated_apis flag.

    And we don't need to handle 0.9 lightningd which didn't include
    allow-deprecated-apis in getmanifest call.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jan 25, 2024
    Configuration menu
    Copy the full SHA
    31c081d View commit details
    Browse the repository at this point in the history