From 019525429c648361ae88109a5f25eff2594f10b1 Mon Sep 17 00:00:00 2001 From: Chenyao Yu <4844716+chenyaoy@users.noreply.github.com> Date: Thu, 12 Dec 2024 22:08:05 -0500 Subject: [PATCH 01/13] Downgrade connect v2 to slinky --- protocol/app/ante/market_update.go | 7 +- protocol/app/ante/market_update_test.go | 4 +- protocol/app/ante/replay_protection.go | 2 +- protocol/app/app.go | 26 +++--- protocol/app/app_test.go | 2 +- protocol/app/basic_manager/basic_manager.go | 2 +- protocol/app/module_accounts.go | 2 +- protocol/app/module_accounts_test.go | 2 +- protocol/app/msgs/all_msgs.go | 28 +++---- protocol/app/msgs/normal_msgs.go | 32 +++---- protocol/app/msgs/normal_msgs_test.go | 28 +++---- protocol/app/prepare/prepare_proposal.go | 2 +- protocol/app/prepare/prepare_proposal_test.go | 14 ++-- .../prices/slinky_price_update_generator.go | 8 +- .../slinky_price_update_generator_test.go | 14 ++-- .../process/slinky_market_price_decoder.go | 2 +- .../slinky_market_price_decoder_test.go | 2 +- protocol/app/upgrades/v6.0.0/constants.go | 4 +- protocol/app/upgrades/v6.0.0/upgrade.go | 8 +- .../app/vote_extensions/expected_keepers.go | 5 +- .../vote_extensions/extend_vote_handler.go | 5 +- protocol/app/vote_extensions/oracle_client.go | 2 +- .../app/vote_extensions/oracle_client_test.go | 2 +- protocol/cmd/dydxprotocold/cmd/config.go | 2 +- protocol/contrib/connect/oracle.json | 26 ------ protocol/daemons/flags/flags.go | 2 +- .../client/price_function/exchange_error.go | 3 +- protocol/daemons/slinky/client/client.go | 2 +- protocol/daemons/slinky/client/client_test.go | 2 +- .../slinky/client/market_pair_fetcher.go | 2 +- .../slinky/client/market_pair_fetcher_test.go | 2 +- .../daemons/slinky/client/price_fetcher.go | 6 +- .../slinky/client/price_fetcher_test.go | 2 +- .../slinky/client/sidecar_version_checker.go | 4 +- .../client/sidecar_version_checker_test.go | 2 +- protocol/docker-compose.yml | 20 ++--- protocol/go.mod | 42 +++++----- protocol/go.sum | 84 +++++++++---------- protocol/lib/ante/nested_msg.go | 12 +-- protocol/lib/ante/nested_msg_test.go | 34 ++++---- protocol/lib/marketmap/utils.go | 6 +- protocol/lib/marketmap/utils_test.go | 4 +- protocol/lib/slinky/utils.go | 2 +- protocol/lib/slinky/utils_test.go | 2 +- .../testing/e2e/gov/add_new_market_test.go | 2 +- protocol/testing/e2e/gov/perpetuals_test.go | 4 +- protocol/testing/e2e/gov/prices_test.go | 2 +- protocol/testutil/app/app.go | 2 +- protocol/testutil/constants/marketmap.go | 4 +- protocol/testutil/keeper/clob.go | 2 +- protocol/testutil/keeper/listing.go | 2 +- protocol/testutil/keeper/marketmap.go | 4 +- protocol/testutil/keeper/perpetuals.go | 2 +- protocol/testutil/keeper/prices.go | 2 +- protocol/testutil/msgs/nested_msgs.go | 10 +-- protocol/testutil/network/network.go | 2 +- protocol/testutil/prices/cli/util.go | 2 +- protocol/x/clob/keeper/process_operations.go | 2 +- protocol/x/clob/module_test.go | 2 +- protocol/x/delaymsg/keeper/delayed_message.go | 4 +- protocol/x/listing/keeper/listing.go | 13 ++- protocol/x/listing/keeper/listing_test.go | 6 +- .../msg_create_market_permissionless_test.go | 6 +- protocol/x/listing/types/expected_keepers.go | 9 +- protocol/x/prices/keeper/market.go | 31 ++++--- protocol/x/prices/keeper/market_param.go | 6 +- protocol/x/prices/keeper/market_param_test.go | 6 +- protocol/x/prices/keeper/market_test.go | 5 +- .../msg_server_create_oracle_market_test.go | 4 +- protocol/x/prices/keeper/slinky_adapter.go | 38 ++++----- .../x/prices/keeper/slinky_adapter_test.go | 2 +- protocol/x/prices/module_test.go | 2 +- protocol/x/prices/simulation/genesis.go | 2 +- protocol/x/prices/types/expected_keepers.go | 10 +-- protocol/x/prices/types/types.go | 14 ++-- protocol/x/vault/keeper/orders.go | 2 +- protocol/x/vest/types/vest_entry.go | 10 +-- 77 files changed, 314 insertions(+), 364 deletions(-) delete mode 100644 protocol/contrib/connect/oracle.json diff --git a/protocol/app/ante/market_update.go b/protocol/app/ante/market_update.go index 6b4ae40bcf..9575f4da49 100644 --- a/protocol/app/ante/market_update.go +++ b/protocol/app/ante/market_update.go @@ -1,15 +1,14 @@ package ante import ( - "context" "errors" "fmt" + slinkytypes "github.com/skip-mev/slinky/pkg/types" errorsmod "cosmossdk.io/errors" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - slinkytypes "github.com/skip-mev/connect/v2/pkg/types" - mmtypes "github.com/skip-mev/connect/v2/x/marketmap/types" + mmtypes "github.com/skip-mev/slinky/x/marketmap/types" slinkylibs "github.com/dydxprotocol/v4-chain/protocol/lib/slinky" perpetualstypes "github.com/dydxprotocol/v4-chain/protocol/x/perpetuals/types" @@ -20,7 +19,7 @@ var ErrRestrictedMarketUpdates = errors.New("cannot call MsgUpdateMarkets or Msg "on a restricted market") type MarketMapKeeper interface { - GetAllMarkets(ctx context.Context) (map[string]mmtypes.Market, error) + GetAllMarkets(ctx sdk.Context) (map[string]mmtypes.Market, error) } var ( diff --git a/protocol/app/ante/market_update_test.go b/protocol/app/ante/market_update_test.go index d8e804e11f..aa240b6df7 100644 --- a/protocol/app/ante/market_update_test.go +++ b/protocol/app/ante/market_update_test.go @@ -14,8 +14,8 @@ import ( "github.com/cosmos/cosmos-sdk/types/tx/signing" xauthsigning "github.com/cosmos/cosmos-sdk/x/auth/signing" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" - "github.com/skip-mev/connect/v2/pkg/types" - mmtypes "github.com/skip-mev/connect/v2/x/marketmap/types" + "github.com/skip-mev/slinky/pkg/types" + mmtypes "github.com/skip-mev/slinky/x/marketmap/types" "github.com/stretchr/testify/require" "github.com/dydxprotocol/v4-chain/protocol/app/ante" diff --git a/protocol/app/ante/replay_protection.go b/protocol/app/ante/replay_protection.go index 0514e62e6e..d2fb6a25bd 100644 --- a/protocol/app/ante/replay_protection.go +++ b/protocol/app/ante/replay_protection.go @@ -86,7 +86,7 @@ func (rpd ReplayProtectionDecorator) AnteHandle( 1, []gometrics.Label{metrics.GetLabelForIntValue(metrics.ExecMode, int(ctx.ExecMode()))}, ) - return ctx, errorsmod.Wrap(sdkerrors.ErrWrongSequence, err.Error()) + return ctx, errorsmod.Wrapf(sdkerrors.ErrWrongSequence, err.Error()) } telemetry.IncrCounterWithLabels( []string{metrics.TimestampNonce, metrics.Valid, metrics.Count}, diff --git a/protocol/app/app.go b/protocol/app/app.go index f23d5a13ad..cfc97cd4b5 100644 --- a/protocol/app/app.go +++ b/protocol/app/app.go @@ -198,9 +198,9 @@ import ( vestmodule "github.com/dydxprotocol/v4-chain/protocol/x/vest" vestmodulekeeper "github.com/dydxprotocol/v4-chain/protocol/x/vest/keeper" vestmoduletypes "github.com/dydxprotocol/v4-chain/protocol/x/vest/types" - marketmapmodule "github.com/skip-mev/connect/v2/x/marketmap" - marketmapmodulekeeper "github.com/skip-mev/connect/v2/x/marketmap/keeper" - marketmapmoduletypes "github.com/skip-mev/connect/v2/x/marketmap/types" + marketmapmodule "github.com/skip-mev/slinky/x/marketmap" + marketmapmodulekeeper "github.com/skip-mev/slinky/x/marketmap/keeper" + marketmapmoduletypes "github.com/skip-mev/slinky/x/marketmap/types" // IBC ica "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts" @@ -225,16 +225,16 @@ import ( "github.com/dydxprotocol/v4-chain/protocol/indexer/msgsender" // Slinky - slinkyproposals "github.com/skip-mev/connect/v2/abci/proposals" - "github.com/skip-mev/connect/v2/abci/strategies/aggregator" - compression "github.com/skip-mev/connect/v2/abci/strategies/codec" - "github.com/skip-mev/connect/v2/abci/strategies/currencypair" - "github.com/skip-mev/connect/v2/abci/ve" - oracleconfig "github.com/skip-mev/connect/v2/oracle/config" - "github.com/skip-mev/connect/v2/pkg/math/voteweighted" - oracleclient "github.com/skip-mev/connect/v2/service/clients/oracle" - servicemetrics "github.com/skip-mev/connect/v2/service/metrics" - promserver "github.com/skip-mev/connect/v2/service/servers/prometheus" + slinkyproposals "github.com/skip-mev/slinky/abci/proposals" + "github.com/skip-mev/slinky/abci/strategies/aggregator" + compression "github.com/skip-mev/slinky/abci/strategies/codec" + "github.com/skip-mev/slinky/abci/strategies/currencypair" + "github.com/skip-mev/slinky/abci/ve" + oracleconfig "github.com/skip-mev/slinky/oracle/config" + "github.com/skip-mev/slinky/pkg/math/voteweighted" + oracleclient "github.com/skip-mev/slinky/service/clients/oracle" + servicemetrics "github.com/skip-mev/slinky/service/metrics" + promserver "github.com/skip-mev/slinky/service/servers/prometheus" // Full Node Streaming streaming "github.com/dydxprotocol/v4-chain/protocol/streaming" diff --git a/protocol/app/app_test.go b/protocol/app/app_test.go index a0130d2167..db4bba13a3 100644 --- a/protocol/app/app_test.go +++ b/protocol/app/app_test.go @@ -6,7 +6,7 @@ import ( "testing" "time" - marketmapmodule "github.com/skip-mev/connect/v2/x/marketmap" + marketmapmodule "github.com/skip-mev/slinky/x/marketmap" evidencemodule "cosmossdk.io/x/evidence" feegrantmodule "cosmossdk.io/x/feegrant/module" diff --git a/protocol/app/basic_manager/basic_manager.go b/protocol/app/basic_manager/basic_manager.go index dd9122a5a7..c4d17251ca 100644 --- a/protocol/app/basic_manager/basic_manager.go +++ b/protocol/app/basic_manager/basic_manager.go @@ -42,7 +42,7 @@ import ( subaccountsmodule "github.com/dydxprotocol/v4-chain/protocol/x/subaccounts" vaultmodule "github.com/dydxprotocol/v4-chain/protocol/x/vault" vestmodule "github.com/dydxprotocol/v4-chain/protocol/x/vest" - marketmapmodule "github.com/skip-mev/connect/v2/x/marketmap" + marketmapmodule "github.com/skip-mev/slinky/x/marketmap" ica "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts" "github.com/cosmos/ibc-go/v8/modules/apps/transfer" diff --git a/protocol/app/module_accounts.go b/protocol/app/module_accounts.go index 920e5ebd4c..c699218c8e 100644 --- a/protocol/app/module_accounts.go +++ b/protocol/app/module_accounts.go @@ -15,7 +15,7 @@ import ( satypes "github.com/dydxprotocol/v4-chain/protocol/x/subaccounts/types" vaultmoduletypes "github.com/dydxprotocol/v4-chain/protocol/x/vault/types" vestmoduletypes "github.com/dydxprotocol/v4-chain/protocol/x/vest/types" - marketmapmoduletypes "github.com/skip-mev/connect/v2/x/marketmap/types" + marketmapmoduletypes "github.com/skip-mev/slinky/x/marketmap/types" "golang.org/x/exp/maps" ) diff --git a/protocol/app/module_accounts_test.go b/protocol/app/module_accounts_test.go index 6585a4c8c7..097d379943 100644 --- a/protocol/app/module_accounts_test.go +++ b/protocol/app/module_accounts_test.go @@ -18,7 +18,7 @@ import ( satypes "github.com/dydxprotocol/v4-chain/protocol/x/subaccounts/types" vaultmoduletypes "github.com/dydxprotocol/v4-chain/protocol/x/vault/types" vestmoduletypes "github.com/dydxprotocol/v4-chain/protocol/x/vest/types" - marketmapmoduletypes "github.com/skip-mev/connect/v2/x/marketmap/types" + marketmapmoduletypes "github.com/skip-mev/slinky/x/marketmap/types" ) func TestModuleAccountsToAddresses(t *testing.T) { diff --git a/protocol/app/msgs/all_msgs.go b/protocol/app/msgs/all_msgs.go index 357d9c0218..953373b23b 100644 --- a/protocol/app/msgs/all_msgs.go +++ b/protocol/app/msgs/all_msgs.go @@ -8,20 +8,6 @@ var ( // AllTypeMessages is a list of all messages and types that are used in the app. // This list comes from the app's `InterfaceRegistry`. AllTypeMessages = map[string]struct{}{ - // connect marketmap messages - "/connect.marketmap.v2.MsgCreateMarkets": {}, - "/connect.marketmap.v2.MsgCreateMarketsResponse": {}, - "/connect.marketmap.v2.MsgParams": {}, - "/connect.marketmap.v2.MsgParamsResponse": {}, - "/connect.marketmap.v2.MsgRemoveMarkets": {}, - "/connect.marketmap.v2.MsgRemoveMarketsResponse": {}, - "/connect.marketmap.v2.MsgRemoveMarketAuthorities": {}, - "/connect.marketmap.v2.MsgRemoveMarketAuthoritiesResponse": {}, - "/connect.marketmap.v2.MsgUpdateMarkets": {}, - "/connect.marketmap.v2.MsgUpdateMarketsResponse": {}, - "/connect.marketmap.v2.MsgUpsertMarkets": {}, - "/connect.marketmap.v2.MsgUpsertMarketsResponse": {}, - // auth "/cosmos.auth.v1beta1.BaseAccount": {}, "/cosmos.auth.v1beta1.ModuleAccount": {}, @@ -407,6 +393,20 @@ var ( "/ibc.applications.interchain_accounts.controller.v1.MsgUpdateParamsResponse": {}, "/ibc.applications.interchain_accounts.host.v1.MsgUpdateParams": {}, "/ibc.applications.interchain_accounts.host.v1.MsgUpdateParamsResponse": {}, + + // slinky marketmap messages + "/slinky.marketmap.v1.MsgCreateMarkets": {}, + "/slinky.marketmap.v1.MsgCreateMarketsResponse": {}, + "/slinky.marketmap.v1.MsgParams": {}, + "/slinky.marketmap.v1.MsgParamsResponse": {}, + "/slinky.marketmap.v1.MsgRemoveMarkets": {}, + "/slinky.marketmap.v1.MsgRemoveMarketsResponse": {}, + "/slinky.marketmap.v1.MsgRemoveMarketAuthorities": {}, + "/slinky.marketmap.v1.MsgRemoveMarketAuthoritiesResponse": {}, + "/slinky.marketmap.v1.MsgUpdateMarkets": {}, + "/slinky.marketmap.v1.MsgUpdateMarketsResponse": {}, + "/slinky.marketmap.v1.MsgUpsertMarkets": {}, + "/slinky.marketmap.v1.MsgUpsertMarketsResponse": {}, } // DisallowMsgs are messages that cannot be externally submitted. diff --git a/protocol/app/msgs/normal_msgs.go b/protocol/app/msgs/normal_msgs.go index 6b4dfb18a5..ead7a9aa66 100644 --- a/protocol/app/msgs/normal_msgs.go +++ b/protocol/app/msgs/normal_msgs.go @@ -23,12 +23,12 @@ import ( listing "github.com/dydxprotocol/v4-chain/protocol/x/listing/types" sending "github.com/dydxprotocol/v4-chain/protocol/x/sending/types" vault "github.com/dydxprotocol/v4-chain/protocol/x/vault/types" - marketmapmoduletypes "github.com/skip-mev/connect/v2/x/marketmap/types" + marketmapmoduletypes "github.com/skip-mev/slinky/x/marketmap/types" ) var ( // NormalMsgs are messages that can be submitted by external users. - NormalMsgs = lib.MergeAllMapsMustHaveDistinctKeys(NormalMsgsDefault, NormalMsgsDydxCustom, NormalMsgsConnect) + NormalMsgs = lib.MergeAllMapsMustHaveDistinctKeys(NormalMsgsDefault, NormalMsgsDydxCustom, NormalMsgsSlinky) // Default modules NormalMsgsDefault = map[string]sdk.Msg{ @@ -267,19 +267,19 @@ var ( "/dydxprotocol.vault.MsgWithdrawFromMegavaultResponse": nil, } - NormalMsgsConnect = map[string]sdk.Msg{ - // connect marketmap messages - "/connect.marketmap.v2.MsgCreateMarkets": &marketmapmoduletypes.MsgCreateMarkets{}, - "/connect.marketmap.v2.MsgCreateMarketsResponse": nil, - "/connect.marketmap.v2.MsgParams": &marketmapmoduletypes.MsgParams{}, - "/connect.marketmap.v2.MsgParamsResponse": nil, - "/connect.marketmap.v2.MsgRemoveMarketAuthorities": &marketmapmoduletypes.MsgRemoveMarketAuthorities{}, - "/connect.marketmap.v2.MsgRemoveMarketAuthoritiesResponse": nil, - "/connect.marketmap.v2.MsgRemoveMarkets": &marketmapmoduletypes.MsgRemoveMarkets{}, - "/connect.marketmap.v2.MsgRemoveMarketsResponse": nil, - "/connect.marketmap.v2.MsgUpdateMarkets": &marketmapmoduletypes.MsgUpdateMarkets{}, - "/connect.marketmap.v2.MsgUpdateMarketsResponse": nil, - "/connect.marketmap.v2.MsgUpsertMarkets": &marketmapmoduletypes.MsgUpsertMarkets{}, - "/connect.marketmap.v2.MsgUpsertMarketsResponse": nil, + NormalMsgsSlinky = map[string]sdk.Msg{ + // slinky marketmap messages + "/slinky.marketmap.v1.MsgCreateMarkets": &marketmapmoduletypes.MsgCreateMarkets{}, + "/slinky.marketmap.v1.MsgCreateMarketsResponse": nil, + "/slinky.marketmap.v1.MsgParams": &marketmapmoduletypes.MsgParams{}, + "/slinky.marketmap.v1.MsgParamsResponse": nil, + "/slinky.marketmap.v1.MsgRemoveMarketAuthorities": &marketmapmoduletypes.MsgRemoveMarketAuthorities{}, + "/slinky.marketmap.v1.MsgRemoveMarkets": &marketmapmoduletypes.MsgRemoveMarkets{}, + "/slinky.marketmap.v1.MsgRemoveMarketsResponse": nil, + "/slinky.marketmap.v1.MsgRemoveMarketAuthoritiesResponse": nil, + "/slinky.marketmap.v1.MsgUpdateMarkets": &marketmapmoduletypes.MsgUpdateMarkets{}, + "/slinky.marketmap.v1.MsgUpdateMarketsResponse": nil, + "/slinky.marketmap.v1.MsgUpsertMarkets": &marketmapmoduletypes.MsgUpsertMarkets{}, + "/slinky.marketmap.v1.MsgUpsertMarketsResponse": nil, } ) diff --git a/protocol/app/msgs/normal_msgs_test.go b/protocol/app/msgs/normal_msgs_test.go index 759fa3c605..7eedb7ce4d 100644 --- a/protocol/app/msgs/normal_msgs_test.go +++ b/protocol/app/msgs/normal_msgs_test.go @@ -11,20 +11,6 @@ import ( func TestNormalMsgs_Key(t *testing.T) { expectedMsgs := []string{ - // connect marketmap messages - "/connect.marketmap.v2.MsgCreateMarkets", - "/connect.marketmap.v2.MsgCreateMarketsResponse", - "/connect.marketmap.v2.MsgParams", - "/connect.marketmap.v2.MsgParamsResponse", - "/connect.marketmap.v2.MsgRemoveMarketAuthorities", - "/connect.marketmap.v2.MsgRemoveMarketAuthoritiesResponse", - "/connect.marketmap.v2.MsgRemoveMarkets", - "/connect.marketmap.v2.MsgRemoveMarketsResponse", - "/connect.marketmap.v2.MsgUpdateMarkets", - "/connect.marketmap.v2.MsgUpdateMarketsResponse", - "/connect.marketmap.v2.MsgUpsertMarkets", - "/connect.marketmap.v2.MsgUpsertMarketsResponse", - // auth "/cosmos.auth.v1beta1.BaseAccount", "/cosmos.auth.v1beta1.ModuleAccount", @@ -253,6 +239,20 @@ func TestNormalMsgs_Key(t *testing.T) { "/ibc.lightclients.tendermint.v1.ConsensusState", "/ibc.lightclients.tendermint.v1.Header", "/ibc.lightclients.tendermint.v1.Misbehaviour", + + // slinky marketmap messages + "/slinky.marketmap.v1.MsgCreateMarkets", + "/slinky.marketmap.v1.MsgCreateMarketsResponse", + "/slinky.marketmap.v1.MsgParams", + "/slinky.marketmap.v1.MsgParamsResponse", + "/slinky.marketmap.v1.MsgRemoveMarketAuthorities", + "/slinky.marketmap.v1.MsgRemoveMarketAuthoritiesResponse", + "/slinky.marketmap.v1.MsgRemoveMarkets", + "/slinky.marketmap.v1.MsgRemoveMarketsResponse", + "/slinky.marketmap.v1.MsgUpdateMarkets", + "/slinky.marketmap.v1.MsgUpdateMarketsResponse", + "/slinky.marketmap.v1.MsgUpsertMarkets", + "/slinky.marketmap.v1.MsgUpsertMarketsResponse", } require.Equal(t, expectedMsgs, lib.GetSortedKeys[sort.StringSlice](msgs.NormalMsgs)) diff --git a/protocol/app/prepare/prepare_proposal.go b/protocol/app/prepare/prepare_proposal.go index 3cb527aaa1..ce7dd8751d 100644 --- a/protocol/app/prepare/prepare_proposal.go +++ b/protocol/app/prepare/prepare_proposal.go @@ -14,7 +14,7 @@ import ( "github.com/dydxprotocol/v4-chain/protocol/app/prepare/prices" "github.com/dydxprotocol/v4-chain/protocol/lib/metrics" pricetypes "github.com/dydxprotocol/v4-chain/protocol/x/prices/types" - "github.com/skip-mev/connect/v2/abci/ve" + "github.com/skip-mev/slinky/abci/ve" ) var ( diff --git a/protocol/app/prepare/prepare_proposal_test.go b/protocol/app/prepare/prepare_proposal_test.go index ab0af2917f..367da90302 100644 --- a/protocol/app/prepare/prepare_proposal_test.go +++ b/protocol/app/prepare/prepare_proposal_test.go @@ -21,13 +21,13 @@ import ( clobtypes "github.com/dydxprotocol/v4-chain/protocol/x/clob/types" perpetualtypes "github.com/dydxprotocol/v4-chain/protocol/x/perpetuals/types" pricestypes "github.com/dydxprotocol/v4-chain/protocol/x/prices/types" - "github.com/skip-mev/connect/v2/abci/strategies/aggregator" - aggregatormock "github.com/skip-mev/connect/v2/abci/strategies/aggregator/mocks" - "github.com/skip-mev/connect/v2/abci/strategies/codec" - strategymock "github.com/skip-mev/connect/v2/abci/strategies/currencypair/mocks" - slinkytestutils "github.com/skip-mev/connect/v2/abci/testutils" - vetypes "github.com/skip-mev/connect/v2/abci/ve/types" - oracletypes "github.com/skip-mev/connect/v2/pkg/types" + "github.com/skip-mev/slinky/abci/strategies/aggregator" + aggregatormock "github.com/skip-mev/slinky/abci/strategies/aggregator/mocks" + "github.com/skip-mev/slinky/abci/strategies/codec" + strategymock "github.com/skip-mev/slinky/abci/strategies/currencypair/mocks" + slinkytestutils "github.com/skip-mev/slinky/abci/testutils" + vetypes "github.com/skip-mev/slinky/abci/ve/types" + oracletypes "github.com/skip-mev/slinky/pkg/types" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" ) diff --git a/protocol/app/prepare/prices/slinky_price_update_generator.go b/protocol/app/prepare/prices/slinky_price_update_generator.go index 153ee1c2cb..4754d836c7 100644 --- a/protocol/app/prepare/prices/slinky_price_update_generator.go +++ b/protocol/app/prepare/prices/slinky_price_update_generator.go @@ -5,10 +5,10 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" pricestypes "github.com/dydxprotocol/v4-chain/protocol/x/prices/types" - "github.com/skip-mev/connect/v2/abci/strategies/aggregator" - "github.com/skip-mev/connect/v2/abci/strategies/codec" - "github.com/skip-mev/connect/v2/abci/strategies/currencypair" - "github.com/skip-mev/connect/v2/abci/ve" + "github.com/skip-mev/slinky/abci/strategies/aggregator" + "github.com/skip-mev/slinky/abci/strategies/codec" + "github.com/skip-mev/slinky/abci/strategies/currencypair" + "github.com/skip-mev/slinky/abci/ve" ) // SlinkyPriceUpdateGenerator is an implementation of the PriceUpdateGenerator interface. This implementation diff --git a/protocol/app/prepare/prices/slinky_price_update_generator_test.go b/protocol/app/prepare/prices/slinky_price_update_generator_test.go index fab534fc87..6769e9ad47 100644 --- a/protocol/app/prepare/prices/slinky_price_update_generator_test.go +++ b/protocol/app/prepare/prices/slinky_price_update_generator_test.go @@ -5,13 +5,13 @@ import ( cmtabci "github.com/cometbft/cometbft/abci/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/dydxprotocol/v4-chain/protocol/app/prepare/prices" - "github.com/skip-mev/connect/v2/abci/strategies/aggregator" - aggregatormock "github.com/skip-mev/connect/v2/abci/strategies/aggregator/mocks" - codecmock "github.com/skip-mev/connect/v2/abci/strategies/codec/mocks" - strategymock "github.com/skip-mev/connect/v2/abci/strategies/currencypair/mocks" - "github.com/skip-mev/connect/v2/abci/testutils" - vetypes "github.com/skip-mev/connect/v2/abci/ve/types" - oracletypes "github.com/skip-mev/connect/v2/pkg/types" + "github.com/skip-mev/slinky/abci/strategies/aggregator" + aggregatormock "github.com/skip-mev/slinky/abci/strategies/aggregator/mocks" + codecmock "github.com/skip-mev/slinky/abci/strategies/codec/mocks" + strategymock "github.com/skip-mev/slinky/abci/strategies/currencypair/mocks" + "github.com/skip-mev/slinky/abci/testutils" + vetypes "github.com/skip-mev/slinky/abci/ve/types" + oracletypes "github.com/skip-mev/slinky/pkg/types" "github.com/stretchr/testify/suite" "math/big" "testing" diff --git a/protocol/app/process/slinky_market_price_decoder.go b/protocol/app/process/slinky_market_price_decoder.go index 07e05caee2..53d1e2fa3b 100644 --- a/protocol/app/process/slinky_market_price_decoder.go +++ b/protocol/app/process/slinky_market_price_decoder.go @@ -4,7 +4,7 @@ import ( "fmt" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/skip-mev/connect/v2/abci/ve" + "github.com/skip-mev/slinky/abci/ve" "github.com/dydxprotocol/v4-chain/protocol/app/constants" "github.com/dydxprotocol/v4-chain/protocol/app/prepare/prices" diff --git a/protocol/app/process/slinky_market_price_decoder_test.go b/protocol/app/process/slinky_market_price_decoder_test.go index 2ed6358ab2..6880737cce 100644 --- a/protocol/app/process/slinky_market_price_decoder_test.go +++ b/protocol/app/process/slinky_market_price_decoder_test.go @@ -5,7 +5,7 @@ import ( "testing" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/skip-mev/connect/v2/abci/testutils" + "github.com/skip-mev/slinky/abci/testutils" "github.com/stretchr/testify/suite" "github.com/dydxprotocol/v4-chain/protocol/app/constants" diff --git a/protocol/app/upgrades/v6.0.0/constants.go b/protocol/app/upgrades/v6.0.0/constants.go index 7b7b9c99fb..59b3253405 100644 --- a/protocol/app/upgrades/v6.0.0/constants.go +++ b/protocol/app/upgrades/v6.0.0/constants.go @@ -2,8 +2,8 @@ package v_6_0_0 import ( store "cosmossdk.io/store/types" - slinkytypes "github.com/skip-mev/connect/v2/pkg/types" - marketmapmoduletypes "github.com/skip-mev/connect/v2/x/marketmap/types" + slinkytypes "github.com/skip-mev/slinky/pkg/types" + marketmapmoduletypes "github.com/skip-mev/slinky/x/marketmap/types" "github.com/dydxprotocol/v4-chain/protocol/app/upgrades" accountplustypes "github.com/dydxprotocol/v4-chain/protocol/x/accountplus/types" diff --git a/protocol/app/upgrades/v6.0.0/upgrade.go b/protocol/app/upgrades/v6.0.0/upgrade.go index d05748b6d2..fca255a4d3 100644 --- a/protocol/app/upgrades/v6.0.0/upgrade.go +++ b/protocol/app/upgrades/v6.0.0/upgrade.go @@ -14,10 +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/connect/v2/providers/apis/dydx" - dydxtypes "github.com/skip-mev/connect/v2/providers/apis/dydx/types" - marketmapkeeper "github.com/skip-mev/connect/v2/x/marketmap/keeper" - marketmaptypes "github.com/skip-mev/connect/v2/x/marketmap/types" + "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" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" diff --git a/protocol/app/vote_extensions/expected_keepers.go b/protocol/app/vote_extensions/expected_keepers.go index fdba16a985..b472a201e9 100644 --- a/protocol/app/vote_extensions/expected_keepers.go +++ b/protocol/app/vote_extensions/expected_keepers.go @@ -1,16 +1,15 @@ package vote_extensions import ( - "context" sdk "github.com/cosmos/cosmos-sdk/types" - oracletypes "github.com/skip-mev/connect/v2/pkg/types" + oracletypes "github.com/skip-mev/slinky/pkg/types" pricestypes "github.com/dydxprotocol/v4-chain/protocol/x/prices/types" ) // PricesKeeper is the expected interface for the x/price keeper used by the vote extension handlers type PricesKeeper interface { - GetCurrencyPairFromID(ctx context.Context, id uint64) (cp oracletypes.CurrencyPair, found bool) + GetCurrencyPairFromID(ctx sdk.Context, id uint64) (cp oracletypes.CurrencyPair, found bool) GetValidMarketPriceUpdates(ctx sdk.Context) *pricestypes.MsgUpdateMarketPrices UpdateMarketPrices( ctx sdk.Context, diff --git a/protocol/app/vote_extensions/extend_vote_handler.go b/protocol/app/vote_extensions/extend_vote_handler.go index 16eb3b28d6..fefde4a5ed 100644 --- a/protocol/app/vote_extensions/extend_vote_handler.go +++ b/protocol/app/vote_extensions/extend_vote_handler.go @@ -2,7 +2,7 @@ package vote_extensions import ( "fmt" - slinkytypes "github.com/skip-mev/connect/v2/pkg/types" + slinkytypes "github.com/skip-mev/slinky/pkg/types" "math/big" cometabci "github.com/cometbft/cometbft/abci/types" @@ -38,8 +38,7 @@ func (n NoopPriceApplier) GetPricesForValidator(_ sdk.ConsAddress) map[slinkytyp // latest available market prices // 4. Calling the Slinky ExtendVoteHandler to handle the rest of ExtendVote // -// See -// https://github.com/skip-mev/connect/v2/blob/a5b1d3d3a2723e4746b5d588c512d7cc052dc0ff/abci/ve/vote_extension.go#L77 +// See https://github.com/skip-mev/slinky/blob/a5b1d3d3a2723e4746b5d588c512d7cc052dc0ff/abci/ve/vote_extension.go#L77 // for the Slinky ExtendVoteHandler logic. func (e *ExtendVoteHandler) ExtendVoteHandler() sdk.ExtendVoteHandler { return func(ctx sdk.Context, req *cometabci.RequestExtendVote) (resp *cometabci.ResponseExtendVote, err error) { diff --git a/protocol/app/vote_extensions/oracle_client.go b/protocol/app/vote_extensions/oracle_client.go index 42a1f0bd01..07fc0e647f 100644 --- a/protocol/app/vote_extensions/oracle_client.go +++ b/protocol/app/vote_extensions/oracle_client.go @@ -7,7 +7,7 @@ import ( "time" sdk "github.com/cosmos/cosmos-sdk/types" - oracleservicetypes "github.com/skip-mev/connect/v2/service/servers/oracle/types" + oracleservicetypes "github.com/skip-mev/slinky/service/servers/oracle/types" "google.golang.org/grpc" ) diff --git a/protocol/app/vote_extensions/oracle_client_test.go b/protocol/app/vote_extensions/oracle_client_test.go index c69751939c..0bf1a3ed4f 100644 --- a/protocol/app/vote_extensions/oracle_client_test.go +++ b/protocol/app/vote_extensions/oracle_client_test.go @@ -6,7 +6,7 @@ import ( "cosmossdk.io/log" sdk "github.com/cosmos/cosmos-sdk/types" - oracletypes "github.com/skip-mev/connect/v2/pkg/types" + oracletypes "github.com/skip-mev/slinky/pkg/types" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" diff --git a/protocol/cmd/dydxprotocold/cmd/config.go b/protocol/cmd/dydxprotocold/cmd/config.go index e0e1d43c0a..56429a5762 100644 --- a/protocol/cmd/dydxprotocold/cmd/config.go +++ b/protocol/cmd/dydxprotocold/cmd/config.go @@ -7,7 +7,7 @@ import ( serverconfig "github.com/cosmos/cosmos-sdk/server/config" assettypes "github.com/dydxprotocol/v4-chain/protocol/x/assets/types" clobtypes "github.com/dydxprotocol/v4-chain/protocol/x/clob/types" - oracleconfig "github.com/skip-mev/connect/v2/oracle/config" + oracleconfig "github.com/skip-mev/slinky/oracle/config" ) const ( diff --git a/protocol/contrib/connect/oracle.json b/protocol/contrib/connect/oracle.json deleted file mode 100644 index 9636c1c6d1..0000000000 --- a/protocol/contrib/connect/oracle.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "providers": { - "dydx_migration_api": { - "name": "dydx_migration_api", - "api": { - "enabled": true, - "timeout": 20000000000, - "interval": 10000000000, - "reconnectTimeout": 2000000000, - "maxQueries": 1, - "atomic": true, - "endpoints": [ - { - "url": "http://dydxprotocold0:1317" - }, - { - "url": "dydxprotocold0:9090" - } - ], - "batchSize": 0, - "name": "dydx_migration_api" - }, - "type": "market_map_provider" - } - } -} \ No newline at end of file diff --git a/protocol/daemons/flags/flags.go b/protocol/daemons/flags/flags.go index 7eb7d263b6..939e32f68d 100644 --- a/protocol/daemons/flags/flags.go +++ b/protocol/daemons/flags/flags.go @@ -4,7 +4,7 @@ import ( "time" servertypes "github.com/cosmos/cosmos-sdk/server/types" - oracleconfig "github.com/skip-mev/connect/v2/oracle/config" + oracleconfig "github.com/skip-mev/slinky/oracle/config" "github.com/spf13/cast" "github.com/spf13/cobra" ) diff --git a/protocol/daemons/pricefeed/client/price_function/exchange_error.go b/protocol/daemons/pricefeed/client/price_function/exchange_error.go index cc605465d9..2bbce0aad2 100644 --- a/protocol/daemons/pricefeed/client/price_function/exchange_error.go +++ b/protocol/daemons/pricefeed/client/price_function/exchange_error.go @@ -2,7 +2,6 @@ package price_function import ( "fmt" - "github.com/dydxprotocol/v4-chain/protocol/daemons/pricefeed/client/types" ) @@ -36,6 +35,6 @@ func (e *ExchangeErrorImpl) GetExchangeId() types.ExchangeId { func NewExchangeError(exchangeId types.ExchangeId, msg string) ExchangeError { return &ExchangeErrorImpl{ exchangeId: exchangeId, - err: fmt.Errorf("%s", msg), + err: fmt.Errorf(msg), } } diff --git a/protocol/daemons/slinky/client/client.go b/protocol/daemons/slinky/client/client.go index 08aa04c467..2fc5352a50 100644 --- a/protocol/daemons/slinky/client/client.go +++ b/protocol/daemons/slinky/client/client.go @@ -9,7 +9,7 @@ import ( "cosmossdk.io/log" - oracleclient "github.com/skip-mev/connect/v2/service/clients/oracle" + oracleclient "github.com/skip-mev/slinky/service/clients/oracle" appflags "github.com/dydxprotocol/v4-chain/protocol/app/flags" "github.com/dydxprotocol/v4-chain/protocol/daemons/flags" diff --git a/protocol/daemons/slinky/client/client_test.go b/protocol/daemons/slinky/client/client_test.go index 8c6d439321..f98a1896b7 100644 --- a/protocol/daemons/slinky/client/client_test.go +++ b/protocol/daemons/slinky/client/client_test.go @@ -7,7 +7,7 @@ import ( "time" "cosmossdk.io/log" - "github.com/skip-mev/connect/v2/service/servers/oracle/types" + "github.com/skip-mev/slinky/service/servers/oracle/types" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" "google.golang.org/grpc" diff --git a/protocol/daemons/slinky/client/market_pair_fetcher.go b/protocol/daemons/slinky/client/market_pair_fetcher.go index 0fbc676144..bfcc42e311 100644 --- a/protocol/daemons/slinky/client/market_pair_fetcher.go +++ b/protocol/daemons/slinky/client/market_pair_fetcher.go @@ -14,7 +14,7 @@ import ( daemontypes "github.com/dydxprotocol/v4-chain/protocol/daemons/types" "github.com/dydxprotocol/v4-chain/protocol/lib/slinky" pricetypes "github.com/dydxprotocol/v4-chain/protocol/x/prices/types" - slinkytypes "github.com/skip-mev/connect/v2/pkg/types" + slinkytypes "github.com/skip-mev/slinky/pkg/types" ) // MarketPairFetcher is a lightweight process run in a goroutine by the slinky client. diff --git a/protocol/daemons/slinky/client/market_pair_fetcher_test.go b/protocol/daemons/slinky/client/market_pair_fetcher_test.go index a7fc2235b5..34cacb3967 100644 --- a/protocol/daemons/slinky/client/market_pair_fetcher_test.go +++ b/protocol/daemons/slinky/client/market_pair_fetcher_test.go @@ -9,7 +9,7 @@ import ( "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" - slinkytypes "github.com/skip-mev/connect/v2/pkg/types" + slinkytypes "github.com/skip-mev/slinky/pkg/types" "github.com/dydxprotocol/v4-chain/protocol/daemons/slinky/client" "github.com/dydxprotocol/v4-chain/protocol/mocks" diff --git a/protocol/daemons/slinky/client/price_fetcher.go b/protocol/daemons/slinky/client/price_fetcher.go index 06709fd9ba..e8f72465de 100644 --- a/protocol/daemons/slinky/client/price_fetcher.go +++ b/protocol/daemons/slinky/client/price_fetcher.go @@ -5,9 +5,9 @@ import ( "strconv" "cosmossdk.io/log" - slinkytypes "github.com/skip-mev/connect/v2/pkg/types" - oracleclient "github.com/skip-mev/connect/v2/service/clients/oracle" - "github.com/skip-mev/connect/v2/service/servers/oracle/types" + slinkytypes "github.com/skip-mev/slinky/pkg/types" + oracleclient "github.com/skip-mev/slinky/service/clients/oracle" + "github.com/skip-mev/slinky/service/servers/oracle/types" "github.com/dydxprotocol/v4-chain/protocol/daemons/pricefeed/api" pricefeedtypes "github.com/dydxprotocol/v4-chain/protocol/daemons/server/types/pricefeed" diff --git a/protocol/daemons/slinky/client/price_fetcher_test.go b/protocol/daemons/slinky/client/price_fetcher_test.go index 7781dae7ef..4a9d7f21d8 100644 --- a/protocol/daemons/slinky/client/price_fetcher_test.go +++ b/protocol/daemons/slinky/client/price_fetcher_test.go @@ -7,7 +7,7 @@ import ( "time" "cosmossdk.io/log" - "github.com/skip-mev/connect/v2/service/servers/oracle/types" + "github.com/skip-mev/slinky/service/servers/oracle/types" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" diff --git a/protocol/daemons/slinky/client/sidecar_version_checker.go b/protocol/daemons/slinky/client/sidecar_version_checker.go index af7ec97199..8e654f9ea8 100644 --- a/protocol/daemons/slinky/client/sidecar_version_checker.go +++ b/protocol/daemons/slinky/client/sidecar_version_checker.go @@ -7,8 +7,8 @@ import ( "cosmossdk.io/log" "github.com/hashicorp/go-version" - oracleclient "github.com/skip-mev/connect/v2/service/clients/oracle" - "github.com/skip-mev/connect/v2/service/servers/oracle/types" + oracleclient "github.com/skip-mev/slinky/service/clients/oracle" + "github.com/skip-mev/slinky/service/servers/oracle/types" ) // SidecarVersionChecker is a lightweight process run in a goroutine by the slinky client. diff --git a/protocol/daemons/slinky/client/sidecar_version_checker_test.go b/protocol/daemons/slinky/client/sidecar_version_checker_test.go index 97dd6b6839..11eb2d47fa 100644 --- a/protocol/daemons/slinky/client/sidecar_version_checker_test.go +++ b/protocol/daemons/slinky/client/sidecar_version_checker_test.go @@ -10,7 +10,7 @@ import ( "github.com/dydxprotocol/v4-chain/protocol/daemons/slinky/client" "github.com/dydxprotocol/v4-chain/protocol/mocks" - "github.com/skip-mev/connect/v2/service/servers/oracle/types" + "github.com/skip-mev/slinky/service/servers/oracle/types" ) func TestSidecarVersionChecker(t *testing.T) { diff --git a/protocol/docker-compose.yml b/protocol/docker-compose.yml index 450f0ac7d9..6c0e0d2eaf 100644 --- a/protocol/docker-compose.yml +++ b/protocol/docker-compose.yml @@ -115,19 +115,19 @@ services: - DAEMON_HOME=/dydxprotocol/chain/.dave volumes: - ./localnet/dydxprotocol3:/dydxprotocol/chain/.dave/data - connect0: - image: ghcr.io/skip-mev/connect-sidecar:v2.1.2 + slinky0: + image: ghcr.io/skip-mev/slinky-sidecar:v1.0.13 entrypoint: > - sh -c "connect --marketmap-provider dydx_migration_api --oracle-config /etc/connect/oracle.json --log-std-out-level error" + sh -c "slinky --marketmap-provider dydx_migration_api --oracle-config /etc/slinky/oracle.json --log-std-out-level error" environment: - - CONNECT_CONFIG_PROVIDERS_RAYDIUM_API_API_ENDPOINTS_0_URL=${RAYDIUM_URL} - - CONNECT_CONFIG_PROVIDERS_UNISWAPV3_API-BASE_API_ENDPOINTS_0_URL=${UNISWAPV3_BASE_URL} - - CONNECT_CONFIG_PROVIDERS_UNISWAPV3_API-ETHEREUM_API_ENDPOINTS_0_URL=${UNISWAPV3_ETHEREUM_URL} - - CONNECT_CONFIG_PROVIDERS_RAYDIUM_API_API_INTERVAL=${PROVIDER_NODE_QUERY_INTERVAL} - - CONNECT_CONFIG_PROVIDERS_UNISWAPV3_API-BASE_API_INTERVAL=${PROVIDER_NODE_QUERY_INTERVAL} - - CONNECT_CONFIG_PROVIDERS_UNISWAPV3_API-ETHEREUM_API_INTERVAL=${PROVIDER_NODE_QUERY_INTERVAL} + - SLINKY_CONFIG_PROVIDERS_RAYDIUM_API_API_ENDPOINTS_0_URL=${RAYDIUM_URL} + - SLINKY_CONFIG_PROVIDERS_UNISWAPV3_API-BASE_API_ENDPOINTS_0_URL=${UNISWAPV3_BASE_URL} + - SLINKY_CONFIG_PROVIDERS_UNISWAPV3_API-ETHEREUM_API_ENDPOINTS_0_URL=${UNISWAPV3_ETHEREUM_URL} + - SLINKY_CONFIG_PROVIDERS_RAYDIUM_API_API_INTERVAL=${PROVIDER_NODE_QUERY_INTERVAL} + - SLINKY_CONFIG_PROVIDERS_UNISWAPV3_API-BASE_API_INTERVAL=${PROVIDER_NODE_QUERY_INTERVAL} + - SLINKY_CONFIG_PROVIDERS_UNISWAPV3_API-ETHEREUM_API_INTERVAL=${PROVIDER_NODE_QUERY_INTERVAL} volumes: - - ./contrib/connect:/etc/connect + - ./contrib/slinky:/etc/slinky ports: - "8080:8080" - "8002:8002" # metrics diff --git a/protocol/go.mod b/protocol/go.mod index 4a6e2458b4..753f09c14f 100644 --- a/protocol/go.mod +++ b/protocol/go.mod @@ -19,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.4 - github.com/golangci/golangci-lint v1.62.0 + github.com/golangci/golangci-lint v1.62.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 @@ -32,11 +32,11 @@ require ( github.com/spf13/cobra v1.8.1 github.com/spf13/pflag v1.0.5 github.com/stretchr/testify v1.10.0 - github.com/vektra/mockery/v2 v2.46.0 + github.com/vektra/mockery/v2 v2.44.1 github.com/zyedidia/generic v1.0.0 golang.org/x/exp v0.0.0-20240909161429-701f63a606c0 google.golang.org/genproto v0.0.0-20240903143218-8af14fe29dc1 // indirect - google.golang.org/grpc v1.68.0 + google.golang.org/grpc v1.68.1 gopkg.in/DataDog/dd-trace-go.v1 v1.48.0 gopkg.in/typ.v4 v4.1.0 ) @@ -47,10 +47,10 @@ require ( cosmossdk.io/errors v1.0.1 cosmossdk.io/log v1.4.1 cosmossdk.io/store v1.1.1 - cosmossdk.io/tools/confix v0.1.2 + cosmossdk.io/tools/confix v0.1.1 cosmossdk.io/x/circuit v0.1.1 - cosmossdk.io/x/evidence v0.1.1 - cosmossdk.io/x/feegrant v0.1.1 + cosmossdk.io/x/evidence v0.1.0 + cosmossdk.io/x/feegrant v0.1.0 cosmossdk.io/x/tx v0.13.5 cosmossdk.io/x/upgrade v0.1.4 github.com/burdiyan/kafkautil v0.0.0-20190131162249-eaf83ed22d5b @@ -69,7 +69,7 @@ require ( github.com/pelletier/go-toml v1.9.5 github.com/rs/zerolog v1.33.0 github.com/shopspring/decimal v1.3.1 - github.com/skip-mev/connect/v2 v2.2.1 + github.com/skip-mev/slinky v1.0.14-0.20241212193714-ab2537f1a1f2 github.com/spf13/viper v1.19.0 github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d google.golang.org/genproto/googleapis/api v0.0.0-20240903143218-8af14fe29dc1 @@ -95,10 +95,10 @@ require ( github.com/Abirdcfly/dupword v0.1.3 // indirect github.com/Antonboom/errname v1.0.0 // indirect github.com/Antonboom/nilnil v1.0.0 // indirect - github.com/Antonboom/testifylint v1.5.0 // indirect + github.com/Antonboom/testifylint v1.5.2 // indirect github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 // indirect github.com/BurntSushi/toml v1.4.1-0.20240526193622-a339e1f7089c // indirect - github.com/Crocmagnon/fatcontext v0.5.2 // indirect + github.com/Crocmagnon/fatcontext v0.5.3 // indirect github.com/DataDog/datadog-go v4.8.2+incompatible // indirect github.com/DataDog/datadog-go/v5 v5.0.2 // indirect github.com/DataDog/gostackparse v0.5.0 // indirect @@ -159,7 +159,7 @@ require ( github.com/cosmos/btcutil v1.0.5 // indirect github.com/cosmos/gogogateway v1.2.0 // indirect github.com/cosmos/ics23/go v0.11.0 // indirect - github.com/cosmos/interchain-security/v6 v6.3.0 // indirect + github.com/cosmos/interchain-security/v5 v5.2.0 // 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-ipa v0.0.0-20240223125850-b1e8a79f509c // indirect @@ -312,7 +312,7 @@ require ( github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.20 // indirect github.com/mattn/go-runewidth v0.0.16 // indirect - github.com/mgechev/revive v1.5.0 // indirect + github.com/mgechev/revive v1.5.1 // indirect github.com/minio/highwayhash v1.0.3 // indirect github.com/mitchellh/go-homedir v1.1.0 // indirect github.com/mitchellh/go-testing-interface v1.14.1 // indirect @@ -328,7 +328,7 @@ require ( github.com/nakabonne/nestif v0.3.1 // indirect github.com/nishanths/exhaustive v0.12.0 // indirect github.com/nishanths/predeclared v0.2.2 // indirect - github.com/nunnatsa/ginkgolinter v0.18.0 // indirect + github.com/nunnatsa/ginkgolinter v0.18.3 // indirect github.com/nxadm/tail v1.4.8 // indirect github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a // indirect github.com/oklog/run v1.1.0 // indirect @@ -342,7 +342,7 @@ require ( github.com/petermattis/goid v0.0.0-20240813172612-4fcff4a6cae7 // indirect github.com/pierrec/lz4/v4 v4.1.17 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect - github.com/polyfloyd/go-errorlint v1.6.0 // indirect + github.com/polyfloyd/go-errorlint v1.7.0 // indirect github.com/prometheus/client_golang v1.20.5 // indirect github.com/prometheus/client_model v0.6.1 // indirect github.com/prometheus/common v0.60.1 // indirect @@ -398,7 +398,7 @@ require ( github.com/ultraware/funlen v0.1.0 // indirect github.com/ultraware/whitespace v0.1.1 // indirect github.com/uudashr/gocognit v1.1.3 // indirect - github.com/uudashr/iface v1.2.0 // indirect + github.com/uudashr/iface v1.2.1 // indirect github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f // indirect github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect github.com/xeipuuv/gojsonschema v1.2.0 // indirect @@ -423,15 +423,15 @@ require ( 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.29.0 // indirect - golang.org/x/exp/typeparams v0.0.0-20240909161429-701f63a606c0 // indirect + golang.org/x/crypto v0.31.0 // indirect + golang.org/x/exp/typeparams v0.0.0-20241108190413-2d47ceb2692f // indirect golang.org/x/mod v0.22.0 // indirect - golang.org/x/net v0.31.0 // indirect + golang.org/x/net v0.32.0 // indirect golang.org/x/oauth2 v0.23.0 // indirect - golang.org/x/sync v0.9.0 // indirect - golang.org/x/sys v0.27.0 // indirect - golang.org/x/term v0.26.0 // indirect - golang.org/x/text v0.20.0 // indirect + golang.org/x/sync v0.10.0 // indirect + golang.org/x/sys v0.28.0 // indirect + golang.org/x/term v0.27.0 // indirect + golang.org/x/text v0.21.0 // indirect golang.org/x/time v0.6.0 // indirect golang.org/x/tools v0.27.0 // indirect google.golang.org/api v0.198.0 // indirect diff --git a/protocol/go.sum b/protocol/go.sum index 8f8192bfa7..16a4433340 100644 --- a/protocol/go.sum +++ b/protocol/go.sum @@ -626,14 +626,14 @@ cosmossdk.io/log v1.4.1 h1:wKdjfDRbDyZRuWa8M+9nuvpVYxrEOwbD/CA8hvhU8QM= cosmossdk.io/log v1.4.1/go.mod h1:k08v0Pyq+gCP6phvdI6RCGhLf/r425UT6Rk/m+o74rU= cosmossdk.io/math v1.4.0 h1:XbgExXFnXmF/CccPPEto40gOO7FpWu9yWNAZPN3nkNQ= cosmossdk.io/math v1.4.0/go.mod h1:O5PkD4apz2jZs4zqFdTr16e1dcaQCc5z6lkEnrrppuk= -cosmossdk.io/tools/confix v0.1.2 h1:2hoM1oFCNisd0ltSAAZw2i4ponARPmlhuNu3yy0VwI4= -cosmossdk.io/tools/confix v0.1.2/go.mod h1:7XfcbK9sC/KNgVGxgLM0BrFbVcR/+6Dg7MFfpx7duYo= +cosmossdk.io/tools/confix v0.1.1 h1:aexyRv9+y15veH3Qw16lxQwo+ki7r2I+g0yNTEFEQM8= +cosmossdk.io/tools/confix v0.1.1/go.mod h1:nQVvP1tHsGXS83PonPVWJtSbddIqyjEw99L4M3rPJyQ= cosmossdk.io/x/circuit v0.1.1 h1:KPJCnLChWrxD4jLwUiuQaf5mFD/1m7Omyo7oooefBVQ= cosmossdk.io/x/circuit v0.1.1/go.mod h1:B6f/urRuQH8gjt4eLIXfZJucrbreuYrKh5CSjaOxr+Q= cosmossdk.io/x/evidence v0.1.0 h1:J6OEyDl1rbykksdGynzPKG5R/zm6TacwW2fbLTW4nCk= cosmossdk.io/x/evidence v0.1.0/go.mod h1:hTaiiXsoiJ3InMz1uptgF0BnGqROllAN8mwisOMMsfw= -cosmossdk.io/x/feegrant v0.1.1 h1:EKFWOeo/pup0yF0svDisWWKAA9Zags6Zd0P3nRvVvw8= -cosmossdk.io/x/feegrant v0.1.1/go.mod h1:2GjVVxX6G2fta8LWj7pC/ytHjryA6MHAJroBWHFNiEQ= +cosmossdk.io/x/feegrant v0.1.0 h1:c7s3oAq/8/UO0EiN1H5BIjwVntujVTkYs35YPvvrdQk= +cosmossdk.io/x/feegrant v0.1.0/go.mod h1:4r+FsViJRpcZif/yhTn+E0E6OFfg4n0Lx+6cCtnZElU= cosmossdk.io/x/tx v0.13.5 h1:FdnU+MdmFWn1pTsbfU0OCf2u6mJ8cqc1H4OMG418MLw= cosmossdk.io/x/tx v0.13.5/go.mod h1:V6DImnwJMTq5qFjeGWpXNiT/fjgE4HtmclRmTqRVM3w= cosmossdk.io/x/upgrade v0.1.1 h1:aoPe2gNvH+Gwt/Pgq3dOxxQVU3j5P6Xf+DaUJTDZATc= @@ -655,16 +655,16 @@ github.com/Antonboom/errname v1.0.0 h1:oJOOWR07vS1kRusl6YRSlat7HFnb3mSfMl6sDMRoT github.com/Antonboom/errname v1.0.0/go.mod h1:gMOBFzK/vrTiXN9Oh+HFs+e6Ndl0eTFbtsRTSRdXyGI= github.com/Antonboom/nilnil v1.0.0 h1:n+v+B12dsE5tbAqRODXmEKfZv9j2KcTBrp+LkoM4HZk= github.com/Antonboom/nilnil v1.0.0/go.mod h1:fDJ1FSFoLN6yoG65ANb1WihItf6qt9PJVTn/s2IrcII= -github.com/Antonboom/testifylint v1.5.0 h1:dlUIsDMtCrZWUnvkaCz3quJCoIjaGi41GzjPBGkkJ8A= -github.com/Antonboom/testifylint v1.5.0/go.mod h1:wqaJbu0Blb5Wag2wv7Z5xt+CIV+eVLxtGZrlK13z3AE= +github.com/Antonboom/testifylint v1.5.2 h1:4s3Xhuv5AvdIgbd8wOOEeo0uZG7PbDKQyKY5lGoQazk= +github.com/Antonboom/testifylint v1.5.2/go.mod h1:vxy8VJ0bc6NavlYqjZfmp6EfqXMtBgQ4+mhCojwC1P8= github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 h1:L/gRVlceqvL25UVaW/CKtUDjefjrs0SPonmDGUVOYP0= github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/toml v1.4.1-0.20240526193622-a339e1f7089c h1:pxW6RcqyfI9/kWtOwnv/G+AzdKuy2ZrqINhenH4HyNs= github.com/BurntSushi/toml v1.4.1-0.20240526193622-a339e1f7089c/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/Crocmagnon/fatcontext v0.5.2 h1:vhSEg8Gqng8awhPju2w7MKHqMlg4/NI+gSDHtR3xgwA= -github.com/Crocmagnon/fatcontext v0.5.2/go.mod h1:87XhRMaInHP44Q7Tlc7jkgKKB7kZAOPiDkFMdKCC+74= +github.com/Crocmagnon/fatcontext v0.5.3 h1:zCh/wjc9oyeF+Gmp+V60wetm8ph2tlsxocgg/J0hOps= +github.com/Crocmagnon/fatcontext v0.5.3/go.mod h1:XoCQYY1J+XTfyv74qLXvNw4xFunr3L1wkopIIKG7wGM= github.com/DataDog/datadog-agent/pkg/obfuscate v0.0.0-20211129110424-6491aa3bf583 h1:3nVO1nQyh64IUY6BPZUpMYMZ738Pu+LsMt3E0eqqIYw= github.com/DataDog/datadog-agent/pkg/obfuscate v0.0.0-20211129110424-6491aa3bf583/go.mod h1:EP9f4GqaDJyP1F5jTNMtzdIpw3JpNs3rMSJOnYywCiw= github.com/DataDog/datadog-agent/pkg/remoteconfig/state v0.42.0-rc.1 h1:Rmz52Xlc5k3WzAHzD0SCH4USCzyti7EbK4HtrHys3ME= @@ -719,8 +719,8 @@ github.com/ajstarks/deck/generate v0.0.0-20210309230005-c3f852c02e19/go.mod h1:T github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw= github.com/ajstarks/svgo v0.0.0-20211024235047-1546f124cd8b/go.mod h1:1KcenG0jGWcpt8ov532z81sp/kMMUG485J2InIOyADM= github.com/akavel/rsrc v0.8.0/go.mod h1:uLoCtb9J+EyAqh+26kdrTgmzRBFPGOolLWKpdxkKq+c= -github.com/alecthomas/assert/v2 v2.6.0 h1:o3WJwILtexrEUk3cUVal3oiQY2tfgr/FHWiz/v2n4FU= -github.com/alecthomas/assert/v2 v2.6.0/go.mod h1:Bze95FyfUr7x34QZrjL+XP+0qgp/zg8yS+TtBj1WA3k= +github.com/alecthomas/assert/v2 v2.2.2 h1:Z/iVC0xZfWTaFNE6bA3z07T86hd45Xe2eLt6WVy2bbk= +github.com/alecthomas/assert/v2 v2.2.2/go.mod h1:pXcQ2Asjp247dahGEmsZ6ru0UVwnkhktn7S0bBDLxvQ= github.com/alecthomas/go-check-sumtype v0.2.0 h1:Bo+e4DFf3rs7ME9w/0SU/g6nmzJaphduP8Cjiz0gbwY= github.com/alecthomas/go-check-sumtype v0.2.0/go.mod h1:WyYPfhfkdhyrdaligV6svFopZV8Lqdzn5pyVBaV6jhQ= github.com/alecthomas/kingpin/v2 v2.4.0/go.mod h1:0gyi0zQnjuFk8xrkNKamJoyUo382HRL7ATRpFZCw6tE= @@ -893,8 +893,8 @@ github.com/cosmos/ibc-go/v8 v8.0.0 h1:QKipnr/NGwc+9L7NZipURvmSIu+nw9jOIWTJuDBqOh github.com/cosmos/ibc-go/v8 v8.0.0/go.mod h1:C6IiJom0F3cIQCD5fKwVPDrDK9j/xTu563AWuOmXois= github.com/cosmos/ics23/go v0.11.0 h1:jk5skjT0TqX5e5QJbEnwXIS2yI2vnmLOgpQPeM5RtnU= github.com/cosmos/ics23/go v0.11.0/go.mod h1:A8OjxPE67hHST4Icw94hOxxFEJMBG031xIGF/JHNIY0= -github.com/cosmos/interchain-security/v6 v6.3.0 h1:AIsfxLUDtUGVfaqJ1WPwnYIOT5AxoSO58469iw9vNH4= -github.com/cosmos/interchain-security/v6 v6.3.0/go.mod h1:6DSiV2w+DuPkxP1KGFtaxpiwf8Xt2iusj8O53KCx96Q= +github.com/cosmos/interchain-security/v5 v5.2.0 h1:ZB4sMH5kG4Fmuk+WLKykXv8qSSoafo1eVlSo0G5scKE= +github.com/cosmos/interchain-security/v5 v5.2.0/go.mod h1:vmeTcTxFCl1eV0o6xpl/IRT7Basz0szVVGzbppnInMg= github.com/cosmos/keyring v1.2.0 h1:8C1lBP9xhImmIabyXW4c3vFjjLiBdGCmfLUfeZlV1Yo= github.com/cosmos/keyring v1.2.0/go.mod h1:fc+wB5KTk9wQ9sDx0kFXB3A0MaeGHM9AwRStKOQ5vOA= github.com/cosmos/ledger-cosmos-go v0.13.3 h1:7ehuBGuyIytsXbd4MP43mLeoN2LTOEnk5nvue4rK+yM= @@ -1187,8 +1187,8 @@ github.com/golangci/go-printf-func-name v0.1.0 h1:dVokQP+NMTO7jwO4bwsRwLWeudOVUP github.com/golangci/go-printf-func-name v0.1.0/go.mod h1:wqhWFH5mUdJQhweRnldEywnR5021wTdZSNgwYceV14s= github.com/golangci/gofmt v0.0.0-20240816233607-d8596aa466a9 h1:/1322Qns6BtQxUZDTAT4SdcoxknUki7IAoK4SAXr8ME= github.com/golangci/gofmt v0.0.0-20240816233607-d8596aa466a9/go.mod h1:Oesb/0uFAyWoaw1U1qS5zyjCg5NP9C9iwjnI4tIsXEE= -github.com/golangci/golangci-lint v1.62.0 h1:/G0g+bi1BhmGJqLdNQkKBWjcim8HjOPc4tsKuHDOhcI= -github.com/golangci/golangci-lint v1.62.0/go.mod h1:jtoOhQcKTz8B6dGNFyfQV3WZkQk+YvBDewDtNpiAJts= +github.com/golangci/golangci-lint v1.62.2 h1:b8K5K9PN+rZN1+mKLtsZHz2XXS9aYKzQ9i25x3Qnxxw= +github.com/golangci/golangci-lint v1.62.2/go.mod h1:ILWWyeFUrctpHVGMa1dg2xZPKoMUTc5OIMgW7HZr34g= github.com/golangci/misspell v0.6.0 h1:JCle2HUTNWirNlDIAUO44hUsKhOFqGPoC4LZxlaSXDs= github.com/golangci/misspell v0.6.0/go.mod h1:keMNyY6R9isGaSAu+4Q8NMBwMPkh15Gtc8UCVoDtAWo= github.com/golangci/modinfo v0.3.4 h1:oU5huX3fbxqQXdfspamej74DFX0kyGLkw1ppvXoJ8GA= @@ -1531,8 +1531,8 @@ github.com/mattn/go-runewidth v0.0.16 h1:E5ScNMtiwvlvB5paMFdw9p4kSQzbXFikJ5SQO6T github.com/mattn/go-runewidth v0.0.16/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/mattn/go-sqlite3 v1.14.14/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU= github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0/go.mod h1:QUyp042oQthUoa9bqDv0ER0wrtXnBruoNd7aNjkbP+k= -github.com/mgechev/revive v1.5.0 h1:oaSmjA7rP8+HyoRuCgC531VHwnLH1AlJdjj+1AnQceQ= -github.com/mgechev/revive v1.5.0/go.mod h1:L6T3H8EoerRO86c7WuGpvohIUmiploGiyoYbtIWFmV8= +github.com/mgechev/revive v1.5.1 h1:hE+QPeq0/wIzJwOphdVyUJ82njdd8Khp4fUIHGZHW3M= +github.com/mgechev/revive v1.5.1/go.mod h1:lC9AhkJIBs5zwx8wkudyHrU+IJkrEKmpCmGMnIJPk4o= github.com/minio/asm2plan9s v0.0.0-20200509001527-cdd76441f9d8/go.mod h1:mC1jAcsrzbxHt8iiaC+zU4b1ylILSosueou12R++wfY= github.com/minio/c2goasm v0.0.0-20190812172519-36a3d3bbc4f3/go.mod h1:RagcQ7I8IeTMnF8JTXieKnO4Z6JCsikNEzj0DwauVzE= github.com/minio/highwayhash v1.0.3 h1:kbnuUMoHYyVl7szWjSxJnxw11k2U709jqFPPmIUyD6Q= @@ -1577,8 +1577,8 @@ github.com/nishanths/exhaustive v0.12.0/go.mod h1:mEZ95wPIZW+x8kC4TgC+9YCUgiST7e github.com/nishanths/predeclared v0.2.2 h1:V2EPdZPliZymNAn79T8RkNApBjMmVKh5XRpLm/w98Vk= github.com/nishanths/predeclared v0.2.2/go.mod h1:RROzoN6TnGQupbC+lqggsOlcgysk3LMK/HI84Mp280c= github.com/nkovacs/streamquote v1.0.0/go.mod h1:BN+NaZ2CmdKqUuTUXUEm9j95B2TRbpOWpxbJYzzgUsc= -github.com/nunnatsa/ginkgolinter v0.18.0 h1:ZXO1wKhPg3A6LpbN5dMuqwhfOjN5c3ous8YdKOuqk9k= -github.com/nunnatsa/ginkgolinter v0.18.0/go.mod h1:vPrWafSULmjMGCMsfGA908if95VnHQNAahvSBOjTuWs= +github.com/nunnatsa/ginkgolinter v0.18.3 h1:WgS7X3zzmni3vwHSBhvSgqrRgUecN6PQUcfB0j1noDw= +github.com/nunnatsa/ginkgolinter v0.18.3/go.mod h1:BE1xyB/PNtXXG1azrvrqJW5eFH0hSRylNzFy8QHPwzs= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= @@ -1646,8 +1646,8 @@ github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qR github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/polyfloyd/go-errorlint v1.6.0 h1:tftWV9DE7txiFzPpztTAwyoRLKNj9gpVm2cg8/OwcYY= -github.com/polyfloyd/go-errorlint v1.6.0/go.mod h1:HR7u8wuP1kb1NeN1zqTd1ZMlqUKPPHF+Id4vIPvDqVw= +github.com/polyfloyd/go-errorlint v1.7.0 h1:Zp6lzCK4hpBDj8y8a237YK4EPrMXQWvOe3nGoH4pFrU= +github.com/polyfloyd/go-errorlint v1.7.0/go.mod h1:dGWKu85mGHnegQ2SWpEybFityCg3j7ZbwsVUxAOk9gY= github.com/prashantv/gostub v1.1.0 h1:BTyx3RfQjRHnUWaGF9oQos79AlQ5k8WNktv7VGvVH4g= github.com/prashantv/gostub v1.1.0/go.mod h1:A5zLQHz7ieHGG7is6LLXLz7I8+3LZzsrV0P1IAHhP5U= github.com/prometheus/client_golang v1.18.0 h1:HzFfmkOzH5Q8L8G+kSJKUx5dtG87sewO+FoDDqP5Tbk= @@ -1744,8 +1744,8 @@ github.com/sivchari/tenv v1.12.1 h1:+E0QzjktdnExv/wwsnnyk4oqZBUfuh89YMQT1cyuvSY= github.com/sivchari/tenv v1.12.1/go.mod h1:1LjSOUCc25snIr5n3DtGGrENhX3LuWefcplwVGC24mw= github.com/skip-mev/chaintestutil v0.0.0-20240514161515-056d7ba45610 h1:4JlsiRVt/YZOvrKH525T7sZXgEWUEjqSDMwE6fXNbdo= github.com/skip-mev/chaintestutil v0.0.0-20240514161515-056d7ba45610/go.mod h1:kB8gFZX07CyJnw8q9iEZijI3qJTIe1K/Y++P5VGkrcg= -github.com/skip-mev/connect/v2 v2.2.1 h1:VR0zurE0TJP/YxMeGNeq+SdqEEKWy7U59vZ1bv1dT6g= -github.com/skip-mev/connect/v2 v2.2.1/go.mod h1:QKCyZSPIutYjbDBbrFCFz0RGU5i6R75DFuvoc8tSa74= +github.com/skip-mev/slinky v1.0.14-0.20241212193714-ab2537f1a1f2 h1:lg8XXwQWVtZwe5DwkbFmeMuOhCiRMd/oQmVt0TYb7oA= +github.com/skip-mev/slinky v1.0.14-0.20241212193714-ab2537f1a1f2/go.mod h1:/FnDWFvhjZGmkH8K+lkGw+1I8Ogsh6a0rghMOtjAg+U= github.com/sonatard/noctx v0.1.0 h1:JjqOc2WN16ISWAjAk8M5ej0RfExEXtkEyExl2hLW+OM= github.com/sonatard/noctx v0.1.0/go.mod h1:0RvBxqY8D4j9cTTTWE8ylt2vqj2EPI8fHmrxHdsaZ2c= github.com/sourcegraph/conc v0.3.0 h1:OQTbbt6P72L20UqAkXXuLOj79LfEanQ+YQFNpLA9ySo= @@ -1851,12 +1851,12 @@ github.com/urfave/cli/v2 v2.25.7 h1:VAzn5oq403l5pHjc4OhD54+XGO9cdKVL/7lDjF+iKUs= github.com/urfave/cli/v2 v2.25.7/go.mod h1:8qnjx1vcq5s2/wpsqoZFndg2CE5tNFyrTvS6SinrnYQ= github.com/uudashr/gocognit v1.1.3 h1:l+a111VcDbKfynh+airAy/DJQKaXh2m9vkoysMPSZyM= github.com/uudashr/gocognit v1.1.3/go.mod h1:aKH8/e8xbTRBwjbCkwZ8qt4l2EpKXl31KMHgSS+lZ2U= -github.com/uudashr/iface v1.2.0 h1:ECJjh5q/1Zmnv/2yFpWV6H3oMg5+Mo+vL0aqw9Gjazo= -github.com/uudashr/iface v1.2.0/go.mod h1:Ux/7d/rAF3owK4m53cTVXL4YoVHKNqnoOeQHn2xrlp0= +github.com/uudashr/iface v1.2.1 h1:vHHyzAUmWZ64Olq6NZT3vg/z1Ws56kyPdBOd5kTXDF8= +github.com/uudashr/iface v1.2.1/go.mod h1:4QvspiRd3JLPAEXBQ9AiZpLbJlrWWgRChOKDJEuQTdg= github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= github.com/valyala/fasttemplate v1.0.1/go.mod h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPUpymEIMZ47gx8= -github.com/vektra/mockery/v2 v2.46.0 h1:DKIFj6hAPGwmOYiWfWzdsQtBgU8ozPXo3Bwbmf+Ku80= -github.com/vektra/mockery/v2 v2.46.0/go.mod h1:XNTE9RIu3deGAGQRVjP1VZxGpQNm0YedZx4oDs3prr8= +github.com/vektra/mockery/v2 v2.50.0 h1:0GYRH38nKiRghwUq+0aJXG1sT3yyTYj/J1xQRM8kGzQ= +github.com/vektra/mockery/v2 v2.50.0/go.mod h1:xO2DeYemEPC2tCzIZ+a1tifZ/7Laf/Chxg3vlc+oDsI= github.com/xdg-go/pbkdf2 v1.0.0/go.mod h1:jrpuAogTd400dnrH08LKmI/xc1MbPOebTwRqcT5RDeI= github.com/xdg-go/scram v1.1.1/go.mod h1:RaEWvsqvNKKvBPvcKeFjrG2cJqOkHTiyTpzz23ni57g= github.com/xdg-go/stringprep v1.0.3/go.mod h1:W3f5j4i+9rC0kuIEJL0ky1VpHXQU3ocBgklLGvcBnW8= @@ -1976,8 +1976,8 @@ golang.org/x/crypto v0.9.0/go.mod h1:yrmDGqONDYtNj3tH8X9dzUun2m2lzPa9ngI6/RUPGR0 golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliYc= golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4= golang.org/x/crypto v0.18.0/go.mod h1:R0j02AL6hcrfOiy9T4ZYp/rcWeMxM3L6QYxlOuEG1mg= -golang.org/x/crypto v0.29.0 h1:L5SG1JTTXupVV3n6sUqMTeWbjAyfPwoda2DLX8J8FrQ= -golang.org/x/crypto v0.29.0/go.mod h1:+F4F4N5hv6v38hfeYwTdx20oUvLLc+QfrE9Ax9HtgRg= +golang.org/x/crypto v0.31.0 h1:ihbySMvVjLAeSH1IbfcRTkD/iNscyz8rGzjF/E5hV6U= +golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk= golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -1998,8 +1998,8 @@ golang.org/x/exp v0.0.0-20240909161429-701f63a606c0 h1:e66Fs6Z+fZTbFBAxKfP3PALWB golang.org/x/exp v0.0.0-20240909161429-701f63a606c0/go.mod h1:2TbTHSBQa924w8M6Xs1QcRcFwyucIwBGpK1p2f1YFFY= golang.org/x/exp/typeparams v0.0.0-20220428152302-39d4317da171/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk= golang.org/x/exp/typeparams v0.0.0-20230203172020-98cc5a0785f9/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk= -golang.org/x/exp/typeparams v0.0.0-20240909161429-701f63a606c0 h1:bVwtbF629Xlyxk6xLQq2TDYmqP0uiWaet5LwRebuY0k= -golang.org/x/exp/typeparams v0.0.0-20240909161429-701f63a606c0/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk= +golang.org/x/exp/typeparams v0.0.0-20241108190413-2d47ceb2692f h1:WTyX8eCCyfdqiPYkRGm0MqElSfYFH3yR1+rl/mct9sA= +golang.org/x/exp/typeparams v0.0.0-20241108190413-2d47ceb2692f/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk= golang.org/x/image v0.0.0-20180708004352-c73c2afc3b81/go.mod h1:ux5Hcp/YLpHSI86hEcLt0YII63i6oz57MZXIpbrjZUs= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= @@ -2115,8 +2115,8 @@ golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk= golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= golang.org/x/net v0.20.0/go.mod h1:z8BVo6PvndSri0LbOE3hAn0apkU+1YvI6E70E9jsnvY= -golang.org/x/net v0.31.0 h1:68CPQngjLL0r2AlUKiSxtQFKvzRVbnzLwMUn5SzcLHo= -golang.org/x/net v0.31.0/go.mod h1:P4fl1q7dY2hnZFxEk4pPSkDHF+QqjitcnDjUQyMM+pM= +golang.org/x/net v0.32.0 h1:ZqPmj8Kzc+Y6e0+skZsuACbx+wzMgo5MQsJh9Qd6aYI= +golang.org/x/net v0.32.0/go.mod h1:CwU0IoeOlnQQWJ6ioyFrfRuomB8GKF6KbYXZVyeXNfs= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -2170,8 +2170,8 @@ golang.org/x/sync v0.0.0-20220929204114-8fcdb60fdcc0/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.2.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= -golang.org/x/sync v0.9.0 h1:fEo0HyrW1GIgZdpbhCRO0PkJajUS5H9IFUztCgEo2jQ= -golang.org/x/sync v0.9.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.10.0 h1:3NQrjDixjgGwUOCaF8w2+VYHv0Ve/vGYSbdkTa98gmQ= +golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -2278,8 +2278,8 @@ golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s= -golang.org/x/sys v0.27.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA= +golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= @@ -2293,8 +2293,8 @@ golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= golang.org/x/term v0.12.0/go.mod h1:owVbMEjm3cBLCHdkQu9b1opXd4ETQWc3BhuQGKgXgvU= golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U= golang.org/x/term v0.16.0/go.mod h1:yn7UURbUtPyrVJPGPq404EukNFxcm/foM+bV/bfcDsY= -golang.org/x/term v0.26.0 h1:WEQa6V3Gja/BhNxg540hBip/kkaYtRg3cxg4oXSw4AU= -golang.org/x/term v0.26.0/go.mod h1:Si5m1o57C5nBNQo5z1iq+XDijt21BDBDp2bK0QI8e3E= +golang.org/x/term v0.27.0 h1:WP60Sv1nlK1T6SupCHbXzSaN0b9wUmsPoRS9b61A23Q= +golang.org/x/term v0.27.0/go.mod h1:iMsnZpn0cago0GOrHO2+Y7u7JPn5AylBrcoWkElMTSM= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -2313,8 +2313,8 @@ golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= -golang.org/x/text v0.20.0 h1:gK/Kv2otX8gz+wn7Rmb3vT96ZwuoxnQlY+HlJVj7Qug= -golang.org/x/text v0.20.0/go.mod h1:D4IsuqiFMhST5bX19pQ9ikHC2GsaKyk/oF+pn3ducp4= +golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= +golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -2688,8 +2688,8 @@ google.golang.org/grpc v1.52.0/go.mod h1:pu6fVzoFb+NBYNAvQL08ic+lvB2IojljRYuun5v google.golang.org/grpc v1.53.0/go.mod h1:OnIrk0ipVdj4N5d9IUoFUx72/VlD7+jUsHwZgwSMQpw= google.golang.org/grpc v1.54.0/go.mod h1:PUSEXI6iWghWaB6lXM4knEgpJNu2qUcKfDtNci3EC2g= google.golang.org/grpc v1.55.0/go.mod h1:iYEXKGkEBhg1PjZQvoYEVPTDkHo1/bjTnfwTeGONTY8= -google.golang.org/grpc v1.68.0 h1:aHQeeJbo8zAkAa3pRzrVjZlbz6uSfeOXlJNQM0RAbz0= -google.golang.org/grpc v1.68.0/go.mod h1:fmSPC5AsjSBCK54MyHRx48kpOti1/jRfOlwEWywNjWA= +google.golang.org/grpc v1.68.1 h1:oI5oTa11+ng8r8XMMN7jAOmWfPZWbYpCFaMUTACxkM0= +google.golang.org/grpc v1.68.1/go.mod h1:+q1XYFJjShcqn0QZHvCyeR4CXPA+llXIeUIfIe00waw= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= diff --git a/protocol/lib/ante/nested_msg.go b/protocol/lib/ante/nested_msg.go index cf3cd6433f..2c6e64cc8a 100644 --- a/protocol/lib/ante/nested_msg.go +++ b/protocol/lib/ante/nested_msg.go @@ -12,7 +12,7 @@ import ( ) const DYDX_MSG_PREFIX = "/" + constants.AppName -const CONNECT_MSG_PREFIX = "/connect" +const SLINKY_MSG_PREFIX = "/slinky" // IsNestedMsg returns true if the given msg is a nested msg. func IsNestedMsg(msg sdk.Msg) bool { @@ -33,9 +33,9 @@ func IsDydxMsg(msg sdk.Msg) bool { return strings.HasPrefix(sdk.MsgTypeURL(msg), DYDX_MSG_PREFIX) } -// IsConnectMsg returns true if the given msg is a Connect custom msg. -func IsConnectMsg(msg sdk.Msg) bool { - return strings.HasPrefix(sdk.MsgTypeURL(msg), CONNECT_MSG_PREFIX) +// IsSlinkyMsg returns true if the given msg is a Slinky custom msg. +func IsSlinkyMsg(msg sdk.Msg) bool { + return strings.HasPrefix(sdk.MsgTypeURL(msg), SLINKY_MSG_PREFIX) } // ValidateNestedMsg returns err if the given msg is an invalid nested msg. @@ -86,8 +86,8 @@ func validateInnerMsg(msg sdk.Msg) error { if IsDydxMsg(inner) { return fmt.Errorf("Invalid nested msg for MsgExec: dydx msg type") } - if IsConnectMsg(inner) { - return fmt.Errorf("Invalid nested msg for MsgExec: Connect msg type") + if IsSlinkyMsg(inner) { + return fmt.Errorf("Invalid nested msg for MsgExec: Slinky msg type") } } diff --git a/protocol/lib/ante/nested_msg_test.go b/protocol/lib/ante/nested_msg_test.go index 0a98a94b84..8a4b149052 100644 --- a/protocol/lib/ante/nested_msg_test.go +++ b/protocol/lib/ante/nested_msg_test.go @@ -22,7 +22,7 @@ var ( invalidInnerMsgErr_AppInjected = fmt.Errorf("Invalid nested msg: app-injected msg type") invalidInnerMsgErr_Nested = fmt.Errorf("Invalid nested msg: double-nested msg type") invalidInnerMsgErr_Dydx = fmt.Errorf("Invalid nested msg for MsgExec: dydx msg type") - invalidInnerMsgErr_Connect = fmt.Errorf("Invalid nested msg for MsgExec: Connect msg type") + invalidInnerMsgErr_Slinky = fmt.Errorf("Invalid nested msg for MsgExec: Slinky msg type") ) func TestIsNestedMsg_Empty(t *testing.T) { @@ -107,32 +107,32 @@ func TestIsDydxMsg_Valid(t *testing.T) { } } -func TestIsConnectMsg_Invalid(t *testing.T) { - allConnectMsgs := lib.MergeAllMapsMustHaveDistinctKeys( - appmsgs.NormalMsgsConnect, +func TestIsSlinkyMsg_Invalid(t *testing.T) { + allSlinkyMsgs := lib.MergeAllMapsMustHaveDistinctKeys( + appmsgs.NormalMsgsSlinky, ) - allMsgsMinusConnect := lib.MergeAllMapsMustHaveDistinctKeys(appmsgs.AllowMsgs, appmsgs.DisallowMsgs) - for key := range allConnectMsgs { - delete(allMsgsMinusConnect, key) + allMsgsMinusSlinky := lib.MergeAllMapsMustHaveDistinctKeys(appmsgs.AllowMsgs, appmsgs.DisallowMsgs) + for key := range allSlinkyMsgs { + delete(allMsgsMinusSlinky, key) } - allNonNilSampleMsgs := testmsgs.GetNonNilSampleMsgs(allMsgsMinusConnect) + allNonNilSampleMsgs := testmsgs.GetNonNilSampleMsgs(allMsgsMinusSlinky) for _, sampleMsg := range allNonNilSampleMsgs { t.Run(sampleMsg.Name, func(t *testing.T) { - require.False(t, ante.IsConnectMsg(sampleMsg.Msg)) + require.False(t, ante.IsSlinkyMsg(sampleMsg.Msg)) }) } } -func TestIsConnectMsg_Valid(t *testing.T) { - allConnectMsgs := lib.MergeAllMapsMustHaveDistinctKeys( - appmsgs.NormalMsgsConnect, +func TestIsSlinkyMsg_Valid(t *testing.T) { + allSlinkyMsgs := lib.MergeAllMapsMustHaveDistinctKeys( + appmsgs.NormalMsgsSlinky, ) - allNonNilSampleMsgs := testmsgs.GetNonNilSampleMsgs(allConnectMsgs) + allNonNilSampleMsgs := testmsgs.GetNonNilSampleMsgs(allSlinkyMsgs) for _, sampleMsg := range allNonNilSampleMsgs { t.Run(sampleMsg.Name, func(t *testing.T) { - require.True(t, ante.IsConnectMsg(sampleMsg.Msg)) + require.True(t, ante.IsSlinkyMsg(sampleMsg.Msg)) }) } } @@ -174,9 +174,9 @@ func TestValidateNestedMsg(t *testing.T) { msg: &testmsgs.MsgExecWithDydxMessage, expectedErr: invalidInnerMsgErr_Dydx, }, - "Invalid MsgExec: Connect custom msg": { - msg: &testmsgs.MsgExecWithConnectMessage, - expectedErr: invalidInnerMsgErr_Connect, + "Invalid MsgExec: Slinky custom msg": { + msg: &testmsgs.MsgExecWithSlinkyMessage, + expectedErr: invalidInnerMsgErr_Slinky, }, "Valid: empty inner msg": { msg: testmsgs.MsgSubmitProposalWithEmptyInner, diff --git a/protocol/lib/marketmap/utils.go b/protocol/lib/marketmap/utils.go index 9cad05780e..18d82861d7 100644 --- a/protocol/lib/marketmap/utils.go +++ b/protocol/lib/marketmap/utils.go @@ -2,9 +2,9 @@ package marketmap import ( pricestypes "github.com/dydxprotocol/v4-chain/protocol/x/prices/types" - dydx "github.com/skip-mev/connect/v2/providers/apis/dydx" - dydxtypes "github.com/skip-mev/connect/v2/providers/apis/dydx/types" - marketmaptypes "github.com/skip-mev/connect/v2/x/marketmap/types" + dydx "github.com/skip-mev/slinky/providers/apis/dydx" + dydxtypes "github.com/skip-mev/slinky/providers/apis/dydx/types" + marketmaptypes "github.com/skip-mev/slinky/x/marketmap/types" ) // Construct a MarketMap struct from a slice of MarketParams diff --git a/protocol/lib/marketmap/utils_test.go b/protocol/lib/marketmap/utils_test.go index eb8f6ce4f3..94f6ce075d 100644 --- a/protocol/lib/marketmap/utils_test.go +++ b/protocol/lib/marketmap/utils_test.go @@ -5,8 +5,8 @@ import ( "github.com/dydxprotocol/v4-chain/protocol/lib/marketmap" pricestypes "github.com/dydxprotocol/v4-chain/protocol/x/prices/types" - slinkytypes "github.com/skip-mev/connect/v2/pkg/types" - marketmaptypes "github.com/skip-mev/connect/v2/x/marketmap/types" + slinkytypes "github.com/skip-mev/slinky/pkg/types" + marketmaptypes "github.com/skip-mev/slinky/x/marketmap/types" "github.com/stretchr/testify/require" ) diff --git a/protocol/lib/slinky/utils.go b/protocol/lib/slinky/utils.go index 0fa0c71737..1a3417a9cc 100644 --- a/protocol/lib/slinky/utils.go +++ b/protocol/lib/slinky/utils.go @@ -4,7 +4,7 @@ import ( "fmt" "strings" - "github.com/skip-mev/connect/v2/pkg/types" + "github.com/skip-mev/slinky/pkg/types" ) /* diff --git a/protocol/lib/slinky/utils_test.go b/protocol/lib/slinky/utils_test.go index 6d9bc388fc..a2ee405e4b 100644 --- a/protocol/lib/slinky/utils_test.go +++ b/protocol/lib/slinky/utils_test.go @@ -4,7 +4,7 @@ import ( "fmt" "testing" - "github.com/skip-mev/connect/v2/pkg/types" + "github.com/skip-mev/slinky/pkg/types" "github.com/stretchr/testify/require" "github.com/dydxprotocol/v4-chain/protocol/lib/slinky" diff --git a/protocol/testing/e2e/gov/add_new_market_test.go b/protocol/testing/e2e/gov/add_new_market_test.go index 345a1d9752..f12c533c49 100644 --- a/protocol/testing/e2e/gov/add_new_market_test.go +++ b/protocol/testing/e2e/gov/add_new_market_test.go @@ -6,7 +6,7 @@ import ( "github.com/dydxprotocol/v4-chain/protocol/lib" "github.com/dydxprotocol/v4-chain/protocol/lib/slinky" - marketmaptypes "github.com/skip-mev/connect/v2/x/marketmap/types" + marketmaptypes "github.com/skip-mev/slinky/x/marketmap/types" "github.com/cometbft/cometbft/types" sdk "github.com/cosmos/cosmos-sdk/types" diff --git a/protocol/testing/e2e/gov/perpetuals_test.go b/protocol/testing/e2e/gov/perpetuals_test.go index 5ba02bd3a1..e4a5feac4a 100644 --- a/protocol/testing/e2e/gov/perpetuals_test.go +++ b/protocol/testing/e2e/gov/perpetuals_test.go @@ -15,8 +15,8 @@ import ( clobtypes "github.com/dydxprotocol/v4-chain/protocol/x/clob/types" perptypes "github.com/dydxprotocol/v4-chain/protocol/x/perpetuals/types" pricestypes "github.com/dydxprotocol/v4-chain/protocol/x/prices/types" - slinkytypes "github.com/skip-mev/connect/v2/pkg/types" - marketmaptypes "github.com/skip-mev/connect/v2/x/marketmap/types" + slinkytypes "github.com/skip-mev/slinky/pkg/types" + marketmaptypes "github.com/skip-mev/slinky/x/marketmap/types" "github.com/stretchr/testify/require" ) diff --git a/protocol/testing/e2e/gov/prices_test.go b/protocol/testing/e2e/gov/prices_test.go index debede63c3..5be07aaa0a 100644 --- a/protocol/testing/e2e/gov/prices_test.go +++ b/protocol/testing/e2e/gov/prices_test.go @@ -14,7 +14,7 @@ import ( clobtypes "github.com/dydxprotocol/v4-chain/protocol/x/clob/types" perptypes "github.com/dydxprotocol/v4-chain/protocol/x/perpetuals/types" pricestypes "github.com/dydxprotocol/v4-chain/protocol/x/prices/types" - marketmaptypes "github.com/skip-mev/connect/v2/x/marketmap/types" + marketmaptypes "github.com/skip-mev/slinky/x/marketmap/types" "github.com/stretchr/testify/require" ) diff --git a/protocol/testutil/app/app.go b/protocol/testutil/app/app.go index 69d76021f3..b2adaf6c7d 100644 --- a/protocol/testutil/app/app.go +++ b/protocol/testutil/app/app.go @@ -68,7 +68,7 @@ import ( satypes "github.com/dydxprotocol/v4-chain/protocol/x/subaccounts/types" vaulttypes "github.com/dydxprotocol/v4-chain/protocol/x/vault/types" vesttypes "github.com/dydxprotocol/v4-chain/protocol/x/vest/types" - marketmapmoduletypes "github.com/skip-mev/connect/v2/x/marketmap/types" + marketmapmoduletypes "github.com/skip-mev/slinky/x/marketmap/types" "github.com/stretchr/testify/require" "golang.org/x/exp/slices" ) diff --git a/protocol/testutil/constants/marketmap.go b/protocol/testutil/constants/marketmap.go index c12de9f4c1..32fbcb0796 100644 --- a/protocol/testutil/constants/marketmap.go +++ b/protocol/testutil/constants/marketmap.go @@ -4,8 +4,8 @@ import ( authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" "github.com/dydxprotocol/v4-chain/protocol/lib/slinky" - slinkytypes "github.com/skip-mev/connect/v2/pkg/types" - marketmapmoduletypes "github.com/skip-mev/connect/v2/x/marketmap/types" + slinkytypes "github.com/skip-mev/slinky/pkg/types" + marketmapmoduletypes "github.com/skip-mev/slinky/x/marketmap/types" ) var GovAuthority = authtypes.NewModuleAddress(govtypes.ModuleName).String() diff --git a/protocol/testutil/keeper/clob.go b/protocol/testutil/keeper/clob.go index 9f5e6fa7e9..661d901d62 100644 --- a/protocol/testutil/keeper/clob.go +++ b/protocol/testutil/keeper/clob.go @@ -34,7 +34,7 @@ import ( subkeeper "github.com/dydxprotocol/v4-chain/protocol/x/subaccounts/keeper" satypes "github.com/dydxprotocol/v4-chain/protocol/x/subaccounts/types" vaultkeeper "github.com/dydxprotocol/v4-chain/protocol/x/vault/keeper" - marketmapkeeper "github.com/skip-mev/connect/v2/x/marketmap/keeper" + marketmapkeeper "github.com/skip-mev/slinky/x/marketmap/keeper" "github.com/stretchr/testify/require" ) diff --git a/protocol/testutil/keeper/listing.go b/protocol/testutil/keeper/listing.go index dbe7c61eb3..6af935aa50 100644 --- a/protocol/testutil/keeper/listing.go +++ b/protocol/testutil/keeper/listing.go @@ -17,7 +17,7 @@ import ( priceskeeper "github.com/dydxprotocol/v4-chain/protocol/x/prices/keeper" subaccountskeeper "github.com/dydxprotocol/v4-chain/protocol/x/subaccounts/keeper" vaultkeeper "github.com/dydxprotocol/v4-chain/protocol/x/vault/keeper" - marketmapkeeper "github.com/skip-mev/connect/v2/x/marketmap/keeper" + marketmapkeeper "github.com/skip-mev/slinky/x/marketmap/keeper" "github.com/stretchr/testify/mock" "testing" diff --git a/protocol/testutil/keeper/marketmap.go b/protocol/testutil/keeper/marketmap.go index 8310b75463..266b88af54 100644 --- a/protocol/testutil/keeper/marketmap.go +++ b/protocol/testutil/keeper/marketmap.go @@ -5,10 +5,10 @@ import ( "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/runtime" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/skip-mev/connect/v2/x/marketmap/types" + "github.com/skip-mev/slinky/x/marketmap/types" storetypes "cosmossdk.io/store/types" - keeper "github.com/skip-mev/connect/v2/x/marketmap/keeper" + keeper "github.com/skip-mev/slinky/x/marketmap/keeper" ) func createMarketMapKeeper( diff --git a/protocol/testutil/keeper/perpetuals.go b/protocol/testutil/keeper/perpetuals.go index b79300d625..0805ea94fc 100644 --- a/protocol/testutil/keeper/perpetuals.go +++ b/protocol/testutil/keeper/perpetuals.go @@ -25,7 +25,7 @@ import ( "github.com/dydxprotocol/v4-chain/protocol/x/perpetuals/types" priceskeeper "github.com/dydxprotocol/v4-chain/protocol/x/prices/keeper" pricestypes "github.com/dydxprotocol/v4-chain/protocol/x/prices/types" - marketmapkeeper "github.com/skip-mev/connect/v2/x/marketmap/keeper" + marketmapkeeper "github.com/skip-mev/slinky/x/marketmap/keeper" "github.com/stretchr/testify/require" ) diff --git a/protocol/testutil/keeper/prices.go b/protocol/testutil/keeper/prices.go index d19468ecc2..bedbb6b7ac 100644 --- a/protocol/testutil/keeper/prices.go +++ b/protocol/testutil/keeper/prices.go @@ -26,7 +26,7 @@ import ( "github.com/dydxprotocol/v4-chain/protocol/x/prices/keeper" "github.com/dydxprotocol/v4-chain/protocol/x/prices/types" revsharekeeper "github.com/dydxprotocol/v4-chain/protocol/x/revshare/keeper" - marketmapkeeper "github.com/skip-mev/connect/v2/x/marketmap/keeper" + marketmapkeeper "github.com/skip-mev/slinky/x/marketmap/keeper" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" ) diff --git a/protocol/testutil/msgs/nested_msgs.go b/protocol/testutil/msgs/nested_msgs.go index 207903bd27..29a5fd9270 100644 --- a/protocol/testutil/msgs/nested_msgs.go +++ b/protocol/testutil/msgs/nested_msgs.go @@ -10,7 +10,7 @@ import ( "github.com/dydxprotocol/v4-chain/protocol/testutil/encoding" prices "github.com/dydxprotocol/v4-chain/protocol/x/prices/types" sending "github.com/dydxprotocol/v4-chain/protocol/x/sending/types" - marketmap "github.com/skip-mev/connect/v2/x/marketmap/types" + marketmap "github.com/skip-mev/slinky/x/marketmap/types" ) func init() { @@ -47,8 +47,8 @@ func init() { _ = testTxBuilder.SetMsgs(&MsgExecWithDydxMessage) MsgExecWithDydxMessageTxBytes, _ = testEncodingCfg.TxConfig.TxEncoder()(testTxBuilder.GetTx()) - _ = testTxBuilder.SetMsgs(&MsgExecWithConnectMessage) - MsgExecWithConnectMessageTxBytes, _ = testEncodingCfg.TxConfig.TxEncoder()(testTxBuilder.GetTx()) + _ = testTxBuilder.SetMsgs(&MsgExecWithSlinkyMessage) + MsgExecWithSlinkyMessageTxBytes, _ = testEncodingCfg.TxConfig.TxEncoder()(testTxBuilder.GetTx()) _ = testTxBuilder.SetMsgs(MsgSubmitProposalWithUpgrade) MsgSubmitProposalWithUpgradeTxBytes, _ = testEncodingCfg.TxConfig.TxEncoder()(testTxBuilder.GetTx()) @@ -124,11 +124,11 @@ var ( ) MsgExecWithDydxMessageTxBytes []byte - MsgExecWithConnectMessage = authz.NewMsgExec( + MsgExecWithSlinkyMessage = authz.NewMsgExec( constants.AliceAccAddress, []sdk.Msg{&marketmap.MsgUpsertMarkets{}}, ) - MsgExecWithConnectMessageTxBytes []byte + MsgExecWithSlinkyMessageTxBytes []byte // Valid MsgSubmitProposals MsgSubmitProposalWithUpgrade, _ = gov.NewMsgSubmitProposal( diff --git a/protocol/testutil/network/network.go b/protocol/testutil/network/network.go index e4d156b6c1..d620a870cd 100644 --- a/protocol/testutil/network/network.go +++ b/protocol/testutil/network/network.go @@ -29,7 +29,7 @@ import ( "github.com/dydxprotocol/v4-chain/protocol/testutil/ci" pricestypes "github.com/dydxprotocol/v4-chain/protocol/x/prices/types" "github.com/gofrs/flock" - marketmaptypes "github.com/skip-mev/connect/v2/x/marketmap/types" + marketmaptypes "github.com/skip-mev/slinky/x/marketmap/types" "github.com/stretchr/testify/require" ) diff --git a/protocol/testutil/prices/cli/util.go b/protocol/testutil/prices/cli/util.go index 58291b75a8..0dfa56e8d7 100644 --- a/protocol/testutil/prices/cli/util.go +++ b/protocol/testutil/prices/cli/util.go @@ -8,7 +8,7 @@ import ( "github.com/dydxprotocol/v4-chain/protocol/testutil/constants" "github.com/dydxprotocol/v4-chain/protocol/testutil/network" "github.com/dydxprotocol/v4-chain/protocol/x/prices/types" - marketmaptypes "github.com/skip-mev/connect/v2/x/marketmap/types" + marketmaptypes "github.com/skip-mev/slinky/x/marketmap/types" "github.com/stretchr/testify/require" ) diff --git a/protocol/x/clob/keeper/process_operations.go b/protocol/x/clob/keeper/process_operations.go index 057256554e..86808afb5d 100644 --- a/protocol/x/clob/keeper/process_operations.go +++ b/protocol/x/clob/keeper/process_operations.go @@ -752,7 +752,7 @@ func (k Keeper) PersistMatchDeleveragingToState( // negative TNC subaccount was seen. if len(matchDeleveraging.GetFills()) == 0 { if !shouldDeleverageAtBankruptcyPrice { - return errorsmod.Wrap( + return errorsmod.Wrapf( types.ErrZeroFillDeleveragingForNonNegativeTncSubaccount, fmt.Sprintf( "PersistMatchDeleveragingToState: zero-fill deleveraging operation included for subaccount %+v"+ diff --git a/protocol/x/clob/module_test.go b/protocol/x/clob/module_test.go index 9c1903713c..ce1793e1cb 100644 --- a/protocol/x/clob/module_test.go +++ b/protocol/x/clob/module_test.go @@ -33,7 +33,7 @@ import ( "github.com/dydxprotocol/v4-chain/protocol/x/prices" prices_keeper "github.com/dydxprotocol/v4-chain/protocol/x/prices/keeper" "github.com/grpc-ecosystem/grpc-gateway/runtime" - marketmap_keeper "github.com/skip-mev/connect/v2/x/marketmap/keeper" + marketmap_keeper "github.com/skip-mev/slinky/x/marketmap/keeper" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" ) diff --git a/protocol/x/delaymsg/keeper/delayed_message.go b/protocol/x/delaymsg/keeper/delayed_message.go index dd3395e62e..a89f2ea788 100644 --- a/protocol/x/delaymsg/keeper/delayed_message.go +++ b/protocol/x/delaymsg/keeper/delayed_message.go @@ -188,7 +188,7 @@ func validateSigners(signers [][]byte) error { ) } if !bytes.Equal(signers[0], types.ModuleAddress) { - return errorsmod.Wrap( + return errorsmod.Wrapf( types.ErrInvalidSigner, "message signer must be delaymsg module address", ) @@ -201,7 +201,7 @@ func (k Keeper) ValidateMsg(msg sdk.Msg, signers [][]byte) error { handler := k.router.Handler(msg) // If the message type is not routable, return an error. if handler == nil { - return errorsmod.Wrap( + return errorsmod.Wrapf( types.ErrMsgIsUnroutable, sdk.MsgTypeURL(msg), ) diff --git a/protocol/x/listing/keeper/listing.go b/protocol/x/listing/keeper/listing.go index eddb127bb9..7518ea346f 100644 --- a/protocol/x/listing/keeper/listing.go +++ b/protocol/x/listing/keeper/listing.go @@ -1,7 +1,6 @@ package keeper import ( - "context" "fmt" "math" "math/big" @@ -18,7 +17,7 @@ import ( "github.com/dydxprotocol/v4-chain/protocol/x/listing/types" perpetualtypes "github.com/dydxprotocol/v4-chain/protocol/x/perpetuals/types" pricestypes "github.com/dydxprotocol/v4-chain/protocol/x/prices/types" - "github.com/skip-mev/connect/v2/x/marketmap/types/tickermetadata" + "github.com/skip-mev/slinky/x/marketmap/types/tickermetadata" ) // Function to set hard cap on listed markets in module store @@ -41,12 +40,10 @@ func (k Keeper) GetMarketsHardCap(ctx sdk.Context) (hardCap uint32) { // Function to wrap the creation of a new market // Note: This will only list long-tail/isolated markets func (k Keeper) CreateMarket( - ctx context.Context, + ctx sdk.Context, ticker string, ) (marketId uint32, err error) { - sdkCtx := sdk.UnwrapSDKContext(ctx) - - marketId = k.PricesKeeper.AcquireNextMarketID(sdkCtx) + marketId = k.PricesKeeper.AcquireNextMarketID(ctx) // Get market details from marketmap // TODO: change to use util from marketmap when available @@ -54,14 +51,14 @@ func (k Keeper) CreateMarket( if err != nil { return 0, err } - marketMapDetails, err := k.MarketMapKeeper.GetMarket(sdkCtx, marketMapPair.String()) + marketMapDetails, err := k.MarketMapKeeper.GetMarket(ctx, marketMapPair.String()) if err != nil { return 0, types.ErrMarketNotFound } // Create a new market market, err := k.PricesKeeper.CreateMarket( - sdkCtx, + ctx, pricestypes.MarketParam{ Id: marketId, Pair: ticker, diff --git a/protocol/x/listing/keeper/listing_test.go b/protocol/x/listing/keeper/listing_test.go index 539dab6a49..bc315c2969 100644 --- a/protocol/x/listing/keeper/listing_test.go +++ b/protocol/x/listing/keeper/listing_test.go @@ -21,9 +21,9 @@ import ( clobtypes "github.com/dydxprotocol/v4-chain/protocol/x/clob/types" perpetualtypes "github.com/dydxprotocol/v4-chain/protocol/x/perpetuals/types" - oracletypes "github.com/skip-mev/connect/v2/pkg/types" - marketmaptypes "github.com/skip-mev/connect/v2/x/marketmap/types" - "github.com/skip-mev/connect/v2/x/marketmap/types/tickermetadata" + oracletypes "github.com/skip-mev/slinky/pkg/types" + marketmaptypes "github.com/skip-mev/slinky/x/marketmap/types" + "github.com/skip-mev/slinky/x/marketmap/types/tickermetadata" pricestypes "github.com/dydxprotocol/v4-chain/protocol/x/prices/types" diff --git a/protocol/x/listing/keeper/msg_create_market_permissionless_test.go b/protocol/x/listing/keeper/msg_create_market_permissionless_test.go index 63b47043b4..a1f351e0b2 100644 --- a/protocol/x/listing/keeper/msg_create_market_permissionless_test.go +++ b/protocol/x/listing/keeper/msg_create_market_permissionless_test.go @@ -12,9 +12,9 @@ import ( pricestypes "github.com/dydxprotocol/v4-chain/protocol/x/prices/types" satypes "github.com/dydxprotocol/v4-chain/protocol/x/subaccounts/types" vaulttypes "github.com/dydxprotocol/v4-chain/protocol/x/vault/types" - oracletypes "github.com/skip-mev/connect/v2/pkg/types" - marketmaptypes "github.com/skip-mev/connect/v2/x/marketmap/types" - "github.com/skip-mev/connect/v2/x/marketmap/types/tickermetadata" + oracletypes "github.com/skip-mev/slinky/pkg/types" + marketmaptypes "github.com/skip-mev/slinky/x/marketmap/types" + "github.com/skip-mev/slinky/x/marketmap/types/tickermetadata" "github.com/stretchr/testify/require" "testing" diff --git a/protocol/x/listing/types/expected_keepers.go b/protocol/x/listing/types/expected_keepers.go index 5fd30efa1b..e00635f158 100644 --- a/protocol/x/listing/types/expected_keepers.go +++ b/protocol/x/listing/types/expected_keepers.go @@ -1,7 +1,6 @@ package types import ( - "context" "math/big" vaulttypes "github.com/dydxprotocol/v4-chain/protocol/x/vault/types" @@ -11,12 +10,12 @@ import ( perpetualtypes "github.com/dydxprotocol/v4-chain/protocol/x/perpetuals/types" pricestypes "github.com/dydxprotocol/v4-chain/protocol/x/prices/types" satypes "github.com/dydxprotocol/v4-chain/protocol/x/subaccounts/types" - marketmaptypes "github.com/skip-mev/connect/v2/x/marketmap/types" + marketmaptypes "github.com/skip-mev/slinky/x/marketmap/types" ) type PricesKeeper interface { CreateMarket( - ctx context.Context, + ctx sdk.Context, marketParam pricestypes.MarketParam, marketPrice pricestypes.MarketPrice, ) (pricestypes.MarketParam, error) @@ -42,12 +41,12 @@ type ClobKeeper interface { type MarketMapKeeper interface { GetMarket( - ctx context.Context, + ctx sdk.Context, ticker string, ) (marketmaptypes.Market, error) // Only used for testing purposes CreateMarket( - ctx context.Context, + ctx sdk.Context, market marketmaptypes.Market, ) error } diff --git a/protocol/x/prices/keeper/market.go b/protocol/x/prices/keeper/market.go index 9523ad8846..d5c76cc310 100644 --- a/protocol/x/prices/keeper/market.go +++ b/protocol/x/prices/keeper/market.go @@ -1,7 +1,6 @@ package keeper import ( - "context" "fmt" gogotypes "github.com/cosmos/gogoproto/types" @@ -21,13 +20,11 @@ import ( // This is the only path to creating new MarketPrices, so if we have a param // defined for a market, we should expect to see a price defined, and vice versa. func (k Keeper) CreateMarket( - ctx context.Context, + ctx sdk.Context, marketParam types.MarketParam, marketPrice types.MarketPrice, ) (types.MarketParam, error) { - sdkCtx := sdk.UnwrapSDKContext(ctx) - - if _, exists := k.GetMarketParam(sdkCtx, marketParam.Id); exists { + if _, exists := k.GetMarketParam(ctx, marketParam.Id); exists { return types.MarketParam{}, errorsmod.Wrapf( types.ErrMarketParamAlreadyExists, "market param with id %d already exists", @@ -43,9 +40,9 @@ func (k Keeper) CreateMarket( return types.MarketParam{}, err } // Stateful Validation - for _, market := range k.GetAllMarketParams(sdkCtx) { + for _, market := range k.GetAllMarketParams(ctx) { if market.Pair == marketParam.Pair { - return types.MarketParam{}, errorsmod.Wrap( + return types.MarketParam{}, errorsmod.Wrapf( types.ErrMarketParamPairAlreadyExists, marketParam.Pair, ) @@ -54,7 +51,7 @@ func (k Keeper) CreateMarket( // check that the market exists in market map currencyPair, err := slinky.MarketPairToCurrencyPair(marketParam.Pair) if err != nil { - return types.MarketParam{}, errorsmod.Wrap( + return types.MarketParam{}, errorsmod.Wrapf( types.ErrMarketPairConversionFailed, marketParam.Pair, ) @@ -62,7 +59,7 @@ func (k Keeper) CreateMarket( currencyPairStr := currencyPair.String() marketMapDetails, err := k.MarketMapKeeper.GetMarket(ctx, currencyPairStr) if err != nil { - return types.MarketParam{}, errorsmod.Wrap( + return types.MarketParam{}, errorsmod.Wrapf( types.ErrTickerNotFoundInMarketMap, currencyPairStr, ) @@ -70,7 +67,7 @@ func (k Keeper) CreateMarket( // Check that the exponent of market price is the negation of the decimals value in the market map if marketPrice.Exponent != int32(marketMapDetails.Ticker.Decimals)*-1 { - return types.MarketParam{}, errorsmod.Wrap( + return types.MarketParam{}, errorsmod.Wrapf( types.ErrInvalidMarketPriceExponent, currencyPairStr, ) @@ -79,18 +76,18 @@ func (k Keeper) CreateMarket( paramBytes := k.cdc.MustMarshal(&marketParam) priceBytes := k.cdc.MustMarshal(&marketPrice) - marketParamStore := k.getMarketParamStore(sdkCtx) + marketParamStore := k.getMarketParamStore(ctx) marketParamStore.Set(lib.Uint32ToKey(marketParam.Id), paramBytes) - marketPriceStore := k.getMarketPriceStore(sdkCtx) + marketPriceStore := k.getMarketPriceStore(ctx) marketPriceStore.Set(lib.Uint32ToKey(marketPrice.Id), priceBytes) // add the pair to the currency-pair-id cache - k.AddCurrencyPairIDToStore(sdkCtx, marketParam.Id, currencyPair) + k.AddCurrencyPairIDToStore(ctx, marketParam.Id, currencyPair) // Generate indexer event. k.GetIndexerEventManager().AddTxnEvent( - sdkCtx, + ctx, indexerevents.SubtypeMarket, indexerevents.MarketEventVersion, indexer_manager.GetBytes( @@ -107,12 +104,12 @@ func (k Keeper) CreateMarket( metrics.SetMarketPairForTelemetry(marketParam.Id, marketParam.Pair) // create a new market rev share - k.RevShareKeeper.CreateNewMarketRevShare(sdkCtx, marketParam.Id) + k.RevShareKeeper.CreateNewMarketRevShare(ctx, marketParam.Id) // enable the market in the market map err = k.MarketMapKeeper.EnableMarket(ctx, currencyPairStr) if err != nil { - k.Logger(sdkCtx).Error( + k.Logger(ctx).Error( "failed to enable market in market map", "market ticker", currencyPairStr, @@ -133,7 +130,7 @@ func (k Keeper) GetExponent(ctx sdk.Context, ticker string) (int32, error) { marketMapDetails, err := k.MarketMapKeeper.GetMarket(ctx, currencyPair.String()) if err != nil { - return 0, errorsmod.Wrap( + return 0, errorsmod.Wrapf( types.ErrTickerNotFoundInMarketMap, ticker, ) diff --git a/protocol/x/prices/keeper/market_param.go b/protocol/x/prices/keeper/market_param.go index e364e3fcec..e62f92fc88 100644 --- a/protocol/x/prices/keeper/market_param.go +++ b/protocol/x/prices/keeper/market_param.go @@ -42,17 +42,17 @@ func (k Keeper) ModifyMarketParam( // Validate update is permitted. for _, market := range k.GetAllMarketParams(ctx) { if market.Pair == updatedMarketParam.Pair && market.Id != updatedMarketParam.Id { - return types.MarketParam{}, errorsmod.Wrap(types.ErrMarketParamPairAlreadyExists, updatedMarketParam.Pair) + return types.MarketParam{}, errorsmod.Wrapf(types.ErrMarketParamPairAlreadyExists, updatedMarketParam.Pair) } } // Validate that modified market param has a corresponding ticker in MarketMap cp, err := slinky.MarketPairToCurrencyPair(updatedMarketParam.Pair) if err != nil { - return types.MarketParam{}, errorsmod.Wrap(types.ErrMarketPairConversionFailed, updatedMarketParam.Pair) + return types.MarketParam{}, errorsmod.Wrapf(types.ErrMarketPairConversionFailed, updatedMarketParam.Pair) } if _, err := k.MarketMapKeeper.GetMarket(ctx, cp.String()); err != nil { - return types.MarketParam{}, errorsmod.Wrap(types.ErrTickerNotFoundInMarketMap, cp.String()) + return types.MarketParam{}, errorsmod.Wrapf(types.ErrTickerNotFoundInMarketMap, cp.String()) } // Store the modified market param. diff --git a/protocol/x/prices/keeper/market_param_test.go b/protocol/x/prices/keeper/market_param_test.go index 84c71fbcef..25c24d31a4 100644 --- a/protocol/x/prices/keeper/market_param_test.go +++ b/protocol/x/prices/keeper/market_param_test.go @@ -6,7 +6,7 @@ import ( "github.com/dydxprotocol/v4-chain/protocol/daemons/pricefeed/metrics" "github.com/dydxprotocol/v4-chain/protocol/lib/slinky" - marketmapkeeper "github.com/skip-mev/connect/v2/x/marketmap/keeper" + marketmapkeeper "github.com/skip-mev/slinky/x/marketmap/keeper" errorsmod "cosmossdk.io/errors" @@ -228,7 +228,7 @@ func TestModifyMarketParam_Errors(t *testing.T) { minExchanges: uint32(1), minPriceChangePpm: uint32(50), exchangeConfigJson: validExchangeConfigJson, - expectedErr: errorsmod.Wrap( + expectedErr: errorsmod.Wrapf( types.ErrMarketParamPairAlreadyExists, "1-1", ).Error(), @@ -239,7 +239,7 @@ func TestModifyMarketParam_Errors(t *testing.T) { minExchanges: uint32(1), minPriceChangePpm: uint32(50), exchangeConfigJson: validExchangeConfigJson, - expectedErr: errorsmod.Wrap( + expectedErr: errorsmod.Wrapf( types.ErrTickerNotFoundInMarketMap, invalidUpdateCurrencyPair.String(), ).Error(), diff --git a/protocol/x/prices/keeper/market_test.go b/protocol/x/prices/keeper/market_test.go index 4b4705d67f..6f58decb30 100644 --- a/protocol/x/prices/keeper/market_test.go +++ b/protocol/x/prices/keeper/market_test.go @@ -10,9 +10,8 @@ import ( "github.com/dydxprotocol/v4-chain/protocol/testutil/constants" keepertest "github.com/dydxprotocol/v4-chain/protocol/testutil/keeper" "github.com/dydxprotocol/v4-chain/protocol/x/prices/types" - - marketmapkeeper "github.com/skip-mev/connect/v2/x/marketmap/keeper" - marketmaptypes "github.com/skip-mev/connect/v2/x/marketmap/types" + marketmapkeeper "github.com/skip-mev/slinky/x/marketmap/keeper" + marketmaptypes "github.com/skip-mev/slinky/x/marketmap/types" "github.com/stretchr/testify/require" ) diff --git a/protocol/x/prices/keeper/msg_server_create_oracle_market_test.go b/protocol/x/prices/keeper/msg_server_create_oracle_market_test.go index f74702beae..ae3b4e95dd 100644 --- a/protocol/x/prices/keeper/msg_server_create_oracle_market_test.go +++ b/protocol/x/prices/keeper/msg_server_create_oracle_market_test.go @@ -12,8 +12,8 @@ import ( pricestest "github.com/dydxprotocol/v4-chain/protocol/testutil/prices" "github.com/dydxprotocol/v4-chain/protocol/x/prices/keeper" pricestypes "github.com/dydxprotocol/v4-chain/protocol/x/prices/types" - marketmapkeeper "github.com/skip-mev/connect/v2/x/marketmap/keeper" - marketmaptypes "github.com/skip-mev/connect/v2/x/marketmap/types" + marketmapkeeper "github.com/skip-mev/slinky/x/marketmap/keeper" + marketmaptypes "github.com/skip-mev/slinky/x/marketmap/types" "github.com/stretchr/testify/require" ) diff --git a/protocol/x/prices/keeper/slinky_adapter.go b/protocol/x/prices/keeper/slinky_adapter.go index 17aec50ae2..9cb12ae3e7 100644 --- a/protocol/x/prices/keeper/slinky_adapter.go +++ b/protocol/x/prices/keeper/slinky_adapter.go @@ -1,15 +1,14 @@ package keeper import ( - "context" "fmt" "cosmossdk.io/math" "cosmossdk.io/store/prefix" sdk "github.com/cosmos/cosmos-sdk/types" gogotypes "github.com/cosmos/gogoproto/types" - slinkytypes "github.com/skip-mev/connect/v2/pkg/types" - oracletypes "github.com/skip-mev/connect/v2/x/oracle/types" + slinkytypes "github.com/skip-mev/slinky/pkg/types" + oracletypes "github.com/skip-mev/slinky/x/oracle/types" "github.com/dydxprotocol/v4-chain/protocol/lib/slinky" "github.com/dydxprotocol/v4-chain/protocol/x/prices/types" @@ -28,28 +27,24 @@ func (k Keeper) getCurrencyPairIDStore(ctx sdk.Context) prefix.Store { return prefix.NewStore(ctx.KVStore(k.storeKey), []byte(types.CurrencyPairIDPrefix)) } -func (k Keeper) GetCurrencyPairFromID(ctx context.Context, id uint64) (cp slinkytypes.CurrencyPair, found bool) { - sdkCtx := sdk.UnwrapSDKContext(ctx) - - mp, found := k.GetMarketParam(sdkCtx, uint32(id)) +func (k Keeper) GetCurrencyPairFromID(ctx sdk.Context, id uint64) (cp slinkytypes.CurrencyPair, found bool) { + mp, found := k.GetMarketParam(ctx, uint32(id)) if !found { return cp, false } cp, err := slinky.MarketPairToCurrencyPair(mp.Pair) if err != nil { - k.Logger(sdkCtx).Error("CurrencyPairFromString", "error", err) + k.Logger(ctx).Error("CurrencyPairFromString", "error", err) return cp, false } return cp, true } -func (k Keeper) GetIDForCurrencyPair(ctx context.Context, cp slinkytypes.CurrencyPair) (uint64, bool) { - sdkCtx := sdk.UnwrapSDKContext(ctx) - +func (k Keeper) GetIDForCurrencyPair(ctx sdk.Context, cp slinkytypes.CurrencyPair) (uint64, bool) { // Try to get corresponding market ID of the currency pair from the store - marketId, found := k.GetCurrencyPairIDFromStore(sdkCtx, cp) + marketId, found := k.GetCurrencyPairIDFromStore(ctx, cp) if found { return uint64(marketId), true } @@ -84,15 +79,12 @@ func (k Keeper) RemoveCurrencyPairFromStore(ctx sdk.Context, cp slinkytypes.Curr currencyPairIDStore.Delete([]byte(currencyPairString)) } -func (k Keeper) GetPriceForCurrencyPair(ctx context.Context, cp slinkytypes.CurrencyPair) (oracletypes.QuotePrice, - error) { - sdkCtx := sdk.UnwrapSDKContext(ctx) - +func (k Keeper) GetPriceForCurrencyPair(ctx sdk.Context, cp slinkytypes.CurrencyPair) (oracletypes.QuotePrice, error) { id, found := k.GetIDForCurrencyPair(ctx, cp) if !found { return oracletypes.QuotePrice{}, fmt.Errorf("currency pair %s not found", cp.String()) } - mp, err := k.GetMarketPrice(sdkCtx, uint32(id)) + mp, err := k.GetMarketPrice(ctx, uint32(id)) if err != nil { return oracletypes.QuotePrice{}, fmt.Errorf("currency pair %s not found", cp.String()) } @@ -101,10 +93,8 @@ func (k Keeper) GetPriceForCurrencyPair(ctx context.Context, cp slinkytypes.Curr }, nil } -func (k Keeper) GetNumCurrencyPairs(ctx context.Context) (uint64, error) { - sdkCtx := sdk.UnwrapSDKContext(ctx) - - marketPriceStore := k.getMarketPriceStore(sdkCtx) +func (k Keeper) GetNumCurrencyPairs(ctx sdk.Context) (uint64, error) { + marketPriceStore := k.getMarketPriceStore(ctx) var numMarketPrices uint64 @@ -121,12 +111,12 @@ func (k Keeper) GetNumCurrencyPairs(ctx context.Context) (uint64, error) { } // GetNumRemovedCurrencyPairs is currently a no-op since we don't support removing Markets right now. -func (k Keeper) GetNumRemovedCurrencyPairs(_ context.Context) (uint64, error) { +func (k Keeper) GetNumRemovedCurrencyPairs(_ sdk.Context) (uint64, error) { return 0, nil } // GetAllCurrencyPairs is not used with the DefaultCurrencyPair strategy. -// See https://github.com/skip-mev/connect/v2/blob/main/abci/strategies/currencypair/default.go -func (k Keeper) GetAllCurrencyPairs(_ context.Context) []slinkytypes.CurrencyPair { +// See https://github.com/skip-mev/slinky/blob/main/abci/strategies/currencypair/default.go +func (k Keeper) GetAllCurrencyPairs(ctx sdk.Context) []slinkytypes.CurrencyPair { return nil } diff --git a/protocol/x/prices/keeper/slinky_adapter_test.go b/protocol/x/prices/keeper/slinky_adapter_test.go index 07dd3872a6..8351b29603 100644 --- a/protocol/x/prices/keeper/slinky_adapter_test.go +++ b/protocol/x/prices/keeper/slinky_adapter_test.go @@ -4,7 +4,7 @@ import ( "fmt" "testing" - oracletypes "github.com/skip-mev/connect/v2/pkg/types" + oracletypes "github.com/skip-mev/slinky/pkg/types" "github.com/stretchr/testify/require" "github.com/dydxprotocol/v4-chain/protocol/testutil/constants" diff --git a/protocol/x/prices/module_test.go b/protocol/x/prices/module_test.go index b9394fb624..a7bb8e3ff5 100644 --- a/protocol/x/prices/module_test.go +++ b/protocol/x/prices/module_test.go @@ -25,7 +25,7 @@ import ( prices_keeper "github.com/dydxprotocol/v4-chain/protocol/x/prices/keeper" pricestypes "github.com/dydxprotocol/v4-chain/protocol/x/prices/types" "github.com/grpc-ecosystem/grpc-gateway/runtime" - marketmapkeeper "github.com/skip-mev/connect/v2/x/marketmap/keeper" + marketmapkeeper "github.com/skip-mev/slinky/x/marketmap/keeper" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" ) diff --git a/protocol/x/prices/simulation/genesis.go b/protocol/x/prices/simulation/genesis.go index 370e4d945e..b29ea23bd0 100644 --- a/protocol/x/prices/simulation/genesis.go +++ b/protocol/x/prices/simulation/genesis.go @@ -15,7 +15,7 @@ import ( "github.com/dydxprotocol/v4-chain/protocol/lib/marketmap" "github.com/dydxprotocol/v4-chain/protocol/testutil/sim_helpers" "github.com/dydxprotocol/v4-chain/protocol/x/prices/types" - marketmaptypes "github.com/skip-mev/connect/v2/x/marketmap/types" + marketmaptypes "github.com/skip-mev/slinky/x/marketmap/types" ) // genNumMarkets returns randomized num markets. diff --git a/protocol/x/prices/types/expected_keepers.go b/protocol/x/prices/types/expected_keepers.go index 3f725019ec..ea3f8fad98 100644 --- a/protocol/x/prices/types/expected_keepers.go +++ b/protocol/x/prices/types/expected_keepers.go @@ -3,7 +3,7 @@ package types import ( "context" - marketmaptypes "github.com/skip-mev/connect/v2/x/marketmap/types" + marketmaptypes "github.com/skip-mev/slinky/x/marketmap/types" "github.com/dydxprotocol/v4-chain/protocol/x/revshare/types" @@ -32,8 +32,8 @@ type RevShareKeeper interface { // MarketMapKeeper defines the expected marketmap keeper used for simulations. type MarketMapKeeper interface { - GetAllMarkets(ctx context.Context) (map[string]marketmaptypes.Market, error) - GetMarket(ctx context.Context, tickerStr string) (marketmaptypes.Market, error) - EnableMarket(ctx context.Context, tickerStr string) error - DisableMarket(ctx context.Context, tickerStr string) error + GetAllMarkets(ctx sdk.Context) (map[string]marketmaptypes.Market, error) + GetMarket(ctx sdk.Context, tickerStr string) (marketmaptypes.Market, error) + EnableMarket(ctx sdk.Context, tickerStr string) error + DisableMarket(ctx sdk.Context, tickerStr string) error } diff --git a/protocol/x/prices/types/types.go b/protocol/x/prices/types/types.go index 8f225e7580..176f884c5a 100644 --- a/protocol/x/prices/types/types.go +++ b/protocol/x/prices/types/types.go @@ -1,18 +1,16 @@ package types import ( - "context" - "cosmossdk.io/log" sdk "github.com/cosmos/cosmos-sdk/types" - slinkytypes "github.com/skip-mev/connect/v2/pkg/types" - oracletypes "github.com/skip-mev/connect/v2/x/oracle/types" + slinkytypes "github.com/skip-mev/slinky/pkg/types" + oracletypes "github.com/skip-mev/slinky/x/oracle/types" ) type PricesKeeper interface { // Market related. CreateMarket( - ctx context.Context, + ctx sdk.Context, param MarketParam, price MarketPrice, ) (createdMarketParam MarketParam, err error) @@ -54,9 +52,9 @@ type PricesKeeper interface { AddCurrencyPairIDToStore(ctx sdk.Context, id uint32, cp slinkytypes.CurrencyPair) // Slinky compat - GetCurrencyPairFromID(ctx context.Context, id uint64) (cp slinkytypes.CurrencyPair, found bool) - GetIDForCurrencyPair(ctx context.Context, cp slinkytypes.CurrencyPair) (uint64, bool) - GetPriceForCurrencyPair(ctx context.Context, cp slinkytypes.CurrencyPair) (oracletypes.QuotePrice, error) + GetCurrencyPairFromID(ctx sdk.Context, id uint64) (cp slinkytypes.CurrencyPair, found bool) + GetIDForCurrencyPair(ctx sdk.Context, cp slinkytypes.CurrencyPair) (uint64, bool) + GetPriceForCurrencyPair(ctx sdk.Context, cp slinkytypes.CurrencyPair) (oracletypes.QuotePrice, error) SetNextMarketID(ctx sdk.Context, nextID uint32) } diff --git a/protocol/x/vault/keeper/orders.go b/protocol/x/vault/keeper/orders.go index 1129bb4651..311bbbbe38 100644 --- a/protocol/x/vault/keeper/orders.go +++ b/protocol/x/vault/keeper/orders.go @@ -45,7 +45,7 @@ func (k Keeper) RefreshAllVaultOrders(ctx sdk.Context) { vaultParams.QuotingParams = &defaultQuotingParams } vault := k.subaccountsKeeper.GetSubaccount(ctx, *vaultId.ToSubaccountId()) - if len(vault.PerpetualPositions) == 0 { + if vault.PerpetualPositions == nil || len(vault.PerpetualPositions) == 0 { if vault.GetUsdcPosition().Cmp(vaultParams.QuotingParams.ActivationThresholdQuoteQuantums.BigInt()) == -1 { continue } diff --git a/protocol/x/vest/types/vest_entry.go b/protocol/x/vest/types/vest_entry.go index 65aa112099..b091be3aa5 100644 --- a/protocol/x/vest/types/vest_entry.go +++ b/protocol/x/vest/types/vest_entry.go @@ -7,15 +7,15 @@ import ( func (entry VestEntry) Validate() error { if entry.VesterAccount == "" { - return errorsmod.Wrap(ErrInvalidVesterAccount, "vester account cannot be empty") + return errorsmod.Wrapf(ErrInvalidVesterAccount, "vester account cannot be empty") } if entry.TreasuryAccount == "" { - return errorsmod.Wrap(ErrInvalidTreasuryAccount, "treasury account cannot be empty") + return errorsmod.Wrapf(ErrInvalidTreasuryAccount, "treasury account cannot be empty") } if err := sdk.ValidateDenom(entry.Denom); err != nil { - return errorsmod.Wrap(ErrInvalidDenom, err.Error()) + return errorsmod.Wrapf(ErrInvalidDenom, err.Error()) } if !entry.StartTime.Before(entry.EndTime) { @@ -23,11 +23,11 @@ func (entry VestEntry) Validate() error { } if entry.StartTime.Location().String() != "UTC" { - return errorsmod.Wrap(ErrInvalidTimeZone, "start_time must be in UTC") + return errorsmod.Wrapf(ErrInvalidTimeZone, "start_time must be in UTC") } if entry.EndTime.Location().String() != "UTC" { - return errorsmod.Wrap(ErrInvalidTimeZone, "start_time must be in UTC") + return errorsmod.Wrapf(ErrInvalidTimeZone, "start_time must be in UTC") } return nil } From eea54abcffc8532b6d138ef7c4694d839d0b3b10 Mon Sep 17 00:00:00 2001 From: Chenyao Yu <4844716+chenyaoy@users.noreply.github.com> Date: Thu, 12 Dec 2024 22:21:58 -0500 Subject: [PATCH 02/13] mock --- protocol/go.mod | 2 +- protocol/mocks/Makefile | 108 ++++++++++++++++----------------- protocol/mocks/OracleClient.go | 6 +- protocol/mocks/PricesKeeper.go | 42 ++++++------- 4 files changed, 77 insertions(+), 81 deletions(-) diff --git a/protocol/go.mod b/protocol/go.mod index 753f09c14f..403a429be2 100644 --- a/protocol/go.mod +++ b/protocol/go.mod @@ -32,7 +32,7 @@ require ( github.com/spf13/cobra v1.8.1 github.com/spf13/pflag v1.0.5 github.com/stretchr/testify v1.10.0 - github.com/vektra/mockery/v2 v2.44.1 + github.com/vektra/mockery/v2 v2.50.0 github.com/zyedidia/generic v1.0.0 golang.org/x/exp v0.0.0-20240909161429-701f63a606c0 google.golang.org/genproto v0.0.0-20240903143218-8af14fe29dc1 // indirect diff --git a/protocol/mocks/Makefile b/protocol/mocks/Makefile index 33ef2f48fa..fd293a472d 100644 --- a/protocol/mocks/Makefile +++ b/protocol/mocks/Makefile @@ -4,64 +4,64 @@ COSMOS_VERSION=$(shell go list -m all | grep "github.com/dydxprotocol/cosmos-sdk COSMOS_STORE_VERSION=$(shell go list -m all | grep "cosmossdk.io/store[^/]" | awk '{print $$NF}') COSMOS_LOG_VERSION=$(shell go list -m all | grep "cosmossdk.io/log[^/]" | awk '{print $$NF}') COSMOS_GOGOPROTO_VERSION=$(shell go list -m all | grep "github.com/cosmos/gogoproto[^/]" | awk '{print $$NF}') -CONNECT_VERSION=$(shell go list -m all | grep "github.com/skip-mev/connect/v2[^/]" | awk '{print $$NF}') +SLINKY_VERSION=$(shell go list -m all | grep "github.com/skip-mev/slinky[^/]" | awk '{print $$NF}') mock-clean: @rm -f ./mocks/*.go mock-gen: - @go run github.com/vektra/mockery/v2 --name=Configurator --dir=$(GOPATH)/pkg/mod/github.com/dydxprotocol/cosmos-sdk@$(COSMOS_VERSION)/types --recursive --output=./mocks - @go run github.com/vektra/mockery/v2 --name=MultiStore --dir=$(GOPATH)/pkg/mod/github.com/dydxprotocol/cosmos-sdk/store@$(COSMOS_STORE_VERSION)/types --recursive --output=./mocks - @go run github.com/vektra/mockery/v2 --name=CacheMultiStore --dir=$(GOPATH)/pkg/mod/github.com/dydxprotocol/cosmos-sdk/store@$(COSMOS_STORE_VERSION)/types --recursive --output=./mocks - @go run github.com/vektra/mockery/v2 --name=AnteDecorator --dir=$(GOPATH)/pkg/mod/github.com/dydxprotocol/cosmos-sdk@$(COSMOS_VERSION)/types --recursive --output=./mocks - @go run github.com/vektra/mockery/v2 --name=TxConfig --dir=$(GOPATH)/pkg/mod/github.com/dydxprotocol/cosmos-sdk@$(COSMOS_VERSION)/client --recursive --output=./mocks - @go run github.com/vektra/mockery/v2 --name=TxBuilder --dir=$(GOPATH)/pkg/mod/github.com/dydxprotocol/cosmos-sdk@$(COSMOS_VERSION)/client --recursive --output=./mocks - @go run github.com/vektra/mockery/v2 --name=Keeper --dir=$(GOPATH)/pkg/mod/github.com/dydxprotocol/cosmos-sdk@$(COSMOS_VERSION)/x/bank/keeper --filename=BankKeeper.go --structname=BankKeeper --recursive --output=./mocks - @go run github.com/vektra/mockery/v2 --name=Server --dir=$(GOPATH)/pkg/mod/github.com/cosmos/gogoproto@$(COSMOS_GOGOPROTO_VERSION)/grpc --recursive --output=./mocks - @go run github.com/vektra/mockery/v2 --name=AppOptions --dir=$(GOPATH)/pkg/mod/github.com/dydxprotocol/cosmos-sdk@$(COSMOS_VERSION)/server/types --recursive --output=./mocks - @go run github.com/vektra/mockery/v2 --name=Logger --dir=$(GOPATH)/pkg/mod/cosmossdk.io/log@$(COSMOS_LOG_VERSION) --filename=logger.go --recursive --output=./mocks - @go run github.com/vektra/mockery/v2 --name=MsgRouter --dir=./lib --recursive --output=./mocks - @go run github.com/vektra/mockery/v2 --name=HealthCheckable --dir=./daemons/types --recursive --output=./mocks - @go run github.com/vektra/mockery/v2 --name=PrepareBridgeKeeper --dir=./app/prepare --recursive --output=./mocks - @go run github.com/vektra/mockery/v2 --name=PrepareClobKeeper --dir=./app/prepare --recursive --output=./mocks - @go run github.com/vektra/mockery/v2 --name=PreparePerpetualsKeeper --dir=./app/prepare --recursive --output=./mocks - @go run github.com/vektra/mockery/v2 --name=PricesKeeper --dir=./app/prepare --recursive --output=./mocks - @go run github.com/vektra/mockery/v2 --name=ProcessBridgeKeeper --dir=./app/process --recursive --output=./mocks - @go run github.com/vektra/mockery/v2 --name=ProcessClobKeeper --dir=./app/process --recursive --output=./mocks - @go run github.com/vektra/mockery/v2 --name=ProcessStakingKeeper --dir=./app/process --recursive --output=./mocks - @go run github.com/vektra/mockery/v2 --name=ProcessPerpetualKeeper --dir=./app/process --recursive --output=./mocks - @go run github.com/vektra/mockery/v2 --name=MemClob --dir=./x/clob/types --recursive --output=./mocks - @go run github.com/vektra/mockery/v2 --name=BridgeKeeper --dir=./x/bridge/types --recursive --output=./mocks - @go run github.com/vektra/mockery/v2 --name=DelayMsgKeeper --dir=./x/delaymsg/types --recursive --output=./mocks - @go run github.com/vektra/mockery/v2 --name=ClobKeeper --dir=./x/clob/types --recursive --output=./mocks - @go run github.com/vektra/mockery/v2 --name=MemClobKeeper --dir=./x/clob/types --recursive --output=./mocks + # @go run github.com/vektra/mockery/v2 --name=Configurator --dir=$(GOPATH)/pkg/mod/github.com/dydxprotocol/cosmos-sdk@$(COSMOS_VERSION)/types --recursive --output=./mocks + # @go run github.com/vektra/mockery/v2 --name=MultiStore --dir=$(GOPATH)/pkg/mod/github.com/dydxprotocol/cosmos-sdk/store@$(COSMOS_STORE_VERSION)/types --recursive --output=./mocks + # @go run github.com/vektra/mockery/v2 --name=CacheMultiStore --dir=$(GOPATH)/pkg/mod/github.com/dydxprotocol/cosmos-sdk/store@$(COSMOS_STORE_VERSION)/types --recursive --output=./mocks + # @go run github.com/vektra/mockery/v2 --name=AnteDecorator --dir=$(GOPATH)/pkg/mod/github.com/dydxprotocol/cosmos-sdk@$(COSMOS_VERSION)/types --recursive --output=./mocks + # @go run github.com/vektra/mockery/v2 --name=TxConfig --dir=$(GOPATH)/pkg/mod/github.com/dydxprotocol/cosmos-sdk@$(COSMOS_VERSION)/client --recursive --output=./mocks + # @go run github.com/vektra/mockery/v2 --name=TxBuilder --dir=$(GOPATH)/pkg/mod/github.com/dydxprotocol/cosmos-sdk@$(COSMOS_VERSION)/client --recursive --output=./mocks + # @go run github.com/vektra/mockery/v2 --name=Keeper --dir=$(GOPATH)/pkg/mod/github.com/dydxprotocol/cosmos-sdk@$(COSMOS_VERSION)/x/bank/keeper --filename=BankKeeper.go --structname=BankKeeper --recursive --output=./mocks + # @go run github.com/vektra/mockery/v2 --name=Server --dir=$(GOPATH)/pkg/mod/github.com/cosmos/gogoproto@$(COSMOS_GOGOPROTO_VERSION)/grpc --recursive --output=./mocks + # @go run github.com/vektra/mockery/v2 --name=AppOptions --dir=$(GOPATH)/pkg/mod/github.com/dydxprotocol/cosmos-sdk@$(COSMOS_VERSION)/server/types --recursive --output=./mocks + # @go run github.com/vektra/mockery/v2 --name=Logger --dir=$(GOPATH)/pkg/mod/cosmossdk.io/log@$(COSMOS_LOG_VERSION) --filename=logger.go --recursive --output=./mocks + # @go run github.com/vektra/mockery/v2 --name=MsgRouter --dir=./lib --recursive --output=./mocks + # @go run github.com/vektra/mockery/v2 --name=HealthCheckable --dir=./daemons/types --recursive --output=./mocks + # @go run github.com/vektra/mockery/v2 --name=PrepareBridgeKeeper --dir=./app/prepare --recursive --output=./mocks + # @go run github.com/vektra/mockery/v2 --name=PrepareClobKeeper --dir=./app/prepare --recursive --output=./mocks + # @go run github.com/vektra/mockery/v2 --name=PreparePerpetualsKeeper --dir=./app/prepare --recursive --output=./mocks + # @go run github.com/vektra/mockery/v2 --name=PricesKeeper --dir=./app/prepare --recursive --output=./mocks + # @go run github.com/vektra/mockery/v2 --name=ProcessBridgeKeeper --dir=./app/process --recursive --output=./mocks + # @go run github.com/vektra/mockery/v2 --name=ProcessClobKeeper --dir=./app/process --recursive --output=./mocks + # @go run github.com/vektra/mockery/v2 --name=ProcessStakingKeeper --dir=./app/process --recursive --output=./mocks + # @go run github.com/vektra/mockery/v2 --name=ProcessPerpetualKeeper --dir=./app/process --recursive --output=./mocks + # @go run github.com/vektra/mockery/v2 --name=MemClob --dir=./x/clob/types --recursive --output=./mocks + # @go run github.com/vektra/mockery/v2 --name=BridgeKeeper --dir=./x/bridge/types --recursive --output=./mocks + # @go run github.com/vektra/mockery/v2 --name=DelayMsgKeeper --dir=./x/delaymsg/types --recursive --output=./mocks + # @go run github.com/vektra/mockery/v2 --name=ClobKeeper --dir=./x/clob/types --recursive --output=./mocks + # @go run github.com/vektra/mockery/v2 --name=MemClobKeeper --dir=./x/clob/types --recursive --output=./mocks @go run github.com/vektra/mockery/v2 --name=PricesKeeper --dir=./x/prices/types --recursive --output=./mocks - @go run github.com/vektra/mockery/v2 --name=PerpetualsKeeper --dir=./x/perpetuals/types --recursive --output=./mocks - @go run github.com/vektra/mockery/v2 --name=SendingKeeper --dir=./x/sending/types --recursive --output=./mocks - @go run github.com/vektra/mockery/v2 --name=SubaccountsKeeper --dir=./x/subaccounts/types --recursive --output=./mocks - @go run github.com/vektra/mockery/v2 --name=VaultKeeper --dir=./x/vault/types --recursive --output=./mocks - @go run github.com/vektra/mockery/v2 --name=FileHandler --dir=./daemons/types --recursive --output=./mocks - @go run github.com/vektra/mockery/v2 --name=GrpcServer --dir=./daemons/types --recursive --output=./mocks - @go run github.com/vektra/mockery/v2 --name=GrpcClient --dir=./daemons/types --recursive --output=./mocks - @go run github.com/vektra/mockery/v2 --name=TimeProvider --dir=./lib/time --recursive --output=./mocks - @go run github.com/vektra/mockery/v2 --name=QueryClient --dir=./testutil/grpc --recursive --output=./mocks - @go run github.com/vektra/mockery/v2 --name=QueryServer --dir=./testutil/grpc --recursive --output=./mocks - @go run github.com/vektra/mockery/v2 --name=ExchangeQueryHandler --dir=./daemons/pricefeed/client/handler --recursive --output=./mocks - @go run github.com/vektra/mockery/v2 --name=RequestHandler --dir=./daemons/types --recursive --output=./mocks - @go run github.com/vektra/mockery/v2 --name=ExchangeToMarketPrices --dir=./daemons/pricefeed/client/types --recursive --output=./mocks - @go run github.com/vektra/mockery/v2 --name=IndexerMessageSender --dir=./indexer --recursive --output=./mocks - @go run github.com/vektra/mockery/v2 --name=PerpetualsClobKeeper --dir=x/perpetuals/types --recursive --output=./mocks - @go run github.com/vektra/mockery/v2 --name=IndexerEventManager --dir=./indexer/indexer_manager --recursive --output=./mocks - @go run github.com/vektra/mockery/v2 --name=PricefeedMutableMarketConfigs --dir=./daemons/pricefeed/client/types --recursive --output=./mocks - @go run github.com/vektra/mockery/v2 --name=ExchangeConfigUpdater --dir=./daemons/pricefeed/client/types --recursive --output=./mocks - @go run github.com/vektra/mockery/v2 --name=BridgeServiceClient --dir=./daemons/bridge/api --recursive --output=./mocks - @go run github.com/vektra/mockery/v2 --name=BridgeQueryClient --dir=./daemons/bridge/client/types --recursive --output=./mocks - @go run github.com/vektra/mockery/v2 --name=EthClient --dir=./daemons/bridge/client/types --recursive --output=./mocks - @go run github.com/vektra/mockery/v2 --name=PriceUpdateGenerator --dir=./app/prepare/prices --recursive --output=./mocks - @go run github.com/vektra/mockery/v2 --name=PriceFetcher --dir=./daemons/slinky/client --recursive --output=./mocks - @go run github.com/vektra/mockery/v2 --name=MarketPairFetcher --dir=./daemons/slinky/client --recursive --output=./mocks + # @go run github.com/vektra/mockery/v2 --name=PerpetualsKeeper --dir=./x/perpetuals/types --recursive --output=./mocks + # @go run github.com/vektra/mockery/v2 --name=SendingKeeper --dir=./x/sending/types --recursive --output=./mocks + # @go run github.com/vektra/mockery/v2 --name=SubaccountsKeeper --dir=./x/subaccounts/types --recursive --output=./mocks + # @go run github.com/vektra/mockery/v2 --name=VaultKeeper --dir=./x/vault/types --recursive --output=./mocks + # @go run github.com/vektra/mockery/v2 --name=FileHandler --dir=./daemons/types --recursive --output=./mocks + # @go run github.com/vektra/mockery/v2 --name=GrpcServer --dir=./daemons/types --recursive --output=./mocks + # @go run github.com/vektra/mockery/v2 --name=GrpcClient --dir=./daemons/types --recursive --output=./mocks + # @go run github.com/vektra/mockery/v2 --name=TimeProvider --dir=./lib/time --recursive --output=./mocks + # @go run github.com/vektra/mockery/v2 --name=QueryClient --dir=./testutil/grpc --recursive --output=./mocks + # @go run github.com/vektra/mockery/v2 --name=QueryServer --dir=./testutil/grpc --recursive --output=./mocks + # @go run github.com/vektra/mockery/v2 --name=ExchangeQueryHandler --dir=./daemons/pricefeed/client/handler --recursive --output=./mocks + # @go run github.com/vektra/mockery/v2 --name=RequestHandler --dir=./daemons/types --recursive --output=./mocks + # @go run github.com/vektra/mockery/v2 --name=ExchangeToMarketPrices --dir=./daemons/pricefeed/client/types --recursive --output=./mocks + # @go run github.com/vektra/mockery/v2 --name=IndexerMessageSender --dir=./indexer --recursive --output=./mocks + # @go run github.com/vektra/mockery/v2 --name=PerpetualsClobKeeper --dir=x/perpetuals/types --recursive --output=./mocks + # @go run github.com/vektra/mockery/v2 --name=IndexerEventManager --dir=./indexer/indexer_manager --recursive --output=./mocks + # @go run github.com/vektra/mockery/v2 --name=PricefeedMutableMarketConfigs --dir=./daemons/pricefeed/client/types --recursive --output=./mocks + # @go run github.com/vektra/mockery/v2 --name=ExchangeConfigUpdater --dir=./daemons/pricefeed/client/types --recursive --output=./mocks + # @go run github.com/vektra/mockery/v2 --name=BridgeServiceClient --dir=./daemons/bridge/api --recursive --output=./mocks + # @go run github.com/vektra/mockery/v2 --name=BridgeQueryClient --dir=./daemons/bridge/client/types --recursive --output=./mocks + # @go run github.com/vektra/mockery/v2 --name=EthClient --dir=./daemons/bridge/client/types --recursive --output=./mocks + # @go run github.com/vektra/mockery/v2 --name=PriceUpdateGenerator --dir=./app/prepare/prices --recursive --output=./mocks + # @go run github.com/vektra/mockery/v2 --name=PriceFetcher --dir=./daemons/slinky/client --recursive --output=./mocks + # @go run github.com/vektra/mockery/v2 --name=MarketPairFetcher --dir=./daemons/slinky/client --recursive --output=./mocks @go run github.com/vektra/mockery/v2 --name=SidecarVersionChecker --dir=./daemons/slinky/client --recursive --output=./mocks - @go run github.com/vektra/mockery/v2 --name=OracleClient --dir=$(GOPATH)/pkg/mod/github.com/skip-mev/connect/v2@$(CONNECT_VERSION)/service/clients/oracle --recursive --output=./mocks - @go run github.com/vektra/mockery/v2 --name=ExtendVoteHandler --dir=$(GOPATH)/pkg/mod/github.com/dydxprotocol/cosmos-sdk@$(COSMOS_VERSION)/types --recursive --output=./mocks - @go run github.com/vektra/mockery/v2 --name=UpdateMarketPriceTxDecoder --dir=./app/process --recursive --output=./mocks - @go run github.com/vektra/mockery/v2 --name=AssetsKeeper --dir=./x/assets/types --recursive --output=./mocks + @go run github.com/vektra/mockery/v2 --name=OracleClient --dir=$(GOPATH)/pkg/mod/github.com/skip-mev/slinky@$(SLINKY_VERSION)/service/clients/oracle --recursive --output=./mocks + # @go run github.com/vektra/mockery/v2 --name=ExtendVoteHandler --dir=$(GOPATH)/pkg/mod/github.com/dydxprotocol/cosmos-sdk@$(COSMOS_VERSION)/types --recursive --output=./mocks + # @go run github.com/vektra/mockery/v2 --name=UpdateMarketPriceTxDecoder --dir=./app/process --recursive --output=./mocks + # @go run github.com/vektra/mockery/v2 --name=AssetsKeeper --dir=./x/assets/types --recursive --output=./mocks diff --git a/protocol/mocks/OracleClient.go b/protocol/mocks/OracleClient.go index 883eed43ba..7ce637a1b7 100644 --- a/protocol/mocks/OracleClient.go +++ b/protocol/mocks/OracleClient.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.0. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mocks @@ -9,7 +9,7 @@ import ( mock "github.com/stretchr/testify/mock" - types "github.com/skip-mev/connect/v2/service/servers/oracle/types" + types "github.com/skip-mev/slinky/service/servers/oracle/types" ) // OracleClient is an autogenerated mock type for the OracleClient type @@ -109,7 +109,7 @@ func (_m *OracleClient) Start(_a0 context.Context) error { return r0 } -// Stop provides a mock function with given fields: +// Stop provides a mock function with no fields func (_m *OracleClient) Stop() error { ret := _m.Called() diff --git a/protocol/mocks/PricesKeeper.go b/protocol/mocks/PricesKeeper.go index 6f7a512119..3c89186d0a 100644 --- a/protocol/mocks/PricesKeeper.go +++ b/protocol/mocks/PricesKeeper.go @@ -1,17 +1,13 @@ -// Code generated by mockery v2.46.0. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mocks import ( - context "context" - log "cosmossdk.io/log" - + oracletypes "github.com/skip-mev/slinky/x/oracle/types" mock "github.com/stretchr/testify/mock" - oracletypes "github.com/skip-mev/connect/v2/x/oracle/types" - - pkgtypes "github.com/skip-mev/connect/v2/pkg/types" + pkgtypes "github.com/skip-mev/slinky/pkg/types" pricestypes "github.com/dydxprotocol/v4-chain/protocol/x/prices/types" @@ -29,7 +25,7 @@ func (_m *PricesKeeper) AddCurrencyPairIDToStore(ctx types.Context, id uint32, c } // CreateMarket provides a mock function with given fields: ctx, param, price -func (_m *PricesKeeper) CreateMarket(ctx context.Context, param pricestypes.MarketParam, price pricestypes.MarketPrice) (pricestypes.MarketParam, error) { +func (_m *PricesKeeper) CreateMarket(ctx types.Context, param pricestypes.MarketParam, price pricestypes.MarketPrice) (pricestypes.MarketParam, error) { ret := _m.Called(ctx, param, price) if len(ret) == 0 { @@ -38,16 +34,16 @@ func (_m *PricesKeeper) CreateMarket(ctx context.Context, param pricestypes.Mark var r0 pricestypes.MarketParam var r1 error - if rf, ok := ret.Get(0).(func(context.Context, pricestypes.MarketParam, pricestypes.MarketPrice) (pricestypes.MarketParam, error)); ok { + if rf, ok := ret.Get(0).(func(types.Context, pricestypes.MarketParam, pricestypes.MarketPrice) (pricestypes.MarketParam, error)); ok { return rf(ctx, param, price) } - if rf, ok := ret.Get(0).(func(context.Context, pricestypes.MarketParam, pricestypes.MarketPrice) pricestypes.MarketParam); ok { + if rf, ok := ret.Get(0).(func(types.Context, pricestypes.MarketParam, pricestypes.MarketPrice) pricestypes.MarketParam); ok { r0 = rf(ctx, param, price) } else { r0 = ret.Get(0).(pricestypes.MarketParam) } - if rf, ok := ret.Get(1).(func(context.Context, pricestypes.MarketParam, pricestypes.MarketPrice) error); ok { + if rf, ok := ret.Get(1).(func(types.Context, pricestypes.MarketParam, pricestypes.MarketPrice) error); ok { r1 = rf(ctx, param, price) } else { r1 = ret.Error(1) @@ -127,7 +123,7 @@ func (_m *PricesKeeper) GetAllMarketPrices(ctx types.Context) []pricestypes.Mark } // GetCurrencyPairFromID provides a mock function with given fields: ctx, id -func (_m *PricesKeeper) GetCurrencyPairFromID(ctx context.Context, id uint64) (pkgtypes.CurrencyPair, bool) { +func (_m *PricesKeeper) GetCurrencyPairFromID(ctx types.Context, id uint64) (pkgtypes.CurrencyPair, bool) { ret := _m.Called(ctx, id) if len(ret) == 0 { @@ -136,16 +132,16 @@ func (_m *PricesKeeper) GetCurrencyPairFromID(ctx context.Context, id uint64) (p var r0 pkgtypes.CurrencyPair var r1 bool - if rf, ok := ret.Get(0).(func(context.Context, uint64) (pkgtypes.CurrencyPair, bool)); ok { + if rf, ok := ret.Get(0).(func(types.Context, uint64) (pkgtypes.CurrencyPair, bool)); ok { return rf(ctx, id) } - if rf, ok := ret.Get(0).(func(context.Context, uint64) pkgtypes.CurrencyPair); ok { + if rf, ok := ret.Get(0).(func(types.Context, uint64) pkgtypes.CurrencyPair); ok { r0 = rf(ctx, id) } else { r0 = ret.Get(0).(pkgtypes.CurrencyPair) } - if rf, ok := ret.Get(1).(func(context.Context, uint64) bool); ok { + if rf, ok := ret.Get(1).(func(types.Context, uint64) bool); ok { r1 = rf(ctx, id) } else { r1 = ret.Get(1).(bool) @@ -183,7 +179,7 @@ func (_m *PricesKeeper) GetExponent(ctx types.Context, ticker string) (int32, er } // GetIDForCurrencyPair provides a mock function with given fields: ctx, cp -func (_m *PricesKeeper) GetIDForCurrencyPair(ctx context.Context, cp pkgtypes.CurrencyPair) (uint64, bool) { +func (_m *PricesKeeper) GetIDForCurrencyPair(ctx types.Context, cp pkgtypes.CurrencyPair) (uint64, bool) { ret := _m.Called(ctx, cp) if len(ret) == 0 { @@ -192,16 +188,16 @@ func (_m *PricesKeeper) GetIDForCurrencyPair(ctx context.Context, cp pkgtypes.Cu var r0 uint64 var r1 bool - if rf, ok := ret.Get(0).(func(context.Context, pkgtypes.CurrencyPair) (uint64, bool)); ok { + if rf, ok := ret.Get(0).(func(types.Context, pkgtypes.CurrencyPair) (uint64, bool)); ok { return rf(ctx, cp) } - if rf, ok := ret.Get(0).(func(context.Context, pkgtypes.CurrencyPair) uint64); ok { + if rf, ok := ret.Get(0).(func(types.Context, pkgtypes.CurrencyPair) uint64); ok { r0 = rf(ctx, cp) } else { r0 = ret.Get(0).(uint64) } - if rf, ok := ret.Get(1).(func(context.Context, pkgtypes.CurrencyPair) bool); ok { + if rf, ok := ret.Get(1).(func(types.Context, pkgtypes.CurrencyPair) bool); ok { r1 = rf(ctx, cp) } else { r1 = ret.Get(1).(bool) @@ -287,7 +283,7 @@ func (_m *PricesKeeper) GetMarketPrice(ctx types.Context, id uint32) (pricestype } // GetPriceForCurrencyPair provides a mock function with given fields: ctx, cp -func (_m *PricesKeeper) GetPriceForCurrencyPair(ctx context.Context, cp pkgtypes.CurrencyPair) (oracletypes.QuotePrice, error) { +func (_m *PricesKeeper) GetPriceForCurrencyPair(ctx types.Context, cp pkgtypes.CurrencyPair) (oracletypes.QuotePrice, error) { ret := _m.Called(ctx, cp) if len(ret) == 0 { @@ -296,16 +292,16 @@ func (_m *PricesKeeper) GetPriceForCurrencyPair(ctx context.Context, cp pkgtypes var r0 oracletypes.QuotePrice var r1 error - if rf, ok := ret.Get(0).(func(context.Context, pkgtypes.CurrencyPair) (oracletypes.QuotePrice, error)); ok { + if rf, ok := ret.Get(0).(func(types.Context, pkgtypes.CurrencyPair) (oracletypes.QuotePrice, error)); ok { return rf(ctx, cp) } - if rf, ok := ret.Get(0).(func(context.Context, pkgtypes.CurrencyPair) oracletypes.QuotePrice); ok { + if rf, ok := ret.Get(0).(func(types.Context, pkgtypes.CurrencyPair) oracletypes.QuotePrice); ok { r0 = rf(ctx, cp) } else { r0 = ret.Get(0).(oracletypes.QuotePrice) } - if rf, ok := ret.Get(1).(func(context.Context, pkgtypes.CurrencyPair) error); ok { + if rf, ok := ret.Get(1).(func(types.Context, pkgtypes.CurrencyPair) error); ok { r1 = rf(ctx, cp) } else { r1 = ret.Error(1) From e401868d841b563a44e4150835109f0888a84e82 Mon Sep 17 00:00:00 2001 From: Chenyao Yu <4844716+chenyaoy@users.noreply.github.com> Date: Fri, 13 Dec 2024 00:02:48 -0500 Subject: [PATCH 03/13] mock --- protocol/mocks/Makefile | 104 ++++++++++++++-------------- protocol/mocks/MarketPairFetcher.go | 6 +- 2 files changed, 55 insertions(+), 55 deletions(-) diff --git a/protocol/mocks/Makefile b/protocol/mocks/Makefile index fd293a472d..ccb9f14554 100644 --- a/protocol/mocks/Makefile +++ b/protocol/mocks/Makefile @@ -10,58 +10,58 @@ mock-clean: @rm -f ./mocks/*.go mock-gen: - # @go run github.com/vektra/mockery/v2 --name=Configurator --dir=$(GOPATH)/pkg/mod/github.com/dydxprotocol/cosmos-sdk@$(COSMOS_VERSION)/types --recursive --output=./mocks - # @go run github.com/vektra/mockery/v2 --name=MultiStore --dir=$(GOPATH)/pkg/mod/github.com/dydxprotocol/cosmos-sdk/store@$(COSMOS_STORE_VERSION)/types --recursive --output=./mocks - # @go run github.com/vektra/mockery/v2 --name=CacheMultiStore --dir=$(GOPATH)/pkg/mod/github.com/dydxprotocol/cosmos-sdk/store@$(COSMOS_STORE_VERSION)/types --recursive --output=./mocks - # @go run github.com/vektra/mockery/v2 --name=AnteDecorator --dir=$(GOPATH)/pkg/mod/github.com/dydxprotocol/cosmos-sdk@$(COSMOS_VERSION)/types --recursive --output=./mocks - # @go run github.com/vektra/mockery/v2 --name=TxConfig --dir=$(GOPATH)/pkg/mod/github.com/dydxprotocol/cosmos-sdk@$(COSMOS_VERSION)/client --recursive --output=./mocks - # @go run github.com/vektra/mockery/v2 --name=TxBuilder --dir=$(GOPATH)/pkg/mod/github.com/dydxprotocol/cosmos-sdk@$(COSMOS_VERSION)/client --recursive --output=./mocks - # @go run github.com/vektra/mockery/v2 --name=Keeper --dir=$(GOPATH)/pkg/mod/github.com/dydxprotocol/cosmos-sdk@$(COSMOS_VERSION)/x/bank/keeper --filename=BankKeeper.go --structname=BankKeeper --recursive --output=./mocks - # @go run github.com/vektra/mockery/v2 --name=Server --dir=$(GOPATH)/pkg/mod/github.com/cosmos/gogoproto@$(COSMOS_GOGOPROTO_VERSION)/grpc --recursive --output=./mocks - # @go run github.com/vektra/mockery/v2 --name=AppOptions --dir=$(GOPATH)/pkg/mod/github.com/dydxprotocol/cosmos-sdk@$(COSMOS_VERSION)/server/types --recursive --output=./mocks - # @go run github.com/vektra/mockery/v2 --name=Logger --dir=$(GOPATH)/pkg/mod/cosmossdk.io/log@$(COSMOS_LOG_VERSION) --filename=logger.go --recursive --output=./mocks - # @go run github.com/vektra/mockery/v2 --name=MsgRouter --dir=./lib --recursive --output=./mocks - # @go run github.com/vektra/mockery/v2 --name=HealthCheckable --dir=./daemons/types --recursive --output=./mocks - # @go run github.com/vektra/mockery/v2 --name=PrepareBridgeKeeper --dir=./app/prepare --recursive --output=./mocks - # @go run github.com/vektra/mockery/v2 --name=PrepareClobKeeper --dir=./app/prepare --recursive --output=./mocks - # @go run github.com/vektra/mockery/v2 --name=PreparePerpetualsKeeper --dir=./app/prepare --recursive --output=./mocks - # @go run github.com/vektra/mockery/v2 --name=PricesKeeper --dir=./app/prepare --recursive --output=./mocks - # @go run github.com/vektra/mockery/v2 --name=ProcessBridgeKeeper --dir=./app/process --recursive --output=./mocks - # @go run github.com/vektra/mockery/v2 --name=ProcessClobKeeper --dir=./app/process --recursive --output=./mocks - # @go run github.com/vektra/mockery/v2 --name=ProcessStakingKeeper --dir=./app/process --recursive --output=./mocks - # @go run github.com/vektra/mockery/v2 --name=ProcessPerpetualKeeper --dir=./app/process --recursive --output=./mocks - # @go run github.com/vektra/mockery/v2 --name=MemClob --dir=./x/clob/types --recursive --output=./mocks - # @go run github.com/vektra/mockery/v2 --name=BridgeKeeper --dir=./x/bridge/types --recursive --output=./mocks - # @go run github.com/vektra/mockery/v2 --name=DelayMsgKeeper --dir=./x/delaymsg/types --recursive --output=./mocks - # @go run github.com/vektra/mockery/v2 --name=ClobKeeper --dir=./x/clob/types --recursive --output=./mocks - # @go run github.com/vektra/mockery/v2 --name=MemClobKeeper --dir=./x/clob/types --recursive --output=./mocks + @go run github.com/vektra/mockery/v2 --name=Configurator --dir=$(GOPATH)/pkg/mod/github.com/dydxprotocol/cosmos-sdk@$(COSMOS_VERSION)/types --recursive --output=./mocks + @go run github.com/vektra/mockery/v2 --name=MultiStore --dir=$(GOPATH)/pkg/mod/github.com/dydxprotocol/cosmos-sdk/store@$(COSMOS_STORE_VERSION)/types --recursive --output=./mocks + @go run github.com/vektra/mockery/v2 --name=CacheMultiStore --dir=$(GOPATH)/pkg/mod/github.com/dydxprotocol/cosmos-sdk/store@$(COSMOS_STORE_VERSION)/types --recursive --output=./mocks + @go run github.com/vektra/mockery/v2 --name=AnteDecorator --dir=$(GOPATH)/pkg/mod/github.com/dydxprotocol/cosmos-sdk@$(COSMOS_VERSION)/types --recursive --output=./mocks + @go run github.com/vektra/mockery/v2 --name=TxConfig --dir=$(GOPATH)/pkg/mod/github.com/dydxprotocol/cosmos-sdk@$(COSMOS_VERSION)/client --recursive --output=./mocks + @go run github.com/vektra/mockery/v2 --name=TxBuilder --dir=$(GOPATH)/pkg/mod/github.com/dydxprotocol/cosmos-sdk@$(COSMOS_VERSION)/client --recursive --output=./mocks + @go run github.com/vektra/mockery/v2 --name=Keeper --dir=$(GOPATH)/pkg/mod/github.com/dydxprotocol/cosmos-sdk@$(COSMOS_VERSION)/x/bank/keeper --filename=BankKeeper.go --structname=BankKeeper --recursive --output=./mocks + @go run github.com/vektra/mockery/v2 --name=Server --dir=$(GOPATH)/pkg/mod/github.com/cosmos/gogoproto@$(COSMOS_GOGOPROTO_VERSION)/grpc --recursive --output=./mocks + @go run github.com/vektra/mockery/v2 --name=AppOptions --dir=$(GOPATH)/pkg/mod/github.com/dydxprotocol/cosmos-sdk@$(COSMOS_VERSION)/server/types --recursive --output=./mocks + @go run github.com/vektra/mockery/v2 --name=Logger --dir=$(GOPATH)/pkg/mod/cosmossdk.io/log@$(COSMOS_LOG_VERSION) --filename=logger.go --recursive --output=./mocks + @go run github.com/vektra/mockery/v2 --name=MsgRouter --dir=./lib --recursive --output=./mocks + @go run github.com/vektra/mockery/v2 --name=HealthCheckable --dir=./daemons/types --recursive --output=./mocks + @go run github.com/vektra/mockery/v2 --name=PrepareBridgeKeeper --dir=./app/prepare --recursive --output=./mocks + @go run github.com/vektra/mockery/v2 --name=PrepareClobKeeper --dir=./app/prepare --recursive --output=./mocks + @go run github.com/vektra/mockery/v2 --name=PreparePerpetualsKeeper --dir=./app/prepare --recursive --output=./mocks + @go run github.com/vektra/mockery/v2 --name=PricesKeeper --dir=./app/prepare --recursive --output=./mocks + @go run github.com/vektra/mockery/v2 --name=ProcessBridgeKeeper --dir=./app/process --recursive --output=./mocks + @go run github.com/vektra/mockery/v2 --name=ProcessClobKeeper --dir=./app/process --recursive --output=./mocks + @go run github.com/vektra/mockery/v2 --name=ProcessStakingKeeper --dir=./app/process --recursive --output=./mocks + @go run github.com/vektra/mockery/v2 --name=ProcessPerpetualKeeper --dir=./app/process --recursive --output=./mocks + @go run github.com/vektra/mockery/v2 --name=MemClob --dir=./x/clob/types --recursive --output=./mocks + @go run github.com/vektra/mockery/v2 --name=BridgeKeeper --dir=./x/bridge/types --recursive --output=./mocks + @go run github.com/vektra/mockery/v2 --name=DelayMsgKeeper --dir=./x/delaymsg/types --recursive --output=./mocks + @go run github.com/vektra/mockery/v2 --name=ClobKeeper --dir=./x/clob/types --recursive --output=./mocks + @go run github.com/vektra/mockery/v2 --name=MemClobKeeper --dir=./x/clob/types --recursive --output=./mocks @go run github.com/vektra/mockery/v2 --name=PricesKeeper --dir=./x/prices/types --recursive --output=./mocks - # @go run github.com/vektra/mockery/v2 --name=PerpetualsKeeper --dir=./x/perpetuals/types --recursive --output=./mocks - # @go run github.com/vektra/mockery/v2 --name=SendingKeeper --dir=./x/sending/types --recursive --output=./mocks - # @go run github.com/vektra/mockery/v2 --name=SubaccountsKeeper --dir=./x/subaccounts/types --recursive --output=./mocks - # @go run github.com/vektra/mockery/v2 --name=VaultKeeper --dir=./x/vault/types --recursive --output=./mocks - # @go run github.com/vektra/mockery/v2 --name=FileHandler --dir=./daemons/types --recursive --output=./mocks - # @go run github.com/vektra/mockery/v2 --name=GrpcServer --dir=./daemons/types --recursive --output=./mocks - # @go run github.com/vektra/mockery/v2 --name=GrpcClient --dir=./daemons/types --recursive --output=./mocks - # @go run github.com/vektra/mockery/v2 --name=TimeProvider --dir=./lib/time --recursive --output=./mocks - # @go run github.com/vektra/mockery/v2 --name=QueryClient --dir=./testutil/grpc --recursive --output=./mocks - # @go run github.com/vektra/mockery/v2 --name=QueryServer --dir=./testutil/grpc --recursive --output=./mocks - # @go run github.com/vektra/mockery/v2 --name=ExchangeQueryHandler --dir=./daemons/pricefeed/client/handler --recursive --output=./mocks - # @go run github.com/vektra/mockery/v2 --name=RequestHandler --dir=./daemons/types --recursive --output=./mocks - # @go run github.com/vektra/mockery/v2 --name=ExchangeToMarketPrices --dir=./daemons/pricefeed/client/types --recursive --output=./mocks - # @go run github.com/vektra/mockery/v2 --name=IndexerMessageSender --dir=./indexer --recursive --output=./mocks - # @go run github.com/vektra/mockery/v2 --name=PerpetualsClobKeeper --dir=x/perpetuals/types --recursive --output=./mocks - # @go run github.com/vektra/mockery/v2 --name=IndexerEventManager --dir=./indexer/indexer_manager --recursive --output=./mocks - # @go run github.com/vektra/mockery/v2 --name=PricefeedMutableMarketConfigs --dir=./daemons/pricefeed/client/types --recursive --output=./mocks - # @go run github.com/vektra/mockery/v2 --name=ExchangeConfigUpdater --dir=./daemons/pricefeed/client/types --recursive --output=./mocks - # @go run github.com/vektra/mockery/v2 --name=BridgeServiceClient --dir=./daemons/bridge/api --recursive --output=./mocks - # @go run github.com/vektra/mockery/v2 --name=BridgeQueryClient --dir=./daemons/bridge/client/types --recursive --output=./mocks - # @go run github.com/vektra/mockery/v2 --name=EthClient --dir=./daemons/bridge/client/types --recursive --output=./mocks - # @go run github.com/vektra/mockery/v2 --name=PriceUpdateGenerator --dir=./app/prepare/prices --recursive --output=./mocks - # @go run github.com/vektra/mockery/v2 --name=PriceFetcher --dir=./daemons/slinky/client --recursive --output=./mocks - # @go run github.com/vektra/mockery/v2 --name=MarketPairFetcher --dir=./daemons/slinky/client --recursive --output=./mocks + @go run github.com/vektra/mockery/v2 --name=PerpetualsKeeper --dir=./x/perpetuals/types --recursive --output=./mocks + @go run github.com/vektra/mockery/v2 --name=SendingKeeper --dir=./x/sending/types --recursive --output=./mocks + @go run github.com/vektra/mockery/v2 --name=SubaccountsKeeper --dir=./x/subaccounts/types --recursive --output=./mocks + @go run github.com/vektra/mockery/v2 --name=VaultKeeper --dir=./x/vault/types --recursive --output=./mocks + @go run github.com/vektra/mockery/v2 --name=FileHandler --dir=./daemons/types --recursive --output=./mocks + @go run github.com/vektra/mockery/v2 --name=GrpcServer --dir=./daemons/types --recursive --output=./mocks + @go run github.com/vektra/mockery/v2 --name=GrpcClient --dir=./daemons/types --recursive --output=./mocks + @go run github.com/vektra/mockery/v2 --name=TimeProvider --dir=./lib/time --recursive --output=./mocks + @go run github.com/vektra/mockery/v2 --name=QueryClient --dir=./testutil/grpc --recursive --output=./mocks + @go run github.com/vektra/mockery/v2 --name=QueryServer --dir=./testutil/grpc --recursive --output=./mocks + @go run github.com/vektra/mockery/v2 --name=ExchangeQueryHandler --dir=./daemons/pricefeed/client/handler --recursive --output=./mocks + @go run github.com/vektra/mockery/v2 --name=RequestHandler --dir=./daemons/types --recursive --output=./mocks + @go run github.com/vektra/mockery/v2 --name=ExchangeToMarketPrices --dir=./daemons/pricefeed/client/types --recursive --output=./mocks + @go run github.com/vektra/mockery/v2 --name=IndexerMessageSender --dir=./indexer --recursive --output=./mocks + @go run github.com/vektra/mockery/v2 --name=PerpetualsClobKeeper --dir=x/perpetuals/types --recursive --output=./mocks + @go run github.com/vektra/mockery/v2 --name=IndexerEventManager --dir=./indexer/indexer_manager --recursive --output=./mocks + @go run github.com/vektra/mockery/v2 --name=PricefeedMutableMarketConfigs --dir=./daemons/pricefeed/client/types --recursive --output=./mocks + @go run github.com/vektra/mockery/v2 --name=ExchangeConfigUpdater --dir=./daemons/pricefeed/client/types --recursive --output=./mocks + @go run github.com/vektra/mockery/v2 --name=BridgeServiceClient --dir=./daemons/bridge/api --recursive --output=./mocks + @go run github.com/vektra/mockery/v2 --name=BridgeQueryClient --dir=./daemons/bridge/client/types --recursive --output=./mocks + @go run github.com/vektra/mockery/v2 --name=EthClient --dir=./daemons/bridge/client/types --recursive --output=./mocks + @go run github.com/vektra/mockery/v2 --name=PriceUpdateGenerator --dir=./app/prepare/prices --recursive --output=./mocks + @go run github.com/vektra/mockery/v2 --name=PriceFetcher --dir=./daemons/slinky/client --recursive --output=./mocks + @go run github.com/vektra/mockery/v2 --name=MarketPairFetcher --dir=./daemons/slinky/client --recursive --output=./mocks @go run github.com/vektra/mockery/v2 --name=SidecarVersionChecker --dir=./daemons/slinky/client --recursive --output=./mocks @go run github.com/vektra/mockery/v2 --name=OracleClient --dir=$(GOPATH)/pkg/mod/github.com/skip-mev/slinky@$(SLINKY_VERSION)/service/clients/oracle --recursive --output=./mocks - # @go run github.com/vektra/mockery/v2 --name=ExtendVoteHandler --dir=$(GOPATH)/pkg/mod/github.com/dydxprotocol/cosmos-sdk@$(COSMOS_VERSION)/types --recursive --output=./mocks - # @go run github.com/vektra/mockery/v2 --name=UpdateMarketPriceTxDecoder --dir=./app/process --recursive --output=./mocks - # @go run github.com/vektra/mockery/v2 --name=AssetsKeeper --dir=./x/assets/types --recursive --output=./mocks + @go run github.com/vektra/mockery/v2 --name=ExtendVoteHandler --dir=$(GOPATH)/pkg/mod/github.com/dydxprotocol/cosmos-sdk@$(COSMOS_VERSION)/types --recursive --output=./mocks + @go run github.com/vektra/mockery/v2 --name=UpdateMarketPriceTxDecoder --dir=./app/process --recursive --output=./mocks + @go run github.com/vektra/mockery/v2 --name=AssetsKeeper --dir=./x/assets/types --recursive --output=./mocks diff --git a/protocol/mocks/MarketPairFetcher.go b/protocol/mocks/MarketPairFetcher.go index 9492dcc903..0f54eafa63 100644 --- a/protocol/mocks/MarketPairFetcher.go +++ b/protocol/mocks/MarketPairFetcher.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.46.0. DO NOT EDIT. +// Code generated by mockery v2.50.0. DO NOT EDIT. package mocks @@ -10,7 +10,7 @@ import ( mock "github.com/stretchr/testify/mock" - types "github.com/skip-mev/connect/v2/pkg/types" + types "github.com/skip-mev/slinky/pkg/types" ) // MarketPairFetcher is an autogenerated mock type for the MarketPairFetcher type @@ -82,7 +82,7 @@ func (_m *MarketPairFetcher) Start(_a0 context.Context, _a1 flags.Flags, _a2 dae return r0 } -// Stop provides a mock function with given fields: +// Stop provides a mock function with no fields func (_m *MarketPairFetcher) Stop() { _m.Called() } From 769cc1801af7a37e2382c96bb562dac490f88181 Mon Sep 17 00:00:00 2001 From: Chenyao Yu <4844716+chenyaoy@users.noreply.github.com> Date: Fri, 13 Dec 2024 06:41:26 -0500 Subject: [PATCH 04/13] add renamed dir --- protocol/contrib/slinky/oracle.json | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 protocol/contrib/slinky/oracle.json diff --git a/protocol/contrib/slinky/oracle.json b/protocol/contrib/slinky/oracle.json new file mode 100644 index 0000000000..9636c1c6d1 --- /dev/null +++ b/protocol/contrib/slinky/oracle.json @@ -0,0 +1,26 @@ +{ + "providers": { + "dydx_migration_api": { + "name": "dydx_migration_api", + "api": { + "enabled": true, + "timeout": 20000000000, + "interval": 10000000000, + "reconnectTimeout": 2000000000, + "maxQueries": 1, + "atomic": true, + "endpoints": [ + { + "url": "http://dydxprotocold0:1317" + }, + { + "url": "dydxprotocold0:9090" + } + ], + "batchSize": 0, + "name": "dydx_migration_api" + }, + "type": "market_map_provider" + } + } +} \ No newline at end of file From a11b8b6f36b1cfa762129e1c06cab78d1a050da4 Mon Sep 17 00:00:00 2001 From: Chenyao Yu <4844716+chenyaoy@users.noreply.github.com> Date: Fri, 13 Dec 2024 06:47:22 -0500 Subject: [PATCH 05/13] lint --- protocol/app/ante/replay_protection.go | 2 +- .../pricefeed/client/price_function/exchange_error.go | 3 ++- protocol/x/clob/keeper/process_operations.go | 2 +- protocol/x/delaymsg/keeper/delayed_message.go | 2 +- protocol/x/prices/keeper/market.go | 10 +++++----- protocol/x/prices/keeper/market_param.go | 6 +++--- protocol/x/prices/keeper/market_param_test.go | 2 +- protocol/x/vault/keeper/orders.go | 2 +- protocol/x/vest/types/vest_entry.go | 4 ++-- 9 files changed, 17 insertions(+), 16 deletions(-) diff --git a/protocol/app/ante/replay_protection.go b/protocol/app/ante/replay_protection.go index d2fb6a25bd..0514e62e6e 100644 --- a/protocol/app/ante/replay_protection.go +++ b/protocol/app/ante/replay_protection.go @@ -86,7 +86,7 @@ func (rpd ReplayProtectionDecorator) AnteHandle( 1, []gometrics.Label{metrics.GetLabelForIntValue(metrics.ExecMode, int(ctx.ExecMode()))}, ) - return ctx, errorsmod.Wrapf(sdkerrors.ErrWrongSequence, err.Error()) + return ctx, errorsmod.Wrap(sdkerrors.ErrWrongSequence, err.Error()) } telemetry.IncrCounterWithLabels( []string{metrics.TimestampNonce, metrics.Valid, metrics.Count}, diff --git a/protocol/daemons/pricefeed/client/price_function/exchange_error.go b/protocol/daemons/pricefeed/client/price_function/exchange_error.go index 2bbce0aad2..cc605465d9 100644 --- a/protocol/daemons/pricefeed/client/price_function/exchange_error.go +++ b/protocol/daemons/pricefeed/client/price_function/exchange_error.go @@ -2,6 +2,7 @@ package price_function import ( "fmt" + "github.com/dydxprotocol/v4-chain/protocol/daemons/pricefeed/client/types" ) @@ -35,6 +36,6 @@ func (e *ExchangeErrorImpl) GetExchangeId() types.ExchangeId { func NewExchangeError(exchangeId types.ExchangeId, msg string) ExchangeError { return &ExchangeErrorImpl{ exchangeId: exchangeId, - err: fmt.Errorf(msg), + err: fmt.Errorf("%s", msg), } } diff --git a/protocol/x/clob/keeper/process_operations.go b/protocol/x/clob/keeper/process_operations.go index 86808afb5d..057256554e 100644 --- a/protocol/x/clob/keeper/process_operations.go +++ b/protocol/x/clob/keeper/process_operations.go @@ -752,7 +752,7 @@ func (k Keeper) PersistMatchDeleveragingToState( // negative TNC subaccount was seen. if len(matchDeleveraging.GetFills()) == 0 { if !shouldDeleverageAtBankruptcyPrice { - return errorsmod.Wrapf( + return errorsmod.Wrap( types.ErrZeroFillDeleveragingForNonNegativeTncSubaccount, fmt.Sprintf( "PersistMatchDeleveragingToState: zero-fill deleveraging operation included for subaccount %+v"+ diff --git a/protocol/x/delaymsg/keeper/delayed_message.go b/protocol/x/delaymsg/keeper/delayed_message.go index a89f2ea788..23afda663f 100644 --- a/protocol/x/delaymsg/keeper/delayed_message.go +++ b/protocol/x/delaymsg/keeper/delayed_message.go @@ -201,7 +201,7 @@ func (k Keeper) ValidateMsg(msg sdk.Msg, signers [][]byte) error { handler := k.router.Handler(msg) // If the message type is not routable, return an error. if handler == nil { - return errorsmod.Wrapf( + return errorsmod.Wrap( types.ErrMsgIsUnroutable, sdk.MsgTypeURL(msg), ) diff --git a/protocol/x/prices/keeper/market.go b/protocol/x/prices/keeper/market.go index d5c76cc310..1bea1371f9 100644 --- a/protocol/x/prices/keeper/market.go +++ b/protocol/x/prices/keeper/market.go @@ -42,7 +42,7 @@ func (k Keeper) CreateMarket( // Stateful Validation for _, market := range k.GetAllMarketParams(ctx) { if market.Pair == marketParam.Pair { - return types.MarketParam{}, errorsmod.Wrapf( + return types.MarketParam{}, errorsmod.Wrap( types.ErrMarketParamPairAlreadyExists, marketParam.Pair, ) @@ -51,7 +51,7 @@ func (k Keeper) CreateMarket( // check that the market exists in market map currencyPair, err := slinky.MarketPairToCurrencyPair(marketParam.Pair) if err != nil { - return types.MarketParam{}, errorsmod.Wrapf( + return types.MarketParam{}, errorsmod.Wrap( types.ErrMarketPairConversionFailed, marketParam.Pair, ) @@ -59,7 +59,7 @@ func (k Keeper) CreateMarket( currencyPairStr := currencyPair.String() marketMapDetails, err := k.MarketMapKeeper.GetMarket(ctx, currencyPairStr) if err != nil { - return types.MarketParam{}, errorsmod.Wrapf( + return types.MarketParam{}, errorsmod.Wrap( types.ErrTickerNotFoundInMarketMap, currencyPairStr, ) @@ -67,7 +67,7 @@ func (k Keeper) CreateMarket( // Check that the exponent of market price is the negation of the decimals value in the market map if marketPrice.Exponent != int32(marketMapDetails.Ticker.Decimals)*-1 { - return types.MarketParam{}, errorsmod.Wrapf( + return types.MarketParam{}, errorsmod.Wrap( types.ErrInvalidMarketPriceExponent, currencyPairStr, ) @@ -130,7 +130,7 @@ func (k Keeper) GetExponent(ctx sdk.Context, ticker string) (int32, error) { marketMapDetails, err := k.MarketMapKeeper.GetMarket(ctx, currencyPair.String()) if err != nil { - return 0, errorsmod.Wrapf( + return 0, errorsmod.Wrap( types.ErrTickerNotFoundInMarketMap, ticker, ) diff --git a/protocol/x/prices/keeper/market_param.go b/protocol/x/prices/keeper/market_param.go index e62f92fc88..e364e3fcec 100644 --- a/protocol/x/prices/keeper/market_param.go +++ b/protocol/x/prices/keeper/market_param.go @@ -42,17 +42,17 @@ func (k Keeper) ModifyMarketParam( // Validate update is permitted. for _, market := range k.GetAllMarketParams(ctx) { if market.Pair == updatedMarketParam.Pair && market.Id != updatedMarketParam.Id { - return types.MarketParam{}, errorsmod.Wrapf(types.ErrMarketParamPairAlreadyExists, updatedMarketParam.Pair) + return types.MarketParam{}, errorsmod.Wrap(types.ErrMarketParamPairAlreadyExists, updatedMarketParam.Pair) } } // Validate that modified market param has a corresponding ticker in MarketMap cp, err := slinky.MarketPairToCurrencyPair(updatedMarketParam.Pair) if err != nil { - return types.MarketParam{}, errorsmod.Wrapf(types.ErrMarketPairConversionFailed, updatedMarketParam.Pair) + return types.MarketParam{}, errorsmod.Wrap(types.ErrMarketPairConversionFailed, updatedMarketParam.Pair) } if _, err := k.MarketMapKeeper.GetMarket(ctx, cp.String()); err != nil { - return types.MarketParam{}, errorsmod.Wrapf(types.ErrTickerNotFoundInMarketMap, cp.String()) + return types.MarketParam{}, errorsmod.Wrap(types.ErrTickerNotFoundInMarketMap, cp.String()) } // Store the modified market param. diff --git a/protocol/x/prices/keeper/market_param_test.go b/protocol/x/prices/keeper/market_param_test.go index 25c24d31a4..f74f07f18e 100644 --- a/protocol/x/prices/keeper/market_param_test.go +++ b/protocol/x/prices/keeper/market_param_test.go @@ -239,7 +239,7 @@ func TestModifyMarketParam_Errors(t *testing.T) { minExchanges: uint32(1), minPriceChangePpm: uint32(50), exchangeConfigJson: validExchangeConfigJson, - expectedErr: errorsmod.Wrapf( + expectedErr: errorsmod.Wrap( types.ErrTickerNotFoundInMarketMap, invalidUpdateCurrencyPair.String(), ).Error(), diff --git a/protocol/x/vault/keeper/orders.go b/protocol/x/vault/keeper/orders.go index 311bbbbe38..1129bb4651 100644 --- a/protocol/x/vault/keeper/orders.go +++ b/protocol/x/vault/keeper/orders.go @@ -45,7 +45,7 @@ func (k Keeper) RefreshAllVaultOrders(ctx sdk.Context) { vaultParams.QuotingParams = &defaultQuotingParams } vault := k.subaccountsKeeper.GetSubaccount(ctx, *vaultId.ToSubaccountId()) - if vault.PerpetualPositions == nil || len(vault.PerpetualPositions) == 0 { + if len(vault.PerpetualPositions) == 0 { if vault.GetUsdcPosition().Cmp(vaultParams.QuotingParams.ActivationThresholdQuoteQuantums.BigInt()) == -1 { continue } diff --git a/protocol/x/vest/types/vest_entry.go b/protocol/x/vest/types/vest_entry.go index b091be3aa5..2f6b4b4d2f 100644 --- a/protocol/x/vest/types/vest_entry.go +++ b/protocol/x/vest/types/vest_entry.go @@ -15,7 +15,7 @@ func (entry VestEntry) Validate() error { } if err := sdk.ValidateDenom(entry.Denom); err != nil { - return errorsmod.Wrapf(ErrInvalidDenom, err.Error()) + return errorsmod.Wrap(ErrInvalidDenom, err.Error()) } if !entry.StartTime.Before(entry.EndTime) { @@ -27,7 +27,7 @@ func (entry VestEntry) Validate() error { } if entry.EndTime.Location().String() != "UTC" { - return errorsmod.Wrapf(ErrInvalidTimeZone, "start_time must be in UTC") + return errorsmod.Wrapf(ErrInvalidTimeZone, "end_time must be in UTC") } return nil } From adf28e5c99eaa7515fa67f7dd76c93ccf0cbd12b Mon Sep 17 00:00:00 2001 From: Chenyao Yu <4844716+chenyaoy@users.noreply.github.com> Date: Fri, 13 Dec 2024 12:49:55 -0500 Subject: [PATCH 06/13] address comments --- protocol/app/msgs/normal_msgs.go | 2 +- protocol/x/prices/keeper/slinky_adapter.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/protocol/app/msgs/normal_msgs.go b/protocol/app/msgs/normal_msgs.go index ead7a9aa66..db0346f870 100644 --- a/protocol/app/msgs/normal_msgs.go +++ b/protocol/app/msgs/normal_msgs.go @@ -273,9 +273,9 @@ var ( "/slinky.marketmap.v1.MsgCreateMarketsResponse": nil, "/slinky.marketmap.v1.MsgParams": &marketmapmoduletypes.MsgParams{}, "/slinky.marketmap.v1.MsgParamsResponse": nil, - "/slinky.marketmap.v1.MsgRemoveMarketAuthorities": &marketmapmoduletypes.MsgRemoveMarketAuthorities{}, "/slinky.marketmap.v1.MsgRemoveMarkets": &marketmapmoduletypes.MsgRemoveMarkets{}, "/slinky.marketmap.v1.MsgRemoveMarketsResponse": nil, + "/slinky.marketmap.v1.MsgRemoveMarketAuthorities": &marketmapmoduletypes.MsgRemoveMarketAuthorities{}, "/slinky.marketmap.v1.MsgRemoveMarketAuthoritiesResponse": nil, "/slinky.marketmap.v1.MsgUpdateMarkets": &marketmapmoduletypes.MsgUpdateMarkets{}, "/slinky.marketmap.v1.MsgUpdateMarketsResponse": nil, diff --git a/protocol/x/prices/keeper/slinky_adapter.go b/protocol/x/prices/keeper/slinky_adapter.go index 9cb12ae3e7..688d1e4875 100644 --- a/protocol/x/prices/keeper/slinky_adapter.go +++ b/protocol/x/prices/keeper/slinky_adapter.go @@ -117,6 +117,6 @@ func (k Keeper) GetNumRemovedCurrencyPairs(_ sdk.Context) (uint64, error) { // GetAllCurrencyPairs is not used with the DefaultCurrencyPair strategy. // See https://github.com/skip-mev/slinky/blob/main/abci/strategies/currencypair/default.go -func (k Keeper) GetAllCurrencyPairs(ctx sdk.Context) []slinkytypes.CurrencyPair { +func (k Keeper) GetAllCurrencyPairs(_ sdk.Context) []slinkytypes.CurrencyPair { return nil } From ae5812b7a65ac5b57ddfba6a428f5b899279ff85 Mon Sep 17 00:00:00 2001 From: Chenyao Yu <4844716+chenyaoy@users.noreply.github.com> Date: Fri, 13 Dec 2024 14:13:25 -0500 Subject: [PATCH 07/13] fix wrapf --- protocol/x/delaymsg/keeper/delayed_message.go | 2 +- protocol/x/prices/keeper/market_param_test.go | 2 +- protocol/x/vest/types/vest_entry.go | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/protocol/x/delaymsg/keeper/delayed_message.go b/protocol/x/delaymsg/keeper/delayed_message.go index 23afda663f..dd3395e62e 100644 --- a/protocol/x/delaymsg/keeper/delayed_message.go +++ b/protocol/x/delaymsg/keeper/delayed_message.go @@ -188,7 +188,7 @@ func validateSigners(signers [][]byte) error { ) } if !bytes.Equal(signers[0], types.ModuleAddress) { - return errorsmod.Wrapf( + return errorsmod.Wrap( types.ErrInvalidSigner, "message signer must be delaymsg module address", ) diff --git a/protocol/x/prices/keeper/market_param_test.go b/protocol/x/prices/keeper/market_param_test.go index f74f07f18e..89ebd1cc64 100644 --- a/protocol/x/prices/keeper/market_param_test.go +++ b/protocol/x/prices/keeper/market_param_test.go @@ -228,7 +228,7 @@ func TestModifyMarketParam_Errors(t *testing.T) { minExchanges: uint32(1), minPriceChangePpm: uint32(50), exchangeConfigJson: validExchangeConfigJson, - expectedErr: errorsmod.Wrapf( + expectedErr: errorsmod.Wrap( types.ErrMarketParamPairAlreadyExists, "1-1", ).Error(), diff --git a/protocol/x/vest/types/vest_entry.go b/protocol/x/vest/types/vest_entry.go index 2f6b4b4d2f..babf8c64ad 100644 --- a/protocol/x/vest/types/vest_entry.go +++ b/protocol/x/vest/types/vest_entry.go @@ -7,11 +7,11 @@ import ( func (entry VestEntry) Validate() error { if entry.VesterAccount == "" { - return errorsmod.Wrapf(ErrInvalidVesterAccount, "vester account cannot be empty") + return errorsmod.Wrap(ErrInvalidVesterAccount, "vester account cannot be empty") } if entry.TreasuryAccount == "" { - return errorsmod.Wrapf(ErrInvalidTreasuryAccount, "treasury account cannot be empty") + return errorsmod.Wrap(ErrInvalidTreasuryAccount, "treasury account cannot be empty") } if err := sdk.ValidateDenom(entry.Denom); err != nil { @@ -23,11 +23,11 @@ func (entry VestEntry) Validate() error { } if entry.StartTime.Location().String() != "UTC" { - return errorsmod.Wrapf(ErrInvalidTimeZone, "start_time must be in UTC") + return errorsmod.Wrap(ErrInvalidTimeZone, "start_time must be in UTC") } if entry.EndTime.Location().String() != "UTC" { - return errorsmod.Wrapf(ErrInvalidTimeZone, "end_time must be in UTC") + return errorsmod.Wrap(ErrInvalidTimeZone, "end_time must be in UTC") } return nil } From 91bfae512472913c1d95327025394287fd537f06 Mon Sep 17 00:00:00 2001 From: Chenyao Yu <4844716+chenyaoy@users.noreply.github.com> Date: Fri, 13 Dec 2024 14:27:57 -0500 Subject: [PATCH 08/13] fix localnet deployment --- protocol/testing/testnet-local/local.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/protocol/testing/testnet-local/local.sh b/protocol/testing/testnet-local/local.sh index d11ad734d8..a90bc06c0d 100755 --- a/protocol/testing/testnet-local/local.sh +++ b/protocol/testing/testnet-local/local.sh @@ -107,7 +107,7 @@ create_validators() { cat <<<"$new_file" >"$VAL_CONFIG_DIR"/node_key.json edit_config "$VAL_CONFIG_DIR" - use_connect "$VAL_CONFIG_DIR" + use_slinky "$VAL_CONFIG_DIR" # Using "*" as a subscript results in a single arg: "dydx1... dydx1... dydx1..." # Using "@" as a subscript results in separate args: "dydx1..." "dydx1..." "dydx1..." @@ -167,11 +167,11 @@ setup_cosmovisor() { done } -use_connect() { +use_slinky() { CONFIG_FOLDER=$1 # Enable slinky daemon dasel put -t bool -f "$CONFIG_FOLDER"/app.toml 'oracle.enabled' -v true - dasel put -t string -f "$VAL_CONFIG_DIR"/app.toml 'oracle.oracle_address' -v 'connect0:8080' + dasel put -t string -f "$VAL_CONFIG_DIR"/app.toml 'oracle.oracle_address' -v 'slinky0:8080' } # TODO(DEC-1894): remove this function once we migrate off of persistent peers. From b58701c146e98f0c62f46bb0c411e9e9aba8b3c1 Mon Sep 17 00:00:00 2001 From: Chenyao Yu <4844716+chenyaoy@users.noreply.github.com> Date: Fri, 13 Dec 2024 15:05:25 -0500 Subject: [PATCH 09/13] fix prometheus sidecar metrics --- protocol/contrib/prometheus/prometheus.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/protocol/contrib/prometheus/prometheus.yml b/protocol/contrib/prometheus/prometheus.yml index 5409a1df3d..a5205fdd47 100644 --- a/protocol/contrib/prometheus/prometheus.yml +++ b/protocol/contrib/prometheus/prometheus.yml @@ -4,4 +4,4 @@ global: scrape_configs: - job_name: "prometheus" static_configs: - - targets: ["connect0:8002"] # ingest side-car metrics in accordance w/ docker-compose env + - targets: ["slinky0:8002"] # ingest side-car metrics in accordance w/ docker-compose env From c399f9519ffaeb36908e255e474e9cb5e8f391c9 Mon Sep 17 00:00:00 2001 From: Chenyao Yu <4844716+chenyaoy@users.noreply.github.com> Date: Fri, 13 Dec 2024 15:14:47 -0500 Subject: [PATCH 10/13] push images --- .github/workflows/indexer-build-and-push-dev-staging.yml | 1 + .github/workflows/protocol-build-and-push-snapshot.yml | 1 + .github/workflows/protocol-build-and-push.yml | 3 ++- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/indexer-build-and-push-dev-staging.yml b/.github/workflows/indexer-build-and-push-dev-staging.yml index 5a98b72552..c7a10c1b02 100644 --- a/.github/workflows/indexer-build-and-push-dev-staging.yml +++ b/.github/workflows/indexer-build-and-push-dev-staging.yml @@ -6,6 +6,7 @@ on: # yamllint disable-line rule:truthy - main - 'release/indexer/v[0-9]+.[0-9]+.x' # e.g. release/indexer/v0.1.x - 'release/indexer/v[0-9]+.x' # e.g. release/indexer/v1.x + - 'downgrade-connect-v2-to-slinky' # TODO(DEC-837): Customize github build and push to ECR by service with paths jobs: diff --git a/.github/workflows/protocol-build-and-push-snapshot.yml b/.github/workflows/protocol-build-and-push-snapshot.yml index e5ff2c8b05..fdc3d4bc8d 100644 --- a/.github/workflows/protocol-build-and-push-snapshot.yml +++ b/.github/workflows/protocol-build-and-push-snapshot.yml @@ -6,6 +6,7 @@ on: # yamllint disable-line rule:truthy - main - 'release/protocol/v[0-9]+.[0-9]+.x' # e.g. release/protocol/v0.1.x - 'release/protocol/v[0-9]+.x' # e.g. release/protocol/v1.x + - 'downgrade-connect-v2-to-slinky' jobs: build-and-push-snapshot-dev: diff --git a/.github/workflows/protocol-build-and-push.yml b/.github/workflows/protocol-build-and-push.yml index ade5341369..52f040af1d 100644 --- a/.github/workflows/protocol-build-and-push.yml +++ b/.github/workflows/protocol-build-and-push.yml @@ -6,7 +6,8 @@ on: # yamllint disable-line rule:truthy - main - 'release/protocol/v[0-9]+.[0-9]+.x' # e.g. release/protocol/v0.1.x - 'release/protocol/v[0-9]+.x' # e.g. release/protocol/v1.x - + - 'release/protocol/v[0-9]+.x' # e.g. release/protocol/v1.x + - 'downgrade-connect-v2-to-slinky' jobs: build-and-push-dev: runs-on: ubuntu-latest From e4d8de07831772d924247b1186ea972a1ec7d752 Mon Sep 17 00:00:00 2001 From: Chenyao Yu <4844716+chenyaoy@users.noreply.github.com> Date: Fri, 13 Dec 2024 16:42:19 -0500 Subject: [PATCH 11/13] upgrade slinky to 1.1.0 --- protocol/go.mod | 2 +- protocol/go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/protocol/go.mod b/protocol/go.mod index 403a429be2..0f4821444f 100644 --- a/protocol/go.mod +++ b/protocol/go.mod @@ -69,7 +69,7 @@ require ( github.com/pelletier/go-toml v1.9.5 github.com/rs/zerolog v1.33.0 github.com/shopspring/decimal v1.3.1 - github.com/skip-mev/slinky v1.0.14-0.20241212193714-ab2537f1a1f2 + github.com/skip-mev/slinky v1.1.0 github.com/spf13/viper v1.19.0 github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d google.golang.org/genproto/googleapis/api v0.0.0-20240903143218-8af14fe29dc1 diff --git a/protocol/go.sum b/protocol/go.sum index 16a4433340..fc9ec1f3b6 100644 --- a/protocol/go.sum +++ b/protocol/go.sum @@ -1744,8 +1744,8 @@ github.com/sivchari/tenv v1.12.1 h1:+E0QzjktdnExv/wwsnnyk4oqZBUfuh89YMQT1cyuvSY= github.com/sivchari/tenv v1.12.1/go.mod h1:1LjSOUCc25snIr5n3DtGGrENhX3LuWefcplwVGC24mw= github.com/skip-mev/chaintestutil v0.0.0-20240514161515-056d7ba45610 h1:4JlsiRVt/YZOvrKH525T7sZXgEWUEjqSDMwE6fXNbdo= github.com/skip-mev/chaintestutil v0.0.0-20240514161515-056d7ba45610/go.mod h1:kB8gFZX07CyJnw8q9iEZijI3qJTIe1K/Y++P5VGkrcg= -github.com/skip-mev/slinky v1.0.14-0.20241212193714-ab2537f1a1f2 h1:lg8XXwQWVtZwe5DwkbFmeMuOhCiRMd/oQmVt0TYb7oA= -github.com/skip-mev/slinky v1.0.14-0.20241212193714-ab2537f1a1f2/go.mod h1:/FnDWFvhjZGmkH8K+lkGw+1I8Ogsh6a0rghMOtjAg+U= +github.com/skip-mev/slinky v1.1.0 h1:yAO4t1dOsei5WKQlhTdQEU/7e6tQhL2+i4X+pGfgN4I= +github.com/skip-mev/slinky v1.1.0/go.mod h1:/FnDWFvhjZGmkH8K+lkGw+1I8Ogsh6a0rghMOtjAg+U= github.com/sonatard/noctx v0.1.0 h1:JjqOc2WN16ISWAjAk8M5ej0RfExEXtkEyExl2hLW+OM= github.com/sonatard/noctx v0.1.0/go.mod h1:0RvBxqY8D4j9cTTTWE8ylt2vqj2EPI8fHmrxHdsaZ2c= github.com/sourcegraph/conc v0.3.0 h1:OQTbbt6P72L20UqAkXXuLOj79LfEanQ+YQFNpLA9ySo= From 53ab40cc10bc613702074620c39c17a53bbd2957 Mon Sep 17 00:00:00 2001 From: Chenyao Yu <4844716+chenyaoy@users.noreply.github.com> Date: Fri, 13 Dec 2024 17:18:04 -0500 Subject: [PATCH 12/13] undo ci change --- .github/workflows/indexer-build-and-push-dev-staging.yml | 1 - .github/workflows/protocol-build-and-push-snapshot.yml | 1 - .github/workflows/protocol-build-and-push.yml | 1 - 3 files changed, 3 deletions(-) diff --git a/.github/workflows/indexer-build-and-push-dev-staging.yml b/.github/workflows/indexer-build-and-push-dev-staging.yml index c7a10c1b02..5a98b72552 100644 --- a/.github/workflows/indexer-build-and-push-dev-staging.yml +++ b/.github/workflows/indexer-build-and-push-dev-staging.yml @@ -6,7 +6,6 @@ on: # yamllint disable-line rule:truthy - main - 'release/indexer/v[0-9]+.[0-9]+.x' # e.g. release/indexer/v0.1.x - 'release/indexer/v[0-9]+.x' # e.g. release/indexer/v1.x - - 'downgrade-connect-v2-to-slinky' # TODO(DEC-837): Customize github build and push to ECR by service with paths jobs: diff --git a/.github/workflows/protocol-build-and-push-snapshot.yml b/.github/workflows/protocol-build-and-push-snapshot.yml index fdc3d4bc8d..e5ff2c8b05 100644 --- a/.github/workflows/protocol-build-and-push-snapshot.yml +++ b/.github/workflows/protocol-build-and-push-snapshot.yml @@ -6,7 +6,6 @@ on: # yamllint disable-line rule:truthy - main - 'release/protocol/v[0-9]+.[0-9]+.x' # e.g. release/protocol/v0.1.x - 'release/protocol/v[0-9]+.x' # e.g. release/protocol/v1.x - - 'downgrade-connect-v2-to-slinky' jobs: build-and-push-snapshot-dev: diff --git a/.github/workflows/protocol-build-and-push.yml b/.github/workflows/protocol-build-and-push.yml index 52f040af1d..5e063c4342 100644 --- a/.github/workflows/protocol-build-and-push.yml +++ b/.github/workflows/protocol-build-and-push.yml @@ -7,7 +7,6 @@ on: # yamllint disable-line rule:truthy - 'release/protocol/v[0-9]+.[0-9]+.x' # e.g. release/protocol/v0.1.x - 'release/protocol/v[0-9]+.x' # e.g. release/protocol/v1.x - 'release/protocol/v[0-9]+.x' # e.g. release/protocol/v1.x - - 'downgrade-connect-v2-to-slinky' jobs: build-and-push-dev: runs-on: ubuntu-latest From 56e920fa084b296d4c3d28e21242ec59389aff0d Mon Sep 17 00:00:00 2001 From: Chenyao Yu <4844716+chenyaoy@users.noreply.github.com> Date: Mon, 16 Dec 2024 15:09:36 -0500 Subject: [PATCH 13/13] fix --- .github/workflows/protocol-build-and-push.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/protocol-build-and-push.yml b/.github/workflows/protocol-build-and-push.yml index 5e063c4342..ade5341369 100644 --- a/.github/workflows/protocol-build-and-push.yml +++ b/.github/workflows/protocol-build-and-push.yml @@ -6,7 +6,7 @@ on: # yamllint disable-line rule:truthy - main - 'release/protocol/v[0-9]+.[0-9]+.x' # e.g. release/protocol/v0.1.x - 'release/protocol/v[0-9]+.x' # e.g. release/protocol/v1.x - - 'release/protocol/v[0-9]+.x' # e.g. release/protocol/v1.x + jobs: build-and-push-dev: runs-on: ubuntu-latest