Skip to content

Commit

Permalink
deploy: 96d43c9
Browse files Browse the repository at this point in the history
  • Loading branch information
tynes committed Feb 8, 2024
1 parent e146457 commit 68d144b
Show file tree
Hide file tree
Showing 22 changed files with 195 additions and 165 deletions.
14 changes: 14 additions & 0 deletions experimental/fault-proof/bond-incentives.html
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,20 @@ <h1 class="menu-title">OP Stack Specification</h1>
<main>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/katex.min.css" integrity="sha384-AfEj0r4/OFrOo5t7NnNe46zW/tFgW6x/bCJG8FqQCEo3+Aro6EYUG4+cU+KJWu/X" crossorigin="anonymous">
<h1 id="bond-incentives"><a class="header" href="#bond-incentives">Bond Incentives</a></h1>
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
<p><strong>Table of Contents</strong></p>
<ul>
<li><a href="#overview">Overview</a></li>
<li><a href="#moves">Moves</a></li>
<li><a href="#subgame-resolution">Subgame Resolution</a>
<ul>
<li><a href="#leftmost-claim-incentives">Leftmost Claim Incentives</a></li>
</ul>
</li>
</ul>
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
<h2 id="overview"><a class="header" href="#overview">Overview</a></h2>
<p>Bonds is an add-on to the core <a href="./fault-dispute-game.html">Fault Dispute Game</a>. The core game mechanics are
designed to ensure honesty as the best response to winning subgames. By introducing financial incentives,
Bonds makes it worthwhile for honest challengers to participate.
Expand Down
4 changes: 2 additions & 2 deletions experimental/fault-proof/cannon-fault-proof-vm.html
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ <h3 id="heap"><a class="header" href="#heap">Heap</a></h3>
result of the syscall to locate free memory. The page size is 4096.</p>
<p>The FPVM has a fixed program break at <code>0x40000000</code>. However, the FPVM is permitted to extend the
heap beyond this limit via mmap syscalls.
For simplicity, there are no memory protections against &quot;heap overruns&quot; against other memory segments.
For simplicity, there are no memory protections against "heap overruns" against other memory segments.
Such VM steps are still considered valid state transitions.</p>
<p>Specification of memory mappings is outside the scope of this document as it is irrelevant to
the VM state. FPVM implementers may refer to the Linux/MIPS kernel for inspiration.</p>
Expand All @@ -283,7 +283,7 @@ <h2 id="delay-slots"><a class="header" href="#delay-slots">Delay Slots</a></h2>
<p>A VM state transition is invalid whenever the current instruction is a delay slot that is filled
with jump or branch type instruction.
That is, where <span class="katex"><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8889em;vertical-align:-0.1944em;"></span><span class="mord mathnormal">n</span><span class="mord mathnormal">e</span><span class="mord mathnormal">x</span><span class="mord mathnormal" style="margin-right:0.07153em;">tPC</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel"><span class="mrel"><span class="mord vbox"><span class="thinbox"><span class="rlap"><span class="strut" style="height:0.8889em;vertical-align:-0.1944em;"></span><span class="inner"><span class="mord"><span class="mrel"></span></span></span><span class="fix"></span></span></span></span></span><span class="mrel">=</span></span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:0.7778em;vertical-align:-0.1944em;"></span><span class="mord mathnormal">p</span><span class="mord mathnormal">c</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">+</span><span class="mspace" style="margin-right:0.2222em;"></span></span><span class="base"><span class="strut" style="height:0.6444em;"></span><span class="mord">4</span></span></span></span> while stepping on a jump/branch instruction.
Otherwise, there would be two consecutive delay slots. While this is considered &quot;undefined&quot;
Otherwise, there would be two consecutive delay slots. While this is considered "undefined"
behavior in typical MIPS implementations, FPVM must raise an exception when stepping on such states.</p>
<h2 id="syscalls"><a class="header" href="#syscalls">Syscalls</a></h2>
<p>Syscalls work similar to <a href="https://www.linux-mips.org/wiki/Syscall">Linux/MIPS</a>, including the
Expand Down
8 changes: 4 additions & 4 deletions experimental/fault-proof/fault-dispute-game.html
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ <h1 id="fault-dispute-game"><a class="header" href="#fault-dispute-game">Fault D
<li><a href="#game_duration">GAME_DURATION</a></li>
</ul>
</li>
<li><a href="#game-mechanics">Game Mechanics</a>
<li><a href="#core-game-mechanics">Core Game Mechanics</a>
<ul>
<li><a href="#actors">Actors</a></li>
<li><a href="#moves">Moves</a>
Expand Down Expand Up @@ -254,7 +254,7 @@ <h3 id="dag"><a class="header" href="#dag">DAG</a></h3>
<li><span class="katex"><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em;"></span><span class="mord mathnormal" style="margin-right:0.22222em;">V</span></span></span></span> is the set of nodes, each representing a claim. Formally, <span class="katex"><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em;"></span><span class="mord mathnormal" style="margin-right:0.22222em;">V</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mopen">{</span><span class="mord"><span class="mord mathnormal" style="margin-right:0.07153em;">C</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3011em;"><span style="top:-2.55em;margin-left:-0.0715em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">1</span></span></span></span><span class="vlist-s"></span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.07153em;">C</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3011em;"><span style="top:-2.55em;margin-left:-0.0715em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">2</span></span></span></span><span class="vlist-s"></span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord">...</span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.07153em;">C</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.1514em;"><span style="top:-2.55em;margin-left:-0.0715em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">n</span></span></span></span><span class="vlist-s"></span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mclose">}</span></span></span></span>,
where <span class="katex"><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8333em;vertical-align:-0.15em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.07153em;">C</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3117em;"><span style="top:-2.55em;margin-left:-0.0715em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">i</span></span></span></span><span class="vlist-s"></span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span></span></span></span> is a claim.</li>
<li><span class="katex"><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em;"></span><span class="mord mathnormal" style="margin-right:0.05764em;">E</span></span></span></span> is the set of <em>directed</em> edges. An edge <span class="katex"><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1.0361em;vertical-align:-0.2861em;"></span><span class="mopen">(</span><span class="mord"><span class="mord mathnormal" style="margin-right:0.07153em;">C</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3117em;"><span style="top:-2.55em;margin-left:-0.0715em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">i</span></span></span></span><span class="vlist-s"></span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.07153em;">C</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3117em;"><span style="top:-2.55em;margin-left:-0.0715em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.05724em;">j</span></span></span></span><span class="vlist-s"></span></span><span class="vlist-r"><span class="vlist" style="height:0.2861em;"><span></span></span></span></span></span></span><span class="mclose">)</span></span></span></span> exists if <span class="katex"><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.9694em;vertical-align:-0.2861em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.07153em;">C</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3117em;"><span style="top:-2.55em;margin-left:-0.0715em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.05724em;">j</span></span></span></span><span class="vlist-s"></span></span><span class="vlist-r"><span class="vlist" style="height:0.2861em;"><span></span></span></span></span></span></span></span></span></span> is a direct dispute
against <span class="katex"><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8333em;vertical-align:-0.15em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.07153em;">C</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3117em;"><span style="top:-2.55em;margin-left:-0.0715em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">i</span></span></span></span><span class="vlist-s"></span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span></span></span></span> through either an &quot;Attack&quot; or &quot;Defend&quot; <a href="#moves">move</a>.</li>
against <span class="katex"><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8333em;vertical-align:-0.15em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.07153em;">C</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3117em;"><span style="top:-2.55em;margin-left:-0.0715em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">i</span></span></span></span><span class="vlist-s"></span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span></span></span></span> through either an "Attack" or "Defend" <a href="#moves">move</a>.</li>
</ul>
<h3 id="subgame"><a class="header" href="#subgame">Subgame</a></h3>
<p>A sub-game is a DAG of depth 1, where the root of the DAG is a <code>Claim</code> and the children are <code>Claim</code>s that counter the
Expand All @@ -280,7 +280,7 @@ <h3 id="game-tree"><a class="header" href="#game-tree">Game Tree</a></h3>
<p><img src="../../static/assets/ob-tree.png" alt="ob-tree" /></p>
<h3 id="position"><a class="header" href="#position">Position</a></h3>
<p>A position represents the location of a claim in the Game Tree. This is represented by a
&quot;generalized index&quot; (or <strong>gindex</strong>) where the high-order bit is the level in the tree and the remaining
"generalized index" (or <strong>gindex</strong>) where the high-order bit is the level in the tree and the remaining
bits is a unique bit pattern, allowing a unique identifier for each node in the tree.</p>
<p>The <strong>gindex</strong> of a position <span class="katex"><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.4306em;"></span><span class="mord mathnormal">n</span></span></span></span> can be calculated as <span class="katex"><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.9713em;vertical-align:-0.0833em;"></span><span class="mord"><span class="mord">2</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.888em;"><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathnormal mtight">d</span><span class="mopen mtight">(</span><span class="mord mathnormal mtight">n</span><span class="mclose mtight">)</span></span></span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">+</span><span class="mspace" style="margin-right:0.2222em;"></span></span><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord mathnormal">i</span><span class="mord mathnormal">d</span><span class="mord mathnormal">x</span><span class="mopen">(</span><span class="mord mathnormal">n</span><span class="mclose">)</span></span></span></span>, where:</p>
<ul>
Expand Down Expand Up @@ -422,7 +422,7 @@ <h3 id="preimageoracle-interaction"><a class="header" href="#preimageoracle-inte
uint256 blockIndex,
bytes32 stateCommitment
) internal view returns (bytes32 leaf) {
require(input.length == 136, &quot;input must be exactly the size of the keccak256 rate&quot;);
require(input.length == 136, "input must be exactly the size of the keccak256 rate");

leaf = keccak256(abi.encodePacked(input, blockIndex, stateCommitment));
}
Expand Down
5 changes: 3 additions & 2 deletions experimental/fault-proof/honest-challenger-fdg.html
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,8 @@ <h1 id="honest-challenger-fault-dispute-game"><a class="header" href="#honest-ch
<li><a href="#fdg-responses">FDG Responses</a>
<ul>
<li><a href="#root-claims">Root Claims</a></li>
<li><a href="#counter-claims">Counter Claims</a></li>
<li><a href="#countering-invalid-claims">Countering Invalid Claims</a></li>
<li><a href="#countering-freeloaders">Countering Freeloaders</a></li>
<li><a href="#steps">Steps</a></li>
</ul>
</li>
Expand Down Expand Up @@ -220,7 +221,7 @@ <h3 id="root-claims"><a class="header" href="#root-claims">Root Claims</a></h3>
<li><strong>Do Nothing</strong> if they agree with the root claim. They do nothing because if the root
claim is left un-countered, the game resolves to their agreement.
NOTE: The honest challenger will still track this game in order to defend any subsequent
claims made against the root claim - in effect, &quot;playing the game&quot;.</li>
claims made against the root claim - in effect, "playing the game".</li>
</ol>
<h3 id="countering-invalid-claims"><a class="header" href="#countering-invalid-claims">Countering Invalid Claims</a></h3>
<p>For every claim made in a dispute game with a <a href="fault-dispute-game.html#game-tree">game tree</a>
Expand Down
6 changes: 3 additions & 3 deletions experimental/fault-proof/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ <h2 id="overview"><a class="header" href="#overview">Overview</a></h2>
</ul>
<p>Each of these 3 components may have different implementations, which can be combined into different proof stacks,
and contribute to proof diversity when resolving a dispute.</p>
<p>&quot;Stateless execution&quot; of the program, and its individual instructions, refers to reproducing
<p>"Stateless execution" of the program, and its individual instructions, refers to reproducing
the exact same computation by authenticating the inputs with a <a href="#Pre-image-Oracle">Pre-image Oracle</a>.</p>
<p><img src="../../static/assets/fault-proof.svg" alt="Diagram of Program and VM architecture" /></p>
<h2 id="pre-image-oracle"><a class="header" href="#pre-image-oracle">Pre-image Oracle</a></h2>
Expand Down Expand Up @@ -265,7 +265,7 @@ <h4 id="type-2-global-keccak256-key"><a class="header" href="#type-2-global-kecc
and avoids unnecessary contract redeployments per dispute.</p>
<p>This global store contract should be non-upgradeable.</p>
<p>Since <code>keccak256</code> is a safe 32-byte hash input, the first byte is overwritten with a <code>2</code> to derive the key,
while keeping the rest of the key &quot;readable&quot; (matching the original hash).</p>
while keeping the rest of the key "readable" (matching the original hash).</p>
<h4 id="type-3-global-generic-key"><a class="header" href="#type-3-global-generic-key">Type <code>3</code>: Global generic key</a></h4>
<p>Reserved. This scheme allows for unlimited application-layer pre-image types without fault-proof VM redeployments.</p>
<p>This is a generic version of a global key store: <code>key = 0x03 ++ keccak256(x, sender)[1:]</code>, where:</p>
Expand Down Expand Up @@ -408,7 +408,7 @@ <h3 id="prologue"><a class="header" href="#prologue">Prologue</a></h3>
<a href="dispute-game-interface.html">dispute game interface</a>, in the L1 history up and till the specified <code>l1_head</code>.
The <code>dispute</code> may be the claim itself, or a pointer to specific prior claimed data in L1,
depending on the dispute game interface.</p>
<p>Implied inputs are loaded in a &quot;prologue&quot; before the actual core state-transition function executes.
<p>Implied inputs are loaded in a "prologue" before the actual core state-transition function executes.
During testing a simplified prologue that loads the overrides may be used.</p>
<blockquote>
<p>Note: only the test-prologues are currently supported, since the dispute game interface is actively changing.</p>
Expand Down
Loading

0 comments on commit 68d144b

Please sign in to comment.