question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Allow to opt out metadata swap for `isHistoric` queries

See original GitHub issue

From my understanding, recently, the isHistoric flag is introduced to some RPC calls, causing a metadata swap that includes some overhead RPC calls (getRuntimeVersion and getHeader).

For the use case of substrate-api-sidecar, it would be very helpful if this metadata swap could be opted out of (i.e. appending a param isHistoric=false). So far we are seeing a significant performance regression, even with the optimization introduced here: https://github.com/polkadot-js/api/commit/637069d723bf9a8afcd42af8b3162a20737ff501 - even though I would have thought it would have fixed performance issues because the endpoint services make every call possible at the same block hash.

Currently Sidecar has its own method to swap out metadata and we are working on a way to handle edge cases like runtime upgrade blocks while only having a minimal performance penalty (see here: https://github.com/paritytech/substrate-api-sidecar/pull/232). We are trying to avoid the overhead of call to getHeader, which the new built in swap implicitly does with every query to a different block hash. This is especially important because the longer an endpoint takes to respond, the higher the memory footprint of Sidecar grows with concurrent requests, and just all around lower throughput/ higher latency - which is becoming a concern as the users of Sidecar experience quickly scaling traffic.

Here are the response times from using our own metadata swapping with v1.30.1 and querying the same block endpoint 5 times in a row. The first is quite long because we have to fetch the metadata since we don’t have any default metadaRpc (branch master, commit 3dfe6dc353da4027cae8ee63cc0bf5244a6490ca) :

image

And here are the response times when I disable our own metadata swap and use v1.31.beta.x (branch: zeke-tst-polk-js commit: bb52ae971a51701b4cdbc7c3f773ce57b796d8a3)

image

Also for reference in case you want to see exact calls for this endpoint:

Also let me know if there is anything related to this that I can help implement on the polkadot-js side. I am not that familiar with the RPC architecture but happy to help and learn more about it.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:11 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
jacogrcommented, Sep 1, 2020

Closing an “wontfix”, sadly the native support is not going away since it has been the #1 support burden in the last 9 months. Additionally there are a couple of issues waiting that needs this (e.g. consts.<module>.<method>.at(blockHash) and keys.at(...)/entries.at(...)

Fo specific suggestions on additional improvements regarding performance (here and elsewhere), all ears. The last suggestion here actually helped a lot.

0reactions
polkadot-js-botcommented, Jun 3, 2021

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue if you think you have a related problem or query.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Features - OpenMetadata Docs
OpenMetadata indexes assets based on descriptions, tags, names, and other metadata to enable keyword, advanced search, and filtering to enable you and others...
Read more >
Get Started - Tableau Help
A server admin must enable the Metadata API on Tableau Server using the tsm maintenance ... In general, all authorized users can query...
Read more >
Android Users, Change This Setting to Stop Facebook's ...
Here are some answers and steps for opting out. Facebook has clarified that it is just storing the metadata of calls, not the...
Read more >
Access VM metadata - Compute Engine - Google Cloud
Query metadata changes using the wait-for-change feature. Given that metadata values can change while your VM is running, the metadata server can be...
Read more >
Use change tracking to synchronize data with external systems
In this article. Enable change tracking for a table; Retrieve changes for a table using the Web API; Retrieve changes for a table...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found