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

I26 wasm add async #38

Merged
merged 84 commits into from
May 26, 2021
Merged

I26 wasm add async #38

merged 84 commits into from
May 26, 2021

Conversation

PopcornPaws
Copy link
Member

Attempts to resolve #36, resolve #26.

Description

There are quite some proposed changes in this pull request and they originate from the following issues.

It was required to compile Ethane in such way that it is supported by wasm applications. However, we bumped into weird errors similar to this and this. Thus we decided to get rid of as many dependencies as possible in order to find the culprit which turned out to be the ureq package.

Therefore, the Http client was modified to use reqwest::blocking::Client to handle blocking http requests without futures and multiple threads. However, this opened a new issue, namely wasm doesn't support blocking requests. Thus, a blocking and a non-blocking (async) Http client was added to Ethane.

Currently the crate has a blocking and a non-blocking feature flag that compiles only the more lightweight sync or the more complex async Http client respectively. Then, there is a blocking and a non-blocking Connection through which the RPC requests are sent and processed. Furthermore, the contract Caller was also split into a blocking and non-blocking object to handle eth contract calls.

Ethane types

In this great "purge", the ethereum-type crate was also dismissed from the dependencies and Ethane's own implementation was added. You can find the Address, Bloom, U256, etc types compiled locally, with slightly different API methods.

WASM

ethane-wasm contains a very basic wasm-compatible implementation of an RPC interface. It is an exploratory implementation only in order to test compatibility issues and tweaks to call ethane via wasm.

Mark Melczer and others added 30 commits May 5, 2021 08:40
- faster if I just test this crate alone.
- tried to implement an umbrella trait for them, but for some reason,
  that didn't work.
- it might be worth investigating why tho
- however, when constructing an `EthereumType` from an integer, a
  reference to an integer is required which might be a bit inconvenient.
@PopcornPaws PopcornPaws marked this pull request as ready for review May 25, 2021 12:51
@PumpkinSeed PumpkinSeed linked an issue May 26, 2021 that may be closed by this pull request
@PumpkinSeed PumpkinSeed merged commit 3bedde1 into main May 26, 2021
@PumpkinSeed PumpkinSeed deleted the I26-wasm-add-async branch May 26, 2021 17:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update documentation after the WASM support Decrease dependency count as much as possible Compile to WASM
2 participants