Make wasm runtime cache size configurable#10177
Conversation
|
@bkchr sorry to ping you, but not sure who can do a review of this one. |
bkchr
left a comment
There was a problem hiding this comment.
Sorry for the late review. I left some comments
Thanks for the review, I applied your feedback |
bkchr
left a comment
There was a problem hiding this comment.
2 nitpicks, otherwise seems to look good.
|
It also doesn't compile. |
Fixed |
There are still warnings. Cargo fmt is also not happy. |
Sorry about that, it should be fine now. |
I need to inform you, that CI is still not happy 🙈 |
|
@bkchr It seems that the CI is green now. There is no need of companion PR on polkadot or cumulus. |
|
@librelois for polkadot we need a companion. See the error. Cumulus should be fine and can be ignored. |
Can one of you take care of the polkadot companion PR or should I do it myself? And in this last case, how to proceed? (I have never made a "polkadot companion" PR). |
|
The docs should probably specify that |
|
You need to create a pr to polkadot that fixes the compilation with your branch. Then you need to mention it as |
It's done |
|
@librelois can you please merge master into this branch? 🙈 |
|
@bkchr Looking at the log of the gitlab-check-dependent-polkadot job, there seems to be a problem in your CI: |
|
bot merge |
|
Error: Github API says "Allow edits from maintainers" is not enabled for paritytech/polkadot#4466. The bot would use that permission to push the lockfile update after merging this PR. Please check https://docs.github.com/en/github/collaborating-with-pull-requests/working-with-forks/allowing-changes-to-a-pull-request-branch-created-from-a-fork. |
|
I don't have any checkboxes like "Allow edits from maintainers": Maybe I need to redo the companion PR from a personal fork instead of the purestake fork. |
* Make wasm runtime cache size configurable * apply review comments * remove VersionedRuntimeValue * fix compilation * VersionedRuntime: replace clone by Arc * fmt * fix warnings * fix tests compilation * fmt
|
@librelois Would have been nice it that new parameter was also documented in code and that I did not have to read this issue to understand what it is for, e.g. see also the missing rust docs. |
* Make wasm runtime cache size configurable * apply review comments * remove VersionedRuntimeValue * fix compilation * VersionedRuntime: replace clone by Arc * fmt * fix warnings * fix tests compilation * fmt
* Make wasm runtime cache size configurable * apply review comments * remove VersionedRuntimeValue * fix compilation * VersionedRuntime: replace clone by Arc * fmt * fix warnings * fix tests compilation * fmt

Polkadot companion: paritytech/polkadot#4466
What does it do?
Makes configurable the maximum number of different runtime versions that can be kept in cache.
What important points should reviewers know?
Before this PR, the cache had an array of 2
VersionedRuntime, with a custom implementation of a "Last Recent Usage" cache strategy which consisted in swapping a runtime in 1st position when it was used.This custom implementation is not compliant if the cache contains more than 2 elements, then a full LRU algorithm is needed, that's why I use the lru crate which does this very well.
skip check-dependent-cumulus