Skip to content

Commit

Permalink
deploy: 6caed18
Browse files Browse the repository at this point in the history
  • Loading branch information
tynes committed Feb 21, 2024
1 parent d4348b0 commit ab83128
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 10 deletions.
14 changes: 10 additions & 4 deletions experimental/plasma.html
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,12 @@ <h2 id="input-commitment-submission"><a class="header" href="#input-commitment-s
challenges if the input cannot be retrieved during the challenge window, as detailed in the following section.</p>
<h2 id="data-availability-challenge-contract"><a class="header" href="#data-availability-challenge-contract">Data Availability Challenge Contract</a></h2>
<h3 id="parameters"><a class="header" href="#parameters">Parameters</a></h3>
<div class="table-wrapper"><table><thead><tr><th>Variable</th><th>Type</th><th>Description</th></tr></thead><tbody>
<div class="table-wrapper"><table><thead><tr><th>Constant</th><th>Type</th><th>Description</th></tr></thead><tbody>
<tr><td>fixedResolutionCost</td><td><code>uint256</code></td><td>Fixed gas cost of resolving a challenge, set to 72925</td></tr>
<tr><td>variableResolutionCost</td><td><code>uint256</code></td><td>Upper limit gas cost per byte scaled by precision constant, set to 16640</td></tr>
<tr><td>variableResolutionCostPrecision</td><td><code>uint256</code></td><td>Precision of the variable resolution cost, set to 1000</td></tr>
</tbody></table>
</div><div class="table-wrapper"><table><thead><tr><th>Variable</th><th>Type</th><th>Description</th></tr></thead><tbody>
<tr><td>challengeWindow</td><td><code>uint256</code></td><td>Number of L1 blocks whereby a commitment MAY be challenged after it's included onchain</td></tr>
<tr><td>resolveWindow</td><td><code>uint256</code></td><td>Number of L1 blocks whereby input data SHOULD be submitted onchain after a challenge</td></tr>
<tr><td>bondSize</td><td><code>uint256</code></td><td>Bond amount in Wei posted by the challenger so that bondSize &gt;= resolveCost</td></tr>
Expand All @@ -271,7 +276,7 @@ <h3 id="parameters"><a class="header" href="#parameters">Parameters</a></h3>
<p>Data availability is guaranteed via a permissionless challenge contract on the L1 chain.
Users have a set number of L1 blocks (<code>challengeWindow</code>) during which they are able to call
the <code>challenge</code> method of the contract with the following inputs:</p>
<pre><code class="language-solidity">function challenge(uint256 challengedBlockNumber, bytes commitment) external payable
<pre><code class="language-solidity">function challenge(uint256 challengedBlockNumber, bytes calldata challengedCommitment) external payable
</code></pre>
<ul>
<li>The L1 block number in which it was included.</li>
Expand All @@ -282,10 +287,11 @@ <h3 id="parameters"><a class="header" href="#parameters">Parameters</a></h3>
If the data is not included onchain by the time the resolve window is elapsed, derivation of the L2 canonical chain
will reorg starting from this first block derived from the challenged input data to the last block derived from the
L1 block at which it expired. See more details about <a href="#derivation">Derivation</a> in the following section.</p>
<pre><code class="language-solidity">function resolve(uint256 challengedBlockNumber, bytes commitment, bytes calldata preImage) external
<pre><code class="language-solidity">function resolve(uint256 challengedBlockNumber, bytes calldata challengedCommitment, bytes calldata resolveData) external
</code></pre>
<p>In order to challenge a commitment, users deposit a bond amount where <code>bond &gt;= resolve_tx_gas_cost</code>.
If the gas cost of resolving the challenge was lower than the bond, the difference is reimbursed to the challenger
If the gas cost of resolving the challenge was lower than the bond, the difference is reimbursed to the challenger where
<code>cost = (fixedResolutionCost + preImageLength * variableResolutionCost / variableResolutionCostPrecision) * gasPrice</code>
and the rest of the bond is burnt. If the challenge is not resolved in time and expired,
the bond is returned and can be withdrawn by the challenger or used to challenge another commitment.
<code>bondSize</code> can be updated by the contract owner similar to <a href="../protocol/system_config.html">SystemConfig</a> variables.
Expand Down
14 changes: 10 additions & 4 deletions print.html
Original file line number Diff line number Diff line change
Expand Up @@ -7133,7 +7133,12 @@ <h2 id="input-commitment-submission"><a class="header" href="#input-commitment-s
challenges if the input cannot be retrieved during the challenge window, as detailed in the following section.</p>
<h2 id="data-availability-challenge-contract"><a class="header" href="#data-availability-challenge-contract">Data Availability Challenge Contract</a></h2>
<h3 id="parameters"><a class="header" href="#parameters">Parameters</a></h3>
<div class="table-wrapper"><table><thead><tr><th>Variable</th><th>Type</th><th>Description</th></tr></thead><tbody>
<div class="table-wrapper"><table><thead><tr><th>Constant</th><th>Type</th><th>Description</th></tr></thead><tbody>
<tr><td>fixedResolutionCost</td><td><code>uint256</code></td><td>Fixed gas cost of resolving a challenge, set to 72925</td></tr>
<tr><td>variableResolutionCost</td><td><code>uint256</code></td><td>Upper limit gas cost per byte scaled by precision constant, set to 16640</td></tr>
<tr><td>variableResolutionCostPrecision</td><td><code>uint256</code></td><td>Precision of the variable resolution cost, set to 1000</td></tr>
</tbody></table>
</div><div class="table-wrapper"><table><thead><tr><th>Variable</th><th>Type</th><th>Description</th></tr></thead><tbody>
<tr><td>challengeWindow</td><td><code>uint256</code></td><td>Number of L1 blocks whereby a commitment MAY be challenged after it's included onchain</td></tr>
<tr><td>resolveWindow</td><td><code>uint256</code></td><td>Number of L1 blocks whereby input data SHOULD be submitted onchain after a challenge</td></tr>
<tr><td>bondSize</td><td><code>uint256</code></td><td>Bond amount in Wei posted by the challenger so that bondSize &gt;= resolveCost</td></tr>
Expand All @@ -7143,7 +7148,7 @@ <h3 id="parameters"><a class="header" href="#parameters">Parameters</a></h3>
<p>Data availability is guaranteed via a permissionless challenge contract on the L1 chain.
Users have a set number of L1 blocks (<code>challengeWindow</code>) during which they are able to call
the <code>challenge</code> method of the contract with the following inputs:</p>
<pre><code class="language-solidity">function challenge(uint256 challengedBlockNumber, bytes commitment) external payable
<pre><code class="language-solidity">function challenge(uint256 challengedBlockNumber, bytes calldata challengedCommitment) external payable
</code></pre>
<ul>
<li>The L1 block number in which it was included.</li>
Expand All @@ -7154,10 +7159,11 @@ <h3 id="parameters"><a class="header" href="#parameters">Parameters</a></h3>
If the data is not included onchain by the time the resolve window is elapsed, derivation of the L2 canonical chain
will reorg starting from this first block derived from the challenged input data to the last block derived from the
L1 block at which it expired. See more details about <a href="experimental/plasma.html#derivation">Derivation</a> in the following section.</p>
<pre><code class="language-solidity">function resolve(uint256 challengedBlockNumber, bytes commitment, bytes calldata preImage) external
<pre><code class="language-solidity">function resolve(uint256 challengedBlockNumber, bytes calldata challengedCommitment, bytes calldata resolveData) external
</code></pre>
<p>In order to challenge a commitment, users deposit a bond amount where <code>bond &gt;= resolve_tx_gas_cost</code>.
If the gas cost of resolving the challenge was lower than the bond, the difference is reimbursed to the challenger
If the gas cost of resolving the challenge was lower than the bond, the difference is reimbursed to the challenger where
<code>cost = (fixedResolutionCost + preImageLength * variableResolutionCost / variableResolutionCostPrecision) * gasPrice</code>
and the rest of the bond is burnt. If the challenge is not resolved in time and expired,
the bond is returned and can be withdrawn by the challenger or used to challenge another commitment.
<code>bondSize</code> can be updated by the contract owner similar to <a href="experimental/../protocol/system_config.html">SystemConfig</a> variables.
Expand Down
2 changes: 1 addition & 1 deletion searchindex.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion searchindex.json

Large diffs are not rendered by default.

0 comments on commit ab83128

Please sign in to comment.