Page MenuHomePhabricator

Make standard flags based off consensus flags
ClosedPublic

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

Details

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
Branch
stdflags
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 9353
Build 16638: Default Diff Build & Tests
Build 16637: arc lint + arc unit

Event Timeline

markblundeberg edited the summary of this revision. (Show Details)
src/policy/policy.h
96

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.

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