This repository was archived by the owner on Nov 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
The Router Module #1679
Closed
Closed
The Router Module #1679
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
1d98c08
UMP: Update the impl guide
pepyakin 90e42ba
UMP: Incorporate XCM related changes into the guide
pepyakin 02ce8c6
UMP: Data structures and configuration
pepyakin e0f9af1
UMP: Initial plumbing
pepyakin e9dde74
UMP: Data layout
pepyakin c583a41
UMP: Acceptance criteria & enactment
pepyakin ea5d29c
UMP: Fix dispatcher bug and add the test for it
pepyakin 294b97e
UMP: Constrain the maximum size of an UMP message
pepyakin d1dbf72
Fix failing test due to misconfiguration
pepyakin 72654e8
Make the type of RelayDispatchQueueSize be more apparent in the guide
pepyakin d2d717c
parachain-primitives: Add an escape hatch for extracting the inner u32
pepyakin 1e7368e
HRMP: Update the impl guide
pepyakin 105255e
HRMP: Incorporate the channel notifications into the guide
pepyakin 2569644
HRMP: Renaming in the impl guide
pepyakin 687ee7c
HRMP: Constrain the maximum number of HRMP messages per candidate
pepyakin 8b23e80
XCM: Introduce HRMP related message types
pepyakin ca23156
HRMP: Data structures and plumbing
pepyakin 423cea6
HRMP: Configuration
pepyakin 52ee2a7
HRMP: Data layout
pepyakin 8ff407e
HRMP: Acceptance & Enactment
pepyakin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
UMP: Initial plumbing
- Loading branch information
commit e0f9af1671a1bcb2b84bc74184ed9e4610e7cfe6
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
| // Copyright 2020 Parity Technologies (UK) Ltd. | ||
| // This file is part of Polkadot. | ||
|
|
||
| // Polkadot is free software: you can redistribute it and/or modify | ||
| // it under the terms of the GNU General Public License as published by | ||
| // the Free Software Foundation, either version 3 of the License, or | ||
| // (at your option) any later version. | ||
|
|
||
| // Polkadot is distributed in the hope that it will be useful, | ||
| // but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| // GNU General Public License for more details. | ||
|
|
||
| // You should have received a copy of the GNU General Public License | ||
| // along with Polkadot. If not, see <http://www.gnu.org/licenses/>. | ||
|
|
||
| use super::{Trait, Module}; | ||
| use crate::configuration::HostConfiguration; | ||
| use sp_std::prelude::*; | ||
| use frame_support::weights::Weight; | ||
| use primitives::v1::{Id as ParaId, UpwardMessage}; | ||
|
|
||
| impl<T: Trait> Module<T> { | ||
| /// Check that all the upward messages sent by a candidate pass the acceptance criteria. Returns | ||
| /// false, if any of the messages doesn't pass. | ||
| pub(crate) fn check_upward_messages( | ||
| config: &HostConfiguration<T::BlockNumber>, | ||
| para: ParaId, | ||
| upward_messages: &[UpwardMessage], | ||
| ) -> bool { | ||
| drop(para); | ||
coriolinus marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| if upward_messages.len() as u32 > config.max_upward_message_num_per_candidate { | ||
| return false; | ||
| } | ||
|
|
||
| for _ in upward_messages { | ||
| return false; | ||
| } | ||
|
|
||
| true | ||
| } | ||
|
|
||
| /// Enacts all the upward messages sent by a candidate. | ||
| pub(crate) fn enact_upward_messages(para: ParaId, upward_messages: Vec<UpwardMessage>) -> Weight { | ||
| drop(para); | ||
|
|
||
| for _ in upward_messages { | ||
| todo!() | ||
| } | ||
|
|
||
| 0 | ||
| } | ||
|
|
||
| /// Devote some time into dispatching pending upward messages. | ||
| pub(crate) fn process_pending_upward_messages() { | ||
| // no-op for now, will be filled in the following commits | ||
| } | ||
| } | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.