Skip to content

Commit

Permalink
Upgrade slinky to 1.0.8 (backport #2069) (#2070)
Browse files Browse the repository at this point in the history
Co-authored-by: Chenyao Yu <[email protected]>
Co-authored-by: Vincent Chau <[email protected]>
  • Loading branch information
3 people authored Aug 9, 2024
1 parent 67191b6 commit 26fac9c
Show file tree
Hide file tree
Showing 5 changed files with 61 additions and 127 deletions.
4 changes: 2 additions & 2 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_22_ALPINE_DIGEST="8e96e6cff6a388c2f70f5f662b64120941fcd7d4b89d62fec87520323a316bd9"
# `docker buildx imagetools inspect golang:1.22.2-alpine`
ARG GOLANG_1_22_ALPINE_DIGEST="cdc86d9f363e8786845bea2040312b4efa321b828acdeb26f393faa864d887b0"

# 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 Down
22 changes: 2 additions & 20 deletions protocol/app/upgrades/v6.0.0/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,10 @@ import (
revsharetypes "github.com/dydxprotocol/v4-chain/protocol/x/revshare/types"
vaultkeeper "github.com/dydxprotocol/v4-chain/protocol/x/vault/keeper"
vaulttypes "github.com/dydxprotocol/v4-chain/protocol/x/vault/types"
"github.com/skip-mev/slinky/oracle/config"
"github.com/skip-mev/slinky/providers/apis/dydx"
dydx "github.com/skip-mev/slinky/providers/apis/dydx"
dydxtypes "github.com/skip-mev/slinky/providers/apis/dydx/types"
marketmapkeeper "github.com/skip-mev/slinky/x/marketmap/keeper"
marketmaptypes "github.com/skip-mev/slinky/x/marketmap/types"
"go.uber.org/zap"

sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/module"
Expand Down Expand Up @@ -67,22 +65,6 @@ func setMarketMapParams(ctx sdk.Context, mmk marketmapkeeper.Keeper) {
}

func migratePricesToMarketMap(ctx sdk.Context, pk pricestypes.PricesKeeper, mmk marketmapkeeper.Keeper) {
// fill out config with dummy variables to pass validation. This handler is only used to run the
// ConvertMarketParamsToMarketMap member function.
h, err := dydx.NewAPIHandler(zap.NewNop(), config.APIConfig{
Enabled: true,
Timeout: 1,
Interval: 1,
ReconnectTimeout: 1,
MaxQueries: 1,
Atomic: false,
Endpoints: []config.Endpoint{{URL: "upgrade"}},
BatchSize: 0,
Name: dydx.Name,
})
if err != nil {
panic(fmt.Sprintf("Failed to construct dydx handler %v", err))
}
allMarketParams := pk.GetAllMarketParams(ctx)
var mpr dydxtypes.QueryAllMarketParamsResponse
for _, mp := range allMarketParams {
Expand All @@ -95,7 +77,7 @@ func migratePricesToMarketMap(ctx sdk.Context, pk pricestypes.PricesKeeper, mmk
ExchangeConfigJson: mp.ExchangeConfigJson,
})
}
mm, err := h.ConvertMarketParamsToMarketMap(mpr)
mm, err := dydx.ConvertMarketParamsToMarketMap(mpr)
if err != nil {
panic(fmt.Sprintf("Couldn't convert markets %v", err))
}
Expand Down
47 changes: 22 additions & 25 deletions protocol/go.mod
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
module github.com/dydxprotocol/v4-chain/protocol

go 1.22

toolchain go1.22.0
go 1.22.2

require (
cosmossdk.io/api v0.7.5
cosmossdk.io/math v1.3.0
github.com/Shopify/sarama v1.37.2
github.com/cometbft/cometbft v0.38.10
github.com/cometbft/cometbft-db v0.10.0 // indirect
github.com/cometbft/cometbft-db v0.12.0 // indirect
github.com/cosmos/cosmos-proto v1.0.0-beta.5
github.com/cosmos/cosmos-sdk v0.50.8
github.com/cosmos/cosmos-sdk v0.50.9
github.com/cosmos/go-bip39 v1.0.0
github.com/cosmos/gogoproto v1.5.0
github.com/cosmos/gogoproto v1.6.0
github.com/go-playground/validator/v10 v10.14.0
github.com/gofrs/flock v0.8.1
github.com/gogo/protobuf v1.3.2 // indirect
Expand All @@ -28,50 +26,49 @@ require (
github.com/ory/dockertest v3.3.5+incompatible
github.com/pkg/errors v0.9.1
github.com/rakyll/statik v0.1.7
github.com/spf13/cast v1.6.0
github.com/spf13/cast v1.7.0
github.com/spf13/cobra v1.8.1
github.com/spf13/pflag v1.0.5
github.com/stretchr/testify v1.9.0
github.com/vektra/mockery/v2 v2.43.2
github.com/vektra/mockery/v2 v2.44.1
github.com/zyedidia/generic v1.0.0
golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842
golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56
google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de // indirect
google.golang.org/grpc v1.65.0
gopkg.in/DataDog/dd-trace-go.v1 v1.48.0
gopkg.in/typ.v4 v4.1.0
)

require (
cosmossdk.io/client/v2 v2.0.0-beta.1
cosmossdk.io/client/v2 v2.0.0-beta.4
cosmossdk.io/core v0.12.0
cosmossdk.io/errors v1.0.1
cosmossdk.io/log v1.3.1
cosmossdk.io/log v1.4.0
cosmossdk.io/store v1.1.0
cosmossdk.io/tools/confix v0.1.1
cosmossdk.io/x/circuit v0.1.1
cosmossdk.io/x/evidence v0.1.0
cosmossdk.io/x/feegrant v0.1.0
cosmossdk.io/x/tx v0.13.3
cosmossdk.io/x/upgrade v0.1.3
cosmossdk.io/x/tx v0.13.4
cosmossdk.io/x/upgrade v0.1.4
github.com/burdiyan/kafkautil v0.0.0-20190131162249-eaf83ed22d5b
github.com/cosmos/cosmos-db v1.0.2
github.com/cosmos/iavl v1.1.2
github.com/cosmos/ibc-go/modules/capability v1.0.0
github.com/cosmos/ibc-go/v8 v8.2.0
github.com/cosmos/ibc-go/v8 v8.3.2
github.com/cosmos/rosetta v0.50.3
github.com/deckarep/golang-set/v2 v2.6.0
github.com/ethereum/go-ethereum v1.14.7
github.com/go-kit/log v0.2.1
github.com/hashicorp/go-metrics v0.5.3
github.com/ory/dockertest/v3 v3.10.0
github.com/pelletier/go-toml v1.9.5
github.com/rs/zerolog v1.32.0
github.com/rs/zerolog v1.33.0
github.com/shopspring/decimal v1.3.1
github.com/skip-mev/slinky v1.0.5-0.20240724231039-9f85f7f0f7cb
github.com/skip-mev/slinky v1.0.8
github.com/spf13/viper v1.19.0
github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d
go.uber.org/zap v1.27.0
google.golang.org/genproto/googleapis/api v0.0.0-20240528184218-531527333157
google.golang.org/genproto/googleapis/api v0.0.0-20240725223205-93522f1f2a9f
google.golang.org/protobuf v1.34.2
gotest.tools/v3 v3.5.1
)
Expand Down Expand Up @@ -136,7 +133,6 @@ require (
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
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/charithe/durationcheck v0.0.10 // indirect
github.com/chavacava/garif v0.1.0 // indirect
Expand All @@ -157,7 +153,7 @@ require (
github.com/cosmos/btcutil v1.0.5 // indirect
github.com/cosmos/gogogateway v1.2.0 // indirect
github.com/cosmos/ics23/go v0.10.0 // indirect
github.com/cosmos/interchain-security/v5 v5.0.0 // indirect
github.com/cosmos/interchain-security/v5 v5.1.1 // indirect
github.com/cosmos/ledger-cosmos-go v0.13.3 // indirect
github.com/cosmos/rosetta-sdk-go v0.10.0 // indirect
github.com/crate-crypto/go-kzg-4844 v1.0.0 // indirect
Expand All @@ -171,9 +167,8 @@ require (
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect
github.com/denis-tingaikin/go-header v0.5.0 // indirect
github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f // indirect
github.com/dgraph-io/badger/v2 v2.2007.4 // indirect
github.com/dgraph-io/badger/v4 v4.2.0 // indirect
github.com/dgraph-io/ristretto v0.1.1 // indirect
github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 // indirect
github.com/docker/cli v23.0.1+incompatible // indirect
github.com/docker/docker v23.0.1+incompatible // indirect
github.com/docker/go-connections v0.4.0 // indirect
Expand Down Expand Up @@ -230,6 +225,7 @@ require (
github.com/golangci/revgrep v0.5.3 // indirect
github.com/golangci/unconvert v0.0.0-20240309020433-c5143eacb3ed // indirect
github.com/google/btree v1.1.2 // indirect
github.com/google/flatbuffers v2.0.8+incompatible // indirect
github.com/google/orderedcode v0.0.1 // indirect
github.com/google/pprof v0.0.0-20240424215950-a892ee059fd6 // indirect
github.com/google/s2a-go v0.1.7 // indirect
Expand Down Expand Up @@ -410,7 +406,7 @@ require (
gitlab.com/bosi/decorder v0.4.2 // indirect
go-simpler.org/musttag v0.12.2 // indirect
go-simpler.org/sloglint v0.7.1 // indirect
go.etcd.io/bbolt v1.3.8 // indirect
go.etcd.io/bbolt v1.4.0-alpha.0.0.20240404170359-43604f3112c5 // indirect
go.mongodb.org/mongo-driver v1.11.0 // indirect
go.opencensus.io v0.24.0 // indirect
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.49.0 // indirect
Expand All @@ -421,19 +417,20 @@ require (
go.uber.org/automaxprocs v1.5.3 // indirect
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/ratelimit v0.2.0 // indirect
go.uber.org/zap v1.27.0 // indirect
golang.org/x/crypto v0.25.0 // indirect
golang.org/x/exp/typeparams v0.0.0-20240314144324-c7f7c6466f7f // indirect
golang.org/x/mod v0.19.0 // indirect
golang.org/x/net v0.27.0 // indirect
golang.org/x/oauth2 v0.20.0 // indirect
golang.org/x/sync v0.7.0 // indirect
golang.org/x/sync v0.8.0 // indirect
golang.org/x/sys v0.22.0 // indirect
golang.org/x/term v0.22.0 // indirect
golang.org/x/text v0.16.0 // indirect
golang.org/x/time v0.5.0 // indirect
golang.org/x/tools v0.23.0 // indirect
google.golang.org/api v0.171.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240709173604-40e1e62336c5 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240722135656-d784300faade // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
Expand Down
Loading

0 comments on commit 26fac9c

Please sign in to comment.