浏览代码

Release v0.2.0 Berlin (#1090)

Cyrill Leutwiler 3 年之前
父节点
当前提交
81c58a304b
共有 6 个文件被更改,包括 69 次插入33 次删除
  1. 3 3
      .github/workflows/test.yml
  2. 47 2
      CHANGELOG.md
  3. 2 2
      Cargo.toml
  4. 5 14
      README.md
  5. 11 11
      docs/installing.rst
  6. 1 1
      solang-parser/Cargo.toml

+ 3 - 3
.github/workflows/test.yml

@@ -103,7 +103,7 @@ jobs:
       with:
       with:
         submodules: recursive
         submodules: recursive
     - name: Download LLVM
     - 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
     - name: Extract LLVM
       run: unzip c:\llvm.zip -d c:/
       run: unzip c:\llvm.zip -d c:/
     - name: Add LLVM to Path
     - name: Add LLVM to Path
@@ -141,7 +141,7 @@ jobs:
           default: true
           default: true
           profile: minimal
           profile: minimal
     - name: Get LLVM
     - 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
     - name: Extract LLVM
       run: tar Jxf llvm13.0-mac-arm.tar.xz
       run: tar Jxf llvm13.0-mac-arm.tar.xz
     - name: Add LLVM to Path
     - name: Add LLVM to Path
@@ -169,7 +169,7 @@ jobs:
           default: true
           default: true
           profile: minimal
           profile: minimal
     - name: Get LLVM
     - 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
     - name: Extract LLVM
       run: tar Jxf llvm13.0-mac-intel.tar.xz
       run: tar Jxf llvm13.0-mac-intel.tar.xz
     - name: Add LLVM to Path
     - name: Add LLVM to Path

+ 47 - 2
CHANGELOG.md

@@ -2,12 +2,57 @@
 All notable changes to [Solang](https://github.com/hyperledger/solang/)
 All notable changes to [Solang](https://github.com/hyperledger/solang/)
 will be documented here.
 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
 ### 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
   a Solidity interface file from an Anchor IDL file. This can be used for calling
   Anchor Contracts on Solana. [seanyoung](https://github.com/seanyoung)
   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
 ## v0.1.13 Genoa
 
 

+ 2 - 2
Cargo.toml

@@ -1,6 +1,6 @@
 [package]
 [package]
 name = "solang"
 name = "solang"
-version = "0.1.13"
+version = "0.2.0"
 authors = ["Sean Young <sean@mess.org>"]
 authors = ["Sean Young <sean@mess.org>"]
 homepage = "https://github.com/hyperledger/solang"
 homepage = "https://github.com/hyperledger/solang"
 documentation = "https://solang.readthedocs.io/"
 documentation = "https://solang.readthedocs.io/"
@@ -46,7 +46,7 @@ itertools = "0.10"
 num-rational = "0.4"
 num-rational = "0.4"
 indexmap = "1.8"
 indexmap = "1.8"
 once_cell = "1.10"
 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"
 codespan-reporting = "0.11"
 phf = { version = "0.11", features = ["macros"] }
 phf = { version = "0.11", features = ["macros"] }
 rust-lapper = "1.0"
 rust-lapper = "1.0"

+ 5 - 14
README.md

@@ -116,17 +116,6 @@ node flipper.js
 
 
 ## Build for Substrate
 ## 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:
 Run:
 
 
 ```bash
 ```bash
@@ -156,8 +145,8 @@ Here is a brief description of what we envision for the next versions.
 | Solana SPL tokens compatibility            | Completed   |
 | Solana SPL tokens compatibility            | Completed   |
 | Parse and resolve inline assembly          | Completed   |
 | Parse and resolve inline assembly          | Completed   |
 | Generate code for 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
 ### 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 |
 | Call Solana's Rust contracts from Solidity | In progress |
 | Improvements in overflow checking          | 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 |
 | Call Solidity from Solana's Rust contracts | Not started |
-| Improve parser resilience                  | Not started |
 | Improve developer experience for Substrate | Not started |
 | Improve developer experience for Substrate | Not started |
 | Tooling for calls between ink! <> solidity | 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
 ### V0.4

+ 11 - 11
docs/installing.rst

@@ -28,11 +28,11 @@ Option 2: Download binaries
 
 
 There are binaries available on github releases:
 There are binaries available on github releases:
 
 
-- `Linux x86-64 <https://github.com/hyperledger/solang/releases/download/v0.1.13/solang-linux-x86-64>`_
-- `Linux arm64 <https://github.com/hyperledger/solang/releases/download/v0.1.13/solang-linux-arm64>`_
-- `Windows x64 <https://github.com/hyperledger/solang/releases/download/v0.1.13/solang.exe>`_
-- `MacOS intel <https://github.com/hyperledger/solang/releases/download/v0.1.13/solang-mac-intel>`_
-- `MacOS arm <https://github.com/hyperledger/solang/releases/download/v0.1.13/solang-mac-arm>`_
+- `Linux x86-64 <https://github.com/hyperledger/solang/releases/download/v0.2.0/solang-linux-x86-64>`_
+- `Linux arm64 <https://github.com/hyperledger/solang/releases/download/v0.2.0/solang-linux-arm64>`_
+- `Windows x64 <https://github.com/hyperledger/solang/releases/download/v0.2.0/solang.exe>`_
+- `MacOS intel <https://github.com/hyperledger/solang/releases/download/v0.2.0/solang-mac-intel>`_
+- `MacOS arm <https://github.com/hyperledger/solang/releases/download/v0.2.0/solang-mac-arm>`_
 
 
 Download the file and save it somewhere in your ``$PATH``, for example the bin directory in your home directory. If the
 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.
 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
 New images are automatically made available on
 `solang containers <https://github.com/hyperledger/solang/pkgs/container/solang>`_.
 `solang containers <https://github.com/hyperledger/solang/pkgs/container/solang>`_.
-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
 .. 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.
 concurrency issues in the lld linker.
 
 
 You can either download the pre-built libraries from
 You can either download the pre-built libraries from
-`github <https://github.com/hyperledger/solang/releases/tag/v0.1.13>`_
+`github <https://github.com/hyperledger/solang/releases/tag/v0.2.0>`_
 or :ref:`build your own from source <llvm-from-source>`. After that, you need to add the ``bin`` of your
 or :ref:`build your own from source <llvm-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.
 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
 A pre-built version of LLVM, specifically configured for Solang, is available at
-`<https://github.com/hyperledger/solang/releases/download/v0.1.13/llvm13.0-linux-x86-64.tar.xz>`_.
+`<https://github.com/hyperledger/solang/releases/download/v0.2.0/llvm13.0-linux-x86-64.tar.xz>`_.
 After downloading, untar the file in a terminal and add it to your path.
 After downloading, untar the file in a terminal and add it to your path.
 
 
 .. code-block:: bash
 .. code-block:: bash
@@ -133,7 +133,7 @@ Windows
 ~~~~~~~
 ~~~~~~~
 
 
 A pre-built version of LLVM, specifically configured for Solang, is available at
 A pre-built version of LLVM, specifically configured for Solang, is available at
-`<https://github.com/hyperledger/solang/releases/download/v0.1.13/llvm13.0-win.zip>`_.
+`<https://github.com/hyperledger/solang/releases/download/v0.2.0/llvm13.0-win.zip>`_.
 
 
 After unzipping the file, add the bin directory to your path.
 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
 A pre-built version of LLVM for intel macs, is available at
-`<https://github.com/hyperledger/solang/releases/download/v0.1.13/llvm13.0-mac-intel.tar.xz>`_ and for arm macs there is
-`<https://github.com/hyperledger/solang/releases/download/v0.1.13/llvm13.0-mac-arm.tar.xz>`_. After downloading,
+`<https://github.com/hyperledger/solang/releases/download/v0.2.0/llvm13.0-mac-intel.tar.xz>`_ and for arm macs there is
+`<https://github.com/hyperledger/solang/releases/download/v0.2.0/llvm13.0-mac-arm.tar.xz>`_. After downloading,
 untar the file in a terminal and add it to your path like so:
 untar the file in a terminal and add it to your path like so:
 
 
 .. code-block:: bash
 .. code-block:: bash

+ 1 - 1
solang-parser/Cargo.toml

@@ -1,6 +1,6 @@
 [package]
 [package]
 name = "solang-parser"
 name = "solang-parser"
-version = "0.1.18"
+version = "0.2.0"
 authors = ["Sean Young <sean@mess.org>"]
 authors = ["Sean Young <sean@mess.org>"]
 homepage = "https://github.com/hyperledger/solang"
 homepage = "https://github.com/hyperledger/solang"
 documentation = "https://solang.readthedocs.io/"
 documentation = "https://solang.readthedocs.io/"