-
Notifications
You must be signed in to change notification settings - Fork 110
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): Sort transaction hashes like zcashd in getrawmempool RPC response #5994
Conversation
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 think this looks good, but I can't see if the order matches zcashd.
We might also want to make it easier to maintain - zcashd might change their order when they implement ZIP-317.
Can you post some zcash-rpc-diff results that demonstrate fee/size and transaction hash ordering?
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #5994 +/- ##
==========================================
+ Coverage 78.01% 78.09% +0.07%
==========================================
Files 312 312
Lines 38997 39011 +14
==========================================
+ Hits 30425 30467 +42
+ Misses 8572 8544 -28 |
I haven't seen it compare transaction hashes yet but for fee/size: ➜ zebra git:(sort-getrawmempool) ✗ ZCASH_CLI=../zcash/src/zcash-cli ./zebra-utils/zcash-rpc-diff 3000 getrawmempool
Checking first node release info...
Checking second node release info...
Connected to zebrad (port 3000) and zcashd (../zcash/src/zcash-cli zcash.conf port).
Checking zebrad network and tip height...
Checking zcashd network and tip height...
Request:
getrawmempool
Querying zebrad main chain at height >=1952462...
real 0m0.004s
user 0m0.003s
sys 0m0.000s
Querying zcashd main chain at height >=1952462...
real 0m0.004s
user 0m0.004s
sys 0m0.000s
Response diff between zebrad and zcashd:
RPC responses were identical
/tmp/tmp.aTB2QNAr5z.rpc-diff/zebrad-main-1952462-getrawmempool.json:
[
"a6d4cd5bc965d581f2b125da30971993f034b370ffb54bcefaa8af0d452fc1bc",
"74979ecc884fe5a4f01f78dfe5b8d252fee7b0a11c96492deb61d10024520ece",
"ab0269e0caf72e467e246d9127affa58b1a28f65bca472d34ded8d1d816cd9e7",
"36f5a844625e83ef9c01bc3c2a6ce368c22e313717f79784eed9db849a38e41c",
"49cf002385c1503ddd1255fd5d2a6420f448d7f98dd17d826b5e10d081f917f9"
] More: ➜ zebra git:(sort-getrawmempool) ✗ ZCASH_CLI=../zcash/src/zcash-cli ./zebra-utils/zcash-rpc-diff 3000 getrawmempool
Checking first node release info...
Checking second node release info...
Connected to zebrad (port 3000) and zcashd (../zcash/src/zcash-cli zcash.conf port).
Checking zebrad network and tip height...
Checking zcashd network and tip height...
Request:
getrawmempool
Querying zebrad main chain at height >=1952462...
real 0m0.003s
user 0m0.002s
sys 0m0.000s
Querying zcashd main chain at height >=1952462...
real 0m0.005s
user 0m0.000s
sys 0m0.004s
Response diff between zebrad and zcashd:
RPC responses were identical
/tmp/tmp.zp5PHPZImD.rpc-diff/zebrad-main-1952462-getrawmempool.json:
[
"a6d4cd5bc965d581f2b125da30971993f034b370ffb54bcefaa8af0d452fc1bc",
"74979ecc884fe5a4f01f78dfe5b8d252fee7b0a11c96492deb61d10024520ece",
"ab0269e0caf72e467e246d9127affa58b1a28f65bca472d34ded8d1d816cd9e7",
"36f5a844625e83ef9c01bc3c2a6ce368c22e313717f79784eed9db849a38e41c",
"49cf002385c1503ddd1255fd5d2a6420f448d7f98dd17d826b5e10d081f917f9"
]
➜ zebra git:(sort-getrawmempool) ✗ ZCASH_CLI=../zcash/src/zcash-cli ./zebra-utils/zcash-rpc-diff 3000 getrawmempool
Checking first node release info...
Checking second node release info...
Connected to zebrad (port 3000) and zcashd (../zcash/src/zcash-cli zcash.conf port).
Checking zebrad network and tip height...
Checking zcashd network and tip height...
Request:
getrawmempool
Querying zebrad main chain at height >=1952462...
real 0m0.003s
user 0m0.003s
sys 0m0.000s
Querying zcashd main chain at height >=1952462...
real 0m0.004s
user 0m0.003s
sys 0m0.000s
Response diff between zebrad and zcashd:
RPC responses were identical
/tmp/tmp.ufdDnxDee3.rpc-diff/zebrad-main-1952462-getrawmempool.json:
[
"a6d4cd5bc965d581f2b125da30971993f034b370ffb54bcefaa8af0d452fc1bc",
"74979ecc884fe5a4f01f78dfe5b8d252fee7b0a11c96492deb61d10024520ece",
"ab0269e0caf72e467e246d9127affa58b1a28f65bca472d34ded8d1d816cd9e7",
"36f5a844625e83ef9c01bc3c2a6ce368c22e313717f79784eed9db849a38e41c",
"49cf002385c1503ddd1255fd5d2a6420f448d7f98dd17d826b5e10d081f917f9"
]
➜ zebra git:(sort-getrawmempool) ✗ ZCASH_CLI=../zcash/src/zcash-cli ./zebra-utils/zcash-rpc-diff 3000 getrawmempool
Checking first node release info...
Checking second node release info...
Connected to zebrad (port 3000) and zcashd (../zcash/src/zcash-cli zcash.conf port).
Checking zebrad network and tip height...
Checking zcashd network and tip height...
Request:
getrawmempool
Querying zebrad main chain at height >=1952464...
real 0m0.004s
user 0m0.003s
sys 0m0.000s
Querying zcashd main chain at height >=1952464...
real 0m0.003s
user 0m0.003s
sys 0m0.000s
Response diff between zebrad and zcashd:
RPC responses were identical
/tmp/tmp.NVA9QwrtE9.rpc-diff/zebrad-main-1952464-getrawmempool.json:
[
"18bbe79487e157af34c1b8d00d51cedb3dd07625d8b76b17eb58e9f8c870d11e",
"6077962d04cda6a99502cdfaf71c38079ec4f17186d4e53f94f18b1a39a24ddb",
"bd8881165be076b6e1a342356bc7194f239908e0e8d72c4e75466e6bcefae2b7"
]
➜ zebra git:(sort-getrawmempool) ✗ ZCASH_CLI=../zcash/src/zcash-cli ./zebra-utils/zcash-rpc-diff 3000 getrawmempool
Checking first node release info...
Checking second node release info...
Connected to zebrad (port 3000) and zcashd (../zcash/src/zcash-cli zcash.conf port).
Checking zebrad network and tip height...
Checking zcashd network and tip height...
Request:
getrawmempool
Querying zebrad main chain at height >=1952464...
real 0m0.002s
user 0m0.002s
sys 0m0.000s
Querying zcashd main chain at height >=1952464...
real 0m0.002s
user 0m0.002s
sys 0m0.000s
Response diff between zebrad and zcashd:
RPC responses were identical
/tmp/tmp.wVSWLneKAN.rpc-diff/zebrad-main-1952464-getrawmempool.json:
[
"18bbe79487e157af34c1b8d00d51cedb3dd07625d8b76b17eb58e9f8c870d11e",
"6077962d04cda6a99502cdfaf71c38079ec4f17186d4e53f94f18b1a39a24ddb",
"bd8881165be076b6e1a342356bc7194f239908e0e8d72c4e75466e6bcefae2b7"
]
➜ zebra git:(sort-getrawmempool) ✗ ZCASH_CLI=../zcash/src/zcash-cli ./zebra-utils/zcash-rpc-diff 3000 getrawmempool
Checking first node release info...
Checking second node release info...
Connected to zebrad (port 3000) and zcashd (../zcash/src/zcash-cli zcash.conf port).
Checking zebrad network and tip height...
Checking zcashd network and tip height...
Request:
getrawmempool
Querying zebrad main chain at height >=1952464...
real 0m0.004s
user 0m0.004s
sys 0m0.000s
Querying zcashd main chain at height >=1952464...
real 0m0.004s
user 0m0.004s
sys 0m0.000s
Response diff between zebrad and zcashd:
RPC responses were identical
/tmp/tmp.qyAMIxOqEr.rpc-diff/zebrad-main-1952464-getrawmempool.json:
[
"18bbe79487e157af34c1b8d00d51cedb3dd07625d8b76b17eb58e9f8c870d11e",
"6077962d04cda6a99502cdfaf71c38079ec4f17186d4e53f94f18b1a39a24ddb",
"bd8881165be076b6e1a342356bc7194f239908e0e8d72c4e75466e6bcefae2b7"
]
➜ zebra git:(sort-getrawmempool) ✗ ZCASH_CLI=../zcash/src/zcash-cli ./zebra-utils/zcash-rpc-diff 3000 getrawmempool
Checking first node release info...
Checking second node release info...
Connected to zebrad (port 3000) and zcashd (../zcash/src/zcash-cli zcash.conf port).
Checking zebrad network and tip height...
Checking zcashd network and tip height...
Request:
getrawmempool
Querying zebrad main chain at height >=1952464...
real 0m0.004s
user 0m0.003s
sys 0m0.000s
Querying zcashd main chain at height >=1952464...
real 0m0.003s
user 0m0.003s
sys 0m0.000s
Response diff between zebrad and zcashd:
RPC responses were identical
/tmp/tmp.WU1AOkIgo4.rpc-diff/zebrad-main-1952464-getrawmempool.json:
[
"18bbe79487e157af34c1b8d00d51cedb3dd07625d8b76b17eb58e9f8c870d11e",
"6077962d04cda6a99502cdfaf71c38079ec4f17186d4e53f94f18b1a39a24ddb",
"bd8881165be076b6e1a342356bc7194f239908e0e8d72c4e75466e6bcefae2b7"
]
➜ zebra git:(sort-getrawmempool) ✗ ZCASH_CLI=../zcash/src/zcash-cli ./zebra-utils/zcash-rpc-diff 3000 getrawmempool
Checking first node release info...
Checking second node release info...
Connected to zebrad (port 3000) and zcashd (../zcash/src/zcash-cli zcash.conf port).
Checking zebrad network and tip height...
Checking zcashd network and tip height...
Request:
getrawmempool
Querying zebrad main chain at height >=1952464...
real 0m0.004s
user 0m0.003s
sys 0m0.000s
Querying zcashd main chain at height >=1952464...
real 0m0.002s
user 0m0.000s
sys 0m0.002s
Response diff between zebrad and zcashd:
RPC responses were identical
/tmp/tmp.bA4SJYm7xj.rpc-diff/zebrad-main-1952464-getrawmempool.json:
[
"18bbe79487e157af34c1b8d00d51cedb3dd07625d8b76b17eb58e9f8c870d11e",
"6077962d04cda6a99502cdfaf71c38079ec4f17186d4e53f94f18b1a39a24ddb",
"bd8881165be076b6e1a342356bc7194f239908e0e8d72c4e75466e6bcefae2b7"
]
➜ zebra git:(sort-getrawmempool) ✗ ZCASH_CLI=../zcash/src/zcash-cli ./zebra-utils/zcash-rpc-diff 3000 getrawmempool
Checking first node release info...
Checking second node release info...
Connected to zebrad (port 3000) and zcashd (../zcash/src/zcash-cli zcash.conf port).
Checking zebrad network and tip height...
Checking zcashd network and tip height...
Request:
getrawmempool
Querying zebrad main chain at height >=1952464...
real 0m0.004s
user 0m0.004s
sys 0m0.000s
Querying zcashd main chain at height >=1952464...
real 0m0.004s
user 0m0.000s
sys 0m0.004s
Response diff between zebrad and zcashd:
RPC responses were identical
/tmp/tmp.lA4ztbtrh9.rpc-diff/zebrad-main-1952464-getrawmempool.json:
[
"18bbe79487e157af34c1b8d00d51cedb3dd07625d8b76b17eb58e9f8c870d11e",
"6077962d04cda6a99502cdfaf71c38079ec4f17186d4e53f94f18b1a39a24ddb",
"bd8881165be076b6e1a342356bc7194f239908e0e8d72c4e75466e6bcefae2b7"
]
|
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.
There are just a few compile warnings to clear up, then we're good to go.
Also I think there was a temporary network error which made a lot of PRs fail. |
Co-authored-by: teor <[email protected]>
This might need the dependency fix in PR #5992 to build correctly, or some other changes to the dependencies, feature dependencies, or features on the code. |
@Mergifyio update |
✅ Branch has been successfully updated |
I missed a couple test failures:
|
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 this up, let's go!
Motivation
It would be convenient for the
getrawmempool
output to match zcashd's exactly so we can run zcash-rpc-diff continuously until there's a difference to examine.Solution
fee/size
then id before returninggetrawmempool
resultsReview
Anyone can review. This doesn't have to merge, we could just use this branch for #5935.
Reviewer Checklist
Follow Up Work