Skip to content

Conversation

@snowmead
Copy link
Contributor

@snowmead snowmead commented Jan 21, 2026

The changes introduce guardrails to prevent client-side decoding failures caused by breaking changes to events or error enums/variants in StorageHub pallets.

What this PR adds:

  • Explicit codec indices (#[codec(index = N)]) on all event and error variants across StorageHub pallets, ensuring SCALE encoding/decoding is deterministic regardless of source code ordering.
  • Documentation establishing encoding stability rules: pallet indices must be immutable, variant indices must never change or be reused, and breaking changes require new versioned variants (e.g., NewStorageRequestV2).
  • Improved error messages in the client when event/error decoding fails, clarifying that a runtime upgrade likely introduced an incompatible change.

Added event and error code overriding indexes to preserve ordering
@snowmead snowmead added B5-clientnoteworthy Changes should be mentioned client-related release notes B7-runtimenoteworthy Changes should be noted in any runtime-upgrade release notes D4-nicetohaveaudit⚠️ PR contains trivial changes to logic that should be properly reviewed. not-breaking Does not need to be mentioned in breaking changes labels Jan 22, 2026
@snowmead snowmead marked this pull request as ready for review January 27, 2026 21:03
@snowmead snowmead requested review from TDemeco and ffarall January 27, 2026 21:03
Copy link
Collaborator

@ffarall ffarall left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR is basically approved. I'm only not approving it now, to prevent it from being merged before other PRs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

B5-clientnoteworthy Changes should be mentioned client-related release notes B7-runtimenoteworthy Changes should be noted in any runtime-upgrade release notes D4-nicetohaveaudit⚠️ PR contains trivial changes to logic that should be properly reviewed. not-breaking Does not need to be mentioned in breaking changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants