diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index de33f6541..47211e8e0 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -130,7 +130,7 @@ jobs:
run: rustup show
- name: Install zepter
- run: cargo install --locked -f zepter
+ run: cargo install --locked -f zepter --version 1.1.0
- name: Run zepter
run: zepter run check
diff --git a/.github/workflows/version-bump.yml b/.github/workflows/version-bump.yml
new file mode 100644
index 000000000..874eaabdf
--- /dev/null
+++ b/.github/workflows/version-bump.yml
@@ -0,0 +1,35 @@
+name: Create version bump ticket
+on:
+ workflow_dispatch:
+ inputs:
+ from:
+ description: "Polkadot version to bump from (ex: v0.9.40)"
+ required: true
+ to:
+ description: "Polkadot version to bump to (ex: v0.9.42)"
+ required: true
+
+jobs:
+ create_bump_ticket:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v3
+ - name: Use Node.js
+ uses: actions/setup-node@v3
+ with:
+ node-version: 20.10.0
+ - name: Generate version bump issue
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ run: |
+ cd tools
+ yarn install
+ yarn --silent run print-version-bump-info -- --from ${{ github.event.inputs.from }} --to ${{ github.event.inputs.to }} | tee ../version-bump.md
+ - name: Create version bump issue
+ uses: peter-evans/create-issue-from-file@v3
+ with:
+ title: Update polkadot-sdk from ${{ github.event.inputs.from }} to ${{ github.event.inputs.to }}
+ content-filepath: ./version-bump.md
+ labels: |
+ automated issue
\ No newline at end of file
diff --git a/Cargo.lock b/Cargo.lock
index d6c8fdd20..5dadd07bb 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -2856,6 +2856,7 @@ dependencies = [
"pallet-services-payment",
"pallet-session",
"pallet-staking",
+ "pallet-stream-payment",
"pallet-sudo",
"pallet-timestamp",
"pallet-transaction-payment",
@@ -2872,6 +2873,7 @@ dependencies = [
"polkadot-runtime-common",
"polkadot-runtime-parachains",
"polkadot-service",
+ "runtime-common",
"sc-consensus-grandpa",
"scale-info",
"serde",
@@ -3989,6 +3991,7 @@ dependencies = [
"pallet-root-testing",
"pallet-services-payment",
"pallet-session",
+ "pallet-stream-payment",
"pallet-sudo",
"pallet-timestamp",
"pallet-transaction-payment",
@@ -4001,6 +4004,7 @@ dependencies = [
"polkadot-parachain-primitives",
"polkadot-runtime-common",
"polkadot-runtime-parachains",
+ "runtime-common",
"sc-consensus-grandpa",
"scale-info",
"serde",
@@ -8737,6 +8741,30 @@ dependencies = [
"sp-std",
]
+[[package]]
+name = "pallet-stream-payment"
+version = "0.1.0"
+dependencies = [
+ "dp-core",
+ "frame-benchmarking",
+ "frame-support",
+ "frame-system",
+ "log",
+ "num-traits",
+ "pallet-balances",
+ "parity-scale-codec",
+ "scale-info",
+ "serde",
+ "similar-asserts",
+ "sp-core",
+ "sp-io",
+ "sp-runtime",
+ "sp-std",
+ "tap",
+ "tp-maths",
+ "tp-traits",
+]
+
[[package]]
name = "pallet-sudo"
version = "4.0.0-dev"
@@ -11273,6 +11301,30 @@ dependencies = [
"windows-sys 0.48.0",
]
+[[package]]
+name = "runtime-common"
+version = "0.1.0"
+dependencies = [
+ "cumulus-primitives-core",
+ "frame-support",
+ "frame-system",
+ "frame-try-runtime",
+ "hex-literal 0.3.4",
+ "pallet-balances",
+ "pallet-configuration",
+ "pallet-data-preservers",
+ "pallet-invulnerables",
+ "pallet-migrations",
+ "pallet-pooled-staking",
+ "pallet-registrar",
+ "pallet-services-payment",
+ "parity-scale-codec",
+ "scale-info",
+ "sp-core",
+ "sp-runtime",
+ "sp-std",
+]
+
[[package]]
name = "rustc-demangle"
version = "0.1.23"
diff --git a/Cargo.toml b/Cargo.toml
index e5403da3d..c7aa2e8b5 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -35,6 +35,7 @@ pallet-pooled-staking = { path = "pallets/pooled-staking", default-features = fa
pallet-registrar = { path = "pallets/registrar", default-features = false }
pallet-registrar-runtime-api = { path = "pallets/registrar/rpc/runtime-api", default-features = false }
pallet-services-payment = { path = "pallets/services-payment", default-features = false }
+pallet-stream-payment = { path = "pallets/stream-payment", default-features = false }
container-chain-template-frontier-runtime = { path = "container-chains/templates/frontier/runtime", default-features = false }
container-chain-template-simple-runtime = { path = "container-chains/templates/simple/runtime", default-features = false }
@@ -43,10 +44,12 @@ dancebox-runtime = { path = "runtime/dancebox", default-features = false }
flashbox-runtime = { path = "runtime/flashbox", default-features = false }
manual-xcm-rpc = { path = "client/manual-xcm" }
node-common = { path = "client/node-common" }
+runtime-common = { path = "runtime/common", default-features = false }
tc-consensus = { path = "client/consensus" }
tp-author-noting-inherent = { path = "primitives/author-noting-inherent", default-features = false }
tp-consensus = { path = "primitives/consensus", default-features = false }
tp-container-chain-genesis-data = { path = "primitives/container-chain-genesis-data", default-features = false }
+tp-fungibles-ext = { path = "primitives/fungibles-ext", default-features = false }
tp-impl-tanssi-pallets-config = { path = "primitives/impl-tanssi-pallets-config", default-features = false }
tp-maths = { path = "primitives/maths", default-features = false }
tp-traits = { path = "primitives/traits", default-features = false }
@@ -253,6 +256,7 @@ num_enum = { version = "0.7.1", default-features = false }
rand_chacha = { version = "0.3.1", default-features = false }
serde = { version = "1.0.152", default-features = false }
smallvec = "1.10.0"
+tap = "1.0.1"
# General (client)
async-io = "1.3"
diff --git a/client/consensus/src/lib.rs b/client/consensus/src/lib.rs
index 770ceda3b..ead2e712e 100644
--- a/client/consensus/src/lib.rs
+++ b/client/consensus/src/lib.rs
@@ -20,11 +20,10 @@
//! slot_author returns the author based on the slot number and authorities provided (aura-like)
//! authorities retrieves the current set of authorities based on the first eligible key found in the keystore
-use {sp_consensus_slots::Slot, sp_core::crypto::Pair};
-
pub mod collators;
mod consensus_orchestrator;
mod manual_seal;
+
#[cfg(test)]
mod tests;
@@ -52,6 +51,8 @@ pub use {
tp_consensus::TanssiAuthorityAssignmentApi,
};
+use {sp_consensus_slots::Slot, sp_core::crypto::Pair};
+
const LOG_TARGET: &str = "aura::tanssi";
type AuthorityId
=
::Public;
diff --git a/client/node-common/src/service.rs b/client/node-common/src/service.rs
index 531e37d05..7fb13e662 100644
--- a/client/node-common/src/service.rs
+++ b/client/node-common/src/service.rs
@@ -35,8 +35,9 @@ use {
run_manual_seal, ConsensusDataProvider, EngineCommand, ManualSealParams,
},
sc_executor::{
- HeapAllocStrategy, NativeElseWasmExecutor, NativeExecutionDispatch, WasmExecutor,
- DEFAULT_HEAP_ALLOC_STRATEGY,
+ sp_wasm_interface::{ExtendedHostFunctions, HostFunctions},
+ HeapAllocStrategy, NativeElseWasmExecutor, NativeExecutionDispatch, RuntimeVersionOf,
+ WasmExecutor, DEFAULT_HEAP_ALLOC_STRATEGY,
},
sc_network::{config::FullNetworkConfiguration, NetworkBlock, NetworkService},
sc_network_sync::SyncingService,
@@ -52,6 +53,7 @@ use {
sp_api::ConstructRuntimeApi,
sp_block_builder::BlockBuilder,
sp_consensus::SelectChain,
+ sp_core::traits::CodeExecutor,
sp_inherents::CreateInherentDataProviders,
sp_offchain::OffchainWorkerApi,
sp_runtime::Percent,
@@ -64,7 +66,7 @@ use {
pub trait NodeBuilderConfig {
type Block;
type RuntimeApi;
- type ParachainNativeExecutor;
+ type ParachainExecutor;
/// Create a new `NodeBuilder` using the types of this `Config`, along
/// with the parachain `Configuration` and an optional `HwBench`.
@@ -75,7 +77,8 @@ pub trait NodeBuilderConfig {
where
Self: Sized,
BlockOf: cumulus_primitives_core::BlockT,
- ParachainNativeExecutorOf: NativeExecutionDispatch + 'static,
+ ExecutorOf:
+ Clone + CodeExecutor + RuntimeVersionOf + TanssiExecutorExt + Sync + Send + 'static,
RuntimeApiOf:
ConstructRuntimeApi, ClientOf> + Sync + Send + 'static,
ConstructedRuntimeApiOf:
@@ -89,8 +92,7 @@ pub type BlockOf = ::Block;
pub type BlockHashOf = as cumulus_primitives_core::BlockT>::Hash;
pub type BlockHeaderOf = as cumulus_primitives_core::BlockT>::Header;
pub type RuntimeApiOf = ::RuntimeApi;
-pub type ParachainNativeExecutorOf = ::ParachainNativeExecutor;
-pub type ExecutorOf = NativeElseWasmExecutor>;
+pub type ExecutorOf = ::ParachainExecutor;
pub type ClientOf = TFullClient, RuntimeApiOf, ExecutorOf>;
pub type BackendOf = TFullBackend>;
pub type ConstructedRuntimeApiOf =
@@ -130,7 +132,7 @@ pub struct NodeBuilder<
SImportQueueService = (),
> where
BlockOf: cumulus_primitives_core::BlockT,
- ParachainNativeExecutorOf: NativeExecutionDispatch + 'static,
+ ExecutorOf: Clone + CodeExecutor + RuntimeVersionOf + Sync + Send + 'static,
RuntimeApiOf: ConstructRuntimeApi, ClientOf> + Sync + Send + 'static,
ConstructedRuntimeApiOf: TaggedTransactionQueue> + BlockBuilder>,
{
@@ -157,13 +159,39 @@ pub struct Network {
pub sync_service: Arc>,
}
+/// Allows to create a parachain-defined executor from a `WasmExecutor`
+pub trait TanssiExecutorExt {
+ type HostFun: HostFunctions;
+ fn new_with_wasm_executor(wasm_executor: WasmExecutor) -> Self;
+}
+
+impl TanssiExecutorExt for WasmExecutor {
+ type HostFun = sp_io::SubstrateHostFunctions;
+
+ fn new_with_wasm_executor(wasm_executor: WasmExecutor) -> Self {
+ wasm_executor
+ }
+}
+
+impl TanssiExecutorExt for NativeElseWasmExecutor
+where
+ D: NativeExecutionDispatch,
+{
+ type HostFun = ExtendedHostFunctions;
+
+ fn new_with_wasm_executor(wasm_executor: WasmExecutor) -> Self {
+ NativeElseWasmExecutor::new_with_wasm_executor(wasm_executor)
+ }
+}
+
// `new` function doesn't take self, and the Rust compiler cannot infer that
// only one type T implements `TypeIdentity`. With thus need a separate impl
// block with concrete types `()`.
impl NodeBuilder
where
BlockOf: cumulus_primitives_core::BlockT,
- ParachainNativeExecutorOf: NativeExecutionDispatch + 'static,
+ ExecutorOf:
+ Clone + CodeExecutor + RuntimeVersionOf + TanssiExecutorExt + Sync + Send + 'static,
RuntimeApiOf: ConstructRuntimeApi, ClientOf> + Sync + Send + 'static,
ConstructedRuntimeApiOf: TaggedTransactionQueue> + BlockBuilder>,
{
@@ -255,7 +283,7 @@ impl
NodeBuilder
where
BlockOf: cumulus_primitives_core::BlockT,
- ParachainNativeExecutorOf: NativeExecutionDispatch + 'static,
+ ExecutorOf: Clone + CodeExecutor + RuntimeVersionOf + Sync + Send + 'static,
RuntimeApiOf: ConstructRuntimeApi, ClientOf> + Sync + Send + 'static,
ConstructedRuntimeApiOf: TaggedTransactionQueue>
+ BlockBuilder>
diff --git a/container-chains/templates/frontier/node/src/service.rs b/container-chains/templates/frontier/node/src/service.rs
index d209e1fd3..56733c83a 100644
--- a/container-chains/templates/frontier/node/src/service.rs
+++ b/container-chains/templates/frontier/node/src/service.rs
@@ -60,7 +60,7 @@ pub struct NodeConfig;
impl NodeBuilderConfig for NodeConfig {
type Block = Block;
type RuntimeApi = RuntimeApi;
- type ParachainNativeExecutor = TemplateRuntimeExecutor;
+ type ParachainExecutor = ParachainExecutor;
}
pub fn frontier_database_dir(config: &Configuration, path: &str) -> std::path::PathBuf {
diff --git a/container-chains/templates/simple/node/src/service.rs b/container-chains/templates/simple/node/src/service.rs
index f71132414..fc7463c3e 100644
--- a/container-chains/templates/simple/node/src/service.rs
+++ b/container-chains/templates/simple/node/src/service.rs
@@ -65,7 +65,7 @@ pub struct NodeConfig;
impl NodeBuilderConfig for NodeConfig {
type Block = Block;
type RuntimeApi = RuntimeApi;
- type ParachainNativeExecutor = ParachainNativeExecutor;
+ type ParachainExecutor = ParachainExecutor;
}
thread_local!(static TIMESTAMP: std::cell::RefCell = std::cell::RefCell::new(0));
diff --git a/node/src/chain_spec/dancebox.rs b/node/src/chain_spec/dancebox.rs
index d5a6c6f28..d10390c10 100644
--- a/node/src/chain_spec/dancebox.rs
+++ b/node/src/chain_spec/dancebox.rs
@@ -212,9 +212,10 @@ fn testnet_genesis(
)
.collect();
// Assign 1000 block credits to all container chains registered in genesis
+ // Assign 100 collator assignment credits to all container chains registered in genesis
let para_id_credits: Vec<_> = para_ids
.iter()
- .map(|(para_id, _genesis_data, _boot_nodes)| (*para_id, 1000))
+ .map(|(para_id, _genesis_data, _boot_nodes)| (*para_id, 1000, 100).into())
.collect();
let para_id_boot_nodes: Vec<_> = para_ids
.iter()
diff --git a/node/src/chain_spec/flashbox.rs b/node/src/chain_spec/flashbox.rs
index 70821c27e..a7573b4fb 100644
--- a/node/src/chain_spec/flashbox.rs
+++ b/node/src/chain_spec/flashbox.rs
@@ -212,9 +212,10 @@ fn testnet_genesis(
)
.collect();
// Assign 1000 block credits to all container chains registered in genesis
+ // Assign 100 collator assignment credits to all container chains registered in genesis
let para_id_credits: Vec<_> = para_ids
.iter()
- .map(|(para_id, _genesis_data, _boot_nodes)| (*para_id, 1000))
+ .map(|(para_id, _genesis_data, _boot_nodes)| (*para_id, 1000, 100).into())
.collect();
let para_id_boot_nodes: Vec<_> = para_ids
.iter()
diff --git a/node/src/container_chain_monitor.rs b/node/src/container_chain_monitor.rs
index e66f8b99a..e2b8b613b 100644
--- a/node/src/container_chain_monitor.rs
+++ b/node/src/container_chain_monitor.rs
@@ -17,7 +17,7 @@
use {
crate::{
container_chain_spawner::{CcSpawnMsg, ContainerChainSpawnerState},
- service::{ParachainBackend, ParachainClient},
+ service::{ContainerChainBackend, ContainerChainClient},
},
cumulus_primitives_core::ParaId,
std::{
@@ -57,9 +57,9 @@ pub struct SpawnedContainer {
/// This won't be precise because it is checked using polling with a high period.
pub stop_refcount_time: Cell