Bounty
XE-10160 · Bounty

Consensus Conflict Stall: pullPhantomBlocks calls AddBlock instead of SaveStagedBlock causing permanent phantom rejection and delayed quorum resolution

Closed · invalid — web filed 2026-11-12 10:27 UTC by xe:e4cd6974

Report

Vulnerability Summary

In node/node.go:887-907, pullPhantomBlocks is registered as the node's PhantomPullFn (node/node.go:584) to retrieve missing block bodies for conflict candidates from connected peers:

func (n *Node) pullPhantomBlocks(account, previous string, hashes []string) {
	if len(hashes) == 0 {
		return
	}
	want := append([]string(nil), hashes...)
	n.wg.Add(1)
	go func() {
		defer n.wg.Done()
		peers := n.Host.Network().Peers()
		if len(peers) == 0 {
			return
		}
		xenet.PullBlocks(n.ctx, n.Msg, peers, want, func(b *core.Block) error {
			if err := n.Ledger.AddBlock(b); err != nil {
				return err
			}
			n.syncTracker.MarkDirty()
			return nil
		})
	}()
}

When a phantom block body is retrieved from a peer: The ingestion callback invokes n.Ledger.AddBlock(b).

However, by definition, a phantom block in an open conflict shares the same Previous hash as an already-existing block on the account's chain. In core/ledger.go, invoking AddBlock(b) on a conflicting block immediately triggers: return errForkDetected or return errPreviousMismatch.

Because AddBlock returns an error:

  1. PullBlocks logs an ingest failure and considers the block un-ingested (delete(want, b.Hash) is skipped).
  2. The block is never saved to the staged block store (n.Store.SaveStagedBlock(b)).
  3. On every subsequent sweep of QuorumManager.sweepOpenConflicts(), qm.ledger.GetBlockOrStaged(h) returns nil, classifying the block as a phantom repeatedly.
  4. The conflict is unable to resolve normally and remains stalled until the hard timeout (phantomUnretrievableTimeout) forces an unretrievable drop.

Impact & Severity

  1. Consensus Livelock: Legitimate conflict candidates successfully retrieved from the P2P network cannot be staged or evaluated by the BFT quorum engine.
  2. Delayed Finality: Accounts with conflicting transactions are blocked from settling or progressing until phantom timeouts expire.

Proposed Remediation

In pullPhantomBlocks, validate the block's hash and signature, then store it as a staged block rather than calling AddBlock:

		xenet.PullBlocks(n.ctx, n.Msg, peers, want, func(b *core.Block) error {
			if err := core.VerifyBlockHash(b); err != nil {
				return err
			}
			if err := core.VerifyBlockSignature(b); err != nil {
				return err
			}
			if err := n.Store.SaveStagedBlock(b); err != nil {
				return err
			}
			n.syncTracker.MarkDirty()
			return nil
		})

Thread

XE deskteam2026-11-20 00:48 UTCdesk

Thanks for the report. We read it against the code and could not confirm a bug in what it describes.

This report is closed as invalid. If we have missed something, file a new report that links https://bounty.xe.network/XE-10160 and says what; it is read like any other.