Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix wrong order of parachain blocks at initialization #2965

Merged
merged 3 commits into from
Nov 4, 2022

Conversation

tomaka
Copy link
Contributor

@tomaka tomaka commented Nov 2, 2022

When we subscribe to parachain blocks, the subscription confirmation contains the list of all blocks that already exist. This list of blocks needs to be ordered from parent to child, and the field is actually named non_finalized_blocks_ancestry_order ("ancestry order") in order for everyone to get the memo.

Unfortunately, the author of the parachains code (me) didn't get the memo, and the parachain blocks aren't properly ordered.
This leads to a panic in runtime_service.rs because it assumes that the ordering is correct.

Copy link
Contributor

@mergify mergify bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automatically approving tomaka's pull requests. This auto-approval will be removed once more maintainers are active.

@github-actions
Copy link
Contributor

github-actions bot commented Nov 2, 2022

twiggy diff report

Difference in .wasm size before and after this pull request.


 Delta Bytes │ Item
─────────────┼─────────────────────────────────────────────────────────────────────────────────────────────────────────────────
        -963 ┊ hashbrown::raw::RawTable<T,A>::reserve_rehash::hae6d9bba2cebb72a
        -373 ┊ <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll::h7e76bd2e9b10b361
        +285 ┊ <core::iter::adapters::map::Map<I,F> as core::iter::traits::iterator::Iterator>::fold::hbe97d819d80395f5
        +270 ┊ <alloc::vec::Vec<T> as alloc::vec::spec_from_iter_nested::SpecFromIterNested<T,I>>::from_iter::h26d3312a567c4e2c
        -270 ┊ <alloc::vec::Vec<T> as alloc::vec::spec_from_iter_nested::SpecFromIterNested<T,I>>::from_iter::hfdacbb2b2e07eb36
        -244 ┊ <alloc::vec::Vec<T> as alloc::vec::spec_from_iter_nested::SpecFromIterNested<T,I>>::from_iter::he32ea814f6c1e49c
        +241 ┊ core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &mut F>::call_once::hf3e93dc6e60df506
        -241 ┊ core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &mut F>::call_once::hf7d80057d8cf6f1c
        +234 ┊ alloc::raw_vec::RawVec<T,A>::grow_amortized::h72e6f13d1a7f7fd5
        -233 ┊ <alloc::vec::Vec<T> as alloc::vec::spec_from_iter_nested::SpecFromIterNested<T,I>>::from_iter::h32012c119fc87478
        +233 ┊ <alloc::vec::Vec<T> as alloc::vec::spec_from_iter_nested::SpecFromIterNested<T,I>>::from_iter::h5e869a52455210d6
        +223 ┊ <alloc::vec::Vec<T> as alloc::vec::spec_from_iter_nested::SpecFromIterNested<T,I>>::from_iter::h2c59176d86cf3e4c
        -223 ┊ <alloc::vec::Vec<T> as alloc::vec::spec_from_iter_nested::SpecFromIterNested<T,I>>::from_iter::h425e5595a195e292
        -216 ┊ <hashbrown::raw::RawIter<T> as core::iter::traits::iterator::Iterator>::next::hc874a5afa85369ea
        +191 ┊ alloc::raw_vec::RawVec<T,A>::allocate_in::hd0c90a36a1a0765f
        -167 ┊ hashbrown::raw::RawTable<T,A>::fallible_with_capacity::h45879e1e2f1af6fc
        +163 ┊ alloc::vec::Vec<T,A>::extend_desugared::h42d44cc515debfab
        -163 ┊ alloc::vec::Vec<T,A>::extend_desugared::he3dbc3a1c5f84cba
        -160 ┊ alloc::vec::Vec<T,A>::extend_desugared::hc09e53178f377e06
        -151 ┊ <core::iter::adapters::map::Map<I,F> as core::iter::traits::iterator::Iterator>::next::hd9f66d08ada6d19f
        +557 ┊ ... and 57 more.
       -1316 ┊ Σ [77 Total Rows]

@tomaka tomaka added the automerge Automatically merge pull request as soon as possible label Nov 4, 2022
@mergify mergify bot merged commit 77fc2e5 into paritytech:main Nov 4, 2022
@tomaka tomaka deleted the para-correct-order branch November 5, 2022 12:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge Automatically merge pull request as soon as possible
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant