-
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
Add support for block proposals to getblocktemplate
method
#5684
Comments
All the miners we've seen so far use |
It would be really convenient for testing, but this does seem like a potentially bad case of scope creep. |
Let's think about how we can minimise the scope?
Hmm that still seems like a lot. |
I added a design, it's not as bad if we can skip returning detailed errors. |
I really like this idea for testing! Let's definitely see if we can minimise the scope |
I like this idea too! If we design it right, we can add a feature that automatically tests each We might be able to automate this test, as long as we ignore errors when the height has changed. (There's a race condition between creating and checking the block.) We will get better test coverage if we do this with a populated mempool. |
@arya2 can you please add an estimate here? |
Motivation
zcashd supports the
proposal
capability, so that if miners want to modify the template and then check that their modifications are still valid before mining, they could propose the new template.This would also be useful for testing purposes, as we could propose the getblocktemplate's response and confirm that the block will be accepted if it has a valid solution.
This would require a
Request
enum in the block verifier with a variant for speculatively validating a block without checking its solution or committing it.It also requires a new state request.
See #5630 for the state request.
Specifications
https://en.bitcoin.it/wiki/BIP_0023#Block_Proposal
https://en.bitcoin.it/wiki/BIP_0022#appendix-example-rejection-reasons
Designs
check::equihash_solution_is_valid(&block.header)
(https://github.com/ZcashFoundation/zebra/blob/main/zebra-consensus/src/block.rs#L166)
CheckContextualValidity
request from change(rpc): check contextual validity of getblocktemplate response #5630 instead ofCommitBlock
.mode == GetBlockTemplateMode::Proposal
data
into the blockBlockVerifier
with the new request variant instead of generating a templateSee zcashd impl: https://github.com/zcash/zcash/blob/master/src/rpc/mining.cpp#L538-L568
Out Of Scope:
The text was updated successfully, but these errors were encountered: