Skip to content

Commit

Permalink
Merge branch 'main' into egor/metoken-eg
Browse files Browse the repository at this point in the history
  • Loading branch information
kosegor authored Sep 25, 2023
2 parents 1e55cb3 + 9c1f366 commit 0a293ae
Show file tree
Hide file tree
Showing 54 changed files with 960 additions and 420 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
with:
files: "**/*.md"
separator: ","
- uses: DavidAnson/markdownlint-cli2-action@v12
- uses: DavidAnson/markdownlint-cli2-action@v13
if: steps.changed-files.outputs.any_changed == 'true'
with:
globs: ${{ steps.changed-files.outputs.all_changed_files }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ jobs:
- name: Test E2E
if: env.GIT_DIFF
run: |
EXPERIMENTAL=true make test-e2e
make test-e2e
liveness-test:
needs: install-tparse
Expand Down
24 changes: 24 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,30 @@ Ref: https://keepachangelog.com/en/1.0.0/

## [Unreleased]

### Improvements

- [2261](https://github.com/umee-network/umee/pull/2261) Use go 1.21

### Bug Fixes

- [2260](https://github.com/umee-network/umee/pull/2260) fix(oracle): avg params storage.

## [v6.0.2](https://github.com/umee-network/umee/releases/tag/v6.0.2) - 2023-09-20

### BugFix

- [2257](https://github.com/umee-network/umee/pull/2257) fix(oracle): missing avg params.

## [v6.0.1](https://github.com/umee-network/umee/releases/tag/v6.0.1) - 2023-09-15

### Features

- [2245](https://github.com/umee-network/umee/pull/2245) cli x/ugov: emergency group query.

### Bug Fixes

- [2247](https://github.com/umee-network/umee/pull/2247) `leverage.GovUpdateSpecialAssets`: set missing `LiquidationThreshold` attribute.

## [v6.0.0](https://github.com/umee-network/umee/releases/tag/v6.0.0) - 2023-09-14

### Features
Expand Down
9 changes: 2 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -169,9 +169,6 @@ go.sum: go.mod
###############################################################################

docker-build-e2e:
@DOCKER_BUILDKIT=1 docker build -t umee-network/umeed-e2e -f contrib/images/umee.e2e.dockerfile .

docker-build-e2e-experimental:
@DOCKER_BUILDKIT=1 docker build -t umee-network/umeed-e2e -f contrib/images/umee.e2e.dockerfile --build-arg EXPERIMENTAL=true .

docker-build:
Expand All @@ -196,14 +193,12 @@ TEST_COVERAGE_PROFILE=coverage.txt

UNIT_TEST_TAGS = norace
TEST_RACE_TAGS = ""
TEST_E2E_TAGS = "e2e"
TEST_E2E_TAGS = "e2e experimental"
TEST_E2E_DEPS = docker-build-e2e

ifeq ($(EXPERIMENTAL),true)
UNIT_TEST_TAGS += experimental
TEST_RACE_TAGS += experimental
TEST_E2E_TAGS += experimental
TEST_E2E_DEPS = docker-build-e2e-experimental
endif

test-unit: ARGS=-timeout=10m -tags='$(UNIT_TEST_TAGS)'
Expand Down Expand Up @@ -238,7 +233,7 @@ test-e2e-cov: $(TEST_E2E_DEPS)
go test ./tests/e2e/... -mod=readonly -timeout 30m -race -v -tags='$(TEST_E2E_TAGS)' -coverpkg=./... -coverprofile=e2e-profile.out -covermode=atomic

test-e2e-clean:
docker stop umee0 umee1 umee2 umee-gaia-relayer gaiaval0 umee-price-feeder
docker stop umee0 umee1 umee2 umee-gaia-relayer gaiaval0 umee-price-feeder || true
docker rm umee0 umee1 umee2 umee-gaia-relayer gaiaval0 umee-price-feeder

test-qa:
Expand Down
11 changes: 11 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,17 @@

Release Procedure is defined in the [CONTRIBUTING](CONTRIBUTING.md#release-procedure) document.

## v6.0.2

This fixes a crash shortly after the 6.0.1 upgrade. The crash occurred at height `8427849` but this binary works even if you switch to it immediately after the gov upgrade. Patch must be applied **as soon as possible**.

## v6.0.1

This is a bug fix release for the `leverage.MsgGovUpdateSpecialAssets` handler.
We also added `umeed q ugov emergency-group` CLI query. Users were able to query the Emergency Group address using REST.

[CHANGELOG](CHANGELOG.md)

## v6.0.0

Highlights:
Expand Down
15 changes: 15 additions & 0 deletions app/upgrades.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,21 @@ func (app UmeeApp) RegisterUpgradeHandlers() {
app.registerUpgrade5_1(upgradeInfo)
app.registerUpgrade("v5.2", upgradeInfo) // v5.2 migration is not compatible with v6, so leaving default here.
app.registerUpgrade6(upgradeInfo)
app.registerUpgrade6_1("v6.1", upgradeInfo)
}

func (app *UmeeApp) registerUpgrade6_1(planName string, _ upgradetypes.Plan) {
app.UpgradeKeeper.SetUpgradeHandler(planName,
func(ctx sdk.Context, plan upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) {
ctx.Logger().Info("-----------------------------\n-----------------------------")
err := app.OracleKeeper.SetHistoricAvgCounterParams(ctx, oracletypes.DefaultAvgCounterParams())
if err != nil {
return fromVM, err
}

return app.mm.RunMigrations(ctx, app.configurator, fromVM)
},
)
}

func (app *UmeeApp) registerUpgrade6(upgradeInfo upgradetypes.Plan) {
Expand Down
58 changes: 58 additions & 0 deletions client/metoken.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
package client

import (
"github.com/umee-network/umee/v6/util/sdkutil"
"github.com/umee-network/umee/v6/x/metoken"
)

func (c Client) MetokenQClient() metoken.QueryClient {
return metoken.NewQueryClient(c.Query.GrpcConn)
}

func (c Client) QueryMetokenParams() (metoken.Params, error) {
ctx, cancel := c.NewQCtx()
defer cancel()

resp, err := c.MetokenQClient().Params(ctx, &metoken.QueryParams{})
if err != nil {
return metoken.Params{}, err
}
return resp.Params, err
}

func (c Client) QueryMetokenIndexBalances(denom string) (*metoken.QueryIndexBalancesResponse, error) {
ctx, cancel := c.NewQCtx()
defer cancel()

msg := &metoken.QueryIndexBalances{MetokenDenom: denom}
if err := sdkutil.ValidateProtoMsg(msg); err != nil {
return nil, err
}
return c.MetokenQClient().IndexBalances(ctx, msg)
}

func (c Client) QueryMetokenIndexes(denom string) (*metoken.QueryIndexesResponse, error) {
ctx, cancel := c.NewQCtx()
defer cancel()

msg := &metoken.QueryIndexes{MetokenDenom: denom}
if err := sdkutil.ValidateProtoMsg(msg); err != nil {
return nil, err
}
return c.MetokenQClient().Indexes(ctx, msg)
}

func (c Client) QueryMetokenIndexPrices(denom string) (*metoken.QueryIndexPricesResponse, error) {
ctx, cancel := c.NewQCtx()
defer cancel()

msg := &metoken.QueryIndexPrices{MetokenDenom: denom}
if err := sdkutil.ValidateProtoMsg(msg); err != nil {
return nil, err
}
return c.MetokenQClient().IndexPrices(ctx, msg)
}

//
// Tx
//
4 changes: 2 additions & 2 deletions contrib/images/umee.e2e-static.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Creates static binaries, by building from the latest version of:
# umeed, price-feeder.

FROM golang:1.20-alpine AS builder
FROM golang:1.21-alpine3.18 AS builder
ENV PACKAGES make git gcc linux-headers build-base curl
RUN apk add --no-cache $PACKAGES

Expand All @@ -25,7 +25,7 @@ RUN LEDGER_ENABLED=false BUILD_TAGS=muslc LINK_STATICALLY=true make install && \


## Prepare the final clear binary
FROM alpine:latest
FROM alpine:3.18
EXPOSE 26656 26657 1317 9090 7171
ENTRYPOINT ["umeed", "start"]

Expand Down
6 changes: 3 additions & 3 deletions contrib/images/umee.e2e.dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Docker for e2e testing
# Creates dynamic binaries, by building from the latest version of umeed

FROM golang:1.20-bookworm AS builder
ARG EXPERIMENTAL=false
FROM golang:1.21-bookworm AS builder
ARG EXPERIMENTAL=true

## Download go module dependencies for umeed
WORKDIR /src/umee
Expand All @@ -15,7 +15,7 @@ ENV EXPERIMENTAL $EXPERIMENTAL
WORKDIR /src/umee
COPY . .
RUN if [ "$EXPERIMENTAL" = "true" ] ; then echo "Installing experimental build";else echo "Installing stable build";fi
RUN BUILD_TAGS=badgerdb make install
RUN make install

## Prepare the final clear binary
FROM ubuntu:23.04
Expand Down
2 changes: 1 addition & 1 deletion contrib/images/umeed.dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Stage-1: build
# We use Debian Bullseye rather then Alpine because Alpine has problem building libwasmvm
# - requires to download libwasmvm_muslc from external source. Build with glibc is straightforward.
FROM golang:1.20-bookworm AS builder
FROM golang:1.21-bookworm AS builder

WORKDIR /src/
# optimization: if go.sum didn't change, docker will use cached image
Expand Down
2 changes: 1 addition & 1 deletion contrib/scripts/go-mod-tidy-all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ set -euo pipefail
for modfile in $(find . -name go.mod); do
echo "Updating $modfile"
DIR=$(dirname $modfile)
(cd $DIR; go mod tidy --compat=1.20)
(cd $DIR; go mod tidy --compat=1.21)
done
44 changes: 22 additions & 22 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/umee-network/umee/v6

go 1.20
go 1.21

require (
cosmossdk.io/errors v1.0.0
Expand All @@ -17,7 +17,7 @@ require (
github.com/golangci/golangci-lint v1.54.2
github.com/gorilla/mux v1.8.0
github.com/grpc-ecosystem/grpc-gateway v1.16.0
github.com/mgechev/revive v1.3.3
github.com/mgechev/revive v1.3.4
github.com/ory/dockertest/v3 v3.10.0
github.com/osmosis-labs/bech32-ibc v0.3.1
github.com/prometheus/client_golang v1.16.0
Expand All @@ -30,22 +30,22 @@ require (
github.com/tendermint/tendermint v0.34.29
github.com/tendermint/tm-db v0.6.7
golang.org/x/exp v0.0.0-20230510235704-dd950f8aeaea
google.golang.org/genproto/googleapis/api v0.0.0-20230526203410-71b5a4ffd15e
google.golang.org/grpc v1.57.0
google.golang.org/genproto/googleapis/api v0.0.0-20230711160842-782d3b101e98
google.golang.org/grpc v1.58.1
google.golang.org/protobuf v1.31.0
gopkg.in/yaml.v3 v3.0.1
gotest.tools/v3 v3.5.0
gotest.tools/v3 v3.5.1
mvdan.cc/gofumpt v0.5.0
)

require (
4d63.com/gocheckcompilerdirectives v1.2.1 // indirect
4d63.com/gochecknoglobals v0.2.1 // indirect
cloud.google.com/go v0.110.0 // indirect
cloud.google.com/go/compute v1.19.1 // indirect
cloud.google.com/go v0.110.4 // indirect
cloud.google.com/go/compute v1.21.0 // indirect
cloud.google.com/go/compute/metadata v0.2.3 // indirect
cloud.google.com/go/iam v0.13.0 // indirect
cloud.google.com/go/storage v1.28.1 // indirect
cloud.google.com/go/iam v1.1.1 // indirect
cloud.google.com/go/storage v1.30.1 // indirect
filippo.io/edwards25519 v1.0.0-rc.1 // indirect
github.com/4meepo/tagalign v1.3.2 // indirect
github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect
Expand Down Expand Up @@ -86,7 +86,7 @@ require (
github.com/cespare/xxhash v1.1.0 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/charithe/durationcheck v0.0.10 // indirect
github.com/chavacava/garif v0.0.0-20230608123814-4bd63c2919ab // indirect
github.com/chavacava/garif v0.1.0 // indirect
github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e // indirect
github.com/cockroachdb/apd/v2 v2.0.2 // indirect
github.com/coinbase/rosetta-sdk-go v0.7.9 // indirect
Expand Down Expand Up @@ -157,11 +157,11 @@ require (
github.com/google/go-cmp v0.5.9 // indirect
github.com/google/gofuzz v1.2.0 // indirect
github.com/google/orderedcode v0.0.1 // indirect
github.com/google/s2a-go v0.1.3 // indirect
github.com/google/s2a-go v0.1.4 // indirect
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/googleapis/enterprise-certificate-proxy v0.2.3 // indirect
github.com/googleapis/gax-go/v2 v2.8.0 // indirect
github.com/googleapis/gax-go/v2 v2.11.0 // indirect
github.com/gordonklaus/ineffassign v0.0.0-20230610083614-0e73809eb601 // indirect
github.com/gorilla/handlers v1.5.1 // indirect
github.com/gorilla/websocket v1.5.0 // indirect
Expand Down Expand Up @@ -303,21 +303,21 @@ require (
go.uber.org/goleak v1.1.12 // indirect
go.uber.org/multierr v1.8.0 // indirect
go.uber.org/zap v1.24.0 // indirect
golang.org/x/crypto v0.12.0 // indirect
golang.org/x/crypto v0.13.0 // indirect
golang.org/x/exp/typeparams v0.0.0-20230307190834-24139beb5833 // indirect
golang.org/x/mod v0.12.0 // indirect
golang.org/x/net v0.14.0 // indirect
golang.org/x/oauth2 v0.7.0 // indirect
golang.org/x/net v0.15.0 // indirect
golang.org/x/oauth2 v0.10.0 // indirect
golang.org/x/sync v0.3.0 // indirect
golang.org/x/sys v0.11.0 // indirect
golang.org/x/term v0.11.0 // indirect
golang.org/x/text v0.12.0 // indirect
golang.org/x/tools v0.12.0 // indirect
golang.org/x/sys v0.12.0 // indirect
golang.org/x/term v0.12.0 // indirect
golang.org/x/text v0.13.0 // indirect
golang.org/x/tools v0.13.0 // indirect
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect
google.golang.org/api v0.122.0 // indirect
google.golang.org/api v0.126.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/genproto v0.0.0-20230629202037-9506855d4529 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20230706204954-ccb25ca9f130 // indirect
google.golang.org/genproto v0.0.0-20230711160842-782d3b101e98 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20230711160842-782d3b101e98 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
honnef.co/go/tools v0.4.5 // indirect
Expand Down
Loading

0 comments on commit 0a293ae

Please sign in to comment.