[TESTS] Allow tx_invalid.json tests to include flag rules for if_unset: [A,B,C] then_unset: [D]#22954
Closed
JeremyRubin wants to merge 1 commit intobitcoin:masterfrom
Closed
[TESTS] Allow tx_invalid.json tests to include flag rules for if_unset: [A,B,C] then_unset: [D]#22954JeremyRubin wants to merge 1 commit intobitcoin:masterfrom
JeremyRubin wants to merge 1 commit intobitcoin:masterfrom
Conversation
Contributor
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ConflictsNo conflicts as of last run. |
This was referenced Nov 18, 2021
Contributor
Author
|
@MarcoFalke is their an automated tool to run to fix this PR? |
Member
|
@JeremyRubin I think git will always consider context, but you can use |
Contributor
Author
|
i was asking because i think the conflict arose out of a scripted diff PR of yours that was merged, I was curious if you reckon that it will fix these conflicts too... |
7f42285 to
0441c20
Compare
Contributor
Author
|
failure is unrelated; has been rebased |
0441c20 to
a797c72
Compare
…t: [A,B,C] then_unset: [D]
a797c72 to
f32c6b7
Compare
9 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This allows an optional tx_invalid.json parameter at position 3 with the format:
[{"if_unset": ["A", "D"], "then_unset": ["B", "C"]}]During the one-by-one flag mutation (patched in #22948 to be all combinations, hence the support of multiple) which checks that if disable required flags
["A", "D"]are all unset then the flags["B", "C"]should become unset as well. The unsetting logic loops until the flags are unset (so rules like if_unset A then_unset B and if_unset B then_unset D end up with B and D unset if A is unset and B is set initially).The current use case of this modification is:
[{"if_unset": ["DEFAULT_CHECK_TEMPLATE_VERIFY_HASH"], "then_unset": ["DISCOURAGE_UPGRADABLE_NOPS"]}]This allows us to write use cases wherein we expect DEFAULT_CHECK_TEMPLATE_VERIFY_HASH to be enabled for the tx to be invalid, but desire for it to be valid (and not discouraged) when it is off. After activation of such a soft fork, we can remove such a rule.
We do not want to do this via a TrimFlags rule as it should not happen across all transactions, only the ones we specify.
It would also be possible to have a list of allowed unsettable flags (e.g., just DISCOURAGE_UPGRADABLE_NOPS and other standardness rules), but it is not required. While the allowing of multiple rules is perhaps extra, this keeps the format flexible for future needs.