ajtowns
commented at 10:58 pm on July 16, 2025:
contributor
We currently use 21 of 32 possible bits for SCRIPT_VERIFY_* flags, with open PRs that may use 8 more (#29247, #31989, #32247, #32453). The mutinynet fork that has included many experimental soft fork features is already reusing bits here. Therefore, bump this to 64 bits.
In order to make it easier to update this logic in future, this PR also introduces a dedicated type for the script flags, and disables implicit conversion between that type and the underlying integer type. To make verifying that this change doesn’t cause flags to disappear, this PR also resurrects the changes from #28806 so that the script flags that are consensus enforced on each block can be queried via getdeploymentinfo.
Move mapFlagNames and FormatScriptFlags logic to script/interpreter.h
Moves FormatScriptFlags logic into GetScriptFlagNames which returns a
vector of strings. For completeness, also has GetScriptFlagNames report
on any bits that do not match a known script flag.
See the guideline for information on the review process.
A summary of reviews will appear here.
Conflicts
Reviewers, this pull request conflicts with the following ones:
#33012 (script: return verification flag responsible for error upon validation failure by darosior)
#32575 (refactor: Split multithreaded case out of CheckInputScripts by fjahr)
#32473 (Introduce per-txin sighash midstate cache for legacy/p2sh/segwitv0 scripts by sipa)
#32453 ([Policy] Discourage Unsigned Annexes by JeremyRubin)
#32317 (kernel: Separate UTXO set access from validation functions by TheCharlatan)
#32247 (BIP-348 (OP_CHECKSIGFROMSTACK) (regtest only) by jamesob)
#31989 (BIP-119 (OP_CHECKTEMPLATEVERIFY) (regtest only) by jamesob)
#31576 (test: Move script_assets_tests into its own suite by hebasto)
#29843 (policy: Allow non-standard scripts with -acceptnonstdtxn=1 (test nets only) by ajtowns)
#29247 (CAT in Tapscript (BIP-347) by arminsabouri)
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.
ajtowns
commented at 10:59 pm on July 16, 2025:
contributor
The “introduce script_verify_flags typename” commit is probably best reviewed with --word-diff fwiw.
DrahtBot added the label
CI failed
on Jul 16, 2025
DrahtBot
commented at 11:01 pm on July 16, 2025:
contributor
🚧 At least one of the CI tasks failed.
Task lint: https://github.com/bitcoin/bitcoin/runs/46136681380
LLM reason (✨ experimental): Lint failure caused by missing include guard in src/script/verify_flags.h.
Try to run the tests locally, according to the documentation. However, a CI failure may still
happen due to a number of reasons, for example:
Possibly due to a silent merge conflict (the changes in this pull request being
incompatible with the current code in the target branch). If so, make sure to rebase on the latest
commit of the target branch.
A sanitizer issue, which can only be found by compiling with the sanitizer and running the
affected test.
An intermittent issue.
Leave a comment here, if you need help tracking down a confusing failure.
Previously the SCRIPT_VERIFY_* flags were specified as either uint32_t,
unsigned int, or unsigned. This converts them to a common type alias in
preparation for changing the underlying type.
21fe94d2ca
script/verify_flags: make script_verify_flags type safe
`using script_verify_flags = uint32_t` allows implicit conversion to
and from int, so replace it with a class to have the compiler ensure we
use the correct type. Provide from_int and as_int to allow for explicit
conversions when desired.
Introduces the type `script_verify_flag_name` for the individual flag
name enumeration.
b64970e49f
script/interpreter: make script_verify_flag_name an ordinary enum
Instead of having `SCRIPT_VERIFY_FOO = (1U << n)` just have it
be `n` directly, and do the bit shifting when converting it to
`script_verify_flags`.
c54e1c0ee7
script/verify_flags: extend script_verify_flags to 64 bitse193e9bb47
ajtowns force-pushed
on Jul 17, 2025
ajtowns
commented at 1:00 am on July 17, 2025:
contributor
Also for people coming here from Google: I had the same error message, but for me the problem was that I was using Qt 6.4.2 which apparently thinks that #if 202002L < 201103L is true, which causes c++config.h to not be included (and no #error is generated because moc doesn’t support the directive) . This has been fixed somewhere before Qt 6.7.3.
The error output also seems to be cutting off the last letter of the filename (“concept” vs “concepts” here, and “stl_relops.” vs “stl_relops.h” in the original bug report linked above).
hebasto
commented at 1:21 pm on July 17, 2025:
member
This is a metadata mirror of the GitHub repository
bitcoin/bitcoin.
This site is not affiliated with GitHub.
Content is generated from a GitHub metadata backup.
generated: 2025-07-23 12:12 UTC
This site is hosted by @0xB10C More mirrored repositories can be found on mirror.b10c.me