[wallet] [rpc] Remove getlabeladdress RPC #13060

pull jnewbery wants to merge 2 commits into bitcoin:master from jnewbery:remove_getlabeladdress changing 5 files +86 −79
  1. jnewbery commented at 7:21 pm on April 23, 2018: member

    labels are associated with addresses (rather than addresses being associated with labels, as was the case with accounts). The getlabeladdress does not make sense in this model, so remove it.

    getaccountaddress is still supported for one release as the accounts API is deprecated.

  2. jnewbery commented at 7:28 pm on April 23, 2018: member

    Builds on top of #12953. Please remove that PR first.

    In my opinion, the getlabeladdress should not have been introduced. However, it was included in #12892 to remove controversy and ensure that PR could be merged.

    There are two main reasons for removing this RPC method:

    • Labels are associated with addresses (rather than addresses being associated with labels, as was the case with accounts). The getlabeladdress does not make sense in this model and blurs the distinction that “labels are associated with addresses, instead of addresses associated with labels”.
    • Keeping getlabeladdress requires keeping the whole CAccount administration in place. Part of the reason for the account to label refactor is simplify the wallet mess and to get rid of that.

    Many contributors have already concept ACK’ed removing this method (@laanwj at #12892 (comment), @PierreRochard at #12892 (comment), @promag at #12892#pullrequestreview-110855143, @jonasschnelli at #12892 (review))

    Main opposition to removing this method came from @ryanofsky and @luke-jr . See #7729 (comment) onwards for a full discussion.

  3. ryanofsky commented at 8:11 pm on April 23, 2018: member

    Main opposition to removing this method came from @ryanofsky and @luke-jr

    No opposition here, I just didn’t think this should be removed or changed in the middle of a PR that otherwise was only adding functionality.

    But I actually don’t know what “labels are associated with addresses rather than addresses being associated with labels” is supposed to mean. This sounds like a zen koan. It may be more accurate to say “Only one label can be associated with an address, but many addresses can be associated with one label. Labels (unlike accounts) do not have a default receiving address.”

    It could also be good to update release notes with a workaround for the deprecated getaccountadddress, though I couldn’t think of anything very straightforward. Could suggest combining getnewaddress(label), listreceivedbylabel, and getaddressesbylabel for a replacement depending on the use-case.

  4. jnewbery commented at 8:22 pm on April 23, 2018: member

    I actually don’t know what “labels are associated with addresses rather than addresses being associated with labels”.

    The idea is that an address HAS labels (currently an address can have only one label, but it should be possible to extend that in future). Conversely an account HAS addresses, ie the address belongs to the account.

    In a model where accounts have addresses, it makes sense for an account to have a ‘default receiving address’. It doesn’t make sense for a label to have a ‘default receiving address’, since a label is just a description that can be attached to one or more addresses.

    I don’t think that’s too mystical. The relationship of addresses owning labels is simple, and the existence of a ’label address’ confuses that simple relationship.

  5. fanquake added the label Wallet on Apr 23, 2018
  6. jnewbery commented at 9:43 pm on April 23, 2018: member

    It could also be good to update release notes with a workaround for the deprecated getaccountadddress, though I couldn’t think of anything very straightforward.

    There are two suggested workarounds here: #7729 (comment) and here: #7729 (comment).

    I’m happy to add those to the release notes if you think that’s a good idea.

  7. laanwj commented at 12:25 pm on April 24, 2018: member
    Concept ACK. Will review in detail after #12953 merged. (it has been merged, please rebase)
  8. MarcoFalke force-pushed on Apr 24, 2018
  9. MarcoFalke commented at 1:40 pm on April 24, 2018: member

    Purged GitHub to get rid of the merged commits without rebase:

    0git push git@github.com:jnewbery/bitcoin.git a3d7d6ad9ff3b40904fae0b8d97b46126e810f3b:remove_getlabeladdress && git push git@github.com:jnewbery/bitcoin.git 8d22e03929f1c6fdcf8669fb01246b7099d861f2:remove_getlabeladdress -f
    
  10. in test/functional/wallet_labels.py:98 in 8d22e03929 outdated
    91@@ -92,17 +92,25 @@ def _run_subtest(self, accounts_api, node):
    92         # recognize the label/address associations.
    93         labels = [Label(name, accounts_api) for name in ("a", "b", "c", "d", "e")]
    94         for label in labels:
    95-            label.add_receive_address(node.getlabeladdress(label=label.name, force=True))
    96+            if accounts_api:
    97+                address = node.getaccountaddress(label.name)
    98+            else:
    99+                address = node.getnewaddress()
    


    laanwj commented at 7:30 am on April 25, 2018:
    address = node.getnewaddress(label.name)? (or is the point here to test setlabel?)

    jnewbery commented at 2:55 pm on April 30, 2018:

    No, yours is better. setlabel is tested further down.

    Fixed and pushed the new version.

  11. promag commented at 10:40 am on April 29, 2018: member
    Concept ACK.
  12. jnewbery force-pushed on Apr 30, 2018
  13. [wallet] [rpc] Remove getlabeladdress RPC
    labels are associated with addresses (rather than addresses being
    associated with labels, as was the case with accounts). The
    getlabeladdress does not make sense in this model, so remove it.
    
    getaccountaddress is still supported for one release as the accounts
    API is deprecated.
    81608178cf
  14. [wallet] [docs] Update release notes for removing `getlabeladdress` 67e0e04140
  15. jnewbery force-pushed on May 16, 2018
  16. jnewbery commented at 9:59 pm on May 16, 2018: member
    rebased
  17. jnewbery commented at 5:47 pm on May 21, 2018: member
    Request that this get a V17.0 tag. it’s not essential that it goes in for the next release, but it’d be preferable to not change the API twice in two consecutive releases if possible.
  18. MarcoFalke added this to the milestone 0.17.0 on May 21, 2018
  19. MarcoFalke commented at 8:02 pm on May 21, 2018: member
    Concept ACK
  20. laanwj commented at 1:17 pm on June 11, 2018: member
    utACK 67e0e04140b3dfac12d628cee391d40b5fac5cfa
  21. laanwj merged this on Jun 11, 2018
  22. laanwj closed this on Jun 11, 2018

  23. laanwj referenced this in commit 3f0f39415b on Jun 11, 2018
  24. jnewbery deleted the branch on Jun 11, 2018
  25. jasonbcox referenced this in commit 3e80fb1e89 on Dec 6, 2019
  26. jonspock referenced this in commit 9339a0747e on Sep 29, 2020
  27. jonspock referenced this in commit b15fee0f58 on Sep 29, 2020
  28. jonspock referenced this in commit 1a753940eb on Oct 10, 2020
  29. xdustinface referenced this in commit c38922e69e on Dec 18, 2020
  30. xdustinface referenced this in commit f2308433cb on Dec 18, 2020
  31. xdustinface referenced this in commit c6ec951776 on Dec 18, 2020
  32. xdustinface referenced this in commit b9e60dd426 on Dec 22, 2020
  33. xdustinface referenced this in commit 8e52b33d3e on Dec 22, 2020
  34. MarcoFalke locked this on Sep 8, 2021

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: 2024-10-05 01:12 UTC

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