-
Notifications
You must be signed in to change notification settings - Fork 35.5k
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
wallet, mempool: propagete checkChainLimits
error message to wallet
#28863
wallet, mempool: propagete checkChainLimits
error message to wallet
#28863
Conversation
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. Code CoverageFor detailed information about the code coverage, see the test coverage report. ReviewsSee the guideline for information on the review process.
If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update. ConflictsReviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first. |
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.
Concept ACK.
It would be nice if the test can reach all four possible limit error messages, but if that's difficult to achieve it could wait for a followup.
2b4e86f
to
bd5417e
Compare
Previously we always got the |
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.
Concept ACK
using the error message from checkChainLimits(...)
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 PR looks good, left a Nit comment
Thanks @Sjors |
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.
ACK bd5417e
bd5417e
to
28115d8
Compare
Thanks for review @TheCharlatan @furszy
|
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.
ACK 28115d8
28115d8
to
e572a53
Compare
checkChainLimits
error message to walletcheckChainLimits
error message to wallet
Force pushed from 28115d8 to e572a53
|
return util::Error{_("Transaction has too long of a mempool chain")}; | ||
auto result = wallet.chain().checkChainLimits(tx); | ||
if (!result) { | ||
return util::Error{util::ErrorString(result)}; |
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.
Just a comment: Would be nice to get #25665 merged, so we can get a move constructor here.
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 @TheCharlatan that can come as a follow-up post #25665 I think?
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.
Indeed, or it could even be done as part of that PR. It depends on which one gets merged first.
Update CheckPackageLimits to use util::Result to pass the error message instead of out parameter. Also update test to reflect the error message from `CTxMempool` `CheckPackageLimits` output.
e572a53
to
8dec9c5
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.
utACK 8dec9c5
@@ -605,11 +605,9 @@ class CTxMemPool | |||
* to mempool. The transactions need not be direct | |||
* ancestors/descendants of each other. | |||
* @param[in] total_vsize Sum of virtual sizes for all transactions in package. | |||
* @param[out] errString Populated with error reason if a limit is hit. |
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.
* @returns {} or the error reason if a limit is hit.
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.
this would be good
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 Would create a tiny follow-up to fix this, so as not to invalidate ACK's.
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.
This is fixed in #29115
cc @glozow & @instagibbs |
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.
Re-ACK 8dec9c5
utACK 8dec9c5 |
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
@@ -605,11 +605,9 @@ class CTxMemPool | |||
* to mempool. The transactions need not be direct | |||
* ancestors/descendants of each other. | |||
* @param[in] total_vsize Sum of virtual sizes for all transactions in package. | |||
* @param[out] errString Populated with error reason if a limit is hit. |
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.
this would be good
…eLimits` returns 19bb65b [doc]: add doxygen return comment for CheckPackageLimits (ismaelsadeeq) Pull request description: This PR adds a doxygen comment on `CheckPackageLimits` describing what the method returns. Fixes #28863 (comment) ACKs for top commit: Sjors: utACK 19bb65b Zero-1729: utACK 19bb65b Tree-SHA512: ccf1cc00a44d3fff60f28ad6766019a9f61b349729eab3cb02bc76b13c2e55441348a1602d806e60e4b2eabeb1f5d1ddacddf86c0bcdb78b078bb3a863b650c2
Requested in #28391 comment
The error message is static when a new transaction is created and package limit is reached.
Transaction has too long of a mempool chain
While the
CTxMempool::CheckPackageLimits
provide explicit information about the error message.This PR updates
CTxMempool::CheckPackageLimits
return type toutil::Result<void>
,CheckPackageLimits
now returns void when package limit is not hit, and returns the error string whenever package limit is hit instead of using out parametererrString
.The PR updates
checkChainLimits
return type toutil::Result<void>
.Now the wallet
CreateTransactionInternal
will have access to the package limit error string whenever its hit.Also Updated functional test to reflect the error message from
CTxMempool::CheckPackageLimits
output.