diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000..3637c56 --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,84 @@ +name: Lint, check, clippy and test + +on: + push: + branches: [ main ] + pull_request: + types: [ opened, synchronize, reopened, ready_for_review ] + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Check formatting + run: cargo fmt --all -- --check + + check: + needs: lint + runs-on: ubuntu-latest + steps: + - name: Setup Ubuntu dependencies + shell: bash + run: sudo apt update && sudo apt install -y protobuf-compiler + + - uses: actions/checkout@v4 + + - name: Rust Cache + uses: Swatinem/rust-cache@v2.7.3 + with: + cache-on-failure: true + cache-all-crates: true + key: check + + - name: Check Build + run: | + cargo check --release --locked --all-features --workspace + + clippy: + needs: lint + runs-on: ubuntu-latest + permissions: + checks: write + env: + SKIP_WASM_BUILD: 1 + steps: + - name: Setup Ubuntu dependencies + shell: bash + run: sudo apt update && sudo apt install -y protobuf-compiler + + - uses: actions/checkout@v4 + + - name: Rust Cache + uses: Swatinem/rust-cache@v2.7.3 + with: + cache-on-failure: true + cache-all-crates: true + key: check + + - name: Annotate with Clippy warnings + uses: actions-rs/clippy-check@v1 + with: + token: ${{ secrets.GITHUB_TOKEN }} + args: --release --locked --all-features --workspace + + test: + needs: lint + runs-on: ubuntu-latest + steps: + - name: Setup Ubuntu dependencies + shell: bash + run: sudo apt update && sudo apt install -y protobuf-compiler + + - uses: actions/checkout@v4 + + - name: Rust Cache + uses: Swatinem/rust-cache@v2.7.3 + with: + cache-on-failure: true + cache-all-crates: true + key: test + + - name: Run tests + run: cargo test --release --locked --all-features --workspace diff --git a/.github/workflows/lint-pr.yml b/.github/workflows/lint-pr.yml new file mode 100644 index 0000000..047030c --- /dev/null +++ b/.github/workflows/lint-pr.yml @@ -0,0 +1,20 @@ +name: "Lint PR" + +on: + pull_request_target: + types: + - opened + - edited + - synchronize + +permissions: + pull-requests: read + +jobs: + lint: + name: Validate PR title for conventional commit compliance + runs-on: ubuntu-latest + steps: + - uses: amannn/action-semantic-pull-request@v5 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/Cargo.lock b/Cargo.lock index 036b2d1..2c68862 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3262,7 +3262,7 @@ dependencies = [ [[package]] name = "fc-api" version = "1.0.0-dev" -source = "git+https://github.com/paritytech/frontier?branch=polkadot-v1.9.0#f68f4c685ed0aed813dcfaac1a9f94fa33d83d5e" +source = "git+https://github.com/polkadot-evm/frontier?branch=polkadot-v1.9.0#f68f4c685ed0aed813dcfaac1a9f94fa33d83d5e" dependencies = [ "async-trait", "fp-storage", @@ -3274,7 +3274,7 @@ dependencies = [ [[package]] name = "fc-cli" version = "1.0.0-dev" -source = "git+https://github.com/paritytech/frontier?branch=polkadot-v1.9.0#f68f4c685ed0aed813dcfaac1a9f94fa33d83d5e" +source = "git+https://github.com/polkadot-evm/frontier?branch=polkadot-v1.9.0#f68f4c685ed0aed813dcfaac1a9f94fa33d83d5e" dependencies = [ "clap", "ethereum-types", @@ -3292,7 +3292,7 @@ dependencies = [ [[package]] name = "fc-consensus" version = "2.0.0-dev" -source = "git+https://github.com/paritytech/frontier?branch=polkadot-v1.9.0#f68f4c685ed0aed813dcfaac1a9f94fa33d83d5e" +source = "git+https://github.com/polkadot-evm/frontier?branch=polkadot-v1.9.0#f68f4c685ed0aed813dcfaac1a9f94fa33d83d5e" dependencies = [ "async-trait", "fp-consensus", @@ -3308,7 +3308,7 @@ dependencies = [ [[package]] name = "fc-db" version = "2.0.0-dev" -source = "git+https://github.com/paritytech/frontier?branch=polkadot-v1.9.0#f68f4c685ed0aed813dcfaac1a9f94fa33d83d5e" +source = "git+https://github.com/polkadot-evm/frontier?branch=polkadot-v1.9.0#f68f4c685ed0aed813dcfaac1a9f94fa33d83d5e" dependencies = [ "async-trait", "ethereum", @@ -3339,7 +3339,7 @@ dependencies = [ [[package]] name = "fc-mapping-sync" version = "2.0.0-dev" -source = "git+https://github.com/paritytech/frontier?branch=polkadot-v1.9.0#f68f4c685ed0aed813dcfaac1a9f94fa33d83d5e" +source = "git+https://github.com/polkadot-evm/frontier?branch=polkadot-v1.9.0#f68f4c685ed0aed813dcfaac1a9f94fa33d83d5e" dependencies = [ "fc-db", "fc-storage", @@ -3362,7 +3362,7 @@ dependencies = [ [[package]] name = "fc-rpc" version = "2.0.0-dev" -source = "git+https://github.com/paritytech/frontier?branch=polkadot-v1.9.0#f68f4c685ed0aed813dcfaac1a9f94fa33d83d5e" +source = "git+https://github.com/polkadot-evm/frontier?branch=polkadot-v1.9.0#f68f4c685ed0aed813dcfaac1a9f94fa33d83d5e" dependencies = [ "ethereum", "ethereum-types", @@ -3417,7 +3417,7 @@ dependencies = [ [[package]] name = "fc-rpc-core" version = "1.1.0-dev" -source = "git+https://github.com/paritytech/frontier?branch=polkadot-v1.9.0#f68f4c685ed0aed813dcfaac1a9f94fa33d83d5e" +source = "git+https://github.com/polkadot-evm/frontier?branch=polkadot-v1.9.0#f68f4c685ed0aed813dcfaac1a9f94fa33d83d5e" dependencies = [ "ethereum", "ethereum-types", @@ -3432,7 +3432,7 @@ dependencies = [ [[package]] name = "fc-storage" version = "1.0.0-dev" -source = "git+https://github.com/paritytech/frontier?branch=polkadot-v1.9.0#f68f4c685ed0aed813dcfaac1a9f94fa33d83d5e" +source = "git+https://github.com/polkadot-evm/frontier?branch=polkadot-v1.9.0#f68f4c685ed0aed813dcfaac1a9f94fa33d83d5e" dependencies = [ "ethereum", "ethereum-types", @@ -3614,7 +3614,7 @@ dependencies = [ [[package]] name = "fp-account" version = "1.0.0-dev" -source = "git+https://github.com/paritytech/frontier?branch=polkadot-v1.9.0#f68f4c685ed0aed813dcfaac1a9f94fa33d83d5e" +source = "git+https://github.com/polkadot-evm/frontier?branch=polkadot-v1.9.0#f68f4c685ed0aed813dcfaac1a9f94fa33d83d5e" dependencies = [ "hex", "impl-serde", @@ -3633,7 +3633,7 @@ dependencies = [ [[package]] name = "fp-consensus" version = "2.0.0-dev" -source = "git+https://github.com/paritytech/frontier?branch=polkadot-v1.9.0#f68f4c685ed0aed813dcfaac1a9f94fa33d83d5e" +source = "git+https://github.com/polkadot-evm/frontier?branch=polkadot-v1.9.0#f68f4c685ed0aed813dcfaac1a9f94fa33d83d5e" dependencies = [ "ethereum", "parity-scale-codec", @@ -3645,7 +3645,7 @@ dependencies = [ [[package]] name = "fp-dynamic-fee" version = "1.0.0" -source = "git+https://github.com/paritytech/frontier?branch=polkadot-v1.9.0#f68f4c685ed0aed813dcfaac1a9f94fa33d83d5e" +source = "git+https://github.com/polkadot-evm/frontier?branch=polkadot-v1.9.0#f68f4c685ed0aed813dcfaac1a9f94fa33d83d5e" dependencies = [ "async-trait", "sp-core", @@ -3655,7 +3655,7 @@ dependencies = [ [[package]] name = "fp-ethereum" version = "1.0.0-dev" -source = "git+https://github.com/paritytech/frontier?branch=polkadot-v1.9.0#f68f4c685ed0aed813dcfaac1a9f94fa33d83d5e" +source = "git+https://github.com/polkadot-evm/frontier?branch=polkadot-v1.9.0#f68f4c685ed0aed813dcfaac1a9f94fa33d83d5e" dependencies = [ "ethereum", "ethereum-types", @@ -3668,7 +3668,7 @@ dependencies = [ [[package]] name = "fp-evm" version = "3.0.0-dev" -source = "git+https://github.com/paritytech/frontier?branch=polkadot-v1.9.0#f68f4c685ed0aed813dcfaac1a9f94fa33d83d5e" +source = "git+https://github.com/polkadot-evm/frontier?branch=polkadot-v1.9.0#f68f4c685ed0aed813dcfaac1a9f94fa33d83d5e" dependencies = [ "evm", "frame-support", @@ -3684,7 +3684,7 @@ dependencies = [ [[package]] name = "fp-rpc" version = "3.0.0-dev" -source = "git+https://github.com/paritytech/frontier?branch=polkadot-v1.9.0#f68f4c685ed0aed813dcfaac1a9f94fa33d83d5e" +source = "git+https://github.com/polkadot-evm/frontier?branch=polkadot-v1.9.0#f68f4c685ed0aed813dcfaac1a9f94fa33d83d5e" dependencies = [ "ethereum", "ethereum-types", @@ -3701,7 +3701,7 @@ dependencies = [ [[package]] name = "fp-self-contained" version = "1.0.0-dev" -source = "git+https://github.com/paritytech/frontier?branch=polkadot-v1.9.0#f68f4c685ed0aed813dcfaac1a9f94fa33d83d5e" +source = "git+https://github.com/polkadot-evm/frontier?branch=polkadot-v1.9.0#f68f4c685ed0aed813dcfaac1a9f94fa33d83d5e" dependencies = [ "frame-support", "parity-scale-codec", @@ -3713,7 +3713,7 @@ dependencies = [ [[package]] name = "fp-storage" version = "2.0.0" -source = "git+https://github.com/paritytech/frontier?branch=polkadot-v1.9.0#f68f4c685ed0aed813dcfaac1a9f94fa33d83d5e" +source = "git+https://github.com/polkadot-evm/frontier?branch=polkadot-v1.9.0#f68f4c685ed0aed813dcfaac1a9f94fa33d83d5e" dependencies = [ "parity-scale-codec", "serde", @@ -4017,76 +4017,6 @@ dependencies = [ "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.9.0)", ] -[[package]] -name = "frontier-parachain-runtime" -version = "0.1.0" -dependencies = [ - "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-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-aura", - "pallet-authorship", - "pallet-balances", - "pallet-base-fee", - "pallet-collator-selection", - "pallet-dynamic-fee", - "pallet-ethereum", - "pallet-evm", - "pallet-evm-chain-id", - "pallet-evm-precompile-modexp", - "pallet-evm-precompile-sha3fips", - "pallet-evm-precompile-simple", - "pallet-hotfix-sufficients", - "pallet-message-queue", - "pallet-session", - "pallet-sudo", - "pallet-timestamp", - "pallet-transaction-payment", - "pallet-transaction-payment-rpc-runtime-api", - "pallet-xcm", - "parachains-common", - "parity-scale-codec", - "polkadot-parachain-primitives", - "polkadot-runtime-common", - "scale-info", - "smallvec", - "sp-api", - "sp-block-builder", - "sp-consensus-aura", - "sp-core", - "sp-genesis-builder", - "sp-inherents", - "sp-offchain", - "sp-runtime", - "sp-session", - "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.9.0)", - "sp-transaction-pool", - "sp-version", - "staging-parachain-info", - "staging-xcm", - "staging-xcm-builder", - "staging-xcm-executor", - "substrate-wasm-builder", -] - [[package]] name = "fs-err" version = "2.11.0" @@ -6951,7 +6881,7 @@ dependencies = [ [[package]] name = "pallet-base-fee" version = "1.0.0" -source = "git+https://github.com/paritytech/frontier?branch=polkadot-v1.9.0#f68f4c685ed0aed813dcfaac1a9f94fa33d83d5e" +source = "git+https://github.com/polkadot-evm/frontier?branch=polkadot-v1.9.0#f68f4c685ed0aed813dcfaac1a9f94fa33d83d5e" dependencies = [ "fp-evm", "frame-support", @@ -7135,7 +7065,7 @@ dependencies = [ [[package]] name = "pallet-dynamic-fee" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/frontier?branch=polkadot-v1.9.0#f68f4c685ed0aed813dcfaac1a9f94fa33d83d5e" +source = "git+https://github.com/polkadot-evm/frontier?branch=polkadot-v1.9.0#f68f4c685ed0aed813dcfaac1a9f94fa33d83d5e" dependencies = [ "fp-dynamic-fee", "fp-evm", @@ -7207,7 +7137,7 @@ dependencies = [ [[package]] name = "pallet-ethereum" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/frontier?branch=polkadot-v1.9.0#f68f4c685ed0aed813dcfaac1a9f94fa33d83d5e" +source = "git+https://github.com/polkadot-evm/frontier?branch=polkadot-v1.9.0#f68f4c685ed0aed813dcfaac1a9f94fa33d83d5e" dependencies = [ "ethereum", "ethereum-types", @@ -7230,7 +7160,7 @@ dependencies = [ [[package]] name = "pallet-evm" version = "6.0.0-dev" -source = "git+https://github.com/paritytech/frontier?branch=polkadot-v1.9.0#f68f4c685ed0aed813dcfaac1a9f94fa33d83d5e" +source = "git+https://github.com/polkadot-evm/frontier?branch=polkadot-v1.9.0#f68f4c685ed0aed813dcfaac1a9f94fa33d83d5e" dependencies = [ "environmental", "evm", @@ -7256,7 +7186,7 @@ dependencies = [ [[package]] name = "pallet-evm-chain-id" version = "1.0.0-dev" -source = "git+https://github.com/paritytech/frontier?branch=polkadot-v1.9.0#f68f4c685ed0aed813dcfaac1a9f94fa33d83d5e" +source = "git+https://github.com/polkadot-evm/frontier?branch=polkadot-v1.9.0#f68f4c685ed0aed813dcfaac1a9f94fa33d83d5e" dependencies = [ "frame-support", "frame-system", @@ -7267,7 +7197,7 @@ dependencies = [ [[package]] name = "pallet-evm-precompile-modexp" version = "2.0.0-dev" -source = "git+https://github.com/paritytech/frontier?branch=polkadot-v1.9.0#f68f4c685ed0aed813dcfaac1a9f94fa33d83d5e" +source = "git+https://github.com/polkadot-evm/frontier?branch=polkadot-v1.9.0#f68f4c685ed0aed813dcfaac1a9f94fa33d83d5e" dependencies = [ "fp-evm", "num", @@ -7276,7 +7206,7 @@ dependencies = [ [[package]] name = "pallet-evm-precompile-sha3fips" version = "2.0.0-dev" -source = "git+https://github.com/paritytech/frontier?branch=polkadot-v1.9.0#f68f4c685ed0aed813dcfaac1a9f94fa33d83d5e" +source = "git+https://github.com/polkadot-evm/frontier?branch=polkadot-v1.9.0#f68f4c685ed0aed813dcfaac1a9f94fa33d83d5e" dependencies = [ "fp-evm", "tiny-keccak", @@ -7285,7 +7215,7 @@ dependencies = [ [[package]] name = "pallet-evm-precompile-simple" version = "2.0.0-dev" -source = "git+https://github.com/paritytech/frontier?branch=polkadot-v1.9.0#f68f4c685ed0aed813dcfaac1a9f94fa33d83d5e" +source = "git+https://github.com/polkadot-evm/frontier?branch=polkadot-v1.9.0#f68f4c685ed0aed813dcfaac1a9f94fa33d83d5e" dependencies = [ "fp-evm", "ripemd", @@ -7334,22 +7264,6 @@ dependencies = [ "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.9.0)", ] -[[package]] -name = "pallet-hotfix-sufficients" -version = "1.0.0" -source = "git+https://github.com/paritytech/frontier?branch=polkadot-v1.9.0#f68f4c685ed0aed813dcfaac1a9f94fa33d83d5e" -dependencies = [ - "frame-benchmarking", - "frame-support", - "frame-system", - "pallet-evm", - "parity-scale-codec", - "scale-info", - "sp-core", - "sp-runtime", - "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.9.0)", -] - [[package]] name = "pallet-identity" version = "28.0.0" @@ -8061,11 +7975,11 @@ dependencies = [ "fp-rpc", "frame-benchmarking", "frame-benchmarking-cli", - "frontier-parachain-runtime", "futures", "jsonrpsee", "log", "pallet-transaction-payment-rpc", + "parachain-template-runtime", "parity-scale-codec", "polkadot-cli", "polkadot-primitives", @@ -8103,6 +8017,75 @@ dependencies = [ "substrate-prometheus-endpoint", ] +[[package]] +name = "parachain-template-runtime" +version = "0.1.0" +dependencies = [ + "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-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-aura", + "pallet-authorship", + "pallet-balances", + "pallet-base-fee", + "pallet-collator-selection", + "pallet-dynamic-fee", + "pallet-ethereum", + "pallet-evm", + "pallet-evm-chain-id", + "pallet-evm-precompile-modexp", + "pallet-evm-precompile-sha3fips", + "pallet-evm-precompile-simple", + "pallet-message-queue", + "pallet-session", + "pallet-sudo", + "pallet-timestamp", + "pallet-transaction-payment", + "pallet-transaction-payment-rpc-runtime-api", + "pallet-xcm", + "parachains-common", + "parity-scale-codec", + "polkadot-parachain-primitives", + "polkadot-runtime-common", + "scale-info", + "smallvec", + "sp-api", + "sp-block-builder", + "sp-consensus-aura", + "sp-core", + "sp-genesis-builder", + "sp-inherents", + "sp-offchain", + "sp-runtime", + "sp-session", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.9.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" @@ -9367,7 +9350,6 @@ version = "7.0.0" source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.9.0#3c3d6fceb82372a3019b37117aa453d564b212de" dependencies = [ "async-trait", - "bitvec", "frame-benchmarking", "frame-benchmarking-cli", "frame-support", @@ -9424,7 +9406,6 @@ dependencies = [ "polkadot-runtime-parachains", "polkadot-statement-distribution", "rococo-runtime", - "rococo-runtime-constants", "sc-authority-discovery", "sc-basic-authorship", "sc-block-builder", diff --git a/Cargo.toml b/Cargo.toml index edc9a3d..d0ce8d1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,6 +17,7 @@ resolver = "2" [workspace.dependencies] codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive"] } +color-print = "0.3.4" hex-literal = "0.4.1" log = { version = "0.4.20", default-features = false } scale-info = { version = "2.10.0", default-features = false, features = ["derive"] } @@ -26,7 +27,118 @@ clap = { version = "4.5.1", features = ["derive"] } jsonrpsee = { version = "0.22", features = ["server"] } futures = "0.3.30" serde_json = "1.0.114" -color-print = "0.3.4" # Local -frontier-parachain-runtime = { path = "./runtime" } +parachain-template-runtime = { path = "./runtime" } + +# Build +substrate-wasm-builder = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0", default-features = false } +substrate-build-script-utils = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0" } + +# Substrate +frame-benchmarking = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0", default-features = false } +frame-benchmarking-cli = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0" } +frame-executive = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0", default-features = false } +frame-support = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0", default-features = false } +frame-system = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0", default-features = false } +frame-system-benchmarking = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0", default-features = false } +frame-system-rpc-runtime-api = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0", default-features = false } +frame-try-runtime = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0", default-features = false } +pallet-aura = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0", default-features = false } +pallet-authorship = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0", default-features = false } +pallet-balances = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0", default-features = false } +pallet-message-queue = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0", default-features = false } +pallet-session = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0", default-features = false } +pallet-sudo = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0", default-features = false } +pallet-timestamp = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0", default-features = false } +pallet-transaction-payment = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0", default-features = false } +pallet-transaction-payment-rpc = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0" } +pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0", default-features = false } +sc-basic-authorship = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0" } +sc-chain-spec = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0" } +sc-cli = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0" } +sc-client-api = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0" } +sc-offchain = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0" } +sc-consensus = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0" } +sc-executor = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0" } +sc-network = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0" } +sc-network-sync = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0" } +sc-rpc = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0" } +sc-service = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0", features = ["default"] } +sc-sysinfo = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0" } +sc-telemetry = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0" } +sc-tracing = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0" } +sc-transaction-pool = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0" } +sc-transaction-pool-api = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0" } +sp-genesis-builder = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0", default-features = false } +sp-offchain = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0", default-features = false } +sp-session = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0", default-features = false } +sp-std = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0", default-features = false } +sp-transaction-pool = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0", default-features = false } +sp-version = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0", default-features = false } +sp-api = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0", default-features = false } +sp-block-builder = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0", default-features = false } +sp-blockchain = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0" } +sp-consensus-aura = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0", default-features = false } +sp-core = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0", default-features = false } +sp-keystore = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0" } +sp-io = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0", default-features = false } +sp-inherents = {git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0", default-features = false } +sp-runtime = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0", default-features = false } +sp-timestamp = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0" } +substrate-frame-rpc-system = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0" } +substrate-prometheus-endpoint = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0" } + +# Polkadot +pallet-xcm = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0", default-features = false } +polkadot-cli = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0" } +polkadot-parachain-primitives = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0", default-features = false } +polkadot-primitives = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0" } +xcm = { package = "staging-xcm", git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0", default-features = false } +polkadot-runtime-common = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0", default-features = false } +xcm-builder = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0", package = "staging-xcm-builder", default-features = false } +xcm-executor = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0", package = "staging-xcm-executor", default-features = false } + +# Cumulus +cumulus-client-cli = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0" } +cumulus-client-collator = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0" } +cumulus-client-consensus-aura = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0" } +cumulus-client-consensus-common = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0" } +cumulus-client-consensus-proposer = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0" } +cumulus-client-service = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0" } +cumulus-pallet-aura-ext = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0", default-features = false } +cumulus-pallet-parachain-system = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0", features = ["parameterized-consensus-hook"], default-features = false } +cumulus-pallet-session-benchmarking = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0", default-features = false } +cumulus-pallet-xcm = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0", default-features = false } +cumulus-pallet-xcmp-queue = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0", default-features = false } +cumulus-primitives-aura = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0", default-features = false } +cumulus-primitives-core = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0", default-features = false } +cumulus-primitives-parachain-inherent = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0" } +cumulus-primitives-storage-weight-reclaim = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0", default-features = false } +cumulus-primitives-utility = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0", default-features = false } +cumulus-relay-chain-interface = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0" } +pallet-collator-selection = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0", default-features = false } +parachains-common = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0", default-features = false } +parachain-info = { package = "staging-parachain-info", git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0", default-features = false } + +# Frontier +fc-api = {git = "https://github.com/polkadot-evm/frontier", branch = "polkadot-v1.9.0" } +fc-cli = {git = "https://github.com/polkadot-evm/frontier", branch = "polkadot-v1.9.0" } +fc-consensus = {git = "https://github.com/polkadot-evm/frontier", branch = "polkadot-v1.9.0" } +fc-db = {git = "https://github.com/polkadot-evm/frontier", branch = "polkadot-v1.9.0", default-features = false } +fc-mapping-sync = {git = "https://github.com/polkadot-evm/frontier", features = ["sql"], branch = "polkadot-v1.9.0" } +fc-rpc = {git = "https://github.com/polkadot-evm/frontier", branch = "polkadot-v1.9.0", features = ["rpc-binary-search-estimate", "txpool"], default-features = false } +fc-rpc-core = {git = "https://github.com/polkadot-evm/frontier", branch = "polkadot-v1.9.0" } +fc-storage = {git = "https://github.com/polkadot-evm/frontier", branch = "polkadot-v1.9.0" } +fp-dynamic-fee = {git = "https://github.com/polkadot-evm/frontier", branch = "polkadot-v1.9.0", default-features = false } +fp-evm = {git = "https://github.com/polkadot-evm/frontier", branch = "polkadot-v1.9.0", default-features = false } +fp-rpc = {git = "https://github.com/polkadot-evm/frontier", branch = "polkadot-v1.9.0", default-features = false } +fp-self-contained = { git = "https://github.com/polkadot-evm/frontier", branch = "polkadot-v1.9.0", features = ["serde"], default-features = false } +pallet-base-fee = { git = "https://github.com/polkadot-evm/frontier", branch = "polkadot-v1.9.0", default-features = false } +pallet-dynamic-fee = { git = "https://github.com/polkadot-evm/frontier", branch = "polkadot-v1.9.0", default-features = false } +pallet-ethereum = { git = "https://github.com/polkadot-evm/frontier", branch = "polkadot-v1.9.0", default-features = false } +pallet-evm = { git = "https://github.com/polkadot-evm/frontier", branch = "polkadot-v1.9.0", default-features = false } +pallet-evm-chain-id = { git = "https://github.com/polkadot-evm/frontier", branch = "polkadot-v1.9.0", default-features = false } +pallet-evm-precompile-modexp = { git = "https://github.com/polkadot-evm/frontier", branch = "polkadot-v1.9.0", default-features = false } +pallet-evm-precompile-sha3fips = { git = "https://github.com/polkadot-evm/frontier", branch = "polkadot-v1.9.0", default-features = false } +pallet-evm-precompile-simple = { git = "https://github.com/polkadot-evm/frontier", branch = "polkadot-v1.9.0", default-features = false } diff --git a/README.md b/README.md index b77b05d..eccac94 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ A new [Cumulus](https://github.com/paritytech/polkadot-sdk/tree/master/cumulus)-based Substrate node, configured with [Frontier](https://github.com/polkadot-evm/frontier), enabling compatibility with the Ethereum Virtual Machine (EVM). -This project is a fork of the [Base Parachain Template](https://github.com/r0gue-io/base-parachain). +This project is a fork of the [Base Parachain Template](https://github.com/r0gue-io/base-parachain). It is used to generate parachains using [Pop CLI](https://github.com/r0gue-io/pop-cli), an all-in-one tool for Polkadot development. diff --git a/node/Cargo.toml b/node/Cargo.toml index d6425b4..5620389 100644 --- a/node/Cargo.toml +++ b/node/Cargo.toml @@ -22,72 +22,72 @@ serde_json = { workspace = true } color-print = { workspace = true } # Local -frontier-parachain-runtime = {path = "../runtime"} +parachain-template-runtime = {path = "../runtime"} # Substrate -frame-benchmarking = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0" } -frame-benchmarking-cli = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0" } -pallet-transaction-payment-rpc = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0" } -sc-basic-authorship = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0" } -sc-chain-spec = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0" } -sc-cli = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0" } -sc-client-api = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0" } -sc-offchain = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0" } -sc-consensus = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0" } -sc-executor = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0" } -sc-network = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0" } -sc-network-sync = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0" } -sc-rpc = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0" } -sc-service = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0", features = ["default"] } -sc-sysinfo = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0" } -sc-telemetry = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0" } -sc-tracing = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0" } -sc-transaction-pool = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0" } -sc-transaction-pool-api = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0" } -sp-api = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0" } -sp-block-builder = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0" } -sp-blockchain = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0" } -sp-consensus-aura = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0" } -sp-core = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0" } -sp-keystore = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0" } -sp-io = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0" } -sp-inherents = {git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0"} -sp-runtime = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0" } -sp-timestamp = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0" } -substrate-frame-rpc-system = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0" } -substrate-prometheus-endpoint = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0" } +frame-benchmarking = { workspace = true } +frame-benchmarking-cli = { workspace = true } +pallet-transaction-payment-rpc = { workspace = true } +sc-basic-authorship = { workspace = true } +sc-chain-spec = { workspace = true } +sc-cli = { workspace = true } +sc-client-api = { workspace = true } +sc-offchain = { workspace = true } +sc-consensus = { workspace = true } +sc-executor = { workspace = true } +sc-network = { workspace = true } +sc-network-sync = { workspace = true } +sc-rpc = { workspace = true } +sc-service = { workspace = true } +sc-sysinfo = { workspace = true } +sc-telemetry = { workspace = true } +sc-tracing = { workspace = true } +sc-transaction-pool = { workspace = true } +sc-transaction-pool-api = { workspace = true } +sp-api = { workspace = true } +sp-block-builder = { workspace = true } +sp-blockchain = { workspace = true } +sp-consensus-aura = { workspace = true } +sp-core = { workspace = true } +sp-keystore = { workspace = true } +sp-inherents = { workspace = true } +sp-io = { workspace = true } +sp-runtime = { workspace = true } +sp-timestamp = { workspace = true } +substrate-frame-rpc-system = { workspace = true } +substrate-prometheus-endpoint = { workspace = true } # Polkadot -polkadot-cli = { git = "https://github.com/paritytech/polkadot-sdk", features = ["rococo-native"], branch = "release-polkadot-v1.9.0" } -polkadot-primitives = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0" } -xcm = { package = "staging-xcm", git = "https://github.com/paritytech/polkadot-sdk", default-features = false, branch = "release-polkadot-v1.9.0" } +polkadot-cli = { workspace = true } +polkadot-primitives = { workspace = true } +xcm = { workspace = true } # Cumulus -cumulus-client-cli = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0" } -cumulus-client-collator = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0" } -cumulus-client-consensus-aura = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0" } -cumulus-client-consensus-common = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0" } -cumulus-client-consensus-proposer = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0" } -cumulus-client-service = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0" } -cumulus-primitives-core = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0" } -cumulus-primitives-parachain-inherent = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0" } -cumulus-relay-chain-interface = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0" } +cumulus-client-cli = { workspace = true } +cumulus-client-collator = { workspace = true } +cumulus-client-consensus-aura = { workspace = true } +cumulus-client-consensus-common = { workspace = true } +cumulus-client-consensus-proposer = { workspace = true } +cumulus-client-service = { workspace = true } +cumulus-primitives-core = { workspace = true } +cumulus-primitives-parachain-inherent = { workspace = true } +cumulus-relay-chain-interface = { workspace = true } # Frontier FRAME -fc-api = {git = "https://github.com/paritytech/frontier", branch = "polkadot-v1.9.0"} -fc-cli = {git = "https://github.com/paritytech/frontier", branch = "polkadot-v1.9.0"} -fc-consensus = {git = "https://github.com/paritytech/frontier", branch = "polkadot-v1.9.0"} -fc-db = {git = "https://github.com/paritytech/frontier", default-features = false , branch = "polkadot-v1.9.0"} -fc-mapping-sync = {git = "https://github.com/paritytech/frontier", features = ["sql"], branch = "polkadot-v1.9.0"} -fc-rpc = {git = "https://github.com/paritytech/frontier", branch = "polkadot-v1.9.0", features = ["rpc-binary-search-estimate", "txpool"]} -fc-rpc-core = {git = "https://github.com/paritytech/frontier", branch = "polkadot-v1.9.0"} -fc-storage = {git = "https://github.com/paritytech/frontier", branch = "polkadot-v1.9.0"} -fp-dynamic-fee = {git = "https://github.com/paritytech/frontier", branch = "polkadot-v1.9.0"} -fp-evm = {git = "https://github.com/paritytech/frontier", branch = "polkadot-v1.9.0"} -fp-rpc = {git = "https://github.com/paritytech/frontier", branch = "polkadot-v1.9.0"} +fc-api = { workspace = true } +fc-cli = { workspace = true } +fc-consensus = { workspace = true } +fc-db = { workspace = true } +fc-mapping-sync = { workspace = true } +fc-rpc = { workspace = true } +fc-rpc-core = { workspace = true } +fc-storage = { workspace = true } +fp-dynamic-fee = { workspace = true } +fp-evm = { workspace = true } +fp-rpc = { workspace = true } [build-dependencies] -substrate-build-script-utils = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0" } +substrate-build-script-utils = { workspace = true } [features] default = [] @@ -95,14 +95,14 @@ runtime-benchmarks = [ "cumulus-primitives-core/runtime-benchmarks", "frame-benchmarking-cli/runtime-benchmarks", "frame-benchmarking/runtime-benchmarks", - "frontier-parachain-runtime/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 = [ - "frontier-parachain-runtime/try-runtime", + "parachain-template-runtime/try-runtime", "polkadot-cli/try-runtime", "sp-runtime/try-runtime", ] diff --git a/node/src/chain_spec.rs b/node/src/chain_spec.rs index 878b323..b5b667a 100644 --- a/node/src/chain_spec.rs +++ b/node/src/chain_spec.rs @@ -1,5 +1,5 @@ use cumulus_primitives_core::ParaId; -use frontier_parachain_runtime as runtime; +use parachain_template_runtime as runtime; use runtime::{AccountId, AuraId, Signature, EXISTENTIAL_DEPOSIT}; use sc_chain_spec::{ChainSpecExtension, ChainSpecGroup}; use sc_service::ChainType; @@ -74,7 +74,7 @@ pub fn development_config() -> ChainSpec { Extensions { relay_chain: "rococo-local".into(), // You MUST set this to the correct network! - para_id: 1000, + para_id: 2000, }, ) .with_name("Development") @@ -107,7 +107,7 @@ pub fn development_config() -> ChainSpec { get_account_id_from_seed::("Ferdie//stash"), ], get_account_id_from_seed::("Alice"), - 1000.into(), + 2000.into(), )) .build() } @@ -125,7 +125,7 @@ pub fn local_testnet_config() -> ChainSpec { Extensions { relay_chain: "rococo-local".into(), // You MUST set this to the correct network! - para_id: 1000, + para_id: 2000, }, ) .with_name("Local Testnet") @@ -158,7 +158,7 @@ pub fn local_testnet_config() -> ChainSpec { get_account_id_from_seed::("Ferdie//stash"), ], get_account_id_from_seed::("Alice"), - 1000.into(), + 2000.into(), )) .with_protocol_id("template-local") .with_properties(properties) diff --git a/node/src/cli.rs b/node/src/cli.rs index 54f6cb6..14a81a7 100644 --- a/node/src/cli.rs +++ b/node/src/cli.rs @@ -2,6 +2,7 @@ use crate::eth::EthConfiguration; use std::path::PathBuf; /// Sub-commands supported by the collator. +#[allow(clippy::large_enum_variant)] #[derive(Debug, clap::Subcommand)] pub enum Subcommand { /// Build a chain specification. @@ -65,7 +66,7 @@ const AFTER_HELP_EXAMPLE: &str = color_print::cstr!( args_conflicts_with_subcommands = true, subcommand_negates_reqs = true )] -#[clap(after_help = AFTER_HELP_EXAMPLE)] +#[command(after_help = AFTER_HELP_EXAMPLE)] pub struct Cli { #[command(subcommand)] pub subcommand: Option, diff --git a/node/src/command.rs b/node/src/command.rs index fe04c40..52604a3 100644 --- a/node/src/command.rs +++ b/node/src/command.rs @@ -1,8 +1,10 @@ +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 frontier_parachain_runtime::Block; use log::info; +use parachain_template_runtime::Block; use sc_cli::{ ChainSpec, CliConfiguration, DefaultConfigurationValues, ImportParams, KeystoreParams, NetworkParams, Result, SharedParams, SubstrateCli, @@ -12,7 +14,6 @@ use sc_service::{ PartialComponents, }; use sp_runtime::traits::AccountIdConversion; -use std::net::SocketAddr; use std::sync::Arc; use crate::{ @@ -276,7 +277,7 @@ pub fn run() -> Result<()> { crate::service::start_parachain_node( config, polkadot_config, - eth_cfg, + eth_cfg, collator_options, id, hwbench, diff --git a/node/src/eth.rs b/node/src/eth.rs index 577dbca..258b8ef 100644 --- a/node/src/eth.rs +++ b/node/src/eth.rs @@ -21,7 +21,7 @@ use fc_mapping_sync::{kv::MappingSyncWorker, SyncStrategy}; use fc_rpc::{EthTask, OverrideHandle}; pub use fc_rpc_core::types::{FeeHistoryCache, FeeHistoryCacheLimit, FilterPool}; // Local -use frontier_parachain_runtime::opaque::Block; +use parachain_template_runtime::opaque::Block; /// Frontier DB backend type. pub type FrontierBackend = fc_db::Backend; @@ -124,6 +124,7 @@ impl EthCompatRuntimeApiCollection for Api where { } +#[allow(clippy::too_many_arguments)] pub async fn spawn_frontier_tasks( task_manager: &TaskManager, client: Arc>>, diff --git a/node/src/rpc/eth.rs b/node/src/rpc/eth.rs index db9ceb9..1674ab6 100644 --- a/node/src/rpc/eth.rs +++ b/node/src/rpc/eth.rs @@ -1,8 +1,7 @@ -use std::{collections::BTreeMap, sync::Arc}; - use fc_rpc::pending::AuraConsensusDataProvider; use fc_rpc_core::EthApiServer; use jsonrpsee::RpcModule; +use std::{collections::BTreeMap, sync::Arc}; // Substrate use sc_client_api::{ backend::{Backend, StorageProvider}, @@ -21,7 +20,7 @@ use sp_consensus_aura::{sr25519::AuthorityId as AuraId, AuraApi}; use sp_core::H256; use sp_runtime::traits::Block as BlockT; // Frontier -pub use fc_rpc::{EthBlockDataCacheTask, EthConfig, OverrideHandle, StorageOverride}; +pub use fc_rpc::{EthBlockDataCacheTask, EthConfig, OverrideHandle}; #[cfg(feature = "txpool")] use fc_rpc::{TxPool, TxPoolApiServer}; pub use fc_rpc_core::types::{FeeHistoryCache, FeeHistoryCacheLimit, FilterPool}; diff --git a/node/src/rpc/mod.rs b/node/src/rpc/mod.rs index 41971e0..6df4fb4 100644 --- a/node/src/rpc/mod.rs +++ b/node/src/rpc/mod.rs @@ -7,7 +7,7 @@ use std::sync::Arc; -use frontier_parachain_runtime::{opaque::Block, AccountId, Balance, Nonce}; +use parachain_template_runtime::{opaque::Block, AccountId, Balance, Nonce}; use sc_client_api::{ backend::{AuxStore, Backend, StorageProvider}, diff --git a/node/src/service.rs b/node/src/service.rs index dc058f4..65819c5 100644 --- a/node/src/service.rs +++ b/node/src/service.rs @@ -5,7 +5,7 @@ use std::{path::Path, sync::Arc, time::Duration}; use cumulus_client_cli::CollatorOptions; // Local Runtime Types -use frontier_parachain_runtime::{ +use parachain_template_runtime::{ opaque::{Block, Hash}, RuntimeApi, TransactionConverter, }; @@ -57,11 +57,11 @@ impl sc_executor::NativeExecutionDispatch for ParachainNativeExecutor { ); fn dispatch(method: &str, data: &[u8]) -> Option> { - frontier_parachain_runtime::api::dispatch(method, data) + parachain_template_runtime::api::dispatch(method, data) } fn native_version() -> sc_executor::NativeVersion { - frontier_parachain_runtime::native_version() + parachain_template_runtime::native_version() } } @@ -84,7 +84,8 @@ pub type Service = PartialComponents< ParachainBlockImport, Option, Option, - Arc, + FrontierBackend, + Arc>, ), >; @@ -95,23 +96,7 @@ pub type Service = PartialComponents< pub fn new_partial( config: &Configuration, eth_config: &EthConfiguration, -) -> Result< - PartialComponents< - ParachainClient, - ParachainBackend, - (), - sc_consensus::DefaultImportQueue, - sc_transaction_pool::FullPool, - ( - ParachainBlockImport, - Option, - Option, - FrontierBackend, - Arc>, - ), - >, - sc_service::Error, -> { +) -> Result { let telemetry = config .telemetry_endpoints .clone() @@ -246,7 +231,7 @@ async fn start_node_impl( import_queue, keystore_container, transaction_pool, - other: (block_import, mut telemetry, telemetry_worker_handle, frontier_backend, overrides), + other: (block_import, mut telemetry, telemetry_worker_handle, frontier_backend, _overrides), .. } = new_partial(¶chain_config, ð_config)?; @@ -400,7 +385,8 @@ async fn start_node_impl( telemetry: telemetry.as_mut(), })?; - spawn_frontier_tasks( + #[allow(clippy::let_underscore_future)] + let _ = spawn_frontier_tasks( &task_manager, client.clone(), backend.clone(), @@ -533,6 +519,7 @@ fn build_import_queue( ) } +#[allow(clippy::too_many_arguments)] fn start_consensus( client: Arc, backend: Arc, diff --git a/polkadot-launch/config.json b/polkadot-launch/config.json deleted file mode 100644 index f03f983..0000000 --- a/polkadot-launch/config.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "relaychain": { - "bin": "../../polkadot/target/release/polkadot", - "chain": "rococo-local", - "nodes": [ - { - "name": "alice", - "wsPort": 9944, - "port": 30444 - }, - { - "name": "bob", - "wsPort": 9955, - "port": 30555 - } - ] - }, - "parachains": [ - { - "bin": "../target/release/polkadot-parachain", - "id": "200", - "balance": "1000000000000000000000", - "nodes": [ - { - "wsPort": 9988, - "name": "alice", - "port": 31200, - "flags": [ - "--force-authoring", - "--", - "--execution=wasm" - ] - } - ] - } - ], - "types": { - } -} diff --git a/runtime/Cargo.toml b/runtime/Cargo.toml index 91af7d9..13d52bb 100644 --- a/runtime/Cargo.toml +++ b/runtime/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "frontier-parachain-runtime" +name = "parachain-template-runtime" version = "0.1.0" authors.workspace = true description = "Parachain runtime template" @@ -13,8 +13,7 @@ publish = false targets = ["x86_64-unknown-linux-gnu"] [build-dependencies] -substrate-wasm-builder = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0", default-features = false } - +substrate-wasm-builder = { workspace = true } [dependencies] codec = { workspace = true } @@ -22,75 +21,73 @@ hex-literal = { workspace = true } log = { workspace = true } scale-info = { workspace = true } smallvec = { workspace = true } + # Substrate -frame-benchmarking = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0", optional = true, default-features = false } -frame-executive = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0", default-features = false } -frame-support = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0", default-features = false } -frame-system = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0", default-features = false } -frame-system-benchmarking = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0", optional = true, default-features = false } -frame-system-rpc-runtime-api = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0", default-features = false } -frame-try-runtime = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0", optional = true, default-features = false } -pallet-aura = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0", default-features = false } -pallet-authorship = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0", default-features = false } -pallet-balances = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0", default-features = false } -pallet-message-queue = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0", default-features = false } -pallet-session = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0", default-features = false } -pallet-sudo = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0", default-features = false } -pallet-timestamp = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0", default-features = false } -pallet-transaction-payment = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0", default-features = false } -pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0", default-features = false } -sp-api = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0", default-features = false } -sp-block-builder = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0", default-features = false } -sp-consensus-aura = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0", default-features = false } -sp-core = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0", default-features = false } -sp-genesis-builder = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0", default-features = false } -sp-inherents = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0", default-features = false } -sp-offchain = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0", default-features = false } -sp-runtime = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0", default-features = false } -sp-session = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0", default-features = false } -sp-std = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0", default-features = false } -sp-transaction-pool = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0", default-features = false } -sp-version = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0", default-features = false } +frame-benchmarking = { workspace = true, optional = true } +frame-executive = { workspace = true } +frame-support = { workspace = true } +frame-system = { workspace = true } +frame-system-benchmarking = { workspace = true, optional = true } +frame-system-rpc-runtime-api = { workspace = true } +frame-try-runtime = { workspace = true, optional = true } +pallet-aura = { workspace = true } +pallet-authorship = { workspace = true } +pallet-balances = { workspace = true } +pallet-message-queue = { workspace = true } +pallet-session = { workspace = true } +pallet-sudo = { workspace = true } +pallet-timestamp = { workspace = true } +pallet-transaction-payment = { workspace = true } +pallet-transaction-payment-rpc-runtime-api = { workspace = true } +sp-api = { workspace = true } +sp-block-builder = { workspace = true } +sp-consensus-aura = { workspace = true } +sp-core = { workspace = true } +sp-genesis-builder = { workspace = true } +sp-inherents = { workspace = true } +sp-offchain = { workspace = true } +sp-runtime = { workspace = true } +sp-session = { workspace = true } +sp-std = { workspace = true } +sp-transaction-pool = { workspace = true } +sp-version = { workspace = true } # Polkadot -pallet-xcm = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0", default-features = false } -polkadot-parachain-primitives = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0", default-features = false } -polkadot-runtime-common = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0", default-features = false } -xcm = { package = "staging-xcm", git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0", default-features = false } -xcm-builder = { package = "staging-xcm-builder", git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0", default-features = false } -xcm-executor = { package = "staging-xcm-executor", git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0", default-features = false } +pallet-xcm = { workspace = true } +polkadot-parachain-primitives = { workspace = true } +polkadot-runtime-common = { workspace = true } +xcm = { workspace = true } +xcm-builder = { workspace = true } +xcm-executor = { workspace = true } # Cumulus -cumulus-pallet-aura-ext = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0", default-features = false } -cumulus-pallet-parachain-system = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0", default-features = false, features = ["parameterized-consensus-hook"] } -cumulus-pallet-session-benchmarking = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0", default-features = false } -cumulus-pallet-xcm = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0", default-features = false } -cumulus-pallet-xcmp-queue = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0", default-features = false } -cumulus-primitives-aura = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0", default-features = false } -cumulus-primitives-core = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0", default-features = false } -cumulus-primitives-storage-weight-reclaim = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0", default-features = false } -cumulus-primitives-utility = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0", default-features = false } -pallet-collator-selection = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0", default-features = false } -parachains-common = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0", default-features = false } -parachain-info = { package = "staging-parachain-info", git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.9.0", default-features = false } +cumulus-pallet-aura-ext = { workspace = true } +cumulus-pallet-parachain-system = { workspace = true } +cumulus-pallet-session-benchmarking = { workspace = true } +cumulus-pallet-xcm = { workspace = true } +cumulus-pallet-xcmp-queue = { workspace = true } +cumulus-primitives-aura = { workspace = true } +cumulus-primitives-core = { workspace = true } +cumulus-primitives-storage-weight-reclaim = { workspace = true } +cumulus-primitives-utility = { workspace = true } +pallet-collator-selection = { workspace = true } +parachains-common = { workspace = true } +parachain-info = { workspace = true } # Frontier -fp-evm = { git = "https://github.com/paritytech/frontier", branch = "polkadot-v1.9.0", default-features = false } -fp-rpc = { git = "https://github.com/paritytech/frontier", branch = "polkadot-v1.9.0", default-features = false } -fp-self-contained = { git = "https://github.com/paritytech/frontier", branch = "polkadot-v1.9.0", default-features = false, features = [ - "serde", -] } +fp-evm = { workspace = true } +fp-rpc = { workspace = true } +fp-self-contained = { workspace = true } # Frontier FRAME -pallet-base-fee = { git = "https://github.com/paritytech/frontier", branch = "polkadot-v1.9.0", default-features = false } -pallet-dynamic-fee = { git = "https://github.com/paritytech/frontier", branch = "polkadot-v1.9.0", default-features = false } -pallet-ethereum = { git = "https://github.com/paritytech/frontier", branch = "polkadot-v1.9.0", default-features = false } -pallet-evm = { git = "https://github.com/paritytech/frontier", branch = "polkadot-v1.9.0", default-features = false } -pallet-evm-chain-id = { git = "https://github.com/paritytech/frontier", branch = "polkadot-v1.9.0", default-features = false } -pallet-evm-precompile-modexp = { git = "https://github.com/paritytech/frontier", branch = "polkadot-v1.9.0", default-features = false } -pallet-evm-precompile-sha3fips = { git = "https://github.com/paritytech/frontier", branch = "polkadot-v1.9.0", default-features = false } -pallet-evm-precompile-simple = { git = "https://github.com/paritytech/frontier", branch = "polkadot-v1.9.0", default-features = false } -pallet-hotfix-sufficients = { git = "https://github.com/paritytech/frontier", branch = "polkadot-v1.9.0", default-features = false } +pallet-base-fee = { workspace = true } +pallet-dynamic-fee = { workspace = true } +pallet-ethereum = { workspace = true } +pallet-evm = { workspace = true } +pallet-evm-chain-id = { workspace = true } +pallet-evm-precompile-modexp = { workspace = true } +pallet-evm-precompile-sha3fips = { workspace = true } +pallet-evm-precompile-simple = { workspace = true } [features] default = ["std"] @@ -157,7 +154,6 @@ std = [ "pallet-evm-precompile-modexp/std", "pallet-evm-precompile-sha3fips/std", "pallet-evm-precompile-simple/std", - "pallet-hotfix-sufficients/std", ] runtime-benchmarks = [ @@ -184,7 +180,6 @@ runtime-benchmarks = [ "xcm-executor/runtime-benchmarks", "pallet-ethereum/runtime-benchmarks", "pallet-evm/runtime-benchmarks", - "pallet-hotfix-sufficients/runtime-benchmarks", "fp-self-contained/try-runtime", ] @@ -216,7 +211,6 @@ try-runtime = [ "pallet-ethereum/try-runtime", "pallet-base-fee/try-runtime", "pallet-dynamic-fee/try-runtime", - "pallet-hotfix-sufficients/try-runtime", ] experimental = ["pallet-aura/experimental"] diff --git a/runtime/src/lib.rs b/runtime/src/lib.rs index 0a553ef..232b6a7 100644 --- a/runtime/src/lib.rs +++ b/runtime/src/lib.rs @@ -11,7 +11,6 @@ pub mod xcm_config; use codec::{Decode, Encode}; use cumulus_pallet_parachain_system::RelayNumberMonotonicallyIncreases; -use polkadot_runtime_common::xcm_sender::NoPriceForMessageDelivery; use smallvec::smallvec; use sp_api::impl_runtime_apis; use sp_core::{ @@ -68,7 +67,7 @@ use polkadot_runtime_common::{BlockHashCount, SlowAdjustingFeeUpdate}; use weights::{BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight}; // XCM Imports -use xcm::latest::prelude::BodyId; +use xcm::latest::prelude::{AssetId, BodyId}; // Frontier use fp_evm::weight_per_gas; @@ -201,8 +200,8 @@ impl_opaque_keys! { #[sp_version::runtime_version] pub const VERSION: RuntimeVersion = RuntimeVersion { - spec_name: create_runtime_str!("frontier-parachain-runtime"), - impl_name: create_runtime_str!("frontier-parachain-runtime"), + spec_name: create_runtime_str!("parachain-template-runtime"), + impl_name: create_runtime_str!("parachain-template-runtime"), authoring_version: 1, spec_version: 1, impl_version: 0, @@ -230,6 +229,7 @@ pub const DAYS: BlockNumber = HOURS * 24; // Unit = the base number of indivisible units for balances pub const UNIT: Balance = 1_000_000_000_000; +pub const CENTIUNIT: Balance = 10_000_000_000; pub const MILLIUNIT: Balance = 1_000_000_000; pub const MICROUNIT: Balance = 1_000_000; @@ -245,9 +245,11 @@ const AVERAGE_ON_INITIALIZE_RATIO: Perbill = Perbill::from_percent(5); const NORMAL_DISPATCH_RATIO: Perbill = Perbill::from_percent(75); /// We allow for 2 seconds of compute with a 6-second average block. -pub const WEIGHT_MILLISECS_PER_BLOCK: u64 = WEIGHT_REF_TIME_PER_SECOND.saturating_div(2); -const MAXIMUM_BLOCK_WEIGHT: Weight = - Weight::from_parts(WEIGHT_MILLISECS_PER_BLOCK, MAX_POV_SIZE as u64); +pub const WEIGHT_MILLISECS_PER_BLOCK: u64 = WEIGHT_REF_TIME_PER_SECOND.saturating_mul(2); +const MAXIMUM_BLOCK_WEIGHT: Weight = Weight::from_parts( + WEIGHT_MILLISECS_PER_BLOCK, + cumulus_primitives_core::relay_chain::MAX_POV_SIZE as u64, +); /// Maximum number of blocks simultaneously accepted by the Runtime, not yet included /// into the relay chain. @@ -388,7 +390,7 @@ impl pallet_evm::Config for Runtime { type GasLimitPovSizeRatio = GasLimitPovSizeRatio; type SuicideQuickClearLimit = SuicideQuickClearLimit; type Timestamp = Timestamp; - type WeightInfo = pallet_evm::weights::SubstrateWeight; + type WeightInfo = (); // Configure based on benchmarking results.; } parameter_types! { @@ -452,7 +454,7 @@ impl pallet_balances::Config for Runtime { type DustRemoval = (); type ExistentialDeposit = ExistentialDeposit; type AccountStore = System; - type WeightInfo = pallet_balances::weights::SubstrateWeight; + type WeightInfo = (); // Configure based on benchmarking results. type MaxReserves = ConstU32<50>; type ReserveIdentifier = [u8; 8]; type RuntimeHoldReason = RuntimeHoldReason; @@ -478,7 +480,7 @@ impl pallet_transaction_payment::Config for Runtime { impl pallet_sudo::Config for Runtime { type RuntimeEvent = RuntimeEvent; type RuntimeCall = RuntimeCall; - type WeightInfo = (); + type WeightInfo = (); // Configure based on benchmarking results. } parameter_types! { @@ -495,7 +497,7 @@ type ConsensusHook = cumulus_pallet_aura_ext::FixedVelocityConsensusHook< >; impl cumulus_pallet_parachain_system::Config for Runtime { - type WeightInfo = (); + type WeightInfo = (); // Configure based on benchmarking results. type RuntimeEvent = RuntimeEvent; type OnSystemEvent = (); type SelfParaId = parachain_info::Pallet; @@ -516,7 +518,7 @@ parameter_types! { impl pallet_message_queue::Config for Runtime { type RuntimeEvent = RuntimeEvent; - type WeightInfo = (); + type WeightInfo = (); // Configure based on benchmarking results. #[cfg(feature = "runtime-benchmarks")] type MessageProcessor = pallet_message_queue::mock_helpers::NoopMessageProcessor< cumulus_primitives_core::AggregateMessageOrigin, @@ -538,6 +540,20 @@ impl pallet_message_queue::Config for Runtime { impl cumulus_pallet_aura_ext::Config for Runtime {} +parameter_types! { + /// The asset ID for the asset that we use to pay for message delivery fees. + pub FeeAssetId: AssetId = AssetId(xcm_config::TokenLocation::get()); + /// The base fee for the message delivery fees. + pub const BaseDeliveryFee: u128 = CENTIUNIT.saturating_mul(3); +} + +pub type PriceForSiblingParachainDelivery = polkadot_runtime_common::xcm_sender::ExponentialPrice< + FeeAssetId, + BaseDeliveryFee, + TransactionByteFee, + XcmpQueue, +>; + impl cumulus_pallet_xcmp_queue::Config for Runtime { type RuntimeEvent = RuntimeEvent; type ChannelInfo = ParachainSystem; @@ -547,8 +563,8 @@ impl cumulus_pallet_xcmp_queue::Config for Runtime { type MaxInboundSuspended = sp_core::ConstU32<1_000>; type ControllerOrigin = EnsureRoot; type ControllerOriginConverter = XcmOriginToTransactDispatchOrigin; - type WeightInfo = (); - type PriceForSiblingDelivery = NoPriceForMessageDelivery; + type WeightInfo = (); // Configure based on benchmarking results. + type PriceForSiblingDelivery = PriceForSiblingParachainDelivery; } parameter_types! { @@ -567,7 +583,7 @@ impl pallet_session::Config for Runtime { // Essentially just Aura, but let's be pedantic. type SessionHandler = ::KeyTypeIdProviders; type Keys = SessionKeys; - type WeightInfo = (); + type WeightInfo = (); // Configure based on benchmarking results. } impl pallet_aura::Config for Runtime { @@ -605,11 +621,13 @@ impl pallet_collator_selection::Config for Runtime { type ValidatorId = ::AccountId; type ValidatorIdOf = pallet_collator_selection::IdentityCollator; type ValidatorRegistration = Session; - type WeightInfo = (); + type WeightInfo = (); // Configure based on benchmarking results. } // Create the runtime by composing the FRAME pallets that were previously configured. construct_runtime!( + // While this macro defines the pallets conforming the runtime, + // the ones to be benchmarked need to be explicitly passed to `define_benchmarks!`. pub enum Runtime { // System support stuff. System: frame_system = 0, @@ -732,15 +750,16 @@ impl fp_self_contained::SelfContainedCall for RuntimeCall { #[cfg(feature = "runtime-benchmarks")] mod benches { frame_benchmarking::define_benchmarks!( + // Only benchmark the following pallets [frame_system, SystemBench::] - [pallet_balances, Balances] - [pallet_session, SessionBench::] + [cumulus_pallet_parachain_system, ParachainSystem] [pallet_timestamp, Timestamp] - [pallet_message_queue, MessageQueue] + [pallet_balances, Balances] [pallet_sudo, Sudo] [pallet_collator_selection, CollatorSelection] - [cumulus_pallet_parachain_system, ParachainSystem] + [pallet_session, SessionBench::] [cumulus_pallet_xcmp_queue, XcmpQueue] + [pallet_message_queue, MessageQueue] [pallet_evm, EVM] ); } @@ -1119,7 +1138,6 @@ impl_runtime_apis! { Vec, ) { use frame_benchmarking::{Benchmarking, BenchmarkList}; - use frame_benchmarking::list_benchmark; use frame_support::traits::StorageInfoTrait; use frame_system_benchmarking::Pallet as SystemBench; use cumulus_pallet_session_benchmarking::Pallet as SessionBench; @@ -1134,12 +1152,10 @@ impl_runtime_apis! { fn dispatch_benchmark( config: frame_benchmarking::BenchmarkConfig ) -> Result, sp_runtime::RuntimeString> { - use frame_support::traits::TrackedStorageKey; - use frame_benchmarking::{Benchmarking, BenchmarkBatch, add_benchmark}; + use frame_benchmarking::{Benchmarking, BenchmarkBatch, BenchmarkError, add_benchmark}; use pallet_evm::Pallet as PalletEvmBench; use frame_system_benchmarking::Pallet as SystemBench; - use frame_benchmarking::BenchmarkError; impl frame_system_benchmarking::Config for Runtime { fn setup_set_code_requirements(code: &sp_std::vec::Vec) -> Result<(), BenchmarkError> { ParachainSystem::initialize_for_set_code_benchmark(code.len() as u32); diff --git a/runtime/src/precompiles.rs b/runtime/src/precompiles.rs index dda5335..5c22b20 100644 --- a/runtime/src/precompiles.rs +++ b/runtime/src/precompiles.rs @@ -17,6 +17,7 @@ where pub fn new() -> Self { Self(Default::default()) } + pub fn used_addresses() -> [H160; 7] { [ hash(1), @@ -29,6 +30,16 @@ where ] } } + +impl Default for FrontierPrecompiles +where + R: pallet_evm::Config, +{ + fn default() -> Self { + Self::new() + } +} + impl PrecompileSet for FrontierPrecompiles where R: pallet_evm::Config, diff --git a/runtime/src/xcm_config.rs b/runtime/src/xcm_config.rs index 6e5b33f..f190ec3 100644 --- a/runtime/src/xcm_config.rs +++ b/runtime/src/xcm_config.rs @@ -9,8 +9,13 @@ use frame_support::{ }; use frame_system::EnsureRoot; use pallet_xcm::XcmPassthrough; +use parachains_common::{ + xcm_config::{AllSiblingSystemParachains, RelayOrOtherSystemParachains}, + TREASURY_PALLET_ID, +}; use polkadot_parachain_primitives::primitives::Sibling; use polkadot_runtime_common::impls::ToAuthor; +use sp_runtime::traits::AccountIdConversion; use xcm::latest::prelude::*; use xcm_builder::{ AccountId32Aliases, AllowExplicitUnpaidExecutionFrom, AllowTopLevelPaidExecutionFrom, @@ -19,16 +24,24 @@ use xcm_builder::{ RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia, SignedAccountId32AsNative, SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit, TrailingSetTopicAsId, UsingComponents, WithComputedOrigin, WithUniqueTopic, + XcmFeeManagerFromComponents, XcmFeeToAccount, }; use xcm_executor::XcmExecutor; parameter_types! { pub const RelayLocation: Location = Location::parent(); pub const RelayNetwork: Option = None; + pub const TokenLocation: Location = Location::here(); pub RelayChainOrigin: RuntimeOrigin = cumulus_pallet_xcm::Origin::Relay.into(); pub UniversalLocation: InteriorLocation = Parachain(ParachainInfo::parachain_id().into()).into(); + pub TreasuryAccount: AccountId = TREASURY_PALLET_ID.into_account_truncating(); } +/// Locations that will not be charged fees in the executor, +/// either execution or delivery. +/// We only waive fees for system functions, which these locations represent. +pub type WaivedLocations = (RelayOrOtherSystemParachains,); + /// Type for specifying how a `Location` can be converted into an `AccountId`. This is used /// when determining ownership of accounts for asset transacting and when attempting to use XCM /// `Transact` in order to determine the dispatch Origin. @@ -140,7 +153,14 @@ impl xcm_executor::Config for XcmConfig { type MaxAssetsIntoHolding = MaxAssetsIntoHolding; type AssetLocker = (); type AssetExchanger = (); - type FeeManager = (); + type FeeManager = XcmFeeManagerFromComponents< + WaivedLocations, + // Delivery fees are sent to the treasury account. + // These funds are not accessible without a module controlling such an account. + // [pallet_treasury](https://github.com/paritytech/polkadot-sdk/tree/master/substrate/frame/treasury) + // could be suitable option, configured using the same `TREASURY_PALLET_ID` used above as the pallet config's `PalletId`. + XcmFeeToAccount, + >; type MessageExporter = (); type UniversalAliases = Nothing; type CallDispatcher = RuntimeCall; @@ -170,7 +190,7 @@ impl pallet_xcm::Config for Runtime { // ^ Disable dispatchable execute on the XCM pallet. // Needs to be `Everything` for local testing. type XcmExecutor = XcmExecutor; - type XcmTeleportFilter = Everything; + type XcmTeleportFilter = Nothing; type XcmReserveTransferFilter = Nothing; type Weigher = FixedWeightBounds; type UniversalLocation = UniversalLocation; @@ -185,7 +205,7 @@ impl pallet_xcm::Config for Runtime { type TrustedLockers = (); type SovereignAccountOf = LocationToAccountId; type MaxLockers = ConstU32<8>; - type WeightInfo = pallet_xcm::TestWeightInfo; + type WeightInfo = pallet_xcm::TestWeightInfo; // Configure based on benchmarking results. type AdminOrigin = EnsureRoot; type MaxRemoteLockConsumers = ConstU32<0>; type RemoteLockConsumerIdentifier = (); diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 12d44b0..dc68ae8 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,4 +1,4 @@ [toolchain] -channel = "stable" +channel = "1.75" # pinned to version used with polkadot release components = ["rust-src", "rustfmt", "clippy"] targets = ["wasm32-unknown-unknown"]