Skip to content

[Tests] Missing test case for SIGHASH_SINGLE|SIGHASH_ANYONECANPAY #12060

@NicolasDorier

Description

@NicolasDorier

I recently found a consensus bug in NBitcoin script interpreter. (MetacoSA/NBitcoin@7fd1c35)

It was caused by an out of bound signature with SIGHASH_SINGLE|SIGHASH_ANYONECANPAY recently mined on testnet.

My test cases for the script evaluator are using the same, fairly recent (maybe 1 year ago ?) json test cases of Bitcoin Core, and it failed to catch this bug. So I guess this test is missing from Core as well. (I still need to confirm that)

I wrote this test meanwhile in NBitcoin https://github.com/MetacoSA/NBitcoin/blob/7fd1c358b920fdc6c75417f9f2646f2fc0f59585/NBitcoin.Tests/script_tests.cs#L785

I plan to add test case to bitcoin core for it as well (in script_valid.json which I don't find anymore), but I just don't have time for now, so I am opening issue meanwhile.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions