Move IsDeprecatedRPCEnabled to rpc/util, rm redundant rpcEnableDeprecated #27322

pull jonatack wants to merge 3 commits into bitcoin:master from jonatack:2023-03-fix-IsDeprecatedRPCEnabled-build-errors changing 8 files +16 −20
  1. jonatack commented at 1:17 PM on March 24, 2023: member

    CI builds currently fail when IsDeprecatedRPCEnabled() is called from wallet RPCs with "Undefined reference to IsDeprecatedRPCEnabled in libbitcoin_wallet".

    Fix the issue by moving IsDeprecatedRPCEnabled() from rpc/server to rpc/util, thereby moving it from node to common to be picked up by libbitcoin_wallet (see doc/design/librairies.md and src/Makefile.am).

    This move allows us to drop the redundant rpcEnableDeprecated() method. Per the comment in src/interfaces/chain.h::L107 from #15639 we would like to remove these, and this function doesn't seem constrained by the mentioned HTTP port requirement, nor needed if IsDeprecatedRPCEnabled is in common rather than node.

    This allows having only one call for this functionality and avoids developer confusion and head-scratching.

    If it is preferred to keep all of them, this pull could alternatively document the use of these different methods for future developers doing a deprecation.

  2. DrahtBot commented at 1:17 PM on March 24, 2023: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    ACK brunoerg

    If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

    <!--174a7506f384e20aa4161008e828411d-->

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #27757 (rpc: remove deprecated "warning" field from {create,load,restore,unload}wallet by theStack)
    • #27101 (Support JSON-RPC 2.0 when requested by client by pinheadmz)

    If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

  3. DrahtBot added the label Refactoring on Mar 24, 2023
  4. maflcko commented at 1:34 PM on March 24, 2023: member

    lgtm

    Maybe explain that this moves it from node to common?

  5. jonatack force-pushed on Mar 24, 2023
  6. jonatack commented at 2:37 PM on March 24, 2023: member

    PR description and commit message updated per #27322 (comment) (thanks @MarcoFalke).

  7. jonatack force-pushed on Mar 24, 2023
  8. maflcko commented at 4:54 PM on March 30, 2023: member

    Actually, on a second though. Any reason why you can't just call rpcEnableDeprecated?

  9. jonatack commented at 7:11 PM on March 30, 2023: member

    Any reason why you can't just call rpcEnableDeprecated?

    Good question. Looking at it, maybe we can remove it? Per this comment in src/interfaces/chain.h::L107 from #15639 we would like to remove these, and this function doesn't seem constrained by the mentioned HTTP port requirement or needed if IsDeprecatedRPCEnabled is in common rather than node (the first commit here). @ryanofsky wdyt?

    //! * The handleRpc, registerRpcs, rpcEnableDeprecated methods and other RPC
    //!   methods can go away if wallets listen for HTTP requests on their own
    //!   ports instead of registering to handle requests on the node HTTP port.
  10. DrahtBot added the label Needs rebase on Apr 12, 2023
  11. jonatack renamed this:
    move-only: IsDeprecatedRPCEnabled to rpc/util to fix CI builds when called from wallet
    Move IsDeprecatedRPCEnabled to be callable from wallet, rm redundant rpcEnableDeprecated
    on Apr 21, 2023
  12. move-only: IsDeprecatedRPCEnabled to rpc/util to fix builds when called from wallet
    CI builds confusingly fail with "undefined reference to IsDeprecatedRPCEnabled
    in libbitcoin_wallet" compiler errors when this function is called from wallet
    RPCs.
    
    Fix this by moving IsDeprecatedRPCEnabled() from rpc/server to rpc/util,
    thereby moving it from node to common to be picked up by libbitcoin_wallet
    (see doc/design/librairies.md and src/Makefile.am).
    1a1f3518ed
  13. jonatack force-pushed on Apr 21, 2023
  14. rpc: switch wallet deprecation to IsDeprecatedRPCEnabled 1c42fc48b8
  15. interfaces: remove redundant rpcEnableDeprecated method
    Per the comment in src/interfaces/chain.h::L107, it looks like we want to remove
    these, and this function doesn't seem constrained by the HTTP port requirement:
    
    //! * The handleRpc, registerRpcs, rpcEnableDeprecated methods and other RPC
    //!   methods can go away if wallets listen for HTTP requests on their own
    //!   ports instead of registering to handle requests on the node HTTP port.
    
    Further, rpcEnableDeprecated() is unneeded if IsDeprecatedRPCEnabled() is in
    common rather than node and thereby callable from the wallet, and it is
    confusingly redundant to keep it.
    9ed9b50068
  16. jonatack force-pushed on Apr 21, 2023
  17. DrahtBot added the label CI failed on Apr 21, 2023
  18. jonatack renamed this:
    Move IsDeprecatedRPCEnabled to be callable from wallet, rm redundant rpcEnableDeprecated
    Move IsDeprecatedRPCEnabled to rpc/util, rm redundant rpcEnableDeprecated
    on Apr 21, 2023
  19. DrahtBot removed the label Needs rebase on Apr 21, 2023
  20. DrahtBot removed the label CI failed on Apr 21, 2023
  21. jonatack commented at 6:02 PM on April 21, 2023: member

    Rebased 😃

  22. brunoerg approved
  23. brunoerg commented at 6:32 PM on May 8, 2023: contributor

    crACK 9ed9b50068a3cbcf48264d814ffe73e0b9ed10b4

    nit: s/librairies/libraries in 1a1f3518ed4eb2b18c63d98fbdca10a2cda8bf1e message

  24. maflcko commented at 6:36 AM on May 9, 2023: member

    Is gArgs guaranteed to be identical in different processes? If not, it would be good to explain why this behavior change is intentional. If yes, it would be good to explain as well.

  25. DrahtBot added the label Needs rebase on Jun 16, 2023
  26. DrahtBot commented at 7:42 PM on June 16, 2023: contributor

    <!--cf906140f33d8803c4a75a2196329ecb-->

    🐙 This pull request conflicts with the target branch and needs rebase.

  27. fanquake commented at 10:03 AM on August 1, 2023: member

    Needs a rebase, if still relevant, and the question above also needs addressing.

  28. achow101 commented at 4:20 PM on September 20, 2023: member

    Closing this as it has not had any activity in a while. If you are interested in continuing work on this, please leave a comment so that it can be reopened.

  29. achow101 closed this on Sep 20, 2023

  30. bitcoin locked this on Sep 19, 2024

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-14 21:13 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me