diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9b7a258a..399a223a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -16,7 +16,7 @@ jobs: - name: Setup go uses: actions/setup-go@v3 with: - go-version: 1.18 + go-version: 1.19 env: GOOS: ${{ matrix.targetos }} GOARCH: ${{ matrix.arch }} diff --git a/.github/workflows/debug.yml b/.github/workflows/debug.yml index ba6d100b..29e6cbf6 100644 --- a/.github/workflows/debug.yml +++ b/.github/workflows/debug.yml @@ -13,7 +13,7 @@ jobs: steps: - uses: actions/setup-go@v3 with: - go-version: 1.18 + go-version: 1.19 - uses: actions/checkout@v3 - name: Setup tmate session uses: mxschmitt/action-tmate@v3 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 80ab9ea6..de7d98e6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -16,7 +16,7 @@ jobs: fetch-depth: 0 - uses: actions/setup-go@v3 with: - go-version: 1.18 + go-version: 1.19 - name: Build uses: goreleaser/goreleaser-action@v3 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 32d7a592..82408572 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -20,7 +20,7 @@ jobs: steps: - uses: actions/setup-go@v3 with: - go-version: 1.18 + go-version: 1.19 - name: Display Go Version run: go version - name: Install tparse @@ -36,7 +36,7 @@ jobs: steps: - uses: actions/setup-go@v3 with: - go-version: 1.18 + go-version: 1.19 - uses: actions/checkout@v3 - uses: technote-space/get-diff-action@v6.1.1 with: @@ -56,7 +56,7 @@ jobs: test-e2e: runs-on: ubuntu-latest - timeout-minutes: 30 + timeout-minutes: 20 steps: - uses: actions/checkout@v3 - uses: technote-space/get-diff-action@v6.1.1 @@ -68,7 +68,7 @@ jobs: - uses: actions/setup-go@v3 if: env.GIT_DIFF with: - go-version: 1.18 + go-version: 1.19 cache: true # In this step, this action saves a list of existing images, diff --git a/.goreleaser.yml b/.goreleaser.yml index 4137f037..9bc3f966 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -2,11 +2,11 @@ project_name: peggo env: - - GO111MODULE=on + - CGO_ENABLED=1 before: hooks: - - go mod tidy -compat=1.18 + - go mod download builds: - main: ./ @@ -15,17 +15,12 @@ builds: mod_timestamp: "{{ .CommitTimestamp }}" flags: - -trimpath - env: - - CGO_ENABLED=0 ldflags: - -s -w -X main.commit={{.Commit}} -X main.date={{ .CommitDate }} -X github.com/umee-network/peggo/cmd/peggo.Version={{ .Version }} -X github.com/umee-network/peggo/cmd/peggo.Commit=$(COMMIT)={{ .Commit }} goos: - - darwin - linux goarch: - amd64 - - arm - - arm64 archives: - format: tar.gz @@ -35,8 +30,8 @@ archives: format: zip name_template: "{{ .Binary }}-v{{ .Version }}-{{ .Os }}-{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}" files: - - LICENSE - README.md + - LICENSE release: github: @@ -52,4 +47,4 @@ snapshot: name_template: SNAPSHOT-{{ .Commit }} changelog: - skip: true + skip: false diff --git a/CHANGELOG.md b/CHANGELOG.md index 55e77630..be57ea52 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -45,6 +45,9 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### Improvements +- [#412](https://github.com/umee-network/peggo/pull/412) Update price-feeder to v2.0.1 and removed FTX and Binance from default providers. + - update go to 1.19 +- [#328f55c](https://github.com/umee-network/peggo/commit/328f55c5944101527df13d43e791c47155ddd8d7) Cosmos SDK to v0.46.7. - [#399](https://github.com/umee-network/peggo/pull/399) Update price-feeder to v101 and umee to v3.1.0. ## [v1.3.0](https://github.com/umee-network/peggo/releases/tag/v1.3.0) - 2022-10-26 @@ -180,7 +183,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### Bug Fixes - [#134] Fix logs, CLI help and a panic when a non-function call transaction was - received during the TX pending check. + received during the TX pending check. ## [v0.2.0](https://github.com/umee-network/peggo/releases/tag/v0.2.0) - 2022-01-17 diff --git a/Dockerfile b/Dockerfile index 8ea0ab03..af6bb8db 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,31 +1,28 @@ +## image for docker Peggo release + ARG IMG_TAG=latest # Fetch base packages -FROM golang:1.18-alpine AS base-builder -ENV PACKAGES make git libc-dev gcc linux-headers -RUN apk add --no-cache $PACKAGES +FROM golang:1.19-bullseye AS builder # Compile the peggo binary -FROM base-builder AS peggo-builder -WORKDIR /src/app/ -COPY go.mod go.sum* ./ -RUN go mod download +WORKDIR /src/peggo/ COPY . . -RUN apk add --no-cache $PACKAGES +RUN go mod download RUN make install -# Fetch umeed binary -FROM base-builder AS umeed-builder -ARG UMEE_VERSION=v3.0.0-beta1 -ENV PACKAGES curl eudev-dev -RUN apk add --no-cache $PACKAGES -WORKDIR /downloads/ -RUN git clone https://github.com/umee-network/umee.git -RUN cd umee && git checkout ${UMEE_VERSION} && CGO_ENABLED=0 make build && cp ./build/umeed /usr/local/bin/ +# Build umeed +WORKDIR /src/umee +# RUN wget https://github.com/umee-network/umee/releases/download/v3.0.3/umeed-v3.0.3-linux-amd64.tar.gz && \ +RUN wget https://github.com/umee-network/umee/releases/download/v3.3.0-rc1/umeed-v3.3.0-rc1-linux-amd64 && \ + chmod +x umeed-v3.3.0-rc1-linux-amd64* && \ + cp umeed-v3.3.0-rc1-linux-amd64* /usr/local/bin/umeed +RUN wget https://raw.githubusercontent.com/CosmWasm/wasmvm/v1.1.1/internal/api/libwasmvm.x86_64.so # Add to a distroless container FROM gcr.io/distroless/cc:$IMG_TAG ARG IMG_TAG -COPY --from=peggo-builder /go/bin/peggo /usr/local/bin/ -COPY --from=umeed-builder /usr/local/bin/umeed /usr/local/bin/ +COPY --from=builder /go/bin/peggo /usr/local/bin/ +COPY --from=builder /usr/local/bin/umeed /usr/local/bin/ +COPY --from=builder /src/umee/libwasmvm.x86_64.so /lib/ EXPOSE 26656 26657 1317 9090 diff --git a/Makefile b/Makefile index 19e24091..5fc7bb60 100644 --- a/Makefile +++ b/Makefile @@ -21,16 +21,19 @@ endif ldflags = -X github.com/umee-network/peggo/cmd/peggo.Version=$(VERSION) \ -X github.com/umee-network/peggo/cmd/peggo.Commit=$(COMMIT) \ -X github.com/umee-network/peggo/cmd/peggo.SDKVersion=$(SDK_VERSION) +ldflags += $(LDFLAGS) +ldflags := $(strip $(ldflags)) -BUILD_FLAGS := -ldflags '$(ldflags)' +build_tags += $(BUILD_TAGS) +BUILD_FLAGS := -tags "$(build_tags)" -ldflags '$(ldflags)' build: go.sum @echo "--> Building..." - CGO_ENABLED=0 go build -mod=readonly -o $(BUILD_DIR)/ $(BUILD_FLAGS) ./... + go build -mod=readonly $(BUILD_FLAGS) -o $(BUILD_DIR)/ ./... install: go.sum @echo "--> Installing..." - CGO_ENABLED=0 go install -mod=readonly $(BUILD_FLAGS) ./... + go install -mod=readonly $(BUILD_FLAGS) ./... .PHONY: build install @@ -47,7 +50,7 @@ test-unit: ARGS=-timeout=5m -tags='norace' test-unit: TEST_PACKAGES=$(PACKAGES_UNIT) test-unit-cover: ARGS=-timeout=5m -tags='norace' -coverprofile=coverage.txt -covermode=atomic test-unit-cover: TEST_PACKAGES=$(PACKAGES_UNIT) -test-e2e: ARGS=-timeout=25m -v +test-e2e: ARGS=-timeout=20m -v test-e2e: TEST_PACKAGES=$(PACKAGES_E2E) $(TEST_TARGETS): run-tests @@ -106,7 +109,7 @@ solidity-wrappers: $(SOLIDITY_DIR)/contracts/*.sol ############################################################################### docker-build: - @docker build -t umeenet/peggo . + @docker build -t umeenet/peggo --platform=linux/amd64 . docker-build-debug: @docker build -t umeenet/peggo --build-arg IMG_TAG=debug . diff --git a/cmd/peggo/orchestrator.go b/cmd/peggo/orchestrator.go index 15b74ce7..800d3f5f 100644 --- a/cmd/peggo/orchestrator.go +++ b/cmd/peggo/orchestrator.go @@ -21,7 +21,7 @@ import ( "golang.org/x/sync/errgroup" "google.golang.org/grpc" - umeepfprovider "github.com/umee-network/umee/price-feeder/oracle/provider" + umeepfprovider "github.com/umee-network/umee/price-feeder/v2/oracle/provider" "github.com/umee-network/peggo/cmd/peggo/client" "github.com/umee-network/peggo/orchestrator" @@ -295,7 +295,6 @@ func getOrchestratorCmd() *cobra.Command { umeepfprovider.ProviderHuobi.String(), umeepfprovider.ProviderOkx.String(), umeepfprovider.ProviderCoinbase.String(), - umeepfprovider.ProviderBinance.String(), umeepfprovider.ProviderBitget.String(), umeepfprovider.ProviderMexc.String(), umeepfprovider.ProviderCrypto.String(), @@ -304,8 +303,8 @@ func getOrchestratorCmd() *cobra.Command { allProviders := append([]string{ umeepfprovider.ProviderKraken.String(), umeepfprovider.ProviderGate.String(), - umeepfprovider.ProviderFTX.String(), umeepfprovider.ProviderMock.String(), + umeepfprovider.ProviderBinance.String(), }, defaultProviders...) cmd.Flags().StringSlice(flagOracleProviders, defaultProviders, diff --git a/contrib/images/Dockerfile b/contrib/images/Dockerfile index c48694ee..16444422 100644 --- a/contrib/images/Dockerfile +++ b/contrib/images/Dockerfile @@ -1,3 +1,5 @@ +## image for e2e tests + # Fetch base packages FROM golang:1.19-alpine AS builder ENV PACKAGES make git libc-dev gcc linux-headers diff --git a/go.mod b/go.mod index 09482794..5a6f00a5 100644 --- a/go.mod +++ b/go.mod @@ -24,7 +24,7 @@ require ( github.com/spf13/viper v1.14.0 github.com/stretchr/testify v1.8.1 github.com/tendermint/tendermint v0.34.24 - github.com/umee-network/umee/price-feeder v1.0.1-0.20221027015322-96357449c737 + github.com/umee-network/umee/price-feeder/v2 v2.0.2 github.com/umee-network/umee/v3 v3.3.0-rc1 golang.org/x/sync v0.1.0 golang.org/x/term v0.2.0 diff --git a/go.sum b/go.sum index a65b5eff..d9260498 100644 --- a/go.sum +++ b/go.sum @@ -1413,8 +1413,8 @@ github.com/umee-network/bech32-ibc v0.3.2 h1:T2QgfMVktA9iAYLYmhmcukJr5qoaEJgRLDo github.com/umee-network/bech32-ibc v0.3.2/go.mod h1:kbT1K+mxxzDkvmcsHtBXgM2meNv6AXroxPdSeWAcZE0= github.com/umee-network/cosmos-sdk v0.46.7-umee h1:6/JO17fjm1kxiFVjfblbNIRbilZcHV2WsC87iD63+kI= github.com/umee-network/cosmos-sdk v0.46.7-umee/go.mod h1:fqKqz39U5IlEFb4nbQ72951myztsDzFKKDtffYJ63nk= -github.com/umee-network/umee/price-feeder v1.0.1-0.20221027015322-96357449c737 h1:8NZaHAl6/Xoss6qfsUvxc6o9JZdPQzUS6ku87UvhJeQ= -github.com/umee-network/umee/price-feeder v1.0.1-0.20221027015322-96357449c737/go.mod h1:qtGLqvFnz9I9gJBpI3918hEIZZbeqJ3r2yJW/1fK8mM= +github.com/umee-network/umee/price-feeder/v2 v2.0.2 h1:pSCH5NAQVnTy1T+DBX2zXr9TtG8mP7VDHoygAvqMNK4= +github.com/umee-network/umee/price-feeder/v2 v2.0.2/go.mod h1:cpN8tgH0aby8FaEAVH5UgFjhKtgLBogHFTH8oXgIjkQ= github.com/umee-network/umee/v3 v3.3.0-rc1 h1:Wm1x42b3N0iY8THCNOyrA78CvImnW8CW7hyfLbcipvg= github.com/umee-network/umee/v3 v3.3.0-rc1/go.mod h1:AMWNhC28k/OPvTLf8IWTCS0eSJJ4A72AWFwt8UB2eaQ= github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= diff --git a/orchestrator/oracle/currency.go b/orchestrator/oracle/currency.go index 26c326ce..4a3f7cc8 100644 --- a/orchestrator/oracle/currency.go +++ b/orchestrator/oracle/currency.go @@ -3,7 +3,7 @@ package oracle import ( "strings" - umeepftypes "github.com/umee-network/umee/price-feeder/oracle/types" + umeepftypes "github.com/umee-network/umee/price-feeder/v2/oracle/types" ) const ( diff --git a/orchestrator/oracle/oracle.go b/orchestrator/oracle/oracle.go index dc2af344..7423f683 100644 --- a/orchestrator/oracle/oracle.go +++ b/orchestrator/oracle/oracle.go @@ -11,10 +11,10 @@ import ( "github.com/rs/zerolog" "golang.org/x/sync/errgroup" - pforacle "github.com/umee-network/umee/price-feeder/oracle" - pfprovider "github.com/umee-network/umee/price-feeder/oracle/provider" - pftypes "github.com/umee-network/umee/price-feeder/oracle/types" - pfsync "github.com/umee-network/umee/price-feeder/pkg/sync" + pforacle "github.com/umee-network/umee/price-feeder/v2/oracle" + pfprovider "github.com/umee-network/umee/price-feeder/v2/oracle/provider" + pftypes "github.com/umee-network/umee/price-feeder/v2/oracle/types" + pfsync "github.com/umee-network/umee/price-feeder/v2/pkg/sync" umeeparams "github.com/umee-network/umee/v3/app/params" )