Skip to content

fix: abort committee rotation on session key registration failure - #2078

Draft
Klapeyron wants to merge 1 commit into
mainfrom
feat/session-duplicate-key-committee-sync
Draft

fix: abort committee rotation on session key registration failure#2078
Klapeyron wants to merge 1 commit into
mainfrom
feat/session-duplicate-key-committee-sync

Conversation

@Klapeyron

Copy link
Copy Markdown
Contributor

Overview

register_committee_keys currently logs SessionInterface::set_keys failures and still hands the full committee to pallet_session. That pallet then drops members without NextKeys, so the live authority set diverges from CurrentCommittee/QueuedCommittee. AURA author index and BEEFY stake matching become undefined; a partial or empty set is a liveness/finality risk (#1895).

set_keys is treated as a black box. The session manager does not inspect or special-case the error (DuplicatedKey today, NoAccount, or a reason pallet_session adds later). Any Err aborts the hand-off.

Policy is all-or-nothing:

  • Call set_keys for each unique member. First failure skips the whole incoming committee.
  • new_session returns None, so pallet_session keeps the previous validators.
  • The failed committee is not queued. QueuedCommittee stays the previous full set; the skipped epoch is stamped so rotation does not retry every block.
  • A reduced committee is never installed.
  • Genesis panics if the initial committee cannot be registered in full (empty default genesis config is still allowed).

A later epoch with a clean committee still rotates normally.

🗹 TODO before merging

  • Ready

📌 Submission Checklist

  • All commits are signed off (git commit -s) for the DCO
  • Changes are backward-compatible (or flagged if breaking)
  • Pull request description explains why the change is needed
  • Self-reviewed the diff
  • I have included a change file, or skipped for this reason:
  • If the changes introduce a new feature, I have bumped the node minor version
  • Update documentation (if relevant)
  • Updated AGENTS.md if build commands, architecture, or workflows changed
  • No new todos introduced

🧪 Testing Evidence

  • Additional tests are provided (if possible)

cargo test -p pallet-session-validator-management --lib

Colliding session keys are only a fixture to make set_keys return Err. Tests cover: any registration failure skips the whole incoming set; all members rejected keeps the previous set; recovery on the next valid committee; genesis panics if the initial committee cannot register in full.

🔱 Fork Strategy

  • Node Runtime Update
  • Node Client Update
  • Other:
  • N/A

Runtime upgrade required so live chains pick up the new SessionManager behaviour.

Links

Closes #1895

@Klapeyron Klapeyron self-assigned this Sep 1, 2026
Ignore set_keys errors no longer: one DuplicatedKey (or any registration
failure) skips the whole incoming committee so pallet_session and the
session manager stay on the previous full authority set.

Signed-off-by: Tomasz Bartos <tomasz.bartos@shielded.io>
@Klapeyron
Klapeyron force-pushed the feat/session-duplicate-key-committee-sync branch from bf1f2c4 to 4a9c683 Compare September 1, 2026 09:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Aura→BABE] Committee rotation proceeds after session key registration failure

1 participant