Skip to content

No committed test forces a lock to be processed before the conflicting block’s notification #8228

Open

Description

@thepastaclaw

PastaClaw flagged this while reviewing #8211, where it was deferred to a follow-up instead of being fixed in that pull request. This issue tracks the follow-up.

No committed test forces a lock to be processed before the conflicting block’s notification (suggestion)

Impact: CI can pass even if the InstantSend worker again leaves a conflicting block active when it processes the lock before BlockConnected.

Where: src/instantsend/net_instantsend.cpp:408-416 at 0066d066f7be:

// A check deferred when this lock was processed before (without its transaction) is superseded by this one
std::erase_if(m_deferred_conflict_checks,
[&](const DeferredConflictCheck& check) { return check.islock_hash == hash; });
// Read the tip only now that the lock is stored: ConnectBlock rejects later conflicting blocks. A dropped
// lock is not deferred, so its resubmissions can't grow the deferred checks past the pending queue's bound.
if (const auto* tip = WITH_LOCK(::cs_main, return m_chainman.ActiveTip()); stored && tip != m_notified_tip) {
m_deferred_conflict_checks.push_back({tip, hash});
} else {
ResolveBlockConflicts(hash, *islock);

The rebase dropped the regression test that held the validation queue while the worker processed the lock. feature_llmq_is_cl_conflicts.py submits the block, synchronizes the nodes, and then relays the lock; it checks for disconnection but does not force the notification to arrive late. The project requires automated coverage for consensus changes, and this path changes which block remains active. Restore the test through the public worker path: TestChain100Setup can select the non-rotating test quorum with -llmqtestinstantsenddip0024=llmq_test_instantsend. Hold the callback with CallFunctionInValidationInterfaceQueue, wait for the worker to finish processing the lock before releasing it, and assert that the conflicting tip disconnects. Exercise reprocessing in the worker’s actual order, which handles the pending locks before draining deferred checks.

_Raised as blocking. An independent pass did not find a failure someone would actually hit, so it does not block: The range-diff confirms that the queue-holding regression test was dropped. The existing functional test drains the validation queue through sync_all() before relaying the lock, so it verifies disconnection but cannot exercise the deferred path or lock reprocessing. That is a real coverage gap, but the patch changes when the worker runs the existing InstantSend conflict resolver, not the consensus rules for accepting blocks or which lock takes precedence. The mandatory consensus-change test rule therefore do

Origin

Activity

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