mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-15 19:41:05 +00:00
Use a BoundedVec in ValidationResult (#6603)
* Use a `BoundedVec` in `ValidationResult` > Use a `BoundedVec` for `upward_messages` and `horizontal_messages` in order to > limit the number of individual messages/memory allocations right at decoding > time. The reason for this is that the `ValidationResult` may contain a code > upgrade (including a full PVF binary), so the total size limit can't be set > too low and this limit will still allow several millions of upward messages, > which will (due to the memory allocator overhead) already have a > non-negligible memory footprint in decoded form. * List all fields when hashing so we don't miss one * Define types for `BoundedVec`s of messages * Fix test compile errors * Depend on `bounded-collections` 0.1.4 (fixes allocation issue) * Fix compilation issue * Derive `Hash` instead of manual `impl` * Avoid use of unwrap
This commit is contained in:
@@ -43,8 +43,8 @@ pub use polkadot_core_primitives::v2::{
|
||||
|
||||
// Export some polkadot-parachain primitives
|
||||
pub use polkadot_parachain::primitives::{
|
||||
HeadData, HrmpChannelId, Id, UpwardMessage, ValidationCode, ValidationCodeHash,
|
||||
LOWEST_PUBLIC_ID, LOWEST_USER_ID,
|
||||
HeadData, HorizontalMessages, HrmpChannelId, Id, UpwardMessage, UpwardMessages, ValidationCode,
|
||||
ValidationCodeHash, LOWEST_PUBLIC_ID, LOWEST_USER_ID,
|
||||
};
|
||||
|
||||
#[cfg(feature = "std")]
|
||||
@@ -593,12 +593,12 @@ impl<H: Encode, N: Encode> PersistedValidationData<H, N> {
|
||||
|
||||
/// Commitments made in a `CandidateReceipt`. Many of these are outputs of validation.
|
||||
#[derive(PartialEq, Eq, Clone, Encode, Decode, TypeInfo, RuntimeDebug)]
|
||||
#[cfg_attr(feature = "std", derive(Hash, Default))]
|
||||
#[cfg_attr(feature = "std", derive(Default, Hash))]
|
||||
pub struct CandidateCommitments<N = BlockNumber> {
|
||||
/// Messages destined to be interpreted by the Relay chain itself.
|
||||
pub upward_messages: Vec<UpwardMessage>,
|
||||
pub upward_messages: UpwardMessages,
|
||||
/// Horizontal messages sent by the parachain.
|
||||
pub horizontal_messages: Vec<OutboundHrmpMessage<Id>>,
|
||||
pub horizontal_messages: HorizontalMessages,
|
||||
/// New validation code.
|
||||
pub new_validation_code: Option<ValidationCode>,
|
||||
/// The head-data produced as a result of execution.
|
||||
|
||||
Reference in New Issue
Block a user