Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release v0.2.0 Berlin #1090

Merged
merged 21 commits into from
Dec 2, 2022
Merged
Show file tree
Hide file tree
Changes from 19 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
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These files are built during release, so usually we update these after release (not ideal)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this work if first tag it and let the release job run? Since this is in the test.yml

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The release job is run in parallel to the test job, so it will work if we re-run it after the release job.

I don't know a way of making the test workflow depend on the release workflow, conditionally if there is a release workflow.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As discussed on todays standup, to achieve this the first step would be to split our CI workflows to separate build from test jobs, so that early stage build artifacts can be used for tests but also as release assets. A further improvement would be to use something like bazel to gain the ability to "run" the CI locally.

But how should we proceed here, should we try it like this (with the re run) or should I undo these changes for a follow up (having it included here would be nicer IMO)?

- name: Extract LLVM
run: unzip c:\llvm.zip -d c:/
- name: Add LLVM to Path
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
49 changes: 47 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
xermicus marked this conversation as resolved.
Show resolved Hide resolved

xermicus marked this conversation as resolved.
Show resolved Hide resolved
### 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
xermicus marked this conversation as resolved.
Show resolved Hide resolved
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)

xermicus marked this conversation as resolved.
Show resolved Hide resolved
## v0.1.13 Genoa

Expand Down
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "solang"
version = "0.1.13"
version = "0.2.0"
authors = ["Sean Young <[email protected]>"]
homepage = "https://github.com/hyperledger/solang"
documentation = "https://solang.readthedocs.io/"
Expand Down Expand Up @@ -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"
Expand Down
19 changes: 5 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
22 changes: 11 additions & 11 deletions docs/installing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ Option 2: Download binaries

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
path you use is not already in ``$PATH``, then you need to add it yourself.
Expand All @@ -56,7 +56,7 @@ Option 3: Use ghcr.io/hyperledger/solang containers

New images are automatically made available on
`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

Expand Down Expand Up @@ -113,15 +113,15 @@ 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 <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
LLVM directory to your path, so that the build system of Solang can find the correct version of LLVM to use.

Linux
~~~~~

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.

.. code-block:: bash
Expand All @@ -133,7 +133,7 @@ Windows
~~~~~~~

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.

Expand All @@ -145,8 +145,8 @@ Mac
~~~

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:

.. code-block:: bash
Expand Down
2 changes: 1 addition & 1 deletion solang-parser/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "solang-parser"
version = "0.1.18"
version = "0.2.0"
authors = ["Sean Young <[email protected]>"]
homepage = "https://github.com/hyperledger/solang"
documentation = "https://solang.readthedocs.io/"
Expand Down