Skip to content

Commit

Permalink
Merge pull request #175 from neutron-org/upd/neutron-upd-0.51
Browse files Browse the repository at this point in the history
upd: bumped orig wasmd to v0.51
  • Loading branch information
pr0n00gler authored Jun 10, 2024
2 parents 71d2e7f + d9bebe6 commit 4652fc2
Show file tree
Hide file tree
Showing 216 changed files with 10,333 additions and 6,331 deletions.
19 changes: 13 additions & 6 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ orbs:
executors:
golang:
docker:
- image: cimg/go:1.20
- image: cimg/go:1.21

commands:
make:
Expand Down Expand Up @@ -97,11 +97,11 @@ jobs:
- "profiles/*"
- store_artifacts:
path: /tmp/logs

test-system:
executor: golang
parallelism: 1
resource_class: large
resource_class: xlarge
steps:
- attach_workspace:
at: /tmp/workspace
Expand All @@ -112,6 +112,13 @@ jobs:
- run:
name: Build and run system tests
command: make test-system
- run:
command: |
mkdir -p /tmp/system-test-workspace
mv /home/circleci/project/tests/system/testnet /tmp/system-test-workspace
when: on_fail
- store_artifacts:
path: /tmp/system-test-workspace

benchmark:
executor: golang
Expand All @@ -135,7 +142,7 @@ jobs:
simulations:
executor: golang
parallelism: 1
resource_class: large
resource_class: xlarge
steps:
- checkout
- run:
Expand Down Expand Up @@ -182,15 +189,15 @@ jobs:
command: |
IN_DOCKER=$(docker run --rm "cosmwasm/wasmd:${CIRCLE_SHA1}" /usr/bin/wasmd query wasm libwasmvm-version)
echo "Runtime libwasmvm-version in docker: $IN_DOCKER"
IN_GOMOD=$(go list -m github.com/CosmWasm/wasmvm | cut -d" " -f2 | cut -d"v" -f2)
IN_GOMOD=$(go list -m github.com/CosmWasm/wasmvm/v2 | cut -d" " -f2 | cut -d"v" -f2)
echo "wasmvm version in go.mod: $IN_GOMOD"
if [[ "$IN_DOCKER" != "$IN_GOMOD" ]]; then
echo "Mismatch of wasmvm versions detected"
exit 1
fi
- when:
condition:
equal: [ main, << pipeline.git.branch >> ]
equal: [main, << pipeline.git.branch >>]
steps:
- run:
name: Push application Docker image to docker hub
Expand Down
1 change: 0 additions & 1 deletion .codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ flags:

ignore:
- "cmd/"
- "contrib/"
- "docs/"
- "docker/"
- "scripts/"
Expand Down
16 changes: 16 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# EditorConfig is awesome: https://EditorConfig.org

# top-most EditorConfig file
root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[{Makefile,*.go}]
indent_style = tab
indent_size = 4
5 changes: 0 additions & 5 deletions .github/CODEOWNERS

This file was deleted.

8 changes: 4 additions & 4 deletions .github/workflows/codeql-analizer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,17 @@ jobs:

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

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@v3
with:
languages: 'go'
queries: crypto-com/cosmos-sdk-codeql@main,security-and-quality

- name: Autobuild
uses: github/codeql-action/autobuild@v2
uses: github/codeql-action/autobuild@v3

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@v3
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@v4.0.0
- uses: bufbuild/buf-setup-action@v1.26.1
- uses: actions/checkout@v4
- uses: bufbuild/buf-setup-action@v1.30.1

# lint checks
- uses: bufbuild/buf-lint-action@v1
Expand Down
25 changes: 25 additions & 0 deletions .github/workflows/staticmajor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Staticmajor: Static analyzer to catch leaking resources & other bad code patterns
name: Detect leaking resources and bad code patterns
on:
pull_request:
paths:
- "**.go"
push:
branches: [ main ]
paths:
- "**.go"

jobs:
run_staticmajor:
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v4
- name: Staticmajor action
id: staticmajor
uses: orijtech/staticmajor-action@main
with:
packages: ./...
resleak: true
structslop: false
tests: false
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,3 @@ dependency-graph.png
*.aux
*.out
*.synctex.gz
contract_tests/*
8 changes: 4 additions & 4 deletions .mergify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ queue_rules:
pull_request_rules:
- name: backport patches to main branch
conditions:
- base=releases/v0.40.x
- base=releases/v0.4x
- label=backport/main
actions:
backport:
Expand All @@ -20,11 +20,11 @@ pull_request_rules:
backport:
branches:
- releases/v0.3x
- name: backport patches to v0.40.x release branch
- name: backport patches to sdk47 release branch
conditions:
- base=main
- label=backport/v0.40.x
- label=backport/v0.4x
actions:
backport:
branches:
- releases/v0.40.x
- releases/v0.4x
62 changes: 45 additions & 17 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,62 @@

## [Unreleased](https://github.com/CosmWasm/wasmd/tree/HEAD)

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

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

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

This patch release includes only the cosmos-sdk upgrade to [v0.47.3](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.47.3).
It solves [barberry](https://forum.cosmos.network/t/cosmos-sdk-security-advisory-barberry/10825) security vulnerability.
[Full Changelog](https://github.com/CosmWasm/wasmd/compare/v0.51.0...HEAD)

# [v0.51.0](https://github.com/CosmWasm/wasmd/tree/v0.51.0) (2024-04-22)

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

- Bump cosmos-sdk to v0.50.6 [#1865](https://github.com/CosmWasm/wasmd/pull/1865)
- Bump tx module to v0.13.3 [#1864](https://github.com/CosmWasm/wasmd/pull/1864)
- Fix Amino JSON representation [\#1844](https://github.com/CosmWasm/wasmd/pull/1844)
- Add BuiltInCapabilities() to x/wasm/keeper and deprecate AllCapabilities() [#1855](https://github.com/CosmWasm/wasmd/pull/1855)
- Move contrib/ in scripts/ [\#1848](https://github.com/CosmWasm/wasmd/pull/1848)
- Remove contract_tests [\#1847](https://github.com/CosmWasm/wasmd/pull/1847)
- Upgrade Alpine in Dockerfile to 3.18 [\#1837](https://github.com/CosmWasm/wasmd/pull/1837)
- Bump wasmvm to 2.0.0 [\#1832](https://github.com/CosmWasm/wasmd/pull/1832)
- Rename gas to gasLeft [\#1820](https://github.com/CosmWasm/wasmd/pull/1820)
- Fix misleading error message for duplicate address on instantiate2 [\#1816](https://github.com/CosmWasm/wasmd/pull/1816)
- Rewrite compatibility section in README [\#1805](https://github.com/CosmWasm/wasmd/pull/1805)
- Generalize "pinned" to "discount" for cases where contract is in memory [\#1799](https://github.com/CosmWasm/wasmd/pull/1799)
- Rename InstantiateContractCosts -> SetupContractCost; Remove NewContractInstanceCosts [\#1797](https://github.com/CosmWasm/wasmd/pull/1797)
- Bump cosmos-sdk proto to v0.50.0 [\#1795](https://github.com/CosmWasm/wasmd/pull/1795)
- Fix grant contract cli command description [\#1778](https://github.com/CosmWasm/wasmd/issues/1778)
- Add Build Address gRPC Query [\#1753](https://github.com/CosmWasm/wasmd/pull/1753)

### Notable changes:
- Upgrade cosmos-sdk to [v0.47.3](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.47.3)
- Upgrade to [CosmWasm 2.0.0](https://github.com/CosmWasm/wasmvm/releases/tag/v2.0.0)
- Upgrade to [SDK v0.50.6](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.50.6) patch release of Cosmos SDK Eden

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

## [v0.40.1](https://github.com/CosmWasm/wasmd/tree/v0.40.1) (2023-06-06)
## [v0.50.0](https://github.com/CosmWasm/wasmd/tree/v0.50.0) (2023-11-23)

[Full Changelog](https://github.com/CosmWasm/wasmd/compare/v0.40.0...v0.40.1)
[Full Changelog](https://github.com/CosmWasm/wasmd/compare/v0.45.0...v0.50.0)

This patch release includes only the wasmvm upgrade to [v1.2.4](https://github.com/CosmWasm/wasmvm/releases/tag/v1.2.4).
It solves some incompatibility problems by improving cache invalidation. See [\#426](https://github.com/CosmWasm/wasmvm/issues/426)
- Fix module migration fails when code upload access is set to `OnlyAddress` [\#1725](https://github.com/CosmWasm/wasmd/issues/1725)
- Upgrade to SDK v0.50.1 [\#1696](https://github.com/CosmWasm/wasmd/pull/1696)
- Bump bufbuild/buf-setup-action from 1.27.1 to 1.27.2 [\#1684](https://github.com/CosmWasm/wasmd/pull/1684)
- Bump google.golang.org/grpc from 1.58.1 to 1.58.3 in /tests/system [\#1682](https://github.com/CosmWasm/wasmd/pull/1682)
- Rename some more "features" to "capabilities" [\#1679](https://github.com/CosmWasm/wasmd/pull/1679)
- Bump actions/checkout from 4.1.0 to 4.1.1 [\#1678](https://github.com/CosmWasm/wasmd/pull/1678)
- Bump bufbuild/buf-setup-action from 1.27.0 to 1.27.1 [\#1677](https://github.com/CosmWasm/wasmd/pull/1677)
- Upgrade to SDK v0.50 + IBC v8.0 [\#1611](https://github.com/CosmWasm/wasmd/pull/1611)

### Notable changes:
- Upgrade wasmvm to v1.2.4. [\#1430](https://github.com/CosmWasm/wasmd/issues/1430)
- Upgrade to [SDK v0.50.1](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.50.1) Eden release
- Upgrade to [IBC v8.0.0](https://github.com/cosmos/ibc-go/releases/tag/v8.0.0) release

### 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.45.0...HEAD)
- This release includes state migrations! Please pay careful attention to the doc provided by the [SDK](https://github.com/cosmos/cosmos-sdk/blob/v0.50.1/UPGRADING.md#v050x) team
and the [IBC](https://github.com/cosmos/ibc-go/releases/tag/v8.0.0) team with their releases
- We have some example upgrade code in the `app/upgrade/v0.50` dir, assuming that you come from a wasmd v0.4x version.
- We also tested a chain upgrade with wasmd v0.33 to v0.50 directly with a fix to [app.go](https://github.com/CosmWasm/wasmd/blame/b02a4723618629b5bb9603d8298621f6ef449f92/app/app.go#L927)
to work around an issue.
- Disclaimer: the upgrade codes are examples and may require more customization for your chain. Please do proper tests before applying on mainnets
- Please share your experience and success stories on CosmWasm [discord](https://discord.com/invite/cPjEnPd)


## [v0.45.0](https://github.com/CosmWasm/wasmd/tree/v0.45.0) (2023-11-15)

Expand Down
21 changes: 10 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# docker build . -t cosmwasm/wasmd:latest
# docker run --rm -it cosmwasm/wasmd:latest /bin/sh
FROM golang:1.19-alpine3.15 AS go-builder
ARG arch=x86_64

# Using Alpine 3.19+ as the build system is currently broken,
# see https://github.com/CosmWasm/wasmvm/issues/523
FROM golang:1.21-alpine3.18 AS go-builder

# this comes from standard alpine nightly file
# https://github.com/rust-lang/docker-rust-nightly/blob/master/alpine3.12/Dockerfile
Expand All @@ -15,21 +17,18 @@ RUN apk add git
WORKDIR /code
COPY . /code/
# See https://github.com/CosmWasm/wasmvm/releases
ADD https://github.com/CosmWasm/wasmvm/releases/download/v1.5.0/libwasmvm_muslc.aarch64.a /lib/libwasmvm_muslc.aarch64.a
ADD https://github.com/CosmWasm/wasmvm/releases/download/v1.5.0/libwasmvm_muslc.x86_64.a /lib/libwasmvm_muslc.x86_64.a
RUN sha256sum /lib/libwasmvm_muslc.aarch64.a | grep 2687afbdae1bc6c7c8b05ae20dfb8ffc7ddc5b4e056697d0f37853dfe294e913
RUN sha256sum /lib/libwasmvm_muslc.x86_64.a | grep 465e3a088e96fd009a11bfd234c69fb8a0556967677e54511c084f815cf9ce63

# 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
ADD https://github.com/CosmWasm/wasmvm/releases/download/v2.0.0/libwasmvm_muslc.aarch64.a /lib/libwasmvm_muslc.aarch64.a
ADD https://github.com/CosmWasm/wasmvm/releases/download/v2.0.0/libwasmvm_muslc.x86_64.a /lib/libwasmvm_muslc.x86_64.a
RUN sha256sum /lib/libwasmvm_muslc.aarch64.a | grep 3b478b3e51d31e53ce9324a8895d2cd7278af5179b9a02ea55d8627958e42afa
RUN sha256sum /lib/libwasmvm_muslc.x86_64.a | grep ca08bb7b73b49b483611d9755bb8455620bb8c0faf3014400908ed49bf3b19a5

# force it to use static lib (from above) not standard libgo_cosmwasm.so file
RUN LEDGER_ENABLED=false BUILD_TAGS=muslc LINK_STATICALLY=true make build
RUN echo "Ensuring binary is statically linked ..." \
&& (file /code/build/wasmd | grep "statically linked")

# --------------------------------------------------------
FROM alpine:3.16
FROM alpine:3.18

COPY --from=go-builder /code/build/wasmd /usr/bin/wasmd

Expand All @@ -45,4 +44,4 @@ EXPOSE 26656
# tendermint rpc
EXPOSE 26657

CMD ["/usr/bin/wasmd", "version"]
CMD ["/usr/bin/wasmd", "version"]
6 changes: 6 additions & 0 deletions INTEGRATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ hardware it runs on.

| wasmd | Cosmos SDK |
|:-----:|:----------:|
| v0.50 | v0.50.1 |
| v0.45 | v0.47.5 |
| v0.44 | v0.47.5 |
| v0.43 | v0.47.5 |
| v0.42 | v0.47.5 |
| v0.41 | v0.47.4 |
| v0.40 | v0.47.1 |
| v0.31 | v0.45.14 |
| v0.30 | v0.45.11 |
Expand Down
15 changes: 4 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ ldflags := $(strip $(ldflags))
BUILD_FLAGS := -tags "$(build_tags_comma_sep)" -ldflags '$(ldflags)' -trimpath

# The below include contains the tools and runsim targets.
include contrib/devtools/Makefile
include scripts/contrib/devtools/Makefile

all: install lint test

Expand All @@ -89,13 +89,6 @@ endif
build-windows-client: go.sum
GOOS=windows GOARCH=amd64 go build -mod=readonly $(BUILD_FLAGS) -o build/wasmd.exe ./cmd/wasmd

build-contract-tests-hooks:
ifeq ($(OS),Windows_NT)
go build -mod=readonly $(BUILD_FLAGS) -o build/contract_tests.exe ./cmd/contract_tests
else
go build -mod=readonly $(BUILD_FLAGS) -o build/contract_tests ./cmd/contract_tests
endif

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

Expand Down Expand Up @@ -161,7 +154,7 @@ test-system: install
format-tools:
go install mvdan.cc/gofumpt@v0.4.0
go install github.com/client9/misspell/cmd/misspell@v0.3.4
go install golang.org/x/tools/cmd/goimports@latest
go install github.com/daixiang0/gci@v0.11.2

lint: format-tools
golangci-lint run --tests=false
Expand All @@ -170,13 +163,13 @@ lint: format-tools
format: format-tools
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
find . -name '*.go' -type f -not -path "./vendor*" -not -path "./tests/system/vendor*" -not -path "*.git*" -not -path "./client/lcd/statik/statik.go" | xargs gci write --skip-generated -s standard -s default -s "prefix(cosmossdk.io)" -s "prefix(github.com/cosmos/cosmos-sdk)" -s "prefix(github.com/CosmWasm/wasmd)" --custom-order


###############################################################################
### Protobuf ###
###############################################################################
protoVer=0.13.1
protoVer=0.14.0
protoImageName=ghcr.io/cosmos/proto-builder:$(protoVer)
protoImage=$(DOCKER) run --rm -v $(CURDIR):/workspace --workdir /workspace $(protoImageName)

Expand Down
Loading

0 comments on commit 4652fc2

Please sign in to comment.