-
Notifications
You must be signed in to change notification settings - Fork 106
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
Tracking: Implement getblocktemplate RPC #5235
Comments
Hey team! Please add your planning poker estimate with Zenhub @arya2 @conradoplg @dconnolly @oxarbitrage @teor2345 @upbqdn |
Some potentially useful documentation from bitcoin: https://en.bitcoin.it/wiki/Getblocktemplate |
This is the default testnet It contains the following undocumented fields:
This makes it more likely that other parts of the documentation are out of date. $ zcash-cli -testnet getblocktemplate {
"capabilities": [
"proposal"
],
"version": 4,
"previousblockhash": "065f6320634754f3e5fbc93ffbde1d4100b96d6a3f3dd552d5b56a015e5b78dd",
"blockcommitmentshash": "95c502ddc997e79266943e3fcef3f83d496dc2716c3c762f706f73455e754014",
"lightclientroothash": "95c502ddc997e79266943e3fcef3f83d496dc2716c3c762f706f73455e754014",
"finalsaplingroothash": "95c502ddc997e79266943e3fcef3f83d496dc2716c3c762f706f73455e754014",
"defaultroots": {
"merkleroot": "8cd693cd20e239426327ea06a64558afbddc7637e67884ee17f4ee1d53b63c63",
"chainhistoryroot": "cdb17ded03160eeed581a7c5f0378d98f820a218856a0251cb0b6ac921c960d8",
"authdataroot": "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
"blockcommitmentshash": "95c502ddc997e79266943e3fcef3f83d496dc2716c3c762f706f73455e754014"
},
"transactions": [
],
"coinbasetxn": {
"data": "0400008085202f89010000000000000000000000000000000000000000000000000000000000000000ffffffff050385d21f00ffffffff0480b2e60e000000001976a914054d6009cb52b13b812bfa6fcf4bc7495b65a89c88ac286bee000000000017a9140c0bcca02f3cba01a5d7423ac3903d40586399eb8738c94d010000000017a9145d8b6cb94fb7d99363ae0e7114be5208f47924508740787d010000000017a91471e1df05024288a00802de81e08c437859586c87870000000085d21f000000000000000000000000",
"hash": "8cd693cd20e239426327ea06a64558afbddc7637e67884ee17f4ee1d53b63c63",
"authdigest": "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
"depends": [
],
"fee": 0,
"sigops": 1,
"required": true
},
"longpollid": "065f6320634754f3e5fbc93ffbde1d4100b96d6a3f3dd552d5b56a015e5b78dd77311",
"target": "029b220000000000000000000000000000000000000000000000000000000000",
"mintime": 1666251905,
"mutable": [
"time",
"transactions",
"prevblock"
],
"noncerange": "00000000ffffffff",
"sigoplimit": 20000,
"sizelimit": 2000000,
"curtime": 1666254605,
"bits": "20029b22",
"height": 2085509
} |
This is the default mainnet $ zcash-cli getblocktemplate {
"capabilities": [
"proposal"
],
"version": 4,
"previousblockhash": "00000000005a92b9c568345fbb04e80d1d8f6bbcbd5c623ed1163e58806d28ab",
"blockcommitmentshash": "f086a03f0ab071e8d20c2f9515253b14cfcb76cfbba34e0cb5314c99ffc8a311",
"lightclientroothash": "f086a03f0ab071e8d20c2f9515253b14cfcb76cfbba34e0cb5314c99ffc8a311",
"finalsaplingroothash": "f086a03f0ab071e8d20c2f9515253b14cfcb76cfbba34e0cb5314c99ffc8a311",
"defaultroots": {
"merkleroot": "3a8f3244e15670a623a08d9b95db69d29ba48d1e8f6bdee970fe1ab39b3f4f9a",
"chainhistoryroot": "6adb3762fbefc6d49c6a472d71d87fe7e0c4d1adc1a4a97a3a165474d65e1cf8",
"authdataroot": "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
"blockcommitmentshash": "f086a03f0ab071e8d20c2f9515253b14cfcb76cfbba34e0cb5314c99ffc8a311"
},
"transactions": [
],
"coinbasetxn": {
"data": "0400008085202f89010000000000000000000000000000000000000000000000000000000000000000ffffffff050364381c00ffffffff0480b2e60e000000001976a914dc38751362cd527d2295064f1a6fac6685e7a14488ac40787d010000000017a914931fec54c1fea86e574462cc32013f5400b891298738c94d010000000017a914a409be939aede71e3e1fa5e2d594161101e7147687286bee000000000017a914d45cb1adffb5215a42720532a076f02c7c778c90870000000064381c000000000000000000000000",
"hash": "3a8f3244e15670a623a08d9b95db69d29ba48d1e8f6bdee970fe1ab39b3f4f9a",
"authdigest": "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
"depends": [
],
"fee": 0,
"sigops": 1,
"required": true
},
"longpollid": "00000000005a92b9c568345fbb04e80d1d8f6bbcbd5c623ed1163e58806d28ab10",
"target": "000000000135fb00000000000000000000000000000000000000000000000000",
"mintime": 1666255449,
"mutable": [
"time",
"transactions",
"prevblock"
],
"noncerange": "00000000ffffffff",
"sigoplimit": 20000,
"sizelimit": 2000000,
"curtime": 1666256072,
"bits": "1c0135fb",
"height": 1849444
} |
This is the default mainnet I replaced 3.6 MB of hex encoded transaction data with $ zcash-cli getblocktemplate | jq '(.transactions[].data) |= "..." ' {
"capabilities": [
"proposal"
],
"version": 4,
"previousblockhash": "00000000001be30d82561462528b56a61c0a5e921960760edd6e325557ecdcbb",
"blockcommitmentshash": "18d46472afb5d45985c23b0fb1404ae3f5cc002a463b9f44b11091483bd0cc09",
"lightclientroothash": "18d46472afb5d45985c23b0fb1404ae3f5cc002a463b9f44b11091483bd0cc09",
"finalsaplingroothash": "18d46472afb5d45985c23b0fb1404ae3f5cc002a463b9f44b11091483bd0cc09",
"defaultroots": {
"merkleroot": "7742ba54ab1a130de3a60020b4e56a45d1a25d0b6776ae9d49091c43aad176d0",
"chainhistoryroot": "b03c4bea6583d9c35bdbea4de9435fd487f6c8a253c119481f15ee0c2bb7fbe6",
"authdataroot": "7f5d36e82fcc84267c4cca93a2800cdcfe26b6f0f03566907739c07cda00ef14",
"blockcommitmentshash": "18d46472afb5d45985c23b0fb1404ae3f5cc002a463b9f44b11091483bd0cc09"
},
"transactions": [
{
"data": "...",
"hash": "610dbcbb639dd02a0958a9a7f2cec4a65bdcbe96b96c0f99c74382b7b1f39e35",
"authdigest": "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
"depends": [],
"fee": 245,
"sigops": 2
},
{
"data": "...",
"hash": "07ebe4606ced7a3ad952115ceb999f73fdaeb147c4c5aa00084d4f1856fe4806",
"authdigest": "e2f90dec876601b63412f966b6544a8a7392cfc50ddd421d076ad85e9445ec84",
"depends": [],
"fee": 1000,
"sigops": 0
}
],
"coinbasetxn": {
"data": "0400008085202f89010000000000000000000000000000000000000000000000000000000000000000ffffffff050366381c00ffffffff045db7e60e000000001976a914f72070b750eba1b327a268a8f68ab5c05834ef6788ac40787d010000000017a914931fec54c1fea86e574462cc32013f5400b891298738c94d010000000017a914a409be939aede71e3e1fa5e2d594161101e7147687286bee000000000017a914d45cb1adffb5215a42720532a076f02c7c778c90870000000066381c000000000000000000000000",
"hash": "201d369050ab59cfdc9cd016ea642997943827bc9633de16522ce32469836308",
"authdigest": "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
"depends": [],
"fee": -1245,
"sigops": 1,
"required": true
},
"longpollid": "00000000001be30d82561462528b56a61c0a5e921960760edd6e325557ecdcbb22",
"target": "00000000013bf900000000000000000000000000000000000000000000000000",
"mintime": 1666255680,
"mutable": [
"time",
"transactions",
"prevblock"
],
"noncerange": "00000000ffffffff",
"sigoplimit": 20000,
"sizelimit": 2000000,
"curtime": 1666256289,
"bits": "1c013bf9",
"height": 1849446
} |
Draft of the split we want to do to implement this method: Goal : Create a default 6 tickets total. This split was chosen because after we introduce a very basic 1- Introduce getblocktemplateTasks:
No dependencies. 2- Populate
|
Based on #5235 (comment) i created 6 tickets:
Feel free to edit the descriptions, they are not all complete yet. |
I just checked the |
getblocktemplate
RPC call
Removing estimate from issue as it is now a tracking issue, estimates of sub-tasks to be taken into account instead |
Closing this for now, implementation is done and testing is being tracked under #5937 |
Motivation
Mining pools use the
getblocktemplate
RPC method.Scope
getblocktemplate
supports about 10 different alternative options or modes:https://zcash.github.io/rpc/getblocktemplate.html
Some of these modes don't work for Zcash, or are very difficult to implement. So we might want to just implement the modes that are actually used by mining pools.
getblocktemplate
RPC method #5451Blocktemplate
responses with fixed values data #5452BlockTemplate
fields using a new state request #5455BlockTemplate.blockcommitmentshash
from the transactions and state request #5579BlockTemplate
#5453BlockTemplate
#5454jsonrequestobject
argument to thegetblocktemplate
RPC #5495getblocktemplate
transactions according to ZIP-317 #5473Optional
We're not sure if we need to implement these tickets yet:
getblocktemplate
for Sapling addresses #5472getblocktemplate
for Orchard Unified addresses #5929Here are some example
getblocktemplate
responses:Mining Pool Usage
s-nomp
callsgetblocktemplate
from this code:Draft Design Notes
Error Handling
Do we need to return an error if Zebra is still syncing, and not at the chain tip yet?
Testing
zcashd
andzebrad
RPC output using https://github.com/ZcashFoundation/zebra/blob/main/zebra-utils/zcash-rpc-diffThe text was updated successfully, but these errors were encountered: