Skip to content

Commit 3ee35c8

Browse files
committed
wip
1 parent 1d1f852 commit 3ee35c8

File tree

4 files changed

+20
-4
lines changed

4 files changed

+20
-4
lines changed

cumulus/client/relay-chain-minimal-node/src/blockchain_rpc_client.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,13 @@ impl RuntimeApiSubsystemClient for BlockChainRpcClient {
338338
.await?)
339339
}
340340

341+
async fn disabled_validators(
342+
&self,
343+
at: Hash,
344+
) -> Result<Vec<polkadot_primitives::ValidatorIndex>, ApiError> {
345+
Ok(self.rpc_client.parachain_host_disabled_validators(at).await?)
346+
}
347+
341348
async fn staging_async_backing_params(&self, at: Hash) -> Result<AsyncBackingParams, ApiError> {
342349
Ok(self.rpc_client.parachain_host_staging_async_backing_params(at).await?)
343350
}

cumulus/client/relay-chain-rpc-interface/src/rpc_client.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -588,6 +588,14 @@ impl RelayChainRpcClient {
588588
.await
589589
}
590590

591+
pub async fn parachain_host_disabled_validators(
592+
&self,
593+
at: RelayHash,
594+
) -> Result<Vec<ValidatorIndex>, RelayChainError> {
595+
self.call_remote_runtime_function("ParachainHost_disabled_validators", at, None::<()>)
596+
.await
597+
}
598+
591599
#[allow(missing_docs)]
592600
pub async fn parachain_host_staging_async_backing_params(
593601
&self,

cumulus/parachains/integration-tests/emulated/common/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ pub use impls::{RococoWococoMessageHandler, WococoRococoMessageHandler};
1919
pub use parachains_common::{AccountId, Balance};
2020
pub use paste;
2121
use polkadot_parachain::primitives::HrmpChannelId;
22+
use polkadot_primitives::runtime_api::runtime_decl_for_parachain_host::ParachainHostV6;
2223
pub use polkadot_runtime_parachains::inclusion::{AggregateMessageOrigin, UmpQueueId};
2324
pub use sp_core::{sr25519, storage::Storage, Get};
2425
use sp_tracing;

polkadot/node/core/runtime-api/src/cache.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +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>>,
68+
disabled_validators: LruMap<Hash, Vec<ValidatorIndex>>,
6969

7070
staging_para_backing_state: LruMap<(Hash, ParaId), Option<vstaging::BackingState>>,
7171
staging_async_backing_params: LruMap<Hash, vstaging::AsyncBackingParams>,
@@ -98,7 +98,7 @@ impl Default for RequestResultCache {
9898
disputes: LruMap::new(ByLength::new(DEFAULT_CACHE_CAP)),
9999
unapplied_slashes: LruMap::new(ByLength::new(DEFAULT_CACHE_CAP)),
100100
key_ownership_proof: LruMap::new(ByLength::new(DEFAULT_CACHE_CAP)),
101-
disabled_validators: LruCache::new(DEFAULT_CACHE_CAP),
101+
disabled_validators: LruMap::new(ByLength::new(DEFAULT_CACHE_CAP)),
102102

103103
staging_para_backing_state: LruMap::new(ByLength::new(DEFAULT_CACHE_CAP)),
104104
staging_async_backing_params: LruMap::new(ByLength::new(DEFAULT_CACHE_CAP)),
@@ -440,15 +440,15 @@ impl RequestResultCache {
440440
&mut self,
441441
relay_parent: &Hash,
442442
) -> Option<&Vec<ValidatorIndex>> {
443-
self.disabled_validators.get(relay_parent)
443+
self.disabled_validators.get(relay_parent).map(|v| &*v)
444444
}
445445

446446
pub(crate) fn cache_disabled_validators(
447447
&mut self,
448448
relay_parent: Hash,
449449
disabled_validators: Vec<ValidatorIndex>,
450450
) {
451-
self.disabled_validators.put(relay_parent, disabled_validators);
451+
self.disabled_validators.insert(relay_parent, disabled_validators);
452452
}
453453

454454
pub(crate) fn staging_para_backing_state(

0 commit comments

Comments
 (0)