Repository navigation
Conversation
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. Code Coverage & BenchmarksFor details see: https://corecheck.dev/bitcoin/bitcoin/pulls/31900. ReviewsSee the guideline for information on the review process.
If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update. ConflictsReviewers, this pull request conflicts with the following ones:
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. |
glozow
left a comment
There was a problem hiding this comment.
lgtm, though I've heard we don't like hyphens, so perhaps go in the other direction and change all the other ones to _?
Hmm, sure, happy to change if that would be preferable, mostly went this way as I saw other examples using |
|
I want to say this changed over time... I can't find the thread where I was convinced, but here's chat GPT's argument for why underscores are better than hyphens in JSON:
fwiw, if we think of pre-29 as the last chance to be liberal with changing API, I do think unifying it within |
stickies-v
left a comment
There was a problem hiding this comment.
The developer notes state:
Argument and field naming: please consider whether there is already a naming style or spelling convention in the API for the type of object in question (blockhash, for example), and if so, try to use that. If not, use snake case fee_delta (and not, e.g. feedelta or camel case feeDelta).
Rationale: Consistency with the existing interface.
So it seems like if any change is made, it should be package_msg, or update developer notes first. The JSON-RPC spec does not provide guidelines on using either or the other, and it doesn't seem to me like there is an industry standard either, so I don't see a particular reason to update the developer notes.
fwiw, if we think of pre-29 as the last chance to be liberal with changing API, I do think unifying it within
submitpackagemakes sense
I agree with that. Concept ACK.
Previously, the result of a `submitpackage` RPC call would include fields with mixed styles (mixing dash-case and snake_case). Here, we align them all to use snake_case, i.e., to use the `_` delimiter.
Previously, the result of a `testmempoolaccept` RPC call would include fields with mixed styles (mixing dash-case and snake_case). Here, we align them all to use snake_case, i.e., to use the `_` delimiter.
52a24de to
a85ea7d
Compare
package-msg field of submitpackage RPCsubmitpackage RPC results
|
Alright, I now updated this PR to adjust all
Alright, good to know. It might be noteworthy that there are other projects that directly forward Core's JSON (e.g. the Esplora implementations over at mempool/electrs#105 and Blockstream/electrs#119) that would also be affected by the API breakage (and for clients it might also be a bit annoying as they surely can't know with version of Core a particular Esplora server is running under the hood, but I guess they'd need to figure something out, or just use the newer version asap?). That said, I agree that if this should get fixed/aligned, now might be the last chance to do so (also given that said downstream projects haven't fully finished deploying |
|
Would be good to add release notes to document the |
| {RPCResult::Type::STR, "reject-reason", /*optional=*/true, "Rejection reason (only present when 'allowed' is false)"}, | ||
| {RPCResult::Type::STR, "reject-details", /*optional=*/true, "Rejection details (only present when 'allowed' is false and rejection details exist)"}, | ||
| {RPCResult::Type::STR, "reject_reason", /*optional=*/true, "Rejection reason (only present when 'allowed' is false)"}, | ||
| {RPCResult::Type::STR, "reject_details", /*optional=*/true, "Rejection details (only present when 'allowed' is false and rejection details exist)"}, |
There was a problem hiding this comment.
reject-details was only added in 221c789 (master), so changing it seems fine
Ah right, I forgot about that. And spesmilo/electrumx#288 and spesmilo/electrum-protocol#1. I think this would inconvenience a few people. Ok... even though it's marked as experimental, I think it's too late to break |
Alright, no worries! Going ahead and closing this. |
Previously, the
submitpackageRPC call returned a response key namedpackage_msg, which is inconsistent with the other field names that are using-as a delimiter. Here, we align the style ofpackage-msg.cc @glozow @instagibbs