Exposes the following PolkaVM specific options via the standard json
interface:
- Heap size
- Stack size
- Whether to emit source level debug information
Additionally it is now forbidden to specify those as CLI option in
standard JSON mode. They are bytecode altering options and having
multiple ways to specify them creates unnecessary room for confusion:
The standard JSON input description should be sufficient and succint for
reproducible builds.
Closes#290
---------
Signed-off-by: xermicus <bigcyrill@hotmail.com>
- Add support for solc `v0.8.30`. No changes in YUL or the binary
interface.
- Fix a semver bug in the NPM packages to correctly align their solc
dependencies with our last supported version.
---------
Signed-off-by: Cyrill Leutwiler <bigcyrill@hotmail.com>
So far if no optimization level was specified, optimizations for
execution time were applied. However, we currently are a bit limited on
code size. Add to that, this setting is not available in solc and people
generally ignore the docs, generating a lot of support requests.
Signed-off-by: Cyrill Leutwiler <bigcyrill@hotmail.com>
- Allow configuration of the maximum heap and stack size via CLI flags
and JSON input settings.
- Increase the default value for the stack size to 32kb.
---------
Signed-off-by: Cyrill Leutwiler <bigcyrill@hotmail.com>
- Lazily load function arguments so that they can be passed as pointers.
- Lazily call the immutable store function to avoid storing zero sized
immutable data.
---------
Signed-off-by: Cyrill Leutwiler <bigcyrill@hotmail.com>
Storage keys and values are big endian. Keeping them LE was a pre-mature
optimization because for the contract itself it this is a no-op and thus
not observable. However we should consider the storage layout as part of
the contract ABI. The endianness of transient storage values are still
kept as-is.
---------
Signed-off-by: Cyrill Leutwiler <bigcyrill@hotmail.com>
- Support for passing LLVM command line options via the prcoess input or
providing one or more `--llvm-arg='..'` resolc CLI flag. This allows
more fine-grained control over the LLVM backend configuration.
- Make LLVM initialization idempotent.
---------
Signed-off-by: Cyrill Leutwiler <bigcyrill@hotmail.com>
The differential testing framework will make a second consumer. There
seems to be no re-usable Rust crate for this. But we already have
everything here, just needs a small refactor to make it fully re-usable.
- Mostly decouple the solc JSON-input-output interface types from the
`solidity` frontend crate
- Expose the JSON-input-output interface types in a dedicated crate
---------
Signed-off-by: Cyrill Leutwiler <bigcyrill@hotmail.com>
### Description
Adds `--supported-solc-versions` cli command to return a semver range of
supported `solc` versions.
Is a hack until #162 is implemented.
---------
Co-authored-by: xermicus <cyrill@parity.io>
No observable changes w.r.t. YUL compilation.
- Mark solc v0.8.29 as the latest supported version
- Add integration test for solc v0.8.29 specific feature
- Use the latest version on CI
- Drive-by fix linter complaints and a two types in the CI yaml files
---------
Signed-off-by: Cyrill Leutwiler <bigcyrill@hotmail.com>
Signed-off-by: xermicus <cyrill@parity.io>
- Add the revive runtime function interface to minimize boiler plate
code.
- Outline heavily repeated code into dedicated functions to bring down
code size.
- The code size tests builds optimized for size.
- Function attributes are passed as slices.
This significantly brings down the code size for all OpenZeppelin wizard
contracts (using all possible features) compiled against OpenZeppelin
`v5.0.0` with size optimizations.
|contract|| `-Oz` main | `-Oz` PR || `-O3` main | `-O3` PR |
|-|-|-|-|-|-|-|
|erc1155.sol||100K|67K||114K|147K|
|erc20.sol||120K|90K||160K|191K|
|erc721.sol||128K|101K||178K|214K|
|governor.sol||226K|165K||293K|349K|
|rwa.sol||116K|85K||154K|185K|
|stable.sol||116K|86K||155K|192K|
On the flip side this introduces a heavy penalty for cycle optimized
builds. Setting the no-inline attributes for cycle optimized builds
helps a lot but heavily penalizes runtime speed (LLVM does not yet
inline everything properly - to be investigated later on).
Next steps:
- Modularize more functions
- Refactor the YUL function arguments to use pointers instead of values
- Afterwards check if LLVM still has trouble inline-ing properly on O3
or set the no-inline attribute if it does not penalize runtime
performance too bad.
- llvm artifacts search, download and extract now in `get-llvm` action
- `get-emsdk` action - clone, install, activate emsdk, so we don't need
to build `revive-builder` for this
- switch workflows to new actions
- `concurrency` for remaining workflows (cancel run if new run is
triggered)
- `target_commitish` for main release, fixes release commit
- Run release workflow in PR without creating a release if PR is labeled
with `release-test`
---------
Co-authored-by: cornholio <0@mcornholio.ru>
Co-authored-by: Alexander Theißen <alex.theissen@me.com>
Co-authored-by: xermicus <cyrill@parity.io>
Co-authored-by: xermicus <bigcyrill@hotmail.com>
Pre-eliminary support for LLVM releases and resolc binary releases by streamlining the build process for all supported hosts platforms.
- Introduce the revive-llvm-builder crate with the revive-llvm builder utilty.
- Do not rely on the LLVM dependency in $PATH to decouple the system LLVM installation from the LLVM host dependency.
- Fix the emscripten build by decoupling the host and native LLVM dependencies. Thus allowing a single LLVM emscripten release that can be used on any host platform.
- An example Dockerfile building an alpine container with a fully statically linked resolc ELF binary.
- Remove the Debian builder utilities and workflow.