Update docs (#261)

* typos and broken links

* evm runtime docs

* name change in code

* generic runtime description updated, and typos

* smart contract with zombienet

* quick start exported into another document and further formatting
This commit is contained in:
Özgün Özerk
2024-07-26 16:33:59 +03:00
committed by Gustavo Gonzalez
parent 1b67c98311
commit 9b9845920c
41 changed files with 1032 additions and 492 deletions
+1 -1
View File
@@ -10,7 +10,7 @@ Before starting development, please [create an issue](https://github.com/OpenZep
### Coding style
You can check out `[rustfmt.toml](https://github.com/OpenZeppelin/polkadot-runtime-template/blob/main/rustfmt.toml)`.
You can check out `[rustfmt.toml](https://github.com/OpenZeppelin/polkadot-runtime-templates/blob/main/generic-template/rustfmt.toml)`.
Also, we suggest enabling `format-on-save` feature of your code editor.
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 145 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 MiB

+3
View File
@@ -1,12 +1,15 @@
* General Guides
** xref:guides/quick_start.adoc[Quick Start]
** xref:guides/weights_fees.adoc[Weights & Fees]
** xref:guides/async_backing.adoc[Async Backing]
* EVM Template Guides
** xref:guides/contract_migration.adoc[Contract Migration]
** xref:guides/predeployed_contracts.adoc[Predeployed Contracts]
** xref:guides/testing_with_zombienet.adoc[Testing with Zombienet]
** xref:guides/rpc_differences.adoc[RPC Differences]
* Runtimes
** xref:runtimes/generic.adoc[Generic Runtime]
** xref:runtimes/evm.adoc[EVM Runtime]
* Runtime Descriptions
** xref:runtime/xcm_executor.adoc[XCM Executor]
* Pallet Specifications
@@ -16,7 +16,7 @@ cargo build --release --features="async-backing"
== How to test
You can always test it against Rococo (it should already have enabled async backing), but the fastest way is to test against a local relay chain. In our repository you can find a script, a config and a link:https://github.com/OpenZeppelin/polkadot-runtime-template/tree/main/zombienet-config[manual] that will run both relay chain and a parachain. To launch a parachain with a relay chain, you will need to run these commands:
You can always test it against Rococo (it should already have enabled async backing), but the fastest way is to test against a local relay chain. In our repository you can find a script, a config and a link:https://github.com/OpenZeppelin/polkadot-runtime-templates/tree/main/generic-template/zombienet-config[manual] that will run both relay chain and a parachain. To launch a parachain with a relay chain, you will need to run these commands:
* Get the Polkadot binaries:
** If you are using some Linux distro, you can download the binaries:
@@ -24,7 +24,7 @@ You can always test it against Rococo (it should already have enabled async back
```
./scripts/zombienet.sh init
```
** Otherwise, you have to build it from scratch. It takes
** Otherwise, you have to build it from scratch. It takes
+
```
./scripts/zombienet.sh build
@@ -33,4 +33,4 @@ You can always test it against Rococo (it should already have enabled async back
+
```
./scripts/zombienet.sh devnet
```
```
@@ -0,0 +1,125 @@
:source-highlighter: highlight.js
:highlightjs-languages: rust
:github-icon: pass:[<svg class="icon"><use href="#github-icon"/></svg>]
= Quick start
* Begin by visiting our link:https://github.com/OpenZeppelin/polkadot-runtime-templates[repository]. You can fork it, use it as a template, or simply clone it to your local directory.
```bash
git clone git@github.com:OpenZeppelin/polkadot-runtime-templates.git
```
* Move to the directory of the template you want to use. We will use the `generic runtime template` for this tutorial.
```bash
cd generic-template
```
* Build a release version of the runtime and node:
```bash
cargo build --release
```
* Receive some `ROC` from the link:https://paritytech.github.io/polkadot-testnet-faucet/[Rococo faucet]
* Reserve a ParaId on Rococo:
** Go to link:https://polkadot.js.org/apps[PolkadotJS]. Check that it points to Rococo testnet.
** Go to `Network` > `Parachains`
** Go to `Parathreads` tab
** Click the `+ ParaId` button
** Save a `parachain id` for the further usage.
** Click `Submit` and `Sign and Submit`.
* Generate and customize a chainspec:
** Generate a plain chainspec with this command:
+
```bash
./target/release/parachain-template-node build-spec --disable-default-bootnode > plain-parachain-chainspec.json
```
** Edit the chainspec:
*** Update `name`, `id` and `protocolId` to unique values.
*** Change `relay_chain` from `rococo-local` to `rococo`.
*** Change `para_id` and `parachainInfo.parachainId` from `1000` to the previously saved parachain id.
** Generate a raw chainspec with this command:
+
```bash
./target/release/parachain-template-node build-spec --chain plain-parachain-chainspec.json --disable-default-bootnode --raw > raw-parachain-chainspec.json
```
* Run two nodes and wait until it syncs with the Rococo relay chain. This can take a fairly long time(up to 2 days), so we can use the `fast-unsafe` flag to make the process faster since we are on a testnet(~ 3 hours). `fast` downloads the blocks without executing the transactions, and `unsafe` skips downloading the state proofs(which we are ok with since it is Rococo).
+
```bash
./target/release/parachain-template-node \
--alice \
--collator \
--force-authoring \
--chain raw-parachain-chainspec.json \
--base-path <path to datadir> \
--port 40333 \
--rpc-port 8844 \
-- \
--execution wasm \
--chain <path to the Rococo chainspec> \
--port 30343 \
--rpc-port 9977 \
--sync fast-unsafe
```
+
```bash
./target/release/parachain-template-node \
--bob \
--collator \
--force-authoring \
--chain raw-parachain-chainspec.json \
--base-path <path to datadir> \
--port 40333 \
--rpc-port 8845 \
-- \
--execution wasm \
--chain <path to the Rococo chainspec> \
--port 30343 \
--rpc-port 9977 \
--sync fast-unsafe
```
** `<path to datadir>` is where the downloaded chain state will be stored. It can be any folder on your computer.
** `<path to the Rococo chainspec>` is where your Rococo chainspec is stored. You can download this file from the link:https://github.com/paritytech/polkadot-sdk/blob/release-polkadot-v1.10.0/polkadot/node/service/chain-specs/rococo.jsonofficial[official Polkadot sdk repository].
* Register a parathread:
** Generate a genesis state:
+
```bash
./target/release/parachain-template-node export-genesis-state --chain raw-parachain-chainspec.json para-<paraId>-genesis-state
```
** Generate a genesis wasm:
+
```bash
./target/release/parachain-template-node export-genesis-wasm --chain raw-parachain-chainspec.json para-<paraId>-wasm
```
** Go to link:https://polkadot.js.org/apps[PolkadotJS]. Check that it points to Rococo testnet.
** Go to `Network` > `Parachains`.
** Go to `Parathreads` tab.
** Click the `+ ParaThread` button.
** Insert `para-<paraId>-wasm` to `code` field.
** Insert `para-<paraId>-genesis-state` to `initial state` field.
** Click `Submit` and `Sign and Submit`.
* When a parachain gets synced with a relaychain, you may start producing blocks as a parathread:
** Create some transaction with a PolkadotJS pointing to your parachain setup.
** With a PolkadotJS pointing to Rococo go to `Developer` > `Extrinsics`.
** Submit an extrinsic `onDemandAssignmentProvider.placeOrderAllowDeath` or `onDemandAssignmentProvider.placeOrderKeepAlive`:
*** `maxAmount` should be not less than 10_000_000 and it is amount of 0.00001 ROC. It is an amount of ROC paid for the block.
*** `paraId` should be set to your parachain id.
*** Click `Submit` and `Sign and Submit`.
** In some time your parathread will produce a block and in one of the next blocks of Rococo there will be an inclusion of this block
== What's next?
- Read our general guides to understand more about the concepts of runtime development.
- Learn more about the runtime configuration. Currently, we have two runtime templates: xref:guides/runtimes/generic.adoc[Generic Runtime Template] and xref:runtimes/evm.adoc[EVM Runtime Template].
- Explore the documentation for pallets. It may be useful if you are considering building a frontend for your parachain.
@@ -0,0 +1,351 @@
:source-highlighter: highlight.js
:highlightjs-languages: rust
:github-icon: pass:[<svg class="icon"><use href="#github-icon"/></svg>]
= Testing Solidity Smart Contracts with Zombienet
In this tutorial, we will demonstrate how to deploy your parachain using Zombienet, and test the functionalities of your parachain.
Below are the main steps of this demo:
. Deploy our parachain against the locally simulated rococo testnet by Zombienet.
. Deploy a Solidity smart contract on our parachain.
. Successfully invoke the Solidity smart contract deployed on our parachain.
== Step 1: Deploy The Parachain
. git clone https://github.com/OpenZeppelin/polkadot-runtime-templates
. move to evm template directory
+
```bash
cd evm-template
```
. replace the content of `zombinet-config/devnet.toml` with:
+
```rust
[relaychain]
chain = "rococo-local"
default_command = "./bin-v1.6.0/polkadot"
[[relaychain.nodes]]
name = "alice"
validator = true
[[relaychain.nodes]]
name = "bob"
validator = true
[relaychain.genesis.runtimeGenesis.patch.configuration.config]
scheduling_lookahead = 2
[relaychain.genesis.runtimeGenesis.patch.configuration.config.async_backing_params]
max_candidate_depth = 3
allowed_ancestry_len = 2
```
. build the zombienet:
+
```bash
./scripts/zombienet.sh build
```
+
.if you came across this error (click to expand):
[%collapsible]
====
```bash
error[E0635]: unknown feature `stdsimd`
--> /Users/ozgunozerk/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ahash-0.7.6/src/lib.rs:33:42
|
33 | #![cfg_attr(feature = "stdsimd", feature(stdsimd))]
```
run the below command for every version of the `ahash`:
```bash
cargo update -p ahash
```
====
+
.or if you came across this error (click to expand):
[%collapsible]
====
```rust
assertion failed [block != nullptr]: BasicBlock requested for unrecognized address
```
just re-run 🙂
====
. run the zombinet:
+
```bash
./scripts/zombienet.sh devnet
```
. build it with `async-backing` feature:
+
```bash
cargo build --release --features="async-backing"
```
. copy the `Direct Link` from `Alice's` tab from Zombienet TUI:
+
image::alice-direct-link.png[Alice Direct Link]
. open the link with Chrome. [`polkadot.js.org/apps`](http://polkadot.js.org/apps) As of 2024 July, it doesnt work on Safari and Brave. And it might be buggy in Firefox. So, open it with Chrome.
. Reserve a `ParaId` on Zombienet:
.. Go to `Network` > `Parachains`
.. Go to `Parathreads` tab
.. Click the `+ ParaId` button
.. Save a `parachain id` for the further usage.
.. Click `Submit` and `Sign and Submit` (you can use `Alice` as the account).
. Preparing necessary files to become a Parachain:
.. Generate a plain chainspec:
+
```bash
./target/release/parachain-template-node build-spec --disable-default-bootnode > plain-parachain-chainspec.json
```
+
```bash
./parachain-template-node build-spec --disable-default-bootnode > plain-parachain-chainspec.json
```
.. Edit the chainspec:
... Update `name`, `id` and `protocolId` to unique values (optional).
... Change `para_id` and `parachainInfo.parachainId` from `1000` to the previously saved parachain id (probably 2000 if thats your first time ;) ).
... Edit the `evmChainId.chainId` to the value of your choice. Try to select a value that has no existing EVM chain assigned to it (should be ok to leave as is for the most cases).
.. Generate a raw chainspec:
+
```bash
./target/release/parachain-template-node build-spec --chain plain-parachain-chainspec.json --disable-default-bootnode --raw > raw-parachain-chainspec.json
```
+
```bash
./parachain-template-node build-spec --chain plain-parachain-chainspec.json --disable-default-bootnode --raw > raw-parachain-chainspec.json
```
.. Generate the genesis state:
+
```bash
./target/release/parachain-template-node export-genesis-state --chain raw-parachain-chainspec.json > genesis-state
```
+
```bash
./parachain-template-node export-genesis-state --chain raw-parachain-chainspec.json > genesis-state
```
.. Generate the validation code:
+
```bash
./target/release/parachain-template-node export-genesis-wasm --chain raw-parachain-chainspec.json > genesis-wasm
```
+
```bash
./parachain-template-node export-genesis-wasm --chain raw-parachain-chainspec.json > genesis-wasm
```
. Registering the Parachain:
.. Go back to `polkadot.js.org/apps` (remember Chrome). Go to `Developer/Sudo`.
.. select `pasasSudoWrapper` and `sudoScheduleParaInitialize(id, genesis)`
.. enter the reserved id (2000) to `id` field
.. enable `file upload` for both `genesisHead` and `validationCode` → because we will upload files for these.
.. select `Yes` for `paraKind` → meaning when we register our parachain, it will be a parachain rather than a parathread.
.. drag&drop your `genesis-state` file generated in step `10.d` into `genesisHead` field (good luck with the aiming)
.. drag&drop your `genesis-wasm` file generated in `10.e` into `validationCode` field
.. It should look like below:
+
image::register-parachain.png[Register Parachain]
.. `Submit Sudo`!
. copy the path to `chain-spec` from zombienet terminal from `Bob` (beware, this file is changing every time you spin up a new zombienet):
+
image::zombie-chain-spec.png[Zombie Chain Spec]
. run the node, and provide the `chain-spec` you copied from the last step into `--chain` part:
* be sure to clear your storage if you were running a node before
+
```rust
./target/release/parachain-template-node \
--alice \
--collator \
--force-authoring \
--chain raw-parachain-chainspec.json \
--base-path storage/alice \
--port 40333 \
--rpc-port 8844 \
-- \
--execution wasm \
--chain /var/folders/...{redacted}.../rococo-local.json \
--port 30343 \
--rpc-port 9977
```
+
```rust
./parachain-template-node \
--alice \
--collator \
--force-authoring \
--chain raw-parachain-chainspec.json \
--base-path storage/alice \
--port 40333 \
--rpc-port 8844 \
-- \
--execution wasm \
--chain /var/folders/kl/404s241d4_93gz8mh4cg4cz80000gn/T/zombie-a91587a2ece24961799f824da68f45a8_-9146-fqbCFiePyOHm/bob/cfg/rococo-local.json \
--port 30343 \
--rpc-port 9977
```
+
```rust
--chain /var/folders/kl/404s241d4_93gz8mh4cg4cz80000gn/T/zombie-a91587a2ece24961799f824da68f45a8_-9146-fqbCFiePyOHm/bob/cfg/rococo-local.json
```
. your node should be running without any problem, and should see block production in your node terminal!
+
image::node-success.png[Node Success]
== Step 2: Deploy a Solidity Smart Contract
. Install Foundry with: `curl -L [https://foundry.paradigm.xyz](https://foundry.paradigm.xyz/) | bash`
. have a smart contract file ready, any smart contract of your choice! We will go with a cute `HelloWorld.sol` smart contract for this tutorial:
+
```solidity
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
contract HelloWorld {
string public greeting = "Hello, World!";
function getGreeting() public view returns (string memory) {
return greeting;
}
}
```
. Create a new javascript project with the below files:
.. `package.json`:
+
```solidity
{
"name": "ts-wallet",
"version": "1.0.0",
"description": "",
"main": "index.js",
"type": "module",
"scripts": {
"exec": "node index.js",
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"dependencies": {
"web3": "^4.8.0"
}
}
```
.. `sanity_check.js`:
+
```solidity
import { Web3 } from "web3";
const web3 = new Web3("ws://127.0.0.1:8844");
console.log("Balance:");
web3.eth.getBalance("0xe04cc55ebee1cbce552f250e85c57b70b2e2625b").then(console.log);
let raw = await web3.eth.accounts.signTransaction({
gas: 21000,
gasPrice: 10000000000,
from: "0xe04cc55ebee1cbce552f250e85c57b70b2e2625b",
to: "0x7c98a1801f0B28dF559bCd828fc67Bd6ab558074",
value: '100000000000000000'
}, "0xcb6df9de1efca7a3998a8ead4e02159d5fa99c3e0d4fd6432667390bb4726854");
let res = await web3.eth.sendSignedTransaction(raw.rawTransaction);
console.log("Transaction details:");
console.log(res);
```
.. `invoke_smart_contract.js`:
+
```solidity
import { Web3 } from "web3";
import { MyAbi } from "./abi.js";
const web3 = new Web3("ws://127.0.0.1:8844");
let contract = new web3.eth.Contract(MyAbi, "0x4045F03B68919da2c440F023Fd7cE2982BfD3C03");
let s = await contract.methods.getGreeting().call();
console.log(s);
```
.. `abi.js`:
+
```solidity
export var MyAbi = [
{
"type": "function",
"name": "getGreeting",
"inputs": [],
"outputs": [
{
"name": "",
"type": "string",
"internalType": "string"
}
],
"stateMutability": "view"
},
{
"type": "function",
"name": "greeting",
"inputs": [],
"outputs": [
{
"name": "",
"type": "string",
"internalType": "string"
}
],
"stateMutability": "view"
}
];
```
. run the below command, and you should see the balance, and then the transaction details printed, proving everything works so far!
+
```solidity
node sanity_check.js
```
. open a terminal instance where the current directory has the `HelloWorld.sol` file, and run:
+
```solidity
forge create --rpc-url http://localhost:8844 --private-key 0xcb6df9de1efca7a3998a8ead4e02159d5fa99c3e0d4fd6432667390bb4726854 HelloWorld.sol:HelloWorld
```
+
* dont forget to copy the address this contract deployed to!
== Step 3: Invoke The Solidity Smart Contract
. replace the contract address in `invoke_smart_contract.js` with the address you copied!
. build the `abi` of the smart contract with:
+
```solidity
forge build --silent && jq '.abi' ./out/HelloWorld.sol/HelloWorld.json
```
. Surprise! We already give you the abi of this in `abi.js` file in step `3`. If you used another contract than `HelloWorld`, replace that `abi.js` files content with your contracts `abi`.
. run the below command, and you should see your smart contract in action:
+
```solidity
node invoke_smart_contract.js
```
+6 -118
View File
@@ -5,124 +5,12 @@
A collection of runtimes that describe parachains with different purposes.
== Quick start
=== Runtimes
* xref:guides/runtimes/generic.adoc[Generic Runtime Template]
* xref:runtimes/evm.adoc[EVM Runtime Template]
* Begin by visiting our link:https://github.com/OpenZeppelin/polkadot-runtime-template[repository]. You can fork it, use it as a template, or simply clone it to your local directory.
```bash
git clone git@github.com:OpenZeppelin/polkadot-runtime-template.git
```
* Move to the directory of the template you want to use. We will use the `generic runtime template` for this tutorial.
```bash
cd generic-template
```
=== A Couple of Good Starting Places
* xref:guides/quick_start.adoc[Quick Start]: a generic parachain runtime that works out of the box. It has all the must have features, and allows further customization based on your project's needs. Generic Runtime Template also serves as the base for our other runtime templates.
* xref:guides/testing_with_zombienet.adoc[Testing with Zombienet]: a more opinionated parachain runtime template that maximizes Ethereum compatibility by using `AccountId20` and configures a local EVM instance. You can easily migrate/deploy Solidity Smart Contracts to this one.
* Build a release version of the runtime and node:
```bash
cargo build --release
```
* Receive some `ROC` from the link:https://paritytech.github.io/polkadot-testnet-faucet/[Rococo faucet]
* Reserve a ParaId on Rococo:
** Go to link:https://polkadot.js.org/apps[PolkadotJS]. Check that it points to Rococo testnet.
** Go to `Network` > `Parachains`
** Go to `Parathreads` tab
** Click the `+ ParaId` button
** Save a `parachain id` for the further usage.
** Click `Submit` and `Sign and Submit`.
* Generate and customize a chainspec:
** Generate a plain chainspec with this command:
+
```bash
./target/release/parachain-template-node build-spec --disable-default-bootnode > plain-parachain-chainspec.json
```
** Edit the chainspec:
*** Update `name`, `id` and `protocolId` to unique values.
*** Change `relay_chain` from `rococo-local` to `rococo`.
*** Change `para_id` and `parachainInfo.parachainId` from `1000` to the previously saved parachain id.
** Generate a raw chainspec with this command:
+
```bash
./target/release/parachain-template-node build-spec --chain plain-parachain-chainspec.json --disable-default-bootnode --raw > raw-parachain-chainspec.json
```
* Run two nodes and wait until it syncs with the Rococo relay chain. This can take a fairly long time(up to 2 days), so we can use the `fast-unsafe` flag to make the process faster since we are on a testnet(~ 3 hours). `fast` downloads the blocks without executing the transactions, and `unsafe` skips downloading the state proofs(which we are ok with since it is Rococo).
+
```bash
./target/release/parachain-template-node \
--alice \
--collator \
--force-authoring \
--chain raw-parachain-chainspec.json \
--base-path <path to datadir> \
--port 40333 \
--rpc-port 8844 \
-- \
--execution wasm \
--chain <path to the Rococo chainspec> \
--port 30343 \
--rpc-port 9977 \
--sync fast-unsafe
```
+
```bash
./target/release/parachain-template-node \
--bob \
--collator \
--force-authoring \
--chain raw-parachain-chainspec.json \
--base-path <path to datadir> \
--port 40333 \
--rpc-port 8845 \
-- \
--execution wasm \
--chain <path to the Rococo chainspec> \
--port 30343 \
--rpc-port 9977 \
--sync fast-unsafe
```
** `<path to datadir>` is where the downloaded chain state will be stored. It can be any folder on your computer.
** `<path to the Rococo chainspec>` is where your Rococo chainspec is stored. You can download this file from the link:https://github.com/paritytech/polkadot-sdk/blob/release-polkadot-v1.10.0/polkadot/node/service/chain-specs/rococo.jsonofficial[official Polkadot sdk repository].
* Register a parathread:
** Generate a genesis state:
+
```bash
./target/release/parachain-template-node export-genesis-state --chain raw-parachain-chainspec.json para-<paraId>-genesis-state
```
** Generate a genesis wasm:
+
```bash
./target/release/parachain-template-node export-genesis-wasm --chain raw-parachain-chainspec.json para-<paraId>-wasm
```
** Go to link:https://polkadot.js.org/apps[PolkadotJS]. Check that it points to Rococo testnet.
** Go to `Network` > `Parachains`.
** Go to `Parathreads` tab.
** Click the `+ ParaThread` button.
** Insert `para-<paraId>-wasm` to `code` field.
** Insert `para-<paraId>-genesis-state` to `initial state` field.
** Click `Submit` and `Sign and Submit`.
* When a parachain gets synced with a relaychain, you may start producing blocks as a parathread:
** Create some transaction with a PolkadotJS pointing to your parachain setup.
** With a PolkadotJS pointing to Rococo go to `Developer` > `Extrinsics`.
** Submit an extrinsic `onDemandAssignmentProvider.placeOrderAllowDeath` or `onDemandAssignmentProvider.placeOrderKeepAlive`:
*** `maxAmount` should be not less than 10_000_000 and it is amount of 0.00001 ROC. It is an amount of ROC paid for the block.
*** `paraId` should be set to your parachain id.
*** Click `Submit` and `Sign and Submit`.
** In some time your parathread will produce a block and in one of the next blocks of Rococo there will be an inclusion of this block
== What's next?
- Read our general guides to understand more about the concepts of runtime development.
// TODO: change if we have more runtimes, add a link to the runtime doc
- Learn more about the runtime configuration. Currently, we have a single runtime template (generic one), and you can find documentation for it here.
- Explore the documentation for pallets. It may be useful if you are considering building a frontend for your parachain.
+155
View File
@@ -0,0 +1,155 @@
:source-highlighter: highlight.js
:highlightjs-languages: rust
:github-icon: pass:[<svg class="icon"><use href="#github-icon"/></svg>]
= Generic Runtime
== Purpose
EVM Runtime Template is built on top of the link:generic.adoc[Generic Runtime Template].
The purpose of this template is to provide EVM compatibilities embedded into the runtime.
With this template, you can:
* Deploy Solidity Smart Contracts to your runtime.
* Interact with the deployed Smart Contracts.
* Deploy and interact with ERC20 tokens.
* Migrate your existing dAPP from Ethereum ecosystem to Polkadot ecosystem.
The pallet list is constructed by the contributions of Parity, the community, and OpenZeppelin.
To maximize the compatibility with EVM, we decided to use `AccountId20` type instead of `AccountId32`.
This choice allowed us to use the signature scheme compatible with Ethereum (ECDSA).
Which, in turn result in better compatibility with tools across the Ethereum ecosystem including wallets, developer tooling, etc.
Metamask integration for example is way simpler for chains with the Ethereum account and signature type.
== Configuration
=== System Support
.click to expand
[%collapsible]
====
* https://paritytech.github.io/polkadot-sdk/master/frame_system/index.html#[frame_system] is responsible from creating the runtime, initializing the storage, and providing the base functionality for the runtime.
* https://paritytech.github.io/polkadot-sdk/master/cumulus_pallet_parachain_system/index.html#[cumulus_pallet_parachain_system] handles low-level details of being a parachain.
* https://paritytech.github.io/polkadot-sdk/master/pallet_timestamp/index.html#[pallet_timestamp] provides a way for consensus systems to set and check the onchain time.
* https://docs.rs/staging-parachain-info/latest/staging_parachain_info/index.html#[parachain_info] provides a way for parachains to report their parachain id and the relay chain block number.
* https://docs.rs/pallet-proxy/latest/pallet_proxy/#[pallet_proxy] enables delegation of rights to execute certain call types from one origin to another.
* https://paritytech.github.io/polkadot-sdk/master/pallet_utility/index.html#[pallet_utility] contains two basic pieces of functionality:
** Batch dispatch: A stateless operation, allowing any origin to execute multiple calls in a single dispatch. This can be useful to amalgamate proposals, combining `set_code` with corresponding `set_storage`s, for efficient multiple payouts with just a single signature verify, or in combination with one of the other two dispatch functionality.
*** https://paritytech.github.io/polkadot-sdk/master/pallet_utility/pallet/struct.Pallet.html#method.force_batch[force_batch]: Sends a batch of dispatch calls. Errors are allowed and wont interrupt
*** https://paritytech.github.io/polkadot-sdk/master/pallet_utility/pallet/struct.Pallet.html#method.batch[batch]: Sends a batch of dispatch calls. This will return `Ok` in all circumstances. To determine the success of the batch, an event is deposited. If a call failed and the batch was interrupted, then the `BatchInterrupted` event is deposited, along with the number of successful calls made and the error of the failed call. If all were successful, then the `BatchCompleted` event is deposited.
*** https://paritytech.github.io/polkadot-sdk/master/pallet_utility/pallet/struct.Pallet.html#method.batch_all[batch_all]: Send a batch of dispatch calls and atomically execute them. The whole transaction will rollback and fail if any of the calls failed.
** Pseudonymal dispatch: A stateless operation, allowing a signed origin to execute a call from an alternative signed origin. Each account has 2 * 2**16 possible “pseudonyms” (alternative account IDs) and these can be stacked. This can be useful as a key management tool, where you need multiple distinct accounts (e.g. as controllers for many staking accounts), but where its perfectly fine to have each of them controlled by the same underlying keypair. Derivative accounts are, for the purposes of proxy filtering considered exactly the same as the origin and are thus hampered with the origins filters.
* https://docs.rs/pallet-multisig/latest/pallet_multisig/#[pallet_multisig] enables multi-signature operations in your runtime. This module allows multiple signed origins (accounts) to coordinate and dispatch a call. For the call to execute, the threshold number of accounts from the set (signatories) must approve it.
* https://docs.rs/pallet-scheduler/latest/pallet_scheduler/#[pallet_scheduler] schedules runtime calls.
* https://docs.rs/pallet-preimage/latest/pallet_preimage/#[preimage] allows for the users and the runtime to store the preimage of a hash on chain. This can be used by other pallets for storing and managing large byte-blobs.
====
=== Monetary
.click to expand
[%collapsible]
====
* https://docs.rs/pallet-balances/latest/pallet_balances/#[pallet_balances] provides functions for:
** Getting and setting free balances.
** Retrieving total, reserved and unreserved balances.
** Repatriating a reserved balance to a beneficiary account that exists.
** Transferring a balance between accounts (when not reserved).
** Slashing an account balance.
** Account creation and removal.
** Managing total issuance.
** Setting and managing locks.
* https://docs.rs/pallet-transaction-payment/latest/pallet_transaction_payment/#[pallet_transaction_payment] provides the basic logic needed to pay the absolute minimum amount needed for a transaction to be included. This includes:
** *base fee*: This is the minimum amount a user pays for a transaction. It is declared as a base *weight* in the runtime and converted to a fee using `WeightToFee`.
** *weight fee*: A fee proportional to amount of weight a transaction consumes.
** *length fee*: A fee proportional to the encoded length of the transaction.
** *tip*: An optional tip. Tip increases the priority of the transaction, giving it a higher chance to be included by the transaction queue.
* https://paritytech.github.io/polkadot-sdk/master/pallet_assets/index.html#[pallet_assets] deals with sets of assets implementing fungible traits, via [fungibles] traits in a simple, secure manner. This pallet makes heavy use of concepts such as Holds and Freezes from the [frame_support::traits::fungible] traits, therefore you should read and understand those docs as a prerequisite to understanding this pallet.
* https://docs.rs/pallet-treasury/latest/pallet_treasury/#[pallet_treasury] provides a “pot” of funds that can be managed by stakeholders in the system and a structure for making spending proposals from this pot.
* https://github.com/moonbeam-foundation/moonbeam/blob/master/pallets/asset-manager/src/lib.rs[#pallet_asset_manager] allows to register new assets if certain conditions are met.
====
=== Governance
.click to expand
[%collapsible]
====
* https://docs.rs/pallet-sudo/latest/pallet_sudo/#[pallet_sudo] provides a way to execute privileged runtime calls using a specified sudo (“superuser do”) account.
* https://docs.rs/pallet-conviction-voting/latest/pallet_conviction_voting/#[pallet_conviction_voting] manages actual voting in polls
* https://docs.rs/pallet-referenda/latest/pallet_referenda/#[pallet_referenda] executes referenda. No voting logic is present here, and the Polling and PollStatus traits are used to allow the voting logic (likely in a pallet) to be utilized.
* https://github.com/OpenZeppelin/polkadot-runtime-templates/blob/main/evm-template/runtime/src/configs/governance/origins.rs#[pallet_custom_origins] allows custom origins for governance. // TODO: double check this, is it really our own pallet, or just copy paste?
* https://docs.rs/pallet-whitelist/latest/pallet_whitelist/index.html#[pallet_whitelist] allows some configurable origin: `Config::WhitelistOrigin` to whitelist some hash of a call, and allows another configurable origin: `Config::DispatchWhitelistedOrigin` to dispatch them with the root origin.
====
=== Collator support
.click to expand
[%collapsible]
====
* https://docs.rs/pallet-authorship/latest/pallet_authorship/#[pallet_authorship] provides authorship tracking for FRAME runtimes. This tracks the current author of the block and recent uncles.
* https://paritytech.github.io/polkadot-sdk/master/pallet_collator_selection/index.html#[pallet_collator_selection] - manages the collators of a parachain. **Collation is *not* a secure activity** and this pallet does not implement any game-theoretic mechanisms to meet BFT safety assumptions of the chosen set. This pallet can:
** set invulnerable candidates (fixed candidates)
** set desired candidates (ideal number of non-fixed)
** set candidacy bond
** remove invulnerability (turn candidate into not fixed)
** and many more (all related to collators)
* https://paritytech.github.io/polkadot-sdk/master/pallet_session/index.html#[pallet_session] allows validators to manage their session keys, provides a function for changing the session length, and handles session rotation.
* https://docs.rs/pallet-aura/latest/pallet_aura/#[pallet_aura] extends Aura consensus by managing offline reporting. It can:
** get the current slot
** get the slot duration
** change and initialize authorities
** ensure the correctness of the state of this pallet
* https://paritytech.github.io/polkadot-sdk/master/cumulus_pallet_aura_ext/index.html#[cumulus_pallet_aura_ext] extends the Substrate AuRa pallet to make it compatible with parachains. It provides the Pallet, the Config and the GenesisConfig.
====
=== XCM Helpers
.click to expand
[%collapsible]
====
* https://paritytech.github.io/polkadot-sdk/master/cumulus_pallet_xcmp_queue/index.html#[cumulus_pallet_xcmp_queue] Responsible for the Queues (both incoming and outgoing) for XCMP messages. This pallet does not actually receive or send messages. Its responsibility is to place the incoming and outgoing XCMP messages in their respective queues and manage these queues.
* https://docs.rs/pallet-xcm/6.0.0/pallet_xcm/#[pallet_xcm] is responsible for filtering, routing, and executing incoming XCM.
* https://paritytech.github.io/polkadot-sdk/master/cumulus_pallet_xcm/index.html#[cumulus_pallet_xcm] is responsible from detecting and ensuring whether XCM's are coming from *Relay* or *Sibling* chain.
* https://docs.rs/pallet-message-queue/latest/pallet_message_queue/#[MessageQueue] provides generalized message queuing and processing capabilities on a per-queue basis for arbitrary use-cases.
====
=== EVM
* https://docs.rs/pallet-ethereum/latest/pallet_ethereum/#[Ethereum] works together with EVM pallet to provide full emulation for Ethereum block processing.
* https://docs.rs/pallet-evm/5.0.0/pallet_evm/#[EVM] allows unmodified EVM code to be executed in a Substrate-based blockchain.
* https://github.com/polkadot-evm/frontier/blob/master/frame/base-fee/src/lib.rs#[BaseFee] dynamically adjusts the `BaseFeePerGas` based on elasticity (zero elasticity means constant `BaseFeePerGas`).
* https://github.com/polkadot-evm/frontier/blob/master/frame/evm-chain-id/src/lib.rs#[EvmChainId] stores the numeric Ethereum-style chain id in the runtime. This pallet can simplify setting up multiple networks with different chain ID by configuring the chain spec without requiring changes to the runtime config.
+21 -5
View File
@@ -5,7 +5,7 @@
== Purpose
Polkadot Runtime Template is constructed with the purpose of providing the most generic template that is working out of the box.
Generic Runtime Template is constructed with the purpose of providing the most generic template that is working out of the box.
The pallet list is constructed by the contributions of Parity, the community, and OpenZeppelin.
@@ -37,8 +37,6 @@ To demystify the hard concepts, we provided a documentation, in which you can fi
* https://docs.rs/staging-parachain-info/latest/staging_parachain_info/index.html#[parachain_info] provides a way for parachains to report their parachain id and the relay chain block number.
* https://docs.rs/pallet-multisig/latest/pallet_multisig/#[pallet_multisig] enables multi-signature operations in your runtime. This module allows multiple signed origins (accounts) to coordinate and dispatch a call. For the call to execute, the threshold number of accounts from the set (signatories) must approve it.
* https://docs.rs/pallet-proxy/latest/pallet_proxy/#[pallet_proxy] enables delegation of rights to execute certain call types from one origin to another.
* https://paritytech.github.io/polkadot-sdk/master/pallet_utility/index.html#[pallet_utility] contains two basic pieces of functionality:
@@ -49,6 +47,12 @@ To demystify the hard concepts, we provided a documentation, in which you can fi
*** https://paritytech.github.io/polkadot-sdk/master/pallet_utility/pallet/struct.Pallet.html#method.batch_all[batch_all]: Send a batch of dispatch calls and atomically execute them. The whole transaction will rollback and fail if any of the calls failed.
** Pseudonymal dispatch: A stateless operation, allowing a signed origin to execute a call from an alternative signed origin. Each account has 2 * 2**16 possible “pseudonyms” (alternative account IDs) and these can be stacked. This can be useful as a key management tool, where you need multiple distinct accounts (e.g. as controllers for many staking accounts), but where its perfectly fine to have each of them controlled by the same underlying keypair. Derivative accounts are, for the purposes of proxy filtering considered exactly the same as the origin and are thus hampered with the origins filters.
* https://docs.rs/pallet-multisig/latest/pallet_multisig/#[pallet_multisig] enables multi-signature operations in your runtime. This module allows multiple signed origins (accounts) to coordinate and dispatch a call. For the call to execute, the threshold number of accounts from the set (signatories) must approve it.
* https://docs.rs/pallet-scheduler/latest/pallet_scheduler/#[pallet_scheduler] schedules runtime calls.
* https://docs.rs/pallet-preimage/latest/pallet_preimage/#[preimage] allows for the users and the runtime to store the preimage of a hash on chain. This can be used by other pallets for storing and managing large byte-blobs.
====
=== Monetary
@@ -72,6 +76,10 @@ To demystify the hard concepts, we provided a documentation, in which you can fi
** *length fee*: A fee proportional to the encoded length of the transaction.
** *tip*: An optional tip. Tip increases the priority of the transaction, giving it a higher chance to be included by the transaction queue.
* https://paritytech.github.io/polkadot-sdk/master/pallet_assets/index.html#[pallet_assets] deals with sets of assets implementing fungible traits, via [fungibles] traits in a simple, secure manner. This pallet makes heavy use of concepts such as Holds and Freezes from the [frame_support::traits::fungible] traits, therefore you should read and understand those docs as a prerequisite to understanding this pallet.
* https://docs.rs/pallet-treasury/latest/pallet_treasury/#[pallet_treasury] provides a “pot” of funds that can be managed by stakeholders in the system and a structure for making spending proposals from this pot.
====
=== Governance
@@ -80,7 +88,15 @@ To demystify the hard concepts, we provided a documentation, in which you can fi
====
* https://docs.rs/pallet-sudo/latest/pallet_sudo/#[pallet_sudo] provides a way to execute privileged runtime calls using a specified sudo (“superuser do”) account.
* https://docs.rs/pallet-treasury/latest/pallet_treasury/#[pallet_treasury] provides a “pot” of funds that can be managed by stakeholders in the system and a structure for making spending proposals from this pot.
* https://docs.rs/pallet-conviction-voting/latest/pallet_conviction_voting/#[pallet_conviction_voting] manages actual voting in polls
* https://docs.rs/pallet-referenda/latest/pallet_referenda/#[pallet_referenda] executes referenda. No voting logic is present here, and the Polling and PollStatus traits are used to allow the voting logic (likely in a pallet) to be utilized.
* https://github.com/OpenZeppelin/polkadot-runtime-templates/blob/main/evm-template/runtime/src/configs/governance/origins.rs#[pallet_custom_origins] allows custom origins for governance. // TODO: double check this, is it really our own pallet, or just copy paste?
* https://docs.rs/pallet-whitelist/latest/pallet_whitelist/index.html#[pallet_whitelist] allows some configurable origin: `Config::WhitelistOrigin` to whitelist some hash of a call, and allows another configurable origin: `Config::DispatchWhitelistedOrigin` to dispatch them with the root origin.
====
@@ -121,6 +137,6 @@ To demystify the hard concepts, we provided a documentation, in which you can fi
* https://paritytech.github.io/polkadot-sdk/master/cumulus_pallet_xcm/index.html#[cumulus_pallet_xcm] is responsible from detecting and ensuring whether XCM's are coming from *Relay* or *Sibling* chain.
* https://paritytech.github.io/polkadot-sdk/master/cumulus_pallet_dmp_queue/index.html#[cumulus_pallet_dmp_queue] is **DEPRECATED**. This pallet used to implement a message queue for downward messages from the relay-chain.
* https://docs.rs/pallet-message-queue/latest/pallet_message_queue/#[MessageQueue] provides generalized message queuing and processing capabilities on a per-queue basis for arbitrary use-cases.
====
+158 -158
View File
@@ -3196,6 +3196,163 @@ dependencies = [
"sha3",
]
[[package]]
name = "evm-runtime-template"
version = "0.1.2"
dependencies = [
"assets-common",
"cumulus-pallet-aura-ext",
"cumulus-pallet-parachain-system",
"cumulus-pallet-session-benchmarking",
"cumulus-pallet-xcm",
"cumulus-pallet-xcmp-queue",
"cumulus-primitives-aura",
"cumulus-primitives-core",
"cumulus-primitives-storage-weight-reclaim",
"cumulus-primitives-utility",
"fp-account",
"fp-evm",
"fp-rpc",
"fp-self-contained",
"frame-benchmarking",
"frame-executive",
"frame-support",
"frame-system",
"frame-system-benchmarking",
"frame-system-rpc-runtime-api",
"frame-try-runtime",
"hex-literal",
"log",
"pallet-asset-manager",
"pallet-assets",
"pallet-aura",
"pallet-authorship",
"pallet-balances",
"pallet-base-fee",
"pallet-collator-selection",
"pallet-conviction-voting",
"pallet-ethereum",
"pallet-evm",
"pallet-evm-chain-id",
"pallet-evm-precompile-modexp",
"pallet-evm-precompile-sha3fips",
"pallet-evm-precompile-simple",
"pallet-message-queue",
"pallet-multisig",
"pallet-preimage",
"pallet-proxy",
"pallet-referenda",
"pallet-scheduler",
"pallet-session",
"pallet-sudo",
"pallet-timestamp",
"pallet-transaction-payment",
"pallet-transaction-payment-rpc-runtime-api",
"pallet-treasury",
"pallet-utility",
"pallet-whitelist",
"pallet-xcm",
"parachains-common",
"parity-scale-codec",
"polkadot-parachain-primitives",
"polkadot-runtime-common",
"scale-info",
"smallvec",
"sp-api",
"sp-arithmetic",
"sp-block-builder",
"sp-consensus-aura",
"sp-core",
"sp-genesis-builder",
"sp-inherents",
"sp-io",
"sp-offchain",
"sp-runtime",
"sp-session",
"sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-v1.10.0)",
"sp-transaction-pool",
"sp-version",
"staging-parachain-info",
"staging-xcm",
"staging-xcm-builder",
"staging-xcm-executor",
"substrate-wasm-builder",
"xcm-primitives",
]
[[package]]
name = "evm-template-node"
version = "0.1.2"
dependencies = [
"clap",
"color-print",
"cumulus-client-cli",
"cumulus-client-collator",
"cumulus-client-consensus-aura",
"cumulus-client-consensus-common",
"cumulus-client-consensus-proposer",
"cumulus-client-service",
"cumulus-primitives-core",
"cumulus-primitives-parachain-inherent",
"cumulus-relay-chain-interface",
"evm-runtime-template",
"fc-api",
"fc-consensus",
"fc-db",
"fc-mapping-sync",
"fc-rpc",
"fc-rpc-core",
"fc-storage",
"fp-dynamic-fee",
"fp-evm",
"fp-rpc",
"frame-benchmarking",
"frame-benchmarking-cli",
"futures",
"hex",
"hex-literal",
"jsonrpsee",
"log",
"pallet-transaction-payment-rpc",
"parity-scale-codec",
"polkadot-cli",
"polkadot-primitives",
"sc-basic-authorship",
"sc-chain-spec",
"sc-cli",
"sc-client-api",
"sc-consensus",
"sc-consensus-aura",
"sc-executor",
"sc-network",
"sc-network-sync",
"sc-offchain",
"sc-rpc",
"sc-service",
"sc-sysinfo",
"sc-telemetry",
"sc-tracing",
"sc-transaction-pool",
"sc-transaction-pool-api",
"serde",
"serde_derive",
"serde_json",
"sp-api",
"sp-block-builder",
"sp-blockchain",
"sp-consensus-aura",
"sp-core",
"sp-inherents",
"sp-io",
"sp-keystore",
"sp-runtime",
"sp-timestamp",
"staging-xcm",
"substrate-build-script-utils",
"substrate-frame-rpc-system",
"substrate-prometheus-endpoint",
]
[[package]]
name = "exit-future"
version = "0.2.0"
@@ -7982,163 +8139,6 @@ dependencies = [
"staging-xcm-executor",
]
[[package]]
name = "parachain-template-node"
version = "0.1.2"
dependencies = [
"clap",
"color-print",
"cumulus-client-cli",
"cumulus-client-collator",
"cumulus-client-consensus-aura",
"cumulus-client-consensus-common",
"cumulus-client-consensus-proposer",
"cumulus-client-service",
"cumulus-primitives-core",
"cumulus-primitives-parachain-inherent",
"cumulus-relay-chain-interface",
"fc-api",
"fc-consensus",
"fc-db",
"fc-mapping-sync",
"fc-rpc",
"fc-rpc-core",
"fc-storage",
"fp-dynamic-fee",
"fp-evm",
"fp-rpc",
"frame-benchmarking",
"frame-benchmarking-cli",
"futures",
"hex",
"hex-literal",
"jsonrpsee",
"log",
"pallet-transaction-payment-rpc",
"parachain-template-runtime",
"parity-scale-codec",
"polkadot-cli",
"polkadot-primitives",
"sc-basic-authorship",
"sc-chain-spec",
"sc-cli",
"sc-client-api",
"sc-consensus",
"sc-consensus-aura",
"sc-executor",
"sc-network",
"sc-network-sync",
"sc-offchain",
"sc-rpc",
"sc-service",
"sc-sysinfo",
"sc-telemetry",
"sc-tracing",
"sc-transaction-pool",
"sc-transaction-pool-api",
"serde",
"serde_derive",
"serde_json",
"sp-api",
"sp-block-builder",
"sp-blockchain",
"sp-consensus-aura",
"sp-core",
"sp-inherents",
"sp-io",
"sp-keystore",
"sp-runtime",
"sp-timestamp",
"staging-xcm",
"substrate-build-script-utils",
"substrate-frame-rpc-system",
"substrate-prometheus-endpoint",
]
[[package]]
name = "parachain-template-runtime"
version = "0.1.2"
dependencies = [
"assets-common",
"cumulus-pallet-aura-ext",
"cumulus-pallet-parachain-system",
"cumulus-pallet-session-benchmarking",
"cumulus-pallet-xcm",
"cumulus-pallet-xcmp-queue",
"cumulus-primitives-aura",
"cumulus-primitives-core",
"cumulus-primitives-storage-weight-reclaim",
"cumulus-primitives-utility",
"fp-account",
"fp-evm",
"fp-rpc",
"fp-self-contained",
"frame-benchmarking",
"frame-executive",
"frame-support",
"frame-system",
"frame-system-benchmarking",
"frame-system-rpc-runtime-api",
"frame-try-runtime",
"hex-literal",
"log",
"pallet-asset-manager",
"pallet-assets",
"pallet-aura",
"pallet-authorship",
"pallet-balances",
"pallet-base-fee",
"pallet-collator-selection",
"pallet-conviction-voting",
"pallet-ethereum",
"pallet-evm",
"pallet-evm-chain-id",
"pallet-evm-precompile-modexp",
"pallet-evm-precompile-sha3fips",
"pallet-evm-precompile-simple",
"pallet-message-queue",
"pallet-multisig",
"pallet-preimage",
"pallet-proxy",
"pallet-referenda",
"pallet-scheduler",
"pallet-session",
"pallet-sudo",
"pallet-timestamp",
"pallet-transaction-payment",
"pallet-transaction-payment-rpc-runtime-api",
"pallet-treasury",
"pallet-utility",
"pallet-whitelist",
"pallet-xcm",
"parachains-common",
"parity-scale-codec",
"polkadot-parachain-primitives",
"polkadot-runtime-common",
"scale-info",
"smallvec",
"sp-api",
"sp-arithmetic",
"sp-block-builder",
"sp-consensus-aura",
"sp-core",
"sp-genesis-builder",
"sp-inherents",
"sp-io",
"sp-offchain",
"sp-runtime",
"sp-session",
"sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-v1.10.0)",
"sp-transaction-pool",
"sp-version",
"staging-parachain-info",
"staging-xcm",
"staging-xcm-builder",
"staging-xcm-executor",
"substrate-wasm-builder",
"xcm-primitives",
]
[[package]]
name = "parachains-common"
version = "7.0.0"
@@ -13988,11 +13988,11 @@ dependencies = [
"cumulus-primitives-core",
"cumulus-primitives-parachain-inherent",
"cumulus-test-relay-sproof-builder",
"evm-runtime-template",
"frame-support",
"frame-system",
"pallet-balances",
"pallet-timestamp",
"parachain-template-runtime",
"parachains-common",
"parity-scale-codec",
"sp-consensus-aura",
+2 -2
View File
@@ -4,10 +4,10 @@ resolver = "2"
[workspace.package]
authors = [ "OpenZeppelin" ]
description = "Runtime template(s) for Polkadot Para{chains, cores}"
description = "EVM Runtime template for Polkadot Para{chains, cores}"
edition = "2021"
license = "GPL-3.0-only"
repository = "https://github.com/OpenZeppelin/polkadot-runtime-template"
repository = "https://github.com/OpenZeppelin/polkadot-runtime-templates"
[workspace.dependencies]
clap = { version = "4.5.3", features = [ "derive" ] }
+5 -5
View File
@@ -1,8 +1,8 @@
[package]
name = "parachain-template-node"
name = "evm-template-node"
authors = { workspace = true }
build = "build.rs"
description = "Node compatible with parachain runtime template."
description = "Node compatible with evm runtime template."
edition = { workspace = true }
license = { workspace = true }
publish = false
@@ -22,7 +22,7 @@ serde_derive = { workspace = true }
serde_json = { workspace = true }
# Local
parachain-template-runtime = { path = "../runtime" }
evm-runtime-template = { path = "../runtime" }
# Substrate
frame-benchmarking = { workspace = true }
@@ -95,16 +95,16 @@ default = []
async-backing = []
experimental = []
runtime-benchmarks = [
"evm-runtime-template/runtime-benchmarks",
"frame-benchmarking-cli/runtime-benchmarks",
"frame-benchmarking/runtime-benchmarks",
"parachain-template-runtime/runtime-benchmarks",
"polkadot-cli/runtime-benchmarks",
"polkadot-primitives/runtime-benchmarks",
"sc-service/runtime-benchmarks",
"sp-runtime/runtime-benchmarks",
]
try-runtime = [
"parachain-template-runtime/try-runtime",
"evm-runtime-template/try-runtime",
"polkadot-cli/try-runtime",
"sp-runtime/try-runtime",
]
+8 -10
View File
@@ -1,12 +1,12 @@
use std::collections::BTreeMap;
use cumulus_primitives_core::ParaId;
use evm_runtime_template::{
AccountId, AuraId, OpenZeppelinPrecompiles as Precompiles, Runtime, Signature,
};
use fp_evm::GenesisAccount;
use hex_literal::hex;
use log::error;
use parachain_template_runtime::{
AccountId, AuraId, OpenZeppelinPrecompiles as Precompiles, Runtime, Signature,
};
use sc_chain_spec::{ChainSpecExtension, ChainSpecGroup};
use sc_service::ChainType;
use serde::{Deserialize, Serialize};
@@ -17,7 +17,7 @@ use crate::contracts::{parse_contracts, ContractsPath};
/// Specialized `ChainSpec` for the normal parachain runtime.
pub type ChainSpec =
sc_service::GenericChainSpec<parachain_template_runtime::RuntimeGenesisConfig, Extensions>;
sc_service::GenericChainSpec<evm_runtime_template::RuntimeGenesisConfig, Extensions>;
/// The default XCM version to set in genesis config.
const SAFE_XCM_VERSION: u32 = xcm::prelude::XCM_VERSION;
@@ -68,8 +68,8 @@ where
///
/// The input must be a tuple of individual keys (a single arg for now since we
/// have just one key).
pub fn template_session_keys(keys: AuraId) -> parachain_template_runtime::SessionKeys {
parachain_template_runtime::SessionKeys { aura: keys }
pub fn template_session_keys(keys: AuraId) -> evm_runtime_template::SessionKeys {
evm_runtime_template::SessionKeys { aura: keys }
}
pub fn development_config(contracts_path: ContractsPath) -> ChainSpec {
@@ -82,8 +82,7 @@ pub fn development_config(contracts_path: ContractsPath) -> ChainSpec {
properties.insert("basedOn".into(), "OpenZeppelin EVM Template".into());
ChainSpec::builder(
parachain_template_runtime::WASM_BINARY
.expect("WASM binary was not built, please build it!"),
evm_runtime_template::WASM_BINARY.expect("WASM binary was not built, please build it!"),
Extensions {
relay_chain: "rococo-local".into(),
// You MUST set this to the correct network!
@@ -134,8 +133,7 @@ pub fn local_testnet_config(contracts_path: ContractsPath) -> ChainSpec {
#[allow(deprecated)]
ChainSpec::builder(
parachain_template_runtime::WASM_BINARY
.expect("WASM binary was not built, please build it!"),
evm_runtime_template::WASM_BINARY.expect("WASM binary was not built, please build it!"),
Extensions {
relay_chain: "rococo-local".into(),
// You MUST set this to the correct network!
+1 -1
View File
@@ -2,9 +2,9 @@ use std::net::SocketAddr;
use cumulus_client_service::storage_proof_size::HostFunctions as ReclaimHostFunctions;
use cumulus_primitives_core::ParaId;
use evm_runtime_template::Block;
use frame_benchmarking_cli::{BenchmarkCmd, SUBSTRATE_REFERENCE_HARDWARE};
use log::info;
use parachain_template_runtime::Block;
use sc_cli::{
ChainSpec, CliConfiguration, DefaultConfigurationValues, ImportParams, KeystoreParams,
NetworkParams, Result, SharedParams, SubstrateCli,
+2 -2
View File
@@ -5,11 +5,11 @@ use std::{
time::Duration,
};
// Local
use evm_runtime_template::opaque::Block;
use fc_rpc::{EthTask, OverrideHandle};
pub use fc_rpc_core::types::{FeeHistoryCache, FeeHistoryCacheLimit, FilterPool};
use futures::{future, prelude::*};
// Local
use parachain_template_runtime::opaque::Block;
// Substrate
use sc_client_api::BlockchainEvents;
use sc_executor::WasmExecutor;
+1 -1
View File
@@ -7,7 +7,7 @@
mod eth;
use std::sync::Arc;
use parachain_template_runtime::{opaque::Block, AccountId, Balance, Nonce};
use evm_runtime_template::{opaque::Block, AccountId, Balance, Nonce};
use sc_client_api::{backend::Backend, AuxStore, BlockchainEvents, StorageProvider, UsageProvider};
pub use sc_rpc::DenyUnsafe;
use sc_rpc::SubscriptionTaskExecutor;
+3 -3
View File
@@ -17,14 +17,14 @@ use cumulus_client_service::{
use cumulus_primitives_core::relay_chain::ValidationCode;
use cumulus_primitives_core::{relay_chain::CollatorPair, ParaId};
use cumulus_relay_chain_interface::{OverseerHandle, RelayChainInterface};
// Substrate Imports
use frame_benchmarking_cli::SUBSTRATE_REFERENCE_HARDWARE;
// Local Runtime Types
use parachain_template_runtime::{
use evm_runtime_template::{
apis::RuntimeApi,
configs::TransactionConverter,
opaque::{Block, Hash},
};
// Substrate Imports
use frame_benchmarking_cli::SUBSTRATE_REFERENCE_HARDWARE;
use sc_client_api::Backend;
use sc_consensus::ImportQueue;
use sc_executor::WasmExecutor;
+2 -2
View File
@@ -1,7 +1,7 @@
[package]
name = "parachain-template-runtime"
name = "evm-runtime-template"
authors = { workspace = true }
description = "A generic parachain runtime template"
description = "An EVM parachain runtime template"
edition = { workspace = true }
license = { workspace = true }
repository = { workspace = true }
+1 -1
View File
@@ -1,6 +1,6 @@
// ExtBuilder impl for all runtime integration tests
use evm_runtime_template::{BuildStorage, Runtime, System};
use frame_support::weights::Weight;
use parachain_template_runtime::{BuildStorage, Runtime, System};
pub fn run_with_system_weight<F: FnMut()>(w: Weight, mut assertions: F) {
let mut t: sp_io::TestExternalities =
+9 -6
View File
@@ -1,5 +1,5 @@
mod constant_tests {
use parachain_template_runtime::constants::currency::*;
use evm_runtime_template::constants::currency::*;
#[test]
fn test_constants() {
@@ -19,12 +19,12 @@ mod constant_tests {
}
mod runtime_tests {
use frame_support::{pallet_prelude::Weight, traits::TypedGet, PalletId};
use parachain_template_runtime::{
use evm_runtime_template::{
configs::{asset_config::*, *},
constants::{currency::*, *},
*,
};
use frame_support::{pallet_prelude::Weight, traits::TypedGet, PalletId};
use sp_runtime::create_runtime_str;
use sp_version::RuntimeVersion;
use xcm::latest::prelude::BodyId;
@@ -40,7 +40,7 @@ mod runtime_tests {
authoring_version: 1,
spec_version: 1,
impl_version: 0,
apis: parachain_template_runtime::apis::RUNTIME_API_VERSIONS,
apis: evm_runtime_template::apis::RUNTIME_API_VERSIONS,
transaction_version: 1,
state_version: 1,
}
@@ -222,8 +222,8 @@ mod runtime_tests {
}
mod xcm_tests {
use evm_runtime_template::configs::xcm_config::*;
use frame_support::weights::Weight;
use parachain_template_runtime::configs::xcm_config::*;
#[test]
fn xcm_executor_constants() {
@@ -235,6 +235,9 @@ mod xcm_tests {
#[test]
fn pallet_xcm_constants() {
assert_eq!(MaxLockers::get(), 0);
assert_eq!(<parachain_template_runtime::Runtime as pallet_xcm::Config>::VERSION_DISCOVERY_QUEUE_SIZE, 100);
assert_eq!(
<evm_runtime_template::Runtime as pallet_xcm::Config>::VERSION_DISCOVERY_QUEUE_SIZE,
100
);
}
}
+1 -1
View File
@@ -1,9 +1,9 @@
// Integration transaction weight-fee tests
mod common;
use common::*;
use evm_runtime_template::{Runtime, RuntimeBlockWeights};
use frame_support::pallet_prelude::*;
use pallet_transaction_payment::Multiplier;
use parachain_template_runtime::{Runtime, RuntimeBlockWeights};
use polkadot_runtime_common::MinimumMultiplier;
use sp_runtime::{traits::Convert, Perquintill};
+2 -2
View File
@@ -1,10 +1,10 @@
// Storage indices integration checks
use frame_support::traits::PalletInfo;
use parachain_template_runtime::{
use evm_runtime_template::{
Aura, AuraExt, Authorship, Balances, CollatorSelection, CumulusXcm, MessageQueue, Multisig,
ParachainInfo, ParachainSystem, PolkadotXcm, Proxy, Runtime, Session, Sudo, System, Timestamp,
TransactionPayment, XcmpQueue,
};
use frame_support::traits::PalletInfo;
fn assert_pallet_prefix<P: 'static>(name: &str) {
assert_eq!(<Runtime as frame_system::Config>::PalletInfo::name::<P>(), Some(name));
+3 -3
View File
@@ -18,7 +18,7 @@ workspace = true
substrate-runtime-fuzzer = { workspace = true }
ziggy = { workspace = true }
parachain-template-runtime = { path = "../runtime" }
evm-runtime-template = { path = "../runtime" }
parachains-common = { workspace = true }
parity-scale-codec = { workspace = true }
@@ -41,18 +41,18 @@ cumulus-test-relay-sproof-builder = { workspace = true }
[features]
default = [ "std", "try-runtime" ]
std = [
"evm-runtime-template/std",
"frame-support/std",
"pallet-timestamp/std",
"parachain-template-runtime/std",
"parity-scale-codec/std",
"sp-consensus-aura/std",
"sp-runtime/std",
]
try-runtime = [
"evm-runtime-template/try-runtime",
"frame-support/try-runtime",
"frame-system/try-runtime",
"pallet-timestamp/try-runtime",
"parachain-template-runtime/try-runtime",
"sp-runtime/try-runtime",
]
+6 -6
View File
@@ -1,17 +1,17 @@
use std::time::{Duration, Instant};
use cumulus_primitives_core::relay_chain::Slot;
use evm_runtime_template::{
constants::SLOT_DURATION, AccountId, AllPalletsWithSystem, Balance, Balances, BlockNumber,
EVMChainIdConfig, Executive, Runtime, RuntimeCall, RuntimeOrigin, SudoConfig,
UncheckedExtrinsic,
};
use frame_support::{
dispatch::GetDispatchInfo,
pallet_prelude::Encode,
traits::{IntegrityTest, TryState, TryStateSelect},
weights::{constants::WEIGHT_REF_TIME_PER_SECOND, Weight},
};
use parachain_template_runtime::{
constants::SLOT_DURATION, AccountId, AllPalletsWithSystem, Balance, Balances, BlockNumber,
EVMChainIdConfig, Executive, Runtime, RuntimeCall, RuntimeOrigin, SudoConfig,
UncheckedExtrinsic,
};
use sp_consensus_aura::AURA_ENGINE_ID;
use sp_runtime::{
traits::{Dispatchable, Header},
@@ -25,7 +25,7 @@ fn main() {
let endowed_accounts: Vec<AccountId> = (0..5).map(|i| [i; 32].into()).collect();
let genesis_storage: Storage = {
use parachain_template_runtime::{
use evm_runtime_template::{
BalancesConfig, CollatorSelectionConfig, RuntimeGenesisConfig, SessionConfig,
SessionKeys,
};
+130 -130
View File
@@ -3767,6 +3767,135 @@ dependencies = [
"zeroize",
]
[[package]]
name = "generic-runtime-template"
version = "1.0.0"
dependencies = [
"assets-common",
"cumulus-pallet-aura-ext",
"cumulus-pallet-parachain-system",
"cumulus-pallet-session-benchmarking",
"cumulus-pallet-xcm",
"cumulus-pallet-xcmp-queue",
"cumulus-primitives-aura",
"cumulus-primitives-core",
"cumulus-primitives-storage-weight-reclaim",
"cumulus-primitives-utility",
"frame-benchmarking",
"frame-executive",
"frame-support",
"frame-system",
"frame-system-benchmarking",
"frame-system-rpc-runtime-api",
"frame-try-runtime",
"hex-literal",
"log",
"pallet-assets",
"pallet-aura",
"pallet-authorship",
"pallet-balances",
"pallet-collator-selection",
"pallet-conviction-voting",
"pallet-message-queue",
"pallet-multisig",
"pallet-preimage",
"pallet-proxy",
"pallet-referenda",
"pallet-scheduler",
"pallet-session",
"pallet-sudo",
"pallet-timestamp",
"pallet-transaction-payment",
"pallet-transaction-payment-rpc-runtime-api",
"pallet-treasury",
"pallet-utility",
"pallet-whitelist",
"pallet-xcm",
"parachains-common",
"parity-scale-codec",
"polkadot-parachain-primitives",
"polkadot-runtime-common",
"scale-info",
"smallvec",
"sp-api",
"sp-arithmetic",
"sp-block-builder",
"sp-consensus-aura",
"sp-core",
"sp-genesis-builder",
"sp-inherents",
"sp-io",
"sp-offchain",
"sp-runtime",
"sp-session",
"sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-v1.10.0)",
"sp-transaction-pool",
"sp-version",
"staging-parachain-info",
"staging-xcm",
"staging-xcm-builder",
"staging-xcm-executor",
"substrate-wasm-builder",
]
[[package]]
name = "generic-template-node"
version = "1.0.0"
dependencies = [
"clap",
"color-print",
"cumulus-client-cli",
"cumulus-client-collator",
"cumulus-client-consensus-aura",
"cumulus-client-consensus-common",
"cumulus-client-consensus-proposer",
"cumulus-client-service",
"cumulus-primitives-core",
"cumulus-primitives-parachain-inherent",
"cumulus-relay-chain-interface",
"frame-benchmarking",
"frame-benchmarking-cli",
"futures",
"generic-runtime-template",
"jsonrpsee",
"log",
"pallet-transaction-payment-rpc",
"parity-scale-codec",
"polkadot-cli",
"polkadot-primitives",
"sc-basic-authorship",
"sc-chain-spec",
"sc-cli",
"sc-client-api",
"sc-consensus",
"sc-executor",
"sc-network",
"sc-network-sync",
"sc-offchain",
"sc-rpc",
"sc-service",
"sc-sysinfo",
"sc-telemetry",
"sc-tracing",
"sc-transaction-pool",
"sc-transaction-pool-api",
"serde",
"serde_json",
"sp-api",
"sp-block-builder",
"sp-blockchain",
"sp-consensus-aura",
"sp-core",
"sp-io",
"sp-keystore",
"sp-runtime",
"sp-timestamp",
"staging-xcm",
"substrate-build-script-utils",
"substrate-frame-rpc-system",
"substrate-prometheus-endpoint",
]
[[package]]
name = "gethostname"
version = "0.2.3"
@@ -7231,135 +7360,6 @@ dependencies = [
"staging-xcm-executor",
]
[[package]]
name = "parachain-template-node"
version = "1.0.0"
dependencies = [
"clap",
"color-print",
"cumulus-client-cli",
"cumulus-client-collator",
"cumulus-client-consensus-aura",
"cumulus-client-consensus-common",
"cumulus-client-consensus-proposer",
"cumulus-client-service",
"cumulus-primitives-core",
"cumulus-primitives-parachain-inherent",
"cumulus-relay-chain-interface",
"frame-benchmarking",
"frame-benchmarking-cli",
"futures",
"jsonrpsee",
"log",
"pallet-transaction-payment-rpc",
"parachain-template-runtime",
"parity-scale-codec",
"polkadot-cli",
"polkadot-primitives",
"sc-basic-authorship",
"sc-chain-spec",
"sc-cli",
"sc-client-api",
"sc-consensus",
"sc-executor",
"sc-network",
"sc-network-sync",
"sc-offchain",
"sc-rpc",
"sc-service",
"sc-sysinfo",
"sc-telemetry",
"sc-tracing",
"sc-transaction-pool",
"sc-transaction-pool-api",
"serde",
"serde_json",
"sp-api",
"sp-block-builder",
"sp-blockchain",
"sp-consensus-aura",
"sp-core",
"sp-io",
"sp-keystore",
"sp-runtime",
"sp-timestamp",
"staging-xcm",
"substrate-build-script-utils",
"substrate-frame-rpc-system",
"substrate-prometheus-endpoint",
]
[[package]]
name = "parachain-template-runtime"
version = "1.0.0"
dependencies = [
"assets-common",
"cumulus-pallet-aura-ext",
"cumulus-pallet-parachain-system",
"cumulus-pallet-session-benchmarking",
"cumulus-pallet-xcm",
"cumulus-pallet-xcmp-queue",
"cumulus-primitives-aura",
"cumulus-primitives-core",
"cumulus-primitives-storage-weight-reclaim",
"cumulus-primitives-utility",
"frame-benchmarking",
"frame-executive",
"frame-support",
"frame-system",
"frame-system-benchmarking",
"frame-system-rpc-runtime-api",
"frame-try-runtime",
"hex-literal",
"log",
"pallet-assets",
"pallet-aura",
"pallet-authorship",
"pallet-balances",
"pallet-collator-selection",
"pallet-conviction-voting",
"pallet-message-queue",
"pallet-multisig",
"pallet-preimage",
"pallet-proxy",
"pallet-referenda",
"pallet-scheduler",
"pallet-session",
"pallet-sudo",
"pallet-timestamp",
"pallet-transaction-payment",
"pallet-transaction-payment-rpc-runtime-api",
"pallet-treasury",
"pallet-utility",
"pallet-whitelist",
"pallet-xcm",
"parachains-common",
"parity-scale-codec",
"polkadot-parachain-primitives",
"polkadot-runtime-common",
"scale-info",
"smallvec",
"sp-api",
"sp-arithmetic",
"sp-block-builder",
"sp-consensus-aura",
"sp-core",
"sp-genesis-builder",
"sp-inherents",
"sp-io",
"sp-offchain",
"sp-runtime",
"sp-session",
"sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?tag=polkadot-v1.10.0)",
"sp-transaction-pool",
"sp-version",
"staging-parachain-info",
"staging-xcm",
"staging-xcm-builder",
"staging-xcm-executor",
"substrate-wasm-builder",
]
[[package]]
name = "parachains-common"
version = "7.0.0"
@@ -13072,9 +13072,9 @@ dependencies = [
"cumulus-test-relay-sproof-builder",
"frame-support",
"frame-system",
"generic-runtime-template",
"pallet-balances",
"pallet-timestamp",
"parachain-template-runtime",
"parachains-common",
"parity-scale-codec",
"sp-consensus-aura",
+2 -2
View File
@@ -4,10 +4,10 @@ resolver = "2"
[workspace.package]
authors = [ "OpenZeppelin" ]
description = "Runtime template(s) for Polkadot Para{chains, cores}"
description = "Generic runtime template for Polkadot Para{chains, cores}"
edition = "2021"
license = "GPL-3.0-only"
repository = "https://github.com/OpenZeppelin/polkadot-runtime-template"
repository = "https://github.com/OpenZeppelin/polkadot-runtime-templates"
[workspace.dependencies]
clap = { version = "4.5.3", features = [ "derive" ] }
+5 -5
View File
@@ -1,8 +1,8 @@
[package]
name = "parachain-template-node"
name = "generic-template-node"
authors = { workspace = true }
build = "build.rs"
description = "Node compatible with parachain runtime template."
description = "Node compatible with generic runtime template."
edition = { workspace = true }
license = { workspace = true }
publish = false
@@ -19,7 +19,7 @@ serde = { workspace = true, features = [ "derive" ] }
serde_json = { workspace = true }
# Local
parachain-template-runtime = { path = "../runtime" }
generic-runtime-template = { path = "../runtime" }
# Substrate
frame-benchmarking = { workspace = true }
@@ -80,14 +80,14 @@ experimental = []
runtime-benchmarks = [
"frame-benchmarking-cli/runtime-benchmarks",
"frame-benchmarking/runtime-benchmarks",
"parachain-template-runtime/runtime-benchmarks",
"generic-runtime-template/runtime-benchmarks",
"polkadot-cli/runtime-benchmarks",
"polkadot-primitives/runtime-benchmarks",
"sc-service/runtime-benchmarks",
"sp-runtime/runtime-benchmarks",
]
try-runtime = [
"parachain-template-runtime/try-runtime",
"generic-runtime-template/try-runtime",
"polkadot-cli/try-runtime",
"sp-runtime/try-runtime",
]
+6 -8
View File
@@ -1,5 +1,5 @@
use cumulus_primitives_core::ParaId;
use parachain_template_runtime::{
use generic_runtime_template::{
constants::currency::EXISTENTIAL_DEPOSIT, AccountId, AuraId, Signature,
};
use sc_chain_spec::{ChainSpecExtension, ChainSpecGroup};
@@ -10,7 +10,7 @@ use sp_runtime::traits::{IdentifyAccount, Verify};
/// Specialized `ChainSpec` for the normal parachain runtime.
pub type ChainSpec =
sc_service::GenericChainSpec<parachain_template_runtime::RuntimeGenesisConfig, Extensions>;
sc_service::GenericChainSpec<generic_runtime_template::RuntimeGenesisConfig, Extensions>;
/// The default XCM version to set in genesis config.
const SAFE_XCM_VERSION: u32 = xcm::prelude::XCM_VERSION;
@@ -61,8 +61,8 @@ where
///
/// The input must be a tuple of individual keys (a single arg for now since we
/// have just one key).
pub fn template_session_keys(keys: AuraId) -> parachain_template_runtime::SessionKeys {
parachain_template_runtime::SessionKeys { aura: keys }
pub fn template_session_keys(keys: AuraId) -> generic_runtime_template::SessionKeys {
generic_runtime_template::SessionKeys { aura: keys }
}
pub fn development_config() -> ChainSpec {
@@ -75,8 +75,7 @@ pub fn development_config() -> ChainSpec {
properties.insert("basedOn".into(), "OpenZeppelin Generic Template".into());
ChainSpec::builder(
parachain_template_runtime::WASM_BINARY
.expect("WASM binary was not built, please build it!"),
generic_runtime_template::WASM_BINARY.expect("WASM binary was not built, please build it!"),
Extensions {
relay_chain: "rococo-local".into(),
// You MUST set this to the correct network!
@@ -127,8 +126,7 @@ pub fn local_testnet_config() -> ChainSpec {
#[allow(deprecated)]
ChainSpec::builder(
parachain_template_runtime::WASM_BINARY
.expect("WASM binary was not built, please build it!"),
generic_runtime_template::WASM_BINARY.expect("WASM binary was not built, please build it!"),
Extensions {
relay_chain: "rococo-local".into(),
// You MUST set this to the correct network!
+1 -1
View File
@@ -3,8 +3,8 @@ use std::net::SocketAddr;
use cumulus_client_service::storage_proof_size::HostFunctions as ReclaimHostFunctions;
use cumulus_primitives_core::ParaId;
use frame_benchmarking_cli::{BenchmarkCmd, SUBSTRATE_REFERENCE_HARDWARE};
use generic_runtime_template::Block;
use log::info;
use parachain_template_runtime::Block;
use sc_cli::{
ChainSpec, CliConfiguration, DefaultConfigurationValues, ImportParams, KeystoreParams,
NetworkParams, Result, SharedParams, SubstrateCli,
+1 -1
View File
@@ -7,7 +7,7 @@
use std::sync::Arc;
use parachain_template_runtime::{opaque::Block, AccountId, Balance, Nonce};
use generic_runtime_template::{opaque::Block, AccountId, Balance, Nonce};
use sc_client_api::AuxStore;
pub use sc_rpc::DenyUnsafe;
use sc_transaction_pool_api::TransactionPool;
+1 -1
View File
@@ -20,7 +20,7 @@ use cumulus_relay_chain_interface::{OverseerHandle, RelayChainInterface};
// Substrate Imports
use frame_benchmarking_cli::SUBSTRATE_REFERENCE_HARDWARE;
// Local Runtime Types
use parachain_template_runtime::{
use generic_runtime_template::{
apis::RuntimeApi,
opaque::{Block, Hash},
};
+1 -1
View File
@@ -1,5 +1,5 @@
[package]
name = "parachain-template-runtime"
name = "generic-runtime-template"
authors = { workspace = true }
description = "A generic parachain runtime template"
edition = { workspace = true }
+1 -1
View File
@@ -1,6 +1,6 @@
// ExtBuilder impl for all runtime integration tests
use frame_support::weights::Weight;
use parachain_template_runtime::{BuildStorage, Runtime, System};
use generic_runtime_template::{BuildStorage, Runtime, System};
pub fn run_with_system_weight<F: FnMut()>(w: Weight, mut assertions: F) {
let mut t: sp_io::TestExternalities =
@@ -1,5 +1,5 @@
mod constant_tests {
use parachain_template_runtime::constants::currency::*;
use generic_runtime_template::constants::currency::*;
#[test]
fn test_constants() {
@@ -20,7 +20,7 @@ mod constant_tests {
mod runtime_tests {
use frame_support::{pallet_prelude::Weight, traits::TypedGet, PalletId};
use parachain_template_runtime::{
use generic_runtime_template::{
configs::*,
constants::{currency::*, *},
*,
@@ -39,7 +39,7 @@ mod runtime_tests {
authoring_version: 1,
spec_version: 1,
impl_version: 0,
apis: parachain_template_runtime::apis::RUNTIME_API_VERSIONS,
apis: generic_runtime_template::apis::RUNTIME_API_VERSIONS,
transaction_version: 1,
state_version: 1,
}
@@ -222,7 +222,7 @@ mod runtime_tests {
mod xcm_tests {
use frame_support::weights::Weight;
use parachain_template_runtime::configs::xcm_config::*;
use generic_runtime_template::configs::xcm_config::*;
#[test]
fn xcm_executor_constants() {
@@ -234,6 +234,9 @@ mod xcm_tests {
#[test]
fn pallet_xcm_constants() {
assert_eq!(MaxLockers::get(), 0);
assert_eq!(<parachain_template_runtime::Runtime as pallet_xcm::Config>::VERSION_DISCOVERY_QUEUE_SIZE, 100);
assert_eq!(
<generic_runtime_template::Runtime as pallet_xcm::Config>::VERSION_DISCOVERY_QUEUE_SIZE,
100
);
}
}
+1 -1
View File
@@ -2,8 +2,8 @@
mod common;
use common::*;
use frame_support::pallet_prelude::*;
use generic_runtime_template::{Runtime, RuntimeBlockWeights};
use pallet_transaction_payment::Multiplier;
use parachain_template_runtime::{Runtime, RuntimeBlockWeights};
use polkadot_runtime_common::MinimumMultiplier;
use sp_runtime::{traits::Convert, Perquintill};
+1 -1
View File
@@ -1,6 +1,6 @@
// Storage indices integration checks
use frame_support::traits::PalletInfo;
use parachain_template_runtime::{
use generic_runtime_template::{
Aura, AuraExt, Authorship, Balances, CollatorSelection, CumulusXcm, MessageQueue, Multisig,
ParachainInfo, ParachainSystem, PolkadotXcm, Proxy, Runtime, Session, Sudo, System, Timestamp,
TransactionPayment, XcmpQueue,
+3 -3
View File
@@ -18,7 +18,7 @@ workspace = true
substrate-runtime-fuzzer = { workspace = true }
ziggy = { workspace = true }
parachain-template-runtime = { path = "../runtime" }
generic-runtime-template = { path = "../runtime" }
parachains-common = { workspace = true }
parity-scale-codec = { workspace = true }
@@ -42,8 +42,8 @@ cumulus-test-relay-sproof-builder = { workspace = true }
default = [ "std", "try-runtime" ]
std = [
"frame-support/std",
"generic-runtime-template/std",
"pallet-timestamp/std",
"parachain-template-runtime/std",
"parity-scale-codec/std",
"sp-consensus-aura/std",
"sp-runtime/std",
@@ -51,8 +51,8 @@ std = [
try-runtime = [
"frame-support/try-runtime",
"frame-system/try-runtime",
"generic-runtime-template/try-runtime",
"pallet-timestamp/try-runtime",
"parachain-template-runtime/try-runtime",
"sp-runtime/try-runtime",
]
+2 -2
View File
@@ -7,7 +7,7 @@ use frame_support::{
traits::{IntegrityTest, TryState, TryStateSelect},
weights::{constants::WEIGHT_REF_TIME_PER_SECOND, Weight},
};
use parachain_template_runtime::{
use generic_runtime_template::{
constants::SLOT_DURATION, AllPalletsWithSystem, Balance, Balances, BlockNumber, Executive,
Runtime, RuntimeCall, RuntimeOrigin, SudoConfig, UncheckedExtrinsic,
};
@@ -25,7 +25,7 @@ fn main() {
let endowed_accounts: Vec<AccountId> = (0..5).map(|i| [i; 32].into()).collect();
let genesis_storage: Storage = {
use parachain_template_runtime::{
use generic_runtime_template::{
BalancesConfig, CollatorSelectionConfig, RuntimeGenesisConfig, SessionConfig,
SessionKeys,
};