Skip to content

Commit

Permalink
Merge pull request #36 from da1suk8/separate_wasmplus_dynamiclink
Browse files Browse the repository at this point in the history
feat: separate x/wasm into x/wasmplus module of dynamiclink
  • Loading branch information
da1suk8 authored Apr 27, 2023
2 parents acb5543 + 979cc83 commit d6ea9ec
Show file tree
Hide file tree
Showing 374 changed files with 15,667 additions and 47,447 deletions.
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @da1suk8 @dudong2 @loloicci @kokeshiM0chi
7 changes: 6 additions & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
version: 2
updates:
updates:
- package-ecosystem: github-actions
directory: "/"
schedule:
interval: daily
open-pull-requests-limit: 10
- package-ecosystem: gomod
directory: "/"
schedule:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/codeql-analizer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
paths:
- "**.go"
push:
branches: [ master ]
branches: [ main ]
paths:
- "**.go"

Expand All @@ -19,7 +19,7 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v2.3.5
uses: actions/checkout@v3.1.0

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
Expand Down
46 changes: 43 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,61 @@
# Changelog

## [Unreleased](https://github.com/line/wasmd/tree/HEAD)
## [Unreleased](https://github.com/Finschia/wasmd/compare/v0.1.3...HEAD)

### Features

### Improvements
* [\#36](https://github.com/Finschia/wasmd/pull/36) separate `x/wasm` into `x/wasmplus` module of dynamiclink

### Bug Fixes
* [\#35](https://github.com/Finschia/wasmd/pull/35) stop wrap twice the response of handling non-plus wasm message in plus handler

### Breaking Changes

### Build, CI

### Document Updates


## [v0.1.3](https://github.com/Finschia/wasmd/releases/tag/v0.1.3) - 2023.04.19

### Breaking Changes
* [\#26](https://github.com/Finschia/wasmd/pull/26) implement CallCallablePoint and ValidateDynamicLinkInterface to cosmwasmAPI
* [\#29](https://github.com/Finschia/wasmd/pull/29) remove getContractEnv from cosmwasmAPI

### Build, CI
* [\#30](https://github.com/Finschia/wasmd/pull/30) replace line repositories with finschia repositories


## [v0.1.2](https://github.com/Finschia/wasmd/releases/tag/v0.1.2) - 2023.04.10

### Features
* [\#21](https://github.com/Finschia/wasmd/pull/21) bump up Finschia/ibc-go v3.3.2


## [v0.1.0](https://github.com/Finschia/wasmd/releases/tag/v0.1.0) - 2023.03.28

### Features
* [\#9](https://github.com/Finschia/wasmd/pull/9) apply the changes of finschia-sdk and ostracon proto

### Improvements
* [\#1](https://github.com/line/wasmd/pull/1) apply all changes of `x/wasm` in lbm-sdk until [lbm-sdk@3bdcb6ffe01c81615bedb777ca0e039cc46ef00c](https://github.com/line/lbm-sdk/tree/3bdcb6ffe01c81615bedb777ca0e039cc46ef00c)
* [\#18](https://github.com/line/wasmd/pull/18) apply the wasm module of lbm-sdk(dynamic_link branch)
* [\#1](https://github.com/Finschia/wasmd/pull/1) apply all changes of `x/wasm` in finschia-sdk until [finschia-sdk@3bdcb6ffe01c81615bedb777ca0e039cc46ef00c](https://github.com/Finschia/finschia-sdk/tree/3bdcb6ffe01c81615bedb777ca0e039cc46ef00c)
* [\#5](https://github.com/Finschia/wasmd/pull/5) bump up wasmd v0.29.1
* [\#7](https://github.com/Finschia/wasmd/pull/7) separate custom features in `x/wasm` into `x/wasmplus` module
* [\#8](https://github.com/Finschia/wasmd/pull/8) Bump Finschia/finschia-sdk to a7557b1d10
* [\#10](https://github.com/Finschia/wasmd/pull/10) update wasmvm version
* [\#18](https://github.com/Finschia/wasmd/pull/18) apply the wasm module of finschia-sdk(dynamic_link branch) until [finschia-sdk@911e8b47774f142d70d5c696722b0291e39e0c0c](https://github.com/Finschia/finschia-sdk/tree/911e8b47774f142d70d5c696722b0291e39e0c0c)

### Bug Fixes
* [\#12](https://github.com/Finschia/wasmd/pull/12) fix not to register wrong codec in `x/wasmplus`
* [\#14](https://github.com/Finschia/wasmd/pull/14) fix the cmd error that does not recognize wasmvm library version

### Breaking Changes

### Build, CI

### Document Updates
* [\#2](https://github.com/Finschia/wasmd/pull/2) add wasm events description


## [cosmwasm/wasmd v0.27.0](https://github.com/CosmWasm/wasmd/blob/v0.27.0/CHANGELOG.md) (2022-05-19)
Expand Down
55 changes: 53 additions & 2 deletions COSMWASM_CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,59 @@
# Changelog

## [Unreleased](https://github.com/CosmWasm/wasmd/tree/HEAD)
## [v0.29.0](https://github.com/CosmWasm/wasmd/tree/v0.29.0) (2022-10-10)

[Full Changelog](https://github.com/CosmWasm/wasmd/compare/v0.28.0...v0.29.0)
- Add dependencies for protobuf and remove third_party forlder [/#1030](https://github.com/CosmWasm/wasmd/pull/1030)
- Check wasmvm version on startup [\#1029](https://github.com/CosmWasm/wasmd/pull/1029/)
- Allow AccessConfig to use a list of addresses instead of just a single address [\#945](https://github.com/CosmWasm/wasmd/issues/945)
- Make contract addresses predictable \("deterministic"\) [\#942](https://github.com/CosmWasm/wasmd/issues/942)
- Add query for the total supply of a coin [\#903](https://github.com/CosmWasm/wasmd/pull/903) ([larry0x](https://github.com/larry0x))
- Upgrade go to v1.18 [\#866](https://github.com/CosmWasm/wasmd/pull/866/) ([faddat](https://github.com/faddat))
- Upgrade to ibc-go v3.3.0 REQUIRES [MIGRATION](https://github.com/cosmos/ibc-go/blob/v3.2.3/docs/migrations/support-denoms-with-slashes.md) [\#1016](https://github.com/CosmWasm/wasmd/pull/1016)
- Upgrade to cosmos-sdk v0.45.8 [\#964](https://github.com/CosmWasm/wasmd/pull/964/) ([faddat](https://github.com/faddat))
- Upgrade wasmvm to v1.1.1 [\#1012](https://github.com/CosmWasm/wasmd/pull/1012), see [wasmvm v1.1.1](https://github.com/CosmWasm/wasmvm/releases/tag/v1.1.1)
- Add documentation how to add x/wasm to a new Cosmos SDK chain [\#876](https://github.com/CosmWasm/wasmd/issues/876)
- Upgrade keyring / go-keychain dependencies (removes deprecate warning) [\#957](https://github.com/CosmWasm/wasmd/issues/957)
- Make contract pinning an optional field in StoreCode proposals [\#972](https://github.com/CosmWasm/wasmd/issues/972)
- Add gRPC query for WASM params [\#889](https://github.com/CosmWasm/wasmd/issues/889)
- Expose Keepers in app.go? [\#881](https://github.com/CosmWasm/wasmd/issues/881)
- Remove unused `flagProposalType` flag in gov proposals [\#849](https://github.com/CosmWasm/wasmd/issues/849)
- Restrict code access config modifications [\#901](https://github.com/CosmWasm/wasmd/pull/901)
- Prevent migration to a restricted code [\#900](https://github.com/CosmWasm/wasmd/pull/900)
- Charge gas to unzip wasm code [\#898](https://github.com/CosmWasm/wasmd/pull/898)

### Notable changes:
- BaseAccount and pruned vesting account types can be re-used for contracts addresses
- A new [MsgInstantiateContract2](https://github.com/CosmWasm/wasmd/pull/1014/files#diff-bf58b9da4b674719f07dd5421c532c1ead13a15f8896b59c1f724215d2064b73R75) was introduced which is an additional value for `message` type events
- Store event contains a new attribute with the code checksum now
- New `wasmd tx wasm instantiate2` CLI command for predictable addresses on instantiation
- New `cosmwasm_1_1` CosmWasm capability (former "feature") was introduced in [cosmwasm/#1356](https://github.com/CosmWasm/cosmwasm/pull/1356) to support total supply queries
- Protobuf files are published to [buf.build](https://buf.build/cosmwasm/wasmd/docs/main:cosmwasm.wasm.v1)

### Migration notes:
- See ibc-go [migration notes](https://github.com/cosmos/ibc-go/blob/v3.3.0/docs/migrations/support-denoms-with-slashes.md)


## [v0.28.0](https://github.com/CosmWasm/wasmd/tree/v0.28.0) (2022-07-29)

[Full Changelog](https://github.com/CosmWasm/wasmd/compare/v0.27.0...v0.28.0)

**API Breaking**

No

**Fixed Bugs**

- Fix: Make events in reply completely determinisitic by stripping out anything coming from Cosmos SDK (not CosmWasm codebase) [\#917](https://github.com/CosmWasm/wasmd/pull/917) ([assafmo](https://github.com/assafmo))

Migration notes:

* Contracts can no longer parse events from any calls except if they call another contract (or instantiate it, migrate it, etc).
The main issue here is likely "Custom" queries from a blockchain, which want to send info (eg. how many tokens were swapped).
Since those custom bindings are maintained by the chain, they can use the data field to pass any deterministic information
back to the contract. We recommend using JSON encoding there with some documented format the contracts can parse out easily.
* For possible non-determinism issues, we also sort all attributes in events. Better safe than sorry.

[Full Changelog](https://github.com/CosmWasm/wasmd/compare/v0.27.0...HEAD)

## [v0.27.0](https://github.com/CosmWasm/wasmd/tree/v0.27.0) (2022-05-19)

Expand Down
48 changes: 23 additions & 25 deletions INTEGRATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
# Integration

If you want to use Wasm in your own app, here is how you can get this working
quickly and easily. First, check to make sure you fit the pre-requisites,
quickly and easily.
First start with This [article](https://medium.com/cosmwasm/cosmwasm-for-ctos-iv-native-integrations-713140bf75fc)
in the "CosmWasm for CTOs" series that gives you a high level view.
Then check to make sure you fit the pre-requisites,
then integrate the `x/wasm` module as described below, and finally, you
can add custom messages and queries to your custom Go/SDK modules, exposing
them to any chain-specific contract.
Expand All @@ -14,26 +17,18 @@ The pre-requisites of integrating `x/wasm` into your custom app is to be using
a compatible version of the Cosmos SDK, and to accept some limits to the
hardware it runs on.

| wasmd | Cosmos SDK |
|:------:|:-----------:|
| v0.24 | v0.45.0 |
| v0.23 | v0.45.0 |
| v0.22 | v0.45.0 |
| v0.21 | v0.42.x |
| v0.20 | v0.42.x |
| v0.19 | v0.42.x |
| v0.18 | v0.42.x |
| v0.17 | v0.42.x |
| v0.16 | v0.42.x |
| v0.15 | v0.41.x |
| v0.14 | v0.40.x |
| v0.13 | v0.40.0-rc3 |
| v0.12 | v0.40.0-rc3 |
| v0.11 | v0.39.1 |
| v0.10 | v0.39.1 |
| v0.9 | v0.38.3 |
| v0.8 | v0.38.3 |
| v0.7 | v0.38.3 |
| wasmd | Cosmos SDK |
|:-----:|:----------:|
| v0.29 | v0.45.8 |
| v0.28 | v0.45.5 |
| v0.27 | v0.45.4 |
| v0.26 | v0.45.1 |
| v0.25 | v0.45.1 |
| v0.24 | v0.45.0 |
| v0.23 | v0.45.0 |
| v0.22 | v0.45.0 |
| v0.21 | v0.42.x |


We currently only support Intel/AMD64 CPUs and OSX or Linux. For Linux, the standard build
commands work for `glibc` systems (Ubuntu, Debian, CentOS, etc). If you wish to compile
Expand Down Expand Up @@ -72,9 +67,12 @@ from the Cosmos SDK, and enabled them in `app.go`. If so, you can just look
at [`wasmd/app/app.go`](https://github.com/CosmWasm/wasmd/blob/master/app/app.go#)
for how to do so (just search there for lines with `wasm`).

`wasmd` also comes with a custom `ante handler` that adds the TX position in the block into the context
and passes it to the contracts. In order to support this feature you would need to add our custom
ante handler into the `ante handler chain` as in: [`app/ante.go`](https://github.com/CosmWasm/wasmd/blob/master/app/ante.go)
`wasmd` also comes with 2 custom `ante handlers`:
* `CountTXDecorator` adds the TX position in the block into the context and passes it to the contracts
* `LimitSimulationGasDecorator` prevents an "infinite gas" query

In order to support these features you would need to add our custom
ante handlers into the `ante handler chain` as in: [`app/ante.go`](https://github.com/CosmWasm/wasmd/blob/master/app/ante.go)

### Copied into your app

Expand Down Expand Up @@ -202,5 +200,5 @@ the SDK is implemented properly.

Once you have tested this and are happy with the results, you can wire it up in `app.go`.
Just edit [the default `NewKeeper` constructor](https://github.com/CosmWasm/wasmd/blob/v0.8.0-rc1/app/app.go#L257-L258)
to have the proper `supportedFeatures` and pass in the `CustomEncoder` and `CustomQuerier` as the last two arguments to `NewKeeper`.
to have the proper `availableCapabilities` and pass in the `CustomEncoder` and `CustomQuerier` as the last two arguments to `NewKeeper`.
Now you can compile your chain and upload your custom contracts on it.
9 changes: 5 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ build: go.sum
ifeq ($(OS),Windows_NT)
exit 1
else
go build -mod=readonly $(BUILD_FLAGS) -o build/wasmd ./cmd/wasmd
go build -mod=readonly $(BUILD_FLAGS) -o build/wasmd ./cmd/wasmplusd
endif

build-contract-tests-hooks:
Expand All @@ -93,7 +93,8 @@ else
endif

install: go.sum
go install -mod=readonly $(BUILD_FLAGS) ./cmd/wasmd
go install -mod=readonly $(BUILD_FLAGS) ./cmd/wasmplusd
mv $(BINDIR)/wasmplusd $(BINDIR)/wasmd

########################################
### Tools & dependencies
Expand All @@ -108,7 +109,7 @@ go.sum: go.mod

draw-deps:
@# requires brew install graphviz or apt-get install graphviz
go get github.com/RobotsAndPencils/goviz
go install github.com/RobotsAndPencils/goviz@latest
@goviz -i ./cmd/wasmd -d 2 | dot -Tpng -o dependency-graph.png

clean:
Expand Down Expand Up @@ -166,7 +167,7 @@ format: format-tools
### Protobuf ###
###############################################################################
PROTO_VERSION=v0.2
PROTO_BUILDER_IMAGE=tendermintdev/sdk-proto-gen@sha256:372dce7be2f465123e26459973ca798fc489ff2c75aeecd814c0ca8ced24faca
PROTO_BUILDER_IMAGE=tendermintdev/sdk-proto-gen:$(PROTO_VERSION)
PROTO_FORMATTER_IMAGE=tendermintdev/docker-build-proto@sha256:aabcfe2fc19c31c0f198d4cd26393f5e5ca9502d7ea3feafbfe972448fee7cae
PROTO_GEN_SWAGGER_IMAGE=cosmos-sdk-proto-gen-swagger-$(PROTO_VERSION)

Expand Down
14 changes: 11 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ compatibility list:

| line/wasmd | cosmwasm/wasmd | line/wasmvm | cosmwasm/wasmvm | cosmwasm-vm | cosmwasm-std |
|------------|----------------|:--------------|-----------------|-------------|--------------|
| | 0.29 | | v1.1.0 | | 1.0-1.1 |
| | 0.28 | | v1.0.0 | | 1.0-1.1 |
| 0.1 | 0.27 | v1.0.0-0.10.0 | v1.0.0 | | 1.0 |
| | 0.26 | | 1.0.0-beta10 | | 1.0 |
| | 0.25 | | 1.0.0-beta10 | | 1.0 |
Expand All @@ -52,7 +54,7 @@ It will also run contracts compiled with 1.x assuming they don't opt into any ne
The 1.x cosmwasm_vm will support all contracts with 1.0 <= version <= 1.x.

Note that `cosmwasm-std` version defines which contracts are compatible with this system. The wasm code uploaded must
have been compiled with one of the supported `cosmwasm-std` versions, or will be rejeted upon upload (with some error
have been compiled with one of the supported `cosmwasm-std` versions, or will be rejected upon upload (with some error
message about "contract too old?" or "contract too new?"). `cosmwasm-vm` version defines the runtime used. It is a
breaking change to switch runtimes (you will need to organize a chain upgrade). As of `cosmwasm-vm 0.13` we are
using [wasmer](https://github.com/wasmerio/wasmer/) 1.0, which is significantly more performant than the older versions.
Expand Down Expand Up @@ -95,9 +97,9 @@ The used cosmos-sdk version is in transition migrating from amino encoding to pr

We use standard cosmos-sdk encoding (amino) for all sdk Messages. However, the message body sent to all contracts,
as well as the internal state is encoded using JSON. Cosmwasm allows arbitrary bytes with the contract itself
responsible for decodng. For better UX, we often use `json.RawMessage` to contain these bytes, which enforces that it is
responsible for decoding. For better UX, we often use `json.RawMessage` to contain these bytes, which enforces that it is
valid json, but also give a much more readable interface. If you want to use another encoding in the contracts, that is
a relatively minor change to wasmd but would currently require a fork. Please open in issue if this is important for
a relatively minor change to wasmd but would currently require a fork. Please open an issue if this is important for
your use case.

## Quick Start
Expand All @@ -109,6 +111,12 @@ make test
if you are using a linux without X or headless linux, look at [this article](https://ahelpme.com/linux/dbusexception-could-not-get-owner-of-name-org-freedesktop-secrets-no-such-name) or [#31](https://github.com/CosmWasm/wasmd/issues/31#issuecomment-577058321).

## Protobuf
The protobuf files for this project are published automatically to the [buf repository](https://buf.build/) to make integration easier:

| wasmd version | buf tag |
|---------------|---------------------------------------------------------------------------------------------------------------------------------------------|
| 0.26.x | [51931206dbe09529c1819a8a2863d291035a2549](https://buf.build/cosmwasm/wasmd/tree/51931206dbe09529c1819a8a2863d291035a2549:cosmwasm/wasm/v1) |

Generate protobuf
```shell script
make proto-gen
Expand Down
4 changes: 2 additions & 2 deletions app/ante.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package app

import (
ibcante "github.com/line/ibc-go/v3/modules/core/ante"
"github.com/line/ibc-go/v3/modules/core/keeper"
sdk "github.com/line/lbm-sdk/types"
sdkerrors "github.com/line/lbm-sdk/types/errors"
"github.com/line/lbm-sdk/x/auth/ante"
ibcante "github.com/line/lbm-sdk/x/ibc/core/ante"
"github.com/line/lbm-sdk/x/ibc/core/keeper"

wasmkeeper "github.com/line/wasmd/x/wasm/keeper"
wasmTypes "github.com/line/wasmd/x/wasm/types"
Expand Down
Loading

0 comments on commit d6ea9ec

Please sign in to comment.