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

Update to BitVec 1.0 #422

Closed
jsdw opened this issue Feb 1, 2022 · 5 comments
Closed

Update to BitVec 1.0 #422

jsdw opened this issue Feb 1, 2022 · 5 comments
Assignees
Labels
good first issue Small, well scoped, simple; good for newcomers

Comments

@jsdw
Copy link
Collaborator

jsdw commented Feb 1, 2022

scale-info is going to update to using BitVec 1.0 soon: paritytech/scale-info#137

When a new version of scale-info is published, let's

  • update subxt to use the new version of scale-info.
  • update subxt to use the new version of parity-scale-codec (which will be bought in by scale-info and also will depend on bitvec 1.0).
  • update all direct dependencies on bitvec to 1.0, fixing any issues that crop up when we do so.
@jsdw jsdw mentioned this issue Feb 1, 2022
16 tasks
@jsdw
Copy link
Collaborator Author

jsdw commented Feb 2, 2022

Also note that frame-metadata will also need an update to make sure it depends on the newly released versions of scale-info and parity-scale-codec when they are released with BitVec 1 support (see paritytech/frame-metadata#34), so let's wait until that has been bumped as well before updating subxt.

@jsdw
Copy link
Collaborator Author

jsdw commented Feb 15, 2022

All of the required crates are good to go now for this :)

@jsdw jsdw added the good first issue Small, well scoped, simple; good for newcomers label Feb 15, 2022
@lexnv
Copy link
Collaborator

lexnv commented Feb 18, 2022

Subxt

Updating the scale-info, frame-metadata and parity-scale-codec crates directly into subxt still contains incompatible hierarchy of dependencies.

error[E0277]: the trait bound `CheckSpecVersion<T>: sp_runtime::scale_info::TypeInfo` is not satisfied
   --> subxt/src/extrinsic/extra.rs:64:17
    |
64  | impl<T: Config> SignedExtension for CheckSpecVersion<T> {
    |                 ^^^^^^^^^^^^^^^ the trait `sp_runtime::scale_info::TypeInfo` is not implemented for `CheckSpecVersion<T>`
    |
note: required by a bound in `SignedExtension`
   --> /Users/lexnv/.cargo/registry/src/github.com-1ecc6299db9ec823/sp-runtime-5.0.0/src/traits.rs:835:57
    |
835 |     Codec + Debug + Sync + Send + Clone + Eq + PartialEq + StaticTypeInfo
    |                                                            ^^^^^^^^^^^^^^ required by this bound in `SignedExtension`

This comes from sp-runtime-5.0.0, but the whole substrate dependency might need updating.

Substrate

Steps performed:

  • Update trie-bench to v0.30
  • Update kvdb-rocksdb to v0.15
  • Update kvdb-memorydb to v0.11
  • Update kvdb to 0.11
  • Update memory-db to 0.29 upstream
  • Update parity-util-mem to upstream 0.11.0
  • Update primitives to upstream 0.11.1
  • Update scale-info to v2 master
  • Update frame-metadata to v15
  • Update parity-scale-codec to v3.0.0

Updating scale-info, frame-metadata and parity-scale-codec will still cause problems due to parity-util-mem outdated version.

Whoever, changing parity-util-mem to latest version 0.11.0 in sp-runtime is incompatible with other linked versions. Therefore, the whole substrate should update the parity-util-mem.

Updating to 0.11.0 would still cause inconsistency in pulled dependencies due to scale-info requirements of >=0.9 and < 3. This can be seen from cargo tree

sp-runtime v5.0.0 (/Users/lexnv/Workspace/parity/substrate/primitives/runtime)

├── parity-util-mem v0.11.0
│   └── primitive-types v0.11.1
│       ├── scale-info v1.0.0


├── substrate-test-runtime-client v2.0.0 (/Users/lexnv/Workspace/parity/substrate/test-utils/runtime/client)
│   ├── substrate-test-client v2.0.1 (/Users/lexnv/Workspace/parity/substrate/test-utils/client)
│   │   ├── sc-offchain v4.0.0-dev (/Users/lexnv/Workspace/parity/substrate/client/offchain)
│   │   │   ├── sc-network v0.10.0-dev (/Users/lexnv/Workspace/parity/substrate/client/network)
│   │   │   │   ├── sp-finality-grandpa v4.0.0-dev (/Users/lexnv/Workspace/parity/substrate/primitives/finality-grandpa)
│   │   │   │   │   ├── finality-grandpa v0.14.4
│   │   │   │   │   │   └── scale-info v1.0.0 (*)

Trying to introduce the crates from local directories, still causes an inconsistency due to byteorder version.

error: failed to select a version for `byteorder`.
    ... required by package `uint v0.9.3 (/Users/lexnv/Workspace/parity/parity-common/uint)`
    ... which satisfies path dependency `uint` of package `primitive-types v0.11.2 (/Users/lexnv/Workspace/parity/parity-common/primitive-types)`
    ... which satisfies path dependency `primitive-types` of package `parity-util-mem v0.11.1 (/Users/lexnv/Workspace/parity/parity-common/parity-util-mem)`
    ... which satisfies path dependency `parity-util-mem` of package `frame-support v4.0.0-dev (/Users/lexnv/Workspace/parity/substrate/frame/support)`
    ... which satisfies path dependency `frame-support` (locked to 4.0.0-dev) of package `frame-benchmarking v4.0.0-dev (/Users/lexnv/Workspace/parity/substrate/frame/benchmarking)`
    ... which satisfies path dependency `frame-benchmarking` (locked to 4.0.0-dev) of package `frame-benchmarking-cli v4.0.0-dev (/Users/lexnv/Workspace/parity/substrate/utils/frame/benchmarking-cli)`
    ... which satisfies path dependency `frame-benchmarking-cli` (locked to 4.0.0-dev) of package `node-cli v3.0.0-dev (/Users/lexnv/Workspace/parity/substrate/bin/node/cli)`
    ... which satisfies path dependency `node-cli` (locked to 3.0.0-dev) of package `chain-spec-builder v2.0.0 (/Users/lexnv/Workspace/parity/substrate/bin/utils/chain-spec-builder)`
versions that meet the requirements `^1.4.3` are: 1.4.3

After updating to v1.4.3 in substrate and dependencies, the hash-db crate is causing a problem.

Compiling sp-trie v5.0.0 (/Users/lexnv/Workspace/parity/substrate/primitives/trie)
error[E0277]: the trait bound `H: hash_db::Hasher` is not satisfied
   --> primitives/trie/src/storage_proof.rs:75:44
    |
75  |     pub fn into_memory_db<H: Hasher>(self) -> crate::MemoryDB<H> {
    |                                               ^^^^^^^^^^^^^^^^^^ the trait `hash_db::Hasher` is not implemented for `H`
    |
note: required by a bound in `memory_db::MemoryDB`
   --> /Users/lexnv/Workspace/parity/trie/memory-db/src/lib.rs:107:5
    |
107 |     H: KeyHasher,
    |        ^^^^^^^^^ required by this bound in `memory_db::MemoryDB`
help: consider further restricting this bound
    |
75  |     pub fn into_memory_db<H: Hasher + hash_db::Hasher>(self) -> crate::MemoryDB<H> {
    |                                     +++++++++++++++++
    ```
    
However, there is no double dependency of this crate in the `crate tree -d`

@jsdw
Copy link
Collaborator Author

jsdw commented Feb 23, 2022

@lexnv It looks like #462 is tracking this issue and will eventually resolve it :)

@jsdw
Copy link
Collaborator Author

jsdw commented Mar 2, 2022

Closed by #462 (Thanks @ascjones!) :)

@jsdw jsdw closed this as completed Mar 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Small, well scoped, simple; good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants