HomePhabricator

[backport#17578] rpc: simplify getaddressinfo labels, deprecate previous…

Description

[backport#17578] rpc: simplify getaddressinfo labels, deprecate previous behavior

Summary:
8925df86c4df16b1070343fef8e4d238f3cc3bd1 doc: update release notes (Jon Atack)
8bb405bbadf11391ccba7b334b4cfe66dc85b390 test: getaddressinfo labels purpose deprecation test (Jon Atack)
60aba1f2f11529add115d963d05599130288ae28 rpc: simplify getaddressinfo labels, deprecate previous behavior (Jon Atack)
7851f14ccf2bcd1e9b2ad48e5e08881be06d9d21 rpc: incorporate review feedback from PR17283 (Jon Atack)

Pull request description:

This PR builds on #17283 (now merged) and is followed by #17585.

It modifies the value returned by rpc getaddressinfo `labels` to an array of label name strings and deprecates the previous behavior of returning an array of JSON hash structures containing label `name` and address `purpose` key/value pairs.

before
```
  "labels": [
    {
      "name": "DOUBLE SPEND",
      "purpose": "receive"
    }
```
after
```
  "labels": [
    "DOUBLE SPEND"
  ]
```

The deprecated behavior can be re-enabled by starting bitcoind with `-deprecatedrpc=labelspurpose`.

For context, see:
- https://github.com/bitcoin/bitcoin/pull/17283#issuecomment-554458001
- http://www.erisian.com.au/bitcoin-core-dev/log-2019-12-13.html#l-425 (lines 425-427)
- http://www.erisian.com.au/bitcoin-core-dev/log-2019-11-22.html#l-622

Reviewers: This PR may be tested manually by building, then running bitcoind with and without the `-deprecatedrpc=labelspurpose` flag while verifying the rpc getaddressinfo help text and `labels` output.

Next steps: deprecate the rpc getaddressinfo `label` field (EDIT: done in #17585) and add support for multiple labels per address. This PR will unblock those.

Depends on D7718

Backport of Core PR17578

Test Plan:

ninja all check check-functional

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Differential Revision: https://reviews.bitcoinabc.org/D7724

Details

Provenance
Samuel Dobson <dobsonsa68@gmail.com>Authored on Jan 7 2020, 22:23
majcostaCommitted on Oct 1 2020, 20:27
majcostaPushed on Oct 1 2020, 20:27
Reviewer
Restricted Project
Differential Revision
D7724: [backport#17578] rpc: simplify getaddressinfo labels, deprecate previous behavior
Parents
rABCcc5951bf2a3b: [backport#17283] rpc: improve getaddressinfo test coverage, help, code docs
Branches
Unknown
Tags
Unknown