Skip to content
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 36 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,19 @@ edition = "2021"
repository = "https://github.com/zdave-parity/polkadot-bulletin-chain.git"

[workspace.dependencies]
cumulus-pallet-aura-ext = { git = "https://github.com/paritytech/polkadot-sdk.git", rev = "56e4b10bbbbcefcf9e4fe879c88c68902181fc4a", default-features = false }
cumulus-pallet-parachain-system = { git = "https://github.com/paritytech/polkadot-sdk.git", rev = "56e4b10bbbbcefcf9e4fe879c88c68902181fc4a", default-features = false }
cumulus-pallet-session-benchmarking = { git = "https://github.com/paritytech/polkadot-sdk.git", rev = "56e4b10bbbbcefcf9e4fe879c88c68902181fc4a", default-features = false }
cumulus-pallet-weight-reclaim = { git = "https://github.com/paritytech/polkadot-sdk.git", rev = "56e4b10bbbbcefcf9e4fe879c88c68902181fc4a", default-features = false }
cumulus-pallet-xcm = { git = "https://github.com/paritytech/polkadot-sdk.git", rev = "56e4b10bbbbcefcf9e4fe879c88c68902181fc4a", default-features = false }
cumulus-pallet-xcmp-queue = { git = "https://github.com/paritytech/polkadot-sdk.git", rev = "56e4b10bbbbcefcf9e4fe879c88c68902181fc4a", default-features = false }
cumulus-primitives-aura = { git = "https://github.com/paritytech/polkadot-sdk.git", rev = "56e4b10bbbbcefcf9e4fe879c88c68902181fc4a", default-features = false }
cumulus-primitives-core = { git = "https://github.com/paritytech/polkadot-sdk.git", rev = "56e4b10bbbbcefcf9e4fe879c88c68902181fc4a", default-features = false }
cumulus-primitives-utility = { git = "https://github.com/paritytech/polkadot-sdk.git", rev = "56e4b10bbbbcefcf9e4fe879c88c68902181fc4a", default-features = false }
parachain-info = { git = "https://github.com/paritytech/polkadot-sdk.git", package = "staging-parachain-info", rev = "56e4b10bbbbcefcf9e4fe879c88c68902181fc4a", default-features = false }
polkadot-parachain-primitives = { git = "https://github.com/paritytech/polkadot-sdk.git", rev = "56e4b10bbbbcefcf9e4fe879c88c68902181fc4a", default-features = false }
testnet-parachains-constants = { git = "https://github.com/paritytech/polkadot-sdk.git", package = "testnet-parachains-constants", rev = "56e4b10bbbbcefcf9e4fe879c88c68902181fc4a", default-features = false }
westend-runtime-constants = { git = "https://github.com/paritytech/polkadot-sdk.git", package = "westend-runtime-constants", rev = "56e4b10bbbbcefcf9e4fe879c88c68902181fc4a", default-features = false }
array-bytes = { version = "6.1" }
bp-test-utils = { git = "https://github.com/paritytech/polkadot-sdk.git", rev = "56e4b10bbbbcefcf9e4fe879c88c68902181fc4a" }
cfg-if = { version = "1.0" }
Expand All @@ -26,6 +39,7 @@ pallet-transaction-storage = { path = "pallets/transaction-storage", default-fea
pallet-validator-set = { path = "pallets/validator-set", default-features = false }
pallets-common = { path = "pallets/common", default-features = false }
polkadot-bulletin-chain-runtime = { path = "runtime" }
bulletin-westend-runtime = { path = "runtimes/bulletin-westend" }

# Polkadot SDK crates (shared git revision)
frame-benchmarking = { git = "https://github.com/paritytech/polkadot-sdk.git", rev = "56e4b10bbbbcefcf9e4fe879c88c68902181fc4a", default-features = false }
Expand Down Expand Up @@ -113,13 +127,33 @@ pallet-xcm-bridge-hub = { git = "https://github.com/paritytech/polkadot-sdk.git"

pallet-staking = { git = "https://github.com/paritytech/polkadot-sdk.git", rev = "56e4b10bbbbcefcf9e4fe879c88c68902181fc4a", default-features = false }
pallet-xcm = { git = "https://github.com/paritytech/polkadot-sdk.git", rev = "56e4b10bbbbcefcf9e4fe879c88c68902181fc4a", default-features = false }
parachains-common = { git = "https://github.com/paritytech/polkadot-sdk.git", rev = "56e4b10bbbbcefcf9e4fe879c88c68902181fc4a", default-features = false }
polkadot-primitives = { git = "https://github.com/paritytech/polkadot-sdk.git", rev = "56e4b10bbbbcefcf9e4fe879c88c68902181fc4a", default-features = false }
sp-staking = { git = "https://github.com/paritytech/polkadot-sdk.git", rev = "56e4b10bbbbcefcf9e4fe879c88c68902181fc4a", default-features = false }
xcm = { git = "https://github.com/paritytech/polkadot-sdk.git", rev = "56e4b10bbbbcefcf9e4fe879c88c68902181fc4a", package = "staging-xcm", default-features = false }
xcm-builder = { git = "https://github.com/paritytech/polkadot-sdk.git", rev = "56e4b10bbbbcefcf9e4fe879c88c68902181fc4a", package = "staging-xcm-builder", default-features = false }
xcm-executor = { git = "https://github.com/paritytech/polkadot-sdk.git", rev = "56e4b10bbbbcefcf9e4fe879c88c68902181fc4a", package = "staging-xcm-executor", default-features = false }

# Parachains common primitives (needed by runtimes)
parachains-common = { git = "https://github.com/paritytech/polkadot-sdk.git", rev = "56e4b10bbbbcefcf9e4fe879c88c68902181fc4a", default-features = false }

# Runtime metadata hash extension
frame-metadata-hash-extension = { git = "https://github.com/paritytech/polkadot-sdk.git", rev = "56e4b10bbbbcefcf9e4fe879c88c68902181fc4a", default-features = false }

# Polkadot runtime common utilities
polkadot-runtime-common = { git = "https://github.com/paritytech/polkadot-sdk.git", rev = "56e4b10bbbbcefcf9e4fe879c88c68902181fc4a", default-features = false }
sp-consensus-aura = { git = "https://github.com/paritytech/polkadot-sdk.git", rev = "56e4b10bbbbcefcf9e4fe879c88c68902181fc4a", default-features = false }
xcm-runtime-apis = { git = "https://github.com/paritytech/polkadot-sdk.git", rev = "56e4b10bbbbcefcf9e4fe879c88c68902181fc4a", default-features = false }
parachains-runtimes-test-utils = { git = "https://github.com/paritytech/polkadot-sdk.git", rev = "56e4b10bbbbcefcf9e4fe879c88c68902181fc4a", default-features = true }

# Additional FRAME pallets used by westend runtime
pallet-aura = { git = "https://github.com/paritytech/polkadot-sdk.git", rev = "56e4b10bbbbcefcf9e4fe879c88c68902181fc4a", default-features = false }
pallet-balances = { git = "https://github.com/paritytech/polkadot-sdk.git", rev = "56e4b10bbbbcefcf9e4fe879c88c68902181fc4a", default-features = false }
pallet-message-queue = { git = "https://github.com/paritytech/polkadot-sdk.git", rev = "56e4b10bbbbcefcf9e4fe879c88c68902181fc4a", default-features = false }
pallet-multisig = { git = "https://github.com/paritytech/polkadot-sdk.git", rev = "56e4b10bbbbcefcf9e4fe879c88c68902181fc4a", default-features = false }
pallet-utility = { git = "https://github.com/paritytech/polkadot-sdk.git", rev = "56e4b10bbbbcefcf9e4fe879c88c68902181fc4a", default-features = false }
pallet-xcm-benchmarks = { git = "https://github.com/paritytech/polkadot-sdk.git", rev = "56e4b10bbbbcefcf9e4fe879c88c68902181fc4a", default-features = false }
pallet-collator-selection = { git = "https://github.com/paritytech/polkadot-sdk.git", rev = "56e4b10bbbbcefcf9e4fe879c88c68902181fc4a", default-features = false }

# Substrate tooling
substrate-build-script-utils = { git = "https://github.com/paritytech/polkadot-sdk.git", rev = "56e4b10bbbbcefcf9e4fe879c88c68902181fc4a" }
substrate-frame-rpc-system = { git = "https://github.com/paritytech/polkadot-sdk.git", rev = "56e4b10bbbbcefcf9e4fe879c88c68902181fc4a" }
Expand All @@ -135,6 +169,7 @@ members = [
"pallets/validator-set",
"runtime",
"runtimes/bulletin-polkadot",
"runtimes/bulletin-westend",
]
[profile.release]
# Polkadot runtime requires unwinding.
Expand Down
212 changes: 212 additions & 0 deletions runtimes/bulletin-westend/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,212 @@
[package]
name = "bulletin-westend-runtime"
version = "0.1.0"
authors.workspace = true
edition.workspace = true
description = "Westend's Bulletin parachain runtime"
license = "Apache-2.0"
repository.workspace = true

[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]


[dependencies]
codec = { features = ["derive"], workspace = true }
scale-info = { features = ["derive"], workspace = true }
serde = { optional = true, features = ["derive"], workspace = true, default-features = true }
serde_json = { features = ["alloc"], workspace = true }
tracing = { workspace = true }

# Substrate
frame-benchmarking = { optional = true, workspace = true }
frame-executive = { workspace = true }
frame-metadata-hash-extension = { workspace = true }
frame-support = { workspace = true }
frame-system = { workspace = true }
frame-system-benchmarking = { optional = true, workspace = true }
frame-system-rpc-runtime-api = { workspace = true }
frame-try-runtime = { optional = true, workspace = 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-keyring = { workspace = true }
sp-offchain = { workspace = true }
sp-runtime = { workspace = true }
sp-session = { workspace = true }
sp-storage = { workspace = true }
sp-transaction-pool = { workspace = true }
sp-version = { workspace = true }

# Polkadot
pallet-xcm = { workspace = true }
pallet-xcm-benchmarks = { optional = true, workspace = true }
polkadot-parachain-primitives = { workspace = true }
polkadot-runtime-common = { workspace = true }
westend-runtime-constants = { workspace = true }
xcm = { workspace = true }
xcm-builder = { workspace = true }
xcm-executor = { workspace = true }
xcm-runtime-apis = { workspace = true }

# Cumulus
cumulus-pallet-aura-ext = { workspace = true }
cumulus-pallet-parachain-system = { workspace = true }
cumulus-pallet-session-benchmarking = { workspace = true }
cumulus-pallet-weight-reclaim = { 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-utility = { workspace = true }

pallet-collator-selection = { workspace = true }
parachain-info = { workspace = true }
parachains-common = { workspace = true }
testnet-parachains-constants = { features = ["westend"], workspace = true }

[dev-dependencies]
parachains-runtimes-test-utils = { workspace = true, default-features = true }

[build-dependencies]
substrate-wasm-builder = { optional = true, workspace = true, default-features = true }

[features]
default = ["std"]
std = [
"codec/std",
"cumulus-pallet-aura-ext/std",
"cumulus-pallet-parachain-system/std",
"cumulus-pallet-session-benchmarking/std",
"cumulus-pallet-weight-reclaim/std",
"cumulus-pallet-xcm/std",
"cumulus-pallet-xcmp-queue/std",
"cumulus-primitives-aura/std",
"cumulus-primitives-core/std",
"cumulus-primitives-utility/std",
"frame-benchmarking?/std",
"frame-executive/std",
"frame-metadata-hash-extension/std",
"frame-support/std",
"frame-system-benchmarking?/std",
"frame-system-rpc-runtime-api/std",
"frame-system/std",
"frame-try-runtime?/std",
"pallet-aura/std",
"pallet-authorship/std",
"pallet-balances/std",
"pallet-collator-selection/std",
"pallet-message-queue/std",
"pallet-session/std",
"pallet-sudo/std",
"pallet-timestamp/std",
"pallet-transaction-payment-rpc-runtime-api/std",
"pallet-transaction-payment/std",
"pallet-xcm-benchmarks?/std",
"pallet-xcm/std",
"parachain-info/std",
"parachains-common/std",
"polkadot-parachain-primitives/std",
"polkadot-runtime-common/std",
"scale-info/std",
"serde",
"serde_json/std",
"sp-api/std",
"sp-block-builder/std",
"sp-consensus-aura/std",
"sp-core/std",
"sp-genesis-builder/std",
"sp-inherents/std",
"sp-keyring/std",
"sp-offchain/std",
"sp-runtime/std",
"sp-session/std",
"sp-storage/std",
"sp-transaction-pool/std",
"sp-version/std",
"substrate-wasm-builder",
"testnet-parachains-constants/std",
"tracing/std",
"westend-runtime-constants/std",
"xcm-builder/std",
"xcm-executor/std",
"xcm-runtime-apis/std",
"xcm/std",
]
runtime-benchmarks = [
"cumulus-pallet-parachain-system/runtime-benchmarks",
"cumulus-pallet-session-benchmarking/runtime-benchmarks",
"cumulus-pallet-weight-reclaim/runtime-benchmarks",
"cumulus-pallet-xcmp-queue/runtime-benchmarks",
"cumulus-primitives-core/runtime-benchmarks",
"cumulus-primitives-utility/runtime-benchmarks",
"frame-benchmarking/runtime-benchmarks",
"frame-support/runtime-benchmarks",
"frame-system-benchmarking/runtime-benchmarks",
"frame-system/runtime-benchmarks",
"pallet-balances/runtime-benchmarks",
"pallet-collator-selection/runtime-benchmarks",
"pallet-message-queue/runtime-benchmarks",
"pallet-sudo/runtime-benchmarks",
"pallet-timestamp/runtime-benchmarks",
"pallet-transaction-payment/runtime-benchmarks",
"pallet-xcm-benchmarks/runtime-benchmarks",
"pallet-xcm/runtime-benchmarks",
"parachains-common/runtime-benchmarks",
"polkadot-parachain-primitives/runtime-benchmarks",
"polkadot-runtime-common/runtime-benchmarks",
"sp-runtime/runtime-benchmarks",
"westend-runtime-constants/runtime-benchmarks",
"xcm-builder/runtime-benchmarks",
"xcm-executor/runtime-benchmarks",
"xcm-runtime-apis/runtime-benchmarks",
"xcm/runtime-benchmarks",
]
try-runtime = [
"cumulus-pallet-aura-ext/try-runtime",
"cumulus-pallet-parachain-system/try-runtime",
"cumulus-pallet-weight-reclaim/try-runtime",
"cumulus-pallet-xcm/try-runtime",
"cumulus-pallet-xcmp-queue/try-runtime",
"frame-executive/try-runtime",
"frame-support/try-runtime",
"frame-system/try-runtime",
"frame-try-runtime/try-runtime",
"pallet-aura/try-runtime",
"pallet-authorship/try-runtime",
"pallet-balances/try-runtime",
"pallet-collator-selection/try-runtime",
"pallet-message-queue/try-runtime",
"pallet-session/try-runtime",
"pallet-sudo/try-runtime",
"pallet-timestamp/try-runtime",
"pallet-transaction-payment/try-runtime",
"pallet-xcm/try-runtime",
"parachain-info/try-runtime",
"parachains-common/try-runtime",
"polkadot-runtime-common/try-runtime",
"sp-runtime/try-runtime",
]
fast-runtime = [
"westend-runtime-constants/fast-runtime",
]

# Enable the metadata hash generation in the wasm builder.
metadata-hash = ["substrate-wasm-builder/metadata-hash"]

# A feature that should be enabled when the runtime should be built for on-chain
# deployment. This will disable stuff that shouldn't be part of the on-chain wasm
# to make it smaller, like logging for example.
on-chain-release-build = ["metadata-hash"]
40 changes: 40 additions & 0 deletions runtimes/bulletin-westend/build.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
// Copyright (C) Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: Apache-2.0

// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

#[cfg(all(not(feature = "metadata-hash"), feature = "std"))]
fn main() {
substrate_wasm_builder::WasmBuilder::build_using_defaults();

substrate_wasm_builder::WasmBuilder::init_with_defaults()
.set_file_name("fast_runtime_binary.rs")
.enable_feature("fast-runtime")
.build();
}

#[cfg(all(feature = "metadata-hash", feature = "std"))]
fn main() {
substrate_wasm_builder::WasmBuilder::init_with_defaults()
.enable_metadata_hash("WND", 12)
.build();

substrate_wasm_builder::WasmBuilder::init_with_defaults()
.set_file_name("fast_runtime_binary.rs")
.enable_feature("fast-runtime")
.enable_metadata_hash("WND", 12)
.build();
}

#[cfg(not(feature = "std"))]
fn main() {}
Loading
Loading