Skip to content

feature_opcat.py doesn't test block/consensus enforcement #106

Open

Description

@ajtowns

test/functional/feature_opcat.py only tests mempool rejection via sendrawtransaction. It never submits a block containing an invalid OP_CAT transaction to verify consensus enforcement. This is arguably okay with 29.1, as mempool enforcement is checked against both standardness and consensus rules, and gives a different error. Though only arguably, because block acceptance (rejection) is still a different code path. But after 29.3 where we only check against standardness rules, it's not really sufficient.

Missing coverage:

  • Taproot OP_CAT with insufficient stack elements — rejected by mempool, never tested in a block
  • Taproot OP_CAT exceeding stack element size limit — rejected by mempool, never tested in a block
  • Segwit v0 OP_CAT (disabled opcode) — rejected by mempool, never tested in a block

The test has get_block/add_block helpers already, and feature_checktemplateverify.py has a fail_block helper
that could be used as a pattern.

Activity

  1. darosior commented on Jun 16, 2026

    @darosior

    Litecoin's MWEB soft fork had a critical vulnerability that wasn't caught because their tests only exercised the mempool / block builder code paths.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions