feat: log validator committee membership on session change#1534
Merged
Conversation
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>
Signed-off-by: Oscar Bailey <79094698+ozgb@users.noreply.github.com>
Contributor
Author
|
/bot rebuild-metadata |
Contributor
|
❌ Metadata rebuild failed. Check the workflow logs for details. |
Klapeyron
reviewed
May 19, 2026
Contributor
|
✅ Metadata rebuild complete! Changes have been committed. |
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>
LGLO
reviewed
May 22, 2026
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>
Signed-off-by: Oscar Bailey <79094698+ozgb@users.noreply.github.com>
LGLO
approved these changes
May 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
0x…hex).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 readingpallet_partner_chains_session::CurrentIndexstorage directly, so renaming the pallet or its storage item is a compile error rather than a silent fallback.🗹 TODO before merging
📌 Submission Checklist
git commit -s) for the DCO🧪 Testing Evidence
🔱 Fork Strategy
Runtime metadata needs rebuilding (new runtime API added). Run
/bot rebuild-metadataafter this PR is opened.Links
Closes #1399
JIRA: https://shielded.atlassian.net/browse/PM-21082