Skip to content

Commit

Permalink
feat: update price-feeder dep to v2.0.2 and remove FTX (#412)
Browse files Browse the repository at this point in the history
+ remove FTX from supported price providers
+ removed Binance from default providers
+ use PriceFeeder v2 (may solve panic issues)
  • Loading branch information
robert-zaremba authored Dec 15, 2022
1 parent 328f55c commit fa1e763
Show file tree
Hide file tree
Showing 14 changed files with 50 additions and 51 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/debug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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/[email protected]
with:
Expand All @@ -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/[email protected]
Expand All @@ -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,
Expand Down
13 changes: 4 additions & 9 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: ./
Expand All @@ -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
Expand All @@ -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:
Expand All @@ -52,4 +47,4 @@ snapshot:
name_template: SNAPSHOT-{{ .Commit }}

changelog:
skip: true
skip: false
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down
33 changes: 15 additions & 18 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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
13 changes: 8 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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

Expand Down Expand Up @@ -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 .
Expand Down
5 changes: 2 additions & 3 deletions cmd/peggo/orchestrator.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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(),
Expand All @@ -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,
Expand Down
2 changes: 2 additions & 0 deletions contrib/images/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down
2 changes: 1 addition & 1 deletion orchestrator/oracle/currency.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
8 changes: 4 additions & 4 deletions orchestrator/oracle/oracle.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand Down

0 comments on commit fa1e763

Please sign in to comment.