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

Cache of runtime call results #1680

Merged
merged 23 commits into from
Jul 29, 2023
Merged

Conversation

xDimon
Copy link
Member

@xDimon xDimon commented Jun 26, 2023

Referenced issues

Resolves #1673

Description of the Change

Store in memory idempotent api-calls results

Benefits

Accelerate by voiding some heavy runtime api calls

xDimon added 15 commits July 12, 2023 12:03
Signed-off-by: Dmitriy Khaustov aka xDimon <[email protected]>
Signed-off-by: Dmitriy Khaustov aka xDimon <[email protected]>
Signed-off-by: Dmitriy Khaustov aka xDimon <[email protected]>
Signed-off-by: Dmitriy Khaustov aka xDimon <[email protected]>
Signed-off-by: Dmitriy Khaustov aka xDimon <[email protected]>
Signed-off-by: Dmitriy Khaustov aka xDimon <[email protected]>
Signed-off-by: Dmitriy Khaustov aka xDimon <[email protected]>
feature: method erase for force proactive removal

Signed-off-by: Dmitriy Khaustov aka xDimon <[email protected]>
Signed-off-by: Dmitriy Khaustov aka xDimon <[email protected]>
Signed-off-by: Dmitriy Khaustov aka xDimon <[email protected]>
Signed-off-by: Dmitriy Khaustov aka xDimon <[email protected]>
Signed-off-by: Dmitriy Khaustov aka xDimon <[email protected]>
@xDimon xDimon force-pushed the feature/runtime_call_results_cache branch from 2c0572b to 38e8124 Compare July 12, 2023 09:13
@xDimon xDimon marked this pull request as ready for review July 12, 2023 09:13
Signed-off-by: Dmitriy Khaustov aka xDimon <[email protected]>
Signed-off-by: Dmitriy Khaustov aka xDimon <[email protected]>
Signed-off-by: Dmitriy Khaustov aka xDimon <[email protected]>
inline LockGuard(const Lockable<IsLockable> &) {}
};

template <template <bool> class Lockable>
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

This solution selected for ability switch between thread-safe implementation and non-ts.

Copy link
Contributor

@Harrm Harrm left a comment

Choose a reason for hiding this comment

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

I have a concern that runtime calls are invoked not just from wrappers in runtime_api/, but sometimes directly through the executor. This is done at least in RPCs and in parachains.

@xDimon xDimon enabled auto-merge (squash) July 28, 2023 10:17
@xDimon xDimon merged commit b6900de into master Jul 29, 2023
@xDimon xDimon deleted the feature/runtime_call_results_cache branch July 29, 2023 18:57
xDimon added a commit that referenced this pull request Jul 31, 2023
* feature: auto removal of non pruned forks
* refactor: move SmallLruCache
* refactor: get-or-calculate-and-put in LRU cache
* refactor: add eq-operator for some types
* feature: cache results of authority discovery api calls
* feature: cache results of babe api calls
* feature: cache results of grandpa api calls
* feature: cache results of core and metadata apis calls
* feature: cache results of parachain host calls
* refactor: lru returns only optional sptr to value for safety
* feature: method erase for force proactive removal
* fix: follow actual lru interface
* feature: method erase_if for force proactive removal by provided predicate
* feature: prune parachain host caches by finalization
* fix: optional using backward
* fix: tests

Signed-off-by: Dmitriy Khaustov aka xDimon <[email protected]>

---------

Signed-off-by: Dmitriy Khaustov aka xDimon <[email protected]>
(cherry picked from commit b6900de)
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.

Cache runtime calls results
3 participants