Align sequence locks and unknown covenant handling with hsd

Merged
WO
4mo ago
+196-38

Summary

  • Apply Handshake sequence locks and OP_CSV semantics to all non-coinbase transaction versions.
  • Permit future unknown covenant types while enforcing hsd-style item count and size bounds.
  • Keep known covenant validation unchanged and add unknown covenant round-trip and spend tests.

Validation

  • go test ./wire ./txscript ./blockchain
  • git diff --check

Review notes

Consensus-critical. This removes inherited Bitcoin tx-version gates and avoids rejecting reserved future covenant types at wire/sanity layers.


Summary by cubic

Aligns consensus with hsd by applying sequence locks/OP_CHECKSEQUENCEVERIFY to all non-coinbase transactions and permitting unknown covenants under hsd stack and serialized-size bounds. Fixes unknown covenant size checks to match hsd’s MAX_COVENANT_SIZE.

  • New Features

    • Sequence locks and OP_CHECKSEQUENCEVERIFY apply to all tx versions in blockchain/txscript (removed version ≥2 gate); added version-0 engine test.
    • Unknown covenants accepted in wire (no type cap; IsKnown/IsUnknown helpers); bounds enforced: MaxCovenantItems=1000, per-item ≤585 bytes, and hsd-style max serialized size in blockchain; allow unknown→NONE, reject unknown→known name; tests added.
  • Bug Fixes

    • Correct unknown covenant serialized-size checks and add boundary tests to align with hsd limits.

Summary by CodeRabbit

  • New Features

    • Added support for unknown covenant types within defined item-count and size limits.
    • Added covenant helpers to identify whether a covenant type is known or unknown.
    • Increased supported covenant item and payload limits.
  • Bug Fixes

    • Sequence locks and OP_CHECKSEQUENCEVERIFY now work correctly for transactions of all versions.
    • Unknown covenant spends are validated with appropriate rules.