paritytech / paritytech/parity-scale-codec
Compilation Error with `parity-scale-codec v3.6.9` After Updating Substrate Chain to `polkadot-v1.9.0`
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 287
- Forks
- 103
- Avg merge
- 6d 13h
- Merged PRs (30d)
- 1
Description
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.5to3.6.9inCargo.toml. - Run
cargo buildorcargo checkto compile the project. - Observe the compilation error related to the missing
full_encodemethod.
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-codecAPI in version3.6.9that introduces afull_encodemethod requirement? - Is there documentation or migration guidance available for updating to
3.6.9that covers this new requirement? - Could this be an issue related to Substrate's
polkadot-v1.9.0update influencingparity-scale-codecdependency 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.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the failure with the stated nightly toolchain, polkadot-v1.9.0 target, and Cargo.toml dependency change, then inspect parity-scale-codec's reported codec.rs FullEncode implementation. Determine whether the versions are incompatible or require migration guidance; done means the project builds without the missing full_encode error and the required change is documented.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100