Skip to content

Commit

Permalink
[wip] Update to polkadot-v1.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
weezy20 committed Oct 31, 2023
1 parent fb0e07d commit b060503
Show file tree
Hide file tree
Showing 17 changed files with 2,481 additions and 1,612 deletions.
3,426 changes: 2,130 additions & 1,296 deletions Cargo.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ cargo build --release
```

### 🕸️ Run a local network
You will need a compatible release of [Polkadot](https://github.com/paritytech/polkadot) to run a local network. You may also want to use [Zombienet](https://github.com/paritytech/zombienet/releases) (available for Linux and MacOS), for spinning up a full fledged relay chain - parachain environment. You can find more information about running a local test network [HERE](./docs/zombienet.md)
You will need a compatible release of [Polkadot](https://github.com/paritytech/polkadot-sdk) to run a local network. You may also want to use [Zombienet](https://github.com/paritytech/zombienet/releases) (available for Linux and MacOS), for spinning up a full fledged relay chain - parachain environment. You can find more information about running a local test network [HERE](./docs/zombienet.md)



Expand Down
18 changes: 15 additions & 3 deletions docs/rust-setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,21 @@ brew update
brew install openssl cmake llvm
```

- ### Install the `wasm` target and the `nightly` toolchain for rust
You may also be required to install a `protobuf` compiler:

```sh
rustup update nightly
rustup target add wasm32-unknown-unknown --toolchain nightly
# Ubuntu
sudo apt install -y protobuf-compiler

# Arch
pacman -Syu --needed --noconfirm protobuf

# Mac Os
brew install protobuf
```

- ### Install the `wasm` target for your rust toolchain

```sh
rustup target add wasm32-unknown-unknown
```
18 changes: 10 additions & 8 deletions docs/zombienet.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,26 @@
You can download executables of the Zombienet CLI from [paritytech/zombienet/releases](https://github.com/paritytech/zombienet/releases)


- Download the Zombienet CLI according to your operating system.
- Download the latest Zombienet CLI according to your operating system.

💡 Tip: If you want the executable to be available system-wide then make sure you place it in one of your `$PATH` directories.
```sh
wget https://github.com/paritytech/zombienet/releases/download/v1.3.30/zombienet-macos
wget https://github.com/paritytech/zombienet/releases/download/v1.3.71/zombienet-macos
chmod +x zombienet-macos
cp zombienet-macos /usr/local/bin
```
Then invoke it anywhere like :
```sh
# Mac Os
zombienet-macos --help
```
Otherwise you can just place it in your working directory.

```sh
./zombienet-macos --help
```sh
# Linux
zombienet-linux-x64 --help
```
You should see some similar output:

You should see some similar output to indicate it's installed and working properly:
```sh
Usage: zombienet [options] [command]

Expand All @@ -41,9 +43,9 @@ Commands:

## Setting up Zombienet config:

You may use a reference implementation from the folder `zombienet-config` or make your own. We provide a simple configuration for you called [zombienet-config.toml](../zombienet-config.toml) which spins up two validators for the relay chain, and one collator for your parachain to get you quickly upto speed.
You may use the provided reference implementation from the repository or make your own. We provide a simple configuration for you [zombienet-config.toml](../zombienet-config.toml) which spins up two validators for the relay chain, and one collator for your parachain to get you quickly upto speed.

⚠️ Take note: the path of the polkadot executable used there is `../bin/polkadot` which means you need to have a folder called `bin` outside the repository directory which contains your compiled polkadot binary which must be named as `polkadot`. Also please take care to compile the correct version of `polkadot` when testing out on your machine. You can do so by cloning `polkadot` and then checking out the appropriate branch that corresponds to the substrate/cumulus version used to build the template.
⚠️ Note: The path of the polkadot executable used there is `./bin/polkadot` which means you need to have a folder called `bin` inside the repository directory which contains your compiled polkadot binary named as `polkadot`. In addition to that since version 1.1.0, you will also need to place the `polkadot-execute-worker` and the `polkadot-prepare-worker` binaries to be inside `bin`. As a user you don't need to interact with these but these are required to start up the main relay chain `polkadot` software. You can find all three [here](https://github.com/paritytech/polkadot-sdk/releases/tag/polkadot-v1.1.0)



Expand Down
121 changes: 63 additions & 58 deletions node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,72 +23,77 @@ serde = {version = "1.0.186", features = ["derive"]}
frontier-parachain-runtime = {path = "../runtime"}

# Substrate
frame-benchmarking = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0"}
frame-benchmarking-cli = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0"}
pallet-transaction-payment-rpc = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0"}
sc-basic-authorship = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0"}
sc-chain-spec = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0"}
sc-cli = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0"}
sc-client-api = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0"}
sc-consensus = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0"}
sc-executor = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0"}
sc-network = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0"}
sc-network-common = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0"}
sc-network-sync = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0"}
sc-offchain = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0"}
sc-rpc = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0"}
sc-service = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0", features = ["default"]}
sc-sysinfo = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0"}
sc-telemetry = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0"}
sc-tracing = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0"}
sc-transaction-pool = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0"}
sc-transaction-pool-api = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0"}
sp-api = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0"}
sp-block-builder = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0"}
sp-blockchain = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0"}
sp-consensus-aura = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0"}
sp-core = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0"}
sp-io = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0"}
sp-keystore = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0"}
sp-offchain = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0"}
sp-runtime = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0"}
sp-session = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0"}
sp-timestamp = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0"}
sp-transaction-pool = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0"}
substrate-frame-rpc-system = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0"}
substrate-prometheus-endpoint = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0"}
try-runtime-cli = {git = "https://github.com/paritytech/substrate", optional = true, branch = "polkadot-v1.0.0"}
frame-benchmarking = {git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0"}
frame-benchmarking-cli = {git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0"}
pallet-transaction-payment-rpc = {git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0"}
sc-basic-authorship = {git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0"}
sc-chain-spec = {git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0"}
sc-cli = {git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0"}
sc-client-api = {git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0"}
sc-consensus = {git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0"}
sc-consensus-aura = {git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0"}
sc-executor = {git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0"}
sc-network = {git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0"}
sc-network-common = {git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0"}
sc-network-sync = {git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0"}
sc-offchain = {git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0"}
sc-rpc = {git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0"}
sc-service = {git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0", features = ["default"]}
sc-sysinfo = {git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0"}
sc-telemetry = {git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0"}
sc-tracing = {git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0"}
sc-transaction-pool = {git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0"}
sc-transaction-pool-api = {git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0"}
sp-api = {git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0"}
sp-block-builder = {git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0"}
sp-blockchain = {git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0"}
sp-consensus-aura = {git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0"}
sp-core = {git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0"}
sp-io = {git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0"}
sp-inherents = {git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0"}
sp-keystore = {git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0"}
sp-offchain = {git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0"}
sp-runtime = {git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0"}
sp-session = {git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0"}
sp-timestamp = {git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0"}
sp-transaction-pool = {git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0"}
substrate-frame-rpc-system = {git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0"}
substrate-prometheus-endpoint = {git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0"}
try-runtime-cli = {git = "https://github.com/paritytech/polkadot-sdk", optional = true, branch = "release-polkadot-v1.1.0"}

# Polkadot
polkadot-cli = {git = "https://github.com/paritytech/polkadot", features = ["rococo-native"], branch = "release-v1.0.0"}
polkadot-primitives = {git = "https://github.com/paritytech/polkadot", branch = "release-v1.0.0"}
polkadot-service = {git = "https://github.com/paritytech/polkadot", branch = "release-v1.0.0"}
xcm = {git = "https://github.com/paritytech/polkadot", default-features = false, branch = "release-v1.0.0"}
polkadot-cli = {git = "https://github.com/paritytech/polkadot-sdk", features = ["rococo-native"], branch = "release-polkadot-v1.1.0"}
polkadot-primitives = {git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0"}
polkadot-service = {git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0"}
xcm = { package = "staging-xcm", git = "https://github.com/paritytech/polkadot-sdk", default-features = false, branch = "release-polkadot-v1.1.0"}

# Cumulus
cumulus-client-cli = {git = "https://github.com/paritytech/cumulus.git", branch = "polkadot-v1.0.0"}
cumulus-client-consensus-aura = {git = "https://github.com/paritytech/cumulus.git", branch = "polkadot-v1.0.0"}
cumulus-client-consensus-common = {git = "https://github.com/paritytech/cumulus.git", branch = "polkadot-v1.0.0"}
cumulus-client-network = {git = "https://github.com/paritytech/cumulus.git", branch = "polkadot-v1.0.0"}
cumulus-client-service = {git = "https://github.com/paritytech/cumulus.git", branch = "polkadot-v1.0.0"}
cumulus-primitives-core = {git = "https://github.com/paritytech/cumulus.git", branch = "polkadot-v1.0.0"}
cumulus-primitives-parachain-inherent = {git = "https://github.com/paritytech/cumulus.git", branch = "polkadot-v1.0.0"}
cumulus-relay-chain-interface = {git = "https://github.com/paritytech/cumulus.git", branch = "polkadot-v1.0.0"}
cumulus-client-cli = {git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0"}
cumulus-client-collator = {git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0"}
cumulus-client-consensus-aura = {git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0"}
cumulus-client-consensus-proposer = {git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0"}
cumulus-client-consensus-common = {git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0"}
cumulus-client-network = {git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0"}
cumulus-client-service = {git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0"}
cumulus-primitives-core = {git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0"}
cumulus-primitives-parachain-inherent = {git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0"}
cumulus-relay-chain-interface = {git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0"}

# Frontier
fc-cli = {git = "https://github.com/paritytech/frontier", branch = "polkadot-v1.0.0"}
fc-consensus = {git = "https://github.com/paritytech/frontier", branch = "polkadot-v1.0.0"}
fc-db = {git = "https://github.com/paritytech/frontier", features = ["default", "sql"], branch = "polkadot-v1.0.0"}
fc-mapping-sync = {git = "https://github.com/paritytech/frontier", features = ["sql"], branch = "polkadot-v1.0.0"}
fc-rpc = {git = "https://github.com/paritytech/frontier", branch = "polkadot-v1.0.0", features = ["rpc-binary-search-estimate", "txpool"]}
fc-rpc-core = {git = "https://github.com/paritytech/frontier", branch = "polkadot-v1.0.0"}
fc-storage = {git = "https://github.com/paritytech/frontier", branch = "polkadot-v1.0.0"}
fp-dynamic-fee = {git = "https://github.com/paritytech/frontier", branch = "polkadot-v1.0.0"}
fp-evm = {git = "https://github.com/paritytech/frontier", branch = "polkadot-v1.0.0"}
fp-rpc = {git = "https://github.com/paritytech/frontier", branch = "polkadot-v1.0.0"}
fc-api = {git = "https://github.com/paritytech/frontier", branch = "polkadot-v1.1.0"}
fc-cli = {git = "https://github.com/paritytech/frontier", branch = "polkadot-v1.1.0"}
fc-consensus = {git = "https://github.com/paritytech/frontier", branch = "polkadot-v1.1.0"}
fc-db = {git = "https://github.com/paritytech/frontier", features = ["default", "sql"], branch = "polkadot-v1.1.0"}
fc-mapping-sync = {git = "https://github.com/paritytech/frontier", features = ["sql"], branch = "polkadot-v1.1.0"}
fc-rpc = {git = "https://github.com/paritytech/frontier", branch = "polkadot-v1.1.0", features = ["rpc-binary-search-estimate", "txpool"]}
fc-rpc-core = {git = "https://github.com/paritytech/frontier", branch = "polkadot-v1.1.0"}
fc-storage = {git = "https://github.com/paritytech/frontier", branch = "polkadot-v1.1.0"}
fp-dynamic-fee = {git = "https://github.com/paritytech/frontier", branch = "polkadot-v1.1.0"}
fp-evm = {git = "https://github.com/paritytech/frontier", branch = "polkadot-v1.1.0"}
fp-rpc = {git = "https://github.com/paritytech/frontier", branch = "polkadot-v1.1.0"}

[build-dependencies]
substrate-build-script-utils = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0"}
substrate-build-script-utils = {git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0"}

[features]
default = []
Expand Down
6 changes: 1 addition & 5 deletions node/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use cumulus_primitives_core::ParaId;
use fc_db::kv::frontier_database_dir;
use frame_benchmarking_cli::{BenchmarkCmd, SUBSTRATE_REFERENCE_HARDWARE};
use frontier_parachain_runtime::Block;
use log::{info, warn};
use log::info;
use sc_cli::{
ChainSpec, CliConfiguration, DefaultConfigurationValues, ImportParams, KeystoreParams,
NetworkParams, Result, SharedParams, SubstrateCli,
Expand Down Expand Up @@ -357,10 +357,6 @@ pub fn run() -> Result<()> {
info!("Parachain genesis state: {}", genesis_state);
info!("Is collating: {}", if config.role.is_authority() { "yes" } else { "no" });

if !collator_options.relay_chain_rpc_urls.is_empty() && !cli.relay_chain_args.is_empty() {
warn!("Detected relay chain node arguments together with --relay-chain-rpc-url. This command starts a minimal Polkadot node that only uses a network-related subset of all relay chain CLI options.");
}

crate::service::start_parachain_node(
config,
polkadot_config,
Expand Down
8 changes: 2 additions & 6 deletions node/src/eth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,14 @@ use std::{

use futures::{future, prelude::*};
// Substrate
use sc_client_api::{BlockchainEvents, StateBackendFor};
use sc_client_api::{BlockchainEvents};
use sc_executor::{NativeElseWasmExecutor, NativeExecutionDispatch};

use sc_network_sync::SyncingService;
use sc_service::{
error::Error as ServiceError, Configuration, TFullBackend, TFullClient, TaskManager,
};
use sp_api::ConstructRuntimeApi;
use sp_runtime::traits::BlakeTwo256;
// Frontier
pub use fc_consensus::FrontierBlockImport;
use fc_mapping_sync::{kv::MappingSyncWorker, SyncStrategy};
Expand Down Expand Up @@ -115,8 +114,6 @@ pub trait EthCompatRuntimeApiCollection:
sp_api::ApiExt<Block>
+ fp_rpc::EthereumRuntimeRPCApi<Block>
+ fp_rpc::ConvertTransactionRuntimeApi<Block>
where
<Self as sp_api::ApiExt<Block>>::StateBackend: sp_api::StateBackend<BlakeTwo256>,
{
}

Expand All @@ -125,7 +122,6 @@ where
Api: sp_api::ApiExt<Block>
+ fp_rpc::EthereumRuntimeRPCApi<Block>
+ fp_rpc::ConvertTransactionRuntimeApi<Block>,
<Self as sp_api::ApiExt<Block>>::StateBackend: sp_api::StateBackend<BlakeTwo256>,
{
}

Expand All @@ -151,7 +147,7 @@ pub async fn spawn_frontier_tasks<RuntimeApi, Executor>(
>,
RuntimeApi: Send + Sync + 'static,
RuntimeApi::RuntimeApi:
EthCompatRuntimeApiCollection<StateBackend = StateBackendFor<TFullBackend<Block>, Block>>,
EthCompatRuntimeApiCollection,
Executor: NativeExecutionDispatch + 'static,
{
// Spawn main mapping sync worker background task.
Expand Down
Loading

0 comments on commit b060503

Please sign in to comment.