Skip to content

Add netuid to TransactionFeePaidWithAlpha event#2614

Merged
sam0x17 merged 1 commit into
devnet-readyfrom
feat/alpha-fees-event
Apr 23, 2026
Merged

Add netuid to TransactionFeePaidWithAlpha event#2614
sam0x17 merged 1 commit into
devnet-readyfrom
feat/alpha-fees-event

Conversation

@gztensor
Copy link
Copy Markdown
Contributor

Description

Adds netuid to TransactionFeePaidWithAlpha event.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Other (please describe):

Checklist

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have run ./scripts/fix_rust.sh to ensure my code is formatted and linted correctly
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@gztensor gztensor added the skip-cargo-audit This PR fails cargo audit but needs to be merged anyway label Apr 23, 2026
@sam0x17 sam0x17 merged commit d6e7292 into devnet-ready Apr 23, 2026
212 of 219 checks passed
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip-cargo-audit This PR fails cargo audit but needs to be merged anyway

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants