The Substrate team(https://github.com/paritytech/substrate/) produces releases like polkadot-v0.9.25 every a few weeks, and my team needs to upgrade our parachain to follow those Substrate versions.
My parachain also uses Frontier (https://github.com/paritytech/frontier/), which uses Substrate as a dependency.
Because Frontier team does not produce a version for each new Substrate version, I have to fix the Frontier code to use a desired substrate version.
I am aware of @JoshOrndorff's tutorial about how to add Frontier into a Substrate Node Template: https://github.com/PureStake/substrate-node-template/commits/frontier-workshop-2021, but that is more than 1 year ago.
Now I have a few options:
Use the commit or branch that has the Substrate version I want: ... This is not good because those available versions are very limited
Copy the latest code from the Frontier master branch, then update the Substrate version: ... This is not good as you can see the errors I got below
Which option is better?
And how can I upgrade or update the Substrate dependencies?
I tried to copy the latest Frontier code from its master branch, then replace the Substrate version to the one I want, then I got these errors:
➜ frontier-zmod git:(polkadot-v0.9.24) ✗ cargo check
Updating git repository `https://github.com/paritytech/substrate`
Updating crates.io index
error: failed to select a version for `syn`.
... required by package `frame-support-procedural v4.0.0-dev (https://github.com/paritytech/substrate?branch=polkadot-v0.9.24#814752f6)`
... which satisfies git dependency `frame-support-procedural` of package `frame-support v4.0.0-dev (https://github.com/paritytech/substrate?branch=polkadot-v0.9.24#814752f6)`
... which satisfies git dependency `frame-support` of package `fp-ethereum v1.0.0-dev (/mnt/sda3/polkadot/frontier-zmod/primitives/ethereum)`
... which satisfies path dependency `fp-ethereum` (locked to 1.0.0-dev) of package `pallet-ethereum v4.0.0-dev (/mnt/sda3/polkadot/frontier-zmod/frame/ethereum)`
... which satisfies path dependency `pallet-ethereum` (locked to 4.0.0-dev) of package `frontier-template-runtime v0.0.0 (/mnt/sda3/polkadot/frontier-zmod/template/runtime)`
... which satisfies path dependency `frontier-template-runtime` (locked to 0.0.0) of package `fc-cli v1.0.0-dev (/mnt/sda3/polkadot/frontier-zmod/client/cli)`
... which satisfies path dependency `fc-cli` (locked to 1.0.0-dev) of package `frontier-template-node v0.0.0 (/mnt/sda3/polkadot/frontier-zmod/template/node)`
versions that meet the requirements `^1.0.98` are: 1.0.98
all possible versions conflict with previously selected packages.
previously selected package `syn v1.0.96`
... which satisfies dependency `syn = "^1.0.96"` (locked to 1.0.96) of package `async-trait v0.1.56`
... which satisfies dependency `async-trait = "^0.1"` (locked to 0.1.56) of package `fc-consensus v2.0.0-dev (/mnt/sda3/polkadot/frontier-zmod/client/consensus)`
... which satisfies path dependency `fc-consensus` (locked to 2.0.0-dev) of package `frontier-template-node v0.0.0 (/mnt/sda3/polkadot/frontier-zmod/template/node)`
failed to select a version for `syn` which could resolve this conflict
➜ frontier-zmod git:(polkadot-v0.9.24) ✗ cargo update -p syn --precise 1.0.98
Updating crates.io index
Updating git repository `https://github.com/paritytech/substrate`
error: failed to select a version for `arrayvec`.
... required by package `libp2p-kad v0.37.1`
... which satisfies dependency `libp2p-kad = "^0.37.1"` of package `libp2p v0.45.1`
... which satisfies dependency `libp2p = "^0.45.1"` of package `sc-cli v0.10.0-dev (https://github.com/paritytech/substrate?branch=polkadot-v0.9.24#814752f6)`
... which satisfies git dependency `sc-cli` of package `fc-cli v1.0.0-dev (/mnt/sda3/polkadot/frontier-zmod/client/cli)`
... which satisfies path dependency `fc-cli` (locked to 1.0.0-dev) of package `frontier-template-node v0.0.0 (/mnt/sda3/polkadot/frontier-zmod/template/node)`
versions that meet the requirements `^0.7.2` are: 0.7.2
all possible versions conflict with previously selected packages.
previously selected package `arrayvec v0.7.1`
... which satisfies dependency `arrayvec = "^0.7.1"` (locked to 0.7.1) of package `jsonrpsee-core v0.13.1`
... which satisfies dependency `jsonrpsee-core = "^0.13.1"` (locked to 0.13.1) of package `jsonrpsee v0.13.1`
... which satisfies dependency `jsonrpsee = "^0.13.0"` (locked to 0.13.1) of package `fc-rpc v2.0.0-dev (/mnt/sda3/polkadot/frontier-zmod/client/rpc)`
... which satisfies path dependency `fc-rpc` (locked to 2.0.0-dev) of package `frontier-template-node v0.0.0 (/mnt/sda3/polkadot/frontier-zmod/template/node)`
failed to select a version for `arrayvec` which could resolve this conflict
➜ frontier-zmod git:(polkadot-v0.9.24) ✗ cargo update -p arrayvec:0.4.12 --precise 0.7.2
Updating crates.io index
Updating git repository `https://github.com/paritytech/substrate`
error: failed to select a version for the requirement `arrayvec = "^0.4.6"`
candidate versions found which didn't match: 0.7.2
location searched: crates.io index
required by package `blake2-rfc v0.2.18`
... which satisfies dependency `blake2-rfc = "^0.2.18"` (locked to 0.2.18) of package `sp-core v6.0.0 (https://github.com/paritytech/substrate?branch=polkadot-v0.9.24#814752f6)`
... which satisfies git dependency `sp-core` of package `fc-db v2.0.0-dev (/mnt/sda3/polkadot/frontier-zmod/client/db)`
... which satisfies path dependency `fc-db` (locked to 2.0.0-dev) of package `fc-cli v1.0.0-dev (/mnt/sda3/polkadot/frontier-zmod/client/cli)`
... which satisfies path dependency `fc-cli` (locked to 1.0.0-dev) of package `frontier-template-node v0.0.0 (/mnt/sda3/polkadot/frontier-zmod/template/node)`
How can I upgrade the Substrate dependency?