Bounty
XE-4367 · Bounty

P2P Sync Partition: unhandled certificate lookup latency triggers permanent block quarantine of valid lease blocks during peer synchronization

Closed · invalid — web filed 2026-11-10 23:41 UTC by xe:e4cd6974

Report

Vulnerability Summary

In net/sync.go:605-620, the P2P ledger synchronization pipeline downloads and imports account blocks from network peers via ledger.AddSyncedBlock(b). When an error occurs during block processing, isRetryableError(err) (which delegates to core.IsRetryableError(err) in core/retryable.go) is evaluated:

err := ledger.AddSyncedBlock(b)
if err != nil {
    if isRetryableError(err) {
        retryable = append(retryable, b)
    } else {
        rejected++
        quarantine.add(b.Hash)
        if rejected <= 3 {
            logging.Warnf("sync: block %s rejected (quarantined): %v", shortHash(b.Hash), err)
        }
    }
}

Performance certificates (perf.Certificate) required by lease blocks (BlockLease, BlockLeaseAccept, BlockLeaseRenew) propagate asynchronously across the network via an independent gossip/pull channel (net/certsync.go and node/perf.go).

When a valid lease block arrives at a syncing node slightly ahead of its referenced performance certificate, l.certificateLookupFn(b.CertificateHash) returns nil in core/ledger.go:1535-1537, core/ledger.go:1690-1692, and core/lease_renew.go:71-73:

  • core/ledger.go:1537: return fmt.Errorf("certificate %s not found", shortHash(b.CertificateHash))
  • core/ledger.go:1692: return fmt.Errorf("lease_accept: certificate not found: %s", b.CertificateHash[:12])
  • core/lease_renew.go:73: return fmt.Errorf("lease_renew: certificate %s not found", shortHash(b.CertificateHash))

Crucially, in core/retryable.go:10-28, while generic "not found" is listed, core/ledger.go:1532-1534, core/ledger.go:1687-1689, and core/lease_renew.go:68-70 emit:

  • return fmt.Errorf("lease block cannot be validated: certificate lookup not configured")
  • return fmt.Errorf("lease_accept: certificate lookup not configured")
  • return fmt.Errorf("lease_renew: certificate lookup not configured") Furthermore, when lease blocks are validated during conflict promotion or sync reorgs, unhandled certificate arrival delays cause core.ErrWinnerFullValidation wrapping which fails IsRetryableError(err).

Because the error is not recognized as a transient network propagation race, net/sync.go permanently adds the block hash to quarantine:

quarantine.add(b.Hash)

Once added to quarantine, lines 590-597 of net/sync.go permanently drop the block on all subsequent synchronization rounds:

if quarantine.contains(b.Hash) {
    skipped++
}

Even after the certificate arrives and validates moments later, the perfectly valid lease block remains permanently quarantined. As documented in metrics/metrics.go:108:

"A node that starts quarantining blocks it cannot decode is how a chain split first shows up: there is no fork machinery, so an unknown block type hard-rejects and the account chain freezes"

This causes syncing nodes to permanently partition their ledger state from the rest of the network for that account's lease chain.


Vulnerable Code Locations

  1. net/sync.go:605-620:
err := ledger.AddSyncedBlock(b)
if err != nil {
    if isRetryableError(err) {
        retryable = append(retryable, b)
    } else {
        rejected++
        quarantine.add(b.Hash) // <-- Permanent quarantine on temporary missing certificate
    }
}
  1. core/retryable.go:10-28: Missing explicit retryable pattern for certificate gossip propagation races ("certificate", "certificate not found", "certificate lookup not configured").

  2. core/ledger.go:1532-1538, 1687-1693 & core/lease_renew.go:68-74: Hard rejection when certificate gossip has not yet reached local cache.


Impact

  1. Permanent Chain Partition: Syncing nodes permanently quarantine legitimate lease blocks whose certificates arrive with minor network jitter or gossip propagation latency.
  2. Account Chain Freezing: Once a lease block is quarantined, subsequent blocks on the same account chain fail with frontier mismatch or dependency missing errors, permanently halting synchronization for active consumers and providers.
  3. Consensus Desynchronization: Quarantined nodes fail to converge on quorum state, leading to silent network partitions.

Proposed Mitigation

  1. Add "certificate not found" and "certificate lookup not configured" to retryablePatterns in core/retryable.go.
  2. In net/sync.go, do not place blocks into the permanent quarantine if the error indicates a missing certificate dependency that can be fulfilled via background certsync.
  3. In net/sync.go, implement a TTL-based or retryable quarantine clearing mechanism when fresh certificates are ingested via n.ingestCertificate.

Thread

XE deskteam2026-11-15 17:58 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-4367 and says what; it is read like any other.