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

Compilation Error with parity-scale-codec v3.6.9 After Updating Substrate Chain to polkadot-v1.9.0 #575

Open
Ali-Usama opened this issue Mar 26, 2024 · 1 comment

Comments

@Ali-Usama
Copy link

After updating my Substrate blockchain project to target polkadot-v1.9, I updated the parity-scale-codec dependency from version 3.6.5 to 3.6.9. This update introduced a compilation error related to a missing full_encode method which wasn't previously required or mentioned.

Error Details

The compiler emits the following error during the build process:

error[E0046]: not all trait items implemented, missing: `full_encode`
   --> /Users/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/parity-scale-codec-3.6.9/src/codec.rs:345:1
    |
343 |     fn full_encode(&self, _into: &mut Vec<u8>);
    |     ------------------------------------------- `full_encode` from trait
344 | }
345 | impl<S: Encode + EncodeLike> FullEncode for S {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `full_encode` in implementation

For more information about this error, try `rustc --explain E0046`.

This error suggests that a full_encode method is now expected but not implemented. This method was not part of the required API in parity-scale-codec 3.6.5 and does not appear to be documented in the current version.

Steps to Reproduce

  • Update a Substrate blockchain project to target polkadot-v1.9.0.
  • Update parity-scale-codec dependency from version 3.6.5 to 3.6.9 in Cargo.toml.
  • Run cargo build or cargo check to compile the project.
  • Observe the compilation error related to the missing full_encode method.

Expected Behavior

I expected the project to compile without errors related to parity-scale-codec, as it did with version 3.6.5.

Questions

  • Has there been a change or addition to the parity-scale-codec API in version 3.6.9 that introduces a full_encode method requirement?
  • Is there documentation or migration guidance available for updating to 3.6.9 that covers this new requirement?
  • Could this be an issue related to Substrate's polkadot-v1.9.0 update influencing parity-scale-codec dependency behavior?

Additional Context

Rust toolchain version: nightly-2024-01-22
Substrate version targeted: polkadot-v1.9.0
Dependency change: parity-scale-codec 3.6.5 -> 3.6.9

Any guidance or insights into resolving this compilation error would be greatly appreciated.

@bkchr
Copy link
Member

bkchr commented Mar 26, 2024

Hmm, this function full_encode doesn't exist. Please try to delete your cargo cache:

rm -rf ~/.cargo/registry

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

No branches or pull requests

2 participants