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

Upgrade to upstream 0.9.40 #735

Merged
merged 22 commits into from
May 9, 2023
Merged

Upgrade to upstream 0.9.40 #735

merged 22 commits into from
May 9, 2023

Conversation

aliXsed
Copy link
Contributor

@aliXsed aliXsed commented Apr 26, 2023

  • Fix xcm benchmarks for generic calls
  • Use the new weight calculating functions from xcm benchmarks
  • Benchmark the PR on the standard machine and update the weights

@aliXsed aliXsed requested a review from simonsso May 3, 2023 01:55
@codecov
Copy link

codecov bot commented May 3, 2023

Codecov Report

Merging #735 (126aca3) into master (49e6999) will increase coverage by 14.53%.
The diff coverage is 5.37%.

@@             Coverage Diff             @@
##           master     #735       +/-   ##
===========================================
+ Coverage   44.50%   59.03%   +14.53%     
===========================================
  Files          37       38        +1     
  Lines        4402     4670      +268     
===========================================
+ Hits         1959     2757      +798     
+ Misses       2443     1913      -530     
Impacted Files Coverage Δ
pallets/allocations/src/lib.rs 95.56% <ø> (ø)
pallets/grants/src/lib.rs 76.82% <ø> (ø)
pallets/grants/src/weights.rs 0.00% <0.00%> (ø)
pallets/mandate/src/lib.rs 7.69% <ø> (ø)
pallets/reserve/src/lib.rs 52.94% <ø> (ø)
runtimes/eden/src/lib.rs 2.64% <0.00%> (-0.05%) ⬇️
runtimes/eden/src/pallets_consensus.rs 0.00% <ø> (ø)
runtimes/eden/src/version.rs 100.00% <ø> (ø)
runtimes/eden/src/weights/frame_system.rs 0.00% <0.00%> (ø)
runtimes/eden/src/weights/pallet_balances.rs 0.00% <0.00%> (ø)
... and 20 more

@aliXsed aliXsed mentioned this pull request May 5, 2023
9 tasks
@aliXsed aliXsed marked this pull request as ready for review May 8, 2023 01:57
@@ -34,7 +34,7 @@ use sp_runtime::{
bounded_vec,
traits::{IdentifyAccount, Verify},
};
const SAFE_XCM_VERSION: u32 = xcm::v2::VERSION;
const SAFE_XCM_VERSION: u32 = xcm::latest::VERSION;
Copy link
Contributor

Choose a reason for hiding this comment

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

wouldn't it be better to have the fixed version here to prevent future updates of xcm to be unwillingly brought to the codebase?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Hounsette The latest version of XCM would only be considered safe if we have done a full upgrade and supports that version. Bringing the safe version from a particular version was the source of some tricky upgrade issues.

Copy link
Member

@ETeissonniere ETeissonniere May 8, 2023

Choose a reason for hiding this comment

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

@aliXsed using the change below (if it is even possible) might allow us to avoid some border effects in case we have an oversight.

Suggested change
const SAFE_XCM_VERSION: u32 = xcm::latest::VERSION;
const SAFE_XCM_VERSION: u32 = xcm::v3::VERSION;

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just for reference, we discussed the cons and pros of going for the latest. Since we have had other places where the xcm definitions are fetched from the latest and we don't see any particular safety issue right now based on supporting the latest xcm that has officially brought to the scope of out code base, we decided to leave this here as it is.

Copy link
Member

@ETeissonniere ETeissonniere left a comment

Choose a reason for hiding this comment

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

Some minor comments, looking good otherwise. @aliXsed do you know if we have any migrations to include?

runtimes/eden/Cargo.toml Show resolved Hide resolved
runtimes/eden/src/pallets_governance.rs Outdated Show resolved Hide resolved
Comment on lines +176 to +178
type CallStack = [Frame<Self>; 5];
type AddressGenerator = pallet_contracts::DefaultAddressGenerator;
type MaxCodeLen = ConstU32<{ 128 * 1024 }>;
type MaxCodeLen = ConstU32<{ 123 * 1024 }>;
Copy link
Member

Choose a reason for hiding this comment

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

Any reasons why this is getting lowered?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I follow the contracts system parachain and the fact that they have gone for a lower value here could be due to some safety analysis. We'd better go for the lower and increase it in the future when we have evaluated all the cons and pros.

Copy link
Member

Choose a reason for hiding this comment

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

Yes of course - I was wondering as to why they did the change, not necessarily if we should do it

Copy link
Member

Choose a reason for hiding this comment

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

Looks like Parity's team figured it would be appropriate to document the limits and safe values in the not so well known integrity_test function. https://paritytech.github.io/substrate/master/src/pallet_contracts/lib.rs.html#323-386

@aliXsed aliXsed merged commit 1dff75e into master May 9, 2023
@aliXsed aliXsed deleted the aliX/upgrade-to-0.9.40 branch May 9, 2023 00:08
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.

3 participants