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

chore: upgrade to polkadot 0.9.4 #107

Merged
merged 17 commits into from
Jun 15, 2021
Merged

chore: upgrade to polkadot 0.9.4 #107

merged 17 commits into from
Jun 15, 2021

Conversation

mattsse
Copy link
Contributor

@mattsse mattsse commented Jun 10, 2021

Changes

  • update runtime and node to reflect latest changes
  • patches substrate/polkadot/cumulus deps
  • Use compact Cargo.toml for every pallet

The patches are necessary:

  • patching chainlink-feed pallet
  • patching jsonrpc*-alpha versions that always get pulled in and break stuff

Tests

cargo t

Issues

@mattsse mattsse added the needs review PR needs reviewing label Jun 11, 2021
@mattsse mattsse marked this pull request as ready for review June 11, 2021 10:50
@mattsse mattsse requested a review from clearloop June 11, 2021 10:50
@mattsse
Copy link
Contributor Author

mattsse commented Jun 11, 2021

The CI apparently fails to download the patches, paritytech//substrate is not a valid repository name
However the double slashes are necessary so that cargo can resolve all of them properly: rust-lang/cargo#5478 (comment)

paritytech//substrate works on my machine, paritytech/substrate breaks 🤷

@mattsse mattsse changed the title chore: upgrade to polkadot v0.9.3 chore: upgrade to polkadot master Jun 11, 2021
@clearloop
Copy link
Contributor

Let me run tests on my machine

Copy link
Contributor

@clearloop clearloop left a comment

Choose a reason for hiding this comment

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

Wierd on my machine

$ cargo t
  warning: use of deprecated type alias `pallet_staking::Module`: use `Pallet` instead
    --> /Users/clearloop/.cargo/git/checkouts/polkadot-4038f27d5e4ea2e8/55be325/runtime/parachains/src/reward_points.rs:57:4
     |
  57 |         <pallet_staking::Module<C>>::reward_by_ids(rewards);
     |          ^^^^^^^^^^^^^^^^^^^^^^^^^
     |
     = note: `#[warn(deprecated)]` on by default

  warning: 1 warning emitted

     Compiling polkadot-runtime-common v0.9.4 (/Users/clearloop/.cargo/git/checkouts/polkadot-4038f27d5e4ea2e8/55be325/runtime/common)
  error[E0046]: not all trait items implemented, missing: `transfer_all`
    --> /Users/clearloop/.cargo/git/checkouts/polkadot-4038f27d5e4ea2e8/55be325/runtime/polkadot/src/weights/pallet_balances.rs:45:1
     |
  45 | impl<T: frame_system::Config> pallet_balances::WeightInfo for WeightInfo<T> {
     | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `transfer_all` in implementation
     |
     = help: implement the missing item: `fn transfer_all() -> u64 { todo!() }`

  error: aborting due to previous error

  For more information about this error, try `rustc --explain E0046`.
  error: could not compile `polkadot-runtime`
$ cargo t --all-features
error: failed to run custom build command for `parachain-runtime v2.0.0 (/Users/clearloop/code/PINT/runtime)`

Caused by:
  process didn't exit successfully: `/Users/clearloop/code/PINT/target/debug/build/parachain-runtime-e0e3cd16d0f6f688/build-script-build` (exit code: 1)
  --- stdout
  Information that should be included in a bug report.
  Executing build command: "/Users/clearloop/.rustup/toolchains/nightly-2021-03-13-aarch64-apple-darwin/bin/cargo" "rustc" "--target=wasm32-unknown-unknown" "--manifest-path=/Users/clearloop/code/PINT/target/debug/wbuild/parachain-runtime/Cargo.toml" "--color=always" "--release"
  Using rustc version: rustc 1.52.0-nightly (b3e19a221 2021-03-12)


  --- stderr
      Blocking waiting for file lock on package cache
  error: failed to select a version for `pallet-committee`.
      ... required by package `parachain-runtime v2.0.0 (/Users/clearloop/code/PINT/runtime)`
      ... which is depended on by `parachain-runtime-wasm v1.0.0 (/Users/clearloop/code/PINT/target/debug/wbuild/parachain-runtime)`
  versions that meet the requirements `=0.0.1` are: 0.0.1

  the package `parachain-runtime` depends on `pallet-committee`, with features: `sp-runtime` but `pallet-committee` does not have these features.


  failed to select a version for `pallet-committee` which could resolve this conflict

After checking the features of pallet-committe, it doesn't require sp-runtime in the runtime-benchmark feature

@mattsse mattsse changed the title chore: upgrade to polkadot master chore: upgrade to polkadot 0.9.4 Jun 13, 2021
@mattsse
Copy link
Contributor Author

mattsse commented Jun 13, 2021

seems like the jsonrpc issues are resolve, patched it against 0.9.4.
cargo t --all-features should succeed now.
curious why the ci fails to fetch the patches.

Perhaps that is related to cache checkouts?

@clearloop
Copy link
Contributor

$ cargo t 
error[E0599]: no variant or associated item named `Committee` found for enum `mock::Event` in the current scope
   --> pallets/committee/src/tests.rs:491:23
    |
491 |           if let Event::Committee(crate::Event::Proposed(_, _, hash)) = last_event() {
    |                         ^^^^^^^^^ variant or associated item not found in `mock::Event`
    | 
   ::: pallets/committee/src/mock.rs:26:1
    |
26  | / frame_support::construct_runtime!(
27  | |     pub enum Test where
28  | |         Block = Block,
29  | |         NodeBlock = Block,
...   |
34  | |     }
35  | | );
    | |__- variant or associated item `Committee` not found here
$ cargo t --all-features
error[E0277]: the trait bound `(): pallet_chainlink_feed::WeightInfo` is not satisfied
   --> pallets/price-feed/src/mock.rs:109:5
    |
109 |     type WeightInfo = ();
    |     ^^^^^^^^^^^^^^^^^^^^^ the trait `pallet_chainlink_feed::WeightInfo` is not implemented for `()`
    | 
   ::: /Users/clearloop/.cargo/git/checkouts/chainlink-polkadot-9ffdf632331b9d0f/486bf07/pallet-chainlink-feed/src/lib.rs:322:26
    |
322 |         type WeightInfo: WeightInfo;
    |                          ---------- required by this bound in `pallet_chainlink_feed::Config::WeightInfo`

   Compiling polkadot-node-primitives v0.1.0 (https://github.com/paritytech//polkadot?rev=2f28561a09aab0613b5f8a68fbabf723d5fc197e#2f28561a)
error: aborting due to previous error

For more information about this error, try `rustc --explain E0277`.
error: could not compile `pallet-price-feed`

To learn more, run the command again with --verbose.
warning: build failed, waiting for other jobs to finish...
error[E0599]: no variant or associated item named `Committee` found for enum `mock::Event` in the current scope
   --> pallets/committee/src/tests.rs:491:23
    |
491 |           if let Event::Committee(crate::Event::Proposed(_, _, hash)) = last_event() {
    |                         ^^^^^^^^^ variant or associated item not found in `mock::Event`
    | 
   ::: pallets/committee/src/mock.rs:26:1
    |
26  | / frame_support::construct_runtime!(
27  | |     pub enum Test where
28  | |         Block = Block,
29  | |         NodeBlock = Block,
...   |
34  | |     }
35  | | );
    | |__- variant or associated item `Committee` not found here


@mattsse mattsse force-pushed the matt/update-latest-polkadot branch from 7c2af9f to 2b3c586 Compare June 14, 2021 08:22
@mattsse
Copy link
Contributor Author

mattsse commented Jun 14, 2021

These should be fixed now,
Any ideas wrt #112 ?

@clearloop
Copy link
Contributor

Build pass on my machine in 7c2af9f

@mattsse
Copy link
Contributor Author

mattsse commented Jun 14, 2021

FYI running this currently fails due to missing validators, and requires #109 to fix. Currently working on this.

@dutterbutter dutterbutter added approved PR approved to merge and removed needs review PR needs reviewing labels Jun 14, 2021
@mattsse mattsse merged commit a390b69 into main Jun 15, 2021
@mattsse mattsse deleted the matt/update-latest-polkadot branch June 15, 2021 13:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved PR approved to merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update rococo-v1 -> polkadot-v0.9.3
3 participants