Skip to content

consensus: Hornet rule matrix — happy path and boundary pins - #322

Merged
reardencode merged 3 commits into
masterfrom
consensus/hornet-rule-matrix
Sep 4, 2026
Merged

consensus: Hornet rule matrix — happy path and boundary pins#322
reardencode merged 3 commits into
masterfrom
consensus/hornet-rule-matrix

Conversation

@rearden-grok

@rearden-grok rearden-grok Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Cross-referenced Hornet’s latest block-validation rules (spec.h on main @ 151462fa) against published spec.html. Unreleased difference: S02 is folded into S03 (ValidateInputPrevoutsUnspent). Full ID-by-ID happy/boundary table is in docs/peer-clients.md.
  • Added structure checks that Hornet lists as local rules and that Core CheckTransaction already requires: stripped size ≤ 1 MB (L03), empty vin (L06), per-tx stripped size (L08), duplicate inputs (L11), null prevouts (L13).
  • Happy/boundary pins live in the existing suites (structure_rule_tests, header.rs median_time_past_tests, consensus_rules). Named selector: ./scripts/test-hornet-rules.sh.

Test plan

  • cargo test -p rbitcoin-consensus --lib -- structure_rule_tests::s14_ structure_rule_tests::s15_ structure_rule_tests::s16_ structure_rule_tests::s17_ structure_rule_tests::s18_ s4_weight h8_timestamp h9_version
  • cargo test -p rbitcoin-test --test consensus_rules
  • CI required jobs green (fmt, deny, clippy, ast-grep, test, windows, macos, multinode, coverage)

Made with Cursor

rearden-grok Bot and others added 2 commits September 4, 2026 08:27
Structure now rejects stripped size > 1MB, empty vin, per-tx oversize,
duplicate inputs, and null prevouts (Core CheckTransaction / Hornet L03,
L06, L08, L11, L13). Named tests cover happy path and exact boundaries
for every Hornet block-validation rule.

Co-authored-by: Cursor <cursoragent@cursor.com>
Replace the peer-clients gap-hunt stub with an ID-by-ID happy/boundary
table against Hornet main spec.h (S02 folded into S03) and published
spec.html. Inventory S14–S18 in consensus-tests.md.

Co-authored-by: Cursor <cursoragent@cursor.com>
Comment thread crates/rbitcoin-test/tests/consensus_rules.rs Fixed
Comment thread crates/rbitcoin-test/tests/consensus_rules.rs Fixed
Comment thread crates/rbitcoin-test/tests/consensus_rules.rs Fixed
Comment thread crates/rbitcoin-test/tests/consensus_rules.rs Fixed
Comment thread crates/rbitcoin-test/tests/consensus_rules.rs Fixed
Comment thread crates/rbitcoin-test/tests/consensus_rules.rs Fixed
Comment thread crates/rbitcoin-test/tests/consensus_rules.rs Fixed
The rules are ours; Hornet is a checklist. Keep happy/boundary pins
under structure_rule_tests, header, and consensus_rules, and select
that set with scripts/test-hornet-rules.sh.

Co-authored-by: Cursor <cursoragent@cursor.com>
Comment thread crates/rbitcoin-test/tests/consensus_rules.rs Dismissed
Comment thread crates/rbitcoin-test/tests/consensus_rules.rs Dismissed
Comment thread crates/rbitcoin-test/tests/consensus_rules.rs Dismissed
Comment thread crates/rbitcoin-test/tests/consensus_rules.rs Dismissed
Comment thread crates/rbitcoin-test/tests/consensus_rules.rs Dismissed
Comment thread crates/rbitcoin-test/tests/consensus_rules.rs Dismissed
Comment thread crates/rbitcoin-test/tests/consensus_rules.rs Dismissed
@reardencode
reardencode merged commit e654630 into master Sep 4, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants