Skip to content

RPC/Mining: Restore API compatibility for prioritisetransaction - #10252

Merged
laanwj merged 1 commit into
bitcoin:masterfrom
luke-jr:rpc_prioritise_api
Jun 6, 2017
Merged

laanwj merged 1 commit into
bitcoin:masterfrom
luke-jr:rpc_prioritise_api

Conversation

@luke-jr

@luke-jr luke-jr commented Apr 21, 2017

Copy link
Copy Markdown
Contributor

Breaking API serves no purpose other than to be incompatible with older versions and other implementations that do support priority

@kallewoof

Copy link
Copy Markdown
Contributor

utACK 9852bf5f6660cb02fae89918cbf5b11bf6c4138e

@jnewbery

jnewbery commented May 1, 2017

Copy link
Copy Markdown
Contributor

This was discussed in #9602 . I was on the fence about whether changing the prioritisetransaction RPC was an acceptable change, but group consensus seemed to be that it should be done. I'm still on the fence, but now that #9602 has been merged I don't think it makes sense to re-open this issue.

As for rationale, I don't think making RPC 'compatible' other implementations should be a consideration for bitcoin core. The RPC interface is an implementation decision. If other bitcoin implementations wish to implement the bitcoin core RPC interface that's fine, but it shouldn't drive core's decisions.

@maflcko

maflcko commented May 1, 2017 via email

Copy link
Copy Markdown
Member

@TheBlueMatt

Copy link
Copy Markdown
Contributor

If we're gonna re-add the dummy value, it should be called "dummy" and explained that its a useless API-compat value (and should make require it to be 0 to ensure people aren't confused).

@luke-jr

luke-jr commented May 2, 2017

Copy link
Copy Markdown
Contributor Author

@TheBlueMatt Besides the name (which would break named-arg compat), I think this PR already satisfies that description: the description explains it isn't supported, and the code enforces it to be either null or 0.

@sdaftuar

Copy link
Copy Markdown
Member

I don't object if others think it's better to avoid breaking the RPC API immediately by keeping this dummy argument around, but I'd say we should update the help text to also say that support for this option will be removed in the future, so that users can expect a future API change.

But I tend to think that we might as well do the full RPC API break now; removal of priority is inherently breaking the API for software that would try to set it...

@maflcko

maflcko commented May 10, 2017 via email

Copy link
Copy Markdown
Member

@luke-jr

luke-jr commented May 10, 2017

Copy link
Copy Markdown
Contributor Author

@sdaftuar Priority still exists, even if Core doesn't support it. The option isn't obsolete, just not supported by Core. There's no reason to remove it in the future, as that would not only break backward compatibility, but also break cross-node compatibility, and for no gain.

@ryanofsky ryanofsky left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK e50650dcf9e856245419dc76d0496a3ea408703b though needs rebase. This seems like an ideal change, since it:

  • Maintains compatibility for users setting 0 priority.
  • Provides a useful error message for users setting other priorities.
  • Updates tests to use named arguments.

Having a dummy priority parameter that doesn't do anything doesn't seem like a big drawback, but if it is a sticking point for merging this PR, maybe this PR could add new RPC that only sets the fee delta, and mark the prioritize RPC deprecated in favor of that new one.

@luke-jr
luke-jr force-pushed the rpc_prioritise_api branch from e50650d to 06a2d76 Compare May 22, 2017 20:55
@luke-jr

luke-jr commented May 22, 2017

Copy link
Copy Markdown
Contributor Author

Rebased

@ryanofsky ryanofsky left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK 06a2d767ce6e06d66ed4e4cfbd751d2ded179a86 with the additional fix for prioritise_transaction.py. Confirmed no changes since last review other than rebase & squash.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's another prioritisetransaction call below that needs to be updated (it's causing travis tests to fail).

@sipa

sipa commented May 23, 2017

Copy link
Copy Markdown
Member

Concept ACK, but tests need fixing.

Breaking API serves no purpose other than to be incompatible with older versions and other implementations that do support priority
@luke-jr
luke-jr force-pushed the rpc_prioritise_api branch from 06a2d76 to 870824e Compare May 23, 2017 20:46
@luke-jr

luke-jr commented May 24, 2017

Copy link
Copy Markdown
Contributor Author

Fixed

@maflcko

maflcko commented Jun 2, 2017

Copy link
Copy Markdown
Member

re-utACK 870824e

@ryanofsky ryanofsky left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK 870824e. Only change since last review was the suggested test fix.

#10488 is an alternative to this PR which renames the priority argument to dummy and changes the wording of some documentation strings. I slightly prefer this PR because it's more focused and more backwards-compatible, and I think if the any of the additional changes from #10488 are desirable, that PR can be just be rebased and merged after this one.


# Now prioritise tx2b to have a higher modified fee
self.nodes[0].prioritisetransaction(tx2b.hash, int(0.1*COIN))
self.nodes[0].prioritisetransaction(txid=tx2b.hash, fee_delta=int(0.1*COIN))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for converting these to name-based arguments.

@laanwj
laanwj merged commit 870824e into bitcoin:master Jun 6, 2017
laanwj added a commit that referenced this pull request Jun 6, 2017
…nsaction

870824e RPC/Mining: Restore API compatibility for prioritisetransaction (Luke Dashjr)

Tree-SHA512: eb507500dc5ba8d17521f34f3d6eae45aa9259c38d15a75dc3e3ad45774ffb53db943be1720a97e6cd5f08e7832801e27ffb636da081a58955018b6f8f9d8fba
@TheBlueMatt TheBlueMatt mentioned this pull request Jun 9, 2017
12 tasks done
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.