diff --git a/404.html b/404.html index 2c60df07..24bc2c8c 100644 --- a/404.html +++ b/404.html @@ -91,7 +91,7 @@ diff --git a/approved/0001-agile-coretime.html b/approved/0001-agile-coretime.html index 1bdf242d..e831f697 100644 --- a/approved/0001-agile-coretime.html +++ b/approved/0001-agile-coretime.html @@ -90,7 +90,7 @@ diff --git a/approved/0005-coretime-interface.html b/approved/0005-coretime-interface.html index 5051ab43..dec4ef8c 100644 --- a/approved/0005-coretime-interface.html +++ b/approved/0005-coretime-interface.html @@ -90,7 +90,7 @@ diff --git a/approved/0007-system-collator-selection.html b/approved/0007-system-collator-selection.html index 3fd92663..65255540 100644 --- a/approved/0007-system-collator-selection.html +++ b/approved/0007-system-collator-selection.html @@ -90,7 +90,7 @@ diff --git a/approved/0008-parachain-bootnodes-dht.html b/approved/0008-parachain-bootnodes-dht.html index 4a71e7c6..5f76aa8f 100644 --- a/approved/0008-parachain-bootnodes-dht.html +++ b/approved/0008-parachain-bootnodes-dht.html @@ -90,7 +90,7 @@ diff --git a/approved/0009-improved-net-light-client-requests.html b/approved/0009-improved-net-light-client-requests.html index 32283a4a..dbf1b22b 100644 --- a/approved/0009-improved-net-light-client-requests.html +++ b/approved/0009-improved-net-light-client-requests.html @@ -90,7 +90,7 @@ diff --git a/approved/0010-burn-coretime-revenue.html b/approved/0010-burn-coretime-revenue.html index 3068c598..cc030e88 100644 --- a/approved/0010-burn-coretime-revenue.html +++ b/approved/0010-burn-coretime-revenue.html @@ -90,7 +90,7 @@ diff --git a/approved/0012-process-for-adding-new-collectives.html b/approved/0012-process-for-adding-new-collectives.html index b648e1c8..dfb022ba 100644 --- a/approved/0012-process-for-adding-new-collectives.html +++ b/approved/0012-process-for-adding-new-collectives.html @@ -90,7 +90,7 @@ diff --git a/approved/0013-prepare-blockbuilder-and-core-runtime-apis-for-mbms.html b/approved/0013-prepare-blockbuilder-and-core-runtime-apis-for-mbms.html index 31a38a03..53b1ea23 100644 --- a/approved/0013-prepare-blockbuilder-and-core-runtime-apis-for-mbms.html +++ b/approved/0013-prepare-blockbuilder-and-core-runtime-apis-for-mbms.html @@ -90,7 +90,7 @@ diff --git a/approved/0014-improve-locking-mechanism-for-parachains.html b/approved/0014-improve-locking-mechanism-for-parachains.html index 0624ca1e..f49a077c 100644 --- a/approved/0014-improve-locking-mechanism-for-parachains.html +++ b/approved/0014-improve-locking-mechanism-for-parachains.html @@ -90,7 +90,7 @@ diff --git a/approved/0022-adopt-encointer-runtime.html b/approved/0022-adopt-encointer-runtime.html index d427a45b..2f1288c5 100644 --- a/approved/0022-adopt-encointer-runtime.html +++ b/approved/0022-adopt-encointer-runtime.html @@ -90,7 +90,7 @@ diff --git a/approved/0026-sassafras-consensus.html b/approved/0026-sassafras-consensus.html index d49546fa..c6550e08 100644 --- a/approved/0026-sassafras-consensus.html +++ b/approved/0026-sassafras-consensus.html @@ -90,7 +90,7 @@ diff --git a/approved/0032-minimal-relay.html b/approved/0032-minimal-relay.html index 099b3970..ddffea97 100644 --- a/approved/0032-minimal-relay.html +++ b/approved/0032-minimal-relay.html @@ -90,7 +90,7 @@ diff --git a/approved/0042-extrinsics-state-version.html b/approved/0042-extrinsics-state-version.html index 00ce4b01..1894821c 100644 --- a/approved/0042-extrinsics-state-version.html +++ b/approved/0042-extrinsics-state-version.html @@ -90,7 +90,7 @@ diff --git a/approved/0043-storage-proof-size-hostfunction.html b/approved/0043-storage-proof-size-hostfunction.html index 3cadfd26..f18b0f94 100644 --- a/approved/0043-storage-proof-size-hostfunction.html +++ b/approved/0043-storage-proof-size-hostfunction.html @@ -90,7 +90,7 @@ diff --git a/approved/0045-nft-deposits-asset-hub.html b/approved/0045-nft-deposits-asset-hub.html index 25be3bce..ede21662 100644 --- a/approved/0045-nft-deposits-asset-hub.html +++ b/approved/0045-nft-deposits-asset-hub.html @@ -90,7 +90,7 @@ diff --git a/approved/0047-assignment-of-availability-chunks.html b/approved/0047-assignment-of-availability-chunks.html index 3f987448..524cee3f 100644 --- a/approved/0047-assignment-of-availability-chunks.html +++ b/approved/0047-assignment-of-availability-chunks.html @@ -90,7 +90,7 @@ diff --git a/approved/0048-session-keys-runtime-api.html b/approved/0048-session-keys-runtime-api.html index c3312497..84312b58 100644 --- a/approved/0048-session-keys-runtime-api.html +++ b/approved/0048-session-keys-runtime-api.html @@ -90,7 +90,7 @@ diff --git a/approved/0050-fellowship-salaries.html b/approved/0050-fellowship-salaries.html index 8d870cb3..9d31e66d 100644 --- a/approved/0050-fellowship-salaries.html +++ b/approved/0050-fellowship-salaries.html @@ -90,7 +90,7 @@ diff --git a/approved/0056-one-transaction-per-notification.html b/approved/0056-one-transaction-per-notification.html index 068407b5..da536e48 100644 --- a/approved/0056-one-transaction-per-notification.html +++ b/approved/0056-one-transaction-per-notification.html @@ -90,7 +90,7 @@ diff --git a/approved/0059-nodes-capabilities-discovery.html b/approved/0059-nodes-capabilities-discovery.html index f69f76e9..7fca8e0e 100644 --- a/approved/0059-nodes-capabilities-discovery.html +++ b/approved/0059-nodes-capabilities-discovery.html @@ -90,7 +90,7 @@ diff --git a/approved/0078-merkleized-metadata.html b/approved/0078-merkleized-metadata.html index 6be221d6..7ad1034b 100644 --- a/approved/0078-merkleized-metadata.html +++ b/approved/0078-merkleized-metadata.html @@ -90,7 +90,7 @@ diff --git a/approved/0084-general-transaction-extrinsic-format.html b/approved/0084-general-transaction-extrinsic-format.html index 303ff559..be714c43 100644 --- a/approved/0084-general-transaction-extrinsic-format.html +++ b/approved/0084-general-transaction-extrinsic-format.html @@ -90,7 +90,7 @@ diff --git a/approved/0091-dht-record-creation-time.html b/approved/0091-dht-record-creation-time.html index 81325194..6b8b464a 100644 --- a/approved/0091-dht-record-creation-time.html +++ b/approved/0091-dht-record-creation-time.html @@ -90,7 +90,7 @@ diff --git a/approved/0097-unbonding_queue.html b/approved/0097-unbonding_queue.html index f431ef45..59406e68 100644 --- a/approved/0097-unbonding_queue.html +++ b/approved/0097-unbonding_queue.html @@ -90,7 +90,7 @@ diff --git a/approved/0099-transaction-extension-version.html b/approved/0099-transaction-extension-version.html index 5fd99dea..40dc2ff6 100644 --- a/approved/0099-transaction-extension-version.html +++ b/approved/0099-transaction-extension-version.html @@ -90,7 +90,7 @@ diff --git a/approved/0100-xcm-multi-type-asset-transfer.html b/approved/0100-xcm-multi-type-asset-transfer.html index 8c62c639..443a6a04 100644 --- a/approved/0100-xcm-multi-type-asset-transfer.html +++ b/approved/0100-xcm-multi-type-asset-transfer.html @@ -90,7 +90,7 @@ diff --git a/approved/0101-xcm-transact-remove-max-weight-param.html b/approved/0101-xcm-transact-remove-max-weight-param.html index 666ad615..d0b000c2 100644 --- a/approved/0101-xcm-transact-remove-max-weight-param.html +++ b/approved/0101-xcm-transact-remove-max-weight-param.html @@ -90,7 +90,7 @@ diff --git a/approved/0103-introduce-core-index-commitment.html b/approved/0103-introduce-core-index-commitment.html index fe18b6d0..29392568 100644 --- a/approved/0103-introduce-core-index-commitment.html +++ b/approved/0103-introduce-core-index-commitment.html @@ -90,7 +90,7 @@ diff --git a/approved/0105-xcm-improved-fee-mechanism.html b/approved/0105-xcm-improved-fee-mechanism.html index 1b896e3e..5e1b6657 100644 --- a/approved/0105-xcm-improved-fee-mechanism.html +++ b/approved/0105-xcm-improved-fee-mechanism.html @@ -90,7 +90,7 @@ diff --git a/approved/0107-xcm-execution-hints.html b/approved/0107-xcm-execution-hints.html index 54011059..5b8099e6 100644 --- a/approved/0107-xcm-execution-hints.html +++ b/approved/0107-xcm-execution-hints.html @@ -90,7 +90,7 @@ diff --git a/approved/0108-xcm-remove-testnet-ids.html b/approved/0108-xcm-remove-testnet-ids.html index 8c82db22..0ae9dc72 100644 --- a/approved/0108-xcm-remove-testnet-ids.html +++ b/approved/0108-xcm-remove-testnet-ids.html @@ -90,7 +90,7 @@ diff --git a/approved/0122-alias-origin-on-asset-transfers.html b/approved/0122-alias-origin-on-asset-transfers.html index 57aa00bc..aa97dfbf 100644 --- a/approved/0122-alias-origin-on-asset-transfers.html +++ b/approved/0122-alias-origin-on-asset-transfers.html @@ -90,7 +90,7 @@ diff --git a/index.html b/index.html index 928c0b63..33116079 100644 --- a/index.html +++ b/index.html @@ -90,7 +90,7 @@ diff --git a/introduction.html b/introduction.html index 928c0b63..33116079 100644 --- a/introduction.html +++ b/introduction.html @@ -90,7 +90,7 @@ diff --git a/print.html b/print.html index 8ee910ac..cdbf5214 100644 --- a/print.html +++ b/print.html @@ -91,7 +91,7 @@ @@ -571,6 +571,229 @@
Table of Contents
+Start Date | 22 Oct 2024 |
Description | XCM Asset Metadata definition and a way of communicating it via XCM |
Authors | Daniel Shiposha |
This RFC proposes a metadata format for XCM-identifiable assets (i.e., for fungible/non-fungible collections and non-fungible tokens) and a set of instructions to communicate it across chains.
+Currently, there is no way to communicate metadata of an asset (or an asset instance) via XCM.
+The ability to query and modify the metadata is useful for two kinds of entities:
+Asset collections (both fungible and nonfungible).
+Any collection has some metadata, such as the name of the collection. The standard way of communicating metadata could help with registering foreign assets within a consensus system. Therefore, this RFC could complement or supersede the RFC for initializing fully-backed derivatives (note that this RFC is related to the old XCM RFC process; it's not the Fellowship RFC and hasn't been migrated yet).
+NFTs (i.e., asset instances).
+The metadata is the crucial aspect of any nonfungible object since metadata assigns meaning to such an object. The metadata for NFTs is just as important as the notion of "amount" for fungibles (there is no sense in fungibles if they have no amount).
+An NFT is always a representation of some object. The metadata describes the object represented by the NFT.
+NFTs can be transferred to another chain via XCM. However, there are limitations due to the inability to communicate its metadata:
+Besides metadata modification, the ability to read it is also valuable. On-chain logic can interpret the NFT metadata, i.e., the metadata could have not only the media meaning but also a utility function within a consensus system. Currently, such a way of using NFT metadata is possible only within one consensus system. This RFC proposes making it possible between different systems via XCM so different chains can fetch and analyze the asset metadata from other chains.
+Runtime users, Runtime devs, Cross-chain dApps, Wallets.
+The Asset Metadata is information bound to an asset class (fungible or NFT collection) or an asset instance (an NFT). +The Asset Metadata could be represented differently on different chains (or in other consensus entities). +However, to communicate metadata between consensus entities via XCM, we need a general format so that any consensus entity can make sense of such information.
+We can name this format "XCM Asset Metadata".
+This RFC proposes:
+Using key-value pairs as XCM Asset Metadata since it is a general concept useful for both structured and unstructured data. Both key and value can be raw bytes with interpretation up to the communicating entities.
+The XCM Asset Metadata should be represented as a map SCALE-encoded equivalent to the BTreeMap<Vec<u8>, Vec<u8>>
.
As such, the XCM Asset Metadata types are defined as follows:
++#![allow(unused)] +fn main() { +type MetadataKey = Vec<u8>; +type MetadataValue = Vec<u8>; +type MetadataMap = BTreeMap<MetadataKey, MetadataValue>; +}
Communicating only the demanded part of the metadata, not the whole metadata.
+A consensus entity should be able to query the values of interested keys to read the metadata.
+We need a set-like type to specify the keys to read, a SCALE-encoded equivalent to the BTreeSet<Vec<u8>>
.
+Let's define that type as follows:
+#![allow(unused)] +fn main() { +type MetadataKeySet = BTreeSet<MetadataKey>; +}
A consensus entity should be able to write the values for specified keys.
+New XCM instructions to communicate the metadata.
+Note: the maximum lengths of MetadataKey
, MetadataValue
, MetadataMap
, and MetadataKeySet
are implementation-defined.
ReportMetadata
The ReportMetadata
is a new instruction to query metadata information.
+It can be used to query metadata key list or to query values of interested keys.
This instruction allows querying the metadata of:
+If an asset (or an asset instance) for which the query is made doesn't exist, the Response::Null
should be reported via the existing QueryResponse
instruction.
The ReportMetadata
can be used without origin (i.e., following the ClearOrigin
instruction) since it only reads state.
Safety: The reporter origin should be trusted to hold the true metadata. If the reserve-based model is considered, the asset's reserve location must be viewed as the only source of truth about the metadata.
+The use case for this instruction is when the metadata information of a foreign asset (or asset instance) is used in the logic of a consensus entity that requested it.
++#![allow(unused)] +fn main() { +/// An instruction to query metadata of an asset or an asset instance. +ReportMetadata { + /// The ID of an asset (a collection, fungible or nonfungible). + asset_id: AssetId, + + /// The ID of an asset instance. + /// + /// If the value is `Undefined`, the metadata of the collection is reported. + instance: AssetInstance, + + /// See `MetadataQueryKind` below. + query_kind: MetadataQueryKind, + + /// The usual field for Report<something> XCM instructions. + /// + /// Information regarding the query response. + /// The `QueryResponseInfo` type is already defined in the XCM spec. + response_info: QueryResponseInfo, +} +}
Where the MetadataQueryKind
is:
+#![allow(unused)] +fn main() { +enum MetadataQueryKind { + /// Query metadata key set. + KeySet, + + /// Query values of the specified keys. + Values(MetadataKeySet), +} +}
The ReportMetadata
works in conjunction with the existing QueryResponse
instruction. The Response
type should be modified accordingly: we need to add a new AssetMetadata
variant to it.
+#![allow(unused)] +fn main() { +/// The struct used in the existing `QueryResponse` instruction. +pub enum Response { + // ... snip, existing variants ... + + /// The metadata info. + AssetMetadata { + /// The ID of an asset (a collection, fungible or nonfungible). + asset_id: AssetId, + + /// The ID of an asset instance. + /// + /// If the value is `Undefined`, the reported metadata is related to the collection, not a token. + instance: AssetInstance, + + /// See `MetadataResponseData` below. + data: MetadataResponseData, + } +} + +pub enum MetadataResponseData { + /// The metadata key list to be reported + /// in response to the `KeySet` metadata query kind. + KeySet(MetadataKeySet), + + /// The values of the keys that were specified in the + /// `Values` variant of the metadata query kind. + Values(MetadataMap), +} +}
ModifyMetadata
The ModifyMetadata
is a new instruction to request a remote chain to modify the values of the specified keys.
This instruction can be used to update the metadata of a collection (fungible or nonfungible) or of an NFT.
+The remote chain handles the modification request and may reject it based on its internal rules. +The request can only be executed or rejected in its entirety. It must not be executed partially.
+To execute the ModifyMetadata
, an origin is required so that the handling logic can authorize the metadata modification request from a known source. Since this instruction requires an origin, the assets used to cover the execution fees must be transferred in a way that preserves the origin. For instance, one can use the approach described in RFC #122 if the handling chain configured aliasing rules accordingly.
The example use case of this instruction is to ask the reserve location of the asset to modify the metadata. So that, the original asset's metadata is updated according to the reserve location's rules.
++#![allow(unused)] +fn main() { +ModifyMetadata { + /// The ID of an asset (a collection, fungible or nonfungible). + asset_id: AssetId, + + /// The ID of an asset instance. + /// + /// If the value is `Undefined`, the modification request targets the collection, not a token. + instance: AssetInstance, + + /// The map contains the keys mapped to the requested new values. + modification: MetadataMap, +} +}
AssetInstance::Undefined
As the new instructions show, this RFC reframes the purpose of the Undefined
variant of the AssetInstance
enum.
+This RFC proposes to use the Undefined
variant of a collection identified by an AssetId
as a synonym of the collection itself. I.e., an asset Asset { id: <AssetId>, fun: NonFungible(AssetInstance::Undefined) }
is considered an NFT representing the collection itself.
As a singleton non-fungible instance is barely distinguishable from its collection, this convention shouldn't cause any problems.
+Thus, the AssetInstance
docs must be updated accordingly in the implementations.
Regarding ergonomics, no drawbacks were noticed.
+As for the user experience, it could discover new cross-chain use cases involving asset collections and NFTs, indicating a positive impact.
+There are no security concerns except for the ReportMetadata
instruction, which implies that the source of the information must be trusted.
In terms of performance and privacy, there will be no changes.
+The implementations must honor the contract for the new instructions. Namely, if the instance
field has the value of AssetInstance::Undefined
, the metadata must relate to the asset collection but not to a non-fungible token inside it.
No significant impact.
+Introducing a standard metadata format and a way of communicating it is a valuable addition to the XCM format that potentially increases cross-chain interoperability without the need to form ad-hoc chain-to-chain integrations via Transact
.
This RFC proposes new functionality, so there are no compatibility issues.
+The original RFC draft contained additional metadata instructions. Though they could be useful, they're clearly outside the basic logic. So, this RFC version omits them to make the metadata discussion more focused on the core things. Nonetheless, there is hope that metadata approval instructions might be useful in the future, so they are mentioned here.
+You can read about the details in the original draft.
Table of Contents
This proposal introduces XCQ (Cross Consensus Query), which aims to serve as an intermediary layer between different chain runtime implementations and tools/UIs, to provide a unified interface for cross-chain queries.
XCQ
abstracts away concrete implementations across chains and supports custom query computations.
Use cases benefiting from XCQ
include:
In Substrate, runtime APIs facilitate off-chain clients in reading the state of the consensus system.
However, different chains may expose different APIs for a similar query or have varying data types, such as doing custom transformations on direct data, or differing AccountId
types.
This diversity also extends to client-side, which may require custom computations over runtime APIs in various use cases.
Therefore, tools and UI developers often access storage directly and reimplement custom computations to convert data into user-friendly representations, leading to duplicated code between Rust runtime logic and UI JS/TS logic.
This duplication increases workload and potential for bugs.
Therefore, a system is needed to serve as an intermediary layer between concrete chain runtime implementations and tools/UIs, to provide a unified interface for cross-chain queries.
-The overall query pattern of XCQ consists of three components:
Testing:
@@ -965,14 +1188,14 @@It's a new functionality, which doesn't modify the existing implementations.
-The proposal facilitate the wallets and dApps developers. Developers no longer need to examine every concrete implementation to support conceptually similar operations across different chains. Additionally, they gain a more modular development experience through encapsulating custom computations over the exposed APIs in PolkaVM programs.
-The proposal defines new apis, which doesn't break compatibility with existing interfaces.
-There are several discussions related to the proposal, including:
frame-metadata
's CustomMetadata
field, but the trade-offs (i.e. compatibility between versions) need examination.Table of Contents
This RFC proposes a change that makes it possible to identify types of compressed blobs stored on-chain, as well as used off-chain, without the need for decompression.
-Currently, a compressed blob does not give any idea of what's inside because the only thing that can be inside, according to the spec, is Wasm. In reality, other blob types are already being used, and more are to come. Apart from being error-prone by itself, the current approach does not allow to properly route the blob through the execution paths before its decompression, which will result in suboptimal implementations when more blob types are used. Thus, it is necessary to introduce a mechanism allowing to identify the blob type without decompressing it.
This proposal is intended to support future work enabling Polkadot to execute PolkaVM and, more generally, other-than-Wasm parachain runtimes, and allow developers to introduce arbitrary compression methods seamlessly in the future.
-Node developers are the main stakeholders for this proposal. It also creates a foundation on which parachain runtime developers will build.
-The current approach to compressing binary blobs involves using zstd
compression, and the resulting compressed blob is prefixed with a unique 64-bit magic value specified in that subsection. The same procedure is used to compress both Wasm code blobs and proofs-of-validity. Currently, having solely a compressed blob, it's impossible to tell what's inside it without decompression, a Wasm blob, or a PoV. That doesn't cause problems in the current protocol, as Wasm blobs and PoV blobs take completely different execution paths in the code.
The changes proposed below are intended to define the means for distinguishing compressed blob types in a backward-compatible and future-proof way.
@@ -1048,26 +1271,26 @@CBLOB_ZSTD_LEGACY
remain on-chain. That may take quite some time. Alternatively, create a migration that alters prefixes of existing blobs;CBLOB_ZSTD_LEGACY
prefix will be possible after all the nodes in all the networks cease using the prefix which is a long process, and additional incentives should be offered to the community to make people upgrade.Currently, the only requirement for a compressed blob prefix is not to coincide with Wasm magic bytes (as stated in code comments). Changes proposed here increase prefix collision risk, given that arbitrary data may be compressed in the future. However, it must be taken into account that:
As the change increases granularity, it will positively affect both testing possibilities and security, allowing developers to check what's inside a given compressed blob precisely. Testing the change itself is trivial. Privacy is not affected by this change.
-The current implementation's performance is not affected by this change. Future implementations allowing for the execution of other-than-Wasm parachain runtimes will benefit from this change performance-wise.
-The end-user ergonomics is not affected. The ergonomics for developers will benefit from this change as it enables exact checks and less guessing.
-The change is designed to be backward-compatible.
-SDK PR#6704 (WIP) introduces a mechanism similar to that described in this proposal and proves the necessity of such a change.
None
-This proposal creates a foundation for two future work directions:
This proposes a periodic, sale-based method for assigning Polkadot Coretime, the analogue of "block space" within the Polkadot Network. The method takes into account the need for long-term capital expenditure planning for teams building on Polkadot, yet also provides a means to allow Polkadot to capture long-term value in the resource which it sells. It supports the possibility of building rich and dynamic secondary markets to optimize resource allocation and largely avoids the need for parameterization.
-The Polkadot Ubiquitous Computer, or just Polkadot UC, represents the public service provided by the Polkadot Network. It is a trust-free, WebAssembly-based, multicore, internet-native omnipresent virtual machine which is highly resilient to interference and corruption.
The present system of allocating the limited resources of the Polkadot Ubiquitous Computer is through a process known as parachain slot auctions. This is a parachain-centric paradigm whereby a single core is long-term allocated to a single parachain which itself implies a Substrate/Cumulus-based chain secured and connected via the Relay-chain. Slot auctions are on-chain candle auctions which proceed for several days and result in the core being assigned to the parachain for six months at a time up to 24 months in advance. Practically speaking, we only see two year periods being bid upon and leased.
@@ -1136,7 +1359,7 @@Furthermore, the design SHOULD be implementable and deployable in a timely fashion; three months from the acceptance of this RFC should not be unreasonable.
-Primary stakeholder sets are:
Socialization:
The essensials of this proposal were presented at Polkadot Decoded 2023 Copenhagen on the Main Stage. A small amount of socialization at the Parachain Summit preceeded it and some substantial discussion followed it. Parity Ecosystem team is currently soliciting views from ecosystem teams who would be key stakeholders.
-Upon implementation of this proposal, the parachain-centric slot auctions and associated crowdloans cease. Instead, Coretime on the Polkadot UC is sold by the Polkadot System in two separate formats: Bulk Coretime and Instantaneous Coretime.
When a Polkadot Core is utilized, we say it is dedicated to a Task rather than a "parachain". The Task to which a Core is dedicated may change at every Relay-chain block and while one predominant type of Task is to secure a Cumulus-based blockchain (i.e. a parachain), other types of Tasks are envisioned.
@@ -1577,16 +1800,16 @@No specific considerations.
Parachains already deployed into the Polkadot UC must have a clear plan of action to migrate to an agile Coretime market.
While this proposal does not introduce documentable features per se, adequate documentation must be provided to potential purchasers of Polkadot Coretime. This SHOULD include any alterations to the Polkadot-SDK software collection.
-Regular testing through unit tests, integration tests, manual testnet tests, zombie-net tests and fuzzing SHOULD be conducted.
A regular security review SHOULD be conducted prior to deployment through a review by the Web3 Foundation economic research group.
Any final implementation MUST pass a professional external security audit.
The proposal introduces no new privacy concerns.
-RFC-3 proposes a means of implementing the high-level allocations within the Relay-chain.
RFC-5 proposes the API for interacting with Relay-chain.
Additional work should specify the interface for the instantaneous market revenue so that the Coretime-chain can ensure Bulk Coretime placed in the instantaneous market is properly compensated.
@@ -1602,7 +1825,7 @@Robert Habermeier initially wrote on the subject of Polkadot blockspace-centric in the article Polkadot Blockspace over Blockchains. While not going into details, the article served as an early reframing piece for moving beyond one-slot-per-chain models and building out secondary market infrastructure for resource allocation.
Table of Contents
@@ -1635,10 +1858,10 @@In the Agile Coretime model of the Polkadot Ubiquitous Computer, as proposed in RFC-1 and RFC-3, it is necessary for the allocating parachain (envisioned to be one or more pallets on a specialised Brokerage System Chain) to communicate the core assignments to the Relay-chain, which is responsible for ensuring those assignments are properly enacted.
This is a proposal for the interface which will exist around the Relay-chain in order to communicate this information and instructions.
-The background motivation for this interface is splitting out coretime allocation functions and secondary markets from the Relay-chain onto System parachains. A well-understood and general interface is necessary for ensuring the Relay-chain receives coretime allocation instructions from one or more System chains without introducing dependencies on the implementation details of either side.
Primary stakeholder sets are:
Socialization:
This content of this RFC was discussed in the Polkdot Fellows channel.
-The interface has two sections: The messages which the Relay-chain is able to receive from the allocating parachain (the UMP message types), and messages which the Relay-chain is able to send to the allocating parachain (the DMP message types). These messages are expected to be able to be implemented in a well-known pallet and called with the XCM Transact
instruction.
Future work may include these messages being introduced into the XCM standard.
Realistic Limits of the Usage
For request_revenue_info
, a successful request should be possible if when
is no less than the Relay-chain block number on arrival of the message less 100,000.
For assign_core
, a successful request should be possible if begin
is no less than the Relay-chain block number on arrival of the message plus 10 and workload
contains no more than 100 items.
-Performance, Ergonomics and Compatibility
+Performance, Ergonomics and Compatibility
No specific considerations.
-Testing, Security and Privacy
+Testing, Security and Privacy
Standard Polkadot testing and security auditing applies.
The proposal introduces no new privacy concerns.
-Future Directions and Related Material
+Future Directions and Related Material
RFC-1 proposes a means of determining allocation of Coretime using this interface.
RFC-3 proposes a means of implementing the high-level allocations within the Relay-chain.
Drawbacks, Alternatives and Unknowns
None at present.
-Prior Art and References
+Prior Art and References
None.
Table of Contents
@@ -1789,13 +2012,13 @@ Summary
+Summary
As core functionality moves from the Relay Chain into system chains, so increases the reliance on
the liveness of these chains for the use of the network. It is not economically scalable, nor
necessary from a game-theoretic perspective, to pay collators large rewards. This RFC proposes a
mechanism -- part technical and part social -- for ensuring reliable collator sets that are
resilient to attemps to stop any subsytem of the Polkadot protocol.
-Motivation
+Motivation
In order to guarantee access to Polkadot's system, the collators on its system chains must propose
blocks (provide liveness) and allow all transactions to eventually be included. That is, some
collators may censor transactions, but there must exist one collator in the set who will include a
@@ -1831,12 +2054,12 @@
RequirementsCollators selected by governance SHOULD have a reasonable expectation that the Treasury will
reimburse their operating costs.
This protocol builds on the existing
Collator Selection pallet
and its notion of Invulnerables. Invulnerables are collators (identified by their AccountId
s) who
@@ -1872,27 +2095,27 @@
The primary drawback is a reliance on governance for continued treasury funding of infrastructure costs for Invulnerable collators.
-The vast majority of cases can be covered by unit testing. Integration test should ensure that the
Collator Selection UpdateOrigin
, which has permission to modify the Invulnerables and desired
number of Candidates, can handle updates over XCM from the system's governance location.
This proposal has very little impact on most users of Polkadot, and should improve the performance of system chains by reducing the number of missed blocks.
-As chains have strict PoV size limits, care must be taken in the PoV impact of the session manager. Appropriate benchmarking and tests should ensure that conservative limits are placed on the number of Invulnerables and Candidates.
-The primary group affected is Candidate collators, who, after implementation of this RFC, will need to compete in a bond-based election rather than a race to claim a Candidate spot.
-This RFC is compatible with the existing implementation and can be handled via upgrades and migration.
-None at this time.
-There may exist in the future system chains for which this model of collator selection is not appropriate. These chains should be evaluated on a case-by-case basis.
@@ -1948,10 +2171,10 @@The full nodes of the Polkadot peer-to-peer network maintain a distributed hash table (DHT), which is currently used for full nodes discovery and validators discovery purposes.
This RFC proposes to extend this DHT to be used to discover full nodes of the parachains of Polkadot.
-The maintenance of bootnodes has long been an annoyance for everyone.
When a bootnode is newly-deployed or removed, every chain specification must be updated in order to take the update into account. This has lead to various non-optimal solutions, such as pulling chain specifications from GitHub repositories. When it comes to RPC nodes, UX developers often have trouble finding up-to-date addresses of parachain RPC nodes. With the ongoing migration from RPC nodes to light clients, similar problems would happen with chain specifications as well.
@@ -1960,9 +2183,9 @@Because the list of bootnodes in chain specifications is so annoying to modify, the consequence is that the number of bootnodes is rather low (typically between 2 and 15). In order to better resist downtimes and DoS attacks, a better solution would be to use every node of a certain chain as potential bootnode, rather than special-casing some specific nodes.
While this RFC doesn't solve these problems for relay chains, it aims at solving it for parachains by storing the list of all the full nodes of a parachain on the relay chain DHT.
Assuming that this RFC is implemented, and that light clients are used, deploying a parachain wouldn't require more work than registering it onto the relay chain and starting the collators. There wouldn't be any need for special infrastructure nodes anymore.
-This RFC has been opened on my own initiative because I think that this is a good technical solution to a usability problem that many people are encountering and that they don't realize can be solved.
-The content of this RFC only applies for parachains and parachain nodes that are "Substrate-compatible". It is in no way mandatory for parachains to comply to this RFC.
Note that "Substrate-compatible" is very loosely defined as "implements the same mechanisms and networking protocols as Substrate". The author of this RFC believes that "Substrate-compatible" should be very precisely specified, but there is controversy on this topic.
While a lot of this RFC concerns the implementation of parachain nodes, it makes use of the resources of the Polkadot chain, and as such it is important to describe them in the Polkadot specification.
@@ -1999,10 +2222,10 @@The peer_id
and addrs
fields are in theory not strictly needed, as the PeerId and addresses could be always equal to the PeerId and addresses of the node being registered as the provider and serving the response. However, the Cumulus implementation currently uses two different networking stacks, one of the parachain and one for the relay chain, using two separate PeerIds and addresses, and as such the PeerId and addresses of the other networking stack must be indicated. Asking them to use only one networking stack wouldn't feasible in a realistic time frame.
The values of the genesis_hash
and fork_id
fields cannot be verified by the requester and are expected to be unused at the moment. Instead, a client that desires connecting to a parachain is expected to obtain the genesis hash and fork ID of the parachain from the parachain chain specification. These fields are included in the networking protocol nonetheless in case an acceptable solution is found in the future, and in order to allow use cases such as discovering parachains in a not-strictly-trusted way.
Because not all nodes want to be used as bootnodes, implementers are encouraged to provide a way to disable this mechanism. However, it is very much encouraged to leave this mechanism on by default for all parachain nodes.
This mechanism doesn't add or remove any security by itself, as it relies on existing mechanisms. However, if the principle of chain specification bootnodes is entirely replaced with the mechanism described in this RFC (which is the objective), then it becomes important whether the mechanism in this RFC can be abused in order to make a parachain unreachable.
@@ -2011,22 +2234,22 @@The DHT mechanism generally has a low overhead, especially given that publishing providers is done only every 24 hours.
Doing a Kademlia iterative query then sending a provider record shouldn't take more than around 50 kiB in total of bandwidth for the parachain bootnode.
Assuming 1000 parachain full nodes, the 20 Polkadot full nodes corresponding to a specific parachain will each receive a sudden spike of a few megabytes of networking traffic when the key
rotates. Again, this is relatively negligible. If this becomes a problem, one can add a random delay before a parachain full node registers itself to be the provider of the key
corresponding to BabeApi_next_epoch
.
Maybe the biggest uncertainty is the traffic that the 20 Polkadot full nodes will receive from light clients that desire knowing the bootnodes of a parachain. Light clients are generally encouraged to cache the peers that they use between restarts, so they should only query these 20 Polkadot full nodes at their first initialization. If this every becomes a problem, this value of 20 is an arbitrary constant that can be increased for more redundancy.
-Irrelevant.
-Irrelevant.
-None.
While it fundamentally doesn't change much to this RFC, using BabeApi_currentEpoch
and BabeApi_nextEpoch
might be inappropriate. I'm not familiar enough with good practices within the runtime to have an opinion here. Should it be an entirely new pallet?
It is possible that in the future a client could connect to a parachain without having to rely on a trusted parachain specification.
Table of Contents
@@ -2059,9 +2282,9 @@Improve the networking messages that query storage items from the remote, in order to reduce the bandwidth usage and number of round trips of light clients.
-Clients on the Polkadot peer-to-peer network can be divided into two categories: full nodes and light clients. So-called full nodes are nodes that store the content of the chain locally on their disk, while light clients are nodes that don't. In order to access for example the balance of an account, a full node can do a disk read, while a light client needs to send a network message to a full node and wait for the full node to reply with the desired value. This reply is in the form of a Merkle proof, which makes it possible for the light client to verify the exactness of the value.
Unfortunately, this network protocol is suffering from some issues:
Once Polkadot and Kusama will have transitioned to state_version = 1
, which modifies the format of the trie entries, it will be possible to generate Merkle proofs that contain only the hashes of values in the storage. Thanks to this, it is already possible to prove the existence of a key without sending its entire value (only its hash), or to prove that a value has changed or not between two blocks (by sending just their hashes).
Thus, the only reason why aforementioned issues exist is because the existing networking messages don't give the possibility for the querier to query this. This is what this proposal aims at fixing.
This is the continuation of https://github.com/w3f/PPPs/pull/10, which itself is the continuation of https://github.com/w3f/PPPs/pull/5.
-The protobuf schema of the networking protocol can be found here: https://github.com/paritytech/substrate/blob/5b6519a7ff4a2d3cc424d78bc4830688f3b184c0/client/network/light/src/schema/light.v1.proto
The proposal is to modify this protocol in this way:
@@ -11,6 +11,7 @@ message Request { @@ -2131,26 +2354,26 @@
, then we do not need to pass the full extrinsic data but rather at maximum, 32 byte of extrinsic data. -Explanation Also note that child tries aren't considered as descendants of the main trie when it comes to the
includeDescendants
flag. In other words, if the request concerns the main trie, no content coming from child tries is ever sent back.This protocol keeps the same maximum response size limit as currently exists (16 MiB). It is not possible for the querier to know in advance whether its query will lead to a reply that exceeds the maximum size. If the reply is too large, the replier should send back only a limited number (but at least one) of requested items in the proof. The querier should then send additional requests for the rest of the items. A response containing none of the requested items is invalid.
The server is allowed to silently discard some keys of the request if it judges that the number of requested keys is too high. This is in line with the fact that the server might truncate the response.
-Drawbacks
+Drawbacks
This proposal doesn't handle one specific situation: what if a proof containing a single specific item would exceed the response size limit? For example, if the response size limit was 1 MiB, querying the runtime code (which is typically 1.0 to 1.5 MiB) would be impossible as it's impossible to generate a proof less than 1 MiB. The response size limit is currently 16 MiB, meaning that no single storage item must exceed 16 MiB.
Unfortunately, because it's impossible to verify a Merkle proof before having received it entirely, parsing the proof in a streaming way is also not possible.
A way to solve this issue would be to Merkle-ize large storage items, so that a proof could include only a portion of a large storage item. Since this would require a change to the trie format, it is not realistically feasible in a short time frame.
-Testing, Security, and Privacy
+Testing, Security, and Privacy
The main security consideration concerns the size of replies and the resources necessary to generate them. It is for example easily possible to ask for all keys and values of the chain, which would take a very long time to generate. Since responses to this networking protocol have a maximum size, the replier should truncate proofs that would lead to the response being too large. Note that it is already possible to send a query that would lead to a very large reply with the existing network protocol. The only thing that this proposal changes is that it would make it less complicated to perform such an attack.
Implementers of the replier side should be careful to detect early on when a reply would exceed the maximum reply size, rather than inconditionally generate a reply, as this could take a very large amount of CPU, disk I/O, and memory. Existing implementations might currently be accidentally protected from such an attack thanks to the fact that requests have a maximum size, and thus that the list of keys in the query was bounded. After this proposal, this accidental protection would no longer exist.
Malicious server nodes might truncate Merkle proofs even when they don't strictly need to, and it is not possible for the client to (easily) detect this situation. However, malicious server nodes can already do undesirable things such as throttle down their upload bandwidth or simply not respond. There is no need to handle unnecessarily truncated Merkle proofs any differently than a server simply not answering the request.
-Performance, Ergonomics, and Compatibility
-Performance
+Performance, Ergonomics, and Compatibility
+Performance
It is unclear to the author of the RFC what the performance implications are. Servers are supposed to have limits to the amount of resources they use to respond to requests, and as such the worst that can happen is that light client requests become a bit slower than they currently are.
-Ergonomics
+Ergonomics
Irrelevant.
-Compatibility
+Compatibility
The prior networking protocol is maintained for now. The older version of this protocol could get removed in a long time.
-Prior Art and References
+Prior Art and References
None. This RFC is a clean-up of an existing mechanism.
Unresolved Questions
None
-Future Directions and Related Material
+Future Directions and Related Material
The current networking protocol could be deprecated in a long time. Additionally, the current "state requests" protocol (used for warp syncing) could also be deprecated in favor of this one.
Table of Contents
@@ -2171,13 +2394,13 @@Summary +
Summary
The Polkadot UC will generate revenue from the sale of available Coretime. The question then arises: how should we handle these revenues? Broadly, there are two reasonable paths – burning the revenue and thereby removing it from total issuance or divert it to the Treasury. This Request for Comment (RFC) presents arguments favoring burning as the preferred mechanism for handling revenues from Coretime sales.
-Motivation
+Motivation
How to handle the revenue accrued from Coretime sales is an important economic question that influences the value of DOT and should be properly discussed before deciding for either of the options. Now is the best time to start this discussion.
-Stakeholders
+Stakeholders
Polkadot DOT token holders.
-Explanation
+Explanation
This RFC discusses potential benefits of burning the revenue accrued from Coretime sales instead of diverting them to Treasury. Here are the following arguments for it.
It's in the interest of the Polkadot community to have a consistent and predictable Treasury income, because volatility in the inflow can be damaging, especially in situations when it is insufficient. As such, this RFC operates under the presumption of a steady and sustainable Treasury income flow, which is crucial for the Polkadot community's stability. The assurance of a predictable Treasury income, as outlined in a prior discussion here, or through other equally effective measures, serves as a baseline assumption for this argument.
Consequently, we need not concern ourselves with this particular issue here. This naturally begs the question - why should we introduce additional volatility to the Treasury by aligning it with the variable Coretime sales? It's worth noting that Coretime revenues often exhibit an inverse relationship with periods when Treasury spending should ideally be ramped up. During periods of low Coretime utilization (indicated by lower revenue), Treasury should spend more on projects and endeavours to increase the demand for Coretime. This pattern underscores that Coretime sales, by their very nature, are an inconsistent and unpredictable source of funding for the Treasury. Given the importance of maintaining a steady and predictable inflow, it's unnecessary to rely on another volatile mechanism. Some might argue that we could have both: a steady inflow (from inflation) and some added bonus from Coretime sales, but burning the revenue would offer further benefits as described below.
@@ -2220,13 +2443,13 @@
Authors Joe Petrowski -Summary
+Summary
Since the introduction of the Collectives parachain, many groups have expressed interest in forming new -- or migrating existing groups into -- on-chain collectives. While adding a new collective is relatively simple from a technical standpoint, the Fellowship will need to merge new pallets into the Collectives parachain for each new collective. This RFC proposes a means for the network to ratify a new collective, thus instructing the Fellowship to instate it in the runtime.
-Motivation
+Motivation
Many groups have expressed interest in representing collectives on-chain. Some of these include:
- Parachain technical fellowship (new)
@@ -2242,12 +2465,12 @@Motivation -
Stakeholders
+Stakeholders
-
- Polkadot stakeholders who would like to organize on-chain.
- Technical Fellowship, in its role of maintaining system runtimes.
Explanation
+Explanation
The group that wishes to operate an on-chain collective should publish the following information:
-
- Charter, including the collective's mandate and how it benefits Polkadot. This would be similar @@ -2281,19 +2504,19 @@
Rem or not the Fellowship member agrees with removal.
Collective removal may also come with other governance calls, for example voiding any scheduled Treasury spends that would fund the given collective.
-Drawbacks
+Drawbacks
Passing a Root origin referendum is slow. However, given the network's investment (in terms of code maintenance and salaries) in a new collective, this is an appropriate step.
-Testing, Security, and Privacy
+Testing, Security, and Privacy
No impacts.
-Performance, Ergonomics, and Compatibility
+Performance, Ergonomics, and Compatibility
Generally all new collectives will be in the Collectives parachain. Thus, performance impacts should strictly be limited to this parachain and not affect others. As the majority of logic for collectives is generalized and reusable, we expect most collectives to be instances of similar subsets of modules. That is, new collectives should generally be compatible with UIs and other services that provide collective-related functionality, with little modifications to support new ones.
-Prior Art and References
+Prior Art and References
The launch of the Technical Fellowship, see the initial forum post.
Unresolved Questions
@@ -2333,13 +2556,13 @@Summary +
Summary
Introduces breaking changes to the
-Core
runtime API by lettingCore::initialize_block
return an enum. The versions ofCore
is bumped from 4 to 5.Motivation
+Motivation
The main feature that motivates this RFC are Multi-Block-Migrations (MBM); these make it possible to split a migration over multiple blocks.
-
Further it would be nice to not hinder the possibility of implementing a new hookpoll
, that runs at the beginning of the block when there are no MBMs and has access toAllPalletsWithSystem
. This hook can then be used to replace the use ofon_initialize
andon_finalize
for non-deadline critical logic.
In a similar fashion, it should not hinder the future addition of aSystem::PostInherents
callback that always runs after all inherents were applied.Stakeholders
+Stakeholders
-
- Substrate Maintainers: They have to implement this, including tests, audit and maintenance burden.
@@ -2347,7 +2570,7 @@Stakeholders<
- Polkadot Parachain Teams: They have to adapt to the breaking changes but then eventually have multi-block migrations available.
Explanation
+Explanation
Core::initialize_block
This runtime API function is changed from returning
()
toExtrinsicInclusionMode
:fn initialize_block(header: &<Block as BlockT>::Header) @@ -2368,23 +2591,23 @@
1. Multi-Block-Migrations: The runtime is being put into lock-down mode for the duration of the migration process by returning OnlyInherents
frominitialize_block
. This ensures that no user provided transaction can interfere with the migration process. It is absolutely necessary to ensure this, otherwise a transaction could call into un-migrated storage and violate storage invariants.2.
poll
is possible by usingapply_extrinsic
as entry-point and not hindered by this approach. It would not be possible to use a pallet inherent likeSystem::last_inherent
to achieve this for two reasons: First is that pallets do not have access toAllPalletsWithSystem
which is required to invoke thepoll
hook on all pallets. Second is that the runtime does currently not enforce an order of inherents.3.
-System::PostInherents
can be done in the same manner aspoll
.Drawbacks
+Drawbacks
The previous drawback of cementing the order of inherents has been addressed and removed by redesigning the approach. No further drawbacks have been identified thus far.
-Testing, Security, and Privacy
+Testing, Security, and Privacy
The new logic of
initialize_block
can be tested by checking that the block-builder will skip transactions whenOnlyInherents
is returned.Security: n/a
Privacy: n/a
-Performance, Ergonomics, and Compatibility
-Performance
+Performance, Ergonomics, and Compatibility
+Performance
The performance overhead is minimal in the sense that no clutter was added after fulfilling the requirements. The only performance difference is that
-initialize_block
also returns an enum that needs to be passed through the WASM boundary. This should be negligible.Ergonomics
+Ergonomics
The new interface allows for more extensible runtime logic. In the future, this will be utilized for multi-block-migrations which should be a huge ergonomic advantage for parachain developers.
-Compatibility
+Compatibility
The advice here is OPTIONAL and outside of the RFC. To not degrade user experience, it is recommended to ensure that an updated node can still import historic blocks.
-Prior Art and References
+Prior Art and References
The RFC is currently being implemented in polkadot-sdk#1781 (formerly substrate#14275). Related issues and merge requests:
@@ -2401,7 +2624,7 @@
ExtrinsicInclusionMode
-
Ispost_inherents
more consistent instead oflast_inherent
? Then we should change it.
=> renamed tolast_inherent
Future Directions and Related Material
+Future Directions and Related Material
The long-term future here is to move the block building logic into the runtime. Currently there is a tight dance between the block author and the runtime; the author has to call into different runtime functions in quick succession and exact order. Any misstep causes the block to be invalid.
@@ -2438,14 +2661,14 @@
This can be unified and simplified by moving both parts into the runtime.
Authors Bryan Chen -Summary
+Summary
This RFC proposes a set of changes to the parachain lock mechanism. The goal is to allow a parachain manager to self-service the parachain without root track governance action.
This is achieved by remove existing lock conditions and only lock a parachain when:
-
- A parachain manager explicitly lock the parachain
- OR a parachain block is produced successfully
Motivation
+Motivation
The manager of a parachain has permission to manage the parachain when the parachain is unlocked. Parachains are by default locked when onboarded to a slot. This requires the parachain wasm/genesis must be valid, otherwise a root track governance action on relaychain is required to update the parachain.
The current reliance on root track governance actions for managing parachains can be time-consuming and burdensome. This RFC aims to address this technical difficulty by allowing parachain managers to take self-service actions, rather than relying on general public voting.
The key scenarios this RFC seeks to improve are:
@@ -2464,12 +2687,12 @@RequirementsA parachain SHOULD be locked when it successfully produced the first block.
- A parachain manager MUST be able to perform lease swap without having a running parachain.
Stakeholders
+Stakeholders
-
- Parachain teams
- Parachain users
Explanation
+Explanation
Status quo
A parachain can either be locked or unlocked3. With parachain locked, the parachain manager does not have any privileges. With parachain unlocked, the parachain manager can perform following actions with the
paras_registrar
pallet:@@ -2509,23 +2732,23 @@
-Migration
- Parachain never produced a block. Including from expired leases.
- Parachain manager never explicitly lock the parachain.
Drawbacks
+Drawbacks
Parachain locks are designed in such way to ensure the decentralization of parachains. If parachains are not locked when it should be, it could introduce centralization risk for new parachains.
For example, one possible scenario is that a collective may decide to launch a parachain fully decentralized. However, if the parachain is unable to produce block, the parachain manager will be able to replace the wasm and genesis without the consent of the collective.
It is considered this risk is tolerable as it requires the wasm/genesis to be invalid at first place. It is not yet practically possible to develop a parachain without any centralized risk currently.
Another case is that a parachain team may decide to use crowdloan to help secure a slot lease. Previously, creating a crowdloan will lock a parachain. This means crowdloan participants will know exactly the genesis of the parachain for the crowdloan they are participating. However, this actually providers little assurance to crowdloan participants. For example, if the genesis block is determined before a crowdloan is started, it is not possible to have onchain mechanism to enforce reward distributions for crowdloan participants. They always have to rely on the parachain team to fulfill the promise after the parachain is alive.
Existing operational parachains will not be impacted.
-Testing, Security, and Privacy
+Testing, Security, and Privacy
The implementation of this RFC will be tested on testnets (Rococo and Westend) first.
An audit maybe required to ensure the implementation does not introduce unwanted side effects.
There is no privacy related concerns.
-Performance
+Performance
This RFC should not introduce any performance impact.
-Ergonomics
+Ergonomics
This RFC should improve the developer experiences for new and existing parachain teams
-Compatibility
+Compatibility
This RFC is fully compatibility with existing interfaces.
-Prior Art and References
+Prior Art and References
- Parachain Slot Extension Story: https://github.com/paritytech/polkadot/issues/4758
- Allow parachain to renew lease without actually run another parachain: https://github.com/paritytech/polkadot/issues/6685
@@ -2533,7 +2756,7 @@Unresolved Questions
None at this stage.
-Future Directions and Related Material
+Future Directions and Related Material
This RFC is only intended to be a short term solution. Slots will be removed in future and lock mechanism is likely going to be replaced with a more generalized parachain manage & recovery system in future. Therefore long term impacts of this RFC are not considered.
1-https://github.com/paritytech/cumulus/issues/377 @@ -2567,19 +2790,19 @@
Summary +
Summary
Encointer is a system chain on Kusama since Jan 2022 and has been developed and maintained by the Encointer association. This RFC proposes to treat Encointer like any other system chain and include it in the fellowship repo with this PR.
-Motivation
+Motivation
Encointer does not seek to be in control of its runtime repository. As a decentralized system, the fellowship has a more suitable structure to maintain a system chain runtime repo than the Encointer association does.
Also, Encointer aims to update its runtime in batches with other system chains in order to have consistency for interoperability across system chains.
-Stakeholders
+Stakeholders
-
- Fellowship: Will continue to take upon them the review and auditing work for the Encointer runtime, but the process is streamlined with other system chains and therefore less time-consuming compared to the separate repo and CI process we currently have.
- Kusama Network: Tokenholders can easily see the changes of all system chains in one place.
- Encointer Association: Further decentralization of the Encointer Network necessities like devops.
- Encointer devs: Being able to work directly in the Fellowship runtimes repo to streamline and synergize with other developers.
Explanation
+Explanation
Our PR has all details about our runtime and how we would move it into the fellowship repo.
Noteworthy: All Encointer-specific pallets will still be located in encointer's repo for the time being: https://github.com/encointer/pallets
It will still be the duty of the Encointer team to keep its runtime up to date and provide adequate test fixtures. Frequent dependency bumps with Polkadot releases would be beneficial for interoperability and could be streamlined with other system chains but that will not be a duty of fellowship. Whenever possible, all system chains could be upgraded jointly (including Encointer) with a batch referendum.
@@ -2588,17 +2811,17 @@Explanation
- Encointer will publish all its crates crates.io
- Encointer does not carry out external auditing of its runtime nor pallets. It would be beneficial but not a requirement from our side if Encointer could join the auditing process of other system chains.
-Drawbacks
+Drawbacks
Other than all other system chains, development and maintenance of the Encointer Network is mainly financed by the KSM Treasury and possibly the DOT Treasury in the future. Encointer is dedicated to maintaining its network and runtime code for as long as possible, but there is a dependency on funding which is not in the hands of the fellowship. The only risk in the context of funding, however, is that the Encointer runtime will see less frequent updates if there's less funding.
-Testing, Security, and Privacy
+Testing, Security, and Privacy
No changes to the existing system are proposed. Only changes to how maintenance is organized.
-Performance, Ergonomics, and Compatibility
+Performance, Ergonomics, and Compatibility
No changes
-Prior Art and References
+Prior Art and References
Existing Encointer runtime repo
Unresolved Questions
None identified
-Future Directions and Related Material
+Future Directions and Related Material
More info on Encointer: encointer.org
Table of Contents
@@ -3518,11 +3741,11 @@
Authors Joe Petrowski, Gavin Wood Summary
+Summary
The Relay Chain contains most of the core logic for the Polkadot network. While this was necessary prior to the launch of parachains and development of XCM, most of this logic can exist in parachains. This is a proposal to migrate several subsystems into system parachains.
-Motivation
+Motivation
Polkadot's scaling approach allows many distinct state machines (known generally as parachains) to operate with common guarantees about the validity and security of their state transitions. Polkadot provides these common guarantees by executing the state transitions on a strict subset (a backing @@ -3534,13 +3757,13 @@
MotivationBy minimising state transition logic on the Relay Chain by migrating it into "system chains" -- a set of parachains that, with the Relay Chain, make up the Polkadot protocol -- the Polkadot Ubiquitous Computer can maximise its primary offering: secure blockspace. -
Stakeholders
+Stakeholders
-
- Parachains that interact with affected logic on the Relay Chain;
- Core protocol and XCM format developers;
- Tooling, block explorer, and UI developers.
Explanation
+Explanation
The following pallets and subsystems are good candidates to migrate from the Relay Chain:
- Identity
@@ -3686,27 +3909,27 @@Kusama
Staking is the subsystem most constrained by PoV limits. Ensuring that elections, payouts, session changes, offences/slashes, etc. work in a parachain on Kusama -- with its larger validator set -- will give confidence to the chain's robustness on Polkadot. -Drawbacks
+Drawbacks
These subsystems will have reduced resources in cores than on the Relay Chain. Staking in particular may require some optimizations to deal with constraints.
-Testing, Security, and Privacy
+Testing, Security, and Privacy
Standard audit/review requirements apply. More powerful multi-chain integration test tools would be useful in developement.
-Performance, Ergonomics, and Compatibility
+Performance, Ergonomics, and Compatibility
Describe the impact of the proposal on the exposed functionality of Polkadot.
-Performance
+Performance
This is an optimization. The removal of public/user transactions on the Relay Chain ensures that its primary resources are allocated to system performance.
-Ergonomics
+Ergonomics
This proposal alters very little for coretime users (e.g. parachain developers). Application developers will need to interact with multiple chains, making ergonomic light client tools particularly important for application development.
For existing parachains that interact with these subsystems, they will need to configure their runtimes to recognize the new locations in the network.
-Compatibility
+Compatibility
Implementing this proposal will require some changes to pallet APIs and/or a pub-sub protocol. Application developers will need to interact with multiple chains in the network.
-Prior Art and References
+Prior Art and References
- Transactionless Relay-chain
- Moving Staking off the Relay Chain
@@ -3715,7 +3938,7 @@Moving Staking off the Relay Chain. -
Future Directions and Related Material
+Future Directions and Related Material
Ideally the Relay Chain becomes transactionless, such that not even balances are represented there. With Staking and Governance off the Relay Chain, this is not an unreasonable next step.
With Identity on Polkadot, Kusama may opt to drop its People Chain.
@@ -3750,13 +3973,13 @@Summary +
Summary
At the moment, we have
-system_version
field onRuntimeVersion
that derives which state version is used for the Storage. We have a use case where we want extrinsics root is derived usingStateVersion::V1
. Without defining a new field underRuntimeVersion
, we would like to propose addingsystem_version
that can be used to derive both storage and extrinsic state version.Motivation
+Motivation
Since the extrinsic state version is always
@@ -3768,11 +3991,11 @@StateVersion::V0
, deriving extrinsic root requires full extrinsic data. This would be problematic when we need to verify the extrinsics root if the extrinsic sizes are bigger. This problem is further explored in https://github.com/polkadot-fellows/RFCs/issues/19MotivationStateVersion::V1
Stakeholders
+Stakeholders
In order to use project specific StateVersion for extrinsic roots, we proposed
an implementation that introduced
parameter to frame_system::Config
but that unfortunately did not feel correct.
@@ -3798,26 +4021,26 @@
There should be no drawbacks as it would replace state_version
with same behavior but documentation should be updated
so that chains know which system_version
to use.
AFAIK, should not have any impact on the security or privacy.
-These changes should be compatible for existing chains if they use state_version
value for system_verision
.
I do not believe there is any performance hit with this change.
-This does not break any exposed Apis.
-This change should not break any compatibility.
-We proposed introducing a similar change by introducing a
parameter to frame_system::Config
but did not feel that
is the correct way of introducing this change.
I do not have any specific questions about this change at the moment.
-IMO, this change is pretty self-contained and there won't be any future work necessary.
Table of Contents
@@ -3846,9 +4069,9 @@This RFC proposes a new host function for parachains, storage_proof_size
. It shall provide the size of the currently recorded storage proof to the runtime. Runtime authors can use the proof size to improve block utilization by retroactively reclaiming unused storage weight.
The number of extrinsics that are included in a parachain block is limited by two constraints: execution time and proof size. FRAME weights cover both concepts, and block-builders use them to decide how many extrinsics to include in a block. However, these weights are calculated ahead of time by benchmarking on a machine with reference hardware. The execution-time properties of the state-trie and its storage items are unknown at benchmarking time. Therefore, we make some assumptions about the state-trie:
In addition, the current model does not account for multiple accesses to the same storage items. While these repetitive accesses will not increase storage-proof size, the runtime-side weight monitoring will account for them multiple times. Since the proof size is completely opaque to the runtime, we can not implement retroactive storage weight correction.
A solution must provide a way for the runtime to track the exact storage-proof size consumed on a per-extrinsic basis.
-This RFC proposes a new host function that exposes the storage-proof size to the runtime. As a result, runtimes can implement storage weight reclaiming mechanisms that improve block utilization.
This RFC proposes the following host function signature:
#![allow(unused)] @@ -3870,14 +4093,14 @@
Explanation
fn ext_storage_proof_size_version_1() -> u64; }
The host function MUST return an unsigned 64-bit integer value representing the current proof size. In block-execution and block-import contexts, this function MUST return the current size of the proof. To achieve this, parachain node implementors need to enable proof recording for block imports. In other contexts, this function MUST return 18446744073709551615 (u64::MAX), which represents disabled proof recording.
-Parachain nodes need to enable proof recording during block import to correctly implement the proposed host function. Benchmarking conducted with balance transfers has shown a performance reduction of around 0.6% when proof recording is enabled.
-The host function proposed in this RFC allows parachain runtime developers to keep track of the proof size. Typical usage patterns would be to keep track of the overall proof size or the difference between subsequent calls to the host function.
-Parachain teams will need to include this host function to upgrade.
-This RFC proposes changing the current deposit requirements on the Polkadot and Kusama Asset Hub for creating an NFT collection, minting an individual NFT, and lowering its corresponding metadata and attribute deposits. The objective is to lower the barrier to entry for NFT creators, fostering a more inclusive and vibrant ecosystem while maintaining network integrity and preventing spam.
-The current deposit of 10 DOT for collection creation (along with 0.01 DOT for item deposit and 0.2 DOT for metadata and attribute deposits) on the Polkadot Asset Hub and 0.1 KSM on Kusama Asset Hub presents a significant financial barrier for many NFT creators. By lowering the deposit @@ -3953,7 +4176,7 @@
deposit
function, adjusted by correspoding pricing mechansim.Previous discussions have been held within the Polkadot Forum, with artists expressing their concerns about the deposit amounts.
-This RFC proposes a revision of the deposit constants in the configuration of the NFTs pallet on the Polkadot Asset Hub. The new deposit amounts would be determined by a standard deposit formula.
As of v1.1.1, the Collection Deposit is 10 DOT and the Item Deposit is 0.01 DOT (see @@ -4038,7 +4261,7 @@
Modifying deposit requirements necessitates a balanced assessment of the potential drawbacks. Highlighted below are cogent points extracted from the discourse on the Polkadot Forum conversation, @@ -4067,20 +4290,20 @@
As noted above, state bloat is a security concern. In the case of abuse, governance could adapt by
increasing deposit rates and/or using forceDestroy
on collections agreed to be spam.
The primary performance consideration stems from the potential for state bloat due to increased activity from lower deposit requirements. It's vital to monitor and manage this to avoid any negative impact on the chain's performance. Strategies for mitigating state bloat, including efficient data management and periodic reviews of storage requirements, will be essential.
-The proposed change aims to enhance the user experience for artists, traders, and utilizers of Kusama and Polkadot Asset Hubs, making Polkadot and Kusama more accessible and user-friendly.
-The change does not impact compatibility as a redeposit
function is already implemented.
If this RFC is accepted, there should not be any unresolved questions regarding how to adapt the @@ -4170,11 +4393,11 @@
Propose a way of permuting the availability chunk indices assigned to validators, in the context of recovering available data from systematic chunks, with the purpose of fairly distributing network bandwidth usage.
-Currently, the ValidatorIndex is always identical to the ChunkIndex. Since the validator array is only shuffled once per session, naively using the ValidatorIndex as the ChunkIndex would pose an unreasonable stress on the first N/3 validators during an entire session, when favouring availability recovery from systematic chunks.
@@ -4182,9 +4405,9 @@Relay chain node core developers.
-An erasure coding algorithm is considered systematic if it preserves the original unencoded data as part of the resulting code. @@ -4338,7 +4561,7 @@
core_index
that used to be occupied by a candidate in some parts of the dispute protocol is
very complicated (See appendix A). This RFC assumes that availability-recovery processes initiated during
@@ -4348,28 +4571,28 @@ CandidateReceipt
Extensive testing will be conducted - both automated and manual. This proposal doesn't affect security or privacy.
-This is a necessary data availability optimisation, as reed-solomon erasure coding has proven to be a top consumer of CPU time in polkadot as we scale up the parachain block size and number of availability cores.
With this optimisation, preliminary performance results show that CPU time used for reed-solomon coding/decoding can be halved and total POV recovery time decrease by 80% for large POVs. See more here.
-Not applicable.
-This is a breaking change. See upgrade path section above. All validators and collators need to have upgraded their node versions before the feature will be enabled via a governance call.
-See comments on the tracking issue and the in-progress PR
Not applicable.
-This enables future optimisations for the performance of availability recovery, such as retrieving batched systematic chunks from backers/approval-checkers.
This RFC proposes to changes the SessionKeys::generate_session_keys
runtime api interface. This runtime api is used by validator operators to
generate new session keys on a node. The public session keys are then registered manually on chain by the validator operator.
Before this RFC it was not possible by the on chain logic to ensure that the account setting the public session keys is also in
@@ -4452,7 +4675,7 @@
generate_session_keys
. Further this RFC proposes to change the return value of the generate_session_keys
function also to not only return the public session keys, but also the proof of ownership for the private session keys. The
validator operator will then need to send the public session keys and the proof together when registering new session keys on chain.
-When submitting the new public session keys to the on chain logic there doesn't exist any verification of possession of the private session keys. This means that users can basically register any kind of public session keys on chain. While the on chain logic ensures that there are no duplicate keys, someone could try to prevent others from registering new session keys by setting them first. While this wouldn't bring @@ -4460,13 +4683,13 @@
After this RFC this kind of attack would not be possible anymore, because the on chain logic can verify that the sending account is in ownership of the private session keys.
-We are first going to explain the proof
format being used:
#![allow(unused)] fn main() { @@ -4500,31 +4723,31 @@
on Polkadot.Explanation already gets the
proof
passed asVec<u8>
. Thisproof
needs to be decoded to the actualProof
type as explained above. Theproof
and the SCALE encodedaccount_id
of the sender are used to verify the ownership of theSessionKeys
. -Drawbacks
+Drawbacks
Validator operators need to pass the their account id when rotating their session keys in a node. This will require updating some high level docs and making users familiar with the slightly changed ergonomics.
-Testing, Security, and Privacy
+Testing, Security, and Privacy
Testing of the new changes only requires passing an appropriate
-owner
for the current testing context. The changes to the proof generation and verification got audited to ensure they are correct.Performance, Ergonomics, and Compatibility
-Performance
+Performance, Ergonomics, and Compatibility
+Performance
The session key generation is an offchain process and thus, doesn't influence the performance of the chain. Verifying the proof is done on chain as part of the transaction logic for setting the session keys. The verification of the proof is a signature verification number of individual session keys times. As setting the session keys is happening quite rarely, it should not influence the overall system performance.
-Ergonomics
+Ergonomics
The interfaces have been optimized to make it as easy as possible to generate the ownership proof.
-Compatibility
+Compatibility
Introduces a new version of the
SessionKeys
runtime api. Thus, nodes should be updated before a runtime is enacted that contains these changes otherwise they will fail to generate session keys. The RPC that exists around this runtime api needs to be updated to support passing the account id and for returning the ownership proof alongside the public session keys.UIs would need to be updated to support the new RPC and the changed on chain logic.
-Prior Art and References
+Prior Art and References
None.
Unresolved Questions
None.
-Future Directions and Related Material
+Future Directions and Related Material
Substrate implementation of the RFC.
Table of Contents
@@ -4562,10 +4785,10 @@Summary +
Summary
The Fellowship Manifesto states that members should receive a monthly allowance on par with gross income in OECD countries. This RFC proposes concrete amounts.
-Motivation
+Motivation
One motivation for the Technical Fellowship is to provide an incentive mechanism that can induct and retain technical talent for the continued progress of the network.
In order for members to uphold their commitment to the network, they should receive support to @@ -4575,12 +4798,12 @@
Motivation
Note: Goals of the Fellowship, expectations for each Dan, and conditions for promotion and demotion are all explained in the Manifesto. This RFC is only to propose concrete values for allowances.
-Stakeholders
+Stakeholders
-
- Fellowship members
- Polkadot Treasury
Explanation
+Explanation
This RFC proposes agreeing on salaries relative to a single level, the III Dan. As such, changes to the amount or asset used would only be on a single value, and all others would adjust relatively. A III Dan is someone whose contributions match the expectations of a full-time individual contributor. @@ -4640,19 +4863,19 @@
Projections
Updates
Updates to these levels, whether relative ratios, the asset used, or the amount, shall be done via RFC.
-Drawbacks
+Drawbacks
By not using DOT for payment, the protocol relies on the stability of other assets and the ability to acquire them. However, the asset of choice can be changed in the future.
-Testing, Security, and Privacy
+Testing, Security, and Privacy
N/A.
-Performance, Ergonomics, and Compatibility
-Performance
+Performance, Ergonomics, and Compatibility
+Performance
N/A
-Ergonomics
+Ergonomics
N/A
-Compatibility
+Compatibility
N/A
-Prior Art and References
+Prior Art and References
- The Polkadot Fellowship Manifesto
@@ -4693,11 +4916,11 @@Summary +
Summary
When two peers connect to each other, they open (amongst other things) a so-called "notifications protocol" substream dedicated to gossiping transactions to each other.
Each notification on this substream currently consists in a SCALE-encoded
Vec<Transaction>
whereTransaction
is defined in the runtime.This RFC proposes to modify the format of the notification to become
-(Compact(1), Transaction)
. This maintains backwards compatibility, as this new format decodes as aVec
of length equal to 1.Motivation
+Motivation
There exists three motivations behind this change:
-
- @@ -4710,9 +4933,9 @@
MotivationIt makes the implementation way more straight-forward by not having to repeat code related to back-pressure. See explanations below.
Stakeholders
+Stakeholders
Low-level developers.
-Explanation
+Explanation
To give an example, if you send one notification with three transactions, the bytes that are sent on the wire are:
concat( leb128(total-size-in-bytes-of-the-rest), @@ -4732,23 +4955,23 @@
Explanation This is equivalent to forcing the
Vec<Transaction>
to always have a length of 1, and I expect the Substrate implementation to simply modify the sending side to add afor
loop that sends one notification per item in theVec
.As explained in the motivation section, this allows extracting
scale(transaction)
items without having to know how to decode them.By "flattening" the two-steps hierarchy, an implementation only needs to back-pressure individual notifications rather than back-pressure notifications and transactions within notifications.
-Drawbacks
+Drawbacks
This RFC chooses to maintain backwards compatibility at the cost of introducing a very small wart (the
Compact(1)
).An alternative could be to introduce a new version of the transactions notifications protocol that sends one
-Transaction
per notification, but this is significantly more complicated to implement and can always be done later in case theCompact(1)
is bothersome.Testing, Security, and Privacy
+Testing, Security, and Privacy
Irrelevant.
-Performance, Ergonomics, and Compatibility
-Performance
+Performance, Ergonomics, and Compatibility
+Performance
Irrelevant.
-Ergonomics
+Ergonomics
Irrelevant.
-Compatibility
+Compatibility
The change is backwards compatible if done in two steps: modify the sender to always send one transaction per notification, then, after a while, modify the receiver to enforce the new format.
-Prior Art and References
+Prior Art and References
Irrelevant.
Unresolved Questions
None.
-Future Directions and Related Material
+Future Directions and Related Material
None. This is a simple isolated change.
Table of Contents
@@ -4788,20 +5011,20 @@Summary +
Summary
This RFC proposes to make the mechanism of RFC #8 more generic by introducing the concept of "capabilities".
Implementations can implement certain "capabilities", such as serving old block headers or being a parachain bootnode.
The discovery mechanism of RFC #8 is extended to be able to discover nodes of specific capabilities.
-Motivation
+Motivation
The Polkadot peer-to-peer network is made of nodes. Not all these nodes are equal. Some nodes store only the headers of recent blocks, some nodes store all the block headers and bodies since the genesis, some nodes store the storage of all blocks since the genesis, and so on.
It is currently not possible to know ahead of time (without connecting to it and asking) which nodes have which data available, and it is not easily possible to build a list of nodes that have a specific piece of data available.
If you want to download for example the header of block 500, you have to connect to a randomly-chosen node, ask it for block 500, and if it says that it doesn't have the block, disconnect and try another randomly-chosen node. In certain situations such as downloading the storage of old blocks, nodes that have the information are relatively rare, and finding through trial and error a node that has the data can take a long time.
This RFC attempts to solve this problem by giving the possibility to build a list of nodes that are capable of serving specific data.
-Stakeholders
+Stakeholders
Low-level client developers. People interested in accessing the archive of the chain.
-Explanation
+Explanation
Reading RFC #8 first might help with comprehension, as this RFC is very similar.
Please keep in mind while reading that everything below applies for both relay chains and parachains, except mentioned otherwise.
Capabilities
@@ -4837,30 +5060,30 @@Drawbacks +
Drawbacks
None that I can see.
-Testing, Security, and Privacy
+Testing, Security, and Privacy
The content of this section is basically the same as the one in RFC 8.
This mechanism doesn't add or remove any security by itself, as it relies on existing mechanisms.
Due to the way Kademlia works, it would become the responsibility of the 20 Polkadot nodes whose
sha256(peer_id)
is closest to thekey
(described in the explanations section) to store the list of nodes that have specific capabilities. Furthermore, when a large number of providers are registered, only the providers closest to thekey
are kept, up to a certain implementation-defined limit.For this reason, an attacker can abuse this mechanism by randomly generating libp2p PeerIds until they find the 20 entries closest to the
key
representing the target capability. They are then in control of the list of nodes with that capability. While doing this can in no way be actually harmful, it could lead to eclipse attacks.Because the key changes periodically and isn't predictable, and assuming that the Polkadot DHT is sufficiently large, it is not realistic for an attack like this to be maintained in the long term.
-Performance, Ergonomics, and Compatibility
-Performance
+Performance, Ergonomics, and Compatibility
+Performance
The DHT mechanism generally has a low overhead, especially given that publishing providers is done only every 24 hours.
Doing a Kademlia iterative query then sending a provider record shouldn't take more than around 50 kiB in total of bandwidth for the parachain bootnode.
Assuming 1000 nodes with a specific capability, the 20 Polkadot full nodes corresponding to that capability will each receive a sudden spike of a few megabytes of networking traffic when the
key
rotates. Again, this is relatively negligible. If this becomes a problem, one can add a random delay before a node registers itself to be the provider of thekey
corresponding toBabeApi_next_epoch
.Maybe the biggest uncertainty is the traffic that the 20 Polkadot full nodes will receive from light clients that desire knowing the nodes with a capability. If this every becomes a problem, this value of 20 is an arbitrary constant that can be increased for more redundancy.
-Ergonomics
+Ergonomics
Irrelevant.
-Compatibility
+Compatibility
Irrelevant.
-Prior Art and References
+Prior Art and References
Unknown.
Unresolved Questions
While it fundamentally doesn't change much to this RFC, using
-BabeApi_currentEpoch
andBabeApi_nextEpoch
might be inappropriate. I'm not familiar enough with good practices within the runtime to have an opinion here. Should it be an entirely new pallet?Future Directions and Related Material
+Future Directions and Related Material
This RFC would make it possible to reliably discover archive nodes, which would make it possible to reliably send archive node requests, something that isn't currently possible. This could solve the problem of finding archive RPC node providers by migrating archive-related request to using the native peer-to-peer protocol rather than JSON-RPC.
If we ever decide to break backwards compatibility, we could divide the "history" and "archive" capabilities in two, between nodes capable of serving older blocks and nodes capable of serving newer blocks. We could even add to the peer-to-peer network nodes that are only capable of serving older blocks (by reading from a database) but do not participate in the head of the chain, and that just exist for historical purposes.
@@ -4909,12 +5132,12 @@Summary +
Summary
To interact with chains in the Polkadot ecosystem it is required to know how transactions are encoded and how to read state. For doing this, Polkadot-SDK, the framework used by most of the chains in the Polkadot ecosystem, exposes metadata about the runtime to the outside. UIs, wallets, and others can use this metadata to interact with these chains. This makes the metadata a crucial piece of the transaction encoding as users are relying on the interacting software to encode the transactions in the correct format.
It gets even more important when the user signs the transaction in an offline wallet, as the device by its nature cannot get access to the metadata without relying on the online wallet to provide it. This makes it so that the offline wallet needs to trust an online party, deeming the security assumptions of the offline devices, mute.
This RFC proposes a way for offline wallets to leverage metadata, within the constraints of these. The design idea is that the metadata is chunked and these chunks are put into a merkle tree. The root hash of this merkle tree represents the metadata. The offline wallets can use the root hash to decode transactions by getting proofs for the individual chunks of the metadata. This root hash is also included in the signed data of the transaction (but not sent as part of the transaction). The runtime is then including its known metadata root hash when verifying the transaction. If the metadata root hash known by the runtime differs from the one that the offline wallet used, it very likely means that the online wallet provided some fake data and the verification of the transaction fails.
Users depend on offline wallets to correctly display decoded transactions before signing. With merkleized metadata, they can be assured of the transaction's legitimacy, as incorrect transactions will be rejected by the runtime.
-Motivation
+Motivation
Polkadot's innovative design (both relay chain and parachains) present the ability to developers to upgrade their network as frequently as they need. These systems manage to have integrations working after the upgrades with the help of FRAME Metadata. This Metadata, which is in the order of half a MiB for most Polkadot-SDK chains, completely describes chain interfaces and properties. Securing this metadata is key for users to be able to interact with the Polkadot-SDK chain in the expected way.
On the other hand, offline wallets provide a secure way for Blockchain users to hold their own keys (some do a better job than others). These devices seldomly get upgraded, usually account for one particular network and hold very small internal memories. Currently in the Polkadot ecosystem there is no secure way of having these offline devices know the latest Metadata of the Polkadot-SDK chain they are interacting with. This results in a plethora of similar yet slightly different offline wallets for all different Polkadot-SDK chains, as well as the impediment of keeping these regularly updated, thus not fully leveraging Polkadot-SDK’s unique forkless upgrade feature.
The two main reasons why this is not possible today are:
@@ -4941,14 +5164,14 @@Red
- Chunks handling mechanism SHOULD support chunks being sent in any order without memory utilization overhead;
- Unused enum variants MUST be stripped (this has great impact on transmitted metadata size; examples: era enum, enum with all calls for call batching).
-Stakeholders
+Stakeholders
- Runtime implementors
- UI/wallet implementors
- Offline wallet implementors
The idea for this RFC was brought up by runtime implementors and was extensively discussed with offline wallet implementors. It was designed in such a way that it can work easily with the existing offline wallet solutions in the Polkadot ecosystem.
-Explanation
+Explanation
The FRAME metadata provides a wide range of information about a FRAME based runtime. It contains information about the pallets, the calls per pallet, the storage entries per pallet, runtime APIs, and type information about most of the types that are used in the runtime. For decoding extrinsics on an offline wallet, what is mainly required is type information. Most of the other information in the FRAME metadata is actually not required for decoding extrinsics and thus it can be removed. Therefore, the following is a proposal on a custom representation of the metadata and how this custom metadata is chunked, ensuring that only the needed chunks required for decoding a particular extrinsic are sent to the offline wallet. The necessary information to transform the FRAME metadata type information into the type information presented in this RFC will be provided. However, not every single detail on how to convert from FRAME metadata into the RFC type information is described.
First, the
MetadataDigest
is introduced. After that,ExtrinsicMetadata
is covered and finally the actual format of the type information. Then pruning of unrelated type information is covered and how to generate theTypeRef
s. In the latest step, merkle tree calculation is explained.Metadata digest
@@ -5219,23 +5442,23 @@Drawbacks +
Drawbacks
The chunking may not be the optimal case for every kind of offline wallet.
-Testing, Security, and Privacy
+Testing, Security, and Privacy
All implementations are required to strictly follow the RFC to generate the metadata hash. This includes which hash function to use and how to construct the metadata types tree. So, all implementations are following the same security criteria. As the chains will calculate the metadata hash at compile time, the build process needs to be trusted. However, this is already a solved problem in the Polkadot ecosystem by using reproducible builds. So, anyone can rebuild a chain runtime to ensure that a proposal is actually containing the changes as advertised.
Implementations can also be tested easily against each other by taking some metadata and ensuring that they all come to the same metadata hash.
Privacy of users should also not be impacted. This assumes that wallets will generate the metadata hash locally and don't leak any information to third party services about which chunks a user will send to their offline wallet. Besides that, there is no leak of private information as getting the raw metadata from the chain is an operation that is done by almost everyone.
-Performance, Ergonomics, and Compatibility
-Performance
+Performance, Ergonomics, and Compatibility
+Performance
There should be no measurable impact on performance to Polkadot or any other chain using this feature. The metadata root hash is calculated at compile time and at runtime it is optionally used when checking the signature of a transaction. This means that at runtime no performance heavy operations are done.
Ergonomics & Compatibility
The proposal alters the way a transaction is built, signed, and verified. So, this imposes some required changes to any kind of developer who wants to construct transactions for Polkadot or any chain using this feature. As the developer can pass
-0
for disabling the verification of the metadata root hash, it can be easily ignored.Prior Art and References
+Prior Art and References
RFC 46 produced by the Alzymologist team is a previous work reference that goes in this direction as well.
On other ecosystems, there are other solutions to the problem of trusted signing. Cosmos for example has a standardized way of transforming a transaction into some textual representation and this textual representation is included in the signed data. Basically achieving the same as what the RFC proposes, but it requires that for every transaction applied in a block, every node in the network always has to generate this textual representation to ensure the transaction signature is valid.
Unresolved Questions
None.
-Future Directions and Related Material
+Future Directions and Related Material
- Does it work with all kind of offline wallets?
- Generic types currently appear multiple times in the metadata with each instantiation. It could be may be useful to have generic type only once in the metadata and declare the generic parameters at their instantiation.
@@ -5273,20 +5496,20 @@
Authors George Pisaltu -Summary
+Summary
This RFC proposes a change to the extrinsic format to incorporate a new transaction type, the "general" transaction.
-Motivation
+Motivation
"General" transactions, a new type of transaction that this RFC aims to support, are transactions which obey the runtime's extensions and have according extension data yet do not have hard-coded signatures. They are first described in Extrinsic Horizon and supported in 3685. They enable users to authorize origins in new, more flexible ways (e.g. ZK proofs, mutations over pre-authenticated origins). As of now, all transactions are limited to the account signing model for origin authorization and any additional origin changes happen in extrinsic logic, which cannot leverage the validation process of extensions.
An example of a use case for such an extension would be sponsoring the transaction fee for some other user. A new extension would be put in place to verify that a part of the initial payload was signed by the author under who the extrinsic should run and change the origin, but the payment for the whole transaction should be handled under a sponsor's account. A POC for this can be found in 3712.
The new "general" transaction type would coexist with both current transaction types for a while and, therefore, the current number of supported transaction types, capped at 2, is insufficient. A new extrinsic type must be introduced alongside the current signed and unsigned types. Currently, an encoded extrinsic's first byte indicate the type of extrinsic using the most significant bit -
0
for unsigned,1
for signed - and the 7 following bits indicate the extrinsic format version, which has been equal to4
for a long time.By taking one bit from the extrinsic format version encoding, we can support 2 additional extrinsic types while also having a minimal impact on our capability to extend and change the extrinsic format in the future.
-Stakeholders
+Stakeholders
-
- Runtime users
- Runtime devs
- Wallet devs
Explanation
+Explanation
An extrinsic is currently encoded as one byte to identify the extrinsic type and version. This RFC aims to change the interpretation of this byte regarding the reserved bits for the extrinsic type and version. In the following explanation, bits represented using
T
make up the extrinsic type and bits represented usingV
make up the extrinsic version.Currently, the bit allocation within the leading encoded byte is
0bTVVV_VVVV
. In practice in the Polkadot ecosystem, the leading byte would be0bT000_0100
as the version has been equal to4
for a long time.This RFC proposes for the bit allocation to change to
@@ -5297,23 +5520,23 @@0bTTVV_VVVV
. As a result, the extrinsic format version will be bumped to5
and the extrinsic type bit representation would change as follows:Explanation
- 11 reserved Drawbacks
+Drawbacks
This change would reduce the maximum possible transaction version from the current
-127
to63
. In order to bypass the new, lower limit, the extrinsic format would have to change again.Testing, Security, and Privacy
+Testing, Security, and Privacy
There is no impact on testing, security or privacy.
-Performance, Ergonomics, and Compatibility
+Performance, Ergonomics, and Compatibility
This change would allow Polkadot to support new types of transactions, with the specific "general" transaction type in mind at the time of writing this proposal.
-Performance
+Performance
There is no performance impact.
-Ergonomics
+Ergonomics
The impact to developers and end-users is minimal as it would just be a bitmask update on their part for parsing the extrinsic type along with the version.
-Compatibility
+Compatibility
This change breaks backwards compatiblity because any transaction that is neither signed nor unsigned, but a new transaction type, would be interpreted as having a future extrinsic format version.
-Prior Art and References
+Prior Art and References
The original design was originally proposed in the
TransactionExtension
PR, which is also the motivation behind this effort.Unresolved Questions
None.
-Future Directions and Related Material
+Future Directions and Related Material
Following this change, the "general" transaction type will be introduced as part of the Extrinsic Horizon effort, which will shape future work.
Table of Contents
@@ -5346,16 +5569,16 @@
Authors Alex Gheorghe (alexggh) -Summary
+Summary
Extend the DHT authority discovery records with a signed creation time, so that nodes can determine which record is newer and always decide to prefer the newer records to the old ones.
-Motivation
+Motivation
Currently, we use the Kademlia DHT for storing records regarding the p2p address of an authority discovery key, the problem is that if the nodes decide to change its PeerId/Network key it will publish a new record, however because of the distributed and replicated nature of the DHT there is no way to tell which record is newer so both old PeerId and the new PeerId will live in the network until the old one expires(36h), that creates all sort of problem and leads to the node changing its address not being properly connected for up to 36h.
After this RFC, nodes are extended to decide to keep the new record and propagate the new record to nodes that have the old record stored, so in the end all the nodes will converge faster to the new record(in the order of minutes, not 36h)
Implementation of the rfc: https://github.com/paritytech/polkadot-sdk/pull/3786.
Current issue without this enhacement: https://github.com/paritytech/polkadot-sdk/issues/3673
-Stakeholders
+Stakeholders
Polkadot node developers.
-Explanation
+Explanation
This RFC heavily relies on the functionalities of the Kademlia DHT already in use by Polkadot. You can find a link to the specification here.
In a nutshell, on a specific node the current authority-discovery protocol publishes Kademila DHT records at startup and periodically. The records contain the full address of the node for each authorithy key it owns. The node tries also to find the full address of all authorities in the network by querying the DHT and picking up the first record it finds for each of the authority id it found on chain.
@@ -5388,24 +5611,24 @@Explanation
Each time a node wants to resolve an authorithy ID it will issue a query with a certain redundancy factor, and from all the results it receives it will decide to pick only the newest record. Additionally, in order to speed up the time until all nodes have the newest record, nodes can optionaly implement a logic where they send the new record to nodes that answered with the older record.
-Drawbacks
+Drawbacks
In theory the new protocol creates a bit more traffic on the DHT network, because it waits for DHT records to be received from more than one node, while in the current implementation we just take the first record that we receive and cancel all in-flight requests to other peers. However, because the redundancy factor will be relatively small and this operation happens rarerly, every 10min, this cost is negligible.
-Testing, Security, and Privacy
+Testing, Security, and Privacy
This RFC's implementation https://github.com/paritytech/polkadot-sdk/pull/3786 had been tested on various local test networks and versi.
With regard to security the creation time is wrapped inside SignedAuthorityRecord wo it will be signed with the authority id key, so there is no way for other malicious nodes to manipulate this field without the received node observing.
-Performance, Ergonomics, and Compatibility
+Performance, Ergonomics, and Compatibility
Irrelevant.
-Performance
+Performance
Irrelevant.
-Ergonomics
+Ergonomics
Irrelevant.
-Compatibility
+Compatibility
The changes are backwards compatible with the existing protocol, so nodes with both the old protocol and newer protocol can exist in the network, this is achieved by the fact that we use protobuf for serializing and deserializing the records, so new fields will be ignore when deserializing with the older protocol and vice-versa when deserializing an old record with the new protocol the new field will be
-None
and the new code accepts this record as being valid.Prior Art and References
+Prior Art and References
The enhancements have been inspired by the algorithm specified in here
Unresolved Questions
N/A
-Future Directions and Related Material
+Future Directions and Related Material
N/A
Table of Contents
@@ -5451,23 +5674,23 @@Summary +
Summary
This RFC proposes a flexible unbonding mechanism for tokens that are locked from staking on the Relay Chain (DOT/KSM), aiming to enhance user convenience without compromising system security.
Locking tokens for staking ensures that Polkadot is able to slash tokens backing misbehaving validators. With changing the locking period, we still need to make sure that Polkadot can slash enough tokens to deter misbehaviour. This means that not all tokens can be unbonded immediately, however we can still allow some tokens to be unbonded quickly.
The new mechanism leads to a signficantly reduced unbonding time on average, by queuing up new unbonding requests and scaling their unbonding duration relative to the size of the queue. New requests are executed with a minimum of 2 days, when the queue is comparatively empty, to the conventional 28 days, if the sum of requests (in terms of stake) exceed some threshold. In scenarios between these two bounds, the unbonding duration scales proportionately. The new mechanism will never be worse than the current fixed 28 days.
In this document we also present an empirical analysis by retrospectively fitting the proposed mechanism to the historic unbonding timeline and show that the average unbonding duration would drastically reduce, while still being sensitive to large unbonding events. Additionally, we discuss implications for UI, UX, and conviction voting.
Note: Our proposition solely focuses on the locks imposed from staking. Other locks, such as governance, remain unchanged. Also, this mechanism should not be confused with the already existing feature of FastUnstake, which lets users unstake tokens immediately that have not received rewards for 28 days or longer.
As an initial step to gauge its effectiveness and stability, it is recommended to implement and test this model on Kusama before considering its integration into Polkadot, with appropriate adjustments to the parameters. In the following, however, we limit our discussion to Polkadot.
-Motivation
+Motivation
Polkadot has one of the longest unbonding periods among all Proof-of-Stake protocols, because security is the most important goal. Staking on Polkadot is still attractive compared to other protocols because of its above-average staking APY. However the long unbonding period harms usability and deters potential participants that want to contribute to the security of the network.
The current length of the unbonding period imposes significant costs for any entity that even wants to perform basic tasks such as a reorganization / consolidation of their stashes, or updating their private key infrastructure. It also limits participation of users that have a large preference for liquidity.
The combination of long unbonding periods and high returns has lead to the proliferation of liquid staking, where parachains or centralised exchanges offer users their staked tokens before the 28 days unbonding period is over either in original DOT/KSM form or derivative tokens. Liquid staking is harmless if few tokens are involved but it could result in many validators being selected by a few entities if a large fraction of DOTs were involved. This may lead to centralization (see here for more discussion on threats of liquid staking) and an opportunity for attacks.
The new mechanism greatly increases the competitiveness of Polkadot, while maintaining sufficient security.
-Stakeholders
+Stakeholders
-
- Every DOT/KSM token holder
Explanation
+Explanation
Before diving into the details of how to implement the unbonding queue, we give readers context about why Polkadot has a 28-day unbonding period in the first place. The reason for it is to prevent long-range attacks (LRA) that becomes theoretically possible if more than 1/3 of validators collude. In essence, a LRA describes the inability of users, who disconnect from the consensus at time t0 and reconnects later, to realize that validators which were legitimate at a certain time, say t0 but dropped out in the meantime, are not to be trusted anymore. That means, for example, a user syncing the state could be fooled by trusting validators that fell outside the active set of validators after t0, and are building a competitive and malicious chain (fork).
LRAs of longer than 28 days are mitigated by the use of trusted checkpoints, which are assumed to be no more than 28 days old. A new node that syncs Polkadot will start at the checkpoint and look for proofs of finality of later blocks, signed by 2/3 of the validators. In an LRA fork, some of the validator sets may be different but only if 2/3 of some validator set in the last 28 days signed something incorrect.
If we detect an LRA of no more than 28 days with the current unbonding period, then we should be able to detect misbehaviour from over 1/3 of validators whose nominators are still bonded. The stake backing these validators is considerable fraction of the total stake (empirically it is 0.287 or so). If we allowed more than this stake to unbond, without checking who it was backing, then the LRA attack might be free of cost for an attacker. The proposed mechansim allows up to half this stake to unbond within 28 days. This halves the amount of tokens that can be slashed, but this is still very high in absolute terms. For example, at the time of writing (19.06.2024) this would translate to around 120 millions DOTs.
@@ -5525,23 +5748,23 @@Convictio
Potential Extension
In addition to a simple queue, we could add a market component that lets users always unbond from staking at the minimum possible waiting time)(==
LOWER_BOUND
, e.g., 2 days), by paying a variable fee. To achieve this, it is reasonable to split the total unbonding capacity into two chunks, with the first capacity for the simple queue and the remaining capacity for the fee-based unbonding. By doing so, we allow users to choose whether they want the quickest unbond and paying a dynamic fee or join the simple queue. Setting a capacity restriction for both queues enables us to guarantee a predictable unbonding time in the simple queue, while allowing users with the respective willingness to pay to get out even earlier. The fees are dynamically adjusted and are proportional to the unbonding stake (and thereby expressed in a percentage of the requested unbonding stake). In contrast to a unified queue, this prevents the issue that users paying a fee jump in front of other users not paying a fee, pushing their unbonding time back (which would be bad for UX). The revenue generated could be burned.This extension and further specifications are left out of this RFC, because it adds further complexity and the empirical analysis above suggests that average unbonding times will already be close the
-LOWER_BOUND
, making a more complex design unnecessary. We advise to first implement the discussed mechanism and assess after some experience whether an extension is desirable.Drawbacks
+Drawbacks
-
- Lower security for LRAs: Without a doubt, the theoretical security against LRAs decreases. But, as we argue, the attack is still costly enough to deter attacks and the attack is sufficiently theoretical. Here, the benefits outweigh the costs.
- Griefing attacks: A large holder could pretend to unbond a large amount of their tokens to prevent other users to exit the network earlier. This would, however be costly due to the fact that the holder loses out on staking rewards. The larger the impact on the queue, the higher the costs. In any case it must be noted that the
UPPER_BOUND
is still 28 days, which means that nominators are never left with a longer unbonding period than currently. There is not enough gain for the attacker to endure this cost.- Challenge for Custodians and Liquid Staking Providers: Changing the unbonding time, especially making it flexible, requires entities that offer staking derivatives to rethink and rework their products.
Testing, Security, and Privacy
+Testing, Security, and Privacy
NA
-Performance, Ergonomics, and Compatibility
+Performance, Ergonomics, and Compatibility
NA
-Performance
+Performance
The authors cannot see any potential impact on performance.
-Ergonomics
+Ergonomics
The authors cannot see any potential impact on ergonomics for developers. We discussed potential impact on UX/UI for users above.
-Compatibility
+Compatibility
The authors cannot see any potential impact on compatibility. This should be assessed by the technical fellows.
-Prior Art and References
+Prior Art and References
- Ethereum proposed a similar solution
- Alistair did some initial write-up
@@ -5578,20 +5801,20 @@
Authors Bastian Köcher -Summary
+Summary
This RFC proposes a change to the extrinsic format to include a transaction extension version.
-Motivation
+Motivation
The extrinsic format supports to be extended with transaction extensions. These transaction extensions are runtime specific and can be different per chain. Each transaction extension can add data to the extrinsic itself or extend the signed payload. This means that adding a transaction extension is breaking the chain specific extrinsic format. A recent example was the introduction of the
-CheckMetadatHash
to Polkadot and all its system chains. As the extension was adding one byte to the extrinsic, it broke a lot of tooling. By introducing an extra version for the transaction extensions it will be possible to introduce changes to these transaction extensions while still being backwards compatible. Based on the version of the transaction extensions, each chain runtime could decode the extrinsic correctly and also create the correct signed payload.Stakeholders
+Stakeholders
-
- Runtime users
- Runtime devs
- Wallet devs
Explanation
+Explanation
RFC84 introduced the extrinsic format
5
. The idea is to piggyback onto this change of the extrinsic format to add the extra version for the transaction extensions. If required, this could also come as extrinsic format6
, but5
is not yet deployed anywhere.The extrinsic format supports the following types of transactions:
@@ -5607,25 +5830,25 @@Explanation
The
Version
being a SCALE encodedu8
representing the version of the transaction extensions.In the chain runtime the version can be used to determine which set of transaction extensions should be used to decode and to validate the transaction.
-Drawbacks
+Drawbacks
This adds one byte more to each signed transaction.
-Testing, Security, and Privacy
+Testing, Security, and Privacy
There is no impact on testing, security or privacy.
-Performance, Ergonomics, and Compatibility
+Performance, Ergonomics, and Compatibility
This will ensure that changes to the transactions extensions can be done in a backwards compatible way.
-Performance
+Performance
There is no performance impact.
-Ergonomics
+Ergonomics
Runtime developers need to take care of the versioning and ensure to bump as required, so that there are no compatibility breaking changes without a bump of the version. It will also add a little bit more code in the runtime to decode these old versions, but this should be neglectable.
-Compatibility
+Compatibility
When introduced together with extrinsic format version
-5
from RFC84, it can be implemented in a backwards compatible way. So, transactions can still be send using the old extrinsic format and decoded by the runtime.Prior Art and References
+Prior Art and References
None.
Unresolved Questions
None.
-Future Directions and Related Material
+Future Directions and Related Material
None.
Table of Contents
@@ -5662,14 +5885,14 @@
Authors Adrian Catangiu -Summary
+Summary
This RFC proposes a new instruction that provides a way to initiate on remote chains, asset transfers which transfer multiple types (teleports, local-reserve, destination-reserve) of assets, using XCM alone.
The currently existing instructions are too opinionated and force each XCM asset transfer to a single transfer type (teleport, local-reserve, destination-reserve). This results in inability to combine different types of transfers in single transfer which results in overall poor UX when trying to move assets across chains.
-Motivation
+Motivation
XCM is the de-facto cross-chain messaging protocol within the Polkadot ecosystem, and cross-chain assets transfers is one of its main use-cases. Unfortunately, in its current spec, it does not support initiating on a remote chain, one or more transfers that combine assets with different transfer types.
@@ -5691,14 +5914,14 @@MotivationParaP
With current XCM, we are limited to doing multiple independent transfers for each individual hop in order to move both "interesting" assets, but also "supporting" assets (used to pay fees).
-Stakeholders
+Stakeholders
A new instruction InitiateAssetsTransfer
is introduced that initiates an assets transfer from the
chain it is executed on, to another chain. The executed transfer is point-to-point (chain-to-chain)
with all of the transfer properties specified in the instruction parameters. The instruction also
@@ -5886,9 +6109,9 @@
No drawbacks identified.
-There should be no security risks related to the new instruction from the XCVM perspective. It follows the same pattern as with single-type asset transfers, only now it allows combining multiple types at once.
Improves security by enabling @@ -5897,16 +6120,16 @@
This brings no impact to the rest of the XCM spec. It is a new, independent instruction, no changes to existing instructions.
Enhances the exposed functionality of Polkadot. Will allow multi-chain transfers that are currently forced to happen in multiple programs per asset per "hop", to be possible in a single XCM program.
-No performance changes/implications.
-The proposal enhances developers' and users' cross-chain asset transfer capabilities. This enhancement is optimized for XCM programs transferring multiple assets, needing to run their logic across multiple chains.
-Does this proposal break compatibility with existing interfaces, older versions of implementations? Summarize necessary migrations or upgrade strategies, if any.
This enhancement is compatible with all existing XCM programs and versions.
@@ -5915,11 +6138,11 @@None.
None.
-None.
Table of Contents
@@ -5952,10 +6175,10 @@The Transact
XCM instruction currently forces the user to set a specific maximum weight allowed to the inner call and then also pay for that much weight regardless of how much the call actually needs in practice.
This RFC proposes improving the usability of Transact
by removing that parameter and instead get and charge the actual weight of the inner call from its dispatch info on the remote chain.
The UX of using Transact
is poor because of having to guess/estimate the require_weight_at_most
weight used by the inner call on the target.
We've seen multiple Transact
on-chain failures caused by guessing wrong values for this require_weight_at_most
even though the rest of the XCM program would have worked.
In practice, this parameter only adds UX overhead with no real practical value. Use cases fall in one of two categories:
@@ -5968,40 +6191,40 @@root/whitelisted_caller
proposals initiated by core-devs completely or partially fail
because of incorrect configuration of require_weight_at_most
parameter. This is a strong indication that the
instruction is hard to use.
-The proposed enhancement is simple: remove require_weight_at_most
parameter from the instruction:
- Transact { origin_kind: OriginKind, require_weight_at_most: Weight, call: DoubleEncoded<Call> },
+ Transact { origin_kind: OriginKind, call: DoubleEncoded<Call> },
The XCVM implementation shall no longer use require_weight_at_most
for weighing. Instead, it shall weigh the Transact instruction by decoding and weighing the inner call
.
No drawbacks, existing scenarios work as before, while this also allows new/easier flows.
-Currently, an XCVM implementation can weigh a message just by looking at the decoded instructions without decoding the Transact's call, but assuming require_weight_at_most
weight for it. With the new version it has to decode the inner call to know its actual weight.
But this does not actually change the security considerations, as can be seen below.
With the new Transact
the weighing happens after decoding the inner call
. The entirety of the XCM program containing this Transact
needs to be either covered by enough bought weight using a BuyExecution
, or the origin has to be allowed to do free execution.
The security considerations around how much can someone execute for free are the same for
both this new version and the old. In both cases, an "attacker" can do the XCM decoding (including Transact inner call
s) for free by adding a large enough BuyExecution
without actually having the funds available.
In both cases, decoding is done for free, but in both cases execution fails early on BuyExecution
.
No performance change.
-Ergonomics are slightly improved by simplifying Transact
API.
Compatible with previous XCM programs.
-None.
None.
-None.
Table of Contents
@@ -6045,13 +6268,13 @@Elastic scaling is not resilient against griefing attacks without a way for a PoV (Proof of Validity)
to commit to the particular core index it was intended for. This RFC proposes a way to include
core index information in the candidate commitments and the CandidateDescriptor
data structure
in a backward compatible way. Additionally, it proposes the addition of a SessionIndex
field in
the CandidateDescriptor
to make dispute resolution more secure and robust.
This RFC proposes a way to solve two different problems:
This approach and alternatives have been considered and discussed in this issue.
-The approach proposed below was chosen primarily because it minimizes the number of breaking changes, the complexity and takes less implementation and testing time. The proposal is to change the existing primitives while keeping binary compatibility with the older versions. We repurpose @@ -6219,28 +6442,28 @@
0
. The runtime needs to be changed to store
a claim queue snapshot at all allowed relay parents.
-The only drawback is that further additions to the descriptor are limited to the amount of remaining unused space.
-Standard testing (unit tests, CI zombienet tests) for functionality and mandatory security audit to ensure the implementation does not introduce any new security issues.
Backward compatibility of the implementation will be tested on testnets (Versi and Westend).
There is no impact on privacy.
-Overall performance will be improved by not checking the collator signatures in runtime and nodes. The impact on the UMP queue and candidate receipt processing is negligible.
The ClaimQueueOffset
along with the relay parent choice allows parachains to optimize their
block production for either throughput or lower XCM message processing latency. A value of 0
with the newest relay parent provides the best latency while picking older relay parents avoids
re-orgs.
It is mandatory for elastic parachains to switch to the new receipt format and commit to a
core by sending the UMPSignal::SelectCore
message. It is optional but desired that all
parachains switch to the new receipts for providing the session index for disputes.
The implementation of this RFC itself must not introduce any breaking changes for the parachain runtime or collator nodes.
-The proposed changes are not fully backward compatible, because older validators verify the collator signature of candidate descriptors.
Additional care must be taken before enabling the new descriptors by waiting for at least @@ -6265,12 +6488,12 @@
Any tooling that decodes UMP XCM messages needs an update to support or ignore the new UMP messages, but they should be fine to decode the regular XCM messages that come before the separator.
-Forum discussion about a new CandidateReceipt
format:
https://forum.polkadot.network/t/pre-rfc-discussion-candidate-receipt-format-v2/3738
N/A
-The implementation is extensible and future-proof to some extent. With minimal or no breaking changes, additional fields can be added in the candidate descriptor until the reserved space is exhausted
@@ -6312,7 +6535,7 @@XCM already handles execution fees in an effective and efficient manner using the BuyExecution
instruction.
However, other types of fees are not handled as effectively -- for example, delivery fees.
Fees exist that can't be measured using Weight
-- as execution fees can -- so a new method should be thought up for those cases.
@@ -6321,7 +6544,7 @@
fees
registerBuyExecution
and adding a new instruction PayFees
with new semantics to ultimately replace it.Execution fees are handled correctly by XCM right now. However, the addition of extra fees, like for message delivery, result in awkward ways of integrating them into the XCVM implementation. This is because these types of fees are not included in the language. @@ -6329,14 +6552,14 @@
The new instruction that will replace BuyExecution
is a much simpler and general version: PayFees
.
This instruction takes one Asset
, takes it from the holding register, and puts it into a new fees
register.
The XCVM implementation can now use this Asset
to make sure every necessary fee is paid for, this includes execution fees, delivery fees, and any other type of fee
@@ -6367,27 +6590,27 @@
There needs to be an explicit change from BuyExecution
to PayFees
, most often accompanied by a reduction in the assets passed in.
It might become a security concern if leftover fees are trapped, since a lot of them are expected.
-There should be no performance downsides to this approach.
The fees
register is a simplification that may actually result in better performance, in the case an implementation is doing a workaround to achieve what this RFC proposes.
The interface is going to be very similar to the already existing one.
Even simpler since PayFees
will only receive one asset.
That asset will allow users to limit the amount of fees they are willing to pay.
This RFC can't just change the semantics of the BuyExecution
instruction since that instruction accepts any funds, uses what it needs and returns the rest immediately.
The new proposed instruction, PayFees
, doesn't return the leftover immediately, it keeps it in the fees
register.
In practice, the deprecated BuyExecution
needs to be slowly rolled out in favour of PayFees
.
The closed RFC PR on the xcm-format repository, before XCM RFCs got moved to fellowship RFCs: https://github.com/polkadot-fellows/xcm-format/pull/53.
None
-This proposal would greatly benefit from an improved asset trapping system.
CustomAssetClaimer is also related, as it directly improves the ergonomics of this proposal.
LeftoverAssetsDestination execution hint would also similarly improve the ergonomics.
@@ -6423,12 +6646,12 @@A previous XCM RFC (https://github.com/polkadot-fellows/xcm-format/pull/37) introduced a SetAssetClaimer
instruction.
This idea of instructing the XCVM to change some implementation-specific behavior is useful.
In order to generalize this mechanism, this RFC introduces a new instruction SetHints
and makes the SetAssetClaimer
be just one of many possible execution hints.
There is a need for specifying how certain implementation-specific things should behave. Things like who can claim the assets or what can be done instead of trapping assets. Another idea for a hint:
@@ -6436,13 +6659,13 @@AssetForFees
: to signify to the executor what asset the user prefers to use for fees.
LeftoverAssetsDestination
: for depositing leftover assets to a destination instead of trapping themA new instruction, SetHints
, will be added.
This instruction will take a single parameter of type Hint
, an enumeration.
The first variant for this enum is AssetClaimer
, which allows to specify a location that should be able to claim trapped assets.
@@ -6463,27 +6686,27 @@
The SetHints
instruction might be hard to benchmark, since we should look into the actual hints being set to know how much weight to attribute to it.
Hint
s are specified on a per-message basis, so they have to be specified at the beginning of a message.
If they were to be specified at the end, hints like AssetClaimer
would be useless if an error occurs beforehand and assets get trapped before ever reaching the hint.
The instruction takes a bounded vector of hints so as to not force barriers to allow an arbitrary number of SetHint
instructions.
None.
-The SetHints
instruction provides a better integration with barriers.
If we had to add one barrier for SetAssetClaimer
and another for each new hint that's added, barriers would need to be changed all the time.
Also, this instruction would make it simpler to write XCM programs.
You only need to specify the hints you want in one single instruction at the top of your program.
None.
-The previous RFC PR in the xcm-format repository before XCM RFCs moved to fellowship RFCs: https://github.com/polkadot-fellows/xcm-format/pull/59.
None.
-None.
Table of Contents
@@ -6516,36 +6739,36 @@This RFC aims to remove the NetworkId
s of Westend
and Rococo
, arguing that testnets shouldn't go in the language.
We've already seen the plans to phase out Rococo and Paseo has appeared.
Instead of constantly changing the testnets included in the language, we should favor specifying them via their genesis hash,
using NetworkId::ByGenesis
.
Remove Westend
and Rococo
from the included NetworkId
s in the language.
This RFC will make it less convenient to specify a testnet, but not by a large amount.
-None.
-None.
-It will very slightly reduce the ergonomics of testnet developers but improve the stability of the language.
-NetworkId::Rococo
and NetworkId::Westend
can just use NetworkId::ByGenesis
, as can other testnets.
A previous attempt to add NetworkId::Paseo
: https://github.com/polkadot-fellows/xcm-format/pull/58.
None.
-None.
Table of Contents
@@ -6584,11 +6807,11 @@XCM programs generated by the InitiateAssetTransfer
instruction shall have the option to carry over the original origin all the way to the final destination. They shall do so by internally making use of AliasOrigin
or ClearOrigin
depending on given parameters.
This allows asset transfers to retain their original origin even across multiple hops.
Ecosystem chains would have to change their trusted aliasing rules to effectively make use of this feature.
-Currently, all XCM asset transfer instructions ultimately clear the origin in the remote XCM message by use of the ClearOrigin
instruction. This is done for security considerations to ensure that subsequent (user-controlled) instructions cannot command the authority of the sending chain.
The problem with this approach is that it limits what can be achieved on remote chains through XCM. Most XCM operations require having an origin, and following any asset transfer the origin is lost, meaning not much can be done other than depositing the transferred assets to some local account or transferring them onward to another chain.
For example, we cannot transfer some funds for buying execution, then do a Transact
(all in the same XCM message).
And we want to be able to do it using a single XCM program.
-Runtime Users, Runtime Devs, wallets, cross-chain dApps.
-In the case of XCM programs going from source-chain
directly to dest-chain
without an intermediary hop, we can enable scenarios such as above by using the AliasOrigin
instruction instead of the ClearOrigin
instruction.
Instead of clearing the source-chain
origin, the destination chain shall attempt to alias source-chain
to "original origin" on the source chain.
Most common such origin aliasing would be X1(Parachain(source-chain))
-> X2(Parachain(source-chain), AccountId32(origin-account))
for the case of a single hop transfer where the initiator is a (signed/pure/proxy) account origin-account
on source-chain
.
@@ -6648,35 +6871,35 @@
In terms of ergonomics and user experience, this support for combining an asset transfer with a subsequent action (like Transact) is a net positive.
In terms of performance, and privacy, this is neutral with no changes.
In terms of security, the feature by itself is also neutral because it allows preserve_origin: false
usage for operating with no extra trust assumptions. When wanting to support preserving origin, chains need to configure secure origin aliasing filters. The one suggested in this RFC should be the right choice for the majority of chains, but each chain will ultimately choose depending on their business model and logic (e.g. chain does not plan to integrate with Asset Hub). It is up to the individual chains to configure accordingly.
Barriers should now allow AliasOrigin
, DescendOrigin
or ClearOrigin
.
Normally, XCM program builders should audit their programs and eliminate assumptions of "no origin" on remote side of this instruction. In this case, the InitiateAssetsTransfer
has not been released yet, it will be part of XCMv5, and we can make this change part of the same XCMv5 so that there isn't even the possibility of someone in the wild having built XCM programs using this instruction on those wrong assumptions.
The working assumption going forward is that the origin on the remote side can either be cleared or it can be the local origin's reanchored location. This assumption is in line with the current behavior of remote XCM programs sent over using pallet_xcm::send
.
The existing DepositReserveAsset
, InitiateReserveWithdraw
and InitiateTeleport
cross chain asset transfer instructions will not attempt to do origin aliasing and will always clear origin same as before for compatibility reasons.
No impact.
-Improves ergonomics by allowing the local origin to operate on the remote chain even when the XCM program includes an asset transfer.
-At the executor-level this change is backwards and forwards compatible. Both types of programs can be executed on new and old versions of XCM with no changes in behavior.
New version of the InitiateAssetsTransfer
instruction acts same as before when used with preserve_origin: false
.
For using the new capabilities, the XCM builder has to verify that the involved chains have the required origin-aliasing filters configured and use some new version of Barriers aware of AliasOrigin
as an allowed alternative to ClearOrigin
.
For compatibility reasons, this RFC proposes this mechanism be added as an enhancement to the yet unreleased InitiateAssetsTransfer
instruction, thus eliminating possibilities of XCM logic breakages in the wild.
Following the same logic, the existing DepositReserveAsset
, InitiateReserveWithdraw
and InitiateTeleport
cross chain asset transfer instructions will not attempt to do origin aliasing and will always clear the origin same as before for compatibility reasons.
Any one of DepositReserveAsset
, InitiateReserveWithdraw
and InitiateTeleport
instructions can be replaced with a InitiateAssetsTransfer
instruction with or without origin aliasing, thus providing a clean and clear upgrade path for opting-in this new feature.
None
-Table of Contents
An off-chain approximation protocol should assign rewards based upon the approvals and availability work done by validators.
All validators track which approval votes they actually use, reporting the aggregate, after which an on-chain median computation gives a good approximation under byzantine assumptions. Approval checkers report aggregate information about which availability chunks they use too, but in availability we need a tit-for-tat game to enforce honesty, because approval committees could often bias results thanks to their small size.
-We want all polkadot subsystems be profitable for validataors, because otherwise operators might profit from running modified code. In particular, almost all rewards in Kusama/Polkadot should come from work done securing parachains, primarily approval checking, but also backing, availability, and support of XCMP.
Among these task, our highest priorities must be approval checks, which ensure soundness, and sending availability chunks to approval checkers. We prove backers must be paid strictly less than approval checkers.
At present though, validators' rewards have relatively little relationship to validators operating costs, in terms of bandwidth and CPU time. Worse, polkadot's scaling makes us particular vulnerable "no-shows" caused by validators skipping their approval checks.
We're particularly concernned about hardware specks impact upon the number of parachain cores. We've requested relatively low spec machines so far, only four physical CPU cores, although some run even lower specs like only two physical CPU cores. Alone, rewards cannot fix our low speced validator problem, but rewards and outreach together should far more impact than either alone.
In future, we'll further increase validator spec requirements, which directly improve polkadot's throughput, and which repeats this dynamic of purging underspeced nodes, except outreach becomes more important because de facto too many slow validators can "out vote" the faster ones
-We alter the validators rewards protocol, but with negligable impact upon rewards for honest validators who comply with hardware and bandwidth recommendations.
We shall still reward participation in relay chain concensus of course, which de facto means block production but not finality, but these current reward levels shall wind up greatly reduced. Any validators who manipulate block rewards now could lose rewards here, simply because of rewards being shifted from block production to availability, but this sounds desirable.
We've discussed roughly this rewards protocol in https://hackmd.io/@rgbPIkIdTwSICPuAq67Jbw/S1fHcvXSF and https://github.com/paritytech/polkadot-sdk/issues/1811 as well as related topics like https://github.com/paritytech/polkadot-sdk/issues/5122
@@ -6816,7 +7039,7 @@We distribute rewards on-chain using approval_usages_medians
and reweighted_total_used_downloads
. Approval checkers could later change from who they download chunks using my_missing_uploads
.
In theory, validators could adopt whatever strategy they like to penalize validators who stiff them on availability redistribution rewards, except they should not stiff back, only choose other availability providers. We discuss one good strategy below, but initially this could go unimplemented.
-Polkadot's efficency creates subtle liveness concerns: Anytime one node cannot perform one of its approval checks then Polkadot loses in expectation 3.25 approval checks, or 0.10833 parablocks. This makes back pressure essential.
We cannot throttle approval checks securely either, so reactive off-chain back pressure only makes sense during or before the backing phase. In other words, if nodes feel overworked themselves, or perhaps beleive others to be, then they should drop backing checks, never approval checks. It follows backing work must be rewarded less well and less reliably than approvals, as otherwise validators could benefit from behavior that harms the network.
@@ -6867,7 +7090,7 @@approval_usages
remain interesting statistics though.
Adversarial validators could manipulates their availability votes though, even without being a supermajority. If they still download honestly, then this costs them more rewards than they earn. We do not prevent validators from preferentially obtaining their pieces from their friends though. We should analyze, or at least observe, the long-term consequences.
A priori, whale nominator's validators could stiff validators but then rotate their validators quickly enough so that they never suffered being skipped back. We discuss several possible solution, and their difficulties, under "Rob's nominator-wise skipping" in https://hackmd.io/@rgbPIkIdTwSICPuAq67Jbw/S1fHcvXSF but overall less seems like more here. Also frequent validator rotation could be penalized elsewhere.
-We operate off-chain except for final rewards votes and median tallies. We expect lower overhead rewards protocols would lack information, thereby admitting easier cheating.
Initially, we designed the ELVES approval gadget to allow on-chain operation, in part for rewards computation, but doing so looks expensive. Also, on-chain rewards computaiton remains only an approximation too, but could even be biased more easily than our off-chain protocol presented here.
@@ -6875,11 +7098,11 @@None
Provide specific questions to discuss and address before the RFC is voted on by the Fellowship. This should include, for example, alternatives to aspects of the proposed design where the appropriate trade-off to make is unclear.
-Any rewards protocol could simply be "out voted" by too many slow validators: An increase the number of parachain cores increases more workload, but this creates no-shows if too few validators could handle this workload.
We could add a synthetic parachain flag, only settable by governance, which treats no-shows as positive approval votes for that parachain, but without adding rewards. We should never enable this for real parachains, only for synthetic ones like gluttons. We should not enable the synthetic parachain flag long-term even for gluttonsm, because validators could easily modify their code. Yet, synthetic approval checks might enable pushing the hardware upgrades more agressively over the short-term.
@@ -6920,10 +7143,10 @@This RFC proposes a dynamic pricing model for the sale of Bulk Coretime on the Polkadot UC. The proposed model updates the regular price of cores for each sale period, by taking into account the number of cores sold in the previous sale, as well as a limit of cores and a target number of cores sold. It ensures a minimum price and limits price growth to a maximum price increase factor, while also giving govenance control over the steepness of the price change curve. It allows governance to address challenges arising from changing market conditions and should offer predictable and controlled price adjustments.
Accompanying visualizations are provided at [1].
-RFC-1 proposes periodic Bulk Coretime Sales as a mechanism to sell continouos regions of blockspace (suggested to be 4 weeks in length). A number of Blockspace Regions (compare RFC-1 & RFC-3) are provided for sale to the Broker-Chain each period and shall be sold in a way that provides value-capture for the Polkadot network. The exact pricing mechanism is out of scope for RFC-1 and shall be provided by this RFC.
A dynamic pricing model is needed. A limited number of Regions are offered for sale each period. The model needs to find the price for a period based on supply and demand of the previous period.
The model shall give Coretime consumers predictability about upcoming price developments and confidence that Polkadot governance can adapt the pricing model to changing market conditions.
@@ -6935,7 +7158,7 @@The primary stakeholders of this RFC are:
The dynamic pricing model sets the new price based on supply and demand in the previous period. The model is a function of the number of Regions sold, piecewise-defined by two power functions.
None at present.
-This pricing model is based on the requirements from the basic linear solution proposed in RFC-1, which is a simple dynamic pricing model and only used as proof. The present model adds additional considerations to make the model more adaptable under real conditions.
This RFC, if accepted, shall be implemented in conjunction with RFC-1.
@@ -7080,9 +7303,9 @@This document is a proposal for restructuring the bulk markets in the Polkadot UC's coretime allocation system to improve efficiency and fairness. The proposal suggests separating the BULK_PERIOD
into MARKET_PERIOD
and RENEWAL_PERIOD
, allowing for a market-driven price discovery through a clearing price Dutch auction during the MARKET_PERIOD
followed by renewal offers at the MARKET_PRICE
during the RENEWAL_PERIOD
. The new system ensures synchronicity between renewal and market prices, fairness among all current tenants, and efficient price discovery, while preserving price caps to provide security for current tenants. It seeks to start a discussion about the possibility of long-term leases.
While the initial RFC-1 has provided a robust framework for Coretime allocation within the Polkadot UC, this proposal builds upon its strengths and uses many provided building blocks to address some areas that could be further improved.
In particular, this proposal introduces the following changes:
The premise of this proposal is to reduce complexity by introducing a common price (that develops releative to capacity consumption of Polkadot UC), while still allowing for market forces to add efficiency. Longterm lease owners still receive priority IF they can pay (close to) the market price. This prevents a situation where the renewal price significantly diverges from renewal prices which allows for core captures. While maximum price increase certainty might seem contradictory to efficient price discovery, the proposed model aims to balance these elements, utilizing market forces to determine the price and allocate cores effectively within certain bounds. It must be stated, that potential price increases remain predictable (in the worst-case) but could be higher than in the originally proposed design. The argument remains, however, that we need to allow market forces to affect all prices for an efficient Coretime pricing and allocation.
Ultimately, this the framework proposed here adheres to all requirements stated in RFC-1.
-Primary stakeholder sets are:
The BULK_PERIOD
has been restructured into two primary segments: the MARKET_PERIOD
and RENEWAL_PERIOD
, along with an auxiliary SETTLEMENT_PERIOD
. This latter period doesn't necessitate any actions from the coretime system chain, but it facilitates a more efficient allocation of coretime in secondary markets. A significant departure from the original proposal lies in the timing of renewals, which now occur post-market phase. This adjustment aims to harmonize renewal prices with their market counterparts, ensuring a more consistent and equitable pricing model.
There are trade-offs that arise from this proposal, compared to the initial model. The most notable one is that here, I prioritize requirement 6 over requirement 2. The price, in the very "worst-case" (meaning a huge explosion in demand for coretime) could lead to a much larger increase of prices in Coretime. From an economic perspective, this (rare edgecase) would also mean that we'd vastly underprice Coretime in the original model, leading to highly inefficient allocations.
-This RFC builds extensively on the available ideas put forward in RFC-1.
Additionally, I want to express a special thanks to Samuel Haefner and Shahar Dobzinski for fruitful discussions and helping me structure my thoughts.
This RFC proposes changes that enable the use of absolute locations in AccountId derivations, which allows protocols built using XCM to have static account derivations in any runtime, regardless of its position in the family hierarchy.
-These changes would allow protocol builders to leverage absolute locations to maintain the exact same derived account address across all networks in the ecosystem, thus enhancing user experience.
One such protocol, that is the original motivation for this proposal, is InvArch's Saturn Multisig, which gives users a unifying multisig and DAO experience across all XCM connected chains.
-This proposal aims to make it possible to derive accounts for absolute locations, enabling protocols that require the ability to maintain the same derived account in any runtime. This is done by deriving accounts from the hash of described absolute locations, which are static across different destinations.
The same location can be represented in relative form and absolute form like so:
#![allow(unused)] @@ -7259,20 +7482,20 @@
WithCom
DescribeFamily
The
DescribeFamily
location descriptor is part of theHashedDescription
MultiLocation hashing system and exists to describe locations in an easy format for encoding and hashing, so that an AccountId can be derived from this MultiLocation.This implementation contains a match statement that does not match against absolute locations, so changes to it involve matching against absolute locations and providing appropriate descriptions for hashing.
-Drawbacks
+Drawbacks
No drawbacks have been identified with this proposal.
-Testing, Security, and Privacy
+Testing, Security, and Privacy
Tests can be done using simple unit tests, as this is not a change to XCM itself but rather to types defined in
xcm-builder
.Security considerations should be taken with the implementation to make sure no unwanted behavior is introduced.
This proposal does not introduce any privacy considerations.
-Performance, Ergonomics, and Compatibility
-Performance
+Performance, Ergonomics, and Compatibility
+Performance
Depending on the final implementation, this proposal should not introduce much overhead to performance.
-Ergonomics
+Ergonomics
The ergonomics of this proposal depend on the final implementation details.
-Compatibility
+Compatibility
Backwards compatibility should remain unchanged, although that depend on the final implementation.
-Prior Art and References
+Prior Art and References
DescirbeFamily
type: https://github.com/paritytech/polkadot-sdk/blob/master/polkadot/xcm/xcm-builder/src/location_conversion.rs#L122- @@ -7309,7 +7532,7 @@
WithComputedOrigin
type: https://github.com/paritytech/polkadot-sdk/blob/master/polkadot/xcm/xcm-builder/src/barriers.rs#L153
ChaosDAO - Summary
+Summary
This RFC proposes to make modifications to voting power delegations as part of the Conviction Voting pallet. The changes being proposed include:
-
- Allow a Delegator to vote independently of their Delegate if they so desire.
@@ -7317,7 +7540,7 @@Summary
- Make a change so that when a delegate votes abstain their delegated votes also vote abstain.
- Allow a Delegator to delegate/ undelegate their votes for all tracks with a single call.
Motivation
+Motivation
It has become clear since the launch of OpenGov that there are a few common tropes which pop up time and time again:
- The frequency of referenda is often too high for network participants to have sufficient time to review, comprehend, and ultimately vote on each individual referendum. This means that these network participants end up being inactive in on-chain governance.
@@ -7325,13 +7548,13 @@MotivationDelegating votes for all tracks currently requires long batched calls which result in high fees for the Delegator - resulting in a reluctance from many to delegate their votes.
We believe (based on feedback from token holders with a larger stake in the network) that if there were some changes made to delegation mechanics, these larger stake holders would be more likely to delegate their voting power to active network participants – thus greatly increasing the support turnout.
-Stakeholders
+Stakeholders
The primary stakeholders of this RFC are:
-
- The Polkadot Technical Fellowship who will have to research and implement the technical aspects of this RFC
- DOT token holders in general
Explanation
+Explanation
This RFC proposes to make 4 changes to the convictionVoting pallet logic in order to improve the user experience of those delegating their voting power to another account.
-
- @@ -7347,21 +7570,21 @@
Explanation
Allow a Delegator to delegate/ undelegate their votes for all tracks with a single call - in order to delegate votes across all tracks, a user must batch 15 calls - resulting in high costs for delegation. A single call for
delegate_all
/undelegate_all
would reduce the complexity and therefore costs of delegations considerably for prospective Delegators.Drawbacks
+Drawbacks
We do not foresee any drawbacks by implementing these changes. If anything we believe that this should help to increase overall voter turnout (via the means of delegation) which we see as a net positive.
-Testing, Security, and Privacy
+Testing, Security, and Privacy
We feel that the Polkadot Technical Fellowship would be the most competent collective to identify the testing requirements for the ideas presented in this RFC.
-Performance, Ergonomics, and Compatibility
-Performance
+Performance, Ergonomics, and Compatibility
+Performance
This change may add extra chain storage requirements on Polkadot, especially with respect to nested delegations.
Ergonomics & Compatibility
The change to add nested delegations may affect governance interfaces such as Nova Wallet who will have to apply changes to their indexers to support nested delegations. It may also affect the Polkadot Delegation Dashboard as well as Polkassembly & SubSquare.
We want to highlight the importance for ecosystem builders to create a mechanism for indexers and wallets to be able to understand that changes have occurred such as increasing the pallet version, etc.
-Prior Art and References
+Prior Art and References
N/A
Unresolved Questions
N/A
-Future Directions and Related Material
+Future Directions and Related Material
Additionally we would like to re-open the conversation about the potential for there to be free delegations. This was discussed by Dr Gavin Wood at Sub0 2022 and we feel like this would go a great way towards increasing the amount of network participants that are delegating: https://youtu.be/hSoSA6laK3Q?t=526
Overall, we strongly feel that delegations are a great way to increase voter turnout, and the ideas presented in this RFC would hopefully help in that aspect.
@@ -7403,9 +7626,9 @@Summary +
Summary
This RFC proposes a new model for a sustainable on-demand parachain registration, involving a smaller initial deposit and periodic rent payments. The new model considers that on-demand chains may be unregistered and later re-registered. The proposed solution also ensures a quick startup for on-demand chains on Polkadot in such cases.
-Motivation
+Motivation
With the support of on-demand parachains on Polkadot, there is a need to explore a new, more cost-effective model for registering validation code. In the current model, the parachain manager is responsible for reserving a unique
ParaId
and covering the cost of storing the validation code of the parachain. These costs can escalate, particularly if the validation code is large. We need a better, sustainable model for registering on-demand parachains on Polkadot to help smaller teams deploy more easily.This RFC suggests a new payment model to create a more financially viable approach to on-demand parachain registration. In this model, a lower initial deposit is required, followed by recurring payments upon parachain registration.
This new model will coexist with the existing one-time deposit payment model, offering teams seeking to deploy on-demand parachains on Polkadot a more cost-effective alternative.
@@ -7419,11 +7642,11 @@RequirementsThe solution MUST allow anyone to pay the rent.
- The solution MUST prevent the removal of validation code if it could still be required for disputes or approval checking.
-Stakeholders
+Stakeholders
-
- Future Polkadot on-demand Parachains
Explanation
+Explanation
This RFC proposes a set of changes that will enable the new rent based approach to registering and storing validation code on-chain. The new model, compared to the current one, will require periodic rent payments. The parachain won't be pruned automatically if the rent is not paid, but by permitting anyone to prune the parachain and rewarding the caller, there will be an incentive for the removal of the validation code.
On-demand parachains should still be able to utilize the current one-time payment model. However, given the size of the deposit required, it's highly likely that most on-demand parachains will opt for the new rent-based model.
@@ -7530,27 +7753,27 @@}
To enable parachain re-registration, we should introduce a new extrinsic in the paras-registrar
pallet that allows this. The logic of this extrinsic will be same as regular registration, with the distinction that it can be called by anyone, and the required deposit will be smaller since it only has to cover for the storage of the validation code.
This RFC does not alter the process of reserving a ParaId
, and therefore, it does not propose reducing it, even though such a reduction could be beneficial.
Even though this RFC doesn't delve into the specifics of the configuration values for parachain registration but rather focuses on the mechanism, configuring it carelessly could lead to potential problems.
Since the validation code hash and head data are not removed when the parachain is pruned but only when the deregister
extrinsic is called, the T::DataDepositPerByte
must be set to a higher value to create a strong enough incentive for removing it from the state.
The implementation of this RFC will be tested on Rococo first.
Proper research should be conducted on setting the configuration values of the new system since these values can have great impact on the network.
An audit is required to ensure the implementation's correctness.
The proposal introduces no new privacy concerns.
-This RFC should not introduce any performance impact.
-This RFC does not affect the current parachains, nor the parachains that intend to use the one-time payment model for parachain registration.
-This RFC does not break compatibility.
-Prior discussion on this topic: https://github.com/paritytech/polkadot-sdk/issues/1796
None at this time.
-As noted in this GitHub issue, we want to raise the per-byte cost of on-chain data storage. However, a substantial increase in this cost would make it highly impractical for on-demand parachains to register on Polkadot. This RFC offers an alternative solution for on-demand parachains, ensuring that the per-byte cost increase doesn't overly burden the registration process.
@@ -7584,16 +7807,16 @@Rather than enforce a limit to the total memory consumption on the client side by loading the value at :heappages
, enforce that limit on the runtime side.
From the early days of Substrate up until recently, the runtime was present in two forms: the wasm runtime (wasm bytecode passed through an interpreter) and the native runtime (native code directly run by the client).
Since the wasm runtime has a lower amount of available memory (4 GiB maximum) compared to the native runtime, and in order to ensure sure that the wasm and native runtimes always produce the same outcome, it was necessary to clamp the amount of memory available to both runtimes to the same value.
In order to achieve this, a special storage key (a "well-known" key) :heappages
was introduced and represents the number of "wasm pages" (one page equals 64kiB) of memory that are available to the memory allocator of the runtimes. If this storage key is absent, it defaults to 2048, which is 128 MiB.
The native runtime has since then been disappeared, but the concept of "heap pages" still exists. This RFC proposes a simplification to the design of Polkadot by removing the concept of "heap pages" as is currently known, and proposes alternative ways to achieve the goal of limiting the amount of memory available.
-Client implementers and low-level runtime developers.
-This RFC proposes the following changes to the client:
:heappages
as special.Each parachain can choose the option that they prefer, but the author of this RFC strongly suggests either option C or B.
-In case of path A, there is one situation where the behaviour pre-RFC is not equivalent to the one post-RFC: when a host function that performs an allocation (for example ext_storage_get
) is called, without this RFC this allocation might fail due to reaching the maximum heap pages, while after this RFC this will always succeed.
This is most likely not a problem, as storage values aren't supposed to be larger than a few megabytes at the very maximum.
In the unfortunate event where the runtime runs out of memory, path B would make it more difficult to relax the memory limit, as we would need to re-upload the entire Wasm, compared to updating only :heappages
in path A or before this RFC.
In the case where the runtime runs out of memory only in the specific event where the Wasm runtime is modified, this could brick the chain. However, this situation is no different than the thousands of other ways that a bug in the runtime can brick a chain, and there's no reason to be particularily worried about this situation in particular.
This RFC would reduce the chance of a consensus issue between clients.
The :heappages
are a rather obscure feature, and it is not clear what happens in some corner cases such as the value being too large (error? clamp?) or malformed. This RFC would completely erase these questions.
In case of path A, it is unclear how performances would be affected. Path A consists in moving client-side operations to the runtime without changing these operations, and as such performance differences are expected to be minimal. Overall, we're talking about one addition/subtraction per malloc and per free, so this is more than likely completely negligible.
In case of path B and C, the performance gain would be a net positive, as this RFC strictly removes things.
-This RFC would isolate the client and runtime more from each other, making it a bit easier to reason about the client or the runtime in isolation.
-Not a breaking change. The runtime-side changes can be applied immediately (without even having to wait for changes in the client), then as soon as the runtime is updated, the client can be updated without any transition period. One can even consider updating the client before the runtime, as it corresponds to path C.
-None.
None.
-This RFC follows the same path as https://github.com/polkadot-fellows/RFCs/pull/4 by scoping everything related to memory allocations to the runtime.
Table of Contents
@@ -7677,7 +7900,7 @@This RFC proposes adding a trivial governance track on Kusama to facilitate X (formerly known as Twitter) posts on the @kusamanetwork account. The technical aspect of implementing this in the runtime is very inconsequential and straight-forward, though it might get more technical if the Fellowship wants to regulate this track with a non-existent permission set. If this is implemented it would need to be followed up with:
@@ -7685,7 +7908,7 @@The overall motivation for this RFC is to decentralize the management of the Kusama brand/communication channel to KSM holders. This is necessary in my opinion primarily because of the inactivity of the account in recent history, with posts spanning weeks or months apart. I am currently unaware of who/what entity manages the Kusama X account, but if they are affiliated with Parity or W3F this proposed solution could also offload some of the legal ramifications of making (or not making) @@ -7695,11 +7918,11 @@
Finally, this RFC is the epitome of experimentation that Kusama is ideal for. This proposal may spark newfound excitement for Kusama and help us realize Kusama's potential for pushing boundaries and trying new unconventional ideas.
-This idea has not been formalized by any individual (or group of) KSM holder(s). To my knowledge the socialization of this idea is contained entirely in my recent X post here, but it is possible that an idea like this one has been discussed in other places. It appears to me that the ecosystem would welcome a change like this which is why I am taking action to formalize the discussion.
-The implementation of this idea can be broken down into 3 primary phases:
First, we begin with this RFC to ensure all feedback can be discussed and implemented in the proposal. After the Fellowship and the community come to a reasonable @@ -7752,7 +7975,7 @@
The main drawback to this change is that it requires a lot of off-chain coordination. It's easy enough to include the track on Kusama but it's a totally different challenge to make it function as intended. The tools need to be built and the auth tokens need to be managed. It would certainly add an administrative burden to whoever manages the X account since they would either need to run the tools themselves or manage auth tokens.
@@ -7764,22 +7987,22 @@Finally, this solution is merely pseudo-decentralization since the X account manager would still have ultimate control of the account. It's decentralized insofar as the auth tokens are given to people actually running the tools; a house of cards is required to facilitate X posts via this track. Not ideal.
-There's major precedent for configuring tracks on openGov given the amount of power tracks have, so it shouldn't be hard to come up with a sound configuration. That's why I recommend restricting permissions of this track to remarks and batches of remarks, or something equally inconsequential.
Building the tools for this implementation is really straight-forward and could be audited by Fellowship members, and the community at large, on Github.
The largest security concern would be the management of Kusama's X account's auth tokens. We would need to ensure that they aren't compromised.
-If a track on Kusama promises users that compliant referenda enacted therein would be posted on Kusama's X account, users would expect that track to perform as promised. If the house of cards tumbles down and a compliant referendum doesn't actually get anything posted, users might think that Kusama is broken or unreliable. This could be damaging to Kusama's image and cause people to question the soundness of other features on Kusama.
As mentioned in the drawbacks, the performance of this feature would depend on off-chain coordinations. We can reduce the administrative burden of these coordinations by funding third parties with the Treasury to deal with it, but then we're relying on trusting these parties.
-By adding a new track to Kusama, governance platforms like Polkassembly or Nova Wallet would need to include it on their applications. This shouldn't be too much of a burden or overhead since they've already built the infrastructure for other openGov tracks.
-This change wouldn't break any compatibility as far as I know.
One reference to a similar feature requiring on-chain/off-chain coordination would be the Kappa-Sigma-Mu Society. Nothing on-chain necessarily enforces the rules @@ -7824,11 +8047,11 @@
The current size of the decision deposit on some tracks is too high for many proposers. As a result, those needing to use it have to find someone else willing to put up the deposit for them - and a number of legitimate attempts to use the root track have timed out. This track would provide a more affordable (though slower) route for these holders to use the root track.
-There have been recent attempts to use the Kusama root track which have timed out with no decision deposit placed. Usually, these referenda have been related to parachain registration related issues.
-Propose to address this by adding a new referendum track [22] Referendum Deposit which can place the decision deposit on another referendum. This would require the following changes:
placeDecisionDesposit
function to additionally allow it to be called by root, with root call bypassing the requirements for a deposit payment.This track would provide a route to starting a root referendum with a much-reduced slashable deposit. This might be undesirable but, assuming the decision deposit cost for this track is still high enough, slashing would still act as a disincentive.
An alternative to this might be to reduce the decision deposit size some of the more expensive tracks. However, part of the purpose of the high deposit - at least on the root track - is to prevent spamming the limited queue with junk referenda.
-Will need additional tests case for the modified pallet and runtime. No security or privacy issues.
-No significant performance impact.
-Only changes related to adding the track. Existing functionality is unchanged.
-No compatibility issues.
-A pallet to facilitate enhanced multisig accounts. The main enhancement is that we store a multisig account in the state with related info (signers, threshold,..etc). The module affords enhanced control over administrative operations such as adding/removing signers, changing the threshold, account deletion, canceling an existing proposal. Each signer can approve/reject a proposal while still exists. The proposal is not intended for migrating or getting rid of existing multisig. It's to allow both options to coexist.
For the rest of the RFC We use the following terms:
Stateful Multisig
to refer to the proposed pallet.Stateless Multisig
to refer to the current multisig pallet in polkadot-sdk.Entities in the Polkadot ecosystem need to have a way to manage their funds and other operations in a secure and efficient way. Multisig accounts are a common way to achieve this. Entities by definition change over time, members of the entity may change, threshold requirements may change, and the multisig account may need to be deleted. For even more enhanced hierarchical control, the multisig account may need to be controlled by other multisig accounts.
Current native solutions for multisig operations are less optimal, performance-wise (as we'll explain later in the RFC), and lack fine-grained control over the multisig account.
@@ -7963,12 +8186,12 @@and much more...
-I've created the stateful multisig pallet during my studies in Polkadot Blockchain Academy under supervision from @shawntabrizi and @ank4n. After that, I've enhanced it to be fully functional and this is a draft PR#3300 in polkadot-sdk. I'll list all the details and design decisions in the following sections. Note that the PR is not 1-1 exactly to the current RFC as the RFC is a more polished version of the PR after updating based on the feedback and discussions.
Let's start with a sequence diagram to illustrate the main operations of the Stateful Multisig.
Standard audit/review requirements apply.
-Doing back of the envelop calculation to proof that the stateful multisig is more efficient than the stateless multisig given it's smaller footprint size on blocks.
Quick review over the extrinsics for both as it affects the block size:
Stateless Multisig: @@ -8452,17 +8675,17 @@
So even though the stateful multisig has a larger state size, it's still more efficient in terms of block size and total footprint on the blockchain.
-The Stateful Multisig will have better ergonomics for managing multisig accounts for both developers and end-users.
-This RFC is compatible with the existing implementation and can be handled via upgrades and migration. It's not intended to replace the existing multisig pallet.
-multisig pallet in polkadot-sdk
This proposes to increase the maximum length of PGP Fingerprint values from a 20 bytes/chars limit to a 40 bytes/chars limit.
-Pretty Good Privacy (PGP) Fingerprints are shorter versions of their corresponding Public Key that may be printed on a business card.
They may be used by someone to validate the correct corresponding Public Key.
@@ -8528,7 +8751,7 @@The maximum length of identity PGP Fingerprint values should be increased from the current 20 bytes/chars limit at least a 40 bytes/chars limit to support PGP Fingerprints and GPG Fingerprints.
-If a user tries to setting an on-chain identity by creating an extrinsic using Polkadot.js with identity
> setIdentity(info)
, then if they try to provide their 40 character long PGP Fingerprint or GPG Fingerprint, which is longer than the maximum length of 20 bytes/chars [u8;20]
, then they will encounter this error:
createType(Call):: Call: failed decoding identity.setIdentity:: Struct: failed on args: {...}:: Struct: failed on pgpFingerprint: Option<[u8;20]>:: Expected input with 20 bytes (160 bits), found 40 bytes
Increasing maximum length of identity PGP Fingerprint values from the current 20 bytes/chars limit to at least a 40 bytes/chars limit would overcome these errors and support PGP Fingerprints and GPG Fingerprints, satisfying the solution requirements.
-No drawbacks have been identified.
-Implementations would be tested for adherance by checking that 40 bytes/chars PGP Fingerprints are supported.
No effect on security or privacy has been identified than already exists.
No implementation pitfalls have been identified.
-It would be an optimization, since the associated exposed interfaces to developers and end-users could start being used.
To minimize additional overhead the proposal suggests a 40 bytes/chars limit since that would at least provide support for PGP Fingerprints, satisfying the solution requirements.
-No potential ergonomic optimizations have been identified.
-Updates to Polkadot.js Apps, API and its documentation and those referring to it may be required.
-No prior articles or references.
No further questions at this stage.
-Relates to RFC entitled "Increase maximum length of identity raw data values from 32 bytes".
Table of Contents
@@ -8606,10 +8829,10 @@This proposes to require a slashable deposit in the broker pallet when initially purchasing or renewing Bulk Coretime or Instantaneous Coretime cores.
Additionally, it proposes to record a reputational status based on the behavior of the purchaser, as it relates to their use of Kusama Coretime cores that they purchase, and to possibly reserve a proportion of the cores for prospective purchasers that have an on-chain identity.
-There are sales of Kusama Coretime cores that are scheduled to occur later this month by Coretime Marketplace Lastic.xyz initially in limited quantities, and potentially also by RegionX in future that is subject to their Polkadot referendum #582. This poses a risk in that some Kusama Coretime core purchasers may buy Kusama Coretime cores when they have no intention of actually placing a workload on them or leasing them out, which would prevent those that wish to purchase and actually use Kusama Coretime cores from being able to use any at cores at all.
The slashable deposit if set too high, may result in an economic impact, where less Kusama Coretime core sales are purchased.
-Lack of a slashable deposit in the Broker pallet is a security concern, since it exposes Kusama Coretime sales to potential abuse.
Reserving a proportion of Kusama Coretime sales cores for those with on-chain identities should not be to the exclusion of accounts that wish to remain anonymous or cause cores to be wasted unnecessarily. As such, if cores that are reserved for on-chain identities remain unsold then they should be released to anonymous accounts that are on a waiting list.
No implementation pitfalls have been identified.
-It should improve performance as it reduces the potential for state bloat since there is less risk of undesirable Kusama Coretime sales activity that would be apparent with no requirement for a slashable deposit or there being no reputational risk to purchasers that waste or misuse Kusama Coretime cores.
The solution proposes to minimize the risk of some Kusama Coretime cores not even being used or leased to perform any tasks at all.
It will be important to monitor and manage the slashable deposits, purchaser reputations, and utilization of the proportion of cores that are reserved for accounts with an on-chain identity.
-The mechanism for setting a slashable deposit amount, should avoid undue complexity for users.
-Updates to Polkadot.js Apps, API and its documentation and those referring to it may be required.
-No prior articles.
None
-None
Table of Contents
@@ -8707,13 +8930,13 @@This RFC proposes the addition of a secondary market feature to either the broker pallet or as a separate pallet maintained by Lastic, enabling users to list and purchase regions. This includes creating, purchasing, and removing listings, as well as emitting relevant events and handling associated errors.
-Currently, the broker pallet lacks functionality for a secondary market, which limits users' ability to freely trade regions. This RFC aims to introduce a secure and straightforward mechanism for users to list regions they own for sale and allow other users to purchase these regions.
While integrating this functionality directly into the broker pallet is one option, another viable approach is to implement it as a separate pallet maintained by Lastic. This separate pallet would have access to the broker pallet and add minimal functionality necessary to support the secondary market.
Adding smart contracts to the Coretime chain could also address this need; however, this process is expected to be lengthy and complex. We cannot afford to wait for this extended timeline to enable basic secondary market functionality. By proposing either integration into the broker pallet or the creation of a dedicated pallet, we can quickly enhance the flexibility and utility of the broker pallet, making it more user-friendly and valuable.
-Primary stakeholders include:
This RFC introduces the following key features:
The main drawback of adding the additional complexity directly to the broker pallet is the potential increase in maintenance overhead. Therefore, we propose adding additional functionality as a separate pallet on the Coretime chain. To take the pressure off from implementing these features, implementation along with unit tests would be taken care of by Lastic (Aurora Makovac, Philip Lucsok).
There are potential risks of security vulnerabilities in the new market functionalities, such as unauthorized region transfers or incorrect balance adjustments. Therefore, extensive security measures would have to be implemented.
-This RFC proposes the integration of smart contracts on the Coretime chain to enhance flexibility and enable complex decentralized applications, including secondary market functionalities.
-Currently, the Coretime chain lacks the capability to support smart contracts, which limits the range of decentralized applications that can be developed and deployed. By enabling smart contracts, the Coretime chain can facilitate more sophisticated functionalities such as automated region trading, dynamic pricing mechanisms, and other decentralized applications that require programmable logic. This will enhance the utility of the Coretime chain, attract more developers, and create more opportunities for innovation.
Additionally, while there is a proposal (#885) to allow EVM-compatible contracts on Polkadot’s Asset Hub, the implementation of smart contracts directly on the Coretime chain will provide synchronous interactions and avoid the complexities of asynchronous operations via XCM.
-Primary stakeholders include:
This RFC introduces the following key components:
There are several drawbacks to consider:
Change the upgrade process of a parachain runtime upgrade to become an off-chain process with regards to the relay chain. Upgrades are still contained in parachain blocks, but will no longer need to end up in relay chain blocks nor in relay chain state.
-Having parachain runtime upgrades go through the relay chain has always been seen as a scalability concern. Due to optimizations in statement distribution and asynchronous backing it became less crucial and got @@ -9019,13 +9242,13 @@
The issues with on-chain runtime upgrades are:
The major drawback of this solution is the same as any solution the moves work off-chain, it adds complexity to the node. E.g. nodes needing the PVF, need to store them separately, together with their own pruning strategy as well.
-Implementations adhering to this RFC, will respond to PVF requests with the actual PVF, if they have it. Requesters will persist received PVFs on disk for as long as they are replaced by a new one. Implementations must not be lazy @@ -9173,8 +9396,8 @@
This proposal lightens the load on the relay chain and is thus in general beneficial for the performance of the network, this is achieved by the following:
@@ -9189,7 +9412,7 @@End users are only affected by better performance and more stable block times.
Parachains will need to implement the introduced request/response protocol and
adapt to the new signalling mechanism via an UMP
message, instead of sending
@@ -9200,7 +9423,7 @@
We will continue to support the old mechanism for code upgrades for a while, but will start to impose stricter limits over time, with the number of registered parachains going up. With those limits in place parachains not migrating to the @@ -9221,7 +9444,7 @@
Off-chain runtime upgrades have been discussed before, the architecture described here is simpler though as it piggybacks on already existing features, namely:
@@ -9247,7 +9470,7 @@By no longer having code upgrade go through the relay chain, occupying a full relay chain block, the impact on other parachains is already greatly reduced, if we @@ -9323,52 +9546,52 @@
The SetFeesMode
instruction and the fees_mode
register allow for the existence of JIT withdrawal.
JIT withdrawal complicates the fee mechanism and leads to bugs and unexpected behaviour.
The proposal is to remove said functionality.
Another effort to simplify fee handling in XCM.
The JIT withdrawal mechanism creates bugs such as not being able to get fees when all assets are put into holding and none left in the origin location. This is a confusing behavior, since there are funds for fees, just not where the XCVM wants them. The XCVM should have only one entrypoint to fee payment, the holding register. That way there is also less surface for bugs.
-The SetFeesMode
instruction will be removed.
The Fees Mode
register will be removed.
Users will have to make sure to put enough assets in WithdrawAsset
when
previously some things might have been charged directly from their accounts.
This leads to a more predictable behaviour though so it will only be
a drawback for the minority of users.
Implementations and benchmarking must change for most existing pallet calls that send XCMs to other locations.
-Performance will be improved since unnecessary checks will be avoided.
-JIT withdrawal was a way of side-stepping the regular flow of XCM programs. By removing it, the spec is simplified but now old use-cases have to work with the original intended behaviour, which may result in more implementation work.
Ergonomics for users will undoubtedly improve since the system is more predictable.
-Existing programs in the ecosystem will break. The instruction should be deprecated as soon as this RFC is approved (but still fully supported), then removed in a subsequent XCM version (probably deprecate in v5, remove in v6).
-The previous RFC PR on the xcm-format repo, before XCM RFCs were moved to fellowship RFCs: https://github.com/polkadot-fellows/xcm-format/pull/57.
None.
-The new generic fees mechanism is related to this proposal and further stimulates it as the JIT withdraw fees mechanism will become useless anyway.
Table of Contents
@@ -9401,20 +9624,20 @@This RFC proposes compressing the state response message during the state syncing process to reduce the amount of data transferred.
-State syncing can require downloading several gigabytes of data, particularly for blockchains with large state sizes, such as Astar, which has a state size exceeding 5 GiB (https://github.com/AstarNetwork/Astar/issues/1110). This presents a significant challenge for nodes with slower network connections. Additionally, the current state sync implementation lacks a persistence feature (https://github.com/paritytech/polkadot-sdk/issues/4), meaning any network disruption forces the node to re-download the entire state, making the process even more difficult.
-This RFC benefits all projects utilizing the Substrate framework, specifically in improving the efficiency of state syncing.
The largest portion of the state response message consists of either CompactProof
or Vec<KeyValueStateEntry>
, depending on whether a proof is requested (source):
CompactProof
: When proof is requested, compression yields a lower ratio but remains beneficial, as shown in warp sync tests in the Performance section below.None identified.
-The code changes required for this RFC are straightforward: compress the state response on the sender side and decompress it on the receiver side. Existing sync tests should ensure functionality remains intact.
-This RFC optimizes network bandwidth usage during state syncing, particularly for blockchains with gigabyte-sized states, while introducing negligible CPU overhead for compression and decompression. For example, compressing the state response during a recent Polkadot warp sync (around height #22076653) reduces the data transferred from 530,310,121 bytes to 352,583,455 bytes — a 33% reduction, saving approximately 169 MiB of data.
Performance data is based on this patch, with logs available here.
-None.
-No compatibility issues identified.
-None.
None.
-None.
Table of Contents
@@ -9473,9 +9696,9 @@This RFC proposes a new host function, secp256r1_ecdsa_verify_prehashed
, for verifying NIST-P256
signatures. The function takes as input the message hash, r
and s
components of the signature, and the x
and y
coordinates of the public key. By providing this function, runtime authors can leverage a more efficient verification mechanism for "secp256r1" elliptic curve signatures, reducing computational costs and improving overall performance.
“secp256r1” elliptic curve is a standardized curve by NIST which has the same calculations by different input parameters with “secp256k1” elliptic curve. The cost of combined attacks and the security conditions are almost the same for both curves. Adding a host function can provide signature verifications using the “secp256r1” elliptic curve in the runtime and multi-faceted benefits can occur. One important factor is that this curve is widely used and supported in many modern devices such as Apple’s Secure Enclave, Webauthn, Android Keychain which proves the user adoption. Additionally, the introduction of this host function could enable valuable features in the account abstraction which allows more efficient and flexible management of accounts by transaction signs in mobile devices. Most of the modern devices and applications rely on the “secp256r1” elliptic curve. The addition of this host function enables a more efficient verification of device native transaction signing mechanisms. For example:
This RFC proposes a new host function for runtime authors to leverage a more efficient verification mechanism for "secp256r1" elliptic curve signatures.
Proposed host function signature:
#![allow(unused)] @@ -9500,19 +9723,19 @@
Explanation ) -> bool; }
The host function MUST return true
if the signature is valid or false
otherwise.
N/A
-The changes are not directly affecting the protocol security, parachains are not enforced to use the host function.
-N/A
-The host function proposed in this RFC allows parachain runtime developers to use a more efficient verification mechanism for "secp256r1" elliptic curve signatures.
-Parachain teams will need to include this host function to upgrade.
-A followup of the RFC-0014. This RFC proposes adding a new collective to the Polkadot Collectives Chain: The Unbrick Collective, as well as improvements in the mechanisms that will allow teams operating paras that had stopped producing blocks to be assisted, in order to restore the production of blocks of these paras.
-Since the initial launch of Polkadot parachains, there has been many incidients causing parachains to stop producing new blocks (therefore, being bricked) and many occurrences that required Polkadot governance to update the parachain head state/wasm. This can be due to many reasons range @@ -9572,14 +9795,14 @@
In consequence, the idea of a Unbrick Collective that can provide assistance to para teams when they brick and further protection against future halts is reasonable enough.
-The Unbrick Collective is defined as an unranked collective of members, not paid by the Polkadot Treasury. Its main goal is to serve as a point of contact and assistance for enacting the actions @@ -9647,25 +9870,25 @@
The ability to modify the Head State and/or the PVF of a para means a possibility to perform arbitrary modifications of it (i.e. take control the native parachain token or any bridged assets in the para).
This could introduce a new attack vector, and therefore, such great power needs to be handled carefully.
-The implementation of this RFC will be tested on testnets (Rococo and Westend) first.
An audit will be required to ensure the implementation doesn't introduce unwanted side effects.
There are no privacy related concerns.
-This RFC should not introduce any performance impact.
-This RFC should improve the experience for new and existing parachain teams, lowering the barrier to unbrick a stalled para.
-This RFC is fully compatible with existing interfaces.
-In an attempt to mitigate risks derived from unwanted behaviours around long decision periods on referenda, this proposal describes how to finalize and decide a result of a poll via a mechanism similar to candle auctions.
-Referenda protocol provide permissionless and efficient mechanisms to enable governance actors to decide the future of the blockchains around Polkadot network. However, they pose a series of risks derived from the game theory perspective around these mechanisms. One of them being where an actor @@ -9744,7 +9967,7 @@
Finalizing
state.Currently, the process of a referendum/poll is defined as an sequence between an ongoing state (where accounts can vote), comprised by a with a preparation period, a decision period, and a confirm period. If the poll is passing before the decision period ends, it's possible to push @@ -9835,33 +10058,33 @@
This approach doesn't include a mechanism to determine whether a change of the poll status in the confirming period is due to a legitimate change of mind of the voters, or an exploitation of its aforementioned vulnerabilities (like a sniping attack), instead treating all of them as potential attacks.
This is an issue that can be addressed by additional mechanisms, and heuristics that can help determine the probability of a change of poll status to happen as a result of a legitimate behaviour.
-The implementation of this RFC will be tested on testnets (Paseo and Westend) first. Furthermore, it should be enabled in a canary network (like Kusama) to ensure the behaviours it is trying to address is indeed avoided.
An audit will be required to ensure the implementation doesn't introduce unwanted side effects.
There are no privacy related concerns.
-The added steps imply pessimization, necessary to meet the expected changes. An implementation MUST exit from the Finalization period as early as possible to minimize this impact.
-This proposal does not alter the already exposed interfaces or developers or end users. However, they must be aware of the changes in the additional overhead the new period might incur (these depend on the implemented VRF).
-This proposal does not break compatibility with existing interfaces, older versions, but it alters the previous implementation of the referendum processing algorithm.
An acceptable upgrade strategy that can be applied is defining a point in time (block number, poll index) from which to start applying the new mechanism, thus, not affecting the already ongoing referenda.
-polkadot-runtime-commont
: Defines the mechanism of candle auctions.A proposed implementation of this change can be seen on this Pull Request.
Table of Contents
@@ -9904,12 +10127,12 @@The protocol change introduces flexibility in the governance structure by enabling the referenda
track list to be modified dynamically at runtime. This is achieved by replacing static slices in
TracksInfo
with iterators, facilitating storage-based track management. As a result, governance
tracks can be modified or added based on real-time decisions and without requiring runtime upgrades.
Polkadot's governance system is designed to be adaptive and decentralized, but modifying the referenda tracks (which determine decision-making paths for proposals) has historically required runtime upgrades. This poses an operational challenge, delaying governance changes until an upgrade @@ -9917,12 +10140,12 @@
The protocol modification replaces the current static slice method used for storing referenda tracks with an iterator-based approach that allows tracks to be managed dynamically using chain storage. Governance participants can define and modify referenda tracks as needed, which are then accessed @@ -9934,12 +10157,12 @@
The most significant drawback is the increased complexity for developers managing track configurations via storage-based iterators, which require careful handling to avoid misuse or inefficiencies.
Additionally, this flexibility could introduce risks if track configurations are modified improperly during runtime, potentially leading to governance instabilities.
-To ensure security, the change must be tested in testnet environments first (Paseo, Westend), particularly in scenarios where multiple track changes happen concurrently. Potential vulnerabilities in governance adjustments must be addressed to prevent abuse.
@@ -9947,22 +10170,22 @@The proposal optimizes governance track management by avoiding the overhead of runtime upgrades, reducing downtime, and eliminating the need for full consensus on upgrades. However, there is a slight performance cost related to runtime access to storage-based iterators, though this is mitigated by the overall system efficiency gains.
-Developers and governance actors benefit from simplified governance processes but must account for the technical complexity of managing iterator-based track configurations.
Tools may need to be developed to help streamline track adjustments in runtime.
-The change is backward compatible with existing governance operations, and does not require developers to adjust how they interact with referenda tracks.
A migration is required to convert existing statically-defined tracks to dynamic storage-based configurations without disruption.
-This dynamic governance track approach builds on previous work around Polkadot's on-chain governance and leverages standard iterator patterns in Rust programming to improve runtime flexibility. Comparable solutions in other governance networks were examined, but this proposal uniquely tailors @@ -9975,7 +10198,7 @@
There are already two proposed solutions for both the implementation and
pallet-referenda
's TracksInfo
to make tracks
@@ -10013,39 +10236,39 @@ The code of a runtime is stored in its own state, and when performing a runtime upgrade, this code is replaced. The new runtime can contain runtime migrations that adapt the state to the state layout as defined by the runtime code. This runtime migration is executed when building the first block with the new runtime code. Anything that interacts with the runtime state uses the state layout as defined by the runtime code. So, when trying to load something from the state in the block that applied the runtime upgrade, it will use the new state layout but will decode the data from the non-migrated state. In the worst case, the data is incorrectly decoded, which may lead to crashes or halting of the chain.
This RFC proposes to store the new runtime code under a different storage key when applying a runtime upgrade. This way, all the off-chain logic can still load the old runtime code under the default storage key and decode the state correctly. The block producer is then required to use this new runtime code to build the next block. While building the next block, the runtime is executing the migrations and moves the new runtime code to the default runtime code location. So, the runtime code found under the default location is always the correct one to decode the state from which the runtime code was loaded.
-While the issue of having undecodable state only exists for the one block in which the runtime upgrade was applied, it still impacts anything that reads state data, like block explorers, UIs, nodes, etc. For block explorers, the issue mainly results in indexing invalid data and UIs may show invalid data to the user. For nodes, reading incorrect data may lead to a performance degradation of the network. There are also ways to prevent certain decoding issues from happening, but it requires that developers are aware of this issue and also requires introducing extra code, which could introduce further bugs down the line.
So, this RFC tries to solve these issues by fixing the underlying problem of having temporary undecodable state.
-The runtime code is stored under the special key :code
in the state. Nodes and other tooling read the runtime code under this storage key when they want to interact with the runtime for e.g., building/importing blocks or getting the metadata to read the state. To update the runtime code the runtime overwrites the value at :code
, and then from the next block on, the new runtime will be loaded.
This RFC proposes to first store the new runtime code under :pending_code
in the state for one block. When the next block is being built, the block builder first needs to check if :pending_code
is set, and if so, it needs to load the runtime from this storage key. While building the block the runtime will move :pending_code
to :code
to have the runtime code at the default location. Nodes importing the block will also need to load :pending_code
if it exists to ensure that the correct runtime code is used. By doing it this way, the runtime code found at :code
in the state of a block will always be able to decode the state.
Furthermore, this RFC proposes to introduce system_version: 3
. The system_version
was introduced in RFC42
. Version 3
would then enable the usage of :pending_code
when applying a runtime code upgrade. This way, the feature can be introduced first and enabled later when the majority of the nodes have upgraded.
Because the first block built with the new runtime code will move the runtime code from :pending_code
to :code
, the runtime code will need to be loaded. This means the runtime code will appear in the proof of validity of a parachain for the first block built with the new runtime code. Generally this is not a problem as the runtime code is also loaded by the parachain when setting the new runtime code.
There is still the possibility of having state that is not migrated even when following the proposal as presented by this RFC. The issue is that if the amount of data to be migrated is too big, not all of it can be migrated in one block, because either it takes more time than there is assigned for a block or parachains for example have a fixed budget for their proof of validity. To solve this issue there already exist multi-block migrations that can chunk the migration across multiple blocks. Consensus-critical data needs to be migrated in the first block to ensure that block production etc., can continue. For the other data being migrated by multi-block migrations the migrations could for example expose to the outside which keys are being migrated and should not be indexed until the migration is finished.
Testing should be straightforward and most of the existing testing should already be good enough. Extending with some checks that :pending_code
is moved to :code
.
The performance should not be impacted besides requiring loading the runtime code in the first block being built with the new runtime code.
-It only alters the way blocks are produced and imported after applying a runtime upgrade. This means that only nodes need to be adapted to the changes of this RFC.
-The change will require that the nodes are upgraded before the runtime starts using this feature. Otherwise they will fail to import the block build by :pending_code
.
For Polkadot/Kusama this means that also the parachain nodes need to be running with a relay chain node version that supports this new feature. Otherwise the parachains will stop producing/finalizing nodes as they can not sync the relay chain any more.
The issue initially reported a bug that led to this RFC. It also discusses multiple solutions for the problem.
None
-move
function. When using the V1
trie layout every value bigger than 32 bytes is put into the db separately. This means a low level move
function would only need to move the hash of the runtime code from :code
to :pending_code
.This RFC proposes the definition of version 5 extrinsics along with changes to the specification and encoding from version 4.
-RFC84
introduced the specification of General
transactions, a new type of extrinsic besides the Signed
and Unsigned
variants available previously in version 4. Additionally,
@@ -10099,13 +10322,13 @@
The introduction of General
transactions allows the authorization of any and all origins through
extensions. This means that, with the appropriate extension, General
transactions can replicate
@@ -10178,264 +10401,41 @@
The metadata will have to accommodate two distinct extrinsic format versions at a given point in time in order to provide the new functionality in a non-breaking way for users and tooling.
Although having to support multiple extrinsic versions in metadata involves extra work, the change is ultimately an improvement to metadata and the extra functionality may be useful in other future scenarios.
-There is no impact on testing, security or privacy.
-This change makes the authorization through signatures configurable by runtime devs in version 5
extrinsics, as opposed to version 4 where the signing payload algorithm and signatures were
hardcoded. This moves the responsibility of ensuring proper authentication through
TransactionExtension
to the runtime devs, but a sensible default which closely resembles the
present day behavior will be provided in VerifySignature
.
There is no performance impact.
-Tooling will have to adapt to be able to tell which authorization scheme is used by a particular
transaction by decoding the extension and checking which particular TransactionExtension
in the
pipeline is enabled to do the origin authorization. Previously, this was done by simply checking
whether the transaction is signed or unsigned, as there was only one method of authentication.
As long as extrinsic version 4 is still exposed in the metadata when version 5 will be introduced, the changes will not break existing infrastructure. This should give enough time for tooling to support version 5 and to remove version 4 in the future.
-This is a result of the work in Extrinsic Horizon and RFC99.
None.
-Following this change, extrinsic version 5 will be introduced as part of the Extrinsic Horizon effort, which will shape future work.
- -Table of Contents
-Start Date | 22 Oct 2024 |
Description | XCM Asset Metadata definition and a way of communicating it via XCM |
Authors | Daniel Shiposha |
This RFC proposes a metadata format for XCM-identifiable assets (i.e., for fungible/non-fungible collections and non-fungible tokens) and a set of instructions to communicate it across chains.
-Currently, there is no way to communicate metadata of an asset (or an asset instance) via XCM.
-The ability to query and modify the metadata is useful for two kinds of entities:
-Asset collections (both fungible and nonfungible).
-Any collection has some metadata, such as the name of the collection. The standard way of communicating metadata could help with registering foreign assets within a consensus system. Therefore, this RFC could complement or supersede the RFC for initializing fully-backed derivatives (note that this RFC is related to the old XCM RFC process; it's not the Fellowship RFC and hasn't been migrated yet).
-NFTs (i.e., asset instances).
-The metadata is the crucial aspect of any nonfungible object since metadata assigns meaning to such an object. The metadata for NFTs is just as important as the notion of "amount" for fungibles (there is no sense in fungibles if they have no amount).
-An NFT is always a representation of some object. The metadata describes the object represented by the NFT.
-NFTs can be transferred to another chain via XCM. However, there are limitations due to the inability to communicate its metadata:
-Besides metadata modification, the ability to read it is also valuable. On-chain logic can interpret the NFT metadata, i.e., the metadata could have not only the media meaning but also a utility function within a consensus system. Currently, such a way of using NFT metadata is possible only within one consensus system. This RFC proposes making it possible between different systems via XCM so different chains can fetch and analyze the asset metadata from other chains.
-Runtime users, Runtime devs, Cross-chain dApps, Wallets.
-The Asset Metadata is information bound to an asset class (fungible or NFT collection) or an asset instance (an NFT). -The Asset Metadata could be represented differently on different chains (or in other consensus entities). -However, to communicate metadata between consensus entities via XCM, we need a general format so that any consensus entity can make sense of such information.
-We can name this format "XCM Asset Metadata".
-This RFC proposes:
-Using key-value pairs as XCM Asset Metadata since it is a general concept useful for both structured and unstructured data. Both key and value can be raw bytes with interpretation up to the communicating entities.
-The XCM Asset Metadata should be represented as a map SCALE-encoded equivalent to the BTreeMap<Vec<u8>, Vec<u8>>
.
As such, the XCM Asset Metadata types are defined as follows:
--#![allow(unused)] -fn main() { -type MetadataKey = Vec<u8>; -type MetadataValue = Vec<u8>; -type MetadataMap = BTreeMap<MetadataKey, MetadataValue>; -}
Communicating only the demanded part of the metadata, not the whole metadata.
-A consensus entity should be able to query the values of interested keys to read the metadata.
-We need a set-like type to specify the keys to read, a SCALE-encoded equivalent to the BTreeSet<Vec<u8>>
.
-Let's define that type as follows:
-#![allow(unused)] -fn main() { -type MetadataKeySet = BTreeSet<MetadataKey>; -}
A consensus entity should be able to write the values for specified keys.
-New XCM instructions to communicate the metadata.
-Note: the maximum lengths of MetadataKey
, MetadataValue
, MetadataMap
, and MetadataKeySet
are implementation-defined.
ReportMetadata
The ReportMetadata
is a new instruction to query metadata information.
-It can be used to query metadata key list or to query values of interested keys.
This instruction allows querying the metadata of:
-If an asset (or an asset instance) for which the query is made doesn't exist, the Response::Null
should be reported via the existing QueryResponse
instruction.
The ReportMetadata
can be used without origin (i.e., following the ClearOrigin
instruction) since it only reads state.
Safety: The reporter origin should be trusted to hold the true metadata. If the reserve-based model is considered, the asset's reserve location must be viewed as the only source of truth about the metadata.
-The use case for this instruction is when the metadata information of a foreign asset (or asset instance) is used in the logic of a consensus entity that requested it.
--#![allow(unused)] -fn main() { -/// An instruction to query metadata of an asset or an asset instance. -ReportMetadata { - /// The ID of an asset (a collection, fungible or nonfungible). - asset_id: AssetId, - - /// The ID of an asset instance. - /// - /// If the value is `Undefined`, the metadata of the collection is reported. - instance: AssetInstance, - - /// See `MetadataQueryKind` below. - query_kind: MetadataQueryKind, - - /// The usual field for Report<something> XCM instructions. - /// - /// Information regarding the query response. - /// The `QueryResponseInfo` type is already defined in the XCM spec. - response_info: QueryResponseInfo, -} -}
Where the MetadataQueryKind
is:
-#![allow(unused)] -fn main() { -enum MetadataQueryKind { - /// Query metadata key set. - KeySet, - - /// Query values of the specified keys. - Values(MetadataKeySet), -} -}
The ReportMetadata
works in conjunction with the existing QueryResponse
instruction. The Response
type should be modified accordingly: we need to add a new AssetMetadata
variant to it.
-#![allow(unused)] -fn main() { -/// The struct used in the existing `QueryResponse` instruction. -pub enum Response { - // ... snip, existing variants ... - - /// The metadata info. - AssetMetadata { - /// The ID of an asset (a collection, fungible or nonfungible). - asset_id: AssetId, - - /// The ID of an asset instance. - /// - /// If the value is `Undefined`, the reported metadata is related to the collection, not a token. - instance: AssetInstance, - - /// See `MetadataResponseData` below. - data: MetadataResponseData, - } -} - -pub enum MetadataResponseData { - /// The metadata key list to be reported - /// in response to the `KeySet` metadata query kind. - KeySet(MetadataKeySet), - - /// The values of the keys that were specified in the - /// `Values` variant of the metadata query kind. - Values(MetadataMap), -} -}
ModifyMetadata
The ModifyMetadata
is a new instruction to request a remote chain to modify the values of the specified keys.
This instruction can be used to update the metadata of a collection (fungible or nonfungible) or of an NFT.
-The remote chain handles the modification request and may reject it based on its internal rules. -The request can only be executed or rejected in its entirety. It must not be executed partially.
-To execute the ModifyMetadata
, an origin is required so that the handling logic can authorize the metadata modification request from a known source. Since this instruction requires an origin, the assets used to cover the execution fees must be transferred in a way that preserves the origin. For instance, one can use the approach described in RFC #122 if the handling chain configured aliasing rules accordingly.
The example use case of this instruction is to ask the reserve location of the asset to modify the metadata. So that, the original asset's metadata is updated according to the reserve location's rules.
--#![allow(unused)] -fn main() { -ModifyMetadata { - /// The ID of an asset (a collection, fungible or nonfungible). - asset_id: AssetId, - - /// The ID of an asset instance. - /// - /// If the value is `Undefined`, the modification request targets the collection, not a token. - instance: AssetInstance, - - /// The map contains the keys mapped to the requested new values. - modification: MetadataMap, -} -}
AssetInstance::Undefined
As the new instructions show, this RFC reframes the purpose of the Undefined
variant of the AssetInstance
enum.
-This RFC proposes to use the Undefined
variant of a collection identified by an AssetId
as a synonym of the collection itself. I.e., an asset Asset { id: <AssetId>, fun: NonFungible(AssetInstance::Undefined) }
is considered an NFT representing the collection itself.
As a singleton non-fungible instance is barely distinguishable from its collection, this convention shouldn't cause any problems.
-Thus, the AssetInstance
docs must be updated accordingly in the implementations.
Regarding ergonomics, no drawbacks were noticed.
-As for the user experience, it could discover new cross-chain use cases involving asset collections and NFTs, indicating a positive impact.
-There are no security concerns except for the ReportMetadata
instruction, which implies that the source of the information must be trusted.
In terms of performance and privacy, there will be no changes.
-The implementations must honor the contract for the new instructions. Namely, if the instance
field has the value of AssetInstance::Undefined
, the metadata must relate to the asset collection but not to a non-fungible token inside it.
No significant impact.
-Introducing a standard metadata format and a way of communicating it is a valuable addition to the XCM format that potentially increases cross-chain interoperability without the need to form ad-hoc chain-to-chain integrations via Transact
.
This RFC proposes new functionality, so there are no compatibility issues.
-The original RFC draft contained additional metadata instructions. Though they could be useful, they're clearly outside the basic logic. So, this RFC version omits them to make the metadata discussion more focused on the core things. Nonetheless, there is hope that metadata approval instructions might be useful in the future, so they are mentioned here.
-You can read about the details in the original draft.
Table of Contents