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 #2339 #2340

Merged
merged 4 commits into from
Jun 7, 2022
Merged

Fix #2339 #2340

merged 4 commits into from
Jun 7, 2022

Conversation

tomaka
Copy link
Contributor

@tomaka tomaka commented Jun 6, 2022

Fix #2339

It turns out that finish panics if the data is incomplete (https://docs.rs/nom/latest/nom/trait.Finish.html#tymethod.finish)
In order to fix that, I've added the complete combinator everywhere we use finish, making sure that Incomplete errors are turned into actual errors.

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 Jun 6, 2022

twiggy diff report

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


 Delta Bytes │ Item
─────────────┼────────────────────────────────────────────────────────────────────────────────────
        -252 ┊ nom::combinator::all_consuming::{{closure}}::hd3f2b064b5b0d6ee
        +252 ┊ nom::combinator::all_consuming::{{closure}}::hd7c13bd363bcbf45
        +170 ┊ <F as nom::internal::Parser<I,O,E>>::parse::h3dca017422294030
        +170 ┊ <F as nom::internal::Parser<I,O,E>>::parse::h947a6e68ce85b59f
        +170 ┊ <F as nom::internal::Parser<I,O,E>>::parse::h9f3d4cc9466ee4f2
        +170 ┊ <F as nom::internal::Parser<I,O,E>>::parse::hd951bf5e90cb34f8
        +164 ┊ <F as nom::internal::Parser<I,O,E>>::parse::hbe61107644899e2c
        +152 ┊ <F as nom::internal::Parser<I,O,E>>::parse::h6e5d3a3b85fabf1f
        +140 ┊ <F as nom::internal::Parser<I,O,E>>::parse::h7b63671bc8506863
        +138 ┊ <F as nom::internal::Parser<I,O,E>>::parse::hc94cbf5ec387739e
        +138 ┊ <F as nom::internal::Parser<I,O,E>>::parse::hd7e1fb02d8051a3e
        +116 ┊ <F as nom::internal::Parser<I,O,E>>::parse::hf0b290640b33fdf5
         -14 ┊ smoldot::network::protocol::grandpa::decode_grandpa_notification::h993ba70db16e8297
       +2464 ┊ Σ [13 Total Rows]

@tomaka tomaka mentioned this pull request Jun 6, 2022
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 Jun 7, 2022
@mergify mergify bot merged commit 57d4c65 into paritytech:main Jun 7, 2022
@tomaka tomaka deleted the finish-panics branch June 7, 2022 08:30
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.

Panic in decode_block_request
2 participants