@@ -65,6 +65,7 @@ pub(crate) struct RequestResultCache {
6565 LruMap < Hash , Vec < ( SessionIndex , CandidateHash , vstaging:: slashing:: PendingSlashes ) > > ,
6666 key_ownership_proof :
6767 LruMap < ( Hash , ValidatorId ) , Option < vstaging:: slashing:: OpaqueKeyOwnershipProof > > ,
68+ disabled_validators : LruCache < Hash , Vec < ValidatorIndex > > ,
6869
6970 staging_para_backing_state : LruMap < ( Hash , ParaId ) , Option < vstaging:: BackingState > > ,
7071 staging_async_backing_params : LruMap < Hash , vstaging:: AsyncBackingParams > ,
@@ -97,6 +98,7 @@ impl Default for RequestResultCache {
9798 disputes : LruMap :: new ( ByLength :: new ( DEFAULT_CACHE_CAP ) ) ,
9899 unapplied_slashes : LruMap :: new ( ByLength :: new ( DEFAULT_CACHE_CAP ) ) ,
99100 key_ownership_proof : LruMap :: new ( ByLength :: new ( DEFAULT_CACHE_CAP ) ) ,
101+ disabled_validators : LruCache :: new ( DEFAULT_CACHE_CAP ) ,
100102
101103 staging_para_backing_state : LruMap :: new ( ByLength :: new ( DEFAULT_CACHE_CAP ) ) ,
102104 staging_async_backing_params : LruMap :: new ( ByLength :: new ( DEFAULT_CACHE_CAP ) ) ,
@@ -434,6 +436,21 @@ impl RequestResultCache {
434436 None
435437 }
436438
439+ pub ( crate ) fn disabled_validators (
440+ & mut self ,
441+ relay_parent : & Hash ,
442+ ) -> Option < & Vec < ValidatorIndex > > {
443+ self . disabled_validators . get ( relay_parent)
444+ }
445+
446+ pub ( crate ) fn cache_disabled_validators (
447+ & mut self ,
448+ relay_parent : Hash ,
449+ disabled_validators : Vec < ValidatorIndex > ,
450+ ) {
451+ self . disabled_validators . put ( relay_parent, disabled_validators) ;
452+ }
453+
437454 pub ( crate ) fn staging_para_backing_state (
438455 & mut self ,
439456 key : ( Hash , ParaId ) ,
@@ -509,6 +526,7 @@ pub(crate) enum RequestResult {
509526 vstaging:: slashing:: OpaqueKeyOwnershipProof ,
510527 Option < ( ) > ,
511528 ) ,
529+ DisabledValidators ( Hash , Vec < ValidatorIndex > ) ,
512530
513531 StagingParaBackingState ( Hash , ParaId , Option < vstaging:: BackingState > ) ,
514532 StagingAsyncBackingParams ( Hash , vstaging:: AsyncBackingParams ) ,
0 commit comments