mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-07-21 14:25:41 +00:00
Check that the validation code matches the parachain code (#3433)
This introduces a check to ensure that the parachain code matches the validation code stored in the relay chain state. If not, it will print a warning. This should be mainly useful for parachain builders to make sure they have setup everything correctly.
This commit is contained in:
@@ -19,7 +19,7 @@ use core::time::Duration;
|
||||
use cumulus_primitives_core::{
|
||||
relay_chain::{
|
||||
CommittedCandidateReceipt, Hash as RelayHash, Header as RelayHeader, InboundHrmpMessage,
|
||||
OccupiedCoreAssumption, SessionIndex, ValidatorId,
|
||||
OccupiedCoreAssumption, SessionIndex, ValidationCodeHash, ValidatorId,
|
||||
},
|
||||
InboundDownwardMessage, ParaId, PersistedValidationData,
|
||||
};
|
||||
@@ -110,6 +110,17 @@ impl RelayChainInterface for RelayChainRpcInterface {
|
||||
.await
|
||||
}
|
||||
|
||||
async fn validation_code_hash(
|
||||
&self,
|
||||
hash: RelayHash,
|
||||
para_id: ParaId,
|
||||
occupied_core_assumption: OccupiedCoreAssumption,
|
||||
) -> RelayChainResult<Option<ValidationCodeHash>> {
|
||||
self.rpc_client
|
||||
.validation_code_hash(hash, para_id, occupied_core_assumption)
|
||||
.await
|
||||
}
|
||||
|
||||
async fn candidate_pending_availability(
|
||||
&self,
|
||||
hash: RelayHash,
|
||||
|
||||
@@ -647,6 +647,20 @@ impl RelayChainRpcClient {
|
||||
.await
|
||||
}
|
||||
|
||||
pub async fn validation_code_hash(
|
||||
&self,
|
||||
at: RelayHash,
|
||||
para_id: ParaId,
|
||||
occupied_core_assumption: OccupiedCoreAssumption,
|
||||
) -> Result<Option<ValidationCodeHash>, RelayChainError> {
|
||||
self.call_remote_runtime_function(
|
||||
"ParachainHost_validation_code_hash",
|
||||
at,
|
||||
Some((para_id, occupied_core_assumption)),
|
||||
)
|
||||
.await
|
||||
}
|
||||
|
||||
fn send_register_message_to_worker(
|
||||
&self,
|
||||
message: RpcDispatcherMessage,
|
||||
|
||||
Reference in New Issue
Block a user