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

Build failing on linux #78

Closed
smu160 opened this issue May 18, 2022 · 3 comments · Fixed by #152
Closed

Build failing on linux #78

smu160 opened this issue May 18, 2022 · 3 comments · Fixed by #152

Comments

@smu160
Copy link

smu160 commented May 18, 2022

      |
  302 | impl pallet_contracts::Config for Runtime {
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `MaxCodeLen`, `RelaxedMaxCodeLen` in implementation
      |
      = help: implement the missing item: `type MaxCodeLen = Type;`
      = help: implement the missing item: `type RelaxedMaxCodeLen = Type;`

  error[E0609]: no field `code_len` on type `Limits`
     --> /home/vasily/.cargo/git/checkouts/substrate-contracts-node-cf7c16677784d274/254342f/runtime/src/lib.rs:297:19
      |
  297 |         schedule.limits.code_len = 256 * 1024;
      |                         ^^^^^^^^ unknown field
      |
      = note: available fields are: `event_topics`, `stack_height`, `globals`, `parameters`, `memory_pages` ... and 5 others

Steps to reproduce:

cargo install contracts-node --git https://github.com/paritytech/substrate-contracts-node.git --tag v0.15.1 --force --locked

System info:

Distro: Ubuntu 22.04 LTS x86_64
Kernel: 5.15.0-30-generic
@takahser
Copy link

Same here:

  error[E0046]: not all trait items implemented, missing: `Event`
     --> /home/xxx/.cargo/git/checkouts/substrate-contracts-node-cf7c16677784d274/254342f/runtime/src/lib.rs:263:1
      |
  263 | impl pallet_transaction_payment::Config for Runtime {
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `Event` in implementation
      |
      = help: implement the missing item: `type Event = Type;`

  error[E0046]: not all trait items implemented, missing: `MaxCodeLen`, `RelaxedMaxCodeLen`, `MaxStorageKeyLen`
     --> /home/xxx/.cargo/git/checkouts/substrate-contracts-node-cf7c16677784d274/254342f/runtime/src/lib.rs:302:1
      |
  302 | impl pallet_contracts::Config for Runtime {
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `MaxCodeLen`, `RelaxedMaxCodeLen`, `MaxStorageKeyLen` in implementation
      |
      = help: implement the missing item: `type MaxCodeLen = Type;`
      = help: implement the missing item: `type RelaxedMaxCodeLen = Type;`
      = help: implement the missing item: `type MaxStorageKeyLen = Type;`

  error[E0053]: method `get_storage` has an incompatible type for trait
     --> /home/xxx/.cargo/git/checkouts/substrate-contracts-node-cf7c16677784d274/254342f/runtime/src/lib.rs:572:9
      |
  572 |             key: [u8; 32],
      |                  ^^^^^^^^
      |                  |
      |                  expected struct `hidden_include::dispatch::Vec`, found array `[u8; 32]`
      |                  help: change the parameter type to match the trait: `hidden_include::dispatch::Vec<u8>`
      |
      = note: expected fn pointer `fn(AccountId32, hidden_include::dispatch::Vec<u8>) -> Result<_, _>`
                 found fn pointer `fn(AccountId32, [u8; 32]) -> Result<_, _>`

  error[E0609]: no field `code_len` on type `Limits`
     --> /home/xxx/.cargo/git/checkouts/substrate-contracts-node-cf7c16677784d274/254342f/runtime/src/lib.rs:297:19
      |
  297 |         schedule.limits.code_len = 256 * 1024;
      |                         ^^^^^^^^ unknown field
      |
      = note: available fields are: `event_topics`, `stack_height`, `globals`, `parameters`, `memory_pages` ... and 5 others

  error[E0308]: mismatched types
     --> /home/xxx/.cargo/git/checkouts/substrate-contracts-node-cf7c16677784d274/254342f/runtime/src/lib.rs:574:36
      |
  574 |             Contracts::get_storage(address, key)
      |             ----------------------          ^^^- help: try using a conversion method: `.to_vec()`
      |             |                               |
      |             |                               expected struct `hidden_include::dispatch::Vec`, found array `[u8; 32]`
      |             arguments to this function are incorrect
      |
      = note: expected struct `hidden_include::dispatch::Vec<u8>`
                  found array `[u8; 32]`
  note: associated function defined here
     --> /home/xxx/.cargo/git/checkouts/substrate-7e08433d4c370a21/c28702f/frame/contracts/src/lib.rs:949:9
      |
  949 |     pub fn get_storage(address: T::AccountId, key: Vec<u8>) -> GetStorageResult {
      |            ^^^^^^^^^^^

  error[E0308]: mismatched types
     --> /home/xxx/.cargo/git/checkouts/substrate-contracts-node-cf7c16677784d274/254342f/runtime/src/lib.rs:572:4
      |
  384 | / impl_runtime_apis! {
  385 | |     impl sp_api::Core<Block> for Runtime {
  386 | |         fn version() -> RuntimeVersion {
  387 | |             VERSION
  ...   |
  572 | |             key: [u8; 32],
      | |             ^^^- help: try using a conversion method: `.to_vec()`
      | |             |
      | |             expected struct `hidden_include::dispatch::Vec`, found array `[u8; 32]`
  ...   |
  591 | |     }
  592 | | }
      | |_- arguments to this function are incorrect
      |
      = note: expected struct `hidden_include::dispatch::Vec<u8>`
                  found array `[u8; 32]`
  note: associated function defined here
     --> /home/xxx/.cargo/git/checkouts/substrate-7e08433d4c370a21/c28702f/frame/contracts/rpc/runtime-api/src/lib.rs:80:6
      |
  80  |         fn get_storage(
      |            ^^^^^^^^^^^

  Some errors have detailed explanations: E0046, E0053, E0308, E0609.
  For more information about an error, try `rustc --explain E0046`.
  error: could not compile `contracts-node-runtime` due to 6 previous errors
warning: build failed, waiting for other jobs to finish...
error: failed to compile `contracts-node v0.15.0 (https://github.com/paritytech/substrate-contracts-node.git?tag=v0.15.1#254342f1)`, intermediate artifacts can be found at `/tmp/cargo-installkRKrkS`

Rust toolchain:

$ rustup show
Default host: x86_64-unknown-linux-gnu
rustup home:  /home/xxx/.rustup

installed toolchains
--------------------

stable-x86_64-unknown-linux-gnu
nightly-2021-11-01-x86_64-unknown-linux-gnu
nightly-2021-11-07-x86_64-unknown-linux-gnu
nightly-2022-03-14-x86_64-unknown-linux-gnu
nightly-2022-05-18-x86_64-unknown-linux-gnu
nightly-x86_64-unknown-linux-gnu (default)

installed targets for active toolchain
--------------------------------------

wasm32-unknown-unknown
x86_64-unknown-linux-gnu

active toolchain
----------------

nightly-x86_64-unknown-linux-gnu (default)
rustc 1.64.0-nightly (c80c4b8fd 2022-06-26)

@ascjones
Copy link
Contributor

Which commit are you using? This should be fixed in #126

@TomaszWaszczyk
Copy link

TomaszWaszczyk commented Oct 9, 2022

Had the same issue @smu160 @takahser Look at the issue.

tomek@rhei-box:~/ssd/workspaces/substrate-contracts-node$ rustup show
Default host: x86_64-unknown-linux-gnu
rustup home:  /home/tomek/.rustup

installed toolchains
--------------------

stable-x86_64-unknown-linux-gnu
nightly-2020-08-23-x86_64-unknown-linux-gnu
nightly-2021-11-29-x86_64-unknown-linux-gnu
nightly-2022-02-19-x86_64-unknown-linux-gnu
nightly-2022-03-14-x86_64-unknown-linux-gnu
nightly-2022-05-11-x86_64-unknown-linux-gnu
nightly-2022-05-23-x86_64-unknown-linux-gnu (default)
nightly-2022-06-30-x86_64-unknown-linux-gnu
nightly-2022-07-24-x86_64-unknown-linux-gnu
nightly-2022-08-15-x86_64-unknown-linux-gnu
nightly-x86_64-unknown-linux-gnu
1.41.0-x86_64-unknown-linux-gnu

installed targets for active toolchain
--------------------------------------

wasm32-unknown-unknown
x86_64-unknown-linux-gnu

active toolchain
----------------

nightly-2022-05-23-x86_64-unknown-linux-gnu (default)
rustc 1.63.0-nightly (b2eed72a6 2022-05-22)

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 a pull request may close this issue.

4 participants