Skip to content

build(deps): Bump rand to 0.8 and quickcheck to 1#2857

Merged
thomaseizinger merged 37 commits intolibp2p:masterfrom
kpp:rand08
Sep 22, 2022
Merged

build(deps): Bump rand to 0.8 and quickcheck to 1#2857
thomaseizinger merged 37 commits intolibp2p:masterfrom
kpp:rand08

Conversation

@kpp
Copy link
Copy Markdown
Contributor

@kpp kpp commented Aug 30, 2022

Fixes #2847
Fixes #2732

It would be nice if you can help me with or at least give an advise:

  • Some tests fail
  • I didn't implement my own gen_range but used modulus instead
  • There is a lot of leaky abstractions of rand in kad

@kpp kpp marked this pull request as draft August 30, 2022 14:38
@kpp kpp changed the title Upgrade rand to 0.8 Upgrade rand to 0.8, quickcheck to 1 Aug 30, 2022
@kpp kpp marked this pull request as ready for review August 31, 2022 12:08
Copy link
Copy Markdown
Contributor

@thomaseizinger thomaseizinger left a comment

Choose a reason for hiding this comment

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

Thank you! This is something that has been overdue for a while!

@kpp
Copy link
Copy Markdown
Contributor Author

kpp commented Sep 2, 2022

Ready for review! @thomaseizinger thank you for helping me with this.

Copy link
Copy Markdown
Contributor

@thomaseizinger thomaseizinger left a comment

Choose a reason for hiding this comment

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

Thank you for pushing this forward!

@kpp
Copy link
Copy Markdown
Contributor Author

kpp commented Sep 6, 2022

So I added an implementation of gen_range, however it is too generic and <T> sometimes is treated as integer which is then substituted as i32, so I have to fix T with something like:

-            match g.gen_range(0..5) {
+            match g.gen_range(0..5u8) {
                 0 => Message::Header(HeaderLine::V1),
                 1 => Message::NotAvailable,
                 2 => Message::ListProtocols,

I added a T: Unsigned bound to catch this kind of errors at compile time.

@kpp
Copy link
Copy Markdown
Contributor Author

kpp commented Sep 6, 2022

Also this is a very strange failed test https://github.com/libp2p/rust-libp2p/runs/8207467155?check_suite_focus=true, issued in #2874.

@kpp kpp requested a review from thomaseizinger September 6, 2022 14:01
Copy link
Copy Markdown
Contributor

@thomaseizinger thomaseizinger left a comment

Choose a reason for hiding this comment

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

LGTM!

@mxinden Can you have a look at this too?

@thomaseizinger thomaseizinger changed the title Upgrade rand to 0.8, quickcheck to 1 build(deps): Upgrade rand to 0.8 and quickcheck to 1 Sep 8, 2022
@thomaseizinger thomaseizinger changed the title build(deps): Upgrade rand to 0.8 and quickcheck to 1 build(deps): Bump rand to 0.8 and quickcheck to 1 Sep 8, 2022
@thomaseizinger
Copy link
Copy Markdown
Contributor

Excuse the bad merge commit, I've fixed the build error in 25f87c5.

Copy link
Copy Markdown
Member

@mxinden mxinden left a comment

Choose a reason for hiding this comment

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

Solid work. Thanks @kpp for solving this long standing issue in such a clean way.

@kpp
Copy link
Copy Markdown
Contributor Author

kpp commented Sep 12, 2022

@mxinden I bumped the versions of crates and added CHANGELOG entries. pnet changelog should reflect the date of publishing.

Copy link
Copy Markdown
Member

@mxinden mxinden left a comment

Choose a reason for hiding this comment

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

Thanks for the follow ups. Still a couple of comments. Keeping the libp2p-kad tests deterministic would ease debugging in the future by a lot.

@kpp
Copy link
Copy Markdown
Contributor Author

kpp commented Sep 15, 2022

@mxinden I made kad tests deterministic.

Copy link
Copy Markdown
Contributor

@thomaseizinger thomaseizinger left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Copy Markdown
Contributor

@thomaseizinger thomaseizinger left a comment

Choose a reason for hiding this comment

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

This is good to merge from my side. Thank you @kpp!

I think the only open point is #2857 (comment), plus there is now a merge conflict with master.

@thomaseizinger
Copy link
Copy Markdown
Contributor

All comments are resolved and tests are passing. Going ahead with merging this. Interoperability tests fail because of libp2p/test-plans#41.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

rand:wasm-bindgen missing feature Consider replacing quickcheck with an alternative

3 participants