-
Notifications
You must be signed in to change notification settings - Fork 79
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
Implement getrawnotaryrequest
and getrawnotarytransaction
RPC extensions
#3098
Conversation
3918670
to
0ec25db
Compare
Codecov Report
@@ Coverage Diff @@
## master #3098 +/- ##
==========================================
- Coverage 84.89% 84.83% -0.06%
==========================================
Files 329 330 +1
Lines 44239 44334 +95
==========================================
+ Hits 37555 37611 +56
- Misses 5172 5211 +39
Partials 1512 1512
... and 4 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
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.
The comment about PR structure:
- Change the PR name, it should describe what you are implementing/optimizing/fixing/doing in this PR. What you are doing here is supporting the
getrawnotarypool
andgetrawnotarytransaction
RPC extensions. Thus, PR may be named "implementgetrawnotaryrequest
andgetrawnotarytransaction
RPC extensions". - Adjust the PR description: it should contain any of "Close Add
getrawnotaryrequestpool
RPC extension #2951." or "Closes Addgetrawnotaryrequestpool
RPC extension #2951." or "Fixes Addgetrawnotaryrequestpool
RPC extension #2951." keywords to let the GitHub know that your PR is not just references the initial issue, but closes it. I.e. "The problem is described in Addgetrawnotaryrequestpool
RPC extension #2951" is not enough for this.
Note, that these comments are relevant for any other PR.
Note about PR content:
- We should support the same methods for RPC Client.
- Documentation should be updated (a part about RPC extensions).
- New mempool APIs should be tested (but this can be doe after APIs finalisation).
565296b
to
3bb20bb
Compare
getrawnotaryrequest
and getrawnotarytransaction
RPC extensions
c7ead95
to
9f8f44c
Compare
Forbid Notary service to change the fallback's witnesses in any way. Fix the problem described in #3098 (comment). Signed-off-by: Anna Shaleva <[email protected]>
Forbid Notary service to change the fallback's witnesses in any way. Fix the problem described in review comment: #3098 (comment). Signed-off-by: Anna Shaleva <[email protected]>
Forbid Notary service to change the fallback's witnesses in any way. Fix the problem described in review comment: #3098 (comment). Signed-off-by: Anna Shaleva <[email protected]>
9f8f44c
to
7f1d872
Compare
678d021
to
5a1b5bc
Compare
Otherwise LGTM. |
5a1b5bc
to
cff45b4
Compare
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.
LGTM.
@roman-khimov, could you review?
@tatiana-nspcc, please, convert the PR from draft.
@tatiana-nspcc, could you also rebase onto the current master, please? |
It was rebased before the last push. As I see it's still based on a current master state. |
That's true, which means I broke our CodeQL job in the #3113. |
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.
Perfectly fine otherwise.
IterateVerifiedTransactions iterates through verified transactions in memory pool and invokes function cont. Where cont callback returns whether we should continue with the traversal process. Signed-off-by: Tatiana Nesterenko <[email protected]>
`getrawnotarytransaction` takes a transaction hash and attempts to find the corresponding transaction in the notary requests mempool. It searches through all the verified main and fallback transactions. `getrawnotarypool` returns hashes of all the verified transactions, including both main and fallback transactions. Additionally add struct result.RawNotaryPool. Close #2951 Signed-off-by: Tatiana Nesterenko <[email protected]>
…ethods GetRawNotaryTransaction returns a fallback or main transaction that was previously added to the memory pool by P2PNotaryRequest. This function invokes the RPC server's `getrawnotarytransaction` method. GetRawNotaryPool returns hashes from all the verified transactions, including both main and fallback transactions. This function invokes the RPC server's `getrawnotarypool` method. Also, these functions were added to doc.go. Signed-off-by: Tatiana Nesterenko <[email protected]>
Signed-off-by: Tatiana Nesterenko <[email protected]>
cff45b4
to
7afa950
Compare
Problem
We have notary pool subscriptions, but it's not enough for debugging some unexpected things that may happen while submitting notary requests.
The problem is described in #2951
Solution
Add the following RPC extensions:
getRawNotaryPool
returns hashes from all the verified transactions, including both main and fallback transactions.getRawNotaryRequest
takes a transaction hash and attempts to find the corresponding transaction in the notary requests mempool. It searches through all the verified main and fallback transactions.Close #2951.