Repository navigation
Conversation
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. External sites
ReviewsSee the guideline and AI policy for information on the review process.
If your review is incorrectly listed, please copy-paste 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. |
janb84
left a comment
There was a problem hiding this comment.
Concept ACK
Looks good, in my review I ran across a few questions / NITS
15221ae to
20fecda
Compare
janb84
left a comment
There was a problem hiding this comment.
ACK 20fecda
Thanks for taking my suggestions!
I think it's ok but depending if you are nitpicking or how you are reading the commit message it can be misunderstood what is ment by "no check is added" while adding BOOST_CHECK_EQUAL(42, op_return_42.size()) and a second BOOST_CHECK_EQUAL(83, ...) .
"no policy check" would remove the possible mis-understanding. Just to highlight it but i'm fine with it.
|
How should this be reviewed? This looks like it is removing 200 lines of test code and adding 200 other lines. I understand that #36692 can be "fixed" with LLMs and that LLMs can "review" the "fix", but if this isn't trivial for humans to review, then I don't think it is worth it. If there are 50 pull requests (each for a file), and each takes 10 minutes to review, it will be ~10hours/person if everything goes well. Just raising this to focus on creating pulls that are trivial to review. I haven't looked closely, but maybe the globals removal like g_dust can be split off into a commit? |
20fecda to
4d01b07
Compare
|
Thanks for taking a look.
I have split the PR into three commits, which should make it easier to review. The first two commits should be easy and quick. The last one is not a mechanical change, and I am happy to drop it if reviewers feel it is better to keep the PR focused on the changes that are trivial to review.
I've split the globals removal into its own commit. Also, I have added "no policy check" in the commit message. |
janb84
left a comment
There was a problem hiding this comment.
re- ACK4d01b07cd5896283571dcc11497b62110f62ba72
changes since last ack; changes separated in several commits.
Although I found it doable to review in one commit I have to confess that the separation makes it easier.
maflcko
left a comment
There was a problem hiding this comment.
Thanks for splitting this large 300 line test case into subtest, and also removing the globals, which I found both tedious to read and understand. Now it seems nicer.
Left some nits. Happy to re-ack if you take them.
review ACK 4d01b07 🔄
Show signature
Signature:
untrusted comment: signature from minisign secret key on empty file; verify via: minisign -Vm "${path_to_any_empty_file}" -P RWTRmVTMeKV5noAMqVlsMugDDCyyTSbA3Re5AkUrhvLVln0tSaFWglOw -x "${path_to_this_whole_four_line_signature_blob}"
RUTRmVTMeKV5npGrKx1nqXCw5zeVHdtdYURB/KlyA/LMFgpNCs+SkW9a8N95d+U4AP1RJMi+krxU1A3Yux4bpwZNLvVBKy0wLgM=
trusted comment: review ACK 4d01b07cd5896283571dcc11497b62110f62ba72 🔄
62h5ER0mEksNU/YI3xCWNK43fnKOqeVnyfnUjaswf6LaFQPguNNjP80PbTGV/oQ2Noxk1flMJuXgF/VA8yuOCg==
| CheckWithFlag(output1, input1, STANDARD_SCRIPT_VERIFY_FLAGS, true); | ||
| } | ||
|
|
||
| BOOST_AUTO_TEST_CASE(test_IsStandard) |
There was a problem hiding this comment.
I think it would be nice to move this IsStandardTx test suite into its own file, as you are touching all lines of this test anyway. Maybe transaction_standardness_tests.cpp, so that it is separate from let's say tx serialize tests or other tx tests.
The g_dust and g_bare_multi globals are replaced by a StandardPolicy struct, which defaults to the node defaults and is passed to each check. The CheckIsStandard and CheckIsNotStandard lambdas become free functions, so that they can be shared by the test cases split out in the next commit. No policy check is added or removed.
Split the test into one test case per policy rule. Each case starts from its own standard transaction, built by the new MakeTx helper, instead of from whatever the previous checks left behind. Values irrelevant to the rule under test may differ, since each case now starts from a fresh transaction. No policy check is added or removed.
Construct the transaction for each check in one expression, instead of mutating a shared transaction between checks. The input of every check is now visible at the call site. The repeated "not dust at the threshold, dust one satoshi below" pairs are folded into a CheckDustThreshold helper. No policy check is added or removed. The size of the 42-byte OP_RETURN script, previously only implied by the hex literal, is now asserted alongside the 83-byte one.
Move the IsStandardTx test cases and their helpers out of transaction_tests.cpp into their own file, so that they are separate from the serialization and other transaction tests.
4d01b07 to
608b99a
Compare
|
Thanks for the review! Addressed the nits:
|
|
review ACK 608b99a 💽 Show signatureSignature: |

Part of #36692: This splits it into one test case per policy rule, each building its own transaction.
The first commit replaces
g_dustandg_bare_multiglobals by aStandardPolicystruct, which defaults to the node defaults and is passed to each check, e.g.CheckIsStandard(t, {.max_op_return_relay = 83}), so no case changes policy for another.Second commit splits
test_IsStandardinto independent test cases i.e. one test case per policy rule. Each starts from its own standard transaction built by a newMakeTxhelper. Since transactions are no longer carried over between checks, some values that are irrelevant to the rule under test differ from before.Third commit builds
IsStandardtest transactions declaratively. Each check constructs its transaction in one expression instead of mutating a shared one.CheckDustThresholdhelper also deduplicates repeated "not dust at the threshold, dust one satoshi below" from test cases.