-
Notifications
You must be signed in to change notification settings - Fork 35.4k
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
Policy: Report reason inputs are non standard #29060
base: master
Are you sure you want to change the base?
Policy: Report reason inputs are non standard #29060
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. ConflictsNo conflicts as of last run. |
3fc397a
to
6ffb956
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.
Concept ACK
6ffb956
to
e032462
Compare
Thank you for review @stickies-v I Addressed your comments and taken suggestions. |
e032462
to
814571b
Compare
Thanks for reviewing @luke-jr The changes in latest push are:
|
814571b
to
0a39b07
Compare
d9e71f0
to
5ef3f9b
Compare
5ef3f9b
to
f4c1945
Compare
Rebased on master for green CI. |
This commit renames AreInputsStandard to HasNonStandardInput. HasNonStandardInput now returns valid TxValidationState if all inputs (scriptSigs) use only standard transaction forms else returns invalid TxValidationState which states why an input is not standard.
Test the various input scriptSig non standardness, and ensure HasNonStandardInput Returns the resin why the input is nonstandard. Co-authored-by: Ben Woosley <ben.woosley@gmail.com>
f4c1945
to
101a308
Compare
if (m_pool.m_opts.require_standard && !AreInputsStandard(tx, m_view)) { | ||
return state.Invalid(TxValidationResult::TX_INPUTS_NOT_STANDARD, "bad-txns-nonstandard-inputs"); | ||
if (m_pool.m_opts.require_standard) { | ||
state = HasNonStandardInput(tx, m_view); |
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.
Seems like it'd be nicer to just pass state
into the function rather than creating a new one and copying it.
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.
Seems like it'd be nicer to just pass state into the function
I am taking this review comment as a non-blocking (nit) suggestion based on the tone.
I will update this when there are blocking comments that indicate a need to retouch the diffs.
Also, I would like to know whether this PR is conceptually acknowledged, @luke-jr.
Thanks for your review.
This PR is another attempt at #13525.
Transactions that fail
PreChecks
Validation due to non-standard inputs now returns invalid validation stateTxValidationResult::TX_INPUTS_NOT_STANDARD
along with a debug error message.Previously, the debug error message for non-standard inputs do not specify why the inputs were considered non-standard.
Instead, the same error string,
bad-txns-nonstandard-inputs
, used for all types of non-standard input scriptSigs.This PR updates the
AreInputsStandard
to include the reason why inputs are non-standard in the debug message.This improves the
Precheck
debug message to be more descriptive.Furthermore, I have addressed all remaining comments from #13525 in this PR.