Skip to content

Conversation

@jonatack
Copy link
Member

@jonatack jonatack commented Mar 24, 2023

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.

@DrahtBot
Copy link
Contributor

DrahtBot commented Mar 24, 2023

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

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.

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.

@maflcko
Copy link
Member

maflcko commented Mar 24, 2023

lgtm

Maybe explain that this moves it from node to common?

@jonatack jonatack force-pushed the 2023-03-fix-IsDeprecatedRPCEnabled-build-errors branch from c852aef to 409758a Compare March 24, 2023 14:33
@jonatack
Copy link
Member Author

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

@maflcko
Copy link
Member

maflcko commented Mar 30, 2023

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

@jonatack
Copy link
Member Author

jonatack commented Mar 30, 2023

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.

@jonatack jonatack changed the title move-only: IsDeprecatedRPCEnabled to rpc/util to fix CI builds when called from wallet Move IsDeprecatedRPCEnabled to be callable from wallet, rm redundant rpcEnableDeprecated Apr 21, 2023
…ed 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).
@jonatack jonatack force-pushed the 2023-03-fix-IsDeprecatedRPCEnabled-build-errors branch from 7125e2f to 4580a1c Compare April 21, 2023 15:35
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.
@jonatack jonatack force-pushed the 2023-03-fix-IsDeprecatedRPCEnabled-build-errors branch from 4580a1c to 9ed9b50 Compare April 21, 2023 15:51
@jonatack jonatack changed the title Move IsDeprecatedRPCEnabled to be callable from wallet, rm redundant rpcEnableDeprecated Move IsDeprecatedRPCEnabled to rpc/util, rm redundant rpcEnableDeprecated Apr 21, 2023
@jonatack
Copy link
Member Author

Rebased 😃

Copy link
Contributor

@brunoerg brunoerg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

crACK 9ed9b50

nit: s/librairies/libraries in 1a1f351 message

@maflcko
Copy link
Member

maflcko commented May 9, 2023

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.

@DrahtBot
Copy link
Contributor

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

@fanquake
Copy link
Member

fanquake commented Aug 1, 2023

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

@achow101
Copy link
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.

@achow101 achow101 closed this Sep 20, 2023
@bitcoin bitcoin locked and limited conversation to collaborators Sep 19, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants