4

As far as I know, the metadata of Polkadot is version 14.

Assuming that the metadata version is not updated,

Can the metadata of the recent block be different?

ex) Block(#9135844)'s metadata != Block(#9135845)'s metadata??

The reason why I'm asking this question seems that I don't have a good concept of metadata yet.

If the same metadata is used in the example above, I don't think I need to get it from time to time.

1
  • Why is it necessary/useful to store the metadata in every block? Feb 22, 2022 at 11:42

2 Answers 2

6

From the Substrate docs

Since the runtime of a Substrate blockchain is an evolving part of the blockchain's state, blockchain metadata is stored on a per-block basis. Be aware that querying the metadata for an older block (with an archive node, for example) could result in acquiring out-of-date metadata that is not compatible with a blockchain's current state.

Metadata does change and two blocks can have different associated metadata versions, you shouldn't make assumptions about it staying the same but it's true that it doesn't change often. In your example V14 means that the structure of the metadata will remain unchanged until the next version but doesn't mean the actual data cannot change, for example new pallets being added to the runtime won't change the v14, but new metadata will be available describing the newly added extrinsics/storage/etc.

From a comment in a related issue I created some time ago. What you probably want is to subscribe for new version changes to fetch metadata only when the runtime is updated.

0

When you change or update your pallets, such as Calls, Storages, RPCs, etc, the metadata may change.

The metadata codec version (such as V14) may change with new substrate version.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.