@@ -99,9 +99,10 @@ use polkadot_node_subsystem::{
99
99
use polkadot_node_subsystem_util:: {
100
100
self as util,
101
101
backing_implicit_view:: View as ImplicitView ,
102
- request_claim_queue, request_disabled_validators, request_session_executor_params,
103
- request_session_index_for_child, request_validator_groups, request_validators,
104
- runtime:: { self , request_min_backing_votes, ClaimQueueSnapshot } ,
102
+ request_claim_queue, request_disabled_validators, request_min_backing_votes,
103
+ request_node_features, request_session_executor_params, request_session_index_for_child,
104
+ request_validator_groups, request_validators,
105
+ runtime:: { self , ClaimQueueSnapshot } ,
105
106
Validator ,
106
107
} ;
107
108
use polkadot_parachain_primitives:: primitives:: IsSystem ;
@@ -125,7 +126,6 @@ use polkadot_statement_table::{
125
126
Context as TableContextTrait , Table ,
126
127
} ;
127
128
use sp_keystore:: KeystorePtr ;
128
- use util:: runtime:: request_node_features;
129
129
130
130
mod error;
131
131
@@ -322,14 +322,20 @@ impl PerSessionCache {
322
322
session_index : SessionIndex ,
323
323
parent : Hash ,
324
324
sender : & mut impl overseer:: SubsystemSender < RuntimeApiMessage > ,
325
- ) -> Result < NodeFeatures , Error > {
325
+ ) -> Result < NodeFeatures , RuntimeApiError > {
326
326
// Try to get the node features from the cache.
327
327
if let Some ( node_features) = self . node_features_cache . get ( & session_index) {
328
328
return Ok ( node_features. clone ( ) ) ;
329
329
}
330
330
331
331
// Fetch the node features from the runtime since it was not in the cache.
332
- let node_features = request_node_features ( parent, session_index, sender) . await ?;
332
+ let node_features = request_node_features ( parent, session_index, sender)
333
+ . await
334
+ . await
335
+ . map_err ( |err| RuntimeApiError :: Execution {
336
+ runtime_api_name : "NodeFeatures" ,
337
+ source : Arc :: new ( err) ,
338
+ } ) ??;
333
339
334
340
// Cache the fetched node features for future use.
335
341
self . node_features_cache . insert ( session_index, node_features. clone ( ) ) ;
@@ -387,11 +393,12 @@ impl PerSessionCache {
387
393
388
394
// Fetch the value from the runtime since it was not in the cache.
389
395
let minimum_backing_votes = request_min_backing_votes ( parent, session_index, sender)
396
+ . await
390
397
. await
391
398
. map_err ( |err| RuntimeApiError :: Execution {
392
399
runtime_api_name : "MinimumBackingVotes" ,
393
400
source : Arc :: new ( err) ,
394
- } ) ?;
401
+ } ) ?? ;
395
402
396
403
// Cache the fetched value for future use.
397
404
self . minimum_backing_votes_cache . insert ( session_index, minimum_backing_votes) ;
@@ -1151,8 +1158,8 @@ async fn construct_per_relay_parent_state<Context>(
1151
1158
let validators = per_session_cache. validators ( session_index, parent, ctx. sender ( ) ) . await ;
1152
1159
let validators = try_runtime_api ! ( validators) ;
1153
1160
1154
- let node_features =
1155
- per_session_cache . node_features ( session_index , parent , ctx . sender ( ) ) . await ? ;
1161
+ let node_features = per_session_cache . node_features ( session_index , parent , ctx . sender ( ) ) . await ;
1162
+ let node_features = try_runtime_api ! ( node_features ) ;
1156
1163
1157
1164
let inject_core_index = node_features
1158
1165
. get ( FeatureIndex :: ElasticScalingMVP as usize )
0 commit comments