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

Update Rust version #2576

Merged
merged 1 commit into from
Mar 4, 2024
Merged

Update Rust version #2576

merged 1 commit into from
Mar 4, 2024

Conversation

nazar-pc
Copy link
Member

@nazar-pc nazar-pc commented Feb 29, 2024

This updates Rust version and fixes a bunch of related lints (latest nightly REALLY doesn't like when the same type is imported more than once even indirectly).

This also fixes #2575 by simply commenting-out already ignored test block_building_storage_proof_does_not_include_runtime_by_default.

Latest nightly also changed some features that required bumping versions of a few crated and removing --locked from cargo-nextest because its latest release still relies on non-fixed versions of dependencies and the only way to get newer compatible ones is to ignore lock file for now.

In some places where the same type was imported more than once due to sp-std I have replaced sp-std with alloc completely. But there are still places where sp-std is used and I didn't want to do bigger refactoring/cleanup.

The changes in this PR are simple and mechanical, no logic changes anywhere.

Code contributor checklist:

Copy link
Member

@vedhavyas vedhavyas left a comment

Choose a reason for hiding this comment

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

Make sense overall.
Seems like there are unintentional white space additions and removals.

Also feels like its going to be chore to extern alloc and put it under a feature over sp_std since that just worked out of the box but I guess I'm being lazy here though

@@ -596,7 +598,7 @@ pub mod pallet {

/// Enable storage access for all users.
#[pallet::call_index(5)]
#[pallet::weight(<T as Config>::WeightInfo::enable_authoring_by_anyone())]
#[pallet::weight(< T as Config >::WeightInfo::enable_authoring_by_anyone())]
Copy link
Member

Choose a reason for hiding this comment

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

are whitespaces in this file expected or unintentional ?

Copy link
Member Author

Choose a reason for hiding this comment

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

This is what rustfmt does for me. Surely not intentional and I'm not happy with what it does actually. Does it not format the same way for you?

@@ -242,10 +246,10 @@ pub enum VerificationError<DomainHash> {
InitializeBlockOrApplyExtrinsicDecode(codec::Error),
/// Failed to decode the storage root produced by verifying `initialize_block` or `apply_extrinsic`.
#[cfg_attr(
feature = "thiserror",
Copy link
Member

Choose a reason for hiding this comment

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

I have the same issue with this missing white space when rust format removes them. I dont have a storng opinion either wway but having spaces is pleasing to look at though

Copy link
Member Author

Choose a reason for hiding this comment

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

I agree, let me know if you find the way to make rustfmt not do this anymore, very annoying

// #[derive(Debug, Clone, Copy)]
// pub(crate) struct GeneralConnectedPeersInstance;
// #[derive(Debug, Clone, Copy)]
// pub(crate) struct SpecialConnectedPeersInstance;
Copy link
Member

Choose a reason for hiding this comment

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

remove them instead ?

Copy link
Member Author

Choose a reason for hiding this comment

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

This is because there was other code commented-out below and this one was forgotten. I suggested @shamil-gadelshin to remove it from the beginning IIRC.

@@ -341,6 +341,7 @@ impl KnownPeersManager {
.read(true)
.write(true)
.create(true)
.truncate(false)
Copy link
Member

Choose a reason for hiding this comment

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

was this not a default before or are we being explicit here ?

Copy link
Member Author

Choose a reason for hiding this comment

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

Base automatically changed from fix-farmer-piece-getter to main March 1, 2024 07:25
@nazar-pc nazar-pc requested a review from vedhavyas March 1, 2024 10:18
Copy link
Member

@vedhavyas vedhavyas left a comment

Choose a reason for hiding this comment

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

No concerns regarding the whitespace. Just curious is all

@nazar-pc nazar-pc added this pull request to the merge queue Mar 4, 2024
Merged via the queue into main with commit 61789fd Mar 4, 2024
19 checks passed
@nazar-pc nazar-pc deleted the update-rust branch March 4, 2024 15:26
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.

2 participants