mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 11:41:04 +00:00
Implement HRMP (#1900)
* HRMP: Update the impl guide * HRMP: Incorporate the channel notifications into the guide * HRMP: Renaming in the impl guide * HRMP: Constrain the maximum number of HRMP messages per candidate This commit addresses the HRMP part of https://github.com/paritytech/polkadot/issues/1869 * XCM: Introduce HRMP related message types * HRMP: Data structures and plumbing * HRMP: Configuration * HRMP: Data layout * HRMP: Acceptance & Enactment * HRMP: Test base logic * Update adder collator * HRMP: Runtime API for accessing inbound messages Also, removing some redundant fully-qualified names. * HRMP: Add diagnostic logging in acceptance criteria * HRMP: Additional tests * Self-review fixes * save test refactorings for the next time * Missed a return statement. * a formatting blip * Add missing logic for appending HRMP digests * Remove the channel contents vectors which became empty * Tighten HRMP channel digests invariants. * Apply suggestions from code review Co-authored-by: Peter Goodspeed-Niklaus <coriolinus@users.noreply.github.com> * Remove a note about sorting for channel id * Add missing rustdocs to the configuration * Clarify and update the invariant for HrmpChannelDigests * Make the onboarding invariant less sloppy Namely, introduce `Paras::is_valid_para` (in fact, it already is present in the implementation) and hook up the invariant to that. Note that this says "within a session" because I don't want to make it super strict on the session boundary. The logic on the session boundary should be extremely careful. * Make `CandidateCheckContext` use T::BlockNumber for hrmp_watermark Co-authored-by: Peter Goodspeed-Niklaus <coriolinus@users.noreply.github.com>
This commit is contained in:
@@ -22,12 +22,13 @@
|
||||
|
||||
use pallet_transaction_payment::CurrencyAdapter;
|
||||
use sp_std::prelude::*;
|
||||
use sp_std::collections::btree_map::BTreeMap;
|
||||
use codec::Encode;
|
||||
use primitives::v1::{
|
||||
AccountId, AccountIndex, Balance, BlockNumber, Hash, Nonce, Signature, Moment,
|
||||
GroupRotationInfo, CoreState, Id, ValidationData, ValidationCode, CandidateEvent,
|
||||
ValidatorId, ValidatorIndex, CommittedCandidateReceipt, OccupiedCoreAssumption,
|
||||
PersistedValidationData,
|
||||
PersistedValidationData, InboundDownwardMessage, InboundHrmpMessage,
|
||||
};
|
||||
use runtime_common::{
|
||||
SlowAdjustingFeeUpdate,
|
||||
@@ -532,6 +533,7 @@ impl parachains_paras::Trait for Runtime {
|
||||
}
|
||||
|
||||
impl parachains_router::Trait for Runtime {
|
||||
type Origin = Origin;
|
||||
type UmpSink = (); // TODO: #1873 To be handled by the XCM receiver.
|
||||
}
|
||||
|
||||
@@ -681,9 +683,15 @@ sp_api::impl_runtime_apis! {
|
||||
runtime_api_impl::validator_discovery::<Runtime>(validators)
|
||||
}
|
||||
|
||||
fn dmq_contents(recipient: Id) -> Vec<primitives::v1::InboundDownwardMessage<BlockNumber>> {
|
||||
fn dmq_contents(recipient: Id) -> Vec<InboundDownwardMessage<BlockNumber>> {
|
||||
runtime_api_impl::dmq_contents::<Runtime>(recipient)
|
||||
}
|
||||
|
||||
fn inbound_hrmp_channels_contents(
|
||||
recipient: Id
|
||||
) -> BTreeMap<Id, Vec<InboundHrmpMessage<BlockNumber>>> {
|
||||
runtime_api_impl::inbound_hrmp_channels_contents::<Runtime>(recipient)
|
||||
}
|
||||
}
|
||||
|
||||
impl fg_primitives::GrandpaApi<Block> for Runtime {
|
||||
|
||||
Reference in New Issue
Block a user