Skip to content

Commit

Permalink
digital-ocean + adding more cps to the loadtests
Browse files Browse the repository at this point in the history
  • Loading branch information
nivasan1 committed Feb 21, 2024
1 parent bdb5310 commit 8894aaf
Show file tree
Hide file tree
Showing 14 changed files with 5,474 additions and 142 deletions.
12 changes: 9 additions & 3 deletions protocol/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# NB: This is a digest for a multi-arch manifest list, you will want to get this by running
# `docker buildx imagetools inspect golang:1.21-alpine`
ARG GOLANG_1_21_ALPINE_DIGEST="926f7f7e1ab8509b4e91d5ec6d5916ebb45155b0c8920291ba9f361d65385806"
ARG GOLANG_1_22_ALPINE_DIGEST="8e96e6cff6a388c2f70f5f662b64120941fcd7d4b89d62fec87520323a316bd9"

# This Dockerfile is a stateless build of the `dydxprotocold` binary as a Docker container.
# It does not include any configuration, state, or genesis information.
Expand All @@ -9,9 +9,10 @@ ARG GOLANG_1_21_ALPINE_DIGEST="926f7f7e1ab8509b4e91d5ec6d5916ebb45155b0c8920291b
# Builder
# --------------------------------------------------------

FROM golang@sha256:${GOLANG_1_21_ALPINE_DIGEST} as builder
FROM golang@sha256:${GOLANG_1_22_ALPINE_DIGEST} as builder
ARG VERSION
ARG COMMIT
ARG SLINKY_REF

# SkipSequenceIncrement is used to determine whether or not we should be building the binary to
# exclude the sequence number increment ante-handler from the app's ante-handler chain
Expand Down Expand Up @@ -49,13 +50,14 @@ RUN --mount=type=cache,target=/root/.cache/go-build \
WORKDIR /
RUN git clone https://github.com/skip-mev/slinky.git
WORKDIR /slinky
RUN git checkout ${SLINKY_REF}
RUN make build

# --------------------------------------------------------
# Runner
# --------------------------------------------------------

FROM golang@sha256:${GOLANG_1_21_ALPINE_DIGEST}
FROM golang@sha256:${GOLANG_1_22_ALPINE_DIGEST}

RUN apk add --no-cache bash

Expand All @@ -74,5 +76,9 @@ EXPOSE 26657
EXPOSE 1317
# grpc
EXPOSE 9090
# oracle server
EXPOSE 8080
# oracle metrics
EXPOSE 8010

ENTRYPOINT ["dydxprotocold"]
3 changes: 2 additions & 1 deletion protocol/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ HTTPS_GIT := https://github.com/dydxprotocol/v4.git
GO_VERSION := $(shell cat go.mod | grep -E 'go [0-9].[0-9]+' | cut -d ' ' -f 2)
PROJECT_NAME := $(shell git remote get-url origin | xargs basename -s .git)
CGO_ENABLED=1
SLINKY_REF=main
export GIT_COMMIT_HASH=$(shell git rev-parse --short HEAD)
export COMMIT=$(shell git rev-parse HEAD)

Expand Down Expand Up @@ -433,7 +434,7 @@ check-sample-pregenesis-up-to-date:
###############################################################################
loadtest-build:
@echo "Build loadtest test image at commit ${GIT_COMMIT_HASH}"
docker build --build-arg VERSION=$(VERSION) --build-arg COMMIT=$(COMMIT) . -t dydxprotocol-base --no-cache --build-arg BUILD_TAGS="netgo,ledger,muslc,skip_sequence_increment_ante_handler"
docker build --build-arg VERSION=$(VERSION) --build-arg COMMIT=$(COMMIT) --build-arg SLINKY_REF=$(SLINKY_REF) . -t dydxprotocol-base --no-cache --build-arg BUILD_TAGS="netgo,ledger,muslc,skip_sequence_increment_ante_handler"

loadtest-run:
@echo "Running loadtest at commit ${GIT_COMMIT_HASH}"
Expand Down
6 changes: 6 additions & 0 deletions protocol/app/vote_extensions/oracle_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,12 @@ func (o *OracleClient) Prices(ctx context.Context, in *oracleservicetypes.QueryP
if err != nil {
return nil, fmt.Errorf("slinky client returned price %s not parsable as uint64", priceString)
}

if price == 0 {
sdkCtx.Logger().Info("slinky client returned price 0 for market", "market id", uint32(id), "currency pair", currencyPairString)
continue
}

sdkCtx.Logger().Info("parsed update for", "market id", uint32(id), "price", price)

// append the update to the list of MarketPriceUpdates to be sent to the app's price-feed service
Expand Down
32 changes: 17 additions & 15 deletions protocol/go.mod
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
module github.com/dydxprotocol/v4-chain/protocol

go 1.21.3
go 1.22

toolchain go1.22.0

require (
cosmossdk.io/api v0.7.2
cosmossdk.io/api v0.7.3
cosmossdk.io/math v1.2.0
github.com/Shopify/sarama v1.37.2
github.com/cometbft/cometbft v0.38.5
github.com/cometbft/cometbft-db v0.9.1 // indirect
github.com/cosmos/cosmos-proto v1.0.0-beta.3
github.com/cosmos/cosmos-proto v1.0.0-beta.4
github.com/cosmos/cosmos-sdk v0.50.4-0.20240125183858-0abf94a334e3
github.com/cosmos/go-bip39 v1.0.0
github.com/cosmos/gogoproto v1.4.11
Expand All @@ -17,7 +19,7 @@ require (
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/mock v1.6.0
github.com/golang/protobuf v1.5.3
github.com/golangci/golangci-lint v1.56.1
github.com/golangci/golangci-lint v1.56.2
github.com/google/go-cmp v0.6.0
github.com/gorilla/mux v1.8.1
github.com/grpc-ecosystem/grpc-gateway v1.16.0
Expand All @@ -29,7 +31,7 @@ require (
github.com/spf13/cobra v1.8.0
github.com/spf13/pflag v1.0.5
github.com/stretchr/testify v1.8.4
github.com/vektra/mockery/v2 v2.40.3
github.com/vektra/mockery/v2 v2.42.0
github.com/zyedidia/generic v1.0.0
golang.org/x/exp v0.0.0-20240103183307-be819d1f06fc
google.golang.org/genproto v0.0.0-20231211222908-989df2bf70f3 // indirect
Expand Down Expand Up @@ -64,7 +66,7 @@ require (
github.com/pelletier/go-toml v1.9.5
github.com/rs/zerolog v1.32.0
github.com/shopspring/decimal v1.3.1
github.com/skip-mev/slinky v0.2.1-0.20240215174721-10e2684a3cc4
github.com/skip-mev/slinky v0.2.1-0.20240221163805-44b958a75ccd
github.com/spf13/viper v1.18.2
go.uber.org/zap v1.26.0
google.golang.org/genproto/googleapis/api v0.0.0-20231212172506-995d672761c0
Expand All @@ -88,7 +90,7 @@ require (
github.com/Abirdcfly/dupword v0.0.13 // indirect
github.com/Antonboom/errname v0.1.12 // indirect
github.com/Antonboom/nilnil v0.1.7 // indirect
github.com/Antonboom/testifylint v1.1.1 // indirect
github.com/Antonboom/testifylint v1.1.2 // indirect
github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 // indirect
github.com/BurntSushi/toml v1.3.2 // indirect
github.com/DataDog/datadog-go v4.8.2+incompatible // indirect
Expand Down Expand Up @@ -117,14 +119,14 @@ require (
github.com/bits-and-blooms/bitset v1.13.0 // indirect
github.com/bkielbasa/cyclop v1.2.1 // indirect
github.com/blizzy78/varnamelen v0.8.0 // indirect
github.com/bombsimon/wsl/v4 v4.2.0 // indirect
github.com/bombsimon/wsl/v4 v4.2.1 // indirect
github.com/breml/bidichk v0.2.7 // indirect
github.com/breml/errchkjson v0.3.6 // indirect
github.com/btcsuite/btcd/btcec/v2 v2.3.2 // indirect
github.com/butuzov/ireturn v0.3.0 // indirect
github.com/butuzov/mirror v1.1.0 // indirect
github.com/catenacyber/perfsprint v0.6.0 // indirect
github.com/ccojocar/zxcvbn-go v1.0.1 // indirect
github.com/ccojocar/zxcvbn-go v1.0.2 // indirect
github.com/cenkalti/backoff v2.2.1+incompatible // indirect
github.com/cenkalti/backoff/v4 v4.2.1 // indirect
github.com/cespare/xxhash v1.1.0 // indirect
Expand Down Expand Up @@ -179,7 +181,7 @@ require (
github.com/gabriel-vasile/mimetype v1.4.2 // indirect
github.com/getsentry/sentry-go v0.25.0 // indirect
github.com/ghostiam/protogetter v0.3.4 // indirect
github.com/go-critic/go-critic v0.11.0 // indirect
github.com/go-critic/go-critic v0.11.1 // indirect
github.com/go-kit/kit v0.13.0 // indirect
github.com/go-logfmt/logfmt v0.6.0 // indirect
github.com/go-ole/go-ole v1.2.6 // indirect
Expand All @@ -188,7 +190,7 @@ require (
github.com/go-stack/stack v1.8.1 // indirect
github.com/go-toolsmith/astcast v1.1.0 // indirect
github.com/go-toolsmith/astcopy v1.1.0 // indirect
github.com/go-toolsmith/astequal v1.1.0 // indirect
github.com/go-toolsmith/astequal v1.2.0 // indirect
github.com/go-toolsmith/astfmt v1.1.0 // indirect
github.com/go-toolsmith/astp v1.1.0 // indirect
github.com/go-toolsmith/strparse v1.1.0 // indirect
Expand All @@ -215,7 +217,7 @@ require (
github.com/google/pprof v0.0.0-20230228050547-1710fef4ab10 // indirect
github.com/google/s2a-go v0.1.7 // indirect
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect
github.com/google/uuid v1.4.0 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/googleapis/enterprise-certificate-proxy v0.3.2 // indirect
github.com/googleapis/gax-go/v2 v2.12.0 // indirect
github.com/gordonklaus/ineffassign v0.1.0 // indirect
Expand Down Expand Up @@ -335,8 +337,8 @@ require (
github.com/sanposhiho/wastedassign/v2 v2.0.7 // indirect
github.com/sasha-s/go-deadlock v0.3.1 // indirect
github.com/sashamelentyev/interfacebloat v1.1.0 // indirect
github.com/sashamelentyev/usestdlibvars v1.24.0 // indirect
github.com/securego/gosec/v2 v2.18.2 // indirect
github.com/sashamelentyev/usestdlibvars v1.25.0 // indirect
github.com/securego/gosec/v2 v2.19.0 // indirect
github.com/shazow/go-diff v0.0.0-20160112020656-b6b7b6733b8c // indirect
github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible // indirect
github.com/sirupsen/logrus v1.9.3 // indirect
Expand Down Expand Up @@ -393,7 +395,7 @@ require (
golang.org/x/term v0.17.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/time v0.5.0 // indirect
golang.org/x/tools v0.17.0 // indirect
golang.org/x/tools v0.18.0 // indirect
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect
google.golang.org/api v0.153.0 // indirect
google.golang.org/appengine v1.6.8 // indirect
Expand Down
Loading

0 comments on commit 8894aaf

Please sign in to comment.