Skip to content

Substrate storage.<pallet>.<item>.<version>.is(block) false positive #334

@khssnv

Description

@khssnv

Describe the bug

The call storage.mypallet.myitem.v1.is(blockHeader) (where storage is imported from types generated by squid-substrate-typegen) returns true at block at height where it expected to return true for v2 (which added new fields to myitem type) only.

To Reproduce

  1. Setup the project.

    git clone --branch debug/khssnv-squid-sdk-bug-report https://github.com/Cerebellum-Network/cere-squid-indexer.git
    cd cere-squid-indexer
    npm i
  2. Launch processor.

    docker compose up -d db
    sqd process
  3. See error message.

    ...
    Unexpected storage layout version selection. Selected v48013 for spec version 54116 which is higher than the next v48017.
    ...

Please tell if this one is too large and I'll prepare a minimal reproducible example.

Expected behavior

In my specific case with the project set up above, the storage.ddcCustomers.buckets.v48013.is(block) call is expected to return false instead of true at height 5,238,731 and return true at storage.ddcCustomers.buckets.v54100.is(block).

Environment (please complete the following information):

  • specify the version of the core packages: "@subsquid/substrate-processor": "8.3.0", "@subsquid/substrate-typegen": "8.1.0", "@subsquid/substrate-metadata-explorer": "3.2.0"
  • node.js version 16
  • npm version 10.8
  • OS version Linux x1 6.5.0-1027-oem #28-Ubuntu SMP PREEMPT_DYNAMIC Thu Jul 25 13:32:46 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
  • Reproducible example or a repo link https://github.com/Cerebellum-Network/cere-squid-indexer

Applicable to decoding issues:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions