From 1aa5263c669674a800d807c93f301f121e4eb235 Mon Sep 17 00:00:00 2001 From: Cyrill Leutwiler Date: Fri, 2 Dec 2022 22:31:05 +0100 Subject: [PATCH] Release v0.2.0 Berlin (#1090) --- .github/workflows/test.yml | 6 ++--- CHANGELOG.md | 49 ++++++++++++++++++++++++++++++++++++-- Cargo.toml | 4 ++-- README.md | 19 ++++----------- docs/installing.rst | 22 ++++++++--------- solang-parser/Cargo.toml | 2 +- 6 files changed, 69 insertions(+), 33 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4e7df72ca..c160f5951 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -103,7 +103,7 @@ jobs: with: submodules: recursive - name: Download LLVM - run: curl -sSL -o c:\llvm.zip https://github.com/hyperledger/solang/releases/download/v0.1.13/llvm13.0-win.zip + run: curl -sSL -o c:\llvm.zip https://github.com/hyperledger/solang/releases/download/v0.2.0/llvm13.0-win.zip - name: Extract LLVM run: unzip c:\llvm.zip -d c:/ - name: Add LLVM to Path @@ -141,7 +141,7 @@ jobs: default: true profile: minimal - name: Get LLVM - run: curl -L --output llvm13.0-mac-arm.tar.xz https://github.com/hyperledger/solang/releases/download/v0.1.13/llvm13.0-mac-arm.tar.xz + run: curl -L --output llvm13.0-mac-arm.tar.xz https://github.com/hyperledger/solang/releases/download/v0.2.0/llvm13.0-mac-arm.tar.xz - name: Extract LLVM run: tar Jxf llvm13.0-mac-arm.tar.xz - name: Add LLVM to Path @@ -169,7 +169,7 @@ jobs: default: true profile: minimal - name: Get LLVM - run: wget -q -O llvm13.0-mac-intel.tar.xz https://github.com/hyperledger/solang/releases/download/v0.1.13/llvm13.0-mac-intel.tar.xz + run: wget -q -O llvm13.0-mac-intel.tar.xz https://github.com/hyperledger/solang/releases/download/v0.2.0/llvm13.0-mac-intel.tar.xz - name: Extract LLVM run: tar Jxf llvm13.0-mac-intel.tar.xz - name: Add LLVM to Path diff --git a/CHANGELOG.md b/CHANGELOG.md index a5efc143a..941204df5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,12 +2,57 @@ All notable changes to [Solang](https://github.com/hyperledger/solang/) will be documented here. -## Unreleased +## v0.2.0.0 Berlin +We are happy to release solang `v0.2.0` codenamed `Berlin` today. Aside from containing many small fixes and improvements, this release marks a milestone towards maturing our Substrate compilation target: any regressions building up since `ink!` v3.0 are fixed, most notably the metadata format (shoutout and many thanks to external contributor [extraymond](https://github.com/extraymond)) and event topics. Furthermore, we are leaving `ink!` version 3 behind us, in favor of introducing compatibility with the recent `ink!` 4 beta release and the latest pallet contract `v0.22.1`. ### Added -- Introduce new sub-command `solang idl` which can be used for generating +- **Solana / breaking:** The try-catch construct is no longer permitted on Solana, as it + never worked. Any CPI error will abort the transaction. + [seanyoung](https://github.com/seanyoung) +- **Solana:** Introduce new sub-command `solang idl` which can be used for generating a Solidity interface file from an Anchor IDL file. This can be used for calling Anchor Contracts on Solana. [seanyoung](https://github.com/seanyoung) +- **Substrate:** Provide specific Substrate builtins via a "substrate" file. The + `Hash` type from `ink!` is the first `ink!` specific type made available for Solidity + contracts. + [xermicus](https://github.com/xermicus) +- **Substrate:** Introduce the `--log-api-return-codes` CLI flag, which changes the + emitted code to print return codes for `seal` API calls into the debug buffer. + [xermicus](https://github.com/xermicus) +- Introduce function name mangling for overloaded functions and constructors, so + that they can be represented properly in the metadata. + [xermicus](https://github.com/xermicus) + +### Changed + - The Solana target now uses Borsh encoding rather than eth abi + encoding. This is aimed at making Solang contracts Anchor compatible. + [LucasSte](https://github.com/LucasSte) +- **Substrate / breaking:** Supported node version is now pallet contracts `v0.22.1`. + [xermicus](https://github.com/xermicus) +- **Substrate / breaking:** Remove the deprecated `random` builtin. + [xermicus](https://github.com/xermicus) + +### Fixed + - Whenever possible, the parser does not give up after the first error. + [salaheldinsoliman](https://github.com/salaheldinsoliman) + - Constant expressions are checked for overflow. + [salaheldinsoliman](https://github.com/salaheldinsoliman) + - AddMod and MulMod were broken. This is now fixed. + [LucasSte](https://github.com/LucasSte) +- **Substrate / breaking:** Solang is now compatible with `ink!` version 4 (beta). + [xermicus](https://github.com/xermicus) +- **Substrate:** Switched ABI generation to use official `ink!` crates, which fixes all + remaining metadata regressions. + [extraymond](https://github.com/extraymond) and [xermicus](https://github.com/xermicus) +- **Substrate:** Allow constructors to have a name, so that multiple constructors are + supported, like in `ink!`. + [xermicus](https://github.com/xermicus) +- All provided examples as well as most of the Solidity code snippets in our + documentation are now checked for succesful compilation on the Solang CI. + [xermicus](https://github.com/xermicus) +- **Substrate:** Fix events with topics. The topic hashes generated by Solang + contracts are now exactly the same as those generated by `ink!`. + [xermicus](https://github.com/xermicus) ## v0.1.13 Genoa diff --git a/Cargo.toml b/Cargo.toml index 32ad73802..b06f35724 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "solang" -version = "0.1.13" +version = "0.2.0" authors = ["Sean Young "] homepage = "https://github.com/hyperledger/solang" documentation = "https://solang.readthedocs.io/" @@ -46,7 +46,7 @@ itertools = "0.10" num-rational = "0.4" indexmap = "1.8" once_cell = "1.10" -solang-parser = { path = "solang-parser", version = "0.1.18" } +solang-parser = { path = "solang-parser", version = "0.2.0" } codespan-reporting = "0.11" phf = { version = "0.11", features = ["macros"] } rust-lapper = "1.0" diff --git a/README.md b/README.md index 11c626183..1d36c3dba 100644 --- a/README.md +++ b/README.md @@ -116,17 +116,6 @@ node flipper.js ## Build for Substrate -### Status -:warning: Solang was developed against Substrate v3.0. It has been a while since the last time the Substrate target was worked on, which introduced a few known regressions. Currently, the following is known to **not** work with recent Substrate versions: - -* Function call arguments of type `address` -* Function return values of type `address` -* Cross-contract calls -* Events with indexed fields - -Maintenance on the Substrate target has now resumed and we are working on fixing these issues. - -### Building Run: ```bash @@ -156,8 +145,8 @@ Here is a brief description of what we envision for the next versions. | Solana SPL tokens compatibility | Completed | | Parse and resolve inline assembly | Completed | | Generate code for inline assembly | Completed | -| Support Solana's Program Derived Addresses | In Progress | -| Support latest Substrate production target | In Progress | +| Support latest Substrate production target | Completed | +| Improve parser resilience | Completed | ### V0.3 @@ -166,10 +155,12 @@ Here is a brief description of what we envision for the next versions. |--------------------------------------------|-------------| | Call Solana's Rust contracts from Solidity | In progress | | Improvements in overflow checking | In progress | +| Support Solana's Program Derived Addresses | In Progress | | Call Solidity from Solana's Rust contracts | Not started | -| Improve parser resilience | Not started | | Improve developer experience for Substrate | Not started | | Tooling for calls between ink! <> solidity | Not started | +| Support chain extensions for Substrate | Not started | +| Provide CLI for node interactions | Not started | ### V0.4 diff --git a/docs/installing.rst b/docs/installing.rst index 5fe73abd1..f9e42b079 100644 --- a/docs/installing.rst +++ b/docs/installing.rst @@ -28,11 +28,11 @@ Option 2: Download binaries There are binaries available on github releases: -- `Linux x86-64 `_ -- `Linux arm64 `_ -- `Windows x64 `_ -- `MacOS intel `_ -- `MacOS arm `_ +- `Linux x86-64 `_ +- `Linux arm64 `_ +- `Windows x64 `_ +- `MacOS intel `_ +- `MacOS arm `_ Download the file and save it somewhere in your ``$PATH``, for example the bin directory in your home directory. If the path you use is not already in ``$PATH``, then you need to add it yourself. @@ -56,7 +56,7 @@ Option 3: Use ghcr.io/hyperledger/solang containers New images are automatically made available on `solang containers `_. -There is a release `v0.1.13` tag and a `latest` tag: +There is a release `v0.2.0` tag and a `latest` tag: .. code-block:: bash @@ -113,7 +113,7 @@ These patches make it possible to generate code for Solana, and fixes concurrency issues in the lld linker. You can either download the pre-built libraries from -`github `_ +`github `_ or :ref:`build your own from source `. After that, you need to add the ``bin`` of your LLVM directory to your path, so that the build system of Solang can find the correct version of LLVM to use. @@ -121,7 +121,7 @@ Linux ~~~~~ A pre-built version of LLVM, specifically configured for Solang, is available at -``_. +``_. After downloading, untar the file in a terminal and add it to your path. .. code-block:: bash @@ -133,7 +133,7 @@ Windows ~~~~~~~ A pre-built version of LLVM, specifically configured for Solang, is available at -``_. +``_. After unzipping the file, add the bin directory to your path. @@ -145,8 +145,8 @@ Mac ~~~ A pre-built version of LLVM for intel macs, is available at -``_ and for arm macs there is -``_. After downloading, +``_ and for arm macs there is +``_. After downloading, untar the file in a terminal and add it to your path like so: .. code-block:: bash diff --git a/solang-parser/Cargo.toml b/solang-parser/Cargo.toml index f8e77550b..e28f63fe3 100644 --- a/solang-parser/Cargo.toml +++ b/solang-parser/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "solang-parser" -version = "0.1.18" +version = "0.2.0" authors = ["Sean Young "] homepage = "https://github.com/hyperledger/solang" documentation = "https://solang.readthedocs.io/"