Skip to content
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions cumulus/client/consensus/aura/src/collator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ use cumulus_client_consensus_common::{
self as consensus_common, ParachainBlockImportMarker, ParachainCandidate,
};
use cumulus_client_consensus_proposer::ProposerInterface;
use cumulus_client_parachain_inherent::{ParachainInherentData, ParachainInherentDataProvider};
use cumulus_client_parachain_inherent::{ParachainInherentDataProvider, RawParachainInherentData};
use cumulus_primitives_core::{
relay_chain::Hash as PHash, DigestItem, ParachainBlockData, PersistedValidationData,
};
Expand Down Expand Up @@ -128,7 +128,7 @@ where
parent_hash: Block::Hash,
timestamp: impl Into<Option<Timestamp>>,
relay_parent_descendants: Option<RelayParentData>,
) -> Result<(ParachainInherentData, InherentData), Box<dyn Error + Send + Sync + 'static>> {
) -> Result<(RawParachainInherentData, InherentData), Box<dyn Error + Send + Sync + 'static>> {
let paras_inherent_data = ParachainInherentDataProvider::create_at(
relay_parent,
&self.relay_client,
Expand Down Expand Up @@ -172,7 +172,7 @@ where
validation_data: &PersistedValidationData,
parent_hash: Block::Hash,
timestamp: impl Into<Option<Timestamp>>,
) -> Result<(ParachainInherentData, InherentData), Box<dyn Error + Send + Sync + 'static>> {
) -> Result<(RawParachainInherentData, InherentData), Box<dyn Error + Send + Sync + 'static>> {
self.create_inherent_data_with_rp_offset(
relay_parent,
validation_data,
Expand All @@ -189,7 +189,7 @@ where
parent_header: &Block::Header,
slot_claim: &SlotClaim<P::Public>,
additional_pre_digest: impl Into<Option<Vec<DigestItem>>>,
inherent_data: (ParachainInherentData, InherentData),
inherent_data: (RawParachainInherentData, InherentData),
proposal_duration: Duration,
max_pov_size: usize,
) -> Result<Option<ParachainCandidate<Block>>, Box<dyn Error + Send + 'static>> {
Expand Down Expand Up @@ -252,7 +252,7 @@ where
parent_header: &Block::Header,
slot_claim: &SlotClaim<P::Public>,
additional_pre_digest: impl Into<Option<Vec<DigestItem>>>,
inherent_data: (ParachainInherentData, InherentData),
inherent_data: (RawParachainInherentData, InherentData),
proposal_duration: Duration,
max_pov_size: usize,
) -> Result<Option<(Collation, ParachainBlockData<Block>)>, Box<dyn Error + Send + 'static>> {
Expand Down
6 changes: 3 additions & 3 deletions cumulus/client/consensus/proposer/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ use sp_inherents::{InherentData, InherentDataProvider};
use sp_runtime::{traits::Block as BlockT, Digest};
use sp_state_machine::StorageProof;

use cumulus_primitives_parachain_inherent::ParachainInherentData;
use cumulus_primitives_parachain_inherent::RawParachainInherentData;
use std::{fmt::Debug, time::Duration};

/// Errors that can occur when proposing a parachain block.
Expand Down Expand Up @@ -72,7 +72,7 @@ pub trait ProposerInterface<Block: BlockT> {
async fn propose(
&mut self,
parent_header: &Block::Header,
paras_inherent_data: &ParachainInherentData,
paras_inherent_data: &RawParachainInherentData,
other_inherent_data: InherentData,
inherent_digests: Digest,
max_duration: Duration,
Expand Down Expand Up @@ -105,7 +105,7 @@ where
async fn propose(
&mut self,
parent_header: &B::Header,
paras_inherent_data: &ParachainInherentData,
paras_inherent_data: &RawParachainInherentData,
other_inherent_data: InherentData,
inherent_digests: Digest,
max_duration: Duration,
Expand Down
10 changes: 6 additions & 4 deletions cumulus/client/parachain-inherent/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ use cumulus_relay_chain_interface::RelayChainInterface;
mod mock;

use cumulus_primitives_core::relay_chain::Header as RelayHeader;
pub use cumulus_primitives_parachain_inherent::{ParachainInherentData, INHERENT_IDENTIFIER};
pub use cumulus_primitives_parachain_inherent::{
InboundMessagesData, ParachainInherentData, RawParachainInherentData, INHERENT_IDENTIFIER,
};
pub use mock::{MockValidationDataInherentDataProvider, MockXcmConfig};

const LOG_TARGET: &str = "parachain-inherent";
Expand Down Expand Up @@ -150,7 +152,7 @@ async fn collect_relay_storage_proof(
pub struct ParachainInherentDataProvider;

impl ParachainInherentDataProvider {
/// Create the [`ParachainInherentData`] at the given `relay_parent`.
/// Create the [`RawParachainInherentData`] at the given `relay_parent`.
///
/// Returns `None` if the creation failed.
pub async fn create_at(
Expand All @@ -159,7 +161,7 @@ impl ParachainInherentDataProvider {
validation_data: &PersistedValidationData,
para_id: ParaId,
relay_parent_descendants: Vec<RelayHeader>,
) -> Option<ParachainInherentData> {
) -> Option<RawParachainInherentData> {
// Only include next epoch authorities when the descendants include an epoch digest.
// Skip the first entry because this is the relay parent itself.
let include_next_authorities = relay_parent_descendants.iter().skip(1).any(|header| {
Expand Down Expand Up @@ -202,7 +204,7 @@ impl ParachainInherentDataProvider {
})
.ok()?;

Some(ParachainInherentData {
Some(RawParachainInherentData {
downward_messages,
horizontal_messages,
validation_data: validation_data.clone(),
Expand Down
4 changes: 2 additions & 2 deletions cumulus/client/parachain-inherent/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

use crate::ParachainInherentData;
use crate::RawParachainInherentData;
use codec::Decode;
use cumulus_primitives_core::{
relay_chain,
Expand Down Expand Up @@ -230,7 +230,7 @@ impl<R: Send + Sync + GenerateRandomness<u64>> InherentDataProvider
sproof_builder.included_para_head = self.current_para_block_head.clone();

let (relay_parent_storage_root, proof) = sproof_builder.into_state_root_and_proof();
let parachain_inherent_data = ParachainInherentData {
let parachain_inherent_data = RawParachainInherentData {
validation_data: PersistedValidationData {
parent_head: Default::default(),
relay_parent_storage_root,
Expand Down
8 changes: 6 additions & 2 deletions cumulus/pallets/parachain-system/src/benchmarking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
#![cfg(feature = "runtime-benchmarks")]

use super::*;
use cumulus_primitives_core::relay_chain::Hash as RelayHash;
use cumulus_primitives_core::{relay_chain::Hash as RelayHash, InboundDownwardMessage};
use cumulus_primitives_parachain_inherent::InboundDownwardMessages;
use frame_benchmarking::v2::*;
use sp_runtime::traits::BlakeTwo256;

Expand All @@ -43,7 +44,10 @@ mod benchmarks {

#[block]
{
Pallet::<T>::enqueue_inbound_downward_messages(head, msgs);
Pallet::<T>::enqueue_inbound_downward_messages(
head,
InboundDownwardMessages::new(msgs).into_abridged(&mut usize::MAX.clone()),
);
}

assert_eq!(ProcessedDownwardMessages::<T>::get(), n);
Expand Down
Loading
Loading