Skip to content

Test: pin locks_out_branch_of boundary cases (PR #320 follow-up)#346

Merged
heifner merged 1 commit into
masterfrom
fix/strong-qc-lockout-followup
May 20, 2026
Merged

Test: pin locks_out_branch_of boundary cases (PR #320 follow-up)#346
heifner merged 1 commit into
masterfrom
fix/strong-qc-lockout-followup

Conversation

@heifner
Copy link
Copy Markdown
Contributor

@heifner heifner commented May 19, 2026

Follow-up to #320. Adds the test coverage and doc cleanup that should have gone in with the original change to block_handle::locks_out_branch_of.

  • Boundary qc.block_num == head.last_final_block_num: the new short-circuit uses a strict <, so the equality case relies on head.extends(qc_target) instead. Pinned in locks_out_branch_of_lib_advanced_past_shared_ancestor with a head whose lib is exactly the shared ancestor.
  • Genesis core (latest_qc_claim is not strong): pinned the !is_strong_qc early return in locks_out_branch_of_test.
  • Documented get_block_reference's precondition at the call site and removed trailing whitespace after the helper.

No production behavior change; producer_plugin's now-unconditional fork_db_head() call in producing mode was reviewed and is required for the lockout check (already gated by in_producing_mode(); cost is negligible).

PR #320 added block_handle::locks_out_branch_of but left two input
classes unpinned by tests:

- qc.block_num == head.last_final_block_num: the helper uses a strict
  `<`, so this boundary must be caught by head.extends(qc_target). Add a
  case where head's lib is exactly the shared ancestor and the QC
  targets that same block, asserting the not-locked-out result comes
  from the extends() path, not the `<` guard.
- genesis core (no real QC): pin the !qc.is_strong_qc early return.

Also document get_block_reference's precondition at the call site
(strong qc implies non-genesis core, so block_num is in range) and drop
trailing whitespace after the helper.
@heifner heifner merged commit 3806434 into master May 20, 2026
28 checks passed
@heifner heifner deleted the fix/strong-qc-lockout-followup branch May 20, 2026 12:35
heifner added a commit that referenced this pull request May 20, 2026
…locks-at-slot-entry

Brings origin/master up to 3806434, picking up #292 (msig chunked storage), #318 (host builtin intrinsic removal), and #346 (locks_out_branch_of genesis-core and last_final boundary cases). Conflict in unittests/fork_db_tests.cpp resolved by keeping our h14a/h14b extensions to locks_out_branch_of_test alongside master's h_root genesis case. block_handle.hpp deduplicated -- both sides had appended extends() in different positions; kept the one with the tightened comment.
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