Page MenuHomePhabricator

Make standard flags based off consensus flags
ClosedPublic

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

Details

Reviewers
jasonbcox
Group Reviewers
Restricted Project
Maniphest Tasks
Restricted Maniphest Task
Commits
rSTAGINGea1da0e8b2fa: Make standard flags based off consensus flags
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
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

markblundeberg edited the summary of this revision. (Show Details)
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.

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