Skip to content

feat: log validator committee membership on session change#1534

Merged
ozgb merged 16 commits into
mainfrom
ozgb-committee-log
May 22, 2026
Merged

feat: log validator committee membership on session change#1534
ozgb merged 16 commits into
mainfrom
ozgb-committee-log

Conversation

@ozgb

@ozgb ozgb commented May 19, 2026

Copy link
Copy Markdown
Contributor

Overview

Adds a node-side watcher that emits one log line per substrate session indicating whether the local AURA key matches a member of the active committee:

  • INFO when the node IS in the committee (with the matching AURA key as 0x… hex).
  • WARN when the node is NOT in the committee (with the local AURA keys, committee size, and a hint to check the keystore).

Only authorities run the watcher, so non-validator nodes don't spam "NOT in committee" warnings.

Motivated by an incident where Alice silently failed to produce blocks for over a week because the AURA key in its keystore did not match the on-chain committee — the standard logs gave no indication. The new log makes this immediately visible to operators on every session boundary.

The session index is exposed via a new typed runtime API (midnight-primitives-session-info::SessionInfoApi) rather than reading pallet_partner_chains_session::CurrentIndex storage directly, so renaming the pallet or its storage item is a compile error rather than a silent fallback.

🗹 TODO before merging

  • Ready
  • TODO: check local-env output with validator + non-validator nodes
    • Confirmed with local-env - correct behaviour for validator nodes in/not in the committee, and for non-validator nodes

📌 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):

🔱 Fork Strategy

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

Runtime metadata needs rebuilding (new runtime API added). Run /bot rebuild-metadata after this PR is opened.

Links

Closes #1399
JIRA: https://shielded.atlassian.net/browse/PM-21082

ozgb added 3 commits May 19, 2026 09:59
Watches imported blocks, dedupes by substrate session index, and emits
a single INFO (in committee) or WARN (not in committee) line per
session. Helps operators diagnose silently mismatched AURA keys.

Refs: #1399
Signed-off-by: Oscar Bailey <79094698+ozgb@users.noreply.github.com>
Replace the direct storage read of `Session::CurrentIndex` with a typed
runtime API call. Adds a new `midnight-primitives-session-info` crate
exposing `SessionInfoApi::current_session_index() -> u32` and impls it
in the runtime as `Session::current_index()`.

Drops the StorageProvider/Backend trait bounds, the manually-built
twox_128 storage key, and the SCALE decoding step from the node-side
watcher — making the code refactor-safe (renaming the pallet or its
storage item is now a compile error rather than a silent runtime
fallback to 0).

Refs: #1399
Signed-off-by: Oscar Bailey <79094698+ozgb@users.noreply.github.com>
Refs: #1399
Signed-off-by: Oscar Bailey <79094698+ozgb@users.noreply.github.com>
@ozgb ozgb requested a review from a team as a code owner May 19, 2026 09:18
ozgb added 2 commits May 19, 2026 10:19
Signed-off-by: Oscar Bailey <79094698+ozgb@users.noreply.github.com>
@ozgb

ozgb commented May 19, 2026

Copy link
Copy Markdown
Contributor Author

/bot rebuild-metadata

@github-actions

Copy link
Copy Markdown
Contributor

❌ Metadata rebuild failed. Check the workflow logs for details.

Comment thread node/src/committee_membership.rs
@github-actions

Copy link
Copy Markdown
Contributor

✅ Metadata rebuild complete! Changes have been committed.

ozgb added 7 commits May 22, 2026 10:37
Newer clang versions promote -Wimplicit-function-declaration to an error,
causing the Substrate runtime's WASM build to fail inside secp256k1-sys
because its bundled wasm-sysroot string.h doesn't declare memmove. Note
the CFLAGS override that demotes the warning so contributors hitting the
error can grep AGENTS.md for the fix.

Signed-off-by: Oscar Bailey <79094698+ozgb@users.noreply.github.com>
Signed-off-by: Oscar Bailey <79094698+ozgb@users.noreply.github.com>
Clarify that committee membership is per-session - a node not in the
current committee may still be a registered or permissioned validator.
Drop the keystore-check hint from the WARN since it can mislead in that
case.

Signed-off-by: Oscar Bailey <79094698+ozgb@users.noreply.github.com>
Signed-off-by: Oscar Bailey <79094698+ozgb@users.noreply.github.com>
Signed-off-by: Oscar Bailey <79094698+ozgb@users.noreply.github.com>
Comment thread node/src/committee_membership.rs Outdated
LGLO
LGLO previously approved these changes May 22, 2026
Signed-off-by: Oscar Bailey <79094698+ozgb@users.noreply.github.com>
Signed-off-by: Oscar Bailey <79094698+ozgb@users.noreply.github.com>
@ozgb ozgb enabled auto-merge May 22, 2026 14:02
Signed-off-by: Oscar Bailey <79094698+ozgb@users.noreply.github.com>
@ozgb ozgb added this pull request to the merge queue May 22, 2026
Merged via the queue into main with commit 99767d8 May 22, 2026
36 checks passed
@ozgb ozgb deleted the ozgb-committee-log branch May 22, 2026 15:07
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.

[node] Missing notification in logs if keys are incorrect or missing

3 participants