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

feat: separate x/wasm into x/wasmplus module of dynamiclink #36

Merged
merged 176 commits into from
Apr 27, 2023

Conversation

da1suk8
Copy link
Member

@da1suk8 da1suk8 commented Apr 21, 2023

Description

closes: #23, #25

The dynamiclink branch was separated into wasmplus.
By implementing the interface, the import cycle problem was avoided and the dynamiclink functionality was properly moved to x/wasmplus.

Functions and variables to be exposed to the outside world are exposed in a file named exported_*.go.
This is because there was a possibility of large differences if they were exposed externally in uppercase letters.
The file x/wasmplus/common_test.go was used for the test, so I copied the original as it is.

Separation Process

  1. Merge to 4c49132
  2. Define functions and variables to be exposed externally 78f312f
  3. Add Pluskeeper interface to keeper 6b4897f
    pluskeeper is defined as x/wasm/keeper/exported_keeper.go
  4. separate!

Motivation and context

In order to merge the dynamic_link branch into the main branch, it was necessary to separate the dynamic_link branch.

How has this been tested?

make build
make test

Checklist:

  • I followed the contributing guidelines and code of conduct.
  • I have added a relevant changelog to CHANGELOG.md
  • I have added tests to cover my changes.
  • I have updated the documentation accordingly.
  • I have updated API documentation client/docs/swagger-ui/swagger.yaml

dependabot bot and others added 30 commits May 12, 2022 08:12
Bumps [github.com/spf13/cast](https://github.com/spf13/cast) from 1.4.1 to 1.5.0.
- [Release notes](https://github.com/spf13/cast/releases)
- [Commits](spf13/cast@v1.4.1...v1.5.0)

---
updated-dependencies:
- dependency-name: github.com/spf13/cast
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) from 1.12.1 to 1.12.2.
- [Release notes](https://github.com/prometheus/client_golang/releases)
- [Changelog](https://github.com/prometheus/client_golang/blob/main/CHANGELOG.md)
- [Commits](prometheus/client_golang@v1.12.1...v1.12.2)

---
updated-dependencies:
- dependency-name: github.com/prometheus/client_golang
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
* Publish protobufs on release tags

* Fix regex to match also rc versions
…ithub.com/prometheus/client_golang-1.12.2

Bump github.com/prometheus/client_golang from 1.12.1 to 1.12.2
* Fix wasm simulations + make functions compatible with tgrade

* Fix lint issues

* Fix simulation setup

* Make simulations store msg pass

* Use default values params to make operations succeed

* Normalize wasm store

* Add simulations to circleci config

* Run simulation in temp dir

* Store sim logs

* Increase circleci machine type

* Extract reflect contract api into helper

* Add execute msg to simulations

* Embed refect wasm contract

Co-authored-by: Pino' Surace <pino.surace@live.it>
feat: setup and run script in dockerfile
…ithub.com/spf13/cast-1.5.0

Bump github.com/spf13/cast from 1.4.1 to 1.5.0
Remove unused NegotiateAppVersion ibc callback
Bumps [github.com/stretchr/testify](https://github.com/stretchr/testify) from 1.7.1 to 1.7.2.
- [Release notes](https://github.com/stretchr/testify/releases)
- [Commits](stretchr/testify@v1.7.1...v1.7.2)

---
updated-dependencies:
- dependency-name: github.com/stretchr/testify
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
…ithub.com/stretchr/testify-1.7.2

Bump github.com/stretchr/testify from 1.7.1 to 1.7.2
Bumps [github.com/stretchr/testify](https://github.com/stretchr/testify) from 1.7.2 to 1.8.0.
- [Release notes](https://github.com/stretchr/testify/releases)
- [Commits](stretchr/testify@v1.7.2...v1.8.0)

---
updated-dependencies:
- dependency-name: github.com/stretchr/testify
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
…ithub.com/stretchr/testify-1.8.0

Bump github.com/stretchr/testify from 1.7.2 to 1.8.0
Output events are not part of consensus and can be non-deterministic
da1suk8 added 4 commits April 21, 2023 19:06
As for cosmwasmAPI, it is intentionally left
by adding nolint:varcheck,deadcode to make it similar to original
x/wasmplus/keeper/api.go Outdated Show resolved Hide resolved
Co-authored-by: Sujong Lee <leesj9476lsj@gmail.com>
@da1suk8 da1suk8 requested a review from dudong2 April 24, 2023 08:13

// prepare querier
querier := k.newQueryHandler(ctx, contractAddress)

// instantiate wasm contract
gas := k.runtimeGasForContract(ctx)
res, gasUsed, err := k.wasmVM.Instantiate(codeInfo.CodeHash, env, info, initMsg, wasmStore, k.cosmwasmAPI(ctx), querier, k.gasMeter(ctx), gas, costJSONDeserialization)
res, gasUsed, err := k.wasmVM.Instantiate(codeInfo.CodeHash, env, info, initMsg, prefixStore, k.pluskeeper.CosmwasmAPI(ctx), querier, k.gasMeter(ctx), gas, costJSONDeserialization)
Copy link
Member

Choose a reason for hiding this comment

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

How about extending the cosmwasmAPI to be able to add new function in other modules. Instead of using pluskeeper which replaces the original keeper function.

gasRegister: NewDefaultWasmGasRegister(),
maxQueryStackSize: types.DefaultMaxQueryStackSize,
acceptedAccountTypes: defaultAcceptedAccountTypes,
pluskeeper: pluskeeper,
Copy link
Member

@zemyblue zemyblue Apr 26, 2023

Choose a reason for hiding this comment

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

If there is not the plusKeeper, can this x/wasm module work?
The default wasm's keeper does not need other plus keepers. But this changes breaks this structure of x/wasm module. Because in this case, this x/wasm module should add plusKeeper.

So I think we need to change it to not using another plusKeeper.

@da1suk8
Copy link
Member Author

da1suk8 commented Apr 26, 2023

@zemyblue
What you mentioned will be addressed in another issue, #38.

Copy link
Member

@zemyblue zemyblue left a comment

Choose a reason for hiding this comment

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

Thank you.
Please modify to not reference x/wasmplus's keeper in x/wasm module.

@da1suk8
Copy link
Member Author

da1suk8 commented Apr 26, 2023

Please modify to not reference x/wasmplus's keeper in x/wasm module.

Yes, I will modify this in #38

@da1suk8 da1suk8 merged commit d6ea9ec into Finschia:dynamic_link Apr 27, 2023
@da1suk8 da1suk8 deleted the separate_wasmplus_dynamiclink branch April 27, 2023 01:59
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.