diff --git a/.mergify.yml b/.mergify.yml index 900c3315..9d79ccb5 100644 --- a/.mergify.yml +++ b/.mergify.yml @@ -53,3 +53,12 @@ pull_request_rules: backport: branches: - release/v0.4.x + + - name: Backport patches to release/v1.0.x branch + conditions: + - base=main + - label=S:backport/v1.0.x + actions: + backport: + branches: + - release/v1.x.x diff --git a/cmd/peggo/orchestrator.go b/cmd/peggo/orchestrator.go index c51e7e77..47741992 100644 --- a/cmd/peggo/orchestrator.go +++ b/cmd/peggo/orchestrator.go @@ -276,10 +276,26 @@ func getOrchestratorCmd() *cobra.Command { cmd.Flags().Bool(flagRelayBatches, false, "Relay transaction batches to Ethereum") cmd.Flags().Int64(flagEthBlocksPerLoop, 2000, "Number of Ethereum blocks to process per orchestrator loop") cmd.Flags().String(flagCoinGeckoAPI, "https://api.coingecko.com/api/v3", "Specify the coingecko API endpoint") - //nolint: lll - cmd.Flags().StringSlice(flagOracleProviders, []string{string(umeepfprovider.ProviderBinance), string(umeepfprovider.ProviderKraken)}, - fmt.Sprintf("Specify the providers to use in the oracle, options \"%s\"", strings.Join([]string{string(umeepfprovider.ProviderBinance), string(umeepfprovider.ProviderHuobi), - string(umeepfprovider.ProviderKraken), string(umeepfprovider.ProviderGate), string(umeepfprovider.ProviderOkx), string(umeepfprovider.ProviderOsmosis)}, ","))) + + defaultProviders := []string{ + umeepfprovider.ProviderOsmosis.String(), + umeepfprovider.ProviderHuobi.String(), + umeepfprovider.ProviderOkx.String(), + umeepfprovider.ProviderCoinbase.String(), + umeepfprovider.ProviderBinance.String(), + umeepfprovider.ProviderBitget.String(), + umeepfprovider.ProviderMexc.String(), + } + + allProviders := append([]string{ + umeepfprovider.ProviderKraken.String(), + umeepfprovider.ProviderGate.String(), + umeepfprovider.ProviderFTX.String(), + umeepfprovider.ProviderMock.String(), + }, defaultProviders...) + + cmd.Flags().StringSlice(flagOracleProviders, defaultProviders, + fmt.Sprintf("Specify the providers to use in the oracle, options \"%s\"", strings.Join(allProviders, ","))) cmd.Flags().Duration(flagEthPendingTXWait, 20*time.Minute, "Time for a pending tx to be considered stale") cmd.Flags().String(flagEthAlchemyWS, "", "Specify the Alchemy websocket endpoint") cmd.Flags().Float64(flagProfitMultiplier, 1.0, "Multiplier to apply to relayer profit") diff --git a/orchestrator/oracle/oracle.go b/orchestrator/oracle/oracle.go index 6f2dcebc..5d397a55 100644 --- a/orchestrator/oracle/oracle.go +++ b/orchestrator/oracle/oracle.go @@ -6,6 +6,7 @@ import ( "sync" "time" + sdkmath "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/rs/zerolog" "golang.org/x/sync/errgroup" @@ -14,6 +15,7 @@ import ( 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" + umeeparams "github.com/umee-network/umee/v3/app/params" ) const ( @@ -273,7 +275,8 @@ func (o *Oracle) setPrices() error { if tickerErr != nil && candleErr != nil { // only generates error if ticker and candle generate errors - return fmt.Errorf("ticker error: %+v\ncandle error: %+v", tickerErr, candleErr) + o.logger.Debug().Msgf("provider: %s ticker error: %+v\ncandle error: %+v", providerName, tickerErr, candleErr) + return nil } // flatten and collect prices based on the base currency per provider @@ -300,12 +303,17 @@ func (o *Oracle) setPrices() error { o.logger.Debug().Err(err).Msg("failed to get ticker prices from provider") } + deviationTreshold := sdk.NewDecFromIntWithPrec(sdkmath.NewInt(15), 1) + computedPrices, err := pforacle.GetComputedPrices( o.logger, providerCandles, providerPrices, o.providerSubscribedPairs, - make(map[string]sdk.Dec, 0), // uses default deviation + map[string]sdk.Dec{ + SymbolETH: deviationTreshold, + umeeparams.BondDenom: deviationTreshold, + }, // uses default deviation for other bases ) if err != nil { return err diff --git a/test/cosmos/multinode.sh b/test/cosmos/multinode.sh index 162dc183..3d1637d7 100755 --- a/test/cosmos/multinode.sh +++ b/test/cosmos/multinode.sh @@ -239,7 +239,7 @@ fi # data dir check # Start the instances echo "Starting nodes..." -$NODE_BIN $home0 start --api.enable true --grpc.address="0.0.0.0:9090" --grpc-web.enable=false --log_level $LOG_LEVEL > $hdir.n0.log 2>&1 & +$NODE_BIN $home0 start --grpc.address="0.0.0.0:9090" --grpc-web.enable=false --log_level $LOG_LEVEL > $hdir.n0.log 2>&1 & $NODE_BIN $home1 start --grpc.address="0.0.0.0:9091" --grpc-web.enable=false --log_level $LOG_LEVEL > $hdir.n1.log 2>&1 & $NODE_BIN $home2 start --grpc.address="0.0.0.0:9092" --grpc-web.enable=false --log_level $LOG_LEVEL > $hdir.n2.log 2>&1 & diff --git a/test/eth/run_ganache.sh b/test/eth/run_ganache.sh index e59f2e63..ec4868b9 100755 --- a/test/eth/run_ganache.sh +++ b/test/eth/run_ganache.sh @@ -1,10 +1,12 @@ +#!/bin/bash -eux + CWD="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )" DATA_DIR=${DATA_DIR:-$CWD/data} rm -rf $DATA_DIR mkdir -p $DATA_DIR -ganache="ganache-cli" +ganache="ganache" if pgrep -x $ganache >/dev/null then @@ -12,11 +14,11 @@ then ps -ef | grep $ganache | grep -v grep | awk '{print $2}' | xargs kill fi -ganache-cli \ - --chain-id 888 \ +$ganache \ + --chain.chainId 888 \ --account '0x88cbead91aee890d27bf06e003ade3d4e952427e88f88d31d61d3ef5e5d54305,1000000000000000000' \ --account '0x741de4f8988ea941d3ff0287911ca4074e62b7d45c991a51186455366f10b544,1000000000000000000' \ --account '0x39a4c898dda351d54875d5ebb3e1c451189116faa556c3c04adc860dd1000608,1000000000000000000' \ --account '0x6c212553111b370a8ffdc682954495b7b90a73cedab7106323646a4f2c4e668f,1000000000000000000' \ - --blockTime 1 \ + --blockTime 1 \ > $DATA_DIR/ganache.log 2>&1 & \ No newline at end of file diff --git a/test/scripts/valset_update_2000_blocks.sh b/test/scripts/valset_update_2000_blocks.sh index 62fdf823..8e62fb45 100755 --- a/test/scripts/valset_update_2000_blocks.sh +++ b/test/scripts/valset_update_2000_blocks.sh @@ -1,9 +1,9 @@ -#!/bin/bash -eu +#!/bin/bash -eux CWD="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )" ETH_RPC=${ETH_RPC:-"http://127.0.0.1:8545"} UMMED_BUILD_PATH=$CWD/../umeed-builds -UMEED_BIN=${UMEED_BIN:-$UMMED_BUILD_PATH/umeed-main} +UMEED_BIN=${UMEED_BIN:-$UMMED_BUILD_PATH/umeed-rc4} PEGGO_BUILD_PATH=$CWD/../../build PEGGO_BIN=${PEGGO_BIN:-$PEGGO_BUILD_PATH/peggo} CHAIN_ID="${CHAIN_ID:-888}" @@ -18,7 +18,7 @@ n1dir="$hdir/n1" n2dir="$hdir/n2" umeeBasename=$(basename $UMEED_BIN) -ganache="ganache-cli" +ganache="ganache" # Common flags kbt="--keyring-backend test" @@ -71,18 +71,21 @@ PEGGO_ETH_PK=$val0PrivateKey $PEGGO_BIN orchestrator $bridgeAddr \ $defaultFlags \ --cosmos-grpc="tcp://0.0.0.0:9090" \ --tendermint-rpc="http://0.0.0.0:26657" \ + --oracle-providers="osmosis,huobi,okx,coinbase,binance,bitget,mexc" \ --cosmos-keyring-dir=$n0dir > $peggoLogPath/n0.peggo.log 2>&1 & -PEGGO_ETH_PK=$val1PrivateKey $PEGGO_BIN orchestrator $bridgeAddr \ +# PEGGO_ETH_PK=$val1PrivateKey $PEGGO_BIN orchestrator $bridgeAddr \ $defaultFlags \ --cosmos-grpc="tcp://0.0.0.0:9091" \ --tendermint-rpc="http://0.0.0.0:26667" \ + --oracle-providers="kraken,osmosis,huobi,okx,coinbase,binance,bitget,mexc" \ --cosmos-keyring-dir=$n1dir > $peggoLogPath/n1.peggo.log 2>&1 & PEGGO_ETH_PK=$val2PrivateKey $PEGGO_BIN orchestrator $bridgeAddr \ $defaultFlags \ --cosmos-grpc="tcp://0.0.0.0:9092" \ --tendermint-rpc="http://0.0.0.0:26677" \ + --oracle-providers="kraken,osmosis,huobi,okx,coinbase,binance,bitget,mexc" \ --cosmos-keyring-dir=$n2dir > $peggoLogPath/n2.peggo.log 2>&1 & echo Wait for a few seconds to get the current valset