-
Notifications
You must be signed in to change notification settings - Fork 107
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): Add proposal capability to getblocktemplate #5870
Conversation
skips solution check for BlockProposal requests calls CheckBlockValidity instead of Commit block for BlockProposal requests
…ktemplate-rpcs in zebra-state
@arya2 can you please rebase this PR on the latest The diff currently shows changes from other PRs, which makes it hard to review. |
ee8e0d2
to
f7c5941
Compare
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.
Looks good!
This is a large and risky change, but if we make some changes we can do it without breaking production code, or diverging from the consensus rules.
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #5870 +/- ##
==========================================
- Coverage 78.23% 78.02% -0.22%
==========================================
Files 310 311 +1
Lines 38837 38919 +82
==========================================
- Hits 30383 30365 -18
- Misses 8454 8554 +100 |
096dab3
to
8420b75
Compare
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.
I'm really happy with the way you've made this change clearer and more consistent, and made it easier to see that we are following the consensus rules.
For testing, I'd like to see a diff between a Zebra and zcashd
block proposal response. I'm also happy to do that test, if you don't have synced instances ready.
This PR took me a while to review, because it changes about 40 files. We might want to think about how to split up future large changes into stages, or how we can avoid unnecessary changes. (This is a general comment, there's no need to split this PR!)
For example, I think we could have done the FinalizedState
to ZebraDb
change in another PR, which would have split out about 10 files from this PR.
Co-authored-by: teor <[email protected]>
Co-authored-by: teor <[email protected]>
This is now handled in ticket #5803, so it doesn't need to block this PR or the CI tests. |
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.
I'm happy for anyone to approve once we've fixed the previous block hash check.
Co-authored-by: teor <[email protected]>
I agree with splitting changes into multiple PRs. I also liked how you organized the getblocktemplate refactor in PR #5837 for when there are a lot of changes in one PR. |
31afa3a
to
c8a35e6
Compare
c8a35e6
to
9ce7d8a
Compare
An
Update: I made issue #5940 for fixing the test. |
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.
Thanks for fixing up my suggestions!
Thanks for the excellent suggestions! |
Same network error as #5938 (comment) |
@Mergifyio update |
✅ Branch has been successfully updated |
Motivation
We want to support using the getblocktemplate RPC in proposal mode to use in our acceptance test.
Closes #5684.
Complex Code or Requirements
The new
CheckValidBlock
state request needs to check the block against all of the usual acceptance rules.Solution
validate_and_commit
with a clone of the non-finalized stateCheckProposal
variant that skips checking the solution and calls the state withCheckValidBlock
instead ofCommitBlock
mode
anddata
fields of thegetblocktemplate
parametersdata
field and call chain verifier with aCheckProposal
requestRelated changes:
workid
parameterReview
Reviewer Checklist
Follow Up Work