Skip to content

Commit c6eca6f

Browse files
committed
doc: add guidance for RPC to developer notes
Adds deprecatedrpc guidance statement to the RPC interface guidelines section.
1 parent 479715e commit c6eca6f

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

doc/developer-notes.md

+6
Original file line numberDiff line numberDiff line change
@@ -1460,6 +1460,12 @@ A few guidelines for introducing and reviewing new RPC interfaces:
14601460
- *Rationale*: JSON strings are Unicode strings, not byte strings, and
14611461
RFC8259 requires JSON to be encoded as UTF-8.
14621462

1463+
A few guidelines for modifying existing RPC interfaces:
1464+
1465+
- It's preferable to avoid changing an RPC in a backward-incompatible manner, but in that case, add an associated `-deprecatedrpc=` option to retain previous RPC behavior during the deprecation period. Backward-incompatible changes include: data type changes (e.g. from `{"warnings":""}` to `{"warnings":[]}`, changing a value from a string to a number, etc.), logical meaning changes of a value, or key name changes (e.g. `{"warning":""}` to `{"warnings":""}`). Adding a key to an object is generally considered backward-compatible. Include a release note that refers the user to the RPC help for details of feature deprecation and re-enabling previous behavior. [Example RPC help](https://github.com/bitcoin/bitcoin/blob/94f0adcc/src/rpc/blockchain.cpp#L1316-L1323).
1466+
1467+
- *Rationale*: Changes in RPC JSON structure can break downstream application compatibility. Implementation of `deprecatedrpc` provides a grace period for downstream applications to migrate. Release notes provide notification to downstream users.
1468+
14631469
Internal interface guidelines
14641470
-----------------------------
14651471

0 commit comments

Comments
 (0)