19 using soralog::util::getThreadNumber;
22 std::shared_ptr<RuntimeInstancesPool> runtime_instances_pool,
23 std::shared_ptr<RuntimeUpgradeTracker> runtime_upgrade_tracker,
24 std::shared_ptr<const ModuleFactory> module_factory,
25 std::shared_ptr<SingleModuleCache> last_compiled_module)
26 : runtime_instances_pool_{std::move(runtime_instances_pool)},
37 outcome::result<std::shared_ptr<ModuleInstance>>
39 std::shared_ptr<const RuntimeCodeProvider> code_provider,
55 !opt_module.has_value()) {
57 logger_,
"Runtime module cache miss for state {}", state.toHex());
58 auto code = code_provider->getCodeAt(state);
59 if (not code.has_value()) {
60 code = code_provider->getCodeAt(header.
state_root);
62 if (not code.has_value()) {
63 return code.as_failure();
74 return std::move(runtime_instance);
#define KAGOME_PROFILE_END(scope)
std::shared_ptr< RuntimeUpgradeTracker > runtime_upgrade_tracker_
std::shared_ptr< SingleModuleCache > last_compiled_module_
outcome::result< std::shared_ptr< ModuleInstance > > getInstanceAt(std::shared_ptr< const RuntimeCodeProvider > code_provider, const primitives::BlockInfo &block, const primitives::BlockHeader &header) override
Returns a module instance for runtime at the.
ModuleRepositoryImpl(std::shared_ptr< RuntimeInstancesPool > runtime_instances_pool, std::shared_ptr< RuntimeUpgradeTracker > runtime_upgrade_tracker, std::shared_ptr< const ModuleFactory > module_factory, std::shared_ptr< SingleModuleCache > last_compiled_module)
std::shared_ptr< RuntimeInstancesPool > runtime_instances_pool_
#define KAGOME_PROFILE_START(scope)
Logger createLogger(const std::string &tag)
std::shared_ptr< const ModuleFactory > module_factory_