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

upd: wasmd 0.43 #117

Merged
merged 62 commits into from
Nov 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
8627f85
style: lint wasmd in the same manner as cosmos-sdk (#1537)
faddat Jul 31, 2023
ae964a8
Bump bufbuild/buf-setup-action from 1.25.0 to 1.25.1 (#1541)
dependabot[bot] Aug 3, 2023
dc970c4
marshaler to codec (#1545)
faddat Aug 4, 2023
a2373f0
remove "check" from make test-all (#1548)
faddat Aug 4, 2023
33df4ae
Bump bufbuild/buf-setup-action from 1.25.1 to 1.26.0 (#1549)
dependabot[bot] Aug 11, 2023
08c517b
Fix label validation error (#1555)
pinosu Aug 17, 2023
3de2c49
Bump bufbuild/buf-setup-action from 1.26.0 to 1.26.1 (#1556)
dependabot[bot] Aug 17, 2023
7078c13
Bump cosmossdk.io/math from 1.0.1 to 1.1.2 (#1566)
dependabot[bot] Aug 22, 2023
881d6a7
Improve ToWasmVMGas/FromWasmVMGas code level documentation (#1564)
webmaster128 Aug 24, 2023
bfaf589
Fix gas calculation (#1567)
chipshort Aug 24, 2023
9e50a42
Bump actions/checkout from 3.5.3 to 3.6.0 (#1572)
dependabot[bot] Aug 25, 2023
acfe1e4
fix: make sure wasmvm cache metrics collector after VM setup
dadamu Aug 28, 2023
7c6069d
Merge pull request #1575 from desmos-labs/paul/fix-wasmvm-cache-metri…
alpe Aug 28, 2023
4595e6d
Fail fast on wasmvm cache metric setup
alpe Aug 28, 2023
78b5af2
Merge pull request #1576 from CosmWasm/1575_test
alpe Aug 28, 2023
baf3357
Add unit test for gas calculation
pinosu Aug 29, 2023
0d3bfce
Rename key store key attribute to be more concrete
alpe Aug 30, 2023
1f49d75
Merge pull request #1585 from CosmWasm/rename_key
alpe Aug 31, 2023
daf48ea
Merge pull request #1582 from CosmWasm/gas_unit_test
alpe Aug 31, 2023
0371b65
Bump github.com/cosmos/ibc-go/v7 from 7.2.0 to 7.3.0 (#1594)
dependabot[bot] Sep 1, 2023
2ca9379
Bump cosmos-sdk to v0.47.5
pinosu Sep 4, 2023
ffcfa8d
Remove Wasmer references
pinosu Sep 4, 2023
55ad68b
Bump actions/checkout from 3.6.0 to 4.0.0
dependabot[bot] Sep 5, 2023
1082ad5
Merge pull request #1603 from CosmWasm/dependabot/github_actions/acti…
alpe Sep 5, 2023
0903d63
Merge pull request #1598 from CosmWasm/1595-bump_sdk_0.47.5
alpe Sep 5, 2023
1149653
Merge pull request #1599 from CosmWasm/1596-remove_wasmer_ref
alpe Sep 5, 2023
51aae54
Deactivate thelper for linter
alpe Sep 5, 2023
086c052
Merge pull request #1604 from CosmWasm/linter_no_thelper
alpe Sep 5, 2023
3fc9224
Bump github.com/cosmos/iavl from 0.20.0 to 0.20.1
dependabot[bot] Sep 6, 2023
f1835a1
Add logging for query err before redacting (#1605)
pinosu Sep 6, 2023
7bd6566
Merge pull request #1606 from CosmWasm/dependabot/go_modules/github.c…
alpe Sep 6, 2023
9e3904c
test: add test cases in ContractsByCode
170210 Sep 7, 2023
cb887ee
Merge pull request #1607 from 170210/modify_wasmd_test
alpe Sep 7, 2023
87dce54
Add StoreAndMigrateContract proposal (#1539)
pinosu Sep 7, 2023
3d9d92c
Wasmvm 1.4 upgrade (#1590)
alpe Sep 7, 2023
0f82c95
Linter only (#1609)
alpe Sep 7, 2023
09b5008
Remove legacy gov proposal dependencies (#1587)
pinosu Sep 7, 2023
965e28c
Restrict pagination on all state query
alpe Sep 12, 2023
e81d655
Start rework channel query
alpe Sep 12, 2023
177c0a9
Test channels query
alpe Sep 13, 2023
d5fa278
Handle query for non ibc contracts
alpe Sep 13, 2023
42f3192
Merge pull request #1619 from CosmWasm/queries
alpe Sep 14, 2023
dd22204
Add store code authz (#1591)
pinosu Sep 14, 2023
e0bfaa5
Merge pull request #1620 from CosmWasm/channel_query
alpe Sep 14, 2023
b72d182
Ensure some contraints and limits on pin/unpin code ids
alpe Sep 13, 2023
6a2bffd
Add grant system tests (#1626)
pinosu Sep 15, 2023
7dba5c7
Merge pull request #1624 from CosmWasm/upper_limit
alpe Sep 18, 2023
7dc2d0c
Fix genesis import with predictable addresses
alpe Sep 18, 2023
c12e85e
Merge pull request #1630 from CosmWasm/1629_genesis
alpe Sep 18, 2023
afa85da
Set default query limit and ensure constraints (#1632)
alpe Sep 18, 2023
03f3c72
Update changelog for 0.42.0 release (#1633)
pinosu Sep 20, 2023
06c6385
Merge branch 'cosmwasm/v0.42.0' into upd/neutron-upd-0.42
Sep 27, 2023
a52bfa8
merge fixes
Sep 27, 2023
1dd39da
fixed tests
swelf19 Sep 27, 2023
5c6517e
regenerated proto
swelf19 Sep 27, 2023
3f634a3
Add msg update contract label (backport #1640) (#1642)
mergify[bot] Sep 28, 2023
cb9f569
Remove gov v1beta1 dependencies and deprecated proposals (#1645)
pinosu Oct 4, 2023
0e60308
Retract v0.42.0 release
pinosu Oct 6, 2023
9a569eb
Merge pull request #1655 from CosmWasm/mergify/bp/releases/v0.4x/pr-1652
alpe Oct 9, 2023
7270ccd
Bump wasmvm to v1.4.1 - bugfix (#1658)
alpe Oct 9, 2023
c51dcca
Update changelog for v0.43.0 release (#1662)
pinosu Oct 10, 2023
4e32ed6
Merge branch 'cosmwasm-orig-0.43.0' into upd/neutron-upd-0.43
swelf19 Oct 24, 2023
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
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ jobs:

lint:
docker:
- image: golangci/golangci-lint:v1.52.2
- image: golangci/golangci-lint:v1.54.2
steps:
- checkout
- run:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analizer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3.5.3
uses: actions/checkout@v4.0.0

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/proto-buf-publisher.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ jobs:
push:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3.5.3
- uses: bufbuild/buf-setup-action@v1.25.0
- uses: actions/checkout@v4.0.0
- uses: bufbuild/buf-setup-action@v1.26.1

# lint checks
- uses: bufbuild/buf-lint-action@v1
Expand Down
115 changes: 101 additions & 14 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,24 @@
run:
tests: true
# timeout for analysis, e.g. 30s, 5m, default is 1m
timeout: 5m
timeout: 15m
sort-results: true
allow-parallel-runners: true
exclude-dir: testutil/testdata
skip-files:
- server/grpc/gogoreflection/fix_registration.go
- ".*\\.pb\\.go$"
- ".*\\.pb\\.gw\\.\\.go$"
- ".*\\.pulsar\\.go$"

linters:
disable-all: true
enable:
- bodyclose
- dogsled
- errcheck
- dogsled
- exportloopref
- goconst
- gocritic
- gci
- gofumpt
- gosec
- gosimple
Expand All @@ -20,42 +27,122 @@ linters:
- misspell
- nakedret
- nolintlint
- revive
- staticcheck
- revive
- stylecheck
- typecheck
# - thelper # too many positives with table tests that have custom setup(*testing.T)
- unconvert
- unparam
- unused

issues:
exclude-rules:
- text: "Use of weak random number generator"
- text: 'Use of weak random number generator'
linters:
- gosec
- text: "ST1003:"
- text: 'ST1003:'
linters:
- stylecheck
# FIXME: Disabled until golangci-lint updates stylecheck with this fix:
# https://github.com/dominikh/go-tools/issues/389
- text: "ST1016:"
- text: 'ST1016:'
linters:
- stylecheck
- path: "migrations"
text: "SA1019:"
- path: 'migrations'
text: 'SA1019:'
linters:
- staticcheck

- text: 'SA1019: codec.NewAminoCodec is deprecated' # TODO remove once migration path is set out
linters:
- staticcheck
- text: 'SA1019: legacybech32.MustMarshalPubKey' # TODO remove once ready to remove from the sdk
linters:
- staticcheck
- text: 'SA1019: legacybech32.MarshalPubKey' # TODO remove once ready to remove from the sdk
linters:
- staticcheck
- text: 'SA1019: legacybech32.UnmarshalPubKey' # TODO remove once ready to remove from the sdk
linters:
- staticcheck
- text: 'SA1019: params.SendEnabled is deprecated' # TODO remove once ready to remove from the sdk
linters:
- staticcheck
- text: 'leading space'
linters:
- nolintlint
max-issues-per-linter: 10000
max-same-issues: 10000

linters-settings:
gci:
custom-order: true
sections:
- standard # Standard section: captures all standard packages.
- default # Default section: contains all imports that could not be matched to another section type.
- prefix(cosmossdk.io)
- prefix(github.com/cosmos/cosmos-sdk)
- prefix(github.com/CosmWasm/wasmd)
revive:
# When set to false, ignores files with "GENERATED" header, similar to golint
ignore-generated-header: true
rules:
- name: redefines-builtin-id
disabled: true

gosec:
# To select a subset of rules to run.
# Available rules: https://github.com/securego/gosec#available-rules
# Default: [] - means include all rules
includes:
# - G101 # Look for hard coded credentials
- G102 # Bind to all interfaces
- G103 # Audit the use of unsafe block
- G104 # Audit errors not checked
- G106 # Audit the use of ssh.InsecureIgnoreHostKey
- G107 # Url provided to HTTP request as taint input
- G108 # Profiling endpoint automatically exposed on /debug/pprof
- G109 # Potential Integer overflow made by strconv.Atoi result conversion to int16/32
- G110 # Potential DoS vulnerability via decompression bomb
- G111 # Potential directory traversal
- G112 # Potential slowloris attack
- G113 # Usage of Rat.SetString in math/big with an overflow (CVE-2022-23772)
- G114 # Use of net/http serve function that has no support for setting timeouts
- G201 # SQL query construction using format string
- G202 # SQL query construction using string concatenation
- G203 # Use of unescaped data in HTML templates
- G204 # Audit use of command execution
- G301 # Poor file permissions used when creating a directory
- G302 # Poor file permissions used with chmod
- G303 # Creating tempfile using a predictable path
- G304 # File path provided as taint input
- G305 # File traversal when extracting zip/tar archive
- G306 # Poor file permissions used when writing to a new file
- G307 # Deferring a method which returns an error
- G401 # Detect the usage of DES, RC4, MD5 or SHA1
- G402 # Look for bad TLS connection settings
- G403 # Ensure minimum RSA key length of 2048 bits
- G404 # Insecure random number source (rand)
- G501 # Import blocklist: crypto/md5
- G502 # Import blocklist: crypto/des
- G503 # Import blocklist: crypto/rc4
- G504 # Import blocklist: net/http/cgi
- G505 # Import blocklist: crypto/sha1
- G601 # Implicit memory aliasing of items from a range statement
misspell:
locale: US
gofumpt:
extra-rules: true
dogsled:
max-blank-identifiers: 6
maligned:
suggest-new: true
nolintlint:
allow-unused: false
allow-leading-space: true
require-explanation: false
require-specific: false
gosimple:
checks: ['all']
gocritic:
disabled-checks:
- regexpMust
- appendAssign
- ifElseChain
54 changes: 53 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,59 @@ It solves some incompatibility problems by improving cache invalidation. See [\#

### Migration notes:
- This release does not include any state migrations or breaking changes, therefore a coordinated chain upgrade is not required.
[Full Changelog](https://github.com/CosmWasm/wasmd/compare/v0.41.0...HEAD)
[Full Changelog](https://github.com/CosmWasm/wasmd/compare/v0.43.0...HEAD)

## [v0.43.0](https://github.com/CosmWasm/wasmd/tree/v0.43.0) (2023-10-10)

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

- Make contract label updatable [\#1601](https://github.com/CosmWasm/wasmd/issues/1601)
- Remove gov v1beta1 dependencies and deprecated proposals [\#1608](https://github.com/CosmWasm/wasmd/issues/1608)
- Retract v0.42.0 release [\#1651](https://github.com/CosmWasm/wasmd/issues/1651)
- Bump wasmvm to v1.4.1 [\#1657](https://github.com/CosmWasm/wasmd/issues/1657)

### Notable changes:
- Wasmd v0.42.0 was retracted because an issue was found in CosmWasm 1.4.0. See https://twitter.com/CosmWasm/status/1709507168448229497
- This release bundles CosmWasm v1.4.1 patch release. If you are using wasmd v0.42.0 please upgrade to wasmd 0.43.0 as soon as possible.
- Deprecated wasm gov proposals have been removed completely from the codebase together with all the govv1beta1 dependencies.
- MsgUpdateContractLabel was introduced to allow contract label updates.

### Migration notes:
- This release does not include any state migrations but breaking changes that require a coordinated chain upgrade.

## [v0.42.0](https://github.com/CosmWasm/wasmd/tree/v0.42.0) (2023-09-20)

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

- Fix label validation error [\#1555](https://github.com/CosmWasm/wasmd/pull/1555)
- Improve ToWasmVMGas/FromWasmVMGas code level documentation [\#1564](https://github.com/CosmWasm/wasmd/pull/1564)
- Fix gas calculation [\#1567](https://github.com/CosmWasm/wasmd/pull/1567)
- Bump cosmos-sdk to v0.47.5 [\#1467](https://github.com/CosmWasm/wasmd/issues/1467)
- fix: make sure wasmvm cache metrics collector registration after VM setup[\#1575](https://github.com/CosmWasm/wasmd/pull/1575)
- Remove legacy gov proposal dependencies [\#1587](https://github.com/CosmWasm/wasmd/pull/1587)
- Upgrade to wasmvm 1.4 [\#1586](https://github.com/CosmWasm/wasmd/issues/1586)
- Custom StoreCode Authorization for authz module [\#1584](https://github.com/CosmWasm/wasmd/issues/1584)
- Bump github.com/cosmos/ibc-go/v7 from 7.2.0 to 7.3.0 [\#1594](https://github.com/CosmWasm/wasmd/pull/1594)
- Log query error before redacting [\#1593](https://github.com/CosmWasm/wasmd/issues/1593)
- Restrict pagination on all-state-query [\#1619](https://github.com/CosmWasm/wasmd/pull/1619)
- Bug in IbcQuery::ListChannels implementation when port is unset [\#1597](https://github.com/CosmWasm/wasmd/issues/1597)
- Ensure some contraints and limits on pin/unpin code ids [\#1624](https://github.com/CosmWasm/wasmd/pull/1624)
- Ensure genesis import works with both address generators [\#1629](https://github.com/CosmWasm/wasmd/issues/1629)
- Set default query limit and ensure constraints [\#1632](https://github.com/CosmWasm/wasmd/pull/1632)

### Notable changes:
- Fix gas calculation [\#1567](https://github.com/CosmWasm/wasmd/pull/1567)
- Upgrade to wasmvm 1.4 [\#1586](https://github.com/CosmWasm/wasmd/issues/1586)
- Bug in IbcQuery::ListChannels implementation when port is unset [\#1597](https://github.com/CosmWasm/wasmd/issues/1597)
- If `port_id` is omitted, all channels bound to the contract's port will be listed.
- Restrict pagination on all-state-query [\#1619](https://github.com/CosmWasm/wasmd/pull/1619)
- Pagination limit is set to 100 for all-state-query. See also [\#1632](https://github.com/CosmWasm/wasmd/pull/1632)
- Ensure some contraints and limits on pin/unpin code ids [\#1624](https://github.com/CosmWasm/wasmd/pull/1624)
- Total number of code ids is limited to 50 for pin/unpin operations
- Custom StoreCode Authorization for authz module [\#1584](https://github.com/CosmWasm/wasmd/issues/1584)

### Migration notes:
- This release does not include any state migrations but breaking changes that require a coordinated chain upgrade.

## [v0.41.0](https://github.com/CosmWasm/wasmd/tree/v0.41.0) (2023-07-28)

Expand Down
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ RUN apk add git
WORKDIR /code
COPY . /code/
# See https://github.com/CosmWasm/wasmvm/releases
ADD https://github.com/CosmWasm/wasmvm/releases/download/v1.3.0/libwasmvm_muslc.aarch64.a /lib/libwasmvm_muslc.aarch64.a
ADD https://github.com/CosmWasm/wasmvm/releases/download/v1.3.0/libwasmvm_muslc.x86_64.a /lib/libwasmvm_muslc.x86_64.a
RUN sha256sum /lib/libwasmvm_muslc.aarch64.a | grep b1610f9c8ad8bdebf5b8f819f71d238466f83521c74a2deb799078932e862722
RUN sha256sum /lib/libwasmvm_muslc.x86_64.a | grep b4aad4480f9b4c46635b4943beedbb72c929eab1d1b9467fe3b43e6dbf617e32
ADD https://github.com/CosmWasm/wasmvm/releases/download/v1.4.1/libwasmvm_muslc.aarch64.a /lib/libwasmvm_muslc.aarch64.a
ADD https://github.com/CosmWasm/wasmvm/releases/download/v1.4.1/libwasmvm_muslc.x86_64.a /lib/libwasmvm_muslc.x86_64.a
RUN sha256sum /lib/libwasmvm_muslc.aarch64.a | grep a8259ba852f1b68f2a5f8eb666a9c7f1680196562022f71bb361be1472a83cfd
RUN sha256sum /lib/libwasmvm_muslc.x86_64.a | grep 324c1073cb988478d644861783ed5a7de21cfd090976ccc6b1de0559098fbbad

# Copy the library you want to the final location that will be found by the linker flag `-lwasmvm_muslc`
RUN cp /lib/libwasmvm_muslc.${arch}.a /lib/libwasmvm_muslc.a
Expand Down
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ distclean: clean
### Testing

test: test-unit
test-all: check test-race test-cover test-system
test-all: test-race test-cover test-system

test-unit:
@VERSION=$(VERSION) go test -mod=readonly -tags='ledger test_ledger_mock' ./...
Expand Down Expand Up @@ -165,12 +165,12 @@ format-tools:

lint: format-tools
golangci-lint run --tests=false
find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -path "*_test.go" | xargs gofumpt -d
find . -name '*.go' -type f -not -path "./vendor*" -not -path "./tests/system/vendor*" -not -path "*.git*" -not -path "*_test.go" | xargs gofumpt -d

format: format-tools
find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -path "./client/lcd/statik/statik.go" | xargs gofumpt -w
find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -path "./client/lcd/statik/statik.go" | xargs misspell -w
find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -path "./client/lcd/statik/statik.go" | xargs goimports -w -local github.com/CosmWasm/wasmd
find . -name '*.go' -type f -not -path "./vendor*" -not -path "./tests/system/vendor*" -not -path "*.git*" -not -path "./client/lcd/statik/statik.go" | xargs gofumpt -w
find . -name '*.go' -type f -not -path "./vendor*" -not -path "./tests/system/vendor*" -not -path "*.git*" -not -path "./client/lcd/statik/statik.go" | xargs misspell -w
find . -name '*.go' -type f -not -path "./vendor*" -not -path "./tests/system/vendor*" -not -path "*.git*" -not -path "./client/lcd/statik/statik.go" | xargs goimports -w -local github.com/CosmWasm/wasmd


###############################################################################
Expand Down
7 changes: 2 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ compatibility list:

| wasmd | wasmvm | cosmwasm-vm | cosmwasm-std |
|-------|--------------|-------------|--------------|
| 0.42 | v1.4.0 | | 1.0-1.4 |
| 0.41 | v1.3.0 | | 1.0-1.3 |
| 0.40 | v1.2.3 | | 1.0-1.2 |
| 0.31 | v1.2.0 | | 1.0-1.2 |
Expand Down Expand Up @@ -198,9 +199,6 @@ Available flags:

* `-X github.com/CosmWasm/wasmd/app.NodeDir=.corald` - set the config/data directory for the node (default `~/.wasmd`)
* `-X github.com/CosmWasm/wasmd/app.Bech32Prefix=coral` - set the bech32 prefix for all accounts (default `wasm`)
* `-X github.com/CosmWasm/wasmd/app.ProposalsEnabled=true` - enable all x/wasm governance proposals (default `false`)
* `-X github.com/CosmWasm/wasmd/app.EnableSpecificProposals=MigrateContract,UpdateAdmin,ClearAdmin` -
enable a subset of the x/wasm governance proposal types (overrides `ProposalsEnabled`)

Examples:

Expand All @@ -227,8 +225,7 @@ We strongly suggest **to limit the max block gas in the genesis** and not use th
```

Tip: if you want to lock this down to a permisisoned network, the following script can edit the genesis file
to only allow permissioned use of code upload or instantiating. (Make sure you set `app.ProposalsEnabled=true`
in this binary):
to only allow permissioned use of code upload or instantiating:

`sed -i 's/permission": "Everybody"/permission": "Nobody"/' .../config/genesis.json`

Expand Down
Loading