-
Notifications
You must be signed in to change notification settings - Fork 34
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
Conversation
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]>
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]>
…icate 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]>
2c0572b
to
38e8124
Compare
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]>
inline LockGuard(const Lockable<IsLockable> &) {} | ||
}; | ||
|
||
template <template <bool> class Lockable> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please consider using SafeObject https://github.com/soramitsu/kagome/blob/master/core/utils/safe_object.hpp
There was a problem hiding this comment.
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.
Signed-off-by: Dmitriy Khaustov aka xDimon <[email protected]>
Signed-off-by: Dmitriy Khaustov aka xDimon <[email protected]>
There was a problem hiding this 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.
* 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)
Referenced issues
Resolves #1673
Description of the Change
Store in memory idempotent api-calls results
Benefits
Accelerate by voiding some heavy runtime api calls