# Parachain Consensus Updates: Coretime, asynchronous backing, scalability

**URL:** <https://forum.polkadot.network/t/parachain-consensus-updates-coretime-asynchronous-backing-scalability/4396>\
**Category:** Ecosystem\
**Created:** [October 23, 2023, 12:24pm UTC](https://forum.polkadot.network/t/parachain-consensus-updates-coretime-asynchronous-backing-scalability/4396 "2023-10-23T12:24:28Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![eskimor](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.polkadot.network/eskimor/32/6264_2.png) [@eskimor](https://forum.polkadot.network/u/eskimor)\
**Post date:** [October 23, 2023, 12:24pm UTC](https://forum.polkadot.network/t/parachain-consensus-updates-coretime-asynchronous-backing-scalability/4396/1 "2023-10-23T12:24:28Z")

</div>

Quick update on parachain consensus related ongoing work.

Just recently a new runtime got deployed on Rococo, which enabled on-demand relay chain functionality. You can play around with it now! @antonva will provide instructions how this works soon.

We expect on-demand relay chain functionality on Kusama and Polkadot by the end of the year, when we have more layers of sandboxing ready for PVF execution.

Another big change we plan to have ready by the end of the year is the new [agile coretime](https://github.com/polkadot-fellows/RFCs/blob/6f29561a4747bbfd95307ce75cd949dfff359e39/text/0001-agile-coretime.md). This will replace the parachain auction model by a more agile core acquisition method, that works on a monthly basis. This and on-demand aim at lowering barrier to entry and optimizing block space utilization. In other words: More block space/core time for more people!

When I was talking about on-demand, I was very specific by saying “relay chain functionality”. The reason is, that realistically for a production chain people will want [more](https://github.com/paritytech/polkadot-sdk/issues/1487). A way of having core orders automated and decentralized. We assume, even without this, that on-demand will already be useful for startups and early projects.

We plan on having an implementation for the [above design](https://github.com/paritytech/polkadot-sdk/issues/1487) ready by Q1/Q2 2024. That being said, the design is there and we definitely welcome contributions, which might make it feasible to have this delivered even sooner. 💪

# Asynchronous Backing

Another _big_ change, that just made it to Rococo, is asynchronous backing. Enabling parachains to have bigger blocks (in terms of execution time) while at the same time also enables them to shorten block times from twelve to six seconds. Reducing latency and multiplying possible throughput at the same time!

# Performance

A lot of effort is also put into improving performance of our system. E.g. [here](https://github.com/paritytech/polkadot-sdk/issues/1617) - planned, or already implemented [here](https://github.com/paritytech/polkadot-sdk/pull/1178), [here](https://github.com/paritytech/polkadot-sdk/pull/1191) and [here](https://github.com/paritytech/polkadot-sdk/pull/1644) to name just a few recent improvements, about to land soon.

More work is happening behind the scenes, when it comes to disputes hardening, slashing, determinism, validator disabling strategies, … but I think the above are the most exiting/user facing developments.

Really looking forward seeing projects making use of asynchronous backing capabilities, authoring their first on-demand block and later on having first projects acquiring new bulk block space via agile coretime! 🕶

---

<div class="post-metadata">

**Author:** ![bill\_w3f](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.polkadot.network/bill_w3f/32/910_2.png) [@bill\_w3f](https://forum.polkadot.network/u/bill_w3f)\
**Post date:** [October 23, 2023, 2:12pm UTC](https://forum.polkadot.network/t/parachain-consensus-updates-coretime-asynchronous-backing-scalability/4396/2 "2023-10-23T14:12:21Z")

</div>

> We expect on-demand relay chain functionality on Kusama and Polkadot by the end of the year, when we have more layers of sandboxing ready for PVF execution.

> When I was talking about on-demand, I was very specific by saying “relay chain functionality”. The reason is, that realistically for a production chain people will want [more](https://github.com/paritytech/polkadot-sdk/issues/1487). A way of having core orders automated and decentralized.

Could you explain a bit more in-depth on what this means? I read the [linked PR](https://github.com/paritytech/polkadot-sdk/issues/1487), but I’m still not clear on what is available now on Rococo (which I assume is also approximately what should be available on Kusama/Polkadot by EOY?) and what is future (Q1/Q2 2024) work.

---

<div class="post-metadata">

**Author:** ![wil](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.polkadot.network/wil/32/927_2.png) [@wil](https://forum.polkadot.network/u/wil)\
**Post date:** [October 23, 2023, 2:23pm UTC](https://forum.polkadot.network/t/parachain-consensus-updates-coretime-asynchronous-backing-scalability/4396/3 "2023-10-23T14:23:49Z")

</div>

> [@eskimor](#):
>
> Another big change we plan to have ready by the end of the year is the new [agile coretime](https://github.com/polkadot-fellows/RFCs/blob/6f29561a4747bbfd95307ce75cd949dfff359e39/text/0001-agile-coretime.md).

“have ready” meaning the PR ready and then start working on rolling out to Rococo then Kusama then Polkadot in Q1/Q2 of 2024 right?

---

<div class="post-metadata">

**Author:** ![GuinnessStache](https://avatars.discourse-cdn.com/v4/letter/g/bb73d2/32.png) [@GuinnessStache](https://forum.polkadot.network/u/GuinnessStache)\
**Post date:** [October 23, 2023, 2:29pm UTC](https://forum.polkadot.network/t/parachain-consensus-updates-coretime-asynchronous-backing-scalability/4396/4 "2023-10-23T14:29:43Z")

</div>

> [@eskimor](#):
>
> Another big change we plan to have ready by the end of the year is the new [agile coretime](https://github.com/polkadot-fellows/RFCs/blob/6f29561a4747bbfd95307ce75cd949dfff359e39/text/0001-agile-coretime.md)

Does this mean live on Polkadot by end of year?

---

<div class="post-metadata">

**Author:** ![eskimor](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.polkadot.network/eskimor/32/6264_2.png) [@eskimor](https://forum.polkadot.network/u/eskimor)\
**Post date:** [October 23, 2023, 2:50pm UTC](https://forum.polkadot.network/t/parachain-consensus-updates-coretime-asynchronous-backing-scalability/4396/5 "2023-10-23T14:50:53Z")

</div>

@bill_w3f What is there on Rococo and will be available by EOY is that you can place an order for a core. Then you will get scheduled, your para will be assigned to a core and your parachain will be able to produce a block.

What is not yet available, is any logic that places the order in an automated and decentralized fashion. This can of course be built by parachain teams themselves. The presented design is for the all-in fully decentralized/everybody is untrusted design space.

Placing the order itself is easy, just send an extrinsic to the relay chain. E.g. one could just setup a funded machine, monitoring the mempool and sending orders as need be. Could be a simple script.

It gets more hairy if you want order placement itself being decentralized. Then you need to setup incentivization schemes, which requires proofs and on-chain logic. This is the part that has not yet been implemented.

---

<div class="post-metadata">

**Author:** ![eskimor](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.polkadot.network/eskimor/32/6264_2.png) [@eskimor](https://forum.polkadot.network/u/eskimor)\
**Post date:** [October 23, 2023, 2:52pm UTC](https://forum.polkadot.network/t/parachain-consensus-updates-coretime-asynchronous-backing-scalability/4396/6 "2023-10-23T14:52:00Z")

</div>

I would say, ready meaning rolled out on Rococo. Kusama and Polkadot following quickly afterwards (Q1).

---

<div class="post-metadata">

**Author:** ![bill\_w3f](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.polkadot.network/bill_w3f/32/910_2.png) [@bill\_w3f](https://forum.polkadot.network/u/bill_w3f)\
**Post date:** [October 23, 2023, 3:09pm UTC](https://forum.polkadot.network/t/parachain-consensus-updates-coretime-asynchronous-backing-scalability/4396/7 "2023-10-23T15:09:06Z")

</div>

Thanks! That clarifies things. Much appreciated!

---

<div class="post-metadata">

**Author:** ![antonva](https://avatars.discourse-cdn.com/v4/letter/a/ecccb3/32.png) [@antonva](https://forum.polkadot.network/u/antonva)\
**Post date:** [October 24, 2023, 11:42am UTC](https://forum.polkadot.network/t/parachain-consensus-updates-coretime-asynchronous-backing-scalability/4396/8 "2023-10-24T11:42:23Z")

</div>

Here are the instructions:

In order to try out on demand parachains on Rococo, first make sure you’ve grabbed some ROC from the testnet faucet [https://paritytech.github.io/polkadot-testnet-faucet](https://paritytech.github.io/polkadot-testnet-faucet).

If you have a runtime on hand you can register it on a new `ParaId` and onboard it as a `Parathread` just like [usual](https://docs.substrate.io/tutorials/build-a-parachain/acquire-a-testnet-slot/#register-as-a-parathread) but do not request a parachain slot. After onboarding, starting a collator and syncing you can go straight on to the placing an order section.

If you don’t have a runtime ready but would like to try it anyway, you can read up on the setup for the adder collator section at the end of this post to get started with a ready to go runtime.

## Placing an order

In [Polkadot.js](https://polkadot.js.org/apps):

1. Navigate to _Developer_ → _Extrinsics_.
2. Select `onDemandAssignmentProvider` from the _“submit the following extrinsic”_ field.
3. Choose either `placeOrderAllowDeath` or `placeOrderKeepAlive` extrinsic.
4. The `maxAmount` field must be somewhere between `10_000_000` and the maximum you would be willing to pay for a single on demand block. The `paraId` field should be set to the `ParaId` you registered and onboarded.  
 ![place-order-extrinsic](https://europe1.discourse-cdn.com/flex005/uploads/polkadot2/original/2X/0/0b786cd29c72c99e8fcf27ab18aa3559b3d7da8a.png)

If the extrinsic was accepted and the collator is working, a new parachain block should be included within a few relay chain blocks depending on congestion.

In the case of an `adder-collator` runtime, the block head will increase by 1 for each block added.  
 ![updated-adder-head](https://europe1.discourse-cdn.com/flex005/uploads/polkadot2/original/2X/6/62947e18fd7bed4f303dc308b7c3aa4bcb3446b7.png)

## Looking up on demand price and other data

- The price of an on demand block is calculated by multiplying `configuration.on_demand_base_fee` with `SpotTraffic`, which is the output of a price controller.

- The base fee and parameters to the price controller are all exposed to governance. Most of these parameters can be located in the `configuration` pallet under `on_demand_*`.

- The actual fee charged for an order is found in the `SpotOrderPlaced` event which is emitted on every placed order.

- The number of on demand parachains that can be processed in the same relay chain block is determined by the `configuration.on_demand_cores` value.

- A parachain cannot have parallel blocks on 2 or more different cores on the same relay chain block. Multiple orders for the same parachain will be processed sequentially.

- The `onDemandAssignmentProvider` pallet stores the order queue under `onDemandQueue` and the spot traffic multiplier can be found under `spotTraffic`.

- The lowest amount that `maxAmount` can be set as is determined by `configuration.on_demand.base_fee`, which by default is `10_000_000`.

## Setup for the adder collator

The following instructions will go through the steps needed to get an instance of `adder-collator` up and running on Rococo as an on-demand parachain.

Compile the `adder-collator`:

```bash
# In the polkadot-sdk repository
cargo build -r -p test-parachain-adder-collator 

```

Export the genesis state for the `adder-collator`:

```bash
# Still in the polkadot-sdk repository
./target/release/adder-collator export-genesis-state \
  --chain=rococo \
  $SOME_PATH/rococo-adder-genesis-state

```

In [Polkadot.js](https://polkadot.js.org/apps):

1. Register a new `ParaId`: _Network_ → _Parachains_ → _Parathreads_ → _ParaId_. Note down the `ParaId`.
2. On the same page, register a `ParaThread`. The `ParaId` should be the one used in step 1. The `code` is obtained from `./target/release/wbuild/test-parachain-adder/test_parachain_adder.compact.compressed.wasm` and the `initial_state` is obtained from `$SOME_PATH/rococo-adder-genesis-state` that was generated earlier.

While waiting for onboarding to finish, launch the collator to start syncing with Rococo.

```bash
# You guessed it, polkadot-sdk repository
./target/release/adder-collator \
  --parachain-id=$YOUR_PARA_ID \
  --chain=rococo 

```

If you don’t have a backup available on hand, this might take a while (a couple of days in my experience).

---

<div class="post-metadata">

**Author:** ![xiaojie\_PolkaWorld](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.polkadot.network/xiaojie_polkaworld/32/1408_2.png) [@xiaojie\_PolkaWorld](https://forum.polkadot.network/u/xiaojie_PolkaWorld)\
**Post date:** [October 25, 2023, 3:10am UTC](https://forum.polkadot.network/t/parachain-consensus-updates-coretime-asynchronous-backing-scalability/4396/9 "2023-10-25T03:10:46Z")

</div>

Are you referring to parathreads when you mention the on-demand relay chain functionality?

---

<div class="post-metadata">

**Author:** ![eskimor](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.polkadot.network/eskimor/32/6264_2.png) [@eskimor](https://forum.polkadot.network/u/eskimor)\
**Post date:** [October 25, 2023, 7:58am UTC](https://forum.polkadot.network/t/parachain-consensus-updates-coretime-asynchronous-backing-scalability/4396/10 "2023-10-25T07:58:05Z")

</div>

Yes, indeed. Naming is hard and evolving. parathreads and on-demand parachains is the same thing. I am a bit reluctant to mention that there was even another name created just recently. Sorry for the confusion, I hope we will be able to straighten up our communication a bit soon.

---

<div class="post-metadata">

**Author:** ![filippoweb3](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.polkadot.network/filippoweb3/32/3446_2.png) [@filippoweb3](https://forum.polkadot.network/u/filippoweb3)\
**Post date:** [October 26, 2023, 1:36pm UTC](https://forum.polkadot.network/t/parachain-consensus-updates-coretime-asynchronous-backing-scalability/4396/11 "2023-10-26T13:36:26Z")

</div>

How are coretime sales handled on Rococo? Is there any implementation or will this be decided later on only on Kusama and Polkadot?

---

<div class="post-metadata">

**Author:** ![alejandro](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.polkadot.network/alejandro/32/55_2.png) [@alejandro](https://forum.polkadot.network/u/alejandro)\
**Post date:** [November 13, 2023, 7:09pm UTC](https://forum.polkadot.network/t/parachain-consensus-updates-coretime-asynchronous-backing-scalability/4396/12 "2023-11-13T19:09:46Z")

</div>

I don’t fully understand what you are exactly asking for @filippoweb3

If you are talking about the exact implementation for the on demand assignment provider that @antonva showcases in the above example, you can find its implementation in this pallet - [`assigner_on_demand`](https://github.com/paritytech/polkadot-sdk/blob/c7bd8804389e4b9b7f9d0c39b06094aebb303e5d/polkadot/runtime/parachains/src/assigner_on_demand/mod.rs).

---

<div class="post-metadata">

**Author:** ![seraya\_w3f](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.polkadot.network/seraya_w3f/32/753_2.png) [@seraya\_w3f](https://forum.polkadot.network/u/seraya_w3f)\
**Post date:** [January 2, 2024, 4:23pm UTC](https://forum.polkadot.network/t/parachain-consensus-updates-coretime-asynchronous-backing-scalability/4396/13 "2024-01-02T16:23:23Z")

</div>

@eskimor what’s the timeline on Asynchronous Backing?

---

<div class="post-metadata">

**Author:** ![eskimor](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.polkadot.network/eskimor/32/6264_2.png) [@eskimor](https://forum.polkadot.network/u/eskimor)\
**Post date:** [January 5, 2024, 3:07pm UTC](https://forum.polkadot.network/t/parachain-consensus-updates-coretime-asynchronous-backing-scalability/4396/14 "2024-01-05T15:07:59Z")

</div>

Goes live on Kusama with the next release.
