mirror of
https://github.com/pezkuwichain/pezkuwi-fellows.git
synced 2026-11-24 06:50:01 +00:00
deploy: fe8db0ffa3
This commit is contained in:
1 parent
4427b53308
commit
e8ed8403d9
64 files changed
+756
-750
No files matched your search
@@ -1,408 +0,0 @@
|
||||
|
||||
<!DOCTYPE HTML>
|
||||
<html lang="en" class="polkadot" dir="ltr">
|
||||
<head>
|
||||
<!-- Book generated using mdBook -->
|
||||
<meta charset="UTF-8">
|
||||
<title>RFC-0120: Referenda Confirmation by Candle Mechanism - Polkadot Fellowship RFCs</title>
|
||||
|
||||
|
||||
<!-- Custom HTML head -->
|
||||
|
||||
<meta name="description" content="An online book of RFCs approved or proposed within the Polkadot Fellowship.">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta name="theme-color" content="#ffffff">
|
||||
|
||||
<link rel="icon" href="../favicon.svg">
|
||||
<link rel="shortcut icon" href="../favicon.png">
|
||||
<link rel="stylesheet" href="../css/variables.css">
|
||||
<link rel="stylesheet" href="../css/general.css">
|
||||
<link rel="stylesheet" href="../css/chrome.css">
|
||||
<link rel="stylesheet" href="../css/print.css" media="print">
|
||||
|
||||
<!-- Fonts -->
|
||||
<link rel="stylesheet" href="../FontAwesome/css/font-awesome.css">
|
||||
<link rel="stylesheet" href="../fonts/fonts.css">
|
||||
|
||||
<!-- Highlight.js Stylesheets -->
|
||||
<link rel="stylesheet" href="../highlight.css">
|
||||
<link rel="stylesheet" href="../tomorrow-night.css">
|
||||
<link rel="stylesheet" href="../ayu-highlight.css">
|
||||
|
||||
<!-- Custom theme stylesheets -->
|
||||
<link rel="stylesheet" href="../theme/polkadot.css">
|
||||
|
||||
</head>
|
||||
<body class="sidebar-visible no-js">
|
||||
<div id="body-container">
|
||||
<!-- Provide site root to javascript -->
|
||||
<script>
|
||||
var path_to_root = "../";
|
||||
var default_theme = window.matchMedia("(prefers-color-scheme: dark)").matches ? "polkadot" : "polkadot";
|
||||
</script>
|
||||
|
||||
<!-- Work around some values being stored in localStorage wrapped in quotes -->
|
||||
<script>
|
||||
try {
|
||||
var theme = localStorage.getItem('mdbook-theme');
|
||||
var sidebar = localStorage.getItem('mdbook-sidebar');
|
||||
|
||||
if (theme.startsWith('"') && theme.endsWith('"')) {
|
||||
localStorage.setItem('mdbook-theme', theme.slice(1, theme.length - 1));
|
||||
}
|
||||
|
||||
if (sidebar.startsWith('"') && sidebar.endsWith('"')) {
|
||||
localStorage.setItem('mdbook-sidebar', sidebar.slice(1, sidebar.length - 1));
|
||||
}
|
||||
} catch (e) { }
|
||||
</script>
|
||||
|
||||
<!-- Set the theme before any content is loaded, prevents flash -->
|
||||
<script>
|
||||
var theme;
|
||||
try { theme = localStorage.getItem('mdbook-theme'); } catch(e) { }
|
||||
if (theme === null || theme === undefined) { theme = default_theme; }
|
||||
var html = document.querySelector('html');
|
||||
html.classList.remove('polkadot')
|
||||
html.classList.add(theme);
|
||||
var body = document.querySelector('body');
|
||||
body.classList.remove('no-js')
|
||||
body.classList.add('js');
|
||||
</script>
|
||||
|
||||
<input type="checkbox" id="sidebar-toggle-anchor" class="hidden">
|
||||
|
||||
<!-- Hide / unhide sidebar before it is displayed -->
|
||||
<script>
|
||||
var body = document.querySelector('body');
|
||||
var sidebar = null;
|
||||
var sidebar_toggle = document.getElementById("sidebar-toggle-anchor");
|
||||
if (document.body.clientWidth >= 1080) {
|
||||
try { sidebar = localStorage.getItem('mdbook-sidebar'); } catch(e) { }
|
||||
sidebar = sidebar || 'visible';
|
||||
} else {
|
||||
sidebar = 'hidden';
|
||||
}
|
||||
sidebar_toggle.checked = sidebar === 'visible';
|
||||
body.classList.remove('sidebar-visible');
|
||||
body.classList.add("sidebar-" + sidebar);
|
||||
</script>
|
||||
|
||||
<nav id="sidebar" class="sidebar" aria-label="Table of contents">
|
||||
<div class="sidebar-scrollbox">
|
||||
<ol class="chapter"><li class="chapter-item expanded affix "><a href="../introduction.html">Introduction</a></li><li class="spacer"></li><li class="chapter-item expanded affix "><li class="part-title">Newly Proposed</li><li class="chapter-item expanded "><a href="../new/0120-referenda-confirmation-by-candle-mechanism.html" class="active">RFC-0120: Referenda Confirmation by Candle Mechanism</a></li><li class="chapter-item expanded "><a href="../new/0121-iterable-referenda-tracks.html">RFC-0121: Iterable Referenda Tracks</a></li><li class="chapter-item expanded "><a href="../new/0122-alias-origin-on-asset-transfers.html">RFC-0122: Asset transfers can alias XCM origin on destination to original origin</a></li><li class="spacer"></li><li class="chapter-item expanded affix "><li class="part-title">Proposed</li><li class="chapter-item expanded "><a href="../proposed/0000-rewards.html">RFC-0000: Validator Rewards</a></li><li class="chapter-item expanded "><a href="../proposed/0004-remove-unnecessary-allocator-usage.html">RFC-0004: Remove the host-side runtime memory allocator</a></li><li class="chapter-item expanded "><a href="../proposed/0006-dynamic-pricing-for-bulk-coretime-sales.html">RFC-0006: Dynamic Pricing for Bulk Coretime Sales</a></li><li class="chapter-item expanded "><a href="../proposed/0009-improved-net-light-client-requests.html">RFC-0009: Improved light client requests networking protocol</a></li><li class="chapter-item expanded "><a href="../proposed/0015-market-design-revisit.html">RFC-0015: Market Design Revisit</a></li><li class="chapter-item expanded "><a href="../proposed/0034-xcm-absolute-location-account-derivation.html">RFC-34: XCM Absolute Location Account Derivation</a></li><li class="chapter-item expanded "><a href="../proposed/0035-conviction-voting-delegation-modifications.html"> RFC-0035: Conviction Voting Delegation Modifications</a></li><li class="chapter-item expanded "><a href="../proposed/0044-rent-based-registration.html">RFC-0044: Rent based registration model</a></li><li class="chapter-item expanded "><a href="../proposed/0054-remove-heap-pages.html">RFC-0054: Remove the concept of "heap pages" from the client</a></li><li class="chapter-item expanded "><a href="../proposed/0070-x-track-kusamanetwork.html">RFC-0070: X Track for @kusamanetwork</a></li><li class="chapter-item expanded "><a href="../proposed/0073-referedum-deposit-track.html">RFC-0073: Decision Deposit Referendum Track</a></li><li class="chapter-item expanded "><a href="../proposed/0074-stateful-multisig-pallet.html">RFC-0074: Stateful Multisig Pallet</a></li><li class="chapter-item expanded "><a href="../proposed/0077-increase-max-length-of-identity-pgp-fingerprint-value.html">RFC-0077: Increase maximum length of identity PGP fingerprint values from 20 bytes</a></li><li class="chapter-item expanded "><a href="../proposed/0088-broker-pallet-slashable-deposit-purchaser-reputation-reserved-cores.html">RFC-0088: Add slashable locked deposit, purchaser reputation, and reserved cores for on-chain identities to broker pallet</a></li><li class="chapter-item expanded "><a href="../proposed/0089-flexible-inflation.html">RFC-0089: Flexible Inflation</a></li><li class="chapter-item expanded "><a href="../proposed/00xx-secondary-marketplace-for-regions.html">RFC-0001: Secondary Market for Regions</a></li><li class="chapter-item expanded "><a href="../proposed/00xx-smart-contracts-coretime-chain.html">RFC-0002: Smart Contracts on the Coretime Chain</a></li><li class="chapter-item expanded "><a href="../proposed/0106-xcm-remove-fees-mode.html">RFC-0106: Remove XCM fees mode</a></li><li class="chapter-item expanded "><a href="../proposed/0111-pure-proxy-replication.html">RFC-0111: Pure Proxy Replication</a></li><li class="chapter-item expanded "><a href="../proposed/0112-compress-state-response-message-in-state-sync.html">RFC-0112: Compress the State Response Message in State Sync</a></li><li class="chapter-item expanded "><a href="../proposed/0117-unbrick-collective.html">RFC-0117: The Unbrick Collective</a></li><li class="spacer"></li><li class="chapter-item expanded affix "><li class="part-title">Approved</li><li class="chapter-item expanded "><a href="../approved/0001-agile-coretime.html">RFC-1: Agile Coretime</a></li><li class="chapter-item expanded "><a href="../approved/0005-coretime-interface.html">RFC-5: Coretime Interface</a></li><li class="chapter-item expanded "><a href="../approved/0007-system-collator-selection.html">RFC-0007: System Collator Selection</a></li><li class="chapter-item expanded "><a href="../approved/0008-parachain-bootnodes-dht.html">RFC-0008: Store parachain bootnodes in relay chain DHT</a></li><li class="chapter-item expanded "><a href="../approved/0010-burn-coretime-revenue.html">RFC-0010: Burn Coretime Revenue</a></li><li class="chapter-item expanded "><a href="../approved/0012-process-for-adding-new-collectives.html">RFC-0012: Process for Adding New System Collectives</a></liLine truncated
|
||||
</div>
|
||||
<div id="sidebar-resize-handle" class="sidebar-resize-handle"></div>
|
||||
</nav>
|
||||
|
||||
<!-- Track and set sidebar scroll position -->
|
||||
<script>
|
||||
var sidebarScrollbox = document.querySelector('#sidebar .sidebar-scrollbox');
|
||||
sidebarScrollbox.addEventListener('click', function(e) {
|
||||
if (e.target.tagName === 'A') {
|
||||
sessionStorage.setItem('sidebar-scroll', sidebarScrollbox.scrollTop);
|
||||
}
|
||||
}, { passive: true });
|
||||
var sidebarScrollTop = sessionStorage.getItem('sidebar-scroll');
|
||||
sessionStorage.removeItem('sidebar-scroll');
|
||||
if (sidebarScrollTop) {
|
||||
// preserve sidebar scroll position when navigating via links within sidebar
|
||||
sidebarScrollbox.scrollTop = sidebarScrollTop;
|
||||
} else {
|
||||
// scroll sidebar to current active section when navigating via "next/previous chapter" buttons
|
||||
var activeSection = document.querySelector('#sidebar .active');
|
||||
if (activeSection) {
|
||||
activeSection.scrollIntoView({ block: 'center' });
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<div id="page-wrapper" class="page-wrapper">
|
||||
|
||||
<div class="page">
|
||||
<div id="menu-bar-hover-placeholder"></div>
|
||||
<div id="menu-bar" class="menu-bar sticky">
|
||||
<div class="left-buttons">
|
||||
<label id="sidebar-toggle" class="icon-button" for="sidebar-toggle-anchor" title="Toggle Table of Contents" aria-label="Toggle Table of Contents" aria-controls="sidebar">
|
||||
<i class="fa fa-bars"></i>
|
||||
</label>
|
||||
<button id="theme-toggle" class="icon-button" type="button" title="Change theme" aria-label="Change theme" aria-haspopup="true" aria-expanded="false" aria-controls="theme-list">
|
||||
<i class="fa fa-paint-brush"></i>
|
||||
</button>
|
||||
<ul id="theme-list" class="theme-popup" aria-label="Themes" role="menu">
|
||||
<li role="none"><button role="menuitem" class="theme" id="polkadot">Polkadot</button></li>
|
||||
<li role="none"><button role="menuitem" class="theme" id="light">Light</button></li>
|
||||
<li role="none"><button role="menuitem" class="theme" id="rust">Rust</button></li>
|
||||
<li role="none"><button role="menuitem" class="theme" id="coal">Coal</button></li>
|
||||
<li role="none"><button role="menuitem" class="theme" id="navy">Navy</button></li>
|
||||
<li role="none"><button role="menuitem" class="theme" id="ayu">Ayu</button></li>
|
||||
</ul>
|
||||
<button id="search-toggle" class="icon-button" type="button" title="Search. (Shortkey: s)" aria-label="Toggle Searchbar" aria-expanded="false" aria-keyshortcuts="S" aria-controls="searchbar">
|
||||
<i class="fa fa-search"></i>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<h1 class="menu-title">Polkadot Fellowship RFCs</h1>
|
||||
|
||||
<div class="right-buttons">
|
||||
<a href="../print.html" title="Print this book" aria-label="Print this book">
|
||||
<i id="print-button" class="fa fa-print"></i>
|
||||
</a>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="search-wrapper" class="hidden">
|
||||
<form id="searchbar-outer" class="searchbar-outer">
|
||||
<input type="search" id="searchbar" name="searchbar" placeholder="Search this book ..." aria-controls="searchresults-outer" aria-describedby="searchresults-header">
|
||||
</form>
|
||||
<div id="searchresults-outer" class="searchresults-outer hidden">
|
||||
<div id="searchresults-header" class="searchresults-header"></div>
|
||||
<ul id="searchresults">
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Apply ARIA attributes after the sidebar and the sidebar toggle button are added to the DOM -->
|
||||
<script>
|
||||
document.getElementById('sidebar-toggle').setAttribute('aria-expanded', sidebar === 'visible');
|
||||
document.getElementById('sidebar').setAttribute('aria-hidden', sidebar !== 'visible');
|
||||
Array.from(document.querySelectorAll('#sidebar a')).forEach(function(link) {
|
||||
link.setAttribute('tabIndex', sidebar === 'visible' ? 0 : -1);
|
||||
});
|
||||
</script>
|
||||
|
||||
<div id="content" class="content">
|
||||
<main>
|
||||
<p><a href="https://github.com/polkadot-fellows/RFCs/pull/120">(source)</a></p>
|
||||
<p><strong>Table of Contents</strong></p>
|
||||
<ul>
|
||||
<li><a href="#rfc-0120-referenda-confirmation-by-candle-mechanism">RFC-0120: Referenda Confirmation by Candle Mechanism</a>
|
||||
<ul>
|
||||
<li><a href="#summary">Summary</a></li>
|
||||
<li><a href="#motivation">Motivation</a></li>
|
||||
<li><a href="#stakeholders">Stakeholders</a></li>
|
||||
<li><a href="#explanation">Explanation</a></li>
|
||||
<li><a href="#drawbacks">Drawbacks</a></li>
|
||||
<li><a href="#testing-security-and-privacy">Testing, Security, and Privacy</a></li>
|
||||
<li><a href="#performance-ergonomics-and-compatibility">Performance, Ergonomics, and Compatibility</a>
|
||||
<ul>
|
||||
<li><a href="#performance">Performance</a></li>
|
||||
<li><a href="#ergonomics">Ergonomics</a></li>
|
||||
<li><a href="#compatibility">Compatibility</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#prior-art-and-references">Prior Art and References</a></li>
|
||||
<li><a href="#unresolved-questions">Unresolved Questions</a></li>
|
||||
<li><a href="#future-directions-and-related-material">Future Directions and Related Material</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
<h1 id="rfc-0120-referenda-confirmation-by-candle-mechanism"><a class="header" href="#rfc-0120-referenda-confirmation-by-candle-mechanism">RFC-0120: Referenda Confirmation by Candle Mechanism</a></h1>
|
||||
<div class="table-wrapper"><table><thead><tr><th></th><th></th></tr></thead><tbody>
|
||||
<tr><td><strong>Start Date</strong></td><td>22 March 2024</td></tr>
|
||||
<tr><td><strong>Description</strong></td><td>Proposal to decide polls after confirm period via a mechanism similar to a candle auction</td></tr>
|
||||
<tr><td><strong>Authors</strong></td><td>Pablo Dorado, Daniel Olano</td></tr>
|
||||
</tbody></table>
|
||||
</div>
|
||||
<h2 id="summary"><a class="header" href="#summary">Summary</a></h2>
|
||||
<p>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.</p>
|
||||
<h2 id="motivation"><a class="header" href="#motivation">Motivation</a></h2>
|
||||
<p>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
|
||||
uses the the public nature of the tally of a poll as a way of determining the best point in time to
|
||||
alter a poll in a meaningful way.</p>
|
||||
<p>While this behaviour is expected based on the current design of the referenda logic, given the
|
||||
recent extension of ongoing times (up to 1 month), the incentives for a bad actor to cause losses
|
||||
on a proposer, reflected as wasted cost of opportunity increase, and thus, this otherwise
|
||||
reasonable outcome becomes an attack vector, a potential risk to mitigate, especially when such
|
||||
attack can compromise critical guarantees of the protocol (such as its upgradeability).</p>
|
||||
<p>To mitigate this, the referenda underlying mechanisms should incentive actors to cast their votes
|
||||
on a poll as early as possible. This proposal's approach suggests using a Candle Auction that will
|
||||
be determined right after the confirm period finishes, thus decreasing the chances of actors to
|
||||
alter the results of a poll on confirming state, and instead incentivizing them to cast their votes
|
||||
earlier, on deciding state.</p>
|
||||
<h2 id="stakeholders"><a class="header" href="#stakeholders">Stakeholders</a></h2>
|
||||
<ul>
|
||||
<li><strong>Governance actors</strong>: Tokenholders and Collectives that vote on polls that have this mechanism
|
||||
enabled should be aware this change affects the outcome of failing a poll on its confirm period.</li>
|
||||
<li><strong>Runtime Developers</strong>: This change requires runtime developers to change configuration
|
||||
parameters for the Referenda Pallet.</li>
|
||||
<li><strong>Tooling and UI developers</strong>: Applications that interact with referenda must update to reflect
|
||||
the new <code>Finalizing</code> state.</li>
|
||||
</ul>
|
||||
<h2 id="explanation"><a class="header" href="#explanation">Explanation</a></h2>
|
||||
<p>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
|
||||
forward to confirm period, and still, go back in case the poll fails. Once the decision period
|
||||
ends, a failure of the poll in the confirm period will lead to the poll to ultimately be rejected.</p>
|
||||
<pre><code class="language-mermaid">stateDiagram-v2
|
||||
sb: Submission
|
||||
pp: Preparation Period
|
||||
dp: Decision Period
|
||||
cp: Confirmation Period
|
||||
state dpd <<choice>>
|
||||
state ps <<choice>>
|
||||
cf: Approved
|
||||
rj: Rejected
|
||||
|
||||
[*] --> sb
|
||||
sb --> pp
|
||||
pp --> dp: decision period starts
|
||||
dp --> cp: poll is passing
|
||||
dp --> ps: decision period ends
|
||||
ps --> cp: poll is passing
|
||||
cp --> dpd: poll fails
|
||||
dpd --> dp: decision period not deadlined
|
||||
ps --> rj: poll is failing
|
||||
dpd --> rj: decision period deadlined
|
||||
cp --> cf
|
||||
cf --> [*]
|
||||
rj --> [*]
|
||||
</code></pre>
|
||||
<p>This specification proposes three changes to implement this candle mechanism:</p>
|
||||
<ol>
|
||||
<li>
|
||||
<p>This mechanism MUST be enabled via a configuration parameter. Once enabled, the referenda system
|
||||
MAY record the next poll ID from which to start enabling this mechanism. This is to preserve
|
||||
backwards compatibility with currently ongoing polls.</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>A record of the poll status (whether it is passing or not) is stored once the decision period is
|
||||
finished.</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>Including a <strong>Finalization</strong> period as part of the ongoing state. From this point, the poll MUST
|
||||
be immutable at this point.</p>
|
||||
<p>This period begins the moment after confirm period ends, and extends the decision for a couple
|
||||
of blocks, until the <a href="https://en.wikipedia.org/wiki/Verifiable_random_function">VRF</a> seed used to determine the candle block can be considered
|
||||
<em>"good enough"</em>. This is, not known before the ongoing period (decision/confirmation) was over.</p>
|
||||
<p>Once that happens, a random block within the confirm period is chosen, and the decision of
|
||||
approving or rejecting the poll is based on the status immediately before the block where the
|
||||
candle was <em>"lit-off"</em>.</p>
|
||||
</li>
|
||||
</ol>
|
||||
<p>When enabled, the state diagram for the referenda system is the following:</p>
|
||||
<pre><code class="language-mermaid">stateDiagram-v2
|
||||
sb: Submission
|
||||
pp: Preparation Period
|
||||
dp: Decision Period
|
||||
cp: Confirmation Period
|
||||
cds: Finalization
|
||||
state dpd <<choice>>
|
||||
state ps <<choice>>
|
||||
state cd <<choice>>
|
||||
cf: Approved
|
||||
rj: Rejected
|
||||
|
||||
[*] --> sb
|
||||
sb --> pp
|
||||
pp --> dp: decision period starts
|
||||
dp --> cp: poll is passing
|
||||
ps --> cp: poll is passing
|
||||
dp --> ps: decision period ends
|
||||
ps --> rj: poll is failing
|
||||
cp --> dpd: poll fails
|
||||
dpd --> cp: decision period over
|
||||
dpd --> dp: decision period not over
|
||||
cp --> cds: confirmation period ends
|
||||
cds --> cd: define moment when candle lit-off
|
||||
cd --> cf: poll passed
|
||||
cd --> rj: poll failed
|
||||
cf --> [*]
|
||||
rj --> [*]
|
||||
</code></pre>
|
||||
<h2 id="drawbacks"><a class="header" href="#drawbacks">Drawbacks</a></h2>
|
||||
<p>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.</p>
|
||||
<p>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.</p>
|
||||
<h2 id="testing-security-and-privacy"><a class="header" href="#testing-security-and-privacy">Testing, Security, and Privacy</a></h2>
|
||||
<p>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.</p>
|
||||
<p>An audit will be required to ensure the implementation doesn't introduce unwanted side effects.</p>
|
||||
<p>There are no privacy related concerns.</p>
|
||||
<h2 id="performance-ergonomics-and-compatibility"><a class="header" href="#performance-ergonomics-and-compatibility">Performance, Ergonomics, and Compatibility</a></h2>
|
||||
<h3 id="performance"><a class="header" href="#performance">Performance</a></h3>
|
||||
<p>The added steps imply pessimization, necessary to meet the expected changes. An implementation MUST
|
||||
exit from the <strong>Finalization</strong> period as early as possible to minimize this impact.</p>
|
||||
<h3 id="ergonomics"><a class="header" href="#ergonomics">Ergonomics</a></h3>
|
||||
<p>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).</p>
|
||||
<h3 id="compatibility"><a class="header" href="#compatibility">Compatibility</a></h3>
|
||||
<p>This proposal does not break compatibility with existing interfaces, older versions, but it alters the
|
||||
previous implementation of the referendum processing algorithm.</p>
|
||||
<p>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.</p>
|
||||
<h2 id="prior-art-and-references"><a class="header" href="#prior-art-and-references">Prior Art and References</a></h2>
|
||||
<ul>
|
||||
<li><a href="https://docs.rs/polkadot-runtime-common/16.0.0/polkadot_runtime_common/auctions/index.html">Auctions pallet</a> in <a href="https://crates.io/crates/polkadot-runtime-common"><code>polkadot-runtime-commont</code></a>: Defines the mechanism of candle auctions.</li>
|
||||
<li><strong>PBA Book</strong>: A good place to read about <a href="https://polkadot-blockchain-academy.github.io/pba-book/cryptography/exotic-primitives/page.html?highlight=vrf#verifiable-random-functionsvrfs">VRFs</a>.</li>
|
||||
</ul>
|
||||
<h2 id="unresolved-questions"><a class="header" href="#unresolved-questions">Unresolved Questions</a></h2>
|
||||
<ul>
|
||||
<li>How to determine in a statistically meaningful way that a change in the poll status corresponds to an
|
||||
organic behaviour, and not an unwanted, malicious behaviour?</li>
|
||||
</ul>
|
||||
<h2 id="future-directions-and-related-material"><a class="header" href="#future-directions-and-related-material">Future Directions and Related Material</a></h2>
|
||||
<p>A proposed implementation of this change can be seen on this <a href="https://github.com/virto-network/polkadot-sdk/pull/4">Pull Request</a>.</p>
|
||||
|
||||
</main>
|
||||
|
||||
<nav class="nav-wrapper" aria-label="Page navigation">
|
||||
<!-- Mobile navigation buttons -->
|
||||
<a rel="prev" href="../introduction.html" class="mobile-nav-chapters previous" title="Previous chapter" aria-label="Previous chapter" aria-keyshortcuts="Left">
|
||||
<i class="fa fa-angle-left"></i>
|
||||
</a>
|
||||
|
||||
<a rel="next prefetch" href="../new/0121-iterable-referenda-tracks.html" class="mobile-nav-chapters next" title="Next chapter" aria-label="Next chapter" aria-keyshortcuts="Right">
|
||||
<i class="fa fa-angle-right"></i>
|
||||
</a>
|
||||
|
||||
<div style="clear: both"></div>
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<nav class="nav-wide-wrapper" aria-label="Page navigation">
|
||||
<a rel="prev" href="../introduction.html" class="nav-chapters previous" title="Previous chapter" aria-label="Previous chapter" aria-keyshortcuts="Left">
|
||||
<i class="fa fa-angle-left"></i>
|
||||
</a>
|
||||
|
||||
<a rel="next prefetch" href="../new/0121-iterable-referenda-tracks.html" class="nav-chapters next" title="Next chapter" aria-label="Next chapter" aria-keyshortcuts="Right">
|
||||
<i class="fa fa-angle-right"></i>
|
||||
</a>
|
||||
</nav>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<script>
|
||||
window.playground_copyable = true;
|
||||
</script>
|
||||
|
||||
|
||||
<script src="../elasticlunr.min.js"></script>
|
||||
<script src="../mark.min.js"></script>
|
||||
<script src="../searcher.js"></script>
|
||||
|
||||
<script src="../clipboard.min.js"></script>
|
||||
<script src="../highlight.js"></script>
|
||||
<script src="../book.js"></script>
|
||||
|
||||
<!-- Custom JS scripts -->
|
||||
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,338 +0,0 @@
|
||||
|
||||
<!DOCTYPE HTML>
|
||||
<html lang="en" class="polkadot" dir="ltr">
|
||||
<head>
|
||||
<!-- Book generated using mdBook -->
|
||||
<meta charset="UTF-8">
|
||||
<title>RFC-0121: Iterable Referenda Tracks - Polkadot Fellowship RFCs</title>
|
||||
|
||||
|
||||
<!-- Custom HTML head -->
|
||||
|
||||
<meta name="description" content="An online book of RFCs approved or proposed within the Polkadot Fellowship.">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta name="theme-color" content="#ffffff">
|
||||
|
||||
<link rel="icon" href="../favicon.svg">
|
||||
<link rel="shortcut icon" href="../favicon.png">
|
||||
<link rel="stylesheet" href="../css/variables.css">
|
||||
<link rel="stylesheet" href="../css/general.css">
|
||||
<link rel="stylesheet" href="../css/chrome.css">
|
||||
<link rel="stylesheet" href="../css/print.css" media="print">
|
||||
|
||||
<!-- Fonts -->
|
||||
<link rel="stylesheet" href="../FontAwesome/css/font-awesome.css">
|
||||
<link rel="stylesheet" href="../fonts/fonts.css">
|
||||
|
||||
<!-- Highlight.js Stylesheets -->
|
||||
<link rel="stylesheet" href="../highlight.css">
|
||||
<link rel="stylesheet" href="../tomorrow-night.css">
|
||||
<link rel="stylesheet" href="../ayu-highlight.css">
|
||||
|
||||
<!-- Custom theme stylesheets -->
|
||||
<link rel="stylesheet" href="../theme/polkadot.css">
|
||||
|
||||
</head>
|
||||
<body class="sidebar-visible no-js">
|
||||
<div id="body-container">
|
||||
<!-- Provide site root to javascript -->
|
||||
<script>
|
||||
var path_to_root = "../";
|
||||
var default_theme = window.matchMedia("(prefers-color-scheme: dark)").matches ? "polkadot" : "polkadot";
|
||||
</script>
|
||||
|
||||
<!-- Work around some values being stored in localStorage wrapped in quotes -->
|
||||
<script>
|
||||
try {
|
||||
var theme = localStorage.getItem('mdbook-theme');
|
||||
var sidebar = localStorage.getItem('mdbook-sidebar');
|
||||
|
||||
if (theme.startsWith('"') && theme.endsWith('"')) {
|
||||
localStorage.setItem('mdbook-theme', theme.slice(1, theme.length - 1));
|
||||
}
|
||||
|
||||
if (sidebar.startsWith('"') && sidebar.endsWith('"')) {
|
||||
localStorage.setItem('mdbook-sidebar', sidebar.slice(1, sidebar.length - 1));
|
||||
}
|
||||
} catch (e) { }
|
||||
</script>
|
||||
|
||||
<!-- Set the theme before any content is loaded, prevents flash -->
|
||||
<script>
|
||||
var theme;
|
||||
try { theme = localStorage.getItem('mdbook-theme'); } catch(e) { }
|
||||
if (theme === null || theme === undefined) { theme = default_theme; }
|
||||
var html = document.querySelector('html');
|
||||
html.classList.remove('polkadot')
|
||||
html.classList.add(theme);
|
||||
var body = document.querySelector('body');
|
||||
body.classList.remove('no-js')
|
||||
body.classList.add('js');
|
||||
</script>
|
||||
|
||||
<input type="checkbox" id="sidebar-toggle-anchor" class="hidden">
|
||||
|
||||
<!-- Hide / unhide sidebar before it is displayed -->
|
||||
<script>
|
||||
var body = document.querySelector('body');
|
||||
var sidebar = null;
|
||||
var sidebar_toggle = document.getElementById("sidebar-toggle-anchor");
|
||||
if (document.body.clientWidth >= 1080) {
|
||||
try { sidebar = localStorage.getItem('mdbook-sidebar'); } catch(e) { }
|
||||
sidebar = sidebar || 'visible';
|
||||
} else {
|
||||
sidebar = 'hidden';
|
||||
}
|
||||
sidebar_toggle.checked = sidebar === 'visible';
|
||||
body.classList.remove('sidebar-visible');
|
||||
body.classList.add("sidebar-" + sidebar);
|
||||
</script>
|
||||
|
||||
<nav id="sidebar" class="sidebar" aria-label="Table of contents">
|
||||
<div class="sidebar-scrollbox">
|
||||
<ol class="chapter"><li class="chapter-item expanded affix "><a href="../introduction.html">Introduction</a></li><li class="spacer"></li><li class="chapter-item expanded affix "><li class="part-title">Newly Proposed</li><li class="chapter-item expanded "><a href="../new/0120-referenda-confirmation-by-candle-mechanism.html">RFC-0120: Referenda Confirmation by Candle Mechanism</a></li><li class="chapter-item expanded "><a href="../new/0121-iterable-referenda-tracks.html" class="active">RFC-0121: Iterable Referenda Tracks</a></li><li class="chapter-item expanded "><a href="../new/0122-alias-origin-on-asset-transfers.html">RFC-0122: Asset transfers can alias XCM origin on destination to original origin</a></li><li class="spacer"></li><li class="chapter-item expanded affix "><li class="part-title">Proposed</li><li class="chapter-item expanded "><a href="../proposed/0000-rewards.html">RFC-0000: Validator Rewards</a></li><li class="chapter-item expanded "><a href="../proposed/0004-remove-unnecessary-allocator-usage.html">RFC-0004: Remove the host-side runtime memory allocator</a></li><li class="chapter-item expanded "><a href="../proposed/0006-dynamic-pricing-for-bulk-coretime-sales.html">RFC-0006: Dynamic Pricing for Bulk Coretime Sales</a></li><li class="chapter-item expanded "><a href="../proposed/0009-improved-net-light-client-requests.html">RFC-0009: Improved light client requests networking protocol</a></li><li class="chapter-item expanded "><a href="../proposed/0015-market-design-revisit.html">RFC-0015: Market Design Revisit</a></li><li class="chapter-item expanded "><a href="../proposed/0034-xcm-absolute-location-account-derivation.html">RFC-34: XCM Absolute Location Account Derivation</a></li><li class="chapter-item expanded "><a href="../proposed/0035-conviction-voting-delegation-modifications.html"> RFC-0035: Conviction Voting Delegation Modifications</a></li><li class="chapter-item expanded "><a href="../proposed/0044-rent-based-registration.html">RFC-0044: Rent based registration model</a></li><li class="chapter-item expanded "><a href="../proposed/0054-remove-heap-pages.html">RFC-0054: Remove the concept of "heap pages" from the client</a></li><li class="chapter-item expanded "><a href="../proposed/0070-x-track-kusamanetwork.html">RFC-0070: X Track for @kusamanetwork</a></li><li class="chapter-item expanded "><a href="../proposed/0073-referedum-deposit-track.html">RFC-0073: Decision Deposit Referendum Track</a></li><li class="chapter-item expanded "><a href="../proposed/0074-stateful-multisig-pallet.html">RFC-0074: Stateful Multisig Pallet</a></li><li class="chapter-item expanded "><a href="../proposed/0077-increase-max-length-of-identity-pgp-fingerprint-value.html">RFC-0077: Increase maximum length of identity PGP fingerprint values from 20 bytes</a></li><li class="chapter-item expanded "><a href="../proposed/0088-broker-pallet-slashable-deposit-purchaser-reputation-reserved-cores.html">RFC-0088: Add slashable locked deposit, purchaser reputation, and reserved cores for on-chain identities to broker pallet</a></li><li class="chapter-item expanded "><a href="../proposed/0089-flexible-inflation.html">RFC-0089: Flexible Inflation</a></li><li class="chapter-item expanded "><a href="../proposed/00xx-secondary-marketplace-for-regions.html">RFC-0001: Secondary Market for Regions</a></li><li class="chapter-item expanded "><a href="../proposed/00xx-smart-contracts-coretime-chain.html">RFC-0002: Smart Contracts on the Coretime Chain</a></li><li class="chapter-item expanded "><a href="../proposed/0106-xcm-remove-fees-mode.html">RFC-0106: Remove XCM fees mode</a></li><li class="chapter-item expanded "><a href="../proposed/0111-pure-proxy-replication.html">RFC-0111: Pure Proxy Replication</a></li><li class="chapter-item expanded "><a href="../proposed/0112-compress-state-response-message-in-state-sync.html">RFC-0112: Compress the State Response Message in State Sync</a></li><li class="chapter-item expanded "><a href="../proposed/0117-unbrick-collective.html">RFC-0117: The Unbrick Collective</a></li><li class="spacer"></li><li class="chapter-item expanded affix "><li class="part-title">Approved</li><li class="chapter-item expanded "><a href="../approved/0001-agile-coretime.html">RFC-1: Agile Coretime</a></li><li class="chapter-item expanded "><a href="../approved/0005-coretime-interface.html">RFC-5: Coretime Interface</a></li><li class="chapter-item expanded "><a href="../approved/0007-system-collator-selection.html">RFC-0007: System Collator Selection</a></li><li class="chapter-item expanded "><a href="../approved/0008-parachain-bootnodes-dht.html">RFC-0008: Store parachain bootnodes in relay chain DHT</a></li><li class="chapter-item expanded "><a href="../approved/0010-burn-coretime-revenue.html">RFC-0010: Burn Coretime Revenue</a></li><li class="chapter-item expanded "><a href="../approved/0012-process-for-adding-new-collectives.html">RFC-0012: Process for Adding New System Collectives</a></liLine truncated
|
||||
</div>
|
||||
<div id="sidebar-resize-handle" class="sidebar-resize-handle"></div>
|
||||
</nav>
|
||||
|
||||
<!-- Track and set sidebar scroll position -->
|
||||
<script>
|
||||
var sidebarScrollbox = document.querySelector('#sidebar .sidebar-scrollbox');
|
||||
sidebarScrollbox.addEventListener('click', function(e) {
|
||||
if (e.target.tagName === 'A') {
|
||||
sessionStorage.setItem('sidebar-scroll', sidebarScrollbox.scrollTop);
|
||||
}
|
||||
}, { passive: true });
|
||||
var sidebarScrollTop = sessionStorage.getItem('sidebar-scroll');
|
||||
sessionStorage.removeItem('sidebar-scroll');
|
||||
if (sidebarScrollTop) {
|
||||
// preserve sidebar scroll position when navigating via links within sidebar
|
||||
sidebarScrollbox.scrollTop = sidebarScrollTop;
|
||||
} else {
|
||||
// scroll sidebar to current active section when navigating via "next/previous chapter" buttons
|
||||
var activeSection = document.querySelector('#sidebar .active');
|
||||
if (activeSection) {
|
||||
activeSection.scrollIntoView({ block: 'center' });
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<div id="page-wrapper" class="page-wrapper">
|
||||
|
||||
<div class="page">
|
||||
<div id="menu-bar-hover-placeholder"></div>
|
||||
<div id="menu-bar" class="menu-bar sticky">
|
||||
<div class="left-buttons">
|
||||
<label id="sidebar-toggle" class="icon-button" for="sidebar-toggle-anchor" title="Toggle Table of Contents" aria-label="Toggle Table of Contents" aria-controls="sidebar">
|
||||
<i class="fa fa-bars"></i>
|
||||
</label>
|
||||
<button id="theme-toggle" class="icon-button" type="button" title="Change theme" aria-label="Change theme" aria-haspopup="true" aria-expanded="false" aria-controls="theme-list">
|
||||
<i class="fa fa-paint-brush"></i>
|
||||
</button>
|
||||
<ul id="theme-list" class="theme-popup" aria-label="Themes" role="menu">
|
||||
<li role="none"><button role="menuitem" class="theme" id="polkadot">Polkadot</button></li>
|
||||
<li role="none"><button role="menuitem" class="theme" id="light">Light</button></li>
|
||||
<li role="none"><button role="menuitem" class="theme" id="rust">Rust</button></li>
|
||||
<li role="none"><button role="menuitem" class="theme" id="coal">Coal</button></li>
|
||||
<li role="none"><button role="menuitem" class="theme" id="navy">Navy</button></li>
|
||||
<li role="none"><button role="menuitem" class="theme" id="ayu">Ayu</button></li>
|
||||
</ul>
|
||||
<button id="search-toggle" class="icon-button" type="button" title="Search. (Shortkey: s)" aria-label="Toggle Searchbar" aria-expanded="false" aria-keyshortcuts="S" aria-controls="searchbar">
|
||||
<i class="fa fa-search"></i>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<h1 class="menu-title">Polkadot Fellowship RFCs</h1>
|
||||
|
||||
<div class="right-buttons">
|
||||
<a href="../print.html" title="Print this book" aria-label="Print this book">
|
||||
<i id="print-button" class="fa fa-print"></i>
|
||||
</a>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="search-wrapper" class="hidden">
|
||||
<form id="searchbar-outer" class="searchbar-outer">
|
||||
<input type="search" id="searchbar" name="searchbar" placeholder="Search this book ..." aria-controls="searchresults-outer" aria-describedby="searchresults-header">
|
||||
</form>
|
||||
<div id="searchresults-outer" class="searchresults-outer hidden">
|
||||
<div id="searchresults-header" class="searchresults-header"></div>
|
||||
<ul id="searchresults">
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Apply ARIA attributes after the sidebar and the sidebar toggle button are added to the DOM -->
|
||||
<script>
|
||||
document.getElementById('sidebar-toggle').setAttribute('aria-expanded', sidebar === 'visible');
|
||||
document.getElementById('sidebar').setAttribute('aria-hidden', sidebar !== 'visible');
|
||||
Array.from(document.querySelectorAll('#sidebar a')).forEach(function(link) {
|
||||
link.setAttribute('tabIndex', sidebar === 'visible' ? 0 : -1);
|
||||
});
|
||||
</script>
|
||||
|
||||
<div id="content" class="content">
|
||||
<main>
|
||||
<p><a href="https://github.com/polkadot-fellows/RFCs/pull/121">(source)</a></p>
|
||||
<p><strong>Table of Contents</strong></p>
|
||||
<ul>
|
||||
<li><a href="#rfc-0121-iterable-referenda-tracks">RFC-0121: Iterable Referenda Tracks</a>
|
||||
<ul>
|
||||
<li><a href="#summary">Summary</a></li>
|
||||
<li><a href="#motivation">Motivation</a></li>
|
||||
<li><a href="#stakeholders">Stakeholders</a></li>
|
||||
<li><a href="#explanation">Explanation</a></li>
|
||||
<li><a href="#drawbacks">Drawbacks</a></li>
|
||||
<li><a href="#testing-security-and-privacy">Testing, Security, and Privacy</a></li>
|
||||
<li><a href="#performance-ergonomics-and-compatibility">Performance, Ergonomics, and Compatibility</a>
|
||||
<ul>
|
||||
<li><a href="#performance">Performance</a></li>
|
||||
<li><a href="#ergonomics">Ergonomics</a></li>
|
||||
<li><a href="#compatibility">Compatibility</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#prior-art-and-references">Prior Art and References</a></li>
|
||||
<li><a href="#unresolved-questions">Unresolved Questions</a></li>
|
||||
<li><a href="#future-directions-and-related-material">Future Directions and Related Material</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
<h1 id="rfc-0121-iterable-referenda-tracks"><a class="header" href="#rfc-0121-iterable-referenda-tracks">RFC-0121: Iterable Referenda Tracks</a></h1>
|
||||
<div class="table-wrapper"><table><thead><tr><th></th><th></th></tr></thead><tbody>
|
||||
<tr><td><strong>Start Date</strong></td><td>17 September 2024</td></tr>
|
||||
<tr><td><strong>Description</strong></td><td>Allow dynamic modifications of referenda tracks at runtime without the need for a full runtime upgrade.</td></tr>
|
||||
<tr><td><strong>Authors</strong></td><td>Pablo Dorado, Daniel Olano</td></tr>
|
||||
</tbody></table>
|
||||
</div>
|
||||
<h2 id="summary"><a class="header" href="#summary">Summary</a></h2>
|
||||
<p>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
|
||||
<code>TracksInfo</code> 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.</p>
|
||||
<h2 id="motivation"><a class="header" href="#motivation">Motivation</a></h2>
|
||||
<p>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
|
||||
is scheduled and executed. The new system provides the flexibility needed to adjust tracks
|
||||
dynamically, reflecting real-time changes in governance needs without the latency and risks
|
||||
associated with runtime upgrades. This reduces governance bottlenecks and allows for quicker
|
||||
adaptation to emergent scenarios.</p>
|
||||
<h2 id="stakeholders"><a class="header" href="#stakeholders">Stakeholders</a></h2>
|
||||
<ul>
|
||||
<li><strong>Network stakeholders</strong>: the change means reduced coordination effort for track adjustments.</li>
|
||||
<li><strong>Governance participants</strong>: this enables more responsive decision-making pathways.</li>
|
||||
</ul>
|
||||
<h2 id="explanation"><a class="header" href="#explanation">Explanation</a></h2>
|
||||
<p>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
|
||||
through runtime rather than being hardcoded in the protocol. This system ensures that tracks are
|
||||
adjustable at any time, reducing upgrade-related complexities and introducing agility in how
|
||||
governance tracks are applied. This modification does not disrupt existing governance mechanisms but
|
||||
rather enhances them by increasing adaptability.</p>
|
||||
<p>In terms of technical structure, <code>TracksInfo::tracks</code> will now return iterators, making it possible
|
||||
to alter track configurations based on storage data rather than static definitions. This opens up
|
||||
possibilities for new track types and governance configurations to be deployed without the need for
|
||||
upgrades that might take up weeks.</p>
|
||||
<h2 id="drawbacks"><a class="header" href="#drawbacks">Drawbacks</a></h2>
|
||||
<p>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.</p>
|
||||
<p>Additionally, this flexibility could introduce risks if track configurations are modified improperly
|
||||
during runtime, potentially leading to governance instabilities.</p>
|
||||
<h2 id="testing-security-and-privacy"><a class="header" href="#testing-security-and-privacy">Testing, Security, and Privacy</a></h2>
|
||||
<p>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.</p>
|
||||
<p>The proposal doesn't introduce privacy risks but increases the need for ensuring that any runtime
|
||||
changes do not inadvertently lead to insecure governance structures.</p>
|
||||
<p>Comprehensive tests should be conducted to validate correct track modifications in different
|
||||
governance scenarios.</p>
|
||||
<h2 id="performance-ergonomics-and-compatibility"><a class="header" href="#performance-ergonomics-and-compatibility">Performance, Ergonomics, and Compatibility</a></h2>
|
||||
<h3 id="performance"><a class="header" href="#performance">Performance</a></h3>
|
||||
<p>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.</p>
|
||||
<h3 id="ergonomics"><a class="header" href="#ergonomics">Ergonomics</a></h3>
|
||||
<p>Developers and governance actors benefit from simplified governance processes but must account for
|
||||
the technical complexity of managing iterator-based track configurations.</p>
|
||||
<p>Tools may need to be developed to help streamline track adjustments in runtime.</p>
|
||||
<h3 id="compatibility"><a class="header" href="#compatibility">Compatibility</a></h3>
|
||||
<p>The change is backward compatible with existing governance operations, and does not require developers
|
||||
to adjust how they interact with referenda tracks.</p>
|
||||
<p>A migration is required to convert existing statically-defined tracks to dynamic storage-based
|
||||
configurations without disruption.</p>
|
||||
<h2 id="prior-art-and-references"><a class="header" href="#prior-art-and-references">Prior Art and References</a></h2>
|
||||
<p>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
|
||||
them to Polkadot’s decentralized, runtime-upgradable architecture.</p>
|
||||
<h2 id="unresolved-questions"><a class="header" href="#unresolved-questions">Unresolved Questions</a></h2>
|
||||
<ul>
|
||||
<li>How to handle governance transitions for currently ongoing referenda when changing configuration
|
||||
parameters of an existing track? Ideally, most tracks should not have to go through this change,
|
||||
but some tactics might be applied (like a proposal that reduces the ongoing queue before a major
|
||||
change and then executes the change, after a reasonable period of time has elapsed and no ongoing
|
||||
referenda exists for that track).</li>
|
||||
</ul>
|
||||
<h2 id="future-directions-and-related-material"><a class="header" href="#future-directions-and-related-material">Future Directions and Related Material</a></h2>
|
||||
<p>There are already two proposed solutions for both the implementation and</p>
|
||||
<ul>
|
||||
<li>This <a href="https://github.com/paritytech/polkadot-sdk/pull/2072">Pull Request</a> proposes changing <code>pallet-referenda</code>'s <code>TracksInfo</code> to make <code>tracks</code>
|
||||
return an iterator.</li>
|
||||
<li>There is already a proposed implementation of <a href="https://github.com/virto-network/frame-contrib/tree/main/pallets/referenda-tracks"><code>pallet-referenda-tracks</code></a>, which
|
||||
stores the configurations, and implements <code>TracksInfo</code> using the iterator approach.</li>
|
||||
</ul>
|
||||
|
||||
</main>
|
||||
|
||||
<nav class="nav-wrapper" aria-label="Page navigation">
|
||||
<!-- Mobile navigation buttons -->
|
||||
<a rel="prev" href="../new/0120-referenda-confirmation-by-candle-mechanism.html" class="mobile-nav-chapters previous" title="Previous chapter" aria-label="Previous chapter" aria-keyshortcuts="Left">
|
||||
<i class="fa fa-angle-left"></i>
|
||||
</a>
|
||||
|
||||
<a rel="next prefetch" href="../new/0122-alias-origin-on-asset-transfers.html" class="mobile-nav-chapters next" title="Next chapter" aria-label="Next chapter" aria-keyshortcuts="Right">
|
||||
<i class="fa fa-angle-right"></i>
|
||||
</a>
|
||||
|
||||
<div style="clear: both"></div>
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<nav class="nav-wide-wrapper" aria-label="Page navigation">
|
||||
<a rel="prev" href="../new/0120-referenda-confirmation-by-candle-mechanism.html" class="nav-chapters previous" title="Previous chapter" aria-label="Previous chapter" aria-keyshortcuts="Left">
|
||||
<i class="fa fa-angle-left"></i>
|
||||
</a>
|
||||
|
||||
<a rel="next prefetch" href="../new/0122-alias-origin-on-asset-transfers.html" class="nav-chapters next" title="Next chapter" aria-label="Next chapter" aria-keyshortcuts="Right">
|
||||
<i class="fa fa-angle-right"></i>
|
||||
</a>
|
||||
</nav>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<script>
|
||||
window.playground_copyable = true;
|
||||
</script>
|
||||
|
||||
|
||||
<script src="../elasticlunr.min.js"></script>
|
||||
<script src="../mark.min.js"></script>
|
||||
<script src="../searcher.js"></script>
|
||||
|
||||
<script src="../clipboard.min.js"></script>
|
||||
<script src="../highlight.js"></script>
|
||||
<script src="../book.js"></script>
|
||||
|
||||
<!-- Custom JS scripts -->
|
||||
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,355 +0,0 @@
|
||||
|
||||
<!DOCTYPE HTML>
|
||||
<html lang="en" class="polkadot" dir="ltr">
|
||||
<head>
|
||||
<!-- Book generated using mdBook -->
|
||||
<meta charset="UTF-8">
|
||||
<title>RFC-0122: Asset transfers can alias XCM origin on destination to original origin - Polkadot Fellowship RFCs</title>
|
||||
|
||||
|
||||
<!-- Custom HTML head -->
|
||||
|
||||
<meta name="description" content="An online book of RFCs approved or proposed within the Polkadot Fellowship.">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta name="theme-color" content="#ffffff">
|
||||
|
||||
<link rel="icon" href="../favicon.svg">
|
||||
<link rel="shortcut icon" href="../favicon.png">
|
||||
<link rel="stylesheet" href="../css/variables.css">
|
||||
<link rel="stylesheet" href="../css/general.css">
|
||||
<link rel="stylesheet" href="../css/chrome.css">
|
||||
<link rel="stylesheet" href="../css/print.css" media="print">
|
||||
|
||||
<!-- Fonts -->
|
||||
<link rel="stylesheet" href="../FontAwesome/css/font-awesome.css">
|
||||
<link rel="stylesheet" href="../fonts/fonts.css">
|
||||
|
||||
<!-- Highlight.js Stylesheets -->
|
||||
<link rel="stylesheet" href="../highlight.css">
|
||||
<link rel="stylesheet" href="../tomorrow-night.css">
|
||||
<link rel="stylesheet" href="../ayu-highlight.css">
|
||||
|
||||
<!-- Custom theme stylesheets -->
|
||||
<link rel="stylesheet" href="../theme/polkadot.css">
|
||||
|
||||
</head>
|
||||
<body class="sidebar-visible no-js">
|
||||
<div id="body-container">
|
||||
<!-- Provide site root to javascript -->
|
||||
<script>
|
||||
var path_to_root = "../";
|
||||
var default_theme = window.matchMedia("(prefers-color-scheme: dark)").matches ? "polkadot" : "polkadot";
|
||||
</script>
|
||||
|
||||
<!-- Work around some values being stored in localStorage wrapped in quotes -->
|
||||
<script>
|
||||
try {
|
||||
var theme = localStorage.getItem('mdbook-theme');
|
||||
var sidebar = localStorage.getItem('mdbook-sidebar');
|
||||
|
||||
if (theme.startsWith('"') && theme.endsWith('"')) {
|
||||
localStorage.setItem('mdbook-theme', theme.slice(1, theme.length - 1));
|
||||
}
|
||||
|
||||
if (sidebar.startsWith('"') && sidebar.endsWith('"')) {
|
||||
localStorage.setItem('mdbook-sidebar', sidebar.slice(1, sidebar.length - 1));
|
||||
}
|
||||
} catch (e) { }
|
||||
</script>
|
||||
|
||||
<!-- Set the theme before any content is loaded, prevents flash -->
|
||||
<script>
|
||||
var theme;
|
||||
try { theme = localStorage.getItem('mdbook-theme'); } catch(e) { }
|
||||
if (theme === null || theme === undefined) { theme = default_theme; }
|
||||
var html = document.querySelector('html');
|
||||
html.classList.remove('polkadot')
|
||||
html.classList.add(theme);
|
||||
var body = document.querySelector('body');
|
||||
body.classList.remove('no-js')
|
||||
body.classList.add('js');
|
||||
</script>
|
||||
|
||||
<input type="checkbox" id="sidebar-toggle-anchor" class="hidden">
|
||||
|
||||
<!-- Hide / unhide sidebar before it is displayed -->
|
||||
<script>
|
||||
var body = document.querySelector('body');
|
||||
var sidebar = null;
|
||||
var sidebar_toggle = document.getElementById("sidebar-toggle-anchor");
|
||||
if (document.body.clientWidth >= 1080) {
|
||||
try { sidebar = localStorage.getItem('mdbook-sidebar'); } catch(e) { }
|
||||
sidebar = sidebar || 'visible';
|
||||
} else {
|
||||
sidebar = 'hidden';
|
||||
}
|
||||
sidebar_toggle.checked = sidebar === 'visible';
|
||||
body.classList.remove('sidebar-visible');
|
||||
body.classList.add("sidebar-" + sidebar);
|
||||
</script>
|
||||
|
||||
<nav id="sidebar" class="sidebar" aria-label="Table of contents">
|
||||
<div class="sidebar-scrollbox">
|
||||
<ol class="chapter"><li class="chapter-item expanded affix "><a href="../introduction.html">Introduction</a></li><li class="spacer"></li><li class="chapter-item expanded affix "><li class="part-title">Newly Proposed</li><li class="chapter-item expanded "><a href="../new/0120-referenda-confirmation-by-candle-mechanism.html">RFC-0120: Referenda Confirmation by Candle Mechanism</a></li><li class="chapter-item expanded "><a href="../new/0121-iterable-referenda-tracks.html">RFC-0121: Iterable Referenda Tracks</a></li><li class="chapter-item expanded "><a href="../new/0122-alias-origin-on-asset-transfers.html" class="active">RFC-0122: Asset transfers can alias XCM origin on destination to original origin</a></li><li class="spacer"></li><li class="chapter-item expanded affix "><li class="part-title">Proposed</li><li class="chapter-item expanded "><a href="../proposed/0000-rewards.html">RFC-0000: Validator Rewards</a></li><li class="chapter-item expanded "><a href="../proposed/0004-remove-unnecessary-allocator-usage.html">RFC-0004: Remove the host-side runtime memory allocator</a></li><li class="chapter-item expanded "><a href="../proposed/0006-dynamic-pricing-for-bulk-coretime-sales.html">RFC-0006: Dynamic Pricing for Bulk Coretime Sales</a></li><li class="chapter-item expanded "><a href="../proposed/0009-improved-net-light-client-requests.html">RFC-0009: Improved light client requests networking protocol</a></li><li class="chapter-item expanded "><a href="../proposed/0015-market-design-revisit.html">RFC-0015: Market Design Revisit</a></li><li class="chapter-item expanded "><a href="../proposed/0034-xcm-absolute-location-account-derivation.html">RFC-34: XCM Absolute Location Account Derivation</a></li><li class="chapter-item expanded "><a href="../proposed/0035-conviction-voting-delegation-modifications.html"> RFC-0035: Conviction Voting Delegation Modifications</a></li><li class="chapter-item expanded "><a href="../proposed/0044-rent-based-registration.html">RFC-0044: Rent based registration model</a></li><li class="chapter-item expanded "><a href="../proposed/0054-remove-heap-pages.html">RFC-0054: Remove the concept of "heap pages" from the client</a></li><li class="chapter-item expanded "><a href="../proposed/0070-x-track-kusamanetwork.html">RFC-0070: X Track for @kusamanetwork</a></li><li class="chapter-item expanded "><a href="../proposed/0073-referedum-deposit-track.html">RFC-0073: Decision Deposit Referendum Track</a></li><li class="chapter-item expanded "><a href="../proposed/0074-stateful-multisig-pallet.html">RFC-0074: Stateful Multisig Pallet</a></li><li class="chapter-item expanded "><a href="../proposed/0077-increase-max-length-of-identity-pgp-fingerprint-value.html">RFC-0077: Increase maximum length of identity PGP fingerprint values from 20 bytes</a></li><li class="chapter-item expanded "><a href="../proposed/0088-broker-pallet-slashable-deposit-purchaser-reputation-reserved-cores.html">RFC-0088: Add slashable locked deposit, purchaser reputation, and reserved cores for on-chain identities to broker pallet</a></li><li class="chapter-item expanded "><a href="../proposed/0089-flexible-inflation.html">RFC-0089: Flexible Inflation</a></li><li class="chapter-item expanded "><a href="../proposed/00xx-secondary-marketplace-for-regions.html">RFC-0001: Secondary Market for Regions</a></li><li class="chapter-item expanded "><a href="../proposed/00xx-smart-contracts-coretime-chain.html">RFC-0002: Smart Contracts on the Coretime Chain</a></li><li class="chapter-item expanded "><a href="../proposed/0106-xcm-remove-fees-mode.html">RFC-0106: Remove XCM fees mode</a></li><li class="chapter-item expanded "><a href="../proposed/0111-pure-proxy-replication.html">RFC-0111: Pure Proxy Replication</a></li><li class="chapter-item expanded "><a href="../proposed/0112-compress-state-response-message-in-state-sync.html">RFC-0112: Compress the State Response Message in State Sync</a></li><li class="chapter-item expanded "><a href="../proposed/0117-unbrick-collective.html">RFC-0117: The Unbrick Collective</a></li><li class="spacer"></li><li class="chapter-item expanded affix "><li class="part-title">Approved</li><li class="chapter-item expanded "><a href="../approved/0001-agile-coretime.html">RFC-1: Agile Coretime</a></li><li class="chapter-item expanded "><a href="../approved/0005-coretime-interface.html">RFC-5: Coretime Interface</a></li><li class="chapter-item expanded "><a href="../approved/0007-system-collator-selection.html">RFC-0007: System Collator Selection</a></li><li class="chapter-item expanded "><a href="../approved/0008-parachain-bootnodes-dht.html">RFC-0008: Store parachain bootnodes in relay chain DHT</a></li><li class="chapter-item expanded "><a href="../approved/0010-burn-coretime-revenue.html">RFC-0010: Burn Coretime Revenue</a></li><li class="chapter-item expanded "><a href="../approved/0012-process-for-adding-new-collectives.html">RFC-0012: Process for Adding New System Collectives</a></liLine truncated
|
||||
</div>
|
||||
<div id="sidebar-resize-handle" class="sidebar-resize-handle"></div>
|
||||
</nav>
|
||||
|
||||
<!-- Track and set sidebar scroll position -->
|
||||
<script>
|
||||
var sidebarScrollbox = document.querySelector('#sidebar .sidebar-scrollbox');
|
||||
sidebarScrollbox.addEventListener('click', function(e) {
|
||||
if (e.target.tagName === 'A') {
|
||||
sessionStorage.setItem('sidebar-scroll', sidebarScrollbox.scrollTop);
|
||||
}
|
||||
}, { passive: true });
|
||||
var sidebarScrollTop = sessionStorage.getItem('sidebar-scroll');
|
||||
sessionStorage.removeItem('sidebar-scroll');
|
||||
if (sidebarScrollTop) {
|
||||
// preserve sidebar scroll position when navigating via links within sidebar
|
||||
sidebarScrollbox.scrollTop = sidebarScrollTop;
|
||||
} else {
|
||||
// scroll sidebar to current active section when navigating via "next/previous chapter" buttons
|
||||
var activeSection = document.querySelector('#sidebar .active');
|
||||
if (activeSection) {
|
||||
activeSection.scrollIntoView({ block: 'center' });
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<div id="page-wrapper" class="page-wrapper">
|
||||
|
||||
<div class="page">
|
||||
<div id="menu-bar-hover-placeholder"></div>
|
||||
<div id="menu-bar" class="menu-bar sticky">
|
||||
<div class="left-buttons">
|
||||
<label id="sidebar-toggle" class="icon-button" for="sidebar-toggle-anchor" title="Toggle Table of Contents" aria-label="Toggle Table of Contents" aria-controls="sidebar">
|
||||
<i class="fa fa-bars"></i>
|
||||
</label>
|
||||
<button id="theme-toggle" class="icon-button" type="button" title="Change theme" aria-label="Change theme" aria-haspopup="true" aria-expanded="false" aria-controls="theme-list">
|
||||
<i class="fa fa-paint-brush"></i>
|
||||
</button>
|
||||
<ul id="theme-list" class="theme-popup" aria-label="Themes" role="menu">
|
||||
<li role="none"><button role="menuitem" class="theme" id="polkadot">Polkadot</button></li>
|
||||
<li role="none"><button role="menuitem" class="theme" id="light">Light</button></li>
|
||||
<li role="none"><button role="menuitem" class="theme" id="rust">Rust</button></li>
|
||||
<li role="none"><button role="menuitem" class="theme" id="coal">Coal</button></li>
|
||||
<li role="none"><button role="menuitem" class="theme" id="navy">Navy</button></li>
|
||||
<li role="none"><button role="menuitem" class="theme" id="ayu">Ayu</button></li>
|
||||
</ul>
|
||||
<button id="search-toggle" class="icon-button" type="button" title="Search. (Shortkey: s)" aria-label="Toggle Searchbar" aria-expanded="false" aria-keyshortcuts="S" aria-controls="searchbar">
|
||||
<i class="fa fa-search"></i>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<h1 class="menu-title">Polkadot Fellowship RFCs</h1>
|
||||
|
||||
<div class="right-buttons">
|
||||
<a href="../print.html" title="Print this book" aria-label="Print this book">
|
||||
<i id="print-button" class="fa fa-print"></i>
|
||||
</a>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="search-wrapper" class="hidden">
|
||||
<form id="searchbar-outer" class="searchbar-outer">
|
||||
<input type="search" id="searchbar" name="searchbar" placeholder="Search this book ..." aria-controls="searchresults-outer" aria-describedby="searchresults-header">
|
||||
</form>
|
||||
<div id="searchresults-outer" class="searchresults-outer hidden">
|
||||
<div id="searchresults-header" class="searchresults-header"></div>
|
||||
<ul id="searchresults">
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Apply ARIA attributes after the sidebar and the sidebar toggle button are added to the DOM -->
|
||||
<script>
|
||||
document.getElementById('sidebar-toggle').setAttribute('aria-expanded', sidebar === 'visible');
|
||||
document.getElementById('sidebar').setAttribute('aria-hidden', sidebar !== 'visible');
|
||||
Array.from(document.querySelectorAll('#sidebar a')).forEach(function(link) {
|
||||
link.setAttribute('tabIndex', sidebar === 'visible' ? 0 : -1);
|
||||
});
|
||||
</script>
|
||||
|
||||
<div id="content" class="content">
|
||||
<main>
|
||||
<p><a href="https://github.com/polkadot-fellows/RFCs/pull/122">(source)</a></p>
|
||||
<p><strong>Table of Contents</strong></p>
|
||||
<ul>
|
||||
<li><a href="#rfc-0122-asset-transfers-can-alias-xcm-origin-on-destination-to-original-origin">RFC-0122: Asset transfers can alias XCM origin on destination to original origin</a>
|
||||
<ul>
|
||||
<li><a href="#summary">Summary</a></li>
|
||||
<li><a href="#motivation">Motivation</a></li>
|
||||
<li><a href="#stakeholders">Stakeholders</a></li>
|
||||
<li><a href="#explanation">Explanation</a>
|
||||
<ul>
|
||||
<li><a href="#trust-assumptions">Trust assumptions</a></li>
|
||||
<li><a href="#xcm-initiateassetstransfer-instruction-changes">XCM <code>InitiateAssetsTransfer</code> instruction changes</a></li>
|
||||
<li><a href="#example-scenarios">Example scenarios</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#drawbacks">Drawbacks</a></li>
|
||||
<li><a href="#testing-security-and-privacy">Testing, Security, and Privacy</a></li>
|
||||
<li><a href="#performance-ergonomics-and-compatibility">Performance, Ergonomics, and Compatibility</a>
|
||||
<ul>
|
||||
<li><a href="#performance">Performance</a></li>
|
||||
<li><a href="#ergonomics">Ergonomics</a></li>
|
||||
<li><a href="#compatibility">Compatibility</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#prior-art-and-references">Prior Art and References</a></li>
|
||||
<li><a href="#unresolved-questions">Unresolved Questions</a></li>
|
||||
<li><a href="#future-directions-and-related-material">Future Directions and Related Material</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
<h1 id="rfc-0122-asset-transfers-can-alias-xcm-origin-on-destination-to-original-origin"><a class="header" href="#rfc-0122-asset-transfers-can-alias-xcm-origin-on-destination-to-original-origin">RFC-0122: Asset transfers can alias XCM origin on destination to original origin</a></h1>
|
||||
<div class="table-wrapper"><table><thead><tr><th></th><th></th></tr></thead><tbody>
|
||||
<tr><td><strong>Start Date</strong></td><td>01 Sep 2024.</td></tr>
|
||||
<tr><td><strong>Description</strong></td><td>Single and Multi-hop asset transfers should be able to carry over original origin</td></tr>
|
||||
<tr><td><strong>Authors</strong></td><td>Adrian Catangiu</td></tr>
|
||||
</tbody></table>
|
||||
</div>
|
||||
<h2 id="summary"><a class="header" href="#summary">Summary</a></h2>
|
||||
<p>XCM programs generated by the <code>InitiateAssetTransfer</code> 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 <code>AliasOrigin</code> or <code>ClearOrigin</code> depending on given parameters.</p>
|
||||
<p>This allows asset transfers to retain their original origin even across multiple hops.</p>
|
||||
<p>Ecosystem chains would have to change their trusted aliasing rules to effectively make use of this feature.</p>
|
||||
<h2 id="motivation"><a class="header" href="#motivation">Motivation</a></h2>
|
||||
<p>Currently, all XCM asset transfer instructions ultimately clear the origin in the remote XCM message by use of the <code>ClearOrigin</code> instruction. This is done for security considerations to ensure that subsequent (user-controlled) instructions cannot command the authority of the sending chain.</p>
|
||||
<p>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.</p>
|
||||
<p>For example, we cannot transfer some funds for buying execution, then do a <code>Transact</code> (all in the same XCM message).</p>
|
||||
<p>The above example is a basic, core building block for cross-chain interactions and we should support it.</p>
|
||||
<p>Transact XCM programs today require a two step process:</p>
|
||||
<img src="https://raw.githubusercontent.com/acatangiu/RFCs/alias-origin-on-asset-transfers/text/0122-transact-today.png" alt="Transact Today">
|
||||
<p>And we want to be able to do it using a single XCM program.</p>
|
||||
<h2 id="stakeholders"><a class="header" href="#stakeholders">Stakeholders</a></h2>
|
||||
<p>Runtime Users, Runtime Devs, wallets, cross-chain dApps.</p>
|
||||
<h2 id="explanation"><a class="header" href="#explanation">Explanation</a></h2>
|
||||
<p>In the case of XCM programs going from <code>source-chain</code> directly to <code>dest-chain</code> without an intermediary hop, we can enable scenarios such as above by using the <code>AliasOrigin</code> instruction instead of the <code>ClearOrigin</code> instruction.</p>
|
||||
<p>Instead of clearing the <code>source-chain</code> origin, the destination chain shall attempt to alias <code>source-chain</code> to "original origin" on the source chain.
|
||||
Most common such origin aliasing would be <code>X1(Parachain(source-chain))</code> -> <code>X2(Parachain(source-chain), AccountId32(origin-account))</code> for the case of a single hop transfer where the initiator is a (signed/pure/proxy) account <code>origin-account</code> on <code>source-chain</code>.
|
||||
This is equivalent to using the <code>DescendOrigin</code> instruction in this case, but also usable in the multi hop case.</p>
|
||||
<p>This allows an actor on chain A to <code>Transact</code> on chain B without having to prefund its SA account on chain B, instead they can simply transfer the required fees in the same XCM program as the <code>Transact</code>.</p>
|
||||
<p>As long as the asset transfer has the same XCM route/hops as the rest of the program, this pattern of usage can be composed across multiple hops, to ultimately <code>Transact</code> on the final hop using the original origin on the source chain, effectively abstracting away any intermediary hops.</p>
|
||||
<h3 id="trust-assumptions"><a class="header" href="#trust-assumptions">Trust assumptions</a></h3>
|
||||
<p>The model described above makes some aliasing trust assumptions, the most important being how <em>the root location of the intermediate hop/chain has to be trusted to alias ("impersonate") other locations from the source chain</em>.</p>
|
||||
<p>The origin aliasing trust relationship is highly customizeable at the runtime level, so that parachains can define coarse filters or granular pairs of (source, target) locations aliasing.</p>
|
||||
<p>Even so, this RFC aims to also propose a standard set of aliasing rules that all Parachains can integrate for allowing the vast majority of <code>Transact</code> usecases in a "one-click" manner (single user signature), without practically lowering their security posture.</p>
|
||||
<h4 id="standard-aliasing-rules"><a class="header" href="#standard-aliasing-rules">Standard Aliasing Rules:</a></h4>
|
||||
<ol>
|
||||
<li>Any chain allows aliasing into a child location. Equivalent to DescendOrigin into an interior location.</li>
|
||||
<li>Parachains allow Asset Hub root location to alias into any other origin.</li>
|
||||
</ol>
|
||||
<p>Now, the second rule as defined above in its most generic form might seem "dangerous" at first, but in practical terms if Asset Hub Root gets compromised and can access arbitrary sovereign accounts on Asset Hub and/or send arbitrary XCMs, the blast radius and potential damage to other parachains are not relevantly impacted by this aliasing rule.</p>
|
||||
<p>This second rule can also be tightened by each parachain to their own liking, for example limit Asset Hub aliasing to a stricter range of locations:</p>
|
||||
<ul>
|
||||
<li>"allow Asset Hub root to alias Ethereum locations" - which enables support for <code>Transact</code> over the Ethereum Snowbridge (but doesn't support sibling parachain to Transact through Asset Hub)</li>
|
||||
</ul>
|
||||
<h3 id="xcm-initiateassetstransfer-instruction-changes"><a class="header" href="#xcm-initiateassetstransfer-instruction-changes">XCM <code>InitiateAssetsTransfer</code> instruction changes</a></h3>
|
||||
<p>A new parameter <code>preserve_origin</code> to be added to the <code>InitiateAssetsTransfer</code> XCM instruction that specifies if the original origin should be preserved or cleared.</p>
|
||||
<pre><code class="language-diff">InitiateAssetsTransfer {
|
||||
destination: Location,
|
||||
assets: Vec<AssetTransferFilter>,
|
||||
remote_fees: Option<AssetTransferFilter>,
|
||||
+ preserve_origin: bool,
|
||||
remote_xcm: Xcm<()>,
|
||||
}
|
||||
</code></pre>
|
||||
<p>This parameter is explicitly necessary because the instruction should be usable between any two chains regardless of their origin-aliasing trust relationship. Preserving the origin requires some level of trust, while clearing it works regardless of that relationship.
|
||||
Specifying <code>preserve_origin: false</code> will always work regardless of the configured alias filters of the
|
||||
involved chains.</p>
|
||||
<h3 id="example-scenarios"><a class="header" href="#example-scenarios">Example scenarios</a></h3>
|
||||
<p>Transact within the ecosytem:</p>
|
||||
<ul>
|
||||
<li>between two chains using an asset native to either one of them for paying for Transact,</li>
|
||||
<li>between two chains using an Asset Hub asset (e.g. USDT) for paying for Transact,</li>
|
||||
</ul>
|
||||
<img src="https://raw.githubusercontent.com/acatangiu/RFCs/alias-origin-on-asset-transfers/text/0122-transact-single-xcm.png" alt="Ecosystem Transact">
|
||||
<p>Transact over Snowbridge (same for other bridges):</p>
|
||||
<ul>
|
||||
<li>user on Ethereum calls function in Parachain A on Polkadot, pays with ETH,</li>
|
||||
<li>user on ParaA on Polkdaot calls function on Ethereum, pays with ETH,</li>
|
||||
</ul>
|
||||
<img src="https://raw.githubusercontent.com/acatangiu/RFCs/alias-origin-on-asset-transfers/text/0122-transact-over-bridge.png" alt="Transact Over Bridge">
|
||||
<h2 id="drawbacks"><a class="header" href="#drawbacks">Drawbacks</a></h2>
|
||||
<p>In terms of ergonomics and user experience, this support for combining an asset transfer with a subsequent action (like Transact) is a net positive.</p>
|
||||
<p>In terms of performance, and privacy, this is neutral with no changes.</p>
|
||||
<p>In terms of security, the feature by itself is also neutral because it allows <code>preserve_origin: false</code> usage for operating with no extra trust assumptions. When wanting to support preserving origin, chains need to configure secure origin aliasing filters. The "standard" one provided in this RFC will be the right choice for the majority of chains, but for others it will not be 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.</p>
|
||||
<h2 id="testing-security-and-privacy"><a class="header" href="#testing-security-and-privacy">Testing, Security, and Privacy</a></h2>
|
||||
<p>Barriers should now allow <code>AliasOrigin</code> or <code>ClearOrigin</code>.</p>
|
||||
<p>Normally, XCM program builders should audit their programs and eliminate assumptions of "no origin" on remote side of this instruction. In this case, the <code>InitiateAssetsTransfer</code> 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.</p>
|
||||
<p>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 <code>pallet_xcm::send</code>.</p>
|
||||
<p>The existing <code>DepositReserveAsset</code>, <code>InitiateReserveWithdraw</code> and <code>InitiateTeleport</code> cross chain asset transfer instructions will not attempt to do origin aliasing and will always clear origin same as before for compatibility reasons.</p>
|
||||
<h2 id="performance-ergonomics-and-compatibility"><a class="header" href="#performance-ergonomics-and-compatibility">Performance, Ergonomics, and Compatibility</a></h2>
|
||||
<h3 id="performance"><a class="header" href="#performance">Performance</a></h3>
|
||||
<p>No impact.</p>
|
||||
<h3 id="ergonomics"><a class="header" href="#ergonomics">Ergonomics</a></h3>
|
||||
<p>Improves ergonomics by allowing the local origin to operate on the remote chain even when the XCM program includes an asset transfer.</p>
|
||||
<h3 id="compatibility"><a class="header" href="#compatibility">Compatibility</a></h3>
|
||||
<p>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.</p>
|
||||
<p>New version of the <code>InitiateAssetsTransfer</code> instruction acts same as before when used with <code>preserve_origin: false</code>.</p>
|
||||
<p>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 <code>AliasOrigin</code> as an allowed alternative to <code>ClearOrigin</code>.</p>
|
||||
<p>For compatibility reasons, this RFC proposes this mechanism be added as an enhancement to the yet unreleased <code>InitiateAssetsTransfer</code> instruction, thus eliminating possibilities of XCM logic breakages in the wild.
|
||||
Following the same logic, the existing <code>DepositReserveAsset</code>, <code>InitiateReserveWithdraw</code> and <code>InitiateTeleport</code> cross chain asset transfer instructions will not attempt to do origin aliasing and will always clear the origin same as before for compatibility reasons.</p>
|
||||
<p>Any one of <code>DepositReserveAsset</code>, <code>InitiateReserveWithdraw</code> and <code>InitiateTeleport</code> instructions can be replaced with a <code>InitiateAssetsTransfer</code> instruction with or without origin aliasing, thus providing a clean and clear upgrade path for opting-in this new feature.</p>
|
||||
<h2 id="prior-art-and-references"><a class="header" href="#prior-art-and-references">Prior Art and References</a></h2>
|
||||
<ul>
|
||||
<li><a href="https://github.com/polkadot-fellows/RFCs/pull/100">RFC: InitiateAssetsTransfer for complex asset transfers</a></li>
|
||||
<li><a href="https://github.com/polkadot-fellows/RFCs/pull/109">RFC: Descend XCM origin instead of clearing it where possible</a></li>
|
||||
</ul>
|
||||
<h2 id="unresolved-questions"><a class="header" href="#unresolved-questions">Unresolved Questions</a></h2>
|
||||
<p>None</p>
|
||||
<h2 id="future-directions-and-related-material"><a class="header" href="#future-directions-and-related-material">Future Directions and Related Material</a></h2>
|
||||
|
||||
</main>
|
||||
|
||||
<nav class="nav-wrapper" aria-label="Page navigation">
|
||||
<!-- Mobile navigation buttons -->
|
||||
<a rel="prev" href="../new/0121-iterable-referenda-tracks.html" class="mobile-nav-chapters previous" title="Previous chapter" aria-label="Previous chapter" aria-keyshortcuts="Left">
|
||||
<i class="fa fa-angle-left"></i>
|
||||
</a>
|
||||
|
||||
<a rel="next prefetch" href="../proposed/0000-rewards.html" class="mobile-nav-chapters next" title="Next chapter" aria-label="Next chapter" aria-keyshortcuts="Right">
|
||||
<i class="fa fa-angle-right"></i>
|
||||
</a>
|
||||
|
||||
<div style="clear: both"></div>
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<nav class="nav-wide-wrapper" aria-label="Page navigation">
|
||||
<a rel="prev" href="../new/0121-iterable-referenda-tracks.html" class="nav-chapters previous" title="Previous chapter" aria-label="Previous chapter" aria-keyshortcuts="Left">
|
||||
<i class="fa fa-angle-left"></i>
|
||||
</a>
|
||||
|
||||
<a rel="next prefetch" href="../proposed/0000-rewards.html" class="nav-chapters next" title="Next chapter" aria-label="Next chapter" aria-keyshortcuts="Right">
|
||||
<i class="fa fa-angle-right"></i>
|
||||
</a>
|
||||
</nav>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<script>
|
||||
window.playground_copyable = true;
|
||||
</script>
|
||||
|
||||
|
||||
<script src="../elasticlunr.min.js"></script>
|
||||
<script src="../mark.min.js"></script>
|
||||
<script src="../searcher.js"></script>
|
||||
|
||||
<script src="../clipboard.min.js"></script>
|
||||
<script src="../highlight.js"></script>
|
||||
<script src="../book.js"></script>
|
||||
|
||||
<!-- Custom JS scripts -->
|
||||
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
Reference in new issue
Block a user