Skip to content
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

fix(rpc): Make the verbosity argument optional in the getblock RPC #6092

Merged
merged 1 commit into from Feb 3, 2023

Conversation

teor2345
Copy link
Contributor

@teor2345 teor2345 commented Feb 2, 2023

Motivation

When s-nomp mines a block with Zebra, it double-checks that block was accepted by the node using getblock. Currently, this fails with:

2023-02-02 11:59:27 [Pool] [zcash_testnet] (Thread 1) Submitted Block using submitblock successfully to daemon instance(s)
2023-02-02 11:59:27 [Pool] [zcash_testnet] (Thread 1) We thought a block was found but it was rejected by the daemon, share data: {"job":"ccce","ip":"::ffff:127.0.0.1","port":1234,"worker":"tmRGc4CD
1UyUdbSJmTUzcB6oDqk4qUaHnnh.worker1","height":2213653,"difficulty":0.05,"shareDiff":"0.16859053","blockDiff":0.062643492,"blockDiffActual":0.062643492,"blockHash":"002f73c6b1fb5a58137955d83aaef22a20921ec
fca5d64ce6798664c2b8d27fe","error":{"unknown":"check coin daemon logs"}}

This is a confusing message for users (and developers!), because the block is actually accepted in the chain.

Specifications

The default for verbosity is 1:
https://zcash.github.io/rpc/getblock.html

Solution

  • Make the verbosity argument optional with a default of 1
  • Update existing tests
  • Add new snapshots and test vectors

Review

This is not on the critical path because it's just annoying and confusing - it doesn't actually block testing progress.

Reviewer Checklist

  • Will the PR name make sense to users?
    • Does it need extra CHANGELOG info? (new features, breaking changes, large changes)
  • Are the PR labels correct?
  • Does the code do what the ticket and PR says?
    • Does it change concurrent code, unsafe code, or consensus rules?
  • How do you know it works? Does it have tests?

@teor2345 teor2345 added C-bug Category: This is a bug P-Medium ⚡ I-usability Zebra is hard to understand or use A-rpc Area: Remote Procedure Call interfaces A-compatibility Area: Compatibility with other nodes or wallets, or standard rules labels Feb 2, 2023
@teor2345 teor2345 self-assigned this Feb 2, 2023
@teor2345 teor2345 requested a review from a team as a code owner February 2, 2023 02:36
@teor2345 teor2345 requested review from oxarbitrage and removed request for a team February 2, 2023 02:36
@codecov
Copy link

codecov bot commented Feb 2, 2023

Codecov Report

Merging #6092 (670ef54) into main (b327d5b) will increase coverage by 0.11%.
The diff coverage is 100.00%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6092      +/-   ##
==========================================
+ Coverage   77.95%   78.07%   +0.11%     
==========================================
  Files         304      304              
  Lines       39027    39035       +8     
==========================================
+ Hits        30423    30475      +52     
+ Misses       8604     8560      -44     

Copy link
Contributor

@arya2 arya2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

mergify bot added a commit that referenced this pull request Feb 2, 2023
@arya2
Copy link
Contributor

arya2 commented Feb 2, 2023

In the merge queue:

block-source-validateproposal-proposal-is-not-based-on-the-current-best-chain-tip-previous-block-hash-must-be-the-best-chain-tip

https://github.com/ZcashFoundation/zebra/actions/runs/4078692209/jobs/7029791337#step:8:290

@teor2345
Copy link
Contributor Author

teor2345 commented Feb 3, 2023

@Mergifyio refresh

@teor2345
Copy link
Contributor Author

teor2345 commented Feb 3, 2023

In the merge queue:

block-source-validateproposal-proposal-is-not-based-on-the-current-best-chain-tip-previous-block-hash-must-be-the-best-chain-tip

https://github.com/ZcashFoundation/zebra/actions/runs/4078692209/jobs/7029791337#step:8:290

This looks like it will be fixed by PR #6091, so I'll retry this PR.

@mergify
Copy link
Contributor

mergify bot commented Feb 3, 2023

refresh

✅ Pull request refreshed

mergify bot added a commit that referenced this pull request Feb 3, 2023
@mergify mergify bot merged commit a51bc2e into main Feb 3, 2023
@mergify mergify bot deleted the optional-getblock-verbosity branch February 3, 2023 02:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-compatibility Area: Compatibility with other nodes or wallets, or standard rules A-rpc Area: Remote Procedure Call interfaces C-bug Category: This is a bug I-usability Zebra is hard to understand or use
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants