0
0
Fork 0
mirror of https://github.com/bitcoin/bitcoin.git synced 2025-02-08 10:31:50 -05:00
This commit is contained in:
tdb3 2025-01-31 02:40:22 +01:00 committed by GitHub
commit f9263295f7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1468,6 +1468,12 @@ A few guidelines for introducing and reviewing new RPC interfaces:
- *Rationale*: JSON strings are Unicode strings, not byte strings, and
RFC8259 requires JSON to be encoded as UTF-8.
A few guidelines for modifying and reviewing existing RPC interfaces:
- If an RPC is being changed in a backward-incompatible way, 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. A release note should be included that refers to RPC help for details of feature deprecation and re-enabling previous behavior. [Example RPC help](https://github.com/bitcoin/bitcoin/blob/94f0adcc31d2d263a03e46192922e3a7672e39d9/src/rpc/blockchain.cpp#L1316-L1323).
- *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.
Internal interface guidelines
-----------------------------