-
Notifications
You must be signed in to change notification settings - Fork 118
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
Use the same format as zcashd
for getblocktemplate
proposal mode errors
#5981
Comments
I think it's low-priority since it only happens for rejections where the response is going to be different anyways because Zebra doesn't provide any specific reject-reasons. The intent in this case is to test the template response rather than getblocktemplate in proposal mode so I think should prioritize fixing the causes of rejections over this. |
It could be a blocker for running with nodes if they exit or permanently fail when they get an error response they are not expecting. So I think we might want to fix it before we ask mining pools to test Zebra. (We expect to return a "wrong tip block" to about 1% of proposals, due to changing chain forks, and new blocks being committed while the proposal is being created.) |
And I agree that the consensus bug is a higher priority! |
Hey team! Please add your planning poker estimate with Zenhub @arya2 @conradoplg @dconnolly @oxarbitrage @teor2345 @upbqdn |
We could try replacing all the punctuation and newlines in those messages with Then the message would stay detailed and readable, but it would match the format that |
@mpguerra I don't think this is a blocker for anything, except maybe for some mining pool software using Zebra. |
I was not able to reproduce this issue yet. Had been using this to test: #5803 (comment) There are failures but not the one posted here, i am unsure if this is still happening. Other fails i was able to see were: Zcash responding with
Invalid proposal in zebra but valid in zcashd. I got this one one time.
I am not totally sure from where the error in the original post is built, seems to be at https://github.com/ZcashFoundation/zebra/blob/main/zebra-rpc/src/methods/get_block_template_rpcs/types/get_block_template/proposal.rs#L49 ? I can try to change that @teor2345 can you point me to where do you think the format needs to be changed ? |
The exact error doesn't matter, this ticket is about the error format.
But
We don't know how strict mining pools are about the response format. And if they get an error, they might just give up on using Zebra, rather than telling us. Here is the code that needs to change: zebra/zebra-rpc/src/methods/get_block_template_rpcs/types/get_block_template/proposal.rs Lines 44 to 56 in b3a4807
Currently,
It is ok to delete or replace punctuation. It doesn't matter if the Block, source, or ValidateProposal are included or not. |
I was never referring to the exact error, i already know that is not the problem. All the explication about what the miners will do (according to what you think) are not needed either. Here what i am asking. Your error:
My error (zcashd produces and error but zebra does not):
In my other error (zebra produces an error and zcashd is not):
Making a regex or whatever to convert from
into
into |
Thanks for letting me know. I explained the errors because you said you couldn't reproduce the issue. |
The format was already changed in PR #5993, so the error message in the ticket is out of date. Would you like to update the ticket, or did you want me to? |
Ok, that is what i had missing. Got it now, thanks. Ill make the changes in the OP with my error. |
I'd suggest using If we do something like this: format!("{error:?}").replace(|c| !c.is_alphanumeric(), "-").make_ascii_lowercase() Then it doesn't matter what the debug format is, and we can change that format without breaking the RPC. |
Yes, that is what i was thinking about, not a regex really. |
Motivation
When I use
zebra-utils/zcash-rpc-block-template-to-proposal
from PR #5944 to send a block proposal from Zebra to bothzcashd
and Zebra, I see these differences in the response format:Zebra should return a string to match the
zcashd
response format, but it is currently returning JSON. For example zcashd returns errors likebad-txns-inputs-missingorspent
Specifications
We were following the specifications in the bitcoin improvement proposals here, but being compatible with the
zcashd
implementation is a higher priority.It is enough to return any error string in
kebab-case
format - we don't need to match the exact error wording.For the example above about best tip error zebra should return something like:
invalid-proposal-proposal-is-not-based-on-the-current-best-chain-tip-previous-block-hash–must–be-the–best-chain-tip
Complex Code or Requirements
This should be a simple format change.
Testing
We can use the
zebra-utils/zcash-rpc-block-template-to-proposal
script to manually re-test to make sure this bug is gone. We'll need to wait for an error.(The previous block error happens if a new block has just arrived, or there is a chain fork.)
The text was updated successfully, but these errors were encountered: