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

Don't stall syncing if gap is too large #2801

Merged
merged 5 commits into from
Oct 4, 2022
Merged

Conversation

tomaka
Copy link
Contributor

@tomaka tomaka commented Sep 29, 2022

cc #2793

After trying to analyze the problem, I've decided to leave it to future-me.
It is very complicated to determine which entries in the list of "blocks known by a source" should be kept and which can be thrown away. There are several other TODOs related to that in the code.

For now, this PR fixes the sync stalling.

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 Sep 29, 2022

twiggy diff report

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


 Delta Bytes │ Item
─────────────┼──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
        -568 ┊ smoldot::sync::all_forks::sources::AllForksSources<TSrc>::remove_known_block::h675080f2e1d47233
        -238 ┊ <alloc::vec::Vec<T> as alloc::vec::spec_from_iter_nested::SpecFromIterNested<T,I>>::from_iter::h3a1c23e25b4b37db
        -230 ┊ alloc::raw_vec::RawVec<T,A>::grow_amortized::h57c5ad59fe99ddd6
        -181 ┊ alloc::raw_vec::RawVec<T,A>::allocate_in::hdb59a704b8ae2af6
        -131 ┊ alloc::vec::Vec<T,A>::extend_desugared::h7a13f870f6e49acd
        -108 ┊ alloc::raw_vec::RawVec<T,A>::current_memory::hb8ff6a56806efb21
         -95 ┊ <alloc::vec::Vec<T,A> as alloc::vec::spec_extend::SpecExtend<T,I>>::spec_extend::h95bce498991f7a36
         -95 ┊ <alloc::vec::Vec<T> as alloc::vec::spec_from_iter::SpecFromIter<T,I>>::from_iter::h91341b1ae4e29986
         -78 ┊ <alloc::raw_vec::RawVec<T,A> as core::ops::drop::Drop>::drop::hbac2f1e1893f2d36
         -58 ┊ <<alloc::vec::into_iter::IntoIter<T,A> as core::ops::drop::Drop>::drop::DropGuard<T,A> as core::ops::drop::Drop>::drop::h5d4bbc79c69014d7
         -58 ┊ core::alloc::layout::Layout::array::h10c9b14e0d61b748
         -56 ┊ alloc::raw_vec::RawVec<T,A>::reserve::do_reserve_and_handle::h3ed58e84da2fdbe1
         -55 ┊ <core::iter::adapters::map::Map<I,F> as core::iter::traits::iterator::Iterator>::next::hf3329ffcaabaa5e5
         -52 ┊ <alloc::vec::into_iter::IntoIter<T,A> as core::ops::drop::Drop>::drop::h58a11575b847f5d0
         -39 ┊ alloc::vec::Vec<T,A>::reserve::h4e73390be96a90e1
         -16 ┊ smoldot::sync::all_forks::AddBlockVacant<TBl,TRq,TSrc>::insert::h7197847b81be47c2
         -16 ┊ smoldot::sync::all_forks::AnnouncedBlockUnknown<TBl,TRq,TSrc>::insert_and_update_source::h398f43956a0fcf66
       -3691 ┊ Σ [17 Total Rows]

@tomaka tomaka added the automerge Automatically merge pull request as soon as possible label Oct 4, 2022
@mergify mergify bot merged commit 9e4f257 into paritytech:main Oct 4, 2022
@tomaka tomaka deleted the fix-2793 branch October 4, 2022 08:44
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