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): Fix Merkle root transaction order in getblocktemplate RPC method #5953

Merged
merged 1 commit into from
Jan 16, 2023

Conversation

arya2
Copy link
Contributor

@arya2 arya2 commented Jan 13, 2023

Motivation

Block templates returned by the getblocktemplate RPC need to be valid.

Solution

  • Sort mempool_txs before generating a default merkle root for the template

Review

Anyone can review.

See #5884 for testing.

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?

@arya2 arya2 added C-bug Category: This is a bug P-High 🔥 A-rpc Area: Remote Procedure Call interfaces I-lose-funds Zebra loses user funds labels Jan 13, 2023
@arya2 arya2 self-assigned this Jan 13, 2023
@arya2 arya2 requested a review from a team as a code owner January 13, 2023 20:56
@arya2 arya2 requested review from dconnolly and removed request for a team January 13, 2023 20:56
@arya2 arya2 changed the title fix(rpc): Corrects invalid default merkle root generation in getblocktemplate RPC method fix(rpc): Corrects default Merkle root generation in getblocktemplate RPC method Jan 13, 2023
@arya2 arya2 requested a review from teor2345 January 13, 2023 21:11
@codecov
Copy link

codecov bot commented Jan 13, 2023

Codecov Report

Merging #5953 (f052448) into main (99a2da6) will increase coverage by 0.06%.
The diff coverage is n/a.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5953      +/-   ##
==========================================
+ Coverage   78.06%   78.13%   +0.06%     
==========================================
  Files         311      311              
  Lines       38919    38919              
==========================================
+ Hits        30384    30410      +26     
+ Misses       8535     8509      -26     

@teor2345 teor2345 changed the title fix(rpc): Corrects default Merkle root generation in getblocktemplate RPC method fix(rpc): Fix Merkle root generation in getblocktemplate RPC method Jan 15, 2023
@teor2345 teor2345 changed the title fix(rpc): Fix Merkle root generation in getblocktemplate RPC method fix(rpc): Fix Merkle root transaction order in getblocktemplate RPC method Jan 15, 2023
@teor2345 teor2345 added A-consensus Area: Consensus rule updates I-consensus Zebra breaks a Zcash consensus rule labels Jan 15, 2023
Copy link
Contributor

@teor2345 teor2345 left a comment

Choose a reason for hiding this comment

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

Thanks for this fix!

mergify bot added a commit that referenced this pull request Jan 15, 2023
@teor2345
Copy link
Contributor

Failed due to #5958:

#27 ERROR: failed to push us-docker.pkg.dev/zealous-zebra/zebra/zebrad-test:pr-5957: failed to copy: io: read/write on closed pipe

https://github.com/ZcashFoundation/zebra/actions/runs/3925766571/jobs/6710902148#step:9:931

@teor2345
Copy link
Contributor

@Mergifyio refresh

@mergify
Copy link
Contributor

mergify bot commented Jan 16, 2023

refresh

✅ Pull request refreshed

mergify bot added a commit that referenced this pull request Jan 16, 2023
mergify bot added a commit that referenced this pull request Jan 16, 2023
@mergify mergify bot merged commit a8bfb1b into main Jan 16, 2023
@mergify mergify bot deleted the fix-gbt-merkle-root branch January 16, 2023 03:37
mergify bot added a commit that referenced this pull request Jan 16, 2023
@mpguerra
Copy link
Contributor

did we create an issue for this? it's ok if not just trying to track things

@arya2
Copy link
Contributor Author

arya2 commented Jan 17, 2023

did we create an issue for this? it's ok if not just trying to track things

We didn't create an issue for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-consensus Area: Consensus rule updates A-rpc Area: Remote Procedure Call interfaces C-bug Category: This is a bug I-consensus Zebra breaks a Zcash consensus rule I-lose-funds Zebra loses user funds
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants