Skip to content

Commit

Permalink
deploy: 89ed209
Browse files Browse the repository at this point in the history
  • Loading branch information
github-merge-queue[bot] committed Nov 27, 2024
1 parent cae5255 commit 96fcb38
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 32 deletions.
31 changes: 16 additions & 15 deletions print.html
Original file line number Diff line number Diff line change
Expand Up @@ -428,27 +428,28 @@ <h2 id="what-youll-learn"><a class="header" href="#what-youll-learn">What You'll
<p>📖 Before reading this section of the book, it is advised to read the <a href="sdk/../fpp-dev/env.html">Fault Proof Program Environment</a>
section to familiarize yourself with the PreimageOracle IO pattern.</p>
</blockquote>
<p>Kona is effectively split into two parts:</p>
<p>Kona is effectively split into three parts:</p>
<ul>
<li>OP Stack state transition logic (<code>kona-derive</code>, <code>kona-executor</code>, <code>kona-mpt</code>)</li>
<li>OP Stack state transition proof SDK (<code>kona-preimage</code>, <code>kona-proof</code>)</li>
<li><a href="sdk/./glossary.html#fault-proof-vm">Fault Proof VM</a>
IO and utilities
(<code>kona-common</code>, <code>kona-common-proc</code>, <code>kona-preimage</code>)</li>
(<code>kona-std-fpvm</code>, <code>kona-std-fpvm-proc</code>)</li>
</ul>
<p>This section of the book focuses on the usage of <code>kona-common</code> and <code>kona-preimage</code> to facilitate host&lt;-&gt;client
<p>This section of the book focuses on the usage of <code>kona-std-fpvm</code> and <code>kona-preimage</code> to facilitate host&lt;-&gt;client
communication for programs running on top of the <a href="sdk/../fpp-dev/env.html">FPVM targets</a>.</p>
<h2 id="host---client-communication-api"><a class="header" href="#host---client-communication-api">Host &lt;-&gt; Client Communication API</a></h2>
<p>The FPVM system API is built on several layers. In this document, we'll cover these layers, from lowest-level to
highest-level API.</p>
<h3 id="kona-common"><a class="header" href="#kona-common"><code>kona-common</code></a></h3>
<p><code>kona-common</code> implements raw syscall dispatch, a default global memory allocator, and a blocking async runtime.
<code>kona-common</code> relies on a minimal linux backend to function, supporting only the syscalls required to implement the
<h3 id="kona-std-fpvm"><a class="header" href="#kona-std-fpvm"><code>kona-std-fpvm</code></a></h3>
<p><code>kona-std-fpvm</code> implements raw syscall dispatch, a default global memory allocator, and a blocking async runtime.
<code>kona-std-fpvm</code> relies on a minimal linux backend to function, supporting only the syscalls required to implement the
<a href="https://specs.optimism.io/experimental/fault-proof/index.html#pre-image-oracle">PreimageOracle ABI</a> (<code>read</code>, <code>write</code>, <code>exit_group</code>).</p>
<p>These syscalls are exposed to the user through the <code>io</code> module directly, with each supported platform implementing the
<a href="https://docs.rs/kona-common/latest/kona_common/trait.BasicKernelInterface.html"><code>BasicKernelInterface</code></a> trait.</p>
<p>To directly dispatch these syscalls, the <a href="https://docs.rs/kona-common/latest/kona_common/io/index.html"><code>io</code></a> module
<a href="https://docs.rs/kona-std-fpvm/latest/kona_std_fpvm/trait.BasicKernelInterface.html"><code>BasicKernelInterface</code></a> trait.</p>
<p>To directly dispatch these syscalls, the <a href="https://docs.rs/kona-std-fpvm/latest/kona_std_fpvm/io/index.html"><code>io</code></a> module
exposes a safe API:</p>
<pre><code class="language-rs">use kona_common::{io, FileDescriptor};
<pre><code class="language-rs">use kona_std_fpvm::{io, FileDescriptor};

// Print to `stdout`. Infallible, will panic if dispatch fails.
io::print("Hello, world!");
Expand All @@ -470,14 +471,14 @@ <h3 id="kona-common"><a class="header" href="#kona-common"><code>kona-common</co
when developing programs that target the <a href="sdk/../fpp-dev/env.html">FPVMs</a>, barring needs like printing directly to
<code>stdout</code>.</p>
<h3 id="kona-preimage"><a class="header" href="#kona-preimage"><code>kona-preimage</code></a></h3>
<p><code>kona-preimage</code> is an implementation of the <a href="https://specs.optimism.io/experimental/fault-proof/index.html#pre-image-oracle">PreimageOracle ABI</a>, built on top of <code>kona-common</code>. This
crate enables synchronous communication between the host and client program, described in
<p><code>kona-preimage</code> is an implementation of the <a href="https://specs.optimism.io/experimental/fault-proof/index.html#pre-image-oracle">PreimageOracle ABI</a>. This crate enables synchronous
communication between the host and client program, described in
<a href="sdk/../fpp-dev/env.html#host---client-communication">Host &lt;-&gt; Client Communication</a> in the FPP Dev environment section of the
book.</p>
<p>The crate is built around the <a href="https://docs.rs/kona-preimage/latest/kona_preimage/struct.PipeHandle.html"><code>PipeHandle</code></a>,
<p>The crate is built around the <a href="https://docs.rs/kona-preimage/latest/kona_preimage/trait.Channel.html"><code>Channel</code></a> trait,
which serves as a single end of a bidirectional pipe (see: <a href="https://man7.org/linux/man-pages/man2/pipe.2.html"><code>pipe</code> manpage</a>).</p>
<p>Through this handle, the higher-level constructs can read and write data to the counterparty holding on to the other end
of the pipe, following the protocol below:</p>
of the channel, following the protocol below:</p>
<center>
<pre class="mermaid">sequenceDiagram
Client-&gt;&gt;+Host: Hint preimage (no-op on-chain / read-only mode)
Expand Down Expand Up @@ -512,8 +513,8 @@ <h3 id="kona-preimage"><a class="header" href="#kona-preimage"><code>kona-preima
</ul>
<p>Each of these traits, however, can be re-implemented to redefine the host&lt;-&gt;client communication protocol if the needs
of the consumer are not covered by the to-<a href="https://specs.optimism.io/experimental/fault-proof/index.html#pre-image-oracle">spec</a> implementations.</p>
<h3 id="kona-client---oracle-backed-sources-example"><a class="header" href="#kona-client---oracle-backed-sources-example"><code>kona-client</code> - Oracle-backed sources (example)</a></h3>
<p>Finally, in <code>kona-client</code>, implementations of data source traits from <code>kona-derive</code> and <code>kona-executor</code> are implemented
<h3 id="kona-proof---oracle-backed-sources-example"><a class="header" href="#kona-proof---oracle-backed-sources-example"><code>kona-proof</code> - Oracle-backed sources (example)</a></h3>
<p>Finally, in <code>kona-proof</code>, implementations of data source traits from <code>kona-derive</code> and <code>kona-executor</code> are provided
to pull in untyped data from the host by <code>PreimageKey</code>. These data source traits are covered in more detail within
the <a href="sdk/./custom-backend.html">Custom Backend</a> section, but we'll quickly gloss over them here to build intuition.</p>
<p>Let's take, for example, <a href="https://github.com/anton-rs/kona/blob/40a8d7ec3def4a1eeb26492a1e4338d8b032e428/bin/client/src/l1/chain_provider.rs#L16-L23"><code>OracleL1ChainProvider</code></a>.
Expand Down
31 changes: 16 additions & 15 deletions sdk/fpvm-backend.html
Original file line number Diff line number Diff line change
Expand Up @@ -195,27 +195,28 @@ <h1 id="fpvm-backend"><a class="header" href="#fpvm-backend">FPVM Backend</a></h
<p>📖 Before reading this section of the book, it is advised to read the <a href="../fpp-dev/env.html">Fault Proof Program Environment</a>
section to familiarize yourself with the PreimageOracle IO pattern.</p>
</blockquote>
<p>Kona is effectively split into two parts:</p>
<p>Kona is effectively split into three parts:</p>
<ul>
<li>OP Stack state transition logic (<code>kona-derive</code>, <code>kona-executor</code>, <code>kona-mpt</code>)</li>
<li>OP Stack state transition proof SDK (<code>kona-preimage</code>, <code>kona-proof</code>)</li>
<li><a href="./glossary.html#fault-proof-vm">Fault Proof VM</a>
IO and utilities
(<code>kona-common</code>, <code>kona-common-proc</code>, <code>kona-preimage</code>)</li>
(<code>kona-std-fpvm</code>, <code>kona-std-fpvm-proc</code>)</li>
</ul>
<p>This section of the book focuses on the usage of <code>kona-common</code> and <code>kona-preimage</code> to facilitate host&lt;-&gt;client
<p>This section of the book focuses on the usage of <code>kona-std-fpvm</code> and <code>kona-preimage</code> to facilitate host&lt;-&gt;client
communication for programs running on top of the <a href="../fpp-dev/env.html">FPVM targets</a>.</p>
<h2 id="host---client-communication-api"><a class="header" href="#host---client-communication-api">Host &lt;-&gt; Client Communication API</a></h2>
<p>The FPVM system API is built on several layers. In this document, we'll cover these layers, from lowest-level to
highest-level API.</p>
<h3 id="kona-common"><a class="header" href="#kona-common"><code>kona-common</code></a></h3>
<p><code>kona-common</code> implements raw syscall dispatch, a default global memory allocator, and a blocking async runtime.
<code>kona-common</code> relies on a minimal linux backend to function, supporting only the syscalls required to implement the
<h3 id="kona-std-fpvm"><a class="header" href="#kona-std-fpvm"><code>kona-std-fpvm</code></a></h3>
<p><code>kona-std-fpvm</code> implements raw syscall dispatch, a default global memory allocator, and a blocking async runtime.
<code>kona-std-fpvm</code> relies on a minimal linux backend to function, supporting only the syscalls required to implement the
<a href="https://specs.optimism.io/experimental/fault-proof/index.html#pre-image-oracle">PreimageOracle ABI</a> (<code>read</code>, <code>write</code>, <code>exit_group</code>).</p>
<p>These syscalls are exposed to the user through the <code>io</code> module directly, with each supported platform implementing the
<a href="https://docs.rs/kona-common/latest/kona_common/trait.BasicKernelInterface.html"><code>BasicKernelInterface</code></a> trait.</p>
<p>To directly dispatch these syscalls, the <a href="https://docs.rs/kona-common/latest/kona_common/io/index.html"><code>io</code></a> module
<a href="https://docs.rs/kona-std-fpvm/latest/kona_std_fpvm/trait.BasicKernelInterface.html"><code>BasicKernelInterface</code></a> trait.</p>
<p>To directly dispatch these syscalls, the <a href="https://docs.rs/kona-std-fpvm/latest/kona_std_fpvm/io/index.html"><code>io</code></a> module
exposes a safe API:</p>
<pre><code class="language-rs">use kona_common::{io, FileDescriptor};
<pre><code class="language-rs">use kona_std_fpvm::{io, FileDescriptor};

// Print to `stdout`. Infallible, will panic if dispatch fails.
io::print("Hello, world!");
Expand All @@ -237,14 +238,14 @@ <h3 id="kona-common"><a class="header" href="#kona-common"><code>kona-common</co
when developing programs that target the <a href="../fpp-dev/env.html">FPVMs</a>, barring needs like printing directly to
<code>stdout</code>.</p>
<h3 id="kona-preimage"><a class="header" href="#kona-preimage"><code>kona-preimage</code></a></h3>
<p><code>kona-preimage</code> is an implementation of the <a href="https://specs.optimism.io/experimental/fault-proof/index.html#pre-image-oracle">PreimageOracle ABI</a>, built on top of <code>kona-common</code>. This
crate enables synchronous communication between the host and client program, described in
<p><code>kona-preimage</code> is an implementation of the <a href="https://specs.optimism.io/experimental/fault-proof/index.html#pre-image-oracle">PreimageOracle ABI</a>. This crate enables synchronous
communication between the host and client program, described in
<a href="../fpp-dev/env.html#host---client-communication">Host &lt;-&gt; Client Communication</a> in the FPP Dev environment section of the
book.</p>
<p>The crate is built around the <a href="https://docs.rs/kona-preimage/latest/kona_preimage/struct.PipeHandle.html"><code>PipeHandle</code></a>,
<p>The crate is built around the <a href="https://docs.rs/kona-preimage/latest/kona_preimage/trait.Channel.html"><code>Channel</code></a> trait,
which serves as a single end of a bidirectional pipe (see: <a href="https://man7.org/linux/man-pages/man2/pipe.2.html"><code>pipe</code> manpage</a>).</p>
<p>Through this handle, the higher-level constructs can read and write data to the counterparty holding on to the other end
of the pipe, following the protocol below:</p>
of the channel, following the protocol below:</p>
<center>
<pre class="mermaid">sequenceDiagram
Client-&gt;&gt;+Host: Hint preimage (no-op on-chain / read-only mode)
Expand Down Expand Up @@ -279,8 +280,8 @@ <h3 id="kona-preimage"><a class="header" href="#kona-preimage"><code>kona-preima
</ul>
<p>Each of these traits, however, can be re-implemented to redefine the host&lt;-&gt;client communication protocol if the needs
of the consumer are not covered by the to-<a href="https://specs.optimism.io/experimental/fault-proof/index.html#pre-image-oracle">spec</a> implementations.</p>
<h3 id="kona-client---oracle-backed-sources-example"><a class="header" href="#kona-client---oracle-backed-sources-example"><code>kona-client</code> - Oracle-backed sources (example)</a></h3>
<p>Finally, in <code>kona-client</code>, implementations of data source traits from <code>kona-derive</code> and <code>kona-executor</code> are implemented
<h3 id="kona-proof---oracle-backed-sources-example"><a class="header" href="#kona-proof---oracle-backed-sources-example"><code>kona-proof</code> - Oracle-backed sources (example)</a></h3>
<p>Finally, in <code>kona-proof</code>, implementations of data source traits from <code>kona-derive</code> and <code>kona-executor</code> are provided
to pull in untyped data from the host by <code>PreimageKey</code>. These data source traits are covered in more detail within
the <a href="./custom-backend.html">Custom Backend</a> section, but we'll quickly gloss over them here to build intuition.</p>
<p>Let's take, for example, <a href="https://github.com/anton-rs/kona/blob/40a8d7ec3def4a1eeb26492a1e4338d8b032e428/bin/client/src/l1/chain_provider.rs#L16-L23"><code>OracleL1ChainProvider</code></a>.
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 96fcb38

Please sign in to comment.