From 13fa395510f7f722481022228c6e566e715bed44 Mon Sep 17 00:00:00 2001 From: Filippo <110459737+filippoweb3@users.noreply.github.com> Date: Tue, 7 May 2024 13:35:57 +0200 Subject: [PATCH] Rename Parathreads -> On-demand Parachains (#5858) * initial edits * rm parathread terminology where possible * minor edits and reorg * add banner * Bader's feedback * Update docs/build/build-data.md Co-authored-by: Radha <86818441+DrW3RK@users.noreply.github.com> * Update docs/build/build-guide.md Co-authored-by: Radha <86818441+DrW3RK@users.noreply.github.com> * Update docs/build/build-guide.md Co-authored-by: Radha <86818441+DrW3RK@users.noreply.github.com> * Update docs/build/build-parachains.md Co-authored-by: Radha <86818441+DrW3RK@users.noreply.github.com> * Update docs/build/build-parachains.md Co-authored-by: Radha <86818441+DrW3RK@users.noreply.github.com> * Update docs/general/faq.md Co-authored-by: Radha <86818441+DrW3RK@users.noreply.github.com> * Update docs/general/glossary.md Co-authored-by: Radha <86818441+DrW3RK@users.noreply.github.com> * Update docs/general/glossary.md Co-authored-by: Radha <86818441+DrW3RK@users.noreply.github.com> * Update docs/general/polkadot-direction.md Co-authored-by: Radha <86818441+DrW3RK@users.noreply.github.com> * Update docs/learn/learn-architecture.md Co-authored-by: Radha <86818441+DrW3RK@users.noreply.github.com> * Update docs/learn/learn-auction.md Co-authored-by: Radha <86818441+DrW3RK@users.noreply.github.com> * Update docs/learn/learn-parachains.md Co-authored-by: Radha <86818441+DrW3RK@users.noreply.github.com> * Update docs/learn/learn-parachains.md Co-authored-by: Radha <86818441+DrW3RK@users.noreply.github.com> * Update docs/learn/learn-parachains.md Co-authored-by: Radha <86818441+DrW3RK@users.noreply.github.com> * Update docs/learn/learn-parachains.md Co-authored-by: Radha <86818441+DrW3RK@users.noreply.github.com> * Update docs/learn/learn-parachains.md Co-authored-by: Radha <86818441+DrW3RK@users.noreply.github.com> * Update docs/learn/learn-parachains.md Co-authored-by: Radha <86818441+DrW3RK@users.noreply.github.com> * Bader's feedback --------- Co-authored-by: Radha <86818441+DrW3RK@users.noreply.github.com> --- docs/build/build-data.md | 2 +- docs/build/build-guide.md | 36 +++++ docs/build/build-index.md | 6 +- docs/build/build-parachains.md | 25 +--- docs/general/faq.md | 16 +-- docs/general/glossary.md | 13 +- docs/general/polkadot-direction.md | 6 +- docs/learn/archive/learn-treasury.md | 3 - docs/learn/learn-agile-coretime.md | 11 +- docs/learn/learn-architecture.md | 20 +-- docs/learn/learn-auction.md | 3 +- docs/learn/learn-comparisons-cosmos.md | 4 +- .../learn-guides-coretime-marketplaces.md | 2 +- docs/learn/learn-parachains-faq.md | 7 +- docs/learn/learn-parachains.md | 126 ++++++++++++------ docs/learn/learn-parathreads.md | 118 ---------------- docs/learn/learn-transactions.md | 14 +- docs/learn/learn-xcm-transport.md | 4 +- kusama-guide/docusaurus.config.js | 6 +- kusama-guide/sidebars.js | 1 - polkadot-wiki/docusaurus.config.js | 6 +- polkadot-wiki/pages/en/index.js | 3 +- polkadot-wiki/sidebars.js | 1 - polkadot-wiki/src/pages/index.js | 3 +- 24 files changed, 194 insertions(+), 242 deletions(-) delete mode 100644 docs/learn/learn-parathreads.md diff --git a/docs/build/build-data.md b/docs/build/build-data.md index e74ab2b54113..bf0aedd5bb88 100644 --- a/docs/build/build-data.md +++ b/docs/build/build-data.md @@ -69,7 +69,7 @@ infrastructure and tooling to help users visualize, curate, share, and analyze o and is currently live on the [Moonbeam](https://moonbeam.network/) network, bringing visibility to billions of blockchain data points to Polkadot via their unified API. The approach to deploying on Moonbeam simplifies the development of Polkadot-based blockchain applications as compared to -implementing a full parachain or parathread. +implementing a full parachain or an on-demand parachain. Covalent captures the entire history of blockchains and offers a way to zoom into data points recorded in smart contracts that are often not accessible. diff --git a/docs/build/build-guide.md b/docs/build/build-guide.md index 5c6c38c14e43..d42779fc1995 100644 --- a/docs/build/build-guide.md +++ b/docs/build/build-guide.md @@ -139,6 +139,16 @@ by design in smart contracts). This vulnerability is mitigated by the -- although it places more of a burden on the developer of the parachain to perform properly benchmarks. +:::info What is an on-demand parachain? + +On-demand parachains use a "pay-as-you-go" model enabled by Agile Coretime to interact with the +Relay Chain. On-demand parachains will only produce a block when needed, unlike full parachains, +which have access to bulk coretime to produce a block at every block of the Relay Chain. When building an +on-demand parachain, you will use the same tools (like PDKs) and get all the benefits of building a +parachain without the cost drawback of purchasing bulk coretime. + +::: + ### Polkadot SDK Overview Polkadot is built using the Polkadot SDK, which, @@ -207,6 +217,32 @@ followed by FRAME, with Cumulus as the final step to understanding the entire pa process. This way, one can view how various paradigms are applied and decide on integrating or utilizing Substrate for their particular use case. +Please see the [parachain development guide](build-parachains.md) for how to get started on building +a parachain. + +#### Parachains Benefits + +Parachains contain their own runtime/STF logic and benefit from the shared security and the +cross-consensus messaging provided by the {{ polkadot: Polkadot :polkadot }} relay chain. Parachains +permit high flexibility and customization but require more effort to create and maintain over time. +A production-grade parachain is typically more involved to create due to the complexity involved in +blockchain networks' technical and economic aspects. + +Parachains grant the creators more space to build the monetary system and other chain aspects from +the ground up. They will allow for a more concise and efficient execution of complex logic than a +smart contract platform could offer. Parachains also provide more flexibility in the form of +governance and can perform complete upgrades in a less controversial way than the current process of +hard forks. + +Some examples of features you can have on a parachain: + +- Custom fee structure (for example, pay a flat transaction fee or pay per byte). +- Shared security and finalization via the relay chain (Polkadot or Kusama). +- Custom monetary policy for the native token and local economy. +- Treasury to be funded through transitions in your state function. +- A governance mechanism that could manage a DAO that is responsible for allocating your on-chain + treasury. + ### Building a Pallet While parachains are highly customizable, they are often complex to develop. If you wish to get diff --git a/docs/build/build-index.md b/docs/build/build-index.md index 1e76a0ca888b..ad0f223ea8ae 100644 --- a/docs/build/build-index.md +++ b/docs/build/build-index.md @@ -20,9 +20,9 @@ the wiki is divided into the following parts: ## Development Guide -- [Starter's Guide](build-guide.md) - High-level overview on choosing a parachain, parathread, or - smart contract for your project and how to get started. -- [Parachain Development](build-parachains.md) - Tools for building parachains and parathreads. +- [Starter's Guide](build-guide.md) - High-level overview on choosing a parachain or smart contract + for your project and how to get started. +- [Parachain Development](build-parachains.md) - Tools for building parachains. - [Smart Contracts](build-smart-contracts.md) - Tools to deploy contracts to a {{ polkadot: Polkadot :polkadot }}{{ kusama: Kusama :kusama }} parachain. diff --git a/docs/build/build-parachains.md b/docs/build/build-parachains.md index 7175c67508ca..a6fd380bed83 100644 --- a/docs/build/build-parachains.md +++ b/docs/build/build-parachains.md @@ -130,8 +130,7 @@ good return on investment. parachain. They can be incentivized with a native token payout from: - Transaction fees collected -- Parathread token sponsorship -- Blocks are naturally produced when a parathread bid is less than the native token payout. +- Parachain token sponsorship ### Para-objects @@ -147,8 +146,7 @@ parallelizable objects. These could be in the form of: -- System level chains (permanent chains): [leased slots](../learn/learn-auction.md), - [parathread pool](../learn/learn-parathreads.md) +- System level chains (permanent chains): [leased slots](../learn/learn-auction.md) - [Bridge](../learn/learn-bridges.md) Hubs - Nested Relay Chains @@ -273,7 +271,7 @@ Are you interested in building a PDK? See the [future PDKs](#future-pdks) sectio After creating your chain runtime logic with Substrate, you will be able to compile it down to a Wasm executable. This Wasm code blob will contain the entire state transition function of your chain, and is what you will need to deploy your project to -{{ polkadot: Polkadot :polkadot }}{{ kusama: Kusama :kusama }} as either a parachain or parathread. +{{ polkadot: Polkadot :polkadot }}{{ kusama: Kusama :kusama }} as a parachain. Validators on {{ polkadot: Polkadot :polkadot }}{{ kusama: Kusama :kusama }} will use the submitted Wasm code to validate the state transitions of your chain or thread, but doing this requires some @@ -289,7 +287,7 @@ performs the critical action of producing new block candidates for your chain an Substrate comes with its own networking layer built-in but unfortunately only supports solo chains (that is, chains that do not connect to the relay chain). However, there is the Cumulus extension that includes a collator node and allows for your Substrate-built logic to be compatible with -{{ polkadot: Polkadot :polkadot }}{{ kusama: Kusama :kusama }} as either a parachain or parathread. +{{ polkadot: Polkadot :polkadot }}{{ kusama: Kusama :kusama }} as a parachain. ### Future PDKs @@ -386,19 +384,10 @@ To include your parachain into the {{ polkadot: Polkadot :polkadot }}{{ kusama: network, you will need to acquire a parachain slot. Parachain slots will be sold in open auctions, the mechanics of which can be found on the -{{ polkadot: [parachain auction](../learn/learn-auction.md) :polkadot }} -{{ kusama: [parachain auction](../learn/learn-auction.md) :kusama }} page of the wiki. +[parachain auction](../learn/learn-auction.md) page. -### Parathread - -Parathreads will not require a parachain slot, so you will not need to engage in the candle auction -mechanism. Instead, you will be able to register your parathread code to a Relay Chain for a fee and -from then be able to start participating in the per-block auctions for inclusion of your state -transition into a Relay Chain. - -For more information on how parathread per-block auctions work, see the more detailed -{{ polkadot: [parathread](../learn/learn-parathreads.md) :polkadot }} -{{ kusama: [parathread](../learn/learn-parathreads.md) :kusama }} page. +A parachain can be producing blocks +[continuously or on-demand](../learn/learn-parachains.md#parachains-vs-on-demand-parachains). ## Resources diff --git a/docs/general/faq.md b/docs/general/faq.md index 20937b78b904..6363e3825b0d 100644 --- a/docs/general/faq.md +++ b/docs/general/faq.md @@ -292,16 +292,16 @@ implementers. ### Are parachains ephemeral? What happens when a parachain loses the next auction? Parachains are not ephemeral. As long as someone is keeping the data for a parachain, the parachain -can move between being a parachain, a parathread, or a separate sovereign chain at different points -of its lifetime. Especially with parathreads, parachains can be decommissioned to only produce -blocks when their usage and throughput makes it necessary. +can move between being a parachain, an +[on-demand parachain](../learn/learn-parachains.md#on-demand-parachains), or a separate sovereign +chain at different points of its lifetime. Especially with on-demand parachains, parachains can +produce blocks when their usage and throughput makes it necessary. When a parachain loses an auction for renewal, that parachain has a few options. In most cases, -becoming a parathread instead would be a suitable choice. Parathreads are still secured by the Relay -Chain, but don't need to hold a parachain slot and can produce a block when its economically -feasible for them. For more on parachains please see the -[parachains page](../learn/learn-parachains.md) and for more on parathreads see -[the parathreads page](../learn/learn-parathreads.md). +becoming an on-demand parachain instead would be a suitable choice. On-demand parachains are still +secured by the Relay Chain, but don't need to hold a parachain slot and can produce a block when its +economically feasible for them. For more on parachains please see the +[parachains page](../learn/learn-parachains.md#parachains-vs-on-demand-parachains). ## Networking diff --git a/docs/general/glossary.md b/docs/general/glossary.md index b698724998a0..bd752c5ec1aa 100644 --- a/docs/general/glossary.md +++ b/docs/general/glossary.md @@ -31,7 +31,7 @@ parachain candidate block is valid or invalid. ## Auction (Parachain) -Parachain auctions are how non-common-good parathreads win a slot to become a parachain. +Parachain auctions are how non-system parachains can access Polkadot. ## Aura @@ -448,7 +448,7 @@ A [Substrate](#substrate) runtime module. A blockchain that meets several characteristics that allow it to work within the confines of the {{ polkadot: Polkadot :polkadot }}{{ kusama: Kusama :kusama }} Host. Also known as "parallelized -chain." +chain". All parachains start their life-cycle as a parathread. ## Parachain Development Kit (PDK) @@ -458,14 +458,13 @@ developers to create {{ polkadot: Polkadot :polkadot }}{{ kusama: Kusama :kusama ## ParaID -A unique numeric (non-negative integer) identifier for a parathread. +A unique numeric (non-negative integer) identifier for a parachain. ## Parathread -A blockchain that works within the confines of the -{{ polkadot: Polkadot :polkadot }}{{ kusama: Kusama :kusama }} Host, thus allowing it to connect to -the Polkadot Relay Chain. This can be done either by becoming a parachain or connecting on a "pay as -you go" basis. All parachains start their life-cycle as a parathread. +Historically, the term "parathread" has been used in two contexts: a substrate-based chain not yet parachain (i.e. not connected to +a {{ polkadot: Polkadot :polkadot }}{{ kusama: Kusama :kusama }} core), or as an on-demand parachain +(i.e. a parachain using on-demand coretime). ## Parachain Registry diff --git a/docs/general/polkadot-direction.md b/docs/general/polkadot-direction.md index 60e863ac8e69..e73284671bd1 100644 --- a/docs/general/polkadot-direction.md +++ b/docs/general/polkadot-direction.md @@ -33,9 +33,9 @@ the [whitepaper](https://polkadot.network/whitepaper/). Polkadot is: - **A multicore computer** where chains that continuously operate in parallel on different cores are called [parachains](../learn/learn-parachains.md). Currently, one core is reserved for one chain through [slot auction mechanism](../learn/learn-auction.md), although one core can be reserved - on-demand to multiple chains at different periods (see - [parathreads](../learn/learn-parathreads.md)). At the time of writing (mid 2023), there are around - 50 cores independently operating in parallel on Polkadot. + on-demand to multiple chains at different periods (see the + [Agile Coretime page](../learn/learn-agile-coretime.md)). At the time of writing (mid 2024), there + are around 50 cores independently operating in parallel on Polkadot. From now on _application_ will be used as a general term to describe anything that can use a Polkadot core to access secure and decentralized computation. diff --git a/docs/learn/archive/learn-treasury.md b/docs/learn/archive/learn-treasury.md index c685dc555b53..0076277389bc 100644 --- a/docs/learn/archive/learn-treasury.md +++ b/docs/learn/archive/learn-treasury.md @@ -74,9 +74,6 @@ The Treasury is funded from different sources: inflation to go to the Treasury. In other words, if 50% of all tokens are staked, then 100% of the inflation goes to the validators as reward. If the staking rate is greater than or less than 50%, then the validators will receive less, with the remainder going to the Treasury. -4. Parathreads: [Parathreads](../learn-parathreads.md) participate in a per-block auction for block - inclusion. Part of this bid goes to the validator that accepts the block and the remainder goes - to the Treasury. ## Tipping diff --git a/docs/learn/learn-agile-coretime.md b/docs/learn/learn-agile-coretime.md index d2460ea4912c..227933a1d3f7 100644 --- a/docs/learn/learn-agile-coretime.md +++ b/docs/learn/learn-agile-coretime.md @@ -3,7 +3,7 @@ id: learn-agile-coretime title: Introduction to Agile Coretime sidebar_label: Agile Coretime Intro description: Introduction to Agile Coretime and its terminology -keywords: [coretime, blockspace, parathread, parachain, cores] +keywords: [coretime, blockspace, parachain, on-demand, cores] slug: ../learn-agile-coretime --- @@ -73,6 +73,13 @@ Previously known as instantaneous coretime, the on-demand coretime refers to cor through bidding in near real-time for the validation of a single parachain block on one of the cores reserved specifically for on-demand orders. +:::info Parathreads are renamed to on-demand parachains + +On-demand parachains (previously called parathreads) are parachains that buy on-demand coretime and +use it to access the Relay Chain through the on-demand coretime pool. + +::: + ### On-demand Coretime Pool Set of cores that are available on-demand. Cores reserved through bulk coretime could also be made @@ -479,7 +486,7 @@ Latency is the only drawback: at low demand, the buyer would receive the coretim the Relay Chain, but there’ll be a delay when executed on the Coretime Chain. At times of high demand, there will be a queue anyway and this delay matters less. -#### What's the best way for on-demand tasks (previously known as on-demand parachains or parathreads) to regularly send extrinsics to the Relay Chain for allowing a block to be validate? +#### What's the best way for on-demand tasks (previously known as on-demand parachains) to regularly send extrinsics to the Relay Chain for allowing a block to be validate? A ready-to-use automated and decentralized method for ordering on-demand coretime is currently [being implemented](https://github.com/paritytech/polkadot-sdk/issues/1487). Some teams diff --git a/docs/learn/learn-architecture.md b/docs/learn/learn-architecture.md index e5940ebe1d59..37f532874587 100644 --- a/docs/learn/learn-architecture.md +++ b/docs/learn/learn-architecture.md @@ -26,19 +26,19 @@ smart contracts are not supported. The main responsibility is to coordinate the including parachains. Other specific work is delegated to the parachains, which have different implementations and features. -## [Parachain](learn-parachains.md) and [Parathread](learn-parathreads.md) Slots +## [Parachain](learn-parachains.md) Slots {{ polkadot: Polkadot :polkadot }}{{ kusama: Kusama :kusama }} can support a number of execution slots. These slots are like cores on a computer's processor (a modern laptop's processor may have eight cores, for example). Each one of these cores can run one process at a time. {{ polkadot: Polkadot :polkadot }}{{ kusama: Kusama :kusama }} allows these slots using two -subscription models: parachains and parathreads. Parachains have a dedicated slot (core) for their -chain and are like a process that runs constantly. Parathreads share slots amongst a group, and are -thus more like processes that need to be woken up and run less frequently. +subscription models: parachains and on-demand parachains. Parachains have a dedicated slot (core) +for their chain and are like a process that runs constantly. On-demand parachains share slots +amongst a group, and are thus more like processes that need to be woken up and run less frequently. Most of the computation that happens across the {{ polkadot: Polkadot :polkadot }}{{ kusama: Kusama :kusama }} network as a whole will be delegated -to specific parachain or parathread implementations that handle various use cases. +to specific parachain implementations that handle various use cases. {{ polkadot: Polkadot :polkadot }}{{ kusama: Kusama :kusama }} places no constraints over what parachains can do besides that they must be able to generate a proof that can be validated by the validators assigned to the parachain. This proof verifies the state transition of the parachain. @@ -47,11 +47,11 @@ like smart contracts, privacy, or scalability — still, others might be exp architectures that are not necessarily blockchain in nature. {{ polkadot: Polkadot :polkadot }}{{ kusama: Kusama :kusama }} provides many ways to secure a slot -for a parachain for a particular length of time. Parathreads are part of a pool that shares slots -and must-win auctions for individual blocks. Parathreads and parachains have the same API; their -difference is economic. Parachains will have to reserve -{{ polkadot: DOT :polkadot }}{{ kusama: KSM :kusama }} for the duration of their slot lease; -parathreads will pay on a per-block basis. Parathreads can become parachains, and vice-versa. +for a parachain for a particular length of time. On-demand parachains share slots with other +parachains. Both regular and on-demand parachains have the same API; their difference is economic. +Parachains will have to reserve {{ polkadot: DOT :polkadot }}{{ kusama: KSM :kusama }} for the +duration of their slot lease; on-demand parachains will pay on a per-block basis. Parachains can +switch between being on-demand and permanent. ### [Shared Security](learn-parachains.md) diff --git a/docs/learn/learn-auction.md b/docs/learn/learn-auction.md index 054cb028ca69..71137fc5fcab 100644 --- a/docs/learn/learn-auction.md +++ b/docs/learn/learn-auction.md @@ -19,8 +19,7 @@ parachain slots. The number of parachain slots is not unbounded on available. A limited number of slots are unlocked every few months through on-chain governance. If a parachain wants to have guaranteed block inclusion at every Relay Chain block, it must acquire a parachain slot. The development of -[on-demand parachains](https://forum.polkadot.network/t/on-demand-parachains/2208) (previously -referred to as parathreads) is in progress. +[on-demand parachains](https://forum.polkadot.network/t/on-demand-parachains/2208) is complete, and they can be deployed after Agile Coretime is live on the network. The parachain slots will be leased according to an unpermissioned [candle auction](https://en.wikipedia.org/wiki/Candle_auction), with several alterations related to diff --git a/docs/learn/learn-comparisons-cosmos.md b/docs/learn/learn-comparisons-cosmos.md index 9c45c0084199..79b64ea5d70f 100644 --- a/docs/learn/learn-comparisons-cosmos.md +++ b/docs/learn/learn-comparisons-cosmos.md @@ -48,8 +48,8 @@ checks before committing it to the final chain. Parachain slots are limited, and thus parachain candidates participate in an auction to reserve a slot for up to two years. For chains that do not have the funding for a parachain slot or the necessity to execute with a six-second block time, Polkadot also has -[parathreads](learn-parathreads.md). Parathreads execute on a pay-as-you-go basis, only paying to -execute a block when they need to. +[on-demand parachains](./learn-parachains.md#on-demand-parachains) that execute on a pay-as-you-go +basis, only paying to execute a block when they need to. In order to interact with chains that want to use their own finalization process (e.g. Bitcoin), Polkadot has [bridge parachains](learn-bridges.md) that offer two-way compatibility. diff --git a/docs/learn/learn-guides-coretime-marketplaces.md b/docs/learn/learn-guides-coretime-marketplaces.md index 85f7fcee6f15..306324ebad46 100644 --- a/docs/learn/learn-guides-coretime-marketplaces.md +++ b/docs/learn/learn-guides-coretime-marketplaces.md @@ -3,7 +3,7 @@ id: learn-guides-coretime-marketplaces title: Coretime Marketplaces sidebar_label: Coretime Marketplaces description: Usage guides for coretime marketplaces -keywords: [coretime, blockspace, parathread, parachain, cores] +keywords: [coretime, blockspace, on-demand, parachain, parathread, cores] slug: ../learn-guides-coretime-marketplaces --- diff --git a/docs/learn/learn-parachains-faq.md b/docs/learn/learn-parachains-faq.md index f7c5400b49ea..3cc207a3cda5 100644 --- a/docs/learn/learn-parachains-faq.md +++ b/docs/learn/learn-parachains-faq.md @@ -44,7 +44,7 @@ significant number of optimizations, and there are future. The exact number of parachains that the Relay Chain can support without any degradation in performance is yet to be discovered. Also, with the [blockspace over blockchains](https://www.rob.tech/polkadot-blockspace-over-blockchains/) paradigm -which brings parathreads into the picture, there is no hard limit number on the number of +which brings on-demand parachains into the picture, there is no hard limit number on the number of blockchains that can be supported by {{ polkadot: Polkadot :polkadot }} {{ kusama: Kusama :kusama }}. @@ -114,9 +114,8 @@ validators. ### How will parachain slots be distributed? Parachain slots are acquirable through auction. For more information on the auction process, please -see the [parachain slot auctions](learn-auction.md) article. Additionally, some parachain slots will -be set aside to run [parathreads](learn-parathreads.md) — chains that bid on a per-block basis -to be included in the Relay Chain. (Parathreads are not implemented yet.) +see the [parachain slot auctions](learn-auction.md) article. Additionally, parachains will be able +to access the Relay Chain [on-demand](./learn-parachains.md#on-demand-parachains). ### Why doesn't everyone bid for the max length? diff --git a/docs/learn/learn-parachains.md b/docs/learn/learn-parachains.md index 31f17eb2e92d..abcc39413e18 100644 --- a/docs/learn/learn-parachains.md +++ b/docs/learn/learn-parachains.md @@ -3,7 +3,7 @@ id: learn-parachains title: Parachains sidebar_label: Introduction to Parachains description: An Introduction to Polkadot's Parachains. -keywords: [parachains, application-specific, sharding] +keywords: [parachains, application-specific, sharding, on-demand, parathread] slug: ../learn-parachains --- @@ -183,38 +183,13 @@ and {{ polkadot: Polkadot :polkadot }}{{ kusama: Kusama :kusama }} would still e Parachains are not required to have their token. If they do, it is up to the parachain to make the economic case for their token, not {{ polkadot: Polkadot :polkadot }}{{ kusama: Kusama :kusama }}. -## Parachain Hubs - -While {{ polkadot: Polkadot :polkadot }}{{ kusama: Kusama :kusama }} enables crosschain -functionality amongst the parachains, it necessitates that there is some latency between the -dispatch of a message from one parachain until the destination parachain receives the message. In -the optimistic scenario, the latency for this message should be at least two blocks - one block for -the message to be dispatched and one block for the receiving parachain to process and produce a -block that acts upon the message. However, in some cases, we may see that the latency for messages -is higher if many messages are in queue to be processed or if no nodes are running both parachain -networks that can quickly gossip the message across the networks. - -Due to the necessary latency in sending crosschain messages, some parachains plan to become _hubs_ -for an entire industry. For example, a parachain project [Acala](https://acala.network) is planning -to become a hub for decentralized finance (DeFi) applications. Many DeFi applications take advantage -of a property known as _composability_ which means that functions of one application can be -synergistically composed with others to create new applications. One example of this includes flash -loans, which borrow funds to execute some on-chain logic as long as the loan is repaid at the end of -the transaction. - -An issue with crosschain latency means that composability property weakens among parachains compared -to a single blockchain. **This implication is common to all sharded blockchain designs, including -Polkadot, Eth2.0, and others.** The solution to this is the introduction of parachain hubs, which -maintain the stronger property of single block composability. - ## Parachain Slot Acquisition -There are several ways to allocate parachain slots on +There are two ways to allocate parachain slots on {{ polkadot: Polkadot :polkadot }}{{ kusama: Kusama :kusama }}: - Governance granted parachains, or "system parachains" - Auction granted parachains -- [Parathreads](./learn-parathreads.md) [System parachains](#system-parachains) are allocated by {{ polkadot: Polkadot :polkadot }}{{ kusama: Kusama :kusama }}'s on-chain @@ -226,28 +201,73 @@ from the Relay Chain, allowing for more efficient parachain processing. teams can either bid with their own {{ polkadot: DOT :polkadot }}{{ kusama: KSM :kusama }} tokens, or source them from the community using the [crowdloan functionality](learn-crowdloans.md). -[Parathreads](learn-parathreads.md) have the same API as parachains, but are scheduled for execution -on a pay-as-you-go basis with an auction for each block. - ### Parachain Lease Expiration When a parachain wins an auction, the tokens it bids get reserved until the lease's end. Reserved balances are non-transferrable and cannot be used for staking. At the end of the lease, the tokens -are unreserved. Parachains that have not secured a new lease to extend their slot will automatically -become [parathreads](./learn-parathreads.md). +are unreserved. Parachains without a new lease to extend their slot will be deprecated to the status +of a parathread (i.e., a chain with a registered `ParaID` but has no access to a core). ## System Parachains -System parachains are parachains that use execution cores allocated by the network's governance. -These chains remove transactions from the Relay Chain, allowing network validators to allocate -resources to validating parachains. System chains are Polkadot using its scaling technology to host -itself. +[System parachains](./learn-system-chains.md) are parachains that use execution cores allocated by +the network's governance. These chains remove transactions from the Relay Chain, allowing network +validators to allocate resources to validating parachains. System chains are Polkadot using its +scaling technology to host itself. + +See this +[Polkadot blog article](https://polkadot.network/common-good-parachains-an-introduction-to-governance-allocated-parachain-slots/) +and this +[Polkadot Forum thread](https://forum.polkadot.network/t/polkadot-protocol-and-common-good-parachains/866) +for more information. + +## On-demand Parachains + +:::info On-demand parachains were previously named parathreads -See the -[Polkadot blog article](https://polkadot.network/common-good-parachains-an-introduction-to-governance-allocated-parachain-slots/), -this -[Polkadot Forum thread](https://forum.polkadot.network/t/polkadot-protocol-and-common-good-parachains/866), -and the [system parachains](learn-system-chains.md) page for more information. +On-demand parachains (previously called parathreads) are parachains that acquire +[on-demand coretime](./learn-agile-coretime.md#on-demand-coretime). + +::: + +On-demand parachains temporarily participate (on a block by block basis) in +{{ polkadot: Polkadot :polkadot }}{{ kusama: Kusama :kusama }} security without needing to lease a +dedicated parachain slot. This is done through economically sharing the scarce resource of a +_parachain slot_ (or core) among several competing resources (parachains). Chains that otherwise +would not be able to acquire a full parachain slot or do not find it economically sensible to do so, +can participate in {{ polkadot: Polkadot :polkadot }}{{ kusama: Kusama :kusama }}'s shared security +as the [on-demand coretime](./learn-agile-coretime.md#on-demand-coretime) offers a graceful off-ramp +to parachains that no longer require a dedicated parachain slot, but would like to continue using +the Relay Chain. + +### Historical Context of On-demand parachains + +According to [this talk](https://v.douyu.com/show/a4Jj7llO5q47Dk01) in Chengdu back in 2019, the +origin of the idea for on-demand parachains came from similar notions in the limited resource of +memory on early personal computers of the late '80s and '90s. Since computers have a limited amount +of physical memory, when an application needs more, the computer can create virtual memory by using +_swap space_ on a hard disk. Swap space allows the capacity of a computer's memory to expand and for +more processes to run concurrently with the trade-off that some processes will take longer to +progress. + +### Parachains vs. On-demand Parachains + +Parachains and on-demand parachains are very similar from a development perspective. One can imagine +that a chain developed with Substrate can at different points in its lifetime assume one of three +states: + +- an independent chain with secured bridge, +- a parachain continuously connected to the Relay Chain, +- or a parachain intermittently connected to the Relay Chain (i.e. on-demand) + +It can switch between these states with relatively minimal effort since the difference is more of an +economic distinction than a technological one. + +On-demand parachains have the exact same benefits for connecting to +{{ polkadot: Polkadot :polkadot }} {{ kusama: Kusama :kusama }} that a full parachain has. Namely, +it is able to send messages to other para-objects through [XCMP](learn-xcm.md###XCMP) and it is +secured under the full economic security of {{ polkadot: Polkadot :polkadot }} +{{ kusama: Kusama :kusama }}'s validator set. ## Parachains' Use Cases @@ -333,6 +353,30 @@ behavior to author blocks, and to include [extrinsics](./learn-transactions.md) correct entry points. The Node-side behavior relies on the Runtime APIs to extract information necessary to determine which action to take. +## Parachain Hubs + +While {{ polkadot: Polkadot :polkadot }}{{ kusama: Kusama :kusama }} enables crosschain +functionality amongst the parachains, it necessitates that there is some latency between the +dispatch of a message from one parachain until the destination parachain receives the message. In +the optimistic scenario, the latency for this message should be at least two blocks - one block for +the message to be dispatched and one block for the receiving parachain to process and produce a +block that acts upon the message. However, in some cases, we may see that the latency for messages +is higher if many messages are in queue to be processed or if no nodes are running both parachain +networks that can quickly gossip the message across the networks. + +Due to the necessary latency in sending crosschain messages, some parachains plan to become _hubs_ +for an entire industry (see the [Asset Hub](./learn-assets.md) and +[Bridge Hub](./learn-bridge-hub.md)). For example, many DeFi applications could take advantage of a +property known as _composability_ which means that functions of one application can be +synergistically composed with others to create new applications. One example of this includes flash +loans, which borrow funds to execute some on-chain logic as long as the loan is repaid at the end of +the transaction. + +An issue with crosschain latency means that composability property weakens among parachains compared +to a single blockchain. **This implication is common to all sharded blockchain designs, including +Polkadot, Ethereum, and others.** The solution to this is the introduction of parachain hubs, which +maintain the stronger property of single block composability. + ## Resources - [Polkadot: The Parachain](https://medium.com/polkadot-network/polkadot-the-parachain-3808040a769a) - diff --git a/docs/learn/learn-parathreads.md b/docs/learn/learn-parathreads.md deleted file mode 100644 index 3dbafdb408dd..000000000000 --- a/docs/learn/learn-parathreads.md +++ /dev/null @@ -1,118 +0,0 @@ ---- -id: learn-parathreads -title: Parathreads -sidebar_label: Parathreads -description: An Introductory Guide to Parathreads. -keywords: [parathreads, slots] -slug: ../learn-parathreads ---- - -Parathreads are an idea for parachains to temporarily participate (on a block by block basis) in -{{ polkadot: Polkadot :polkadot }}{{ kusama: Kusama :kusama }} security without needing to lease a -dedicated parachain slot. This is done through economically sharing the scarce resource of a -_parachain slot_ among several competing resources (parathreads). Chains that otherwise would not be -able to acquire a full parachain slot or do not find it economically sensible to do so, are enabled -to participate in {{ polkadot: Polkadot :polkadot }}{{ kusama: Kusama :kusama }}'s shared security -— albeit with an associated fee per executed block. It also offers a graceful off-ramp to -parachains that no longer require a dedicated parachain slot, but would like to continue using the -Relay Chain. - -## Origin - -According to [this talk](https://v.douyu.com/show/a4Jj7llO5q47Dk01) in Chengdu, the origin of the -idea came from similar notions in the limited resource of memory on early personal computers of the -late '80s and '90s. Since computers have a limited amount of physical memory, when an application -needs more, the computer can create virtual memory by using _swap space_ on a hard disk. Swap space -allows the capacity of a computer's memory to expand and for more processes to run concurrently with -the trade-off that some processes will take longer to progress. - -## How do Parathreads Operate? - -A portion of the parachain slots on the Relay Chain will be designated as part of the parathread -pool. In other words, some parachain slots will have no parachain attached to them and rather will -be used as a space for which the winner(s) of the block-by-block parathread fee auction can have -their block candidate included. - -Collators will offer a bid designated in {{ polkadot: DOT :polkadot }} {{ kusama: KSM :kusama }} for -inclusion of a parathread block candidate. The Relay Chain block author is able to select from these -bids to include a parathread block. The obvious incentive is for them to accept the block candidate -with the highest bid, which would bring them the most profit. The tokens from the parathread bids -will likely be split 80-20, meaning that 80% goes into -{{ polkadot: Polkadot :polkadot }}{{ kusama: Kusama :kusama }} treasury and 20% goes to the block -author. This is the same split that applies also to transaction fees and, like many other parameters -in {{ polkadot: Polkadot :polkadot }}{{ kusama: Kusama :kusama }}, can be changed through a -governance mechanism. - -## Parachain vs. Parathread - -Parachains and parathreads are very similar from a development perspective. One can imagine that a -chain developed with Substrate can at different points in its lifetime assume one of three states: -an independent chain with secured bridge, a parachain, or a parathread. It can switch between these -last two states with relatively minimal effort since the difference is more of an economic -distinction than a technological one. - -Parathreads have the exact same benefits for connecting to {{ polkadot: Polkadot :polkadot }} -{{ kusama: Kusama :kusama }} that a full parachain has. Namely, it is able to send messages to other -para-objects through [XCMP](learn-xcm.md###XCMP) and it is secured under the full economic security -of {{ polkadot: Polkadot :polkadot }} {{ kusama: Kusama :kusama }}'s validator set. - -The difference between parachains and parathreads is economic. Parachains must be registered through -a normal means of {{ polkadot: Polkadot :polkadot }}{{ kusama: Kusama :kusama }}, i.e. governance -proposal or parachain slot auction. Parathreads have a fixed fee for registration that would -realistically be much lower than the cost of acquiring a parachain slot. Similar to how -{{ polkadot: DOT :polkadot }} {{ kusama: KSM :kusama }} are locked for the duration of parachain -slots and then returned to the winner of the auction, the deposit for a parathread will be returned -to the parathread after the conclusion of its term. - -Registration of the parathread does not guarantee anything more than the registration of the -parathread code to the {{ polkadot: Polkadot :polkadot }}{{ kusama: Kusama :kusama }} Relay Chain. -When a parathread progresses by producing a new block, there is a fee that must be paid in order to -participate in a per-block auction for inclusion in the verification of the next Relay Chain block. -All parathreads that are registered are competing in this auction for their parathread to be -included for progression. - -There are two interesting observations to make about parathreads. Since they compete on a per-block -basis, it is similar to how transactions are included in Bitcoin or Ethereum. A similar fee market -will likely develop, which means that busier times will drive the price of parathread inclusion up, -while times of low activity will require lower fees. Two, this mechanism is markedly different from -the parachain mechanism, which guarantees inclusion as long as a parachain slot is held; parathread -registration grants no such right to the parathread. - -## Parathread Economics - -There are two sources of compensation for collators: - -1. Assuming a parathread has its own local token system, it pays the collators from the transaction - fees in its local token. If the parathread does not implement a local token, or its local token - has no value (e.g. it is used only for governance), then it can use {{ polkadot: DOT :polkadot }} - {{ kusama: KSM :kusama }} to incentivize collators. -2. Parathread protocol subsidy. A parathread can mint new tokens in order to provide additional - incentives for the collator. Probably, the amount of local tokens to mint for the parathread - would be a function of time, the more time that passes between parathread blocks that are - included in the Relay Chain, the more tokens the parathread is willing to subsidize in order to - be considered for inclusion. The exact implementation of this minting process could be through - local parathread inflation or via a stockpile of funds like a treasury. - -Collators may be paid in local parathread currency. However, the Relay Chain transacts with the -{{ polkadot: Polkadot :polkadot }}{{ kusama: Kusama :kusama }} native currency only. Collators must -then submit block candidates with an associated bid in {{ polkadot: DOT. :polkadot }} -{{ kusama: KSM. :kusama }} - -## Parachain Slot Swaps - -It will be possible for a parachain that holds a parachain slot to swap this slot with a parathread -so that the parathread "upgrades" to a full parachain and the parachain becomes a parathread. The -chain can also stop being a chain and continue as a thread without swapping the slot. The slot, if -unoccupied, would be auctioned off in the next [auction period](learn-auction.md). - -This provides a graceful off-ramp for parachains that have reached the end of their lease and do not -have sufficient usage to justify renewal; they can remain registered on the Relay Chain but only -produce new blocks when they need to. - -Parathreads help ease the sharp stop of the parachain slot term by allowing parachains that are -still doing something useful to produce blocks, even if it is no longer economically viable to rent -a parachain slot. - -## Resources - -- [Parathreads: Pay-as-you-go Parachains](https://medium.com/polkadot-network/parathreads-pay-as-you-go-parachains-7440d23dde06) diff --git a/docs/learn/learn-transactions.md b/docs/learn/learn-transactions.md index 646789698064..8d7e94e4da69 100644 --- a/docs/learn/learn-transactions.md +++ b/docs/learn/learn-transactions.md @@ -118,13 +118,13 @@ it allows you to add an extra security step. There are [a multitude of possible attacks](../general/transaction-attacks.md) that will prevent you to send funds to the desired destination account. -## Shard Transactions +## Parachain Transactions The transactions that take place within -{{ polkadot: Polkadot :polkadot }}{{ kusama: Kusama :kusama }}'s shards - parachains and -parathreads - do not incur Relay Chain transaction fees. Users of shard applications do not even -need to hold DOT tokens, as each shard has its own economic model and may or may not have a token. -There are, however, situations where shards themselves make transactions on the Relay Chain. +{{ polkadot: Polkadot :polkadot }}{{ kusama: Kusama :kusama }}'s parachains do not incur Relay Chain +transaction fees. Users of shard applications do not even need to hold DOT tokens, as each shard has +its own economic model and may or may not have a token. There are, however, situations where shards +themselves make transactions on the Relay Chain. [Parachains](learn-parachains.md) have a dedicated slot on the Relay Chain for execution, so their collators do not need to own DOT in order to include blocks. The parachain will make some @@ -133,10 +133,6 @@ in an [auction](learn-auction.md) to renew its slot, or upgrading its runtime. P own accounts on the Relay Chain and will need to use those funds to issue transactions on the parachain's behalf. -[Parathreads](learn-parathreads.md) will also make all the same transactions that a parachain might. -In addition, the collators need to participate in an auction every block to progress their chain. -The collators will need to have DOT to participate in these auctions. - ## Block Limits and Transaction Priority Blocks in {{ polkadot: Polkadot :polkadot }}{{ kusama: Kusama :kusama }} have both a maximum length diff --git a/docs/learn/learn-xcm-transport.md b/docs/learn/learn-xcm-transport.md index 52e3c8f2f181..6b401bd45e70 100644 --- a/docs/learn/learn-xcm-transport.md +++ b/docs/learn/learn-xcm-transport.md @@ -41,8 +41,8 @@ _Direct_ and _Relayed_. - With _Direct_, message data goes direct between parachains and is O(1) on the side of the Relay-chain and is very scalable. - With _Relayed_, message data is passed via the Relay-chain, and piggy-backs over VMP. It is much - less scalable, and parathreads in particular may not receive messages due to excessive queue - growth. + less scalable, and on-demand parachains in particular may not receive messages due to excessive + queue growth. Cross-chain transactions are resolved using a simple queuing mechanism based around a Merkle tree to ensure fidelity. It is the task of the Relay Chain validators to move transactions on the output diff --git a/kusama-guide/docusaurus.config.js b/kusama-guide/docusaurus.config.js index 029a6de79c57..48b30abf262d 100644 --- a/kusama-guide/docusaurus.config.js +++ b/kusama-guide/docusaurus.config.js @@ -99,7 +99,11 @@ module.exports = { { to: '/docs/learn-nominator', from: ['/docs/maintain-guides-how-to-nominate-polkadot'] - } + }, + { + to: '/docs/learn-parachains', + from: ['/docs/learn-parathreads'] + }, ], createRedirects: function (existingPath) { if (existingPath.startsWith('/docs/')) { diff --git a/kusama-guide/sidebars.js b/kusama-guide/sidebars.js index 32983dcd0763..190fa54c5a88 100644 --- a/kusama-guide/sidebars.js +++ b/kusama-guide/sidebars.js @@ -643,7 +643,6 @@ module.exports = { }, items: [ 'learn/learn-spree', - "learn/learn-parathreads", "learn/learn-elastic-scaling", "learn/learn-sassafras", ], diff --git a/polkadot-wiki/docusaurus.config.js b/polkadot-wiki/docusaurus.config.js index 77a7ede8fa0c..8819b694eb0d 100644 --- a/polkadot-wiki/docusaurus.config.js +++ b/polkadot-wiki/docusaurus.config.js @@ -180,7 +180,11 @@ module.exports = { { to: '/docs/learn-nominator', from: ['/docs/maintain-guides-how-to-nominate-polkadot'] - } + }, + { + to: '/docs/learn-parachains', + from: ['/docs/learn-parathreads'] + }, ], createRedirects: function (existingPath) { if (existingPath.startsWith("/docs/")) { diff --git a/polkadot-wiki/pages/en/index.js b/polkadot-wiki/pages/en/index.js index 55859c229918..3c7c2df40cc2 100644 --- a/polkadot-wiki/pages/en/index.js +++ b/polkadot-wiki/pages/en/index.js @@ -84,8 +84,7 @@ class HomeFooter extends React.Component {

Kusama is Polkadot’s canary network; a scalable, multi-chain network for radical innovation and early stage Polkadot deployments. For developers, Kusama is a proving - ground for all things Polkadot (i.e. runtime upgrades, on-chain governance, parachains, - parathreads, etc.). + ground for all things Polkadot (i.e. runtime upgrades, on-chain governance, parachains, etc.).

diff --git a/polkadot-wiki/sidebars.js b/polkadot-wiki/sidebars.js index 35b9bb964e54..5d00d27bb737 100644 --- a/polkadot-wiki/sidebars.js +++ b/polkadot-wiki/sidebars.js @@ -672,7 +672,6 @@ module.exports = { }, items: [ 'learn/learn-spree', - "learn/learn-parathreads", "learn/learn-elastic-scaling", "learn/learn-sassafras", { diff --git a/polkadot-wiki/src/pages/index.js b/polkadot-wiki/src/pages/index.js index 9545795e586f..6efdec45b8d6 100644 --- a/polkadot-wiki/src/pages/index.js +++ b/polkadot-wiki/src/pages/index.js @@ -107,8 +107,7 @@ function HomeFooter() { > Kusama is Polkadot’s “canary network”, a scalable, multi-chain network for radical innovation and early stage Polkadot deployments. For developers, Kusama is a proving - ground for all things Polkadot I.e runtime upgrades, on-chain governance, parachains, - parathreads, etc. + ground for all things Polkadot I.e runtime upgrades, on-chain governance, parachains, etc.