Add netuid to TransactionFeePaidWithAlpha event#2614
Merged
Conversation
JohnReedV
approved these changes
Apr 23, 2026
camfairchild
approved these changes
Apr 23, 2026
sam0x17
approved these changes
Apr 23, 2026
This was referenced May 11, 2026
sam0x17
pushed a commit
that referenced
this pull request
May 15, 2026
When `do_batch_commit_weights` / `do_batch_set_weights` process a
per-subnet weight batch, any item that fails currently emits
BatchWeightItemFailed(DispatchError)
which carries the error but **not the netuid** that produced it.
Downstream consumers (block explorers, validator monitors, indexers)
that watch batch submissions cannot correlate failures → subnet
without re-deriving from iteration order, which is fragile across
runtime upgrades and not available to event-only subscribers.
Change the event signature to
BatchWeightItemFailed(NetUid, DispatchError)
and thread the netuid through both emission sites by zipping
`(NetUid, DispatchResult)` tuples out of the per-item map.
Shape parallels #2614 (Add netuid to TransactionFeePaidWithAlpha
event) which made the same observability fix on a different event.
Adds two regression tests in `tests/weights.rs` covering both
emission paths; the dispatches were previously untested at the
batch-event layer. Bumps `spec_version` 406 → 407.
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.
Description
Adds netuid to TransactionFeePaidWithAlpha event.
Type of Change
Checklist
./scripts/fix_rust.shto ensure my code is formatted and linted correctly