paritytech / paritytech/frame-decode

System.Events decoding fails for V11/V12 metadata blocks

Open
#86 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
8
Forks
2
PR merge metrics
No merged PRs in 30d

Description

Summary

System.Events storage cannot be decoded for historical blocks that use V11/V12 metadata. This is a metadata version incompatibility issue, not a lazy migration issue (those are tracked in #85).

Affected Blocks

Attribute Value
Chain Kusama Relay
Spec Versions 1058, 1062
Example Blocks 2064962, 2064963, 2064964, 2064965, 2201991-2201995, 2671528
Total Occurrences 10

Errors Observed

CannotDecodeValue { ty: Vec<EventRecord<T::Event, reason: VariantNotFound(72) at .[2].event }
CannotDecodeValue { ty: Vec<EventRecord<T::Event, reason: CodecError("Not enough data to fill buffer") at .[1].event.[0].[1] }
CannotDecodeValue { ty: Vec<EventRecord<T::Event, reason: CodecError("Not enough data to fill buffer") at .[1].event.[0].[0].[0].[15] }

Root Cause (Investigation Needed)

The issue appears to be related to how event pallet indices are encoded in V11/V12 metadata vs V14:

  • V11/V12: Events may use a different pallet index encoding scheme
  • V14: The current decoder assumes V14-style pallet indices

When decoding V11/V12 events with V14 assumptions, the decoder either:

  1. Encounters an unknown variant (VariantNotFound(72))
  2. Runs out of data because it's reading the wrong structure

TODO

  • Confirm root cause - is it pallet index encoding or something else?
  • Check what Polkadot-JS does for these blocks - does it decode successfully?
  • Determine what changes would be needed to support V11/V12 event decoding
  • Decide if this is worth fixing or if those blocks should simply be excluded from testing

Related

  • #85 tracks lazy migration issues (mixed data formats within same spec version)
  • This issue is specifically about metadata version incompatibility

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the listed Kusama blocks, especially 2064962-2064965, 2201991-2201995, and 2671528, and inspect the reported decoding errors. Compare their V11/V12 event decoding with Polkadot-JS, then determine whether pallet-index encoding is the cause. Done means confirming the root cause and documenting the required support or an explicit decision to exclude these blocks.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
blockchain
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.