Page MenuHomePhabricator

Add CHECKDATASIG to standard flags.

Authored by Mengerian on May 18 2019, 14:54.




Test Plan

make check
Also did make check with test change only, and with code change only,
to check that it fails as expected.
Did IBD on mainnet and testnet with -checkpoints=0 -assumevalid=0

Depends on D3063

Diff Detail

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

Event Timeline

deadalnix requested changes to this revision.May 18 2019, 16:23

That should really be made a standard flag first for a while. If not then a client could get banned during IBD.

23 ↗(On Diff #8729)

This very clearly doesn't check the same thing anymore.

This revision now requires changes to proceed.May 18 2019, 16:23
23 ↗(On Diff #8729)

I changed the test to subtract SCRIPT_ENABLE_CHECKDATASIG from flags during the tests, rather than adding it. So it ends up passing the same flags values into the test (assuming SCRIPT_ENABLE_CHECKDATASIG is included in STANDARD_SCRIPT_VERIFY_FLAGS and MANDATORY_SCRIPT_VERIFY_FLAGS).

If we want CHECKDATASIG in STANDARD_SCRIPT_VERIFY_FLAGS only, and not in MANDATORY_SCRIPT_VERIFY_FLAGS, then I will have to re-jig the test in some other way.

Add CHECKDATASIG to standard flags, not to mandatory flags.

Mengerian retitled this revision from Add CHECKDATASIG to mandatory flags. to Add CHECKDATASIG to standard flags..May 19 2019, 04:27
Mengerian edited the summary of this revision. (Show Details)
deadalnix requested changes to this revision.May 20 2019, 00:11

A few changes, but overall, it looks good.

22 ↗(On Diff #8730)

It's probably better to do & ~SCRIPT_ENABLE_CHECKDATASIG

But more appropriately, just leave it standard and do the setting/clearing in the test.

74 ↗(On Diff #8730)

This expect the flag to be present, so it sets it.

85 ↗(On Diff #8730)

This expects the flag to be absent, which happens to work due to the test cases provided, but this is actually where the problem is.

This test should not assume anything particular about the input that it is given - or, if so, it should check for it in a design by contract fashion ( )

35 ↗(On Diff #8730)

Keep the datasigflags name.

This revision now requires changes to proceed.May 20 2019, 00:11

Rebased on top of test changes.

Depends on D3063

@deadalnix I tried to address your comments by changing the test in D3063 and then rebasing this Diff on top of that one.

markblundeberg added a subscriber: markblundeberg.

Given how STANDARD_SCRIPT_VERIFY_FLAGS appears in some important places, please add IBD to the test plan. :-)

This revision now requires changes to proceed.May 21 2019, 04:31
Mengerian edited the test plan for this revision. (Show Details)

Added IBD to test plan

Mengerian edited the summary of this revision. (Show Details)


deadalnix added inline comments.
258 ↗(On Diff #8794)

No need for double ()

This revision is now accepted and ready to land.May 23 2019, 12:00

Remove redundant brackets and rebase.

This revision was automatically updated to reflect the committed changes.