-
Notifications
You must be signed in to change notification settings - Fork 111
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
change(rpc): return an error from getblocktemplate method if Zebra is not synced to network tip #5623
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #5623 +/- ##
==========================================
- Coverage 78.83% 78.71% -0.13%
==========================================
Files 305 305
Lines 38463 38496 +33
==========================================
- Hits 30324 30301 -23
- Misses 8139 8195 +56 |
Restarting this, this failure may be related to flipping backend switches in gcloud related to OS Login: https://github.com/ZcashFoundation/zebra/actions/runs/3447560707/jobs/5754223166 |
@dconnolly this is a missing sudo command. I added it in #5602 but any of you can add it here if needed (not sure why this didn't fail before) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm!
c648048
to
88022ad
Compare
@Mergifyio update |
✅ Branch has been successfully updated |
This looks really good but i will lime to see a test with a chain synced up to tip and a call to We don't need to add this to CI but just a log here will be enough. |
This helped catch an issue! I'm thinking I want to add a test that syncs to the tip for getblocktemplate in CI too for testing #5630 with the non-finalized state, but for now: {
"jsonrpc": "2.0",
"result": {
"capabilities": [],
"version": 4,
"previousblockhash": "0000000000000000000000000000000000000000000000000000000000000000",
"blockcommitmentshash": "0000000000000000000000000000000000000000000000000000000000000000",
"lightclientroothash": "0000000000000000000000000000000000000000000000000000000000000000",
"finalsaplingroothash": "0000000000000000000000000000000000000000000000000000000000000000",
"defaultroots": {
"merkleroot": "f00a46d38fccf8b48554c1f4651eec6bbc294c79ac2e2bc91e63bfcdc574eaa9",
"chainhistoryroot": "0000000000000000000000000000000000000000000000000000000000000000",
"authdataroot": "8231fdfe4e63846249d0880168deb69bcf7d81cc2f762937677f203fa8d8fd2a",
"blockcommitmentshash": "0000000000000000000000000000000000000000000000000000000000000000"
},
"transactions": [],
"coinbasetxn": {
"data": "050000800a27a726b4d0d6c20000000082b31c00010000000000000000000000000000000000000000000000000000000000000000ffffffff040382b31c0000000004286bee000000000017a914d45cb1adffb5215a42720532a076f02c7c778c908738c94d010000000017a914fd237ff37cc91b87b7cef8408ade1bc14a4e67158740787d010000000017a914931fec54c1fea86e574462cc32013f5400b891298780b2e60e0000000017a9147d46a730d31f97b1930d3368a967c309bd4d136a87000000",
"hash": "f00a46d38fccf8b48554c1f4651eec6bbc294c79ac2e2bc91e63bfcdc574eaa9",
"authdigest": "8231fdfe4e63846249d0880168deb69bcf7d81cc2f762937677f203fa8d8fd2a",
"depends": [],
"fee": 0,
"sigops": 0,
"required": true
},
"target": "",
"mintime": 0,
"mutable": ["time", "transactions", "prevblock"],
"noncerange": "00000000ffffffff",
"sigoplimit": 20000,
"sizelimit": 2000000,
"curtime": 0,
"bits": "",
"height": 0
},
"id": 123
} |
adds info log when estimated_distance_to_chain_tip is too high
87bc022
to
38420cb
Compare
@Mergifyio update |
✅ Branch has been successfully updated |
Motivation
We want to return an error if there's distance between Zebra's best chain tip height and the estimated network chain tip height because mining pools may use the
getblocktemplate
method to check if the node is synced.Closes #5466
Solution
Review
This PR is part of regular scheduled work.
Reviewer Checklist