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

Elrond changes to wasmer2.2 #21

Open
wants to merge 154 commits into
base: feat/wasmer2.2
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
154 commits
Select commit Hold shift + click to select a range
9c14c2e
Add metering feature
ethanfrey Aug 29, 2019
90a7fb4
Add wasmer_compile_with_limit api
ethanfrey Aug 29, 2019
1e4c01e
Try adding metering functions - need help to compile
ethanfrey Aug 29, 2019
a9d7988
Metering api compiles with feature flag on and off
ethanfrey Aug 30, 2019
ab8f3c5
Fixed linter errors in metering.rs
ethanfrey Aug 30, 2019
abf6445
Added some TODOs to check serialization failure
ethanfrey Aug 30, 2019
f68c77b
Fix u32 -> u64 in gas limit
ethanfrey Aug 30, 2019
1406bac
Try to make C test case for using wasmer_compile_with_limit
ethanfrey Aug 30, 2019
d9e884c
Run cargo +stable fmt --all
ethanfrey Aug 30, 2019
c9c7efc
Clean up feature setup with --no-default-features, singlepass-backend…
ethanfrey Sep 18, 2019
3d92bf3
get_metered_compiler uses whatever default backend
ethanfrey Sep 19, 2019
4dcafd5
Handle null input in metering api
ethanfrey Sep 19, 2019
44d1174
wasmer_compile_with_limit -> wasmer_compile_with_gas_metering
ethanfrey Sep 19, 2019
9f0e718
Update deps to 0.7.0 after rebase
ethanfrey Sep 19, 2019
e51f332
Use llvm backend by default for metering - all tests pass
ethanfrey Sep 19, 2019
9b493bb
Add basic test-module-metering-serialize test
ethanfrey Sep 19, 2019
f72b4cf
Expose CraneliftModuleCodeGenerator to test with --metering, document…
ethanfrey Sep 20, 2019
304a16e
Fix linter issue
ethanfrey Sep 20, 2019
c2bdad7
Merge remote-tracking branch 'confio/metering'
camilbancioiu Oct 18, 2019
f08823b
Update versions in Cargo.lock and lib/runtime-c-api/Cargo.toml
camilbancioiu Oct 21, 2019
0a15b72
Update repository name in configuration files (wasmerio → ElrondNetwork)
camilbancioiu Oct 21, 2019
8d483f1
Change two Cargo.toml files so that backend-singlepass and metering a…
camilbancioiu Oct 23, 2019
e6d4e9d
Create function wasmer_instantiate_with_metering() as external API fu…
camilbancioiu Oct 23, 2019
d12a006
Add selectable metering costs table
camilbancioiu Oct 24, 2019
95a2cdb
Make the cranelift backend optional. And organize some imports
camilbancioiu Oct 25, 2019
f7fc629
Add forgotten file metering_costs.rs
camilbancioiu Oct 25, 2019
f9776ff
Add file instructions.txt, documenting the possible WASM instructions…
camilbancioiu Oct 25, 2019
d893a6d
Remove fixed tables and try to create an array-based costs table
camilbancioiu Nov 4, 2019
9f04468
Merge pull request #1 from ElrondNetwork/configurable-gas-metering
camilbancioiu Nov 6, 2019
c421a54
Isolate building imports
camilbancioiu Nov 12, 2019
599cb2a
Create ImportObject constructors; create instance constructors that r…
camilbancioiu Nov 13, 2019
6d50996
Implement external setters for ImportObject and OPCODE_COSTS and clea…
camilbancioiu Nov 15, 2019
f7cf35d
Add .ctags
camilbancioiu Nov 22, 2019
6f14c31
Merge branch 'master' of https://github.com/wasmerio/wasmer into wasm…
camilbancioiu Dec 2, 2019
6fa89e4
Update versions in lib/runtime-c-api/Cargo.toml
camilbancioiu Dec 2, 2019
4cc0c22
Fix imports and other minor changes to make the merge function properly
camilbancioiu Dec 2, 2019
52dc4d8
Merge branch 'deterministic' of https://github.com/spacemeshos/wasmer
camilbancioiu Dec 3, 2019
a2dca09
Fix feature configuration
camilbancioiu Dec 3, 2019
d450170
Disable the Cranelift backend from Cargo.toml files
camilbancioiu Dec 4, 2019
3a84b9a
Enable Wasmparser deterministic execution, fix it in Wasmer and use a…
camilbancioiu Dec 4, 2019
cf447d3
Update .ctags
camilbancioiu Dec 4, 2019
53bdbd3
Implement runtime breakpoints and C API for setting them
camilbancioiu Dec 5, 2019
c856f40
Enable runtime-breakpoints
camilbancioiu Dec 5, 2019
e710fdc
Fix breakpoint injection
camilbancioiu Dec 6, 2019
37225b8
Merge pull request #3 from ElrondNetwork/runtime-breakpoints
camilbancioiu Dec 6, 2019
cdd1662
Add 'dev' profile for runtime-c-api and a build target in the Makefile
camilbancioiu Dec 17, 2019
d4267fc
Merge branch 'runtime-breakpoints'
camilbancioiu Dec 17, 2019
01d8beb
Add locks against reinitialization of opcode costs and the import object
camilbancioiu Dec 18, 2019
7184617
Use RuntimeError::Trap in metering.rs and runtime_breakpoints.rs
camilbancioiu Jan 13, 2020
d4107c4
Remove unneeded println!()
camilbancioiu Jan 13, 2020
abcb269
Merge branch 'master' of https://github.com/wasmerio/wasmer into merg…
camilbancioiu Mar 5, 2020
c9c6b1a
Minor fixes after merge
camilbancioiu Mar 5, 2020
646b475
Update autogenerated files
camilbancioiu Mar 5, 2020
5c54e3b
Update Operator identifiers in metering_costs.rs
camilbancioiu Mar 5, 2020
1f419cb
More fixes after merge
camilbancioiu Mar 5, 2020
fbeb616
Adjustments and Cargo.lock
camilbancioiu Mar 5, 2020
c207b31
More updates and fixes after merge from upstream
camilbancioiu Mar 5, 2020
9375fe4
Implement opcode tracing and middleware options
camilbancioiu May 28, 2020
23102fa
Print runtime postlude if opcode tracing is enabled
camilbancioiu May 28, 2020
2e191ea
Change singlepass codegen_x64.rs to make exception_table optional
camilbancioiu May 29, 2020
4baa24b
Minor comments
camilbancioiu May 29, 2020
4fac4cb
Rename .travis.yml to .travis.upstream.yml
andreibancioiu Jun 1, 2020
1dae68a
Create .travis.yml
andreibancioiu Jun 1, 2020
f428bc5
Update .travis.yml
andreibancioiu Jun 1, 2020
37a08d4
Update .travis.yml
andreibancioiu Jun 1, 2020
96bf3f2
Merge branch 'master' into options-and-opcodetrace
camilbancioiu Jun 1, 2020
456cc54
Add options for metering and runtime_breakpoints
camilbancioiu Jun 1, 2020
26e713a
Add more debugging information when opcode tracing is enabled
camilbancioiu Jun 1, 2020
d3a2e85
Improve debugging prints when tracing is enabled
camilbancioiu Jun 1, 2020
b5a51c8
Fix omitted self.exception_table.unwrap()
camilbancioiu Jun 2, 2020
88e0406
Allow build of branch development.
andreibancioiu Jun 30, 2020
b2a6fa6
Add out-of-gas runtime breakpoint
camilbancioiu Jul 22, 2020
481c5e1
Merge branch 'master' of https://github.com/ElrondNetwork/wasmer
camilbancioiu Jul 22, 2020
85190e4
Change wasmparser dependency to local folder
camilbancioiu Sep 1, 2020
52aabb1
Add feed_local() to the FunctionMiddleware trait and the Metering mid…
camilbancioiu Sep 4, 2020
3516b20
Restore Cargo.toml files
camilbancioiu Sep 4, 2020
2120df8
Minor fix
camilbancioiu Sep 4, 2020
ac18301
Add unmetered locals
camilbancioiu Sep 7, 2020
c37845a
Fix cost computation
camilbancioiu Sep 8, 2020
171d855
Update Cargo.lock
camilbancioiu Sep 8, 2020
666d2be
Allow exactly self.unmetered_locals
camilbancioiu Sep 8, 2020
facd29b
Merge pull request #4 from ElrondNetwork/metering-func-locals
camilbancioiu Sep 8, 2020
0285feb
Fix metered locals
camilbancioiu Sep 8, 2020
4707e0a
Merge pull request #5 from ElrondNetwork/fix-metered-locals
sasurobert Sep 8, 2020
3b78f9a
Add instance caching functionality and C API (WIP)
camilbancioiu Oct 29, 2020
69c5b0d
improvements here and there. not compiling yet.
sasurobert Oct 30, 2020
f82834a
some impro
sasurobert Oct 30, 2020
26d7f31
instance cache error handling
andrei-marinica Oct 30, 2020
239e90d
finished cache implementation
sasurobert Oct 30, 2020
5b565a4
finished implementation of aot
sasurobert Oct 31, 2020
100fc1b
Merge pull request #6 from ElrondNetwork/instance-caching
sasurobert Nov 2, 2020
f1e1327
Implement wasmer_instance_is_function_imported() for the C API
camilbancioiu Feb 8, 2021
c8a49a1
Merge pull request #8 from ElrondNetwork/instance-is-func-imported
camilbancioiu Feb 9, 2021
48a61ed
Update .travis.yml
andreibancioiu Feb 9, 2021
dc7b2f8
Merge pull request #9 from ElrondNetwork/travis-patch-1
camilbancioiu Feb 9, 2021
c71832e
Add reset API function for the global import object cache
camilbancioiu Jun 4, 2021
d1af7bc
Remove global booleans that prevent setting opcode costs and import o…
camilbancioiu Jun 4, 2021
896905e
deallocate previous GLOBAL_IMPORT_OBJECT
andrei-marinica Jun 4, 2021
5a49078
Guard against deallocating a null pointer
camilbancioiu Jun 4, 2021
be694d1
Merge pull request #10 from ElrondNetwork/wasmer-import-cache-reset
sasurobert Jun 7, 2021
f891488
fix build
catalinnnn Oct 7, 2021
0a0d993
Merge pull request #11 from ElrondNetwork/bump-dynasm
catalinnnn Oct 8, 2021
fe45b85
Add tentative workflow for linux-amd64
camilbancioiu Nov 2, 2021
06d3441
Trigger workflow on pull-requests to master
camilbancioiu Nov 2, 2021
9bc9834
Minor fix
camilbancioiu Nov 2, 2021
962c43d
Merge pull request #12 from ElrondNetwork/github-actions
camilbancioiu Nov 2, 2021
471f8af
Fix trigger name
camilbancioiu Nov 2, 2021
044830e
Fix workflow
camilbancioiu Nov 2, 2021
d8322f3
Fix
camilbancioiu Nov 2, 2021
48d9b6c
Enable immediate releases (temporary)
camilbancioiu Nov 2, 2021
7648477
Only enable releases with tags
camilbancioiu Nov 2, 2021
7b06231
Add MacOS build
camilbancioiu Nov 2, 2021
2de2adf
Enable building for all releases
camilbancioiu Nov 2, 2021
df2946e
Only build for releases (for now)
camilbancioiu Nov 2, 2021
878c48f
Isolate release types
camilbancioiu Nov 2, 2021
1f2cf04
Fixes
camilbancioiu Nov 2, 2021
cddc734
Fix workflow again
camilbancioiu Nov 2, 2021
3ec316a
Add libwasmer-build.yml
camilbancioiu Nov 3, 2021
5f160f7
Merge pull request #13 from ElrondNetwork/github-actions
camilbancioiu Nov 3, 2021
26375c8
Implement the OpcodeControl middleware with memory.grow protection
camilbancioiu Nov 3, 2021
aaae4eb
Fix opcode type
camilbancioiu Nov 3, 2021
233c950
Merge pull request #14 from ElrondNetwork/memgrow-protection
camilbancioiu Nov 3, 2021
09c6265
Add memory.grow runtime limit and refactor OpcodeControl
camilbancioiu Nov 9, 2021
2549b5a
Merge pull request #15 from ElrondNetwork/memorygrow-limit
camilbancioiu Nov 9, 2021
397c574
Begin adding derivations of Archive for Artifact (WIP)
camilbancioiu Dec 9, 2021
c44860c
More references to WrappedIndexMap
camilbancioiu Dec 12, 2021
3b70e7d
Enable the indexmap feature of rkyv
camilbancioiu Dec 14, 2021
9a0986f
Begin implementation of WrappedCow
camilbancioiu Dec 15, 2021
d1ee9e7
More type matching for WrappedCow
camilbancioiu Dec 15, 2021
ddb4361
More type alignment
camilbancioiu Dec 16, 2021
27de7f3
More attempts
camilbancioiu Dec 17, 2021
c430a2e
Remove WrappedCow and WrappedIndexMap
camilbancioiu Dec 20, 2021
c6e0e84
Implement wrapper for serializing Memory
camilbancioiu Jan 11, 2022
932622d
Attempt rkyv test for Artifact
camilbancioiu Jan 14, 2022
8d46a26
Update Cargo.lock
camilbancioiu Jan 19, 2022
f3a57c6
Extra test
camilbancioiu Jan 25, 2022
2beeb33
Fix ArchivableMemory deserialization
camilbancioiu Jan 25, 2022
5994d9c
Minor type rewrite for DeserializeWith; clean tests
camilbancioiu Jan 26, 2022
c1a2aac
Implement C API wasmer_instance_cache_rkyv() and wasmer_instance_from…
camilbancioiu Jan 26, 2022
a9dfb5b
Add type MachineSubvalue to break recursivity of MachineValue
camilbancioiu Jan 28, 2022
4227564
Fixes for compilation
camilbancioiu Jan 31, 2022
29addef
Ensure correct size of the serialized data
camilbancioiu Feb 9, 2022
f8fb1df
Update comment
camilbancioiu Feb 9, 2022
037321d
Remove unneeded config file
camilbancioiu Feb 9, 2022
e17fd73
Delete irrelevant test
camilbancioiu Feb 9, 2022
68f1358
Minor fixes
camilbancioiu Feb 9, 2022
8e99e50
Create separate sighandler install function for dylib
camilbancioiu Feb 21, 2022
004a42c
Merge pull request #17 from ElrondNetwork/signal-handling-as-dylib
camilbancioiu Feb 21, 2022
c3bc0d1
Merge pull request #16 from ElrondNetwork/artifact-rkyv
camilbancioiu Feb 22, 2022
46daf7d
Change OpcodeControl to set BREAKPOINT_VALUE_MEMORY_LIMIT for memory.…
camilbancioiu Feb 22, 2022
090754a
Merge pull request #18 from ElrondNetwork/memory-limit-breakpoint
camilbancioiu Mar 1, 2022
82d260d
Create AtomicBool which controls SIGSEGV handler registration
camilbancioiu Mar 9, 2022
1347511
Merge pull request #19 from ElrondNetwork/sigsegv-passthrough
camilbancioiu Mar 9, 2022
e4a2395
Merge branch 'master' into elrond-changes-to-wasmer2.2
sasurobert Mar 22, 2022
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
13 changes: 13 additions & 0 deletions .ctags
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
--exclude=target/*
--exclude=*/target/*
--exclude=docs/*
--exclude=examples/*
--exclude=integration_tests/*
--exclude=fuzz/*
--exclude=*.md
--exclude=*.yml
--exclude=*.txt
--exclude=tags
--exclude=*.sh
--exclude=scripts/*
--exclude=Makefile
26 changes: 26 additions & 0 deletions .github/workflows/libwasmer-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: libwasmer-build

on:
push:
branches:
- master
pull_request:

env:
CARGO_TERM_COLOR: always

jobs:
build:
name: Build dynamic library for ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-18.04
artifact_name: libwasmer_linux_amd64.so
make_target: capi-linux-amd64
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Make
run: make ${{ matrix.make_target }}
40 changes: 40 additions & 0 deletions .github/workflows/libwasmer-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: libwasmer-release

on:
release:
types:
- created


env:
CARGO_TERM_COLOR: always

jobs:
build:
name: Build dynamic library for ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-18.04
artifact_name: libwasmer_linux_amd64.so
make_target: capi-linux-amd64
- os: macos-11
artifact_name: libwasmer_darwin_amd64.dylib
make_target: capi-osx-amd64
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Make
run: make ${{ matrix.make_target }}
- name: Get the version
id: get_version
if: startsWith(github.ref, 'refs/tags/')
run: echo ::set-output name=VERSION::${GITHUB_REF#refs/tags/}
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
name: ${{ steps.get_version.outputs.VERSION }}-linux-amd64
files: |
target/release/${{ matrix.artifact_name }}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
.gdb_history
**/.vscode
api-docs-repo/
tags
.ycm*
/.cargo_home/
/package/
/dist/
Expand Down
75 changes: 75 additions & 0 deletions .travis.upstream.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
arch:
- arm64

language: rust
install: travis_retry
rust:
- nightly-2019-12-19

cache:
directories:
- /home/travis/.sccache/
- /home/travis/.cargo/bin/

script:
# Sccache
# - curl -L https://github.com/mozilla/sccache/releases/download/0.2.10/sccache-0.2.10-x86_64-unknown-linux-musl.tar.gz | tar xzf -
# - export RUSTC_WRAPPER=`pwd`/sccache-0.2.10-x86_64-unknown-linux-musl/sccache
- test -f /home/travis/.cargo/bin/sccache || travis_retry cargo install sccache
- export RUSTC_WRAPPER=/home/travis/.cargo/bin/sccache
- mkdir -p /home/travis/.sccache/
- export SCCACHE_DIR="/home/travis/.sccache/"
- SCCACHE_ERROR_LOG=`pwd`/sccache.log RUST_LOG=debug $RUSTC_WRAPPER --start-server
- $RUSTC_WRAPPER -s

# Tests
- make spectests-singlepass

before_deploy:
# Release
- make release-singlepass
- mkdir -p artifacts
# Make capi
## Disable capi tests for now:
## They are failing because trampolines are not yet implemented for ARM
# - make test-capi-singlepass
- make capi-singlepass
- make build-capi-package
- cp ./wasmer-c-api.tar.gz ./artifacts/$(./scripts/capi-name.sh)
# Build WAPM
- make build-wapm
# Make package
- make build-install-package
- cp ./wasmer.tar.gz ./artifacts/$(./scripts/binary-name.sh)

# before_deploy:
# # Set up git user name and tag this commit
# - git config --local user.name "Syrus Akbary"
# - git config --local user.email "[email protected]"
# - export TRAVIS_TAG="0.10.2"
# # - git tag $TRAVIS_TAG

deploy:
provider: releases
file_glob: true
file: artifacts/*
api_key: $GITHUB_OAUTH_TOKEN
# This is set to the previous artifacts are not deleted by travis
skip_cleanup: true
on:
tags: true
# branch: feature/singlepass-aarch64

addons:
apt:
packages:
- cmake

branches:
only:
- master
- staging
- trying
# Making sure Travis runs on new Tags
- /^\d+\.\d+(\.\d+)?(-\S*)?$/
- /^v\d+\.\d+(\.\d+)?(-\S*)?$/
65 changes: 65 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
os:
- linux
- osx
arch:
- amd64
- arm64
osx_image: xcode11.3

language: rust
before_install:
- if [[ $TRAVIS_OS_NAME == linux ]]; then sudo apt-get install -y patchelf; fi
install: travis_retry
rust:
- nightly-2021-01-25

cache:
directories:
- $HOME/.sccache/
- $HOME/.cargo/bin/

script:
- test -f $HOME/.cargo/bin/sccache || travis_retry cargo install sccache
- export RUSTC_WRAPPER=$HOME/.cargo/bin/sccache
- mkdir -p $HOME/.sccache/
- export SCCACHE_DIR="$HOME/.sccache/"
- SCCACHE_ERROR_LOG=`pwd`/sccache.log RUST_LOG=debug $RUSTC_WRAPPER --start-server
- $RUSTC_WRAPPER -s

- make capi
- ls ./target/release
- mkdir artifacts

- if [[ "$TRAVIS_OS_NAME" == osx ]];
then
mv ./target/release/libwasmer_runtime_c_api.dylib ./artifacts/libwasmer_darwin_amd64.dylib;
install_name_tool -id @executable_path/libwasmer_darwin_amd64.dylib ./artifacts/libwasmer_darwin_amd64.dylib;
fi
- if [[ "$TRAVIS_OS_NAME" == linux && "$TRAVIS_CPU_ARCH" == amd64 ]];
then
mv ./target/release/libwasmer_runtime_c_api.so ./artifacts/libwasmer_linux_amd64.so;
patchelf --set-soname libwasmer_linux_amd64.so ./artifacts/libwasmer_linux_amd64.so;
fi
- if [[ "$TRAVIS_OS_NAME" == linux && "$TRAVIS_CPU_ARCH" == arm64 ]];
then
mv ./target/release/libwasmer_runtime_c_api.so ./artifacts/libwasmer_linux_arm64.so;
patchelf --set-soname libwasmer_linux_arm64.so ./artifacts/libwasmer_linux_arm64.so;
fi

deploy:
provider: releases
file_glob: true
file: artifacts/*
api_key: $GITHUB_OAUTH_TOKEN
skip_cleanup: true
draft: true

addons:
apt:
packages:
- cmake

branches:
only:
- master
- development
93 changes: 91 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading