-
Notifications
You must be signed in to change notification settings - Fork 147
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Aligning RPC API with Bitcoin Core conventions #551
Comments
My main objection would be added complexity if we keep the old names around and just "add" new ones. |
@domob1812 I was figuring we could add the new methods, mark the old ones as deprecated, then a release or two later we could mark the old ones as invisible (I think Bitcoin Core supports invisible RPC methods that don't show up in help?), and then after another 1-2 releases we could remove the old methods. If you strongly prefer a faster schedule to remove the old methods, I might be amenable to that. |
No, I definitely do not prefer to remove the old methods quickly, because that will break everyone out there. And I also don't like having the methods duplicated, as that will be quite a bit of extra complexity in the code (not specifically "complex" code, but just bloat that needs to be updated whenever upstream Bitcoin updates the RPC doc code again and all that). To be honest, my impression is that either way is "bad" and not worth it just to change the naming convention. I'd prefer to keep the names and arguments as they are. |
So, I'm not sure if this has been reaching you, but we're getting a lot of unhappy support requests from users who find the current RPC API to be confusing / bad UX due to its dissimilarity to Bitcoin Core. Some of these complaints are from funders. So I think it is worth fixing. For the specific concern about having duplicate methods, I can think of two workarounds:
Option 2 seems like it would be better for avoiding the bloat that needs to be kept in sync with upstream. I've never actually tried to use method aliases, but I don't mind looking into how it works. Thoughts? |
I am not an expert about Bitcoin's RPC code, either - but if method aliases work that way, then I have no objection to adding them. However, another concern would then be the rename of method arguments, which entails with it the full RPC doc code (which is self-verifying and thus needs to be set correctly or it will break). I assumed that we would want to leave the old method as-is, and add the new method with changed argument names, too. And in that case, we could use neither option 1 nor 2, as we would (at the least) have to duplicate the RPC doc logic. |
@domob1812 Looking at this from another angle -- how often do these breaking changes from upstream affect us? I'm looking at the Namecoin Core Git history for commits that affect
I stopped looking in 2017 Sep. So that looks like between one incident per two years, and two incidents per year (with the rate appearing to decrease over time). Does that sound about right? If we're targeting 4 major releases before the old methods are removed from the code base (2 before they're invisible, and another 2 before we wipe them out), that would be 2 years of maintenance effort for the old methods? Which would be between 1 and 4 merge incidents (closer to 1 given the time correlation)? If implementing this issue is covered by an external funder (to be clear, I do not recommend implementing this without funding), could we simply price the maintenance effort into the funding proposal, so that the funder commits to fund our maintenance effort (based on what we figure 4 merge incidents would cost us in terms of dev time)? I personally wouldn't mind handling those incidents when they happen (as long as that work is funded), it'd be a good excuse to gain some more familiarity with the RPC subsystem (which is something I've wanted to do anyway). |
How do you see this working with external funding? I'm fine to let someone else do this (and be paid for it) - but what shall I do if a weekly merge results in merge conflicts and/or broken build or tests? I would rather not block the merge for perhaps a few weeks until someone else can get it fixed, because that will then just cause more merge conflicts and work to be piling up. Or do you think if in such a case I just push the merge with the conflicts still in, you could go and fix them within the week before the next merge? |
The Namecoin Core RPC API for name operations has a bunch of inconsistencies with what Bitcoin Core does. Some of these inconsistencies are due to Vince doing weird things, others are due to Namecoin Core adding some features before Bitcoin Core did so. Other parts of the API are confusing for historical reasons (though not specifically in conflict with Bitcoin Core).
Some notable examples of API issues:
getrawtransaction
andsubmitblock
."name_checkdb
,name_firstupdate
,name_history
,name_list
,name_new
,name_pending
,name_scan
,name_show
, andname_update
don't follow this.abandontransaction
.name_
methods don't follow this.registername
(registration and pre-registration are more intuitive than firstupdate and new),getnamehistory
(consistent withgetmempoolancestors
),listnames
(consistent withlisttransactions
),preregistername
(ibid),getmempoolname
(consistent withgetmempoolentry
),scannameset
(consistent withscantxoutset
),getname
(consistent withgetrawtransaction
/gettransaction
), andupdatename
.fee_delta
(and not, e.g.feedelta
or camel casefeeDelta
)."allowExisting
,allowExpired
,byHash
,destAddress
,minConf
,maxConf
,nameEncoding
,sendCoins
, andvalueEncoding
don't follow this.options
does the same thing, but worse.name_checkdb
,name_firstupdate
,name_history
,name_list
,name_new
,name_pending
,name_scan
,name_update
, andqueuerawtransaction
don't follow this.rand
argumentsalt
, since this value is typically not random anymore.allowExisting
vsallow_active
allow_active
is probably more precise.tx
argumenttxid
, sincetx
could be confused withrawtx
Would there be any objections to updating the API to fix these issues (leaving the existing API methods in place to avoid disrupting consumers of the current API)?
The text was updated successfully, but these errors were encountered: