Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion book/src/developer_guide/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Unlike with the EVM, where heap memory usage is gas metered, our heap size is st

LLVM is a special non Rust dependency. We interface its builder interface via the [inkwell](https://crates.io/crates/inkwell) wrapper crate.

We use upstream LLVM, but release and use our custom builds. We require the compiler builtins specifically built for the PVM rv64e target and always leave assertions on. Furthermore, we need cross builds because `resolc` itself targets emscripten and musl. The [revive-llvm-builer](https://crates.io/crates/revive-llvm-builder) functions as a cross-platform build script and is used to build and release the LLVM dependency.
We use upstream LLVM, but release and use our custom builds. We require the compiler builtins specifically built for the PVM `rv64emacb` target and always leave assertions on. Furthermore, we need cross builds because `resolc` itself targets emscripten and musl. The [revive-llvm-builer](https://crates.io/crates/revive-llvm-builder) functions as a cross-platform build script and is used to build and release the LLVM dependency.

We also maintain the [lld-sys crate](https://crates.io/crates/lld-sys) for interfacing with `LLD`. The LLVM linker is used during the compilation process, but we don't want to distribute another binary.

Expand Down
8 changes: 4 additions & 4 deletions book/src/user_guide/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Valid levels are the following:
- `s`: Optimize for code size.
- `z`: Aggressively optimize for code size.

By default, `-O3` is applied.
By default, `-Oz` is applied.

### Stack size
```bash
Expand All @@ -31,11 +31,11 @@ By default, `-O3` is applied.
PVM is a register machine with a traditional stack memory space for local variables. This controls the total amount of stack space the contract can use.

You are incentivized to keep this value as small as possible:
1. Increasing the stack size will increase startup costs.
1. Increasing the stack size will increase gas costs due to increased startup costs.
2. The stack size contributes to the total memory size a contract can use, which includes the contract's code size.

Default value: 32768

> [!WARNING]
>
> If the contract uses more stack memory than configured, it will compile fine but eventually revert execution at runtime!
Expand All @@ -52,7 +52,7 @@ You are incentivized to keep this value as small as possible:
2.The heap size contributes to the total memory size a contract can use, which includes the contract's code size

Default value: 65536

> [!WARNING]
>
> If the contract uses more heap memory than configured, it will compile fine but eventually revert execution at runtime!
Expand Down
2 changes: 1 addition & 1 deletion docs/404.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
const path_to_root = "";
const default_light_theme = "light";
const default_dark_theme = "navy";
window.path_to_searchindex_js = "searchindex-756a6899.js";
window.path_to_searchindex_js = "searchindex-82723808.js";
</script>
<!-- Start loading toc.js asap -->
<script src="toc-6f3f265e.js"></script>
Expand Down
2 changes: 1 addition & 1 deletion docs/developer_guide.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
const path_to_root = "";
const default_light_theme = "light";
const default_dark_theme = "navy";
window.path_to_searchindex_js = "searchindex-756a6899.js";
window.path_to_searchindex_js = "searchindex-82723808.js";
</script>
<!-- Start loading toc.js asap -->
<script src="toc-6f3f265e.js"></script>
Expand Down
4 changes: 2 additions & 2 deletions docs/developer_guide/architecture.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
const path_to_root = "../";
const default_light_theme = "light";
const default_dark_theme = "navy";
window.path_to_searchindex_js = "../searchindex-756a6899.js";
window.path_to_searchindex_js = "../searchindex-82723808.js";
</script>
<!-- Start loading toc.js asap -->
<script src="../toc-6f3f265e.js"></script>
Expand Down Expand Up @@ -205,7 +205,7 @@ <h2 id="evm-heap-memory"><a class="header" href="#evm-heap-memory">EVM heap memo
<p>Unlike with the EVM, where heap memory usage is gas metered, our heap size is static (the size is user controllable via a setting flag). The compiler emits bound checks to prevent overflows.</p>
<h2 id="the-llvm-dependency"><a class="header" href="#the-llvm-dependency">The LLVM dependency</a></h2>
<p>LLVM is a special non Rust dependency. We interface its builder interface via the <a href="https://crates.io/crates/inkwell">inkwell</a> wrapper crate.</p>
<p>We use upstream LLVM, but release and use our custom builds. We require the compiler builtins specifically built for the PVM rv64e target and always leave assertions on. Furthermore, we need cross builds because <code>resolc</code> itself targets emscripten and musl. The <a href="https://crates.io/crates/revive-llvm-builder">revive-llvm-builer</a> functions as a cross-platform build script and is used to build and release the LLVM dependency.</p>
<p>We use upstream LLVM, but release and use our custom builds. We require the compiler builtins specifically built for the PVM <code>rv64emacb</code> target and always leave assertions on. Furthermore, we need cross builds because <code>resolc</code> itself targets emscripten and musl. The <a href="https://crates.io/crates/revive-llvm-builder">revive-llvm-builer</a> functions as a cross-platform build script and is used to build and release the LLVM dependency.</p>
<p>We also maintain the <a href="https://crates.io/crates/lld-sys">lld-sys crate</a> for interfacing with <code>LLD</code>. The LLVM linker is used during the compilation process, but we don’t want to distribute another binary.</p>
<h2 id="custom-optimizations"><a class="header" href="#custom-optimizations">Custom optimizations</a></h2>
<p>At the moment, no significant custom optimizations are implemented. Thus, we are missing some optimization opportunities that neither <code>solc</code> nor LLVM can realize (due to their lack of domain specific knowledge about the semantics of our target environment). Furthermore, <code>solc</code> optimizes for EVM gas and a target machine orthogonal to our target (BE 256-bit stack machine EVM vs. 64-bit LE RISC architecture PVM). We have started working on an additional IR layer between Yul and LLVM to capture missed optimization opportunities, though.</p>
Expand Down
2 changes: 1 addition & 1 deletion docs/developer_guide/contributing.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
const path_to_root = "../";
const default_light_theme = "light";
const default_dark_theme = "navy";
window.path_to_searchindex_js = "../searchindex-756a6899.js";
window.path_to_searchindex_js = "../searchindex-82723808.js";
</script>
<!-- Start loading toc.js asap -->
<script src="../toc-6f3f265e.js"></script>
Expand Down
2 changes: 1 addition & 1 deletion docs/developer_guide/cross_compilation.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
const path_to_root = "../";
const default_light_theme = "light";
const default_dark_theme = "navy";
window.path_to_searchindex_js = "../searchindex-756a6899.js";
window.path_to_searchindex_js = "../searchindex-82723808.js";
</script>
<!-- Start loading toc.js asap -->
<script src="../toc-6f3f265e.js"></script>
Expand Down
2 changes: 1 addition & 1 deletion docs/developer_guide/target.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
const path_to_root = "../";
const default_light_theme = "light";
const default_dark_theme = "navy";
window.path_to_searchindex_js = "../searchindex-756a6899.js";
window.path_to_searchindex_js = "../searchindex-82723808.js";
</script>
<!-- Start loading toc.js asap -->
<script src="../toc-6f3f265e.js"></script>
Expand Down
2 changes: 1 addition & 1 deletion docs/developer_guide/testing.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
const path_to_root = "../";
const default_light_theme = "light";
const default_dark_theme = "navy";
window.path_to_searchindex_js = "../searchindex-756a6899.js";
window.path_to_searchindex_js = "../searchindex-82723808.js";
</script>
<!-- Start loading toc.js asap -->
<script src="../toc-6f3f265e.js"></script>
Expand Down
2 changes: 1 addition & 1 deletion docs/faq.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
const path_to_root = "";
const default_light_theme = "light";
const default_dark_theme = "navy";
window.path_to_searchindex_js = "searchindex-756a6899.js";
window.path_to_searchindex_js = "searchindex-82723808.js";
</script>
<!-- Start loading toc.js asap -->
<script src="toc-6f3f265e.js"></script>
Expand Down
2 changes: 1 addition & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
const path_to_root = "";
const default_light_theme = "light";
const default_dark_theme = "navy";
window.path_to_searchindex_js = "searchindex-756a6899.js";
window.path_to_searchindex_js = "searchindex-82723808.js";
</script>
<!-- Start loading toc.js asap -->
<script src="toc-6f3f265e.js"></script>
Expand Down
8 changes: 4 additions & 4 deletions docs/print.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
const path_to_root = "";
const default_light_theme = "light";
const default_dark_theme = "navy";
window.path_to_searchindex_js = "searchindex-756a6899.js";
window.path_to_searchindex_js = "searchindex-82723808.js";
</script>
<!-- Start loading toc.js asap -->
<script src="toc-6f3f265e.js"></script>
Expand Down Expand Up @@ -235,14 +235,14 @@ <h3 id="llvm-optimization-levels"><a class="header" href="#llvm-optimization-lev
<li><code>s</code>: Optimize for code size.</li>
<li><code>z</code>: Aggressively optimize for code size.</li>
</ul>
<p>By default, <code>-O3</code> is applied.</p>
<p>By default, <code>-Oz</code> is applied.</p>
<h3 id="stack-size"><a class="header" href="#stack-size">Stack size</a></h3>
<pre><code class="language-bash">--stack-size &lt;STACK_SIZE&gt;
</code></pre>
<p>PVM is a register machine with a traditional stack memory space for local variables. This controls the total amount of stack space the contract can use.</p>
<p>You are incentivized to keep this value as small as possible:</p>
<ol>
<li>Increasing the stack size will increase startup costs.</li>
<li>Increasing the stack size will increase gas costs due to increased startup costs.</li>
<li>The stack size contributes to the total memory size a contract can use, which includes the contract’s code size.</li>
</ol>
<p>Default value: 32768</p>
Expand Down Expand Up @@ -539,7 +539,7 @@ <h2 id="evm-heap-memory"><a class="header" href="#evm-heap-memory">EVM heap memo
<p>Unlike with the EVM, where heap memory usage is gas metered, our heap size is static (the size is user controllable via a setting flag). The compiler emits bound checks to prevent overflows.</p>
<h2 id="the-llvm-dependency"><a class="header" href="#the-llvm-dependency">The LLVM dependency</a></h2>
<p>LLVM is a special non Rust dependency. We interface its builder interface via the <a href="https://crates.io/crates/inkwell">inkwell</a> wrapper crate.</p>
<p>We use upstream LLVM, but release and use our custom builds. We require the compiler builtins specifically built for the PVM rv64e target and always leave assertions on. Furthermore, we need cross builds because <code>resolc</code> itself targets emscripten and musl. The <a href="https://crates.io/crates/revive-llvm-builder">revive-llvm-builer</a> functions as a cross-platform build script and is used to build and release the LLVM dependency.</p>
<p>We use upstream LLVM, but release and use our custom builds. We require the compiler builtins specifically built for the PVM <code>rv64emacb</code> target and always leave assertions on. Furthermore, we need cross builds because <code>resolc</code> itself targets emscripten and musl. The <a href="https://crates.io/crates/revive-llvm-builder">revive-llvm-builer</a> functions as a cross-platform build script and is used to build and release the LLVM dependency.</p>
<p>We also maintain the <a href="https://crates.io/crates/lld-sys">lld-sys crate</a> for interfacing with <code>LLD</code>. The LLVM linker is used during the compilation process, but we don’t want to distribute another binary.</p>
<h2 id="custom-optimizations"><a class="header" href="#custom-optimizations">Custom optimizations</a></h2>
<p>At the moment, no significant custom optimizations are implemented. Thus, we are missing some optimization opportunities that neither <code>solc</code> nor LLVM can realize (due to their lack of domain specific knowledge about the semantics of our target environment). Furthermore, <code>solc</code> optimizes for EVM gas and a target machine orthogonal to our target (BE 256-bit stack machine EVM vs. 64-bit LE RISC architecture PVM). We have started working on an additional IR layer between Yul and LLVM to capture missed optimization opportunities, though.</p>
Expand Down
2 changes: 1 addition & 1 deletion docs/revive_runner.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
const path_to_root = "";
const default_light_theme = "light";
const default_dark_theme = "navy";
window.path_to_searchindex_js = "searchindex-756a6899.js";
window.path_to_searchindex_js = "searchindex-82723808.js";
</script>
<!-- Start loading toc.js asap -->
<script src="toc-6f3f265e.js"></script>
Expand Down
2 changes: 1 addition & 1 deletion docs/roadmap.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
const path_to_root = "";
const default_light_theme = "light";
const default_dark_theme = "navy";
window.path_to_searchindex_js = "searchindex-756a6899.js";
window.path_to_searchindex_js = "searchindex-82723808.js";
</script>
<!-- Start loading toc.js asap -->
<script src="toc-6f3f265e.js"></script>
Expand Down
2 changes: 1 addition & 1 deletion docs/searcher-c2a407aa.js
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ window.search = window.search || {};
if (yes) {
loadSearchScript(
window.path_to_searchindex_js ||
path_to_root + 'searchindex-756a6899.js',
path_to_root + 'searchindex-82723808.js',
'mdbook-search-index');
search_wrap.classList.remove('hidden');
searchicon.setAttribute('aria-expanded', 'true');
Expand Down
1 change: 0 additions & 1 deletion docs/searchindex-756a6899.js

This file was deleted.

1 change: 1 addition & 0 deletions docs/searchindex-82723808.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/user_guide.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
const path_to_root = "";
const default_light_theme = "light";
const default_dark_theme = "navy";
window.path_to_searchindex_js = "searchindex-756a6899.js";
window.path_to_searchindex_js = "searchindex-82723808.js";
</script>
<!-- Start loading toc.js asap -->
<script src="toc-6f3f265e.js"></script>
Expand Down
6 changes: 3 additions & 3 deletions docs/user_guide/cli.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
const path_to_root = "../";
const default_light_theme = "light";
const default_dark_theme = "navy";
window.path_to_searchindex_js = "../searchindex-756a6899.js";
window.path_to_searchindex_js = "../searchindex-82723808.js";
</script>
<!-- Start loading toc.js asap -->
<script src="../toc-6f3f265e.js"></script>
Expand Down Expand Up @@ -193,14 +193,14 @@ <h3 id="llvm-optimization-levels"><a class="header" href="#llvm-optimization-lev
<li><code>s</code>: Optimize for code size.</li>
<li><code>z</code>: Aggressively optimize for code size.</li>
</ul>
<p>By default, <code>-O3</code> is applied.</p>
<p>By default, <code>-Oz</code> is applied.</p>
<h3 id="stack-size"><a class="header" href="#stack-size">Stack size</a></h3>
<pre><code class="language-bash">--stack-size &lt;STACK_SIZE&gt;
</code></pre>
<p>PVM is a register machine with a traditional stack memory space for local variables. This controls the total amount of stack space the contract can use.</p>
<p>You are incentivized to keep this value as small as possible:</p>
<ol>
<li>Increasing the stack size will increase startup costs.</li>
<li>Increasing the stack size will increase gas costs due to increased startup costs.</li>
<li>The stack size contributes to the total memory size a contract can use, which includes the contract’s code size.</li>
</ol>
<p>Default value: 32768</p>
Expand Down
2 changes: 1 addition & 1 deletion docs/user_guide/differences.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
const path_to_root = "../";
const default_light_theme = "light";
const default_dark_theme = "navy";
window.path_to_searchindex_js = "../searchindex-756a6899.js";
window.path_to_searchindex_js = "../searchindex-82723808.js";
</script>
<!-- Start loading toc.js asap -->
<script src="../toc-6f3f265e.js"></script>
Expand Down
2 changes: 1 addition & 1 deletion docs/user_guide/installation.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
const path_to_root = "../";
const default_light_theme = "light";
const default_dark_theme = "navy";
window.path_to_searchindex_js = "../searchindex-756a6899.js";
window.path_to_searchindex_js = "../searchindex-82723808.js";
</script>
<!-- Start loading toc.js asap -->
<script src="../toc-6f3f265e.js"></script>
Expand Down
2 changes: 1 addition & 1 deletion docs/user_guide/js.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
const path_to_root = "../";
const default_light_theme = "light";
const default_dark_theme = "navy";
window.path_to_searchindex_js = "../searchindex-756a6899.js";
window.path_to_searchindex_js = "../searchindex-82723808.js";
</script>
<!-- Start loading toc.js asap -->
<script src="../toc-6f3f265e.js"></script>
Expand Down
2 changes: 1 addition & 1 deletion docs/user_guide/rust_libraries.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
const path_to_root = "../";
const default_light_theme = "light";
const default_dark_theme = "navy";
window.path_to_searchindex_js = "../searchindex-756a6899.js";
window.path_to_searchindex_js = "../searchindex-82723808.js";
</script>
<!-- Start loading toc.js asap -->
<script src="../toc-6f3f265e.js"></script>
Expand Down
2 changes: 1 addition & 1 deletion docs/user_guide/std_json.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
const path_to_root = "../";
const default_light_theme = "light";
const default_dark_theme = "navy";
window.path_to_searchindex_js = "../searchindex-756a6899.js";
window.path_to_searchindex_js = "../searchindex-82723808.js";
</script>
<!-- Start loading toc.js asap -->
<script src="../toc-6f3f265e.js"></script>
Expand Down
2 changes: 1 addition & 1 deletion docs/user_guide/tooling.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
const path_to_root = "../";
const default_light_theme = "light";
const default_dark_theme = "navy";
window.path_to_searchindex_js = "../searchindex-756a6899.js";
window.path_to_searchindex_js = "../searchindex-82723808.js";
</script>
<!-- Start loading toc.js asap -->
<script src="../toc-6f3f265e.js"></script>
Expand Down
2 changes: 1 addition & 1 deletion docs/welcome.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
const path_to_root = "";
const default_light_theme = "light";
const default_dark_theme = "navy";
window.path_to_searchindex_js = "searchindex-756a6899.js";
window.path_to_searchindex_js = "searchindex-82723808.js";
</script>
<!-- Start loading toc.js asap -->
<script src="toc-6f3f265e.js"></script>
Expand Down
Loading