-
Notifications
You must be signed in to change notification settings - Fork 110
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
Support long polling in the getblocktemplate RPC (excluding mempool changes) #5720
Comments
We probably want to do this, however, this seems like a nice and should wait until we have the basic MVP functionality done (Scope section in #5234) |
How will we know our MVP implementation actually works, if we don't implement enough functionality for a mining pool to run it? |
Hey team! Please add your planning poker estimate with Zenhub @arya2 @conradoplg @dconnolly @oxarbitrage @teor2345 @upbqdn |
This is potentially a very large ticket, and it's in this sprint, so I'm going to split the mempool part into another ticket. |
The specific split I planned didn't end up working out, so I closed that ticket, and I did it in multiple PRs instead. |
Motivation
Some mining pools need long polling support, where the RPC response is delayed until the block template changes.
Specifications
https://en.bitcoin.it/wiki/BIP_0022#Optional:_Long_Polling
Designs
RPC fields:
longpoll
support in thegetblocktemplate
RPCcapabilities
longpollid
field in the RPC response, which represents the contents of the tip and mempool used to create the response.longpollid
parameter to the RPC request,When long polling is requested by the client using a
longpollid
parameter, delay the RPC response until:submitold: false
field, because the old template is invalid, andChainTipChange
watch channel that is updated by the state;submitold: true
field, because the old template can still be a valid block, andChainTipChange
;max_time
is reached (or close?):submitold: false
field, because the old template is invalid.RPC server:
getblocktemplate-rpcs
feature is on, because every long polling client could use one thread.jsonrpc_core
implementation to see what happens when a RPC request future is held open. (We assume it will do whatever the underlyingtokio
executor does.)Testing
I have tested long polling with
zcashd
, and it works with this command:zcash-cli getblocktemplate '{ "longpollid": "0000000000ab159b36911c7860f637a8e5c2d99d17c2a922029ff0905655a30080497" }'
The text was updated successfully, but these errors were encountered: