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

General clean-up of the single stream connections code #2708

Merged
merged 25 commits into from
Sep 6, 2022

Conversation

tomaka
Copy link
Contributor

@tomaka tomaka commented Sep 1, 2022

This PR is a general clean-up of the single stream connection code. It fixes many small issues, and also handles the shutdown phase more properly.
We now properly handle incoming GoAway frames, and have the possibility to send some.

Can be reviewed commit by commit.
I understand that this code is generally extremely complicated, but I don't really have a good solution for this. Networking code is extremely complicated, both in terms of logic and implementation.
Maybe a solution is tests, such as #2323, but at the moment the code isn't even robust enough to have tests.

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 1, 2022

twiggy diff report

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


 Delta Bytes │ Item
─────────────┼────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
       +3293 ┊ smoldot::libp2p::connection::yamux::Yamux<T>::incoming_data::h432ddb31867d1fee
       +3229 ┊ smoldot::libp2p::connection::established::single_stream::SingleStream<TNow,TRqUd,TNotifUd>::read_write::h8bc962f1048ef9a9
       -2730 ┊ smoldot::libp2p::connection::established::single_stream::SingleStream<TNow,TRqUd,TNotifUd>::read_write::h4b1d75277ce755e1
       -2406 ┊ smoldot::libp2p::connection::yamux::Yamux<T>::incoming_data::hc1836819eeefbb99
       -1563 ┊ smoldot::libp2p::connection::established::single_stream::SingleStream<TNow,TRqUd,TNotifUd>::process_substream::h5f516992aa8a0a17
       +1554 ┊ smoldot::libp2p::connection::established::single_stream::SingleStream<TNow,TRqUd,TNotifUd>::process_substream::h1e796161cd63010f
        -530 ┊ smoldot::libp2p::connection::established::single_stream::SingleStream<TNow,TRqUd,TNotifUd>::pass_through_substream_event::hc43f42015d980d3f
        +528 ┊ smoldot::libp2p::connection::established::single_stream::SingleStream<TNow,TRqUd,TNotifUd>::pass_through_substream_event::hd7154870b9c37e2b
        -522 ┊ <core::iter::adapters::chain::Chain<A,B> as core::iter::traits::iterator::Iterator>::next::h50bfef632128dec7
        +522 ┊ <core::iter::adapters::chain::Chain<A,B> as core::iter::traits::iterator::Iterator>::next::h6193fd0dcdf3312d
        +477 ┊ smoldot::libp2p::connection::yamux::Yamux<T>::open_substream::hcba77af0193c9e3a
        +459 ┊ smoldot::libp2p::connection::yamux::Yamux<T>::queue_data_frame_header::h67ccb95347510e80
        -438 ┊ smoldot::libp2p::connection::yamux::Yamux<T>::accept_pending_substream::hf251be31074226e5
        +436 ┊ smoldot::libp2p::connection::yamux::Yamux<T>::accept_pending_substream::h3f3f4be70ece2aee
        -430 ┊ smoldot::libp2p::connection::yamux::Yamux<T>::open_substream::ha9ae355068a4b7cb
        +424 ┊ smoldot::libp2p::connection::yamux::Yamux<T>::queue_window_size_frame_header::he9f07d66b1a928cc
        -413 ┊ smoldot::libp2p::connection::yamux::Yamux<T>::queue_data_frame_header::h865540b3b0c3c286
        +405 ┊ smoldot::libp2p::connection::yamux::ExtractOut<T>::next::ha5720afe78453ceb
        -386 ┊ smoldot::libp2p::connection::established::single_stream::SingleStream<TNow,TRqUd,TNotifUd>::update_all::h5a98aac5e74ec89c
        -385 ┊ smoldot::libp2p::connection::yamux::Yamux<T>::next_dead_substream::hd1577e5cd7f201c3
        +267 ┊ ... and 85 more.
       +1520 ┊ Σ [105 Total Rows]

Copy link
Contributor

@melekes melekes left a comment

Choose a reason for hiding this comment

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

👍

@tomaka tomaka added the automerge Automatically merge pull request as soon as possible label Sep 6, 2022
@mergify mergify bot merged commit 5e3e724 into paritytech:main Sep 6, 2022
@tomaka tomaka deleted the single-stream-improve branch September 6, 2022 09:06
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.

2 participants