Page MenuHomePhabricator

Make standard flags based off consensus flags
ClosedPublic

Authored by markblundeberg on Sat, Feb 8, 06:05.

Details

Reviewers
jasonbcox
Group Reviewers
Restricted Project
Maniphest Tasks
T704: sigChecks implementation
Commits
rABCea1da0e8b2fa: Make standard flags based off consensus flags
Summary

We often see in upgrades that new consensus flags' activations
have to be duplicated both in the mempool-flags and block-flags.

Though we sometimes do the opposite (adding flags that are only
active in blocks but NOT in mempool, such as was done in the
overhaul of D2468), that is rare in comparison.

Since STANDARD_SCRIPT_VERIFY_FLAGS contains all flags set by
GetNextBlockScriptFlags (besides SCRIPT_ENABLE_REPLAY_PROTECTION),
this produces no change in the current output of
GetStandardScriptFlags under any conditions.

At the same time, I've also updated the documentation of
STANDARD_SCRIPT_VERIFY_FLAGS to clarify why we need it
and we can't just get away with using GetStandardScriptFlags.

Test Plan

ninja check-extended check-upgrade-activated-extended

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

markblundeberg created this revision.Sat, Feb 8, 06:05
Herald added a reviewer: Restricted Project. · View Herald TranscriptSat, Feb 8, 06:05
markblundeberg edited the summary of this revision. (Show Details)Sat, Feb 8, 06:19
markblundeberg edited the summary of this revision. (Show Details)
markblundeberg added inline comments.Sat, Feb 8, 07:02
src/policy/policy.h
96 ↗(On Diff #16168)

Ideally we should be making more parts of the codebase use GetStandardScriptFlags when they might be able to get context.

However, we don't actually want this in some cases, for example we don't want the wallet to be able to construct replay protected sighash transactions by default, because we want the alt chain to be a ghost town.

jasonbcox accepted this revision.Sat, Feb 8, 20:43
This revision is now accepted and ready to land.Sat, Feb 8, 20:43