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

Add check version wasm #1029

Merged
merged 4 commits into from
Oct 7, 2022
Merged

Conversation

GNaD13
Copy link
Contributor

@GNaD13 GNaD13 commented Oct 3, 2022

Resolves #994

Add check version wasmvm
(ref with stargaze)

@GNaD13 GNaD13 changed the title Dang/add check version wasm add check version wasm Oct 3, 2022
@codecov
Copy link

codecov bot commented Oct 3, 2022

Codecov Report

Merging #1029 (0f727c0) into main (1a87b28) will decrease coverage by 0.26%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1029      +/-   ##
==========================================
- Coverage   59.71%   59.45%   -0.27%     
==========================================
  Files          52       52              
  Lines        6586     6615      +29     
==========================================
  Hits         3933     3933              
- Misses       2366     2395      +29     
  Partials      287      287              
Impacted Files Coverage Δ
x/wasm/module.go 37.50% <0.00%> (-11.96%) ⬇️

@GNaD13 GNaD13 marked this pull request as ready for review October 4, 2022 04:19
@GNaD13 GNaD13 requested a review from alpe as a code owner October 4, 2022 04:19
Copy link
Contributor

@alpe alpe left a comment

Choose a reason for hiding this comment

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

Excellent work. 🏆
On nit if you want to address it but not blocking.

This is very helpful and should go into v0.29.0 . I tested it manually with docker and got a nice
expected Error: libwasmversion mismatch. got: 1.1.1; expected: v1.1.0.

x/wasm/module.go Outdated
if d.Replace != nil {
return fmt.Sprintf(d.Replace.Version)
}
return fmt.Sprintf(d.Version)
Copy link
Contributor

Choose a reason for hiding this comment

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

nit

Suggested change
return fmt.Sprintf(d.Version)
return d.Version

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have edited it

if d.Path != "github.com/CosmWasm/wasmvm" {
continue
}
if d.Replace != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

excellent 🦅

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you!!!

@@ -217,6 +221,8 @@ func AddModuleInitFlags(startCmd *cobra.Command) {
startCmd.Flags().Uint32(flagWasmMemoryCacheSize, defaults.MemoryCacheSize, "Sets the size in MiB (NOT bytes) of an in-memory cache for Wasm modules. Set to 0 to disable.")
startCmd.Flags().Uint64(flagWasmQueryGasLimit, defaults.SmartQueryGasLimit, "Set the max gas that can be spent on executing a query with a Wasm contract")
startCmd.Flags().String(flagWasmSimulationGasLimit, "", "Set the max gas that can be spent when executing a simulation TX")

startCmd.PreRunE = chainPreRuns(checkLibwasmVersion, startCmd.PreRunE)
Copy link
Contributor

Choose a reason for hiding this comment

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

nice chaining

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you!!!

@alpe alpe added this to the v0.29.0 milestone Oct 6, 2022
@alpe alpe changed the title add check version wasm Add check version wasm Oct 6, 2022
@GNaD13
Copy link
Contributor Author

GNaD13 commented Oct 7, 2022

Excellent work. trophy On nit if you want to address it but not blocking.

This is very helpful and should go into v0.29.0 . I tested it manually with docker and got a nice expected Error: libwasmversion mismatch. got: 1.1.1; expected: v1.1.0.

Hi sir @alpe.Thanks for your review.

@alpe alpe merged commit 2fe81b9 into CosmWasm:main Oct 7, 2022
@webmaster128
Copy link
Member

Nice one!

zemyblue added a commit to zemyblue/wasmd that referenced this pull request Jan 13, 2023
* wasmd_v0.29.1: (94 commits)
  fix test.
  fix test.
  update cosmos-sdk to v45.9, add dragonberry.
  Changelog updates (CosmWasm#1024)
  Validate incoming messages
  Add dependencies for protobuf and remove third_party forlder (CosmWasm#1030)
  Bump bufbuild/buf-setup-action from 1.7.0 to 1.8.0 (CosmWasm#1006)
  Add check version wasm (CosmWasm#1029)
  Make SenderPrivKey field public
  Bump actions/checkout from 3.0.2 to 3.1.0
  Revert module version to 1 as there is no migration
  Doc ante handler
  Fix: typos
  Changelog for v0.29.0-rc1 (CosmWasm#1018)
  Implement improvements to new address generation (CosmWasm#1014)
  Prune vesting accounts balances (CosmWasm#1003)
  Bump github.com/cosmos/ibc-go/v3 from 3.2.0 to 3.3.0
  Fix path to proofs in protos
  Upgrade .a files to 1.1.1
  Bump wasmvm to 1.1.1
  ...

# Conflicts:
#	.circleci/config.yml
#	.github/workflows/proto-buf-publisher.yml
#	CHANGELOG.md
#	Dockerfile
#	Makefile
#	README.md
#	app/app.go
#	app/app_test.go
#	app/export.go
#	app/sim_test.go
#	app/test_helpers.go
#	go.mod
#	go.sum
#	scripts/protocgen.sh
#	third_party/proto/cosmos/base/query/v1beta1/pagination.proto
#	third_party/proto/cosmos/base/v1beta1/coin.proto
#	third_party/proto/tendermint/blockchain/types.pb.go
#	third_party/proto/tendermint/consensus/types.pb.go
#	third_party/proto/tendermint/consensus/wal.pb.go
#	third_party/proto/tendermint/p2p/conn.pb.go
#	third_party/proto/tendermint/privval/types.pb.go
#	third_party/proto/tendermint/state/types.pb.go
#	third_party/proto/tendermint/types/types.pb.go
#	third_party/proto/tendermint/types/validator.pb.go
#	x/wasm/alias.go
#	x/wasm/client/cli/genesis_msg.go
#	x/wasm/client/cli/genesis_msg_test.go
#	x/wasm/client/cli/query.go
#	x/wasm/client/cli/tx.go
#	x/wasm/client/rest/gov.go
#	x/wasm/handler.go
#	x/wasm/ibctesting/chain.go
#	x/wasm/ibctesting/wasm.go
#	x/wasm/ioutils/ioutil_test.go
#	x/wasm/ioutils/utils_test.go
#	x/wasm/keeper/authz_policy.go
#	x/wasm/keeper/bench_test.go
#	x/wasm/keeper/contract_keeper.go
#	x/wasm/keeper/gas_register.go
#	x/wasm/keeper/gas_register_test.go
#	x/wasm/keeper/genesis_test.go
#	x/wasm/keeper/ibc_test.go
#	x/wasm/keeper/keeper.go
#	x/wasm/keeper/keeper_test.go
#	x/wasm/keeper/legacy_querier_test.go
#	x/wasm/keeper/msg_server.go
#	x/wasm/keeper/options.go
#	x/wasm/keeper/options_test.go
#	x/wasm/keeper/proposal_handler.go
#	x/wasm/keeper/proposal_integration_test.go
#	x/wasm/keeper/querier.go
#	x/wasm/keeper/querier_test.go
#	x/wasm/keeper/recurse_test.go
#	x/wasm/keeper/reflect_test.go
#	x/wasm/keeper/relay_test.go
#	x/wasm/keeper/staking_test.go
#	x/wasm/keeper/submsg_test.go
#	x/wasm/keeper/test_common.go
#	x/wasm/keeper/testdata/reflect.go
#	x/wasm/keeper/testdata/reflect.wasm
#	x/wasm/keeper/wasmtesting/coin_transferrer.go
#	x/wasm/keeper/wasmtesting/gas_register.go
#	x/wasm/module.go
#	x/wasm/module_test.go
#	x/wasm/simulation/genesis.go
#	x/wasm/simulation/operations.go
#	x/wasm/simulation/params.go
#	x/wasm/types/codec.go
#	x/wasm/types/events.go
#	x/wasm/types/exported_keepers.go
#	x/wasm/types/genesis.pb.go
#	x/wasm/types/iavl_range_test.go
#	x/wasm/types/ibc.pb.go
#	x/wasm/types/params.go
#	x/wasm/types/proposal.pb.go
#	x/wasm/types/query.pb.go
#	x/wasm/types/query.pb.gw.go
#	x/wasm/types/tx.pb.go
#	x/wasm/types/types.pb.go
Magicloud pushed a commit to fpco/wasmd that referenced this pull request Jan 13, 2023
* add check version wasm

* add check wasmExpectedVersion

* update on nit
conorpp pushed a commit to wormhole-foundation/wasmd that referenced this pull request Feb 1, 2023
* add check version wasm

* add check wasmExpectedVersion

* update on nit
larry0x pushed a commit to larry0x/wasmd that referenced this pull request Jul 17, 2023
Closes / Related to: CosmWasm#1029

## What is the purpose of the change

Re-instate the CoswmWasm message handlers for Mint and FullDenom. Related to osmosis-labs/bindings#25 on the Rust side.


## Brief change log

  - Uncomment the Mint-related code.
  - Implemented `Mint` using `TokenFactory`.
  - Implemented `FullDenom` in terms of `TokenFactory`.

## Testing and Verifying

Uncommented and adapted already existing tests.


## Documentation and Release Note

  - Does this pull request introduce a new feature or user-facing behavior changes? (yes. For the CosmWasm side)
  - Is a relevant changelog entry added to the `Unreleased` section in `CHANGELOG.md`? (will do)
  - How is the feature or change documented? (not documented)
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.

Enforce version check on wasm lib
3 participants