Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: expandMetadata for historic runtimes #692

Merged
merged 5 commits into from
Oct 5, 2021
Merged

Conversation

TarikGul
Copy link
Member

@TarikGul TarikGul commented Oct 2, 2021

closes: #690

This fixes a bug where when expanding metadata in order to capture the weights used in calculating we dont use the correct registry per historic block. This changes that to have a historicApi return the correct registry for the block.

@@ -558,9 +558,10 @@ export class BlocksService extends AbstractService {
blockHash: BlockHash
): Promise<WeightValue> {
const metadata = await api.rpc.state.getMetadata(blockHash);
const historicApi = (await api.at(blockHash)) as ApiPromise;
Copy link
Member

Choose a reason for hiding this comment

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

@TarikGul I suppose the registry contains metadata, chain info and other stuff that is required for that data to match for historical blocks?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yup exactly!

Example: The specific error that brought up this issue too was a type error where Westend has a Lookup36 type in its Metadata, but it didnt match the registry. So when trying to expand the metadata, types didn't align.

Copy link
Member

@niklasad1 niklasad1 left a comment

Choose a reason for hiding this comment

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

LGTM

@TarikGul TarikGul merged commit ed389a4 into master Oct 5, 2021
@TarikGul TarikGul deleted the tarik-fix-expand branch October 5, 2021 17:35
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG]E2E tests fail for westend on blocks 5495855, and 5493461
3 participants