Giter Site home page Giter Site logo

finschia / wasmvm Goto Github PK

View Code? Open in Web Editor NEW
21.0 16.0 14.0 535.63 MB

Go bindings to the CosmWasm smart contract framework. In particular, it allows you to easily compile, initialize, and execute these contracts from Go.

License: Apache License 2.0

Makefile 2.21% Go 55.46% C 11.21% Rust 29.20% Shell 1.93%
rust go blockchain wasm webassembly

wasmvm's Introduction

wasmvm

Builds And Tests

This repository is forked from CosmWasm/wasmvm

This is a wrapper around the CosmWasm VM.

It allows you to compile, initialize and execute CosmWasm smart contracts from Go applications, in particular from x/wasm.

For more detail, see the original document

wasmvm's People

Contributors

0tech avatar 170210 avatar alpe avatar assafmo avatar brew0722 avatar circle-bot avatar da1suk8 avatar ethanfrey avatar faddat avatar finschia-auto-pr[bot] avatar larry0x avatar loloicci avatar reuvenpo avatar shanev avatar shiki-tak avatar taztingo avatar tnasu avatar uint avatar webmaster128 avatar westaking avatar whylee259 avatar yihuang avatar zemyblue avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

wasmvm's Issues

Add a new label for auto pr

Since developer may push commits to auto PR, so it is better to add a label to make a warning.
So we need add a new label for the auto PR.

upload static shared library

Currently, libwasmvm_static.so is excluded from the remote repository by gitignore. Therefore, ci that uses static lib must be built locally each time. Let's upload the static lib to remote as well.

libwasmvm's test "init_cache_writes_error" fails with rustc v1.68 or later

---- cache::tests::init_cache_writes_error stdout ----
thread 'cache::tests::init_cache_writes_error' panicked at 'assertion failed: `(left == right)`
  left: `"Error calling the VM: Cache error: Error creating directory broken\0dir/state: file name contained an unexpected NUL byte"`,
 right: `"Error calling the VM: Cache error: Error creating directory broken\0dir/state: data provided contains a nul byte"`', src/cache.rs:375:9

One GetContractEnv's returning value *Cache does not need pointer

Cache is a struct contains the C pointer of the cache.

type Cache struct {
	ptr *C.cache_t
}

So, this is not much big struct. And, when there is cache Cache and go pass it to C in GetContractEnv as a form of &cache, it issues an error as bellow. (for example https://github.com/line/wasmvm/actions/runs/4203381739/jobs/7292793005#step:7:105)

fatal error: Go pointer stored into non-Go memory

Now, we do not meet it in x/wasm, but it happens when we make some tests like https://github.com/loloicci/wasmvm/blob/59041273a09d3a4c7dbddd3fafc3c1f14260ef7e/api/lib_test.go#L1228-L1237.

So I suggest changing the arg type of GetContractEnv's 2nd arg from *Cache to Cache.

Prepare image for build including aarch64-linux-musl-cross

If we decide to prepare our Docker image, we will respond. If not, please close.

I need aarch64-linux-musl-cross for the wasmer build, but the github actions refuse to get it from musl.cc using wget.

Therefore, I use the image that already contains this as a builder and copy and use it.
https://github.com/line/wasmvm/pull/71/files#diff-a3e40ace4c88526a8320154b12cfc19c7b048c6fd2ea67ddddb3e4849711f249R10

If we should prepare our own Docker image beforehand without using this, then I think this is a matter for another issue.

Originally posted by @shiki-tak in #71 (comment)

How about adding a ci which automatic build shared library?

Summary

Add a CI which automatic build the shared libraries.

Motivation

The shared libraries are referenced by other project like finschia for building.
we need to compile shared library every commit is added if we want to apply the changes of wasmvm, but it doesn't seems to do that often. So I propose adding CI to automatically build the shared libraries.

The cosmwasm/wasmvm already do auto commit it.
https://github.com/CosmWasm/wasmvm/blob/1638725b25d799f078d053391945399cb35664b1/.circleci/config.yml#L282-L322

  deploy_to_git:
    machine:
      image: ubuntu-2004:2022.10.1
    resource_class: xlarge
    steps:
      - add_ssh_keys:
          fingerprints:
            # Custom read/write deployment key with private key stored on CircleCI
            # (see https://app.circleci.com/settings/project/github/CosmWasm/wasmvm/ssh and https://github.com/CosmWasm/wasmvm/settings/keys)
            - "31:de:e5:84:1b:12:81:94:aa:06:50:c0:cb:bd:79:f0"
      - checkout
      - run:
          name: Build shared library for Linux
          command: make release-build-linux
      - run:
          name: Build shared library for macOS
          command: make release-build-macos
      # Shared libraries for Windows (.dll) currently do not work (https://github.com/CosmWasm/wasmvm/issues/389)
      # and .dll builds are not deterministic.
      # Deactivating this step to avoid polluting the git hostory.
      #
      # - run:
      #     name: Build shared library for Windows
      #     command: make release-build-windows
      - run:
          name: Debug build results
          command: ls -l ./internal/api
      - run:
          name: Configure git user
          # This is not a GitHub user and no permissions can be configured other than "push access", which
          # we can configure for Deploy keys at https://github.com/CosmWasm/wasmvm/settings/keys
          command: |
            git config user.email "[email protected]"
            git config user.name "Deployer"
      - run:
          name: Check-in and push new libraries
          command: |
            git status
            git add ./internal/api
            git commit --allow-empty -m '[skip ci] Built release libraries'
            git push origin $CIRCLE_BRANCH

Proposal

  • If new commit is added in main branch, a CI automatically detect and add new PR which compile the shared libraries and change it. -> if there is no changed in the shared libraries to build, do not this.
  • if the all test of the PR are passed, do auto-merge.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.