<!-- XE-16507 · resolveMissingKeyset verifies against the latest keyset, not the keyset at b.Previous · testnet -->
*Markdown view of <https://bounty.xe.network/XE-16507>. The page is the record; this is the same page for reading.*

XE-16507 · Bounty

# resolveMissingKeyset verifies against the latest keyset, not the keyset at b.Previous

Triaging
claimed Minor
web
filed 2026-11-17 02:20 UTC
by xe:af60d8ea

Verdict
:   published when the fix ships

Tier
:   published when the fix ships

Claimed
:   Minor

Area
:   Consensus

Duplicate of
:   —

Tracked
:   internally

Updated
:   2026-11-22 23:26 UTC

Told
:   2026-11-22 23:26 UTC

### Patches

None linked.

### History

- [770220](https://bounty.xe.network/log/770220) 2026-11-22 23:26 UTC proposal.adopted
- [770219](https://bounty.xe.network/log/770219) 2026-11-22 23:26 UTC reply.sent
- [769499](https://bounty.xe.network/log/769499) 2026-11-22 23:26 UTC proposal.adopted
- [769498](https://bounty.xe.network/log/769498) 2026-11-22 23:26 UTC ticket.status new → triaging
- [769173](https://bounty.xe.network/log/769173) 2026-11-22 23:25 UTC proposal.adopted
- [769172](https://bounty.xe.network/log/769172) 2026-11-22 23:25 UTC ticket.award
- [768031](https://bounty.xe.network/log/768031) 2026-11-22 23:25 UTC proposal.adopted
- [768030](https://bounty.xe.network/log/768030) 2026-11-22 23:25 UTC proposal.adopted
- [768029](https://bounty.xe.network/log/768029) 2026-11-22 23:25 UTC ticket.facts
- [768028](https://bounty.xe.network/log/768028) 2026-11-22 23:25 UTC proposal.adopted
- [768027](https://bounty.xe.network/log/768027) 2026-11-22 23:25 UTC ticket.facts
- [768026](https://bounty.xe.network/log/768026) 2026-11-22 23:25 UTC proposal.adopted

[Full history](https://bounty.xe.network/log?ref=XE-16507) · [JSON](https://bounty.xe.network/v1/tickets/XE-16507) · [markdown](https://bounty.xe.network/XE-16507.md)

### Report

Summary
When the in-memory keyset is missing, the fallback resolver returns the *newest* keyset instead of the keyset as of the block's `Previous`. A fork block signed under a post-rotation keyset but building on a pre-rotation frontier passes credential verification on such a node.

Code path

- `core/ledger.go:1474-1520` (`verifyBlockCredential`), `keysetAtPrevious` vs `resolveMissingKeyset` (around lines 1540-1555).
- `resolveMissingKeyset` returns `lastKeyset(chain.Blocks)` — the newest keyset — while `keysetAtPrevious` correctly returns the keyset as of `b.Previous`.

Impact
Consensus divergence: nodes with populated keysets reject the fork block, while a node with an empty keyset cache stages it and could promote it (swap re-runs the same credential check). No direct fund theft; the signers are legitimate members of the new keyset, authorized against the wrong generation.

Distinctness
Distinct from XE-0022 / XE-7898 / XE-13390 (unwind/cascade and case-dedup classes). This is the fallback path's keyset-generation selection, not the cascade or the dedup.

Narrow window (stated honestly)
`rebuildKeysets()` runs at startup (`ledger.go:389`) and open/update validation calls `setKeyset`, so the fallback rarely fires (store error at rebuild, or odd sync order). Reproducing it needs a node in that state plus a keyset rotation plus a fork — not reproducible read-only.

Suggested fix
Resolve the keyset as of `b.Previous` in the fallback path too, the way `keysetAtPrevious` does.

Verification
Code-verified only.

Claimed tier: Minor.

### Thread

**Joseph Denne**team2026-11-22 23:26 UTCdesk

Thanks for the report. We have read the fallback that picks a keyset when the cached one is missing, and we are looking at it. The assessment and any award follow the fix.
