Mutant created against commit 37912ec.
+0 -1 · cpp
This mutant deletes the original lines without replacement.
This description is AI generated, mistakes can be made.
Intent: Break the m_local_set / m_short_id_mapping consistency invariant on mempool removal (mined, replaced, or evicted txs). Stale mappings move into the snapshot and are then sketched by ComputeExtendedSketch while the base sketch (from m_local_set) excludes them. They also cause false SHORTID_COLLISION results, which make net_processing hit Assume(TryRemovingFromSet(collision)) (false) and INV a tx we no longer have.
Behaviour change: Original: after a block confirms tx T, T is gone from both the set and the mapping. Mutant: the mapping keeps T's short id. The next extension sketch includes T although the base sketch did not, so decode fails or yields a bogus diff. A new tx with the same short id is reported as colliding with T, and T is fanned out after it has left the mempool.
Trigger: A tx is in an Erlay peer's set, a block confirms it (MempoolTransactionsRemovedForBlock -> RemoveFromSets), and a reconciliation round with an extension follows. Alternatively, a peer who knows the link salt grinds a tx whose short id equals T's and relays it to us.
Spec violation: Class invariant: m_short_id_mapping holds exactly the short ids of m_local_set (TryRemovingFromSet and AddToSet maintain it in lock-step). Also BIP-330's requirement that the extension cover the same set as the initial sketch.
Severity if undetected: medium
Why tests miss it: RemoveFromSetsTest checks removal via TryRemovingFromSet's return (m_local_set only), RemoveFromSetsKeepsExtensionConsistentTest removes only after the snapshot, p2p_txrecon_responder.py mempool_removal checks only an empty base sketch (built from m_local_set). The analogous line in TryRemovingFromSet is killed by TryRemovingFromSetTest re-adding the same wtxid
Plausibility: The loop's comment talks about leaving the snapshot in place, and the mapping erase looks like bookkeeping that can go when 'the set is the source of truth'. A reviewer comparing it with TryRemovingFromSet might not notice the missing line.
Equivalence risk: Base sketches and HandleInitialSketch use m_local_set, so the mutant only shows through extensions, collisions, or the initiator's GetRelevantIDsFromShortIDs on a diff element equal to a stale id. All of these are reachable, but none happens in a single non-extended round.
Commands and environment reported by the submitter
cmake -B build -DBUILD_GUI=OFF -DWITH_ZMQ=OFF -DENABLE_IPC=OFF && cmake --build build -j$(nproc)ctest --test-dir build -j$(nproc) && build/test/functional/test_runner.py -j$(nproc) --failfastmutant-harness operator: deletion; location: TxReconciliationTrackerImpl::RemoveFromSets lines 569-572
Imported from mutant-harness 474b4f7.
Commands are shown as text and never executed by MutantHub.
0 comments
No comments yet
Discuss equivalence, reproduction difficulties, or a test that kills this mutant.