diff --git a/.github/workflows/check-state-compatibility.yml b/.github/workflows/check-state-compatibility.yml index b92798e6c5f..8ba902d5ed3 100644 --- a/.github/workflows/check-state-compatibility.yml +++ b/.github/workflows/check-state-compatibility.yml @@ -55,7 +55,8 @@ jobs: should_i_run: ${{ steps.compare_versions.outputs.should_i_run }} mainnet_major_version: ${{ steps.mainnet_version.outputs.mainnet_major_version }} steps: - - name: Get mainnet major version + - + name: Get mainnet major version id: mainnet_version run: | # Find current major version via rpc.osmosis.zone/abci_info @@ -64,7 +65,8 @@ jobs: echo "MAINNET_MAJOR_VERSION=$MAINNET_MAJOR_VERSION" >> $GITHUB_ENV echo "mainnet_major_version=$MAINNET_MAJOR_VERSION" >> $GITHUB_OUTPUT - - name: Get GitHub branch major version + - + name: Get GitHub branch major version id: compare_versions run: | CURRENT_BRANCH_MAJOR_VERSION=$(echo ${{ github.event.pull_request.base.ref }} | tr -dc '0-9') @@ -86,20 +88,23 @@ jobs: needs: compare_versions runs-on: self-hosted steps: - - name: Checkout branch + - + name: Checkout branch uses: actions/checkout@v4 with: fetch-depth: 0 - - + - name: 🐿 Setup Golang uses: actions/setup-go@v4 with: - go-version: '^1.20' - - name: 🔨 Build the osmosisd binary + go-version-file: go.mod + - + name: 🔨 Build the osmosisd binary run: | make build build/osmosisd version - - name: 🧪 Initialize Osmosis Node + - + name: 🧪 Initialize Osmosis Node run: | rm -rf $HOME/.osmosisd/ || true build/osmosisd init runner -o @@ -112,9 +117,10 @@ jobs: # Copy genesis to config folder cp /mnt/data/genesis/osmosis-1/genesis.json $HOME/.osmosisd/config/genesis.json - - name: ⏬ Download last pre-epoch snapshot + - + name: ⏬ Download last pre-epoch snapshot run: | - REPO_MAJOR_VERSION=v19 + REPO_MAJOR_VERSION=$(echo ${{ github.base_ref }} | sed 's/\.x//') SNAPSHOT_INFO_URL=${{ env.SNAPSHOT_BUCKET }}/$REPO_MAJOR_VERSION/snapshots.json # Get the latest pre-epoch snapshot information from bucket @@ -132,12 +138,11 @@ jobs: # Copy snapshot in Data folder cp -R /mnt/data/snapshots/$REPO_MAJOR_VERSION/$SNAPSHOT_ID/* $HOME/.osmosisd/ - - name: 🧪 Configure Osmosis Node + - + name: 🧪 Configure Osmosis Node run: | CONFIG_FOLDER=$HOME/.osmosisd/config - - # Find last epoch block comparing repo version to current chain version - REPO_MAJOR_VERSION=19 + REPO_MAJOR_VERSION=$(echo ${{ github.base_ref }} | tr -dc '0-9') if [ $REPO_MAJOR_VERSION == $MAINNET_MAJOR_VERSION ]; then # I'm in the latest major, fetch the epoch info from the lcd endpoint @@ -170,8 +175,10 @@ jobs: # Download addrbook wget -q -O $CONFIG_FOLDER/addrbook.json ${{ env.ADDRBOOK_URL }} - - name: 🧪 Start Osmosis Node + - + name: 🧪 Start Osmosis Node run: build/osmosisd start - - name: 🧹 Clean up Osmosis Home + - + name: 🧹 Clean up Osmosis Home if: always() - run: rm -rf $HOME/.osmosisd/ || true + run: rm -rf $HOME/.osmosisd/ || true \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index a581b1dbad4..9cbe5753347 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -40,6 +40,29 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## v20.5.1 + +### API + +* [#6939](https://github.com/osmosis-labs/osmosis/pull/6939) Fix taker fee GRPC gateway query path in poolmanager. + +## v20.4.0 + +### Bug Fixes + +* [#6906](https://github.com/osmosis-labs/osmosis/pull/6906) Fix issue with the affiliate swap contract mempool check. + +### Misc Improvements + +* [#6863](https://github.com/osmosis-labs/osmosis/pull/6863) GetPoolDenoms method on PoolI interface in poolmanager +* [#6900](https://github.com/osmosis-labs/osmosis/pull/6900) Update EIP-1559 constants to smoothen resets. + +## v20.3.0 + +### Configuration Changes + +* [#6897](https://github.com/osmosis-labs/osmosis/pull/6897) Enable 1559 mempool by default. + ## v20.2.2 ### Features @@ -48,14 +71,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Misc Improvements * [#6788](https://github.com/osmosis-labs/osmosis/pull/6788) Improve error message when CL LP fails due to slippage bound hit. -* [#6898](https://github.com/osmosis-labs/osmosis/pull/6898) Enable 1559 mempool by default. ### API Breaks * [#6805](https://github.com/osmosis-labs/osmosis/pull/6805) return bucket index of the current tick from LiquidityPerTickRange query * [#6863](https://github.com/osmosis-labs/osmosis/pull/6863) GetPoolDenoms method on PoolI interface in poolmanager - ## v20.0.0 ### Features diff --git a/app/app.go b/app/app.go index 4c2d9674582..77922c2fe14 100644 --- a/app/app.go +++ b/app/app.go @@ -268,6 +268,7 @@ func NewOsmosisApp( ) isIngestManagerEnabled := os.Getenv(ENV_NAME_INGEST_TYPE) == ENV_VALUE_INGESTER_SQS + // Initialize the ingest manager for propagating data to external sinks. app.IngestManager = ingest.NewIngestManager() if isIngestManagerEnabled { dbHost := os.Getenv(ENV_NAME_INGEST_SQS_DBHOST) @@ -327,7 +328,7 @@ func NewOsmosisApp( sqsIngester := sqs.NewSidecarQueryServerIngester(poolsIngester, chainInfoingester, txManager) // Set the sidecar query server ingester to the ingest manager. - app.IngestManager.SetIngester(sqsIngester) + app.IngestManager.RegisterIngester(sqsIngester) } // TODO: There is a bug here, where we register the govRouter routes in InitNormalKeepers and then @@ -453,8 +454,8 @@ func (app *OsmosisApp) BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock) // EndBlocker application updates every end block. func (app *OsmosisApp) EndBlocker(ctx sdk.Context, req abci.RequestEndBlock) abci.ResponseEndBlock { + // Process the block and ingest data into various sinks. app.IngestManager.ProcessBlock(ctx) - return app.mm.EndBlock(ctx, req) } diff --git a/app/keepers/keepers.go b/app/keepers/keepers.go index 887ea1bd2b5..80d3e627388 100644 --- a/app/keepers/keepers.go +++ b/app/keepers/keepers.go @@ -36,7 +36,6 @@ import ( icq "github.com/cosmos/ibc-apps/modules/async-icq/v4" icqtypes "github.com/cosmos/ibc-apps/modules/async-icq/v4/types" - "github.com/osmosis-labs/osmosis/v20/ingest" "github.com/osmosis-labs/osmosis/v20/x/cosmwasmpool" cosmwasmpooltypes "github.com/osmosis-labs/osmosis/v20/x/cosmwasmpool/types" downtimedetector "github.com/osmosis-labs/osmosis/v20/x/downtime-detector" @@ -67,6 +66,8 @@ import ( packetforwardkeeper "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v4/router/keeper" packetforwardtypes "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v4/router/types" + "github.com/osmosis-labs/osmosis/v20/ingest" + // IBC Transfer: Defines the "transfer" IBC port transfer "github.com/cosmos/ibc-go/v4/modules/apps/transfer" diff --git a/ingest/README.md b/ingest/README.md new file mode 100644 index 00000000000..b01a3f9c349 --- /dev/null +++ b/ingest/README.md @@ -0,0 +1,8 @@ +# Ingest + +This is a package that is responsible for ingesting end-of-block data into various +sinks. It is designed to be extensible. A user can add a new sink by implementing +an `Ingester` interface and then calling `RegisterIngester` in `app.go`. + +Note that to avoid causing a chain halt, any error or panic occuring during ingestion +is logged and silently ignored. diff --git a/ingest/ingest_manager.go b/ingest/ingest_manager.go index 98388ece5eb..4a7ed4909ee 100644 --- a/ingest/ingest_manager.go +++ b/ingest/ingest_manager.go @@ -2,22 +2,20 @@ package ingest import ( sdk "github.com/cosmos/cosmos-sdk/types" - - "github.com/osmosis-labs/osmosis/v20/ingest/sqs/domain/mvc" - "github.com/osmosis-labs/osmosis/v20/ingest/sqs/log" ) // IngestManager is an interface that defines the methods for the ingest manager. // Ingest manager handles the processing of blocks and ingesting data into various sinks // tha are defined by the Ingester interface. type IngestManager interface { + // RegisterIngester registers an ingester + // to propagate data into at the end of each block. + RegisterIngester(ingester Ingester) + // ProcessBlock processes the block and ingests data into various sinks. // Must never panic. If panic occurs, it is silently logged and ignored. // If the ingester returns an error, it is silently logged and ignored. ProcessBlock(ctx sdk.Context) - // SetIngester sets the ingester. - // Note: In the future, we may expand this to support multiple ingesters. - SetIngester(ingester Ingester) } // Ingester is an interface that defines the methods for the ingester. @@ -26,23 +24,13 @@ type Ingester interface { // ProcessBlock processes the block and ingests data into a sink. // Returns error if the ingester fails to ingest data. ProcessBlock(ctx sdk.Context) error -} - -// AtomicIngester is an interface that defines the methods for the atomic ingester. -// It processes a block by writing data into a transaction. -// The caller must call Exec on the transaction to flush data to sink. -type AtomicIngester interface { - // ProcessBlock processes the block by writing data into a transaction. - // Returns error if fails to process. - // It does not flush data to sink. The caller must call Exec on the transaction - ProcessBlock(ctx sdk.Context, tx mvc.Tx) error - SetLogger(log.Logger) + GetName() string } // ingesterImpl is an implementation of IngesterManager. type ingestManagerImpl struct { - ingester Ingester + ingesters []Ingester } var _ IngestManager = &ingestManagerImpl{} @@ -50,10 +38,15 @@ var _ IngestManager = &ingestManagerImpl{} // NewIngestManager creates a new IngestManager. func NewIngestManager() IngestManager { return &ingestManagerImpl{ - ingester: nil, + ingesters: []Ingester{}, } } +// RegisterIngester implements IngestManager. +func (im *ingestManagerImpl) RegisterIngester(ingester Ingester) { + im.ingesters = append(im.ingesters, ingester) +} + // ProcessBlock implements IngestManager. func (im *ingestManagerImpl) ProcessBlock(ctx sdk.Context) { defer func() { @@ -63,16 +56,11 @@ func (im *ingestManagerImpl) ProcessBlock(ctx sdk.Context) { } }() - // Ingester must be set in the app. If not, we do nothing. - if im.ingester != nil { - if err := im.ingester.ProcessBlock(ctx); err != nil { + // Ingesters must be set in the app. If not, we do nothing. + for _, ingester := range im.ingesters { + if err := ingester.ProcessBlock(ctx); err != nil { // The error is silently logged and ignored. - ctx.Logger().Error("error processing block during ingest", "err", err) + ctx.Logger().Error("error processing block during ingest", "err", err, "ingester", ingester.GetName()) } } } - -// SetIngester implements IngestManager. -func (im *ingestManagerImpl) SetIngester(ingester Ingester) { - im.ingester = ingester -} diff --git a/ingest/sqs/chain_info/ingester/redis/chain_info_ingester.go b/ingest/sqs/chain_info/ingester/redis/chain_info_ingester.go index 876a8eb3c68..8c9cc35b3d7 100644 --- a/ingest/sqs/chain_info/ingester/redis/chain_info_ingester.go +++ b/ingest/sqs/chain_info/ingester/redis/chain_info_ingester.go @@ -4,7 +4,6 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "go.uber.org/zap" - "github.com/osmosis-labs/osmosis/v20/ingest" "github.com/osmosis-labs/osmosis/v20/ingest/sqs/domain/mvc" "github.com/osmosis-labs/osmosis/v20/ingest/sqs/log" ) @@ -19,7 +18,7 @@ type chainInfoIngester struct { } // NewChainInfoIngester returns a new chain information ingester. -func NewChainInfoIngester(chainInfoRepo mvc.ChainInfoRepository, repositoryManager mvc.TxManager) ingest.AtomicIngester { +func NewChainInfoIngester(chainInfoRepo mvc.ChainInfoRepository, repositoryManager mvc.TxManager) mvc.AtomicIngester { return &chainInfoIngester{ chainInfoRepo: chainInfoRepo, repositoryManager: repositoryManager, @@ -47,4 +46,4 @@ func (ci *chainInfoIngester) SetLogger(logger log.Logger) { ci.logger = logger } -var _ ingest.AtomicIngester = &chainInfoIngester{} +var _ mvc.AtomicIngester = &chainInfoIngester{} diff --git a/ingest/sqs/domain/errors.go b/ingest/sqs/domain/errors.go index 1140cafee11..28b4ccce171 100644 --- a/ingest/sqs/domain/errors.go +++ b/ingest/sqs/domain/errors.go @@ -104,11 +104,11 @@ func (e ConcentratedNotEnoughLiquidityToCompleteSwapError) Error() string { return fmt.Sprintf("not enough liquidity to complete swap in pool (%d) with amount in (%s)", e.PoolId, e.AmountIn) } -type ConcentratedTickModelNotSet struct { +type ConcentratedTickModelNotSetError struct { PoolId uint64 } -func (e ConcentratedTickModelNotSet) Error() string { +func (e ConcentratedTickModelNotSetError) Error() string { return fmt.Sprintf("tick model is not set on pool (%d)", e.PoolId) } diff --git a/ingest/sqs/domain/mocks/pool_mock.go b/ingest/sqs/domain/mocks/pool_mock.go index 6d4eff6d611..d654fda21a6 100644 --- a/ingest/sqs/domain/mocks/pool_mock.go +++ b/ingest/sqs/domain/mocks/pool_mock.go @@ -56,15 +56,14 @@ func (mp *MockRoutablePool) GetSQSPoolModel() domain.SQSPool { } // CalculateTokenOutByTokenIn implements routerusecase.RoutablePool. -func (r *MockRoutablePool) CalculateTokenOutByTokenIn(tokenIn sdk.Coin) (sdk.Coin, error) { - +func (mp *MockRoutablePool) CalculateTokenOutByTokenIn(tokenIn sdk.Coin) (sdk.Coin, error) { // Cast to balancer - balancerPool, ok := r.ChainPoolModel.(*balancer.Pool) + balancerPool, ok := mp.ChainPoolModel.(*balancer.Pool) if !ok { panic("not a balancer pool") } - return balancerPool.CalcOutAmtGivenIn(sdk.Context{}, sdk.NewCoins(tokenIn), r.TokenOutDenom, r.SpreadFactor) + return balancerPool.CalcOutAmtGivenIn(sdk.Context{}, sdk.NewCoins(tokenIn), mp.TokenOutDenom, mp.SpreadFactor) } // String implements domain.RoutablePool. diff --git a/ingest/sqs/domain/mocks/pools_usecase_mock.go b/ingest/sqs/domain/mocks/pools_usecase_mock.go index 293b4d60727..506db1b2df8 100644 --- a/ingest/sqs/domain/mocks/pools_usecase_mock.go +++ b/ingest/sqs/domain/mocks/pools_usecase_mock.go @@ -19,15 +19,14 @@ type PoolsUsecaseMock struct { // GetRoutesFromCandidates implements mvc.PoolsUsecase. // Note that taker fee are ignored and not set // Note that tick models are not set -func (r *PoolsUsecaseMock) GetRoutesFromCandidates(ctx context.Context, candidateRoutes route.CandidateRoutes, takerFeeMap domain.TakerFeeMap, tokenInDenom string, tokenOutDenom string) ([]route.RouteImpl, error) { +func (pm *PoolsUsecaseMock) GetRoutesFromCandidates(ctx context.Context, candidateRoutes route.CandidateRoutes, takerFeeMap domain.TakerFeeMap, tokenInDenom string, tokenOutDenom string) ([]route.RouteImpl, error) { finalRoutes := make([]route.RouteImpl, 0, len(candidateRoutes.Routes)) for _, candidateRoute := range candidateRoutes.Routes { - routablePools := make([]domain.RoutablePool, 0, len(candidateRoute.Pools)) for _, candidatePool := range candidateRoute.Pools { // Get the pool data for routing var foundPool domain.PoolI - for _, pool := range r.Pools { + for _, pool := range pm.Pools { if pool.GetId() == candidatePool.ID { foundPool = pool } diff --git a/ingest/sqs/domain/mvc/doc.go b/ingest/sqs/domain/mvc/doc.go index a7bed9d9477..cf1f9a95e6c 100644 --- a/ingest/sqs/domain/mvc/doc.go +++ b/ingest/sqs/domain/mvc/doc.go @@ -1,3 +1,3 @@ // Encapsulates the Model-View-Controller abstraction domain. // Separated from the rest of the domain to avoid import cycles. -package mvc \ No newline at end of file +package mvc diff --git a/ingest/sqs/domain/mvc/repository.go b/ingest/sqs/domain/mvc/repository.go index 489140f9d5c..18ee3e89704 100644 --- a/ingest/sqs/domain/mvc/repository.go +++ b/ingest/sqs/domain/mvc/repository.go @@ -4,7 +4,10 @@ import ( "context" "errors" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/redis/go-redis/v9" + + "github.com/osmosis-labs/osmosis/v20/ingest/sqs/log" ) // Tx defines an interface for atomic transaction. @@ -24,6 +27,18 @@ type Tx interface { ClearAll(ctx context.Context) error } +// AtomicIngester is an interface that defines the methods for the atomic ingester. +// It processes a block by writing data into a transaction. +// The caller must call Exec on the transaction to flush data to sink. +type AtomicIngester interface { + // ProcessBlock processes the block by writing data into a transaction. + // Returns error if fails to process. + // It does not flush data to sink. The caller must call Exec on the transaction + ProcessBlock(ctx sdk.Context, tx Tx) error + + SetLogger(log.Logger) +} + // RedisTx is a redis transaction. type RedisTx struct { pipeliner redis.Pipeliner diff --git a/ingest/sqs/domain/router.go b/ingest/sqs/domain/router.go index a07d80bd0d8..080cadbb030 100644 --- a/ingest/sqs/domain/router.go +++ b/ingest/sqs/domain/router.go @@ -105,9 +105,9 @@ var _ json.Marshaler = &TakerFeeMap{} var _ json.Unmarshaler = &TakerFeeMap{} // MarshalJSON implements json.Marshaler. -func (m TakerFeeMap) MarshalJSON() ([]byte, error) { +func (tfm TakerFeeMap) MarshalJSON() ([]byte, error) { serializedMap := map[string]osmomath.Dec{} - for key, value := range m { + for key, value := range tfm { // Convert DenomPair to a string representation keyString := fmt.Sprintf("%s-%s", key.Denom0, key.Denom1) serializedMap[keyString] = value @@ -117,7 +117,7 @@ func (m TakerFeeMap) MarshalJSON() ([]byte, error) { } // UnmarshalJSON implements json.Unmarshaler. -func (m TakerFeeMap) UnmarshalJSON(data []byte) error { +func (tfm TakerFeeMap) UnmarshalJSON(data []byte) error { var serializedMap map[string]osmomath.Dec if err := json.Unmarshal(data, &serializedMap); err != nil { return err @@ -130,7 +130,7 @@ func (m TakerFeeMap) UnmarshalJSON(data []byte) error { return fmt.Errorf("invalid key format: %s", keyString) } denomPair := DenomPair{Denom0: parts[0], Denom1: parts[1]} - (m)[denomPair] = value + (tfm)[denomPair] = value } return nil diff --git a/ingest/sqs/ingester.go b/ingest/sqs/ingester.go index 6df193293a5..dca8019c1df 100644 --- a/ingest/sqs/ingester.go +++ b/ingest/sqs/ingester.go @@ -7,20 +7,22 @@ import ( "github.com/osmosis-labs/osmosis/v20/ingest/sqs/domain/mvc" ) +const sqsIngesterName = "sidecar-query-server" + var _ ingest.Ingester = &sqsIngester{} // sqsIngester is a sidecar query server (SQS) implementation of Ingester. // It encapsulates all individual SQS ingesters. type sqsIngester struct { txManager mvc.TxManager - poolsIngester ingest.AtomicIngester - chainInfoIngester ingest.AtomicIngester + poolsIngester mvc.AtomicIngester + chainInfoIngester mvc.AtomicIngester } // NewSidecarQueryServerIngester creates a new sidecar query server ingester. // poolsRepository is the storage for pools. // gammKeeper is the keeper for Gamm pools. -func NewSidecarQueryServerIngester(poolsIngester, chainInfoIngester ingest.AtomicIngester, txManager mvc.TxManager) ingest.Ingester { +func NewSidecarQueryServerIngester(poolsIngester, chainInfoIngester mvc.AtomicIngester, txManager mvc.TxManager) ingest.Ingester { return &sqsIngester{ txManager: txManager, chainInfoIngester: chainInfoIngester, @@ -53,3 +55,8 @@ func (i *sqsIngester) ProcessBlock(ctx sdk.Context) error { // Flush all writes atomically return tx.Exec(goCtx) } + +// GetName implements ingest.Ingester. +func (*sqsIngester) GetName() string { + return sqsIngesterName +} diff --git a/ingest/sqs/pools/ingester/redis/pool_ingester.go b/ingest/sqs/pools/ingester/redis/pool_ingester.go index c911d7a7146..fec33358d3f 100644 --- a/ingest/sqs/pools/ingester/redis/pool_ingester.go +++ b/ingest/sqs/pools/ingester/redis/pool_ingester.go @@ -10,7 +10,6 @@ import ( "go.uber.org/zap" "github.com/osmosis-labs/osmosis/osmomath" - "github.com/osmosis-labs/osmosis/v20/ingest" "github.com/osmosis-labs/osmosis/v20/ingest/sqs/domain" "github.com/osmosis-labs/osmosis/v20/ingest/sqs/domain/mvc" "github.com/osmosis-labs/osmosis/v20/ingest/sqs/log" @@ -71,7 +70,7 @@ const ( var uosmoPrecisionBigDec = osmomath.NewBigDec(uosmoPrecision) // NewPoolIngester returns a new pool ingester. -func NewPoolIngester(poolsRepository mvc.PoolsRepository, routerRepository mvc.RouterRepository, tokensUseCase domain.TokensUsecase, repositoryManager mvc.TxManager, routerConfig domain.RouterConfig, gammKeeper common.PoolKeeper, concentratedKeeper common.ConcentratedKeeper, cosmwasmKeeper common.CosmWasmPoolKeeper, bankKeeper common.BankKeeper, protorevKeeper common.ProtorevKeeper, poolManagerKeeper common.PoolManagerKeeper) ingest.AtomicIngester { +func NewPoolIngester(poolsRepository mvc.PoolsRepository, routerRepository mvc.RouterRepository, tokensUseCase domain.TokensUsecase, repositoryManager mvc.TxManager, routerConfig domain.RouterConfig, gammKeeper common.PoolKeeper, concentratedKeeper common.ConcentratedKeeper, cosmwasmKeeper common.CosmWasmPoolKeeper, bankKeeper common.BankKeeper, protorevKeeper common.ProtorevKeeper, poolManagerKeeper common.PoolManagerKeeper) mvc.AtomicIngester { return &poolIngester{ poolsRepository: poolsRepository, routerRepository: routerRepository, @@ -92,7 +91,7 @@ func (pi *poolIngester) ProcessBlock(ctx sdk.Context, tx mvc.Tx) error { return pi.processPoolState(ctx, tx) } -var _ ingest.AtomicIngester = &poolIngester{} +var _ mvc.AtomicIngester = &poolIngester{} // processPoolState processes the pool state. an func (pi *poolIngester) processPoolState(ctx sdk.Context, tx mvc.Tx) error { @@ -209,7 +208,6 @@ func (pi *poolIngester) updateRoutes(ctx context.Context, tx mvc.Tx, pools []dom router = routerusecase.WithSortedPools(router, pools) go func(denomPair domain.DenomPair) { - // TODO: abstract this better candidateRoutes, err := router.GetCandidateRoutes(denomPair.Denom0, denomPair.Denom1) diff --git a/ingest/sqs/pools/repository/redis/redis_pools_repository.go b/ingest/sqs/pools/repository/redis/redis_pools_repository.go index 7d5cd56221e..3bfab2e1d85 100644 --- a/ingest/sqs/pools/repository/redis/redis_pools_repository.go +++ b/ingest/sqs/pools/repository/redis/redis_pools_repository.go @@ -338,25 +338,6 @@ func (r *redisPoolsRepo) GetTickModelForPools(ctx context.Context, pools []uint6 return result, nil } -// getTicksMapByIdCmd returns a map of tick models by pool ID. -// Uses transaction to ensure atomicity. -func getTicksMapByIdCmd(ctx context.Context, tx mvc.Tx) (*redis.MapStringStringCmd, error) { - if !tx.IsActive() { - return nil, fmt.Errorf("tx is inactive") - } - redisTx, err := tx.AsRedisTx() - if err != nil { - return nil, err - } - pipeliner, err := redisTx.GetPipeliner(ctx) - if err != nil { - return nil, err - } - - ticksMapByIDCmd := pipeliner.HGetAll(ctx, concentratedTicksModelKey(poolsKey)) - return ticksMapByIDCmd, nil -} - func sqsPoolModelKey(storeKey string) string { return fmt.Sprintf("%s/sqs", storeKey) } diff --git a/ingest/sqs/pools/usecase/pools_usecase.go b/ingest/sqs/pools/usecase/pools_usecase.go index f7456329ec6..d8259e085cb 100644 --- a/ingest/sqs/pools/usecase/pools_usecase.go +++ b/ingest/sqs/pools/usecase/pools_usecase.go @@ -102,7 +102,7 @@ func (p *poolsUseCase) GetRoutesFromCandidates(ctx context.Context, candidateRou // Get tick model for concentrated pool tickModel, ok := tickModelMap[pool.GetId()] if !ok { - return nil, domain.ConcentratedTickModelNotSet{ + return nil, domain.ConcentratedTickModelNotSetError{ PoolId: pool.GetId(), } } diff --git a/ingest/sqs/pools/usecase/pools_usecase_test.go b/ingest/sqs/pools/usecase/pools_usecase_test.go index 4c9cf8fb8d2..cce8c83d0a4 100644 --- a/ingest/sqs/pools/usecase/pools_usecase_test.go +++ b/ingest/sqs/pools/usecase/pools_usecase_test.go @@ -116,7 +116,7 @@ func (s *PoolsUsecaseTestSuite) TestGetRoutesFromCandidates() { }, }, { - name: "error: no taker fee", + name: "no taker fee - use default", pools: validPools, candidateRoutes: validCandidateRoutes, @@ -127,9 +127,12 @@ func (s *PoolsUsecaseTestSuite) TestGetRoutesFromCandidates() { tokenInDenom: denomOne, tokenOutDenom: denomTwo, - expectedError: domain.TakerFeeNotFoundForDenomPairError{ - Denom0: denomOne, - Denom1: denomTwo, + expectedRoutes: []route.RouteImpl{ + { + Pools: []domain.RoutablePool{ + pools.NewRoutablePool(defaultPool, denomTwo, domain.DefaultTakerFee), + }, + }, }, }, { diff --git a/ingest/sqs/router/README.md b/ingest/sqs/router/README.md index 257cd50ed78..c17fcbc9d92 100644 --- a/ingest/sqs/router/README.md +++ b/ingest/sqs/router/README.md @@ -44,7 +44,7 @@ osmosisd tx cosmwasmpool create-pool 1 "{\"pool_asset_denoms\":[\"uion\",\"uosmo osmosisd tx wasm execute osmo14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9sq2r9g9 "{\"join_pool\":{} }" --amount 1000000uosmo,2000000uion --from lo-test1 --keyring-backend test --chain-id localosmosis --fees 8750uosmo -b=block --gas=3500000 ``` -### Plan: +### Plan 1. Let's make sure that tick model can be retrieved from storage for CL pools independently. (complete) 2. Let's not retrieve tick model with pools. (complete) diff --git a/ingest/sqs/router/usecase/candidate_routes.go b/ingest/sqs/router/usecase/candidate_routes.go index 195fb835c2d..f53caa155ea 100644 --- a/ingest/sqs/router/usecase/candidate_routes.go +++ b/ingest/sqs/router/usecase/candidate_routes.go @@ -8,7 +8,7 @@ import ( // candidatePoolWrapper is an intermediary internal data // structure for constructing all candidate routes related data. // It contains pool denoms for validation after the initial route selection. -// Additionally, it contains the pool type for contructing eventually constructing +// Additionally, it contains the pool type for contracting eventually constructing // a unque list of concentrated pools for knowing which pools require // a tick model. type candidatePoolWrapper struct { diff --git a/ingest/sqs/router/usecase/dynamic_splits.go b/ingest/sqs/router/usecase/dynamic_splits.go index 853d224e4bc..9b40f66c416 100644 --- a/ingest/sqs/router/usecase/dynamic_splits.go +++ b/ingest/sqs/router/usecase/dynamic_splits.go @@ -59,7 +59,7 @@ func (r *Router) GetSplitQuote(routes []route.RouteImpl, tokenIn sdk.Coin) (doma amountOut: osmomath.ZeroInt(), } - bestSplit, err := r.findSplit(memo, routes, 0, tokenIn, tokenIn.Amount, totalIncrements, initialEmptySplit, initialEmptySplit) + bestSplit, err := r.findSplit(memo, routes, 0, tokenIn, totalIncrements, initialEmptySplit, initialEmptySplit) if err != nil { return nil, err } @@ -125,12 +125,11 @@ func (r *Router) GetSplitQuote(routes []route.RouteImpl, tokenIn sdk.Coin) (doma } return quote, nil - } // Recurrence relation: // // findSplit(currentIncrement, currentRoute) = max(estimate(currentRoute, tokeInAmt * currentIncrement / totalIncrements) + OptimalSplit(remainingIncrement - currentIncrement, remaining_routes[1:])) -func (r *Router) findSplit(memo []map[uint8]osmomath.Int, routes []route.RouteImpl, currentRouteIndex uint8, tokenIn sdk.Coin, remainingTokenIn osmomath.Int, remainingIncrements uint8, bestSplitSoFar, currentSplit split) (split, error) { +func (r *Router) findSplit(memo []map[uint8]osmomath.Int, routes []route.RouteImpl, currentRouteIndex uint8, tokenIn sdk.Coin, remainingIncrements uint8, bestSplitSoFar, currentSplit split) (split, error) { // Current route index must be within range if currentRouteIndex >= uint8(len(routes)) { return split{}, fmt.Errorf("current route index (%d) is out of range (%d)", currentRouteIndex, len(routes)) @@ -144,7 +143,7 @@ func (r *Router) findSplit(memo []map[uint8]osmomath.Int, routes []route.RouteIm currentIncrement := remainingIncrements // Attempt to get memoized value. - currentAmtOut, _, err := getAmountOut(currentRoute, currentRouteIndex, memo, currentIncrement, tokenInAmountDec, tokenIn.Denom) + currentAmtOut, err := getAmountOut(currentRoute, currentRouteIndex, memo, currentIncrement, tokenInAmountDec, tokenIn.Denom) if err != nil { // Note that we should always return bestSplitSoFar if there is an error // since we silently skip the failing splits and want to preserve the context about bestSplitSoFar @@ -164,8 +163,7 @@ func (r *Router) findSplit(memo []map[uint8]osmomath.Int, routes []route.RouteIm // TODO: start from highest and exit early for currentIncrement := uint8(0); currentIncrement <= remainingIncrements; currentIncrement++ { - - currentAmtOut, currentAmtIn, err := getAmountOut(currentRoute, currentRouteIndex, memo, currentIncrement, tokenInAmountDec, tokenIn.Denom) + currentAmtOut, err := getAmountOut(currentRoute, currentRouteIndex, memo, currentIncrement, tokenInAmountDec, tokenIn.Denom) if err != nil { continue } @@ -178,7 +176,7 @@ func (r *Router) findSplit(memo []map[uint8]osmomath.Int, routes []route.RouteIm currentSplitCopy.routeIncrements[currentRouteIndex] = int16(currentIncrement) // Recurse - bestSplitSoFar, err = r.findSplit(memo, routes, currentRouteIndex+1, tokenIn, tokenIn.Amount.Sub(currentAmtIn), remainingIncrements-currentIncrement, bestSplitSoFar, currentSplitCopy) + bestSplitSoFar, err = r.findSplit(memo, routes, currentRouteIndex+1, tokenIn, remainingIncrements-currentIncrement, bestSplitSoFar, currentSplitCopy) if err != nil { continue } @@ -192,23 +190,23 @@ func (r *Router) findSplit(memo []map[uint8]osmomath.Int, routes []route.RouteIm // Otherwise, it calculates the amount out and memoizes it by mutating the memo. // Returns error if the amount out cannot be calculated. // Otherwise, returns nil. -func getAmountOut(route route.RouteImpl, memoRouteIndex uint8, memo []map[uint8]osmomath.Int, currentIncrement uint8, totalAmountIn osmomath.Dec, tokenInDenom string) (amtOut, amtIn osmomath.Int, err error) { +func getAmountOut(route route.RouteImpl, memoRouteIndex uint8, memo []map[uint8]osmomath.Int, currentIncrement uint8, totalAmountIn osmomath.Dec, tokenInDenom string) (amtOut osmomath.Int, err error) { if currentIncrement == 0 { zeroResult := osmomath.ZeroInt() memo[memoRouteIndex][currentIncrement] = zeroResult - return zeroResult, zeroResult, nil + return zeroResult, nil } currentAmtOut, ok := memo[memoRouteIndex][currentIncrement] currentRatio := osmomath.NewDec(int64(currentIncrement)).Quo(osmomath.NewDec(int64(totalIncrements))) currentTokenAmountIn := currentRatio.MulMut(totalAmountIn) - amtIn = currentTokenAmountIn.TruncateInt() + amtIn := currentTokenAmountIn.TruncateInt() if !ok { coinOut, err := route.CalculateTokenOutByTokenIn(sdk.NewCoin(tokenInDenom, amtIn)) if err != nil { - return osmomath.Int{}, osmomath.Int{}, err + return osmomath.Int{}, err } currentAmtOut = coinOut.Amount @@ -217,5 +215,5 @@ func getAmountOut(route route.RouteImpl, memoRouteIndex uint8, memo []map[uint8] memo[memoRouteIndex][currentIncrement] = currentAmtOut } - return currentAmtOut, amtIn, nil + return currentAmtOut, nil } diff --git a/ingest/sqs/router/usecase/export_test.go b/ingest/sqs/router/usecase/export_test.go index 047084c9223..4782033c580 100644 --- a/ingest/sqs/router/usecase/export_test.go +++ b/ingest/sqs/router/usecase/export_test.go @@ -26,16 +26,16 @@ func (r *Router) ValidateAndFilterRoutes(candidateRoutes [][]candidatePoolWrappe return r.validateAndFilterRoutes(candidateRoutes, tokenInDenom) } -func (r *routerUseCaseImpl) InitializeRouter(ctx context.Context) (*Router, error) { - return r.initializeRouter(ctx) +func (r *routerUseCaseImpl) InitializeRouter() *Router { + return r.initializeRouter() } func (r *routerUseCaseImpl) HandleRoutes(ctx context.Context, router *Router, tokenInDenom, tokenOutDenom string) (candidateRoutes route.CandidateRoutes, err error) { return r.handleRoutes(ctx, router, tokenInDenom, tokenOutDenom) } -func (r *Router) GetOptimalQuote(tokenIn sdk.Coin, tokenOutDenom string, routes []route.RouteImpl) (domain.Quote, error) { - return r.getOptimalQuote(tokenIn, tokenOutDenom, routes) +func (r *Router) GetOptimalQuote(tokenIn sdk.Coin, routes []route.RouteImpl) (domain.Quote, error) { + return r.getOptimalQuote(tokenIn, routes) } // GetSortedPoolIDs returns the sorted pool IDs. diff --git a/ingest/sqs/router/usecase/optimized_routes.go b/ingest/sqs/router/usecase/optimized_routes.go index 64c85052233..84967d6dd4b 100644 --- a/ingest/sqs/router/usecase/optimized_routes.go +++ b/ingest/sqs/router/usecase/optimized_routes.go @@ -16,7 +16,7 @@ import ( // getOptimalQuote returns the optimal quote by estimating the optimal route(s) through pools // Considers all routes and splits. // Returns error if router repository is not set on the router. -func (r *Router) getOptimalQuote(tokenIn sdk.Coin, tokenOutDenom string, routes []route.RouteImpl) (domain.Quote, error) { +func (r *Router) getOptimalQuote(tokenIn sdk.Coin, routes []route.RouteImpl) (domain.Quote, error) { if r.routerRepository == nil { return nil, ErrNilRouterRepository } @@ -83,7 +83,7 @@ func (r *Router) getOptimalQuote(tokenIn sdk.Coin, tokenOutDenom string, routes // getSingleRouteQuote returns the best single route quote for the given tokenIn and tokenOutDenom. // Returns error if router repository is not set on the router. -func (r *Router) getBestSingleRouteQuote(tokenIn sdk.Coin, tokenOutDenom string, routes []route.RouteImpl) (quote domain.Quote, err error) { +func (r *Router) getBestSingleRouteQuote(tokenIn sdk.Coin, routes []route.RouteImpl) (quote domain.Quote, err error) { if r.routerRepository == nil { return nil, ErrNilRouterRepository } @@ -176,7 +176,6 @@ ROUTE_LOOP: uniquePoolIDsIntraRoute := make(map[uint64]struct{}, len(candidateRoute)) for j, currentPool := range candidateRoute { - if _, ok := uniquePoolIDs[currentPool.ID]; !ok { uniquePoolIDs[currentPool.ID] = struct{}{} } diff --git a/ingest/sqs/router/usecase/optimized_routes_test.go b/ingest/sqs/router/usecase/optimized_routes_test.go index 7c2d1dfbe96..245adb93c0e 100644 --- a/ingest/sqs/router/usecase/optimized_routes_test.go +++ b/ingest/sqs/router/usecase/optimized_routes_test.go @@ -567,7 +567,7 @@ func (s *RouterTestSuite) TestGetBestSplitRoutesQuote_Mainnet_USDTUMEE() { routes := s.constructRoutesFromMainnetPools(router, USDT, UMEE, tickMap, takerFeeMap) - quote, err := router.GetOptimalQuote(sdk.NewCoin(USDT, amountIn), UMEE, routes) + quote, err := router.GetOptimalQuote(sdk.NewCoin(USDT, amountIn), routes) // We only validate that error does not occur without actually validating the quote. s.Require().NoError(err) @@ -592,7 +592,7 @@ func (s *RouterTestSuite) TestGetBestSplitRoutesQuote_Mainnet_UOSMOUION() { routes := s.constructRoutesFromMainnetPools(router, UOSMO, UION, tickMap, takerFeeMap) - quote, err := router.GetOptimalQuote(sdk.NewCoin(UOSMO, amountIn), UION, routes) + quote, err := router.GetOptimalQuote(sdk.NewCoin(UOSMO, amountIn), routes) // We only validate that error does not occur without actually validating the quote. s.Require().NoError(err) @@ -623,7 +623,7 @@ func (s *RouterTestSuite) TestGetBestSplitRoutesQuote_Mainnet_USDTATOM() { routes := s.constructRoutesFromMainnetPools(router, USDT, ATOM, tickMap, takerFeeMap) - quote, err := router.GetOptimalQuote(sdk.NewCoin(USDT, amountIn), ATOM, routes) + quote, err := router.GetOptimalQuote(sdk.NewCoin(USDT, amountIn), routes) // We only validate that error does not occur without actually validating the quote. s.Require().NoError(err) @@ -647,7 +647,7 @@ func (s *RouterTestSuite) TestGetBestSplitRoutesQuote_Mainnet_AKTUMEE() { routes := s.constructRoutesFromMainnetPools(router, AKT, UMEE, tickMap, takerFeeMap) - quote, err := router.GetOptimalQuote(sdk.NewCoin(AKT, amountIn), UMEE, routes) + quote, err := router.GetOptimalQuote(sdk.NewCoin(AKT, amountIn), routes) // We only validate that error does not occur without actually validating the quote. s.Require().NoError(err) @@ -661,8 +661,8 @@ func (s *RouterTestSuite) TestGetBestSplitRoutesQuote_Mainnet_AKTUMEE() { // Expecting 2 pools in the route s.Require().Len(route.GetPools(), 2) - // Validate that the pool is pool 3 - s.Require().Equal(uint64(3), route.GetPools()[0].GetId()) + // Validate that the pool is pool 1093 + s.Require().Equal(uint64(1093), route.GetPools()[0].GetId()) // Validate that the pool is pool 1110 s.Require().Equal(uint64(1110), route.GetPools()[1].GetId()) diff --git a/ingest/sqs/router/usecase/pools/routable_concentrated_pool.go b/ingest/sqs/router/usecase/pools/routable_concentrated_pool.go index a67fb12e97e..f2c332a0b98 100644 --- a/ingest/sqs/router/usecase/pools/routable_concentrated_pool.go +++ b/ingest/sqs/router/usecase/pools/routable_concentrated_pool.go @@ -59,7 +59,6 @@ func (r *routableConcentratedPoolImpl) GetTakerFee() math.LegacyDec { // - the current sqrt price is zero // - rans out of ticks during swap (token in is too high for liquidity in the pool) func (r *routableConcentratedPoolImpl) CalculateTokenOutByTokenIn(tokenIn sdk.Coin) (sdk.Coin, error) { - concentratedPool := r.ChainPool tickModel := r.TickModel diff --git a/ingest/sqs/router/usecase/pools/routable_stableswap_pool.go b/ingest/sqs/router/usecase/pools/routable_stableswap_pool.go index 8da249eb4e6..8fee34469dd 100644 --- a/ingest/sqs/router/usecase/pools/routable_stableswap_pool.go +++ b/ingest/sqs/router/usecase/pools/routable_stableswap_pool.go @@ -78,4 +78,4 @@ func (r *routableStableswapPoolImpl) GetPoolDenoms() []string { // GetType implements domain.RoutablePool. func (*routableStableswapPoolImpl) GetType() poolmanagertypes.PoolType { return poolmanagertypes.Balancer -} \ No newline at end of file +} diff --git a/ingest/sqs/router/usecase/route/route.go b/ingest/sqs/router/usecase/route/route.go index bbd0afb1235..99fc12c9a10 100644 --- a/ingest/sqs/router/usecase/route/route.go +++ b/ingest/sqs/router/usecase/route/route.go @@ -31,7 +31,6 @@ type RouteImpl struct { // Returns the resulting pools. func (r *RouteImpl) PrepareResultPools() []domain.RoutablePool { for i, pool := range r.Pools { - r.Pools[i] = pools.NewRoutableResultPool( pool.GetId(), pool.GetType(), diff --git a/ingest/sqs/router/usecase/router_usecase.go b/ingest/sqs/router/usecase/router_usecase.go index 73607ef9a55..036259eaffe 100644 --- a/ingest/sqs/router/usecase/router_usecase.go +++ b/ingest/sqs/router/usecase/router_usecase.go @@ -39,10 +39,7 @@ func NewRouterUsecase(timeout time.Duration, routerRepository mvc.RouterReposito // GetOptimalQuote returns the optimal quote by estimating the optimal route(s) through pools // on the osmosis network. func (r *routerUseCaseImpl) GetOptimalQuote(ctx context.Context, tokenIn sdk.Coin, tokenOutDenom string) (domain.Quote, error) { - router, err := r.initializeRouter(ctx) - if err != nil { - return nil, err - } + router := r.initializeRouter() candidateRoutes, err := r.handleRoutes(ctx, router, tokenIn.Denom, tokenOutDenom) if err != nil { @@ -66,27 +63,12 @@ func (r *routerUseCaseImpl) GetOptimalQuote(ctx context.Context, tokenIn sdk.Coi return nil, err } - concentratedPoolIDs := []uint64{} - for _, route := range routes { - r.logger.Info("route", zap.Any("route", route)) - - // Query tick model - for _, pool := range route.Pools { - if pool.GetType() == poolmanagertypes.Concentrated { - concentratedPoolIDs = append(concentratedPoolIDs, pool.GetId()) - } - } - } - - return router.getOptimalQuote(tokenIn, tokenOutDenom, routes) + return router.getOptimalQuote(tokenIn, routes) } // GetBestSingleRouteQuote returns the best single route quote to be done directly without a split. func (r *routerUseCaseImpl) GetBestSingleRouteQuote(ctx context.Context, tokenIn sdk.Coin, tokenOutDenom string) (domain.Quote, error) { - router, err := r.initializeRouter(ctx) - if err != nil { - return nil, err - } + router := r.initializeRouter() candidateRoutes, err := r.handleRoutes(ctx, router, tokenIn.Denom, tokenOutDenom) if err != nil { @@ -104,15 +86,12 @@ func (r *routerUseCaseImpl) GetBestSingleRouteQuote(ctx context.Context, tokenIn return nil, err } - return router.getBestSingleRouteQuote(tokenIn, tokenOutDenom, routes) + return router.getBestSingleRouteQuote(tokenIn, routes) } // GetCandidateRoutes implements domain.RouterUsecase. func (r *routerUseCaseImpl) GetCandidateRoutes(ctx context.Context, tokenInDenom string, tokenOutDenom string) (route.CandidateRoutes, error) { - router, err := r.initializeRouter(ctx) - if err != nil { - return route.CandidateRoutes{}, err - } + router := r.initializeRouter() routes, err := r.handleRoutes(ctx, router, tokenInDenom, tokenOutDenom) if err != nil { @@ -127,8 +106,7 @@ func (r *routerUseCaseImpl) GetCandidateRoutes(ctx context.Context, tokenInDenom // - there is an error retrieving pools from the store // - there is an error retrieving taker fees from the store // TODO: test -func (r *routerUseCaseImpl) initializeRouter(ctx context.Context) (*Router, error) { - +func (r *routerUseCaseImpl) initializeRouter() *Router { router := NewRouter([]uint64{}, r.config.MaxPoolsPerRoute, r.config.MaxRoutes, r.config.MaxSplitRoutes, r.config.MaxSplitIterations, r.config.MinOSMOLiquidity, r.logger) router = WithRouterRepository(router, r.routerRepository) router = WithPoolsUsecase(router, r.poolsUsecase) @@ -138,7 +116,7 @@ func (r *routerUseCaseImpl) initializeRouter(ctx context.Context) (*Router, erro r.logger.Debug("sorted pool", zap.Uint64("pool_id", pool.GetId()), zap.Stringer("tvl", pool.GetTotalValueLockedUOSMO())) } - return router, nil + return router } // handleRoutes attempts to retrieve routes from the cache. If no routes are cached, it will @@ -183,7 +161,6 @@ func (r *routerUseCaseImpl) handleRoutes(ctx context.Context, router *Router, to // Persist routes if len(candidateRoutes.Routes) > 0 && r.config.RouteCacheEnabled { - r.logger.Info("persisting routes", zap.Int("num_routes", len(candidateRoutes.Routes))) if err := r.routerRepository.SetRoutes(ctx, tokenInDenom, tokenOutDenom, candidateRoutes); err != nil { diff --git a/ingest/sqs/router/usecase/routertesting/parsing/mainnet_pools.go b/ingest/sqs/router/usecase/routertesting/parsing/mainnet_pools.go index d859808d0b8..6834daee335 100644 --- a/ingest/sqs/router/usecase/routertesting/parsing/mainnet_pools.go +++ b/ingest/sqs/router/usecase/routertesting/parsing/mainnet_pools.go @@ -37,7 +37,7 @@ func StorePools(actualPools []domain.PoolI, tickModelMap map[uint64]domain.TickM if pool.GetType() == poolmanagertypes.Concentrated { tickModel, ok := tickModelMap[pool.GetId()] if !ok { - return fmt.Errorf("no tick model in map %s", domain.ConcentratedTickModelNotSet{ + return fmt.Errorf("no tick model in map %s", domain.ConcentratedTickModelNotSetError{ PoolId: pool.GetId(), }) } @@ -63,7 +63,6 @@ func StorePools(actualPools []domain.PoolI, tickModelMap map[uint64]domain.TickM if err != nil { return err } - } else if err != nil { return err } @@ -113,7 +112,6 @@ func ReadPools(poolsFile string) ([]domain.PoolI, map[uint64]domain.TickModel, e tickMap := make(map[uint64]domain.TickModel) for _, pool := range serializedPools { - poolWrapper, err := UnmarshalPool(pool) if err != nil { return nil, nil, err @@ -181,7 +179,6 @@ func MarshalPool(pool domain.PoolI) (json.RawMessage, error) { // UnmarshalPool unmarshals a pool from JSON. func UnmarshalPool(serializedPool SerializedPool) (domain.PoolI, error) { - var ( chainModel poolmanagertypes.PoolI ) diff --git a/ingest/sqs/router/usecase/routertesting/parsing/mainnet_pools_test.go b/ingest/sqs/router/usecase/routertesting/parsing/mainnet_pools_test.go index 4b4052b25c6..f33adb4b4c0 100644 --- a/ingest/sqs/router/usecase/routertesting/parsing/mainnet_pools_test.go +++ b/ingest/sqs/router/usecase/routertesting/parsing/mainnet_pools_test.go @@ -112,14 +112,6 @@ func TestMarshalUnmarshalPool(t *testing.T) { require.Equal(t, testPoolToMarshal.GetUnderlyingPool(), unmarshalledPool.GetUnderlyingPool()) require.Equal(t, testPoolToMarshal.GetSQSPoolModel(), unmarshalledPool.GetSQSPoolModel()) - - poolToMarshalTickModel, err := testPoolToMarshal.GetTickModel() - require.NoError(t, err) - - unmarshalledPoolTickModel, err := unmarshalledPool.GetTickModel() - require.NoError(t, err) - - require.Equal(t, poolToMarshalTickModel, unmarshalledPoolTickModel) } // This test validates that unmarshalling and marshalling a taker fee map works as expected. diff --git a/ingest/sqs/router/usecase/routertesting/suite.go b/ingest/sqs/router/usecase/routertesting/suite.go index 1837d91a08d..3840d15f09a 100644 --- a/ingest/sqs/router/usecase/routertesting/suite.go +++ b/ingest/sqs/router/usecase/routertesting/suite.go @@ -82,9 +82,9 @@ func WithRoutePools(r route.RouteImpl, pools []domain.RoutablePool) route.RouteI newRoute := route.RouteImpl{ Pools: make([]domain.RoutablePool, 0, len(pools)), } - for _, pool := range pools { - newRoute.Pools = append(newRoute.Pools, pool) - } + + newRoute.Pools = append(newRoute.Pools, pools...) + return newRoute } @@ -93,9 +93,8 @@ func WithCandidateRoutePools(r route.CandidateRoute, pools []route.CandidatePool newRoute := route.CandidateRoute{ Pools: make([]route.CandidatePool, 0, len(pools)), } - for _, pool := range pools { - newRoute.Pools = append(newRoute.Pools, pool) - } + + newRoute.Pools = append(newRoute.Pools, pools...) return newRoute } diff --git a/proto/osmosis/poolmanager/v1beta1/query.proto b/proto/osmosis/poolmanager/v1beta1/query.proto index 39c49eccb09..012147d9cfd 100644 --- a/proto/osmosis/poolmanager/v1beta1/query.proto +++ b/proto/osmosis/poolmanager/v1beta1/query.proto @@ -123,7 +123,7 @@ service Query { rpc TradingPairTakerFee(TradingPairTakerFeeRequest) returns (TradingPairTakerFeeResponse) { option (google.api.http).get = - "/osmosis/poolmanager/v1beta1/pools/trading_pair_takerfee"; + "/osmosis/poolmanager/v1beta1/trading_pair_takerfee"; } // EstimateTradeBasedOnPriceImpact returns an estimated trade based on price diff --git a/x/poolmanager/client/queryproto/query.pb.go b/x/poolmanager/client/queryproto/query.pb.go index b1854156588..35f372ad529 100644 --- a/x/poolmanager/client/queryproto/query.pb.go +++ b/x/poolmanager/client/queryproto/query.pb.go @@ -1470,129 +1470,129 @@ func init() { } var fileDescriptor_6256a4106f701b7d = []byte{ - // 1950 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x59, 0xcb, 0x73, 0x1b, 0x49, - 0x19, 0xcf, 0xc8, 0x8a, 0xd7, 0xfa, 0x1c, 0x3f, 0xd2, 0x89, 0x13, 0x5b, 0x09, 0x96, 0xb7, 0xb3, - 0x64, 0xbd, 0x71, 0x3c, 0x8a, 0xed, 0x2c, 0x09, 0x81, 0x7d, 0x58, 0xb6, 0xb3, 0x11, 0x2c, 0xc4, - 0x4c, 0xbc, 0x0f, 0x16, 0xc2, 0xd4, 0xd8, 0xea, 0x28, 0x43, 0x34, 0xd3, 0x8a, 0xa6, 0xc7, 0xb1, - 0x8b, 0xda, 0x0b, 0x55, 0x14, 0x9c, 0xa8, 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, 0xb3, 0x59, - 0xed, 0x93, 0xe7, 0xb3, 0x27, 0x0e, 0x9e, 0xcf, 0x9e, 0xf8, 0xdb, 0xf3, 0xd9, 0x13, 0x1f, 0xad, - 0xb5, 0x08, 0x4b, 0x15, 0x7a, 0xb1, 0x62, 0x6d, 0x7b, 0x61, 0x9e, 0xdd, 0xe5, 0x6b, 0xf9, 0xbd, - 0xb6, 0x6c, 0x3b, 0x15, 0x9b, 0xb8, 0x4c, 0xfe, 0x4b, 0x55, 0xfe, 0xa4, 0x38, 0x2c, 0xfe, 0xac, - 0xfc, 0x2f, 0x00, 0x00, 0xff, 0xff, 0xae, 0xdc, 0x0c, 0xcf, 0x6e, 0x1e, 0x00, 0x00, + // 1945 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x59, 0x4d, 0x73, 0x1b, 0x49, + 0x19, 0xce, 0xc8, 0x8a, 0xd7, 0x7a, 0x1d, 0x7f, 0xa4, 0x13, 0x27, 0xb6, 0x12, 0x2c, 0x6f, 0x67, + 0xc9, 0x7a, 0xe3, 0x78, 0x14, 0xdb, 0x59, 0xb2, 0x04, 0x76, 0x17, 0xcb, 0x76, 0x36, 0x82, 0x85, + 0x98, 0x89, 0xf7, 0x83, 0x85, 0x30, 0x35, 0x96, 0x3a, 0xca, 0x10, 0xcd, 0xb4, 0xa2, 0xe9, 0x71, + 0xec, 0xa2, 0xf6, 0x42, 0x15, 0x05, 0x27, 0x6a, 0x81, 0xc3, 0x1e, 0x38, 0x50, 0x1c, 0xb8, 0xec, + 0x5e, 0xe1, 0x1f, 0x70, 0x48, 0x51, 0x05, 0x15, 0x0a, 0x0e, 0x14, 0x07, 0x41, 0x25, 0x1c, 0xa8, + 0x62, 0x2f, 0xe8, 0x17, 0x50, 0xfd, 0x31, 0x23, 0x69, 0x2c, 0x8d, 0x46, 0xb2, 0x0f, 0x7b, 0xb2, + 0xd4, 0xfd, 0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x64, 0xe7, 0xa0, 0x46, 0xbc, 0x2e, 0x04, 0x68, 0x03, 0x11, 0x90, 0x4a, 0x40, 0xc0, 0x9b, 0x30, + 0x29, 0x6b, 0x35, 0x83, 0x1c, 0x23, 0x0b, 0x23, 0x8b, 0xe9, 0xc2, 0x5c, 0xb3, 0x91, 0x9b, 0x69, + 0x07, 0x65, 0x86, 0xa9, 0x4e, 0xc9, 0x85, 0x6d, 0x99, 0xf0, 0x5d, 0x38, 0xa7, 0x0c, 0x64, 0x74, + 0xea, 0x33, 0xb3, 0x4c, 0x5c, 0xea, 0x08, 0x46, 0x33, 0x85, 0x17, 0x9b, 0x8d, 0xdc, 0x17, 0x3a, + 0x02, 0x45, 0xec, 0xb0, 0x71, 0x46, 0x6e, 0xec, 0xf0, 0xf5, 0x3b, 0x3e, 0xdb, 0x14, 0xab, 0x7f, + 0xd2, 0xe0, 0x4a, 0x48, 0x96, 0xed, 0x56, 0xaa, 0x84, 0x27, 0x4c, 0xd2, 0x25, 0xc7, 0x4f, 0x52, + 0x01, 0xa6, 0xa2, 0xe0, 0x64, 0x73, 0x65, 0x9b, 0x8d, 0xdc, 0xb9, 0x76, 0xb7, 0x36, 0x54, 0x13, + 0xac, 0x03, 0xcf, 0x4f, 0x34, 0x78, 0x31, 0xa6, 0xd7, 0xd5, 0x50, 0xed, 0xc2, 0x74, 0x2b, 0x90, + 0x25, 0x76, 0x05, 0x9e, 0x4c, 0xe1, 0x35, 0xde, 0x69, 0xff, 0x68, 0xe4, 0x66, 0xe4, 0x20, 0x7b, + 0xe5, 0x87, 0xba, 0x4d, 0xf3, 0x8e, 0xc5, 0x1e, 0xe8, 0x45, 0x97, 0x35, 0x1b, 0xb9, 0xf3, 0xd1, + 0x3a, 0xa4, 0x3b, 0x36, 0x26, 0x83, 0x42, 0x64, 0x36, 0xfc, 0xbf, 0xde, 0x95, 0xdc, 0xf1, 0xd9, + 0x50, 0x63, 0xf7, 0xfd, 0x70, 0x8c, 0x46, 0xc4, 0x18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0x2c, 0xdd, 0xe7, 0x68, 0x1e, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/poolmanager/client/queryproto/query.pb.gw.go b/x/poolmanager/client/queryproto/query.pb.gw.go index a22f9280715..b7de6e3e3c6 100644 --- a/x/poolmanager/client/queryproto/query.pb.gw.go +++ b/x/poolmanager/client/queryproto/query.pb.gw.go @@ -1646,7 +1646,7 @@ var ( pattern_Query_TotalVolumeForPool_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5}, []string{"osmosis", "poolmanager", "v1beta1", "pools", "pool_id", "total_volume"}, "", runtime.AssumeColonVerbOpt(false))) - pattern_Query_TradingPairTakerFee_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"osmosis", "poolmanager", "v1beta1", "pools", "trading_pair_takerfee"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_TradingPairTakerFee_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"osmosis", "poolmanager", "v1beta1", "trading_pair_takerfee"}, "", runtime.AssumeColonVerbOpt(false))) pattern_Query_EstimateTradeBasedOnPriceImpact_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4}, []string{"osmosis", "poolmanager", "v1beta1", "pool_id", "estimate_trade"}, "", runtime.AssumeColonVerbOpt(false))) ) diff --git a/x/txfees/keeper/mempool-1559/code.go b/x/txfees/keeper/mempool-1559/code.go index a8e9399b785..d6b439362c1 100644 --- a/x/txfees/keeper/mempool-1559/code.go +++ b/x/txfees/keeper/mempool-1559/code.go @@ -22,13 +22,13 @@ import ( Additionally: - Periodically evaluating CheckTx and RecheckTx for compliance with these parameters. - Note: The reset interval is set to 1000 blocks, which is approximately 2 hours. Consider adjusting for a smaller time interval (e.g., 500 blocks = 1 hour) if necessary. + Note: The reset interval is set to 2000 blocks, which is approximately 4 hours. Consider adjusting for a smaller time interval (e.g., 500 blocks = 1 hour) if necessary. Challenges: - Transactions falling under their gas bounds are currently discarded by nodes. This behavior can be modified for CheckTx, rather than RecheckTx. Global variables stored in memory: - - DefaultBaseFee: Default base fee, initialized to 0.0025. + - DefaultBaseFee: Default base fee, initialized to 0.01. - MinBaseFee: Minimum base fee, initialized to 0.0025. - MaxBaseFee: Maximum base fee, initialized to 10. - MaxBlockChangeRate: The maximum block change rate, initialized to 1/10. @@ -41,7 +41,7 @@ import ( */ var ( - DefaultBaseFee = sdk.MustNewDecFromStr("0.0025") + DefaultBaseFee = sdk.MustNewDecFromStr("0.01") MinBaseFee = sdk.MustNewDecFromStr("0.0025") MaxBaseFee = sdk.MustNewDecFromStr("10") @@ -49,10 +49,10 @@ var ( MaxBlockChangeRate = sdk.NewDec(1).Quo(sdk.NewDec(10)) TargetGas = int64(70_000_000) // In face of continuous spam, will take ~21 blocks from base fee > spam cost, to mempool eviction - // ceil(log_{15/14}(RecheckFeeConstant)) + // ceil(log_{15/14}(RecheckFee mnConstant)) // So potentially 2 minutes of impaired UX from 1559 nodes on top of time to get to base fee > spam. RecheckFeeConstant = int64(4) - ResetInterval = int64(1000) + ResetInterval = int64(2000) ) const ( diff --git a/x/txfees/keeper/txfee_filters/arb_tx.go b/x/txfees/keeper/txfee_filters/arb_tx.go index 014258772fc..6c599c7ea61 100644 --- a/x/txfees/keeper/txfee_filters/arb_tx.go +++ b/x/txfees/keeper/txfee_filters/arb_tx.go @@ -44,6 +44,9 @@ func (m AffiliateSwapMsg) TokenInDenom() string { // TokenOutDenom implements types.SwapMsgRoute. func (m AffiliateSwapMsg) TokenOutDenom() string { + if len(m.Routes) == 0 { + return "no-token-out" + } lastPoolInRoute := m.Routes[len(m.Routes)-1] return lastPoolInRoute.TokenOutDenom } @@ -103,6 +106,12 @@ func isArbTxLooseAuthz(msg sdk.Msg, swapInDenom string, lpTypesSeen map[gammtype // Get the contract message and attempt to unmarshal it into the affiliate swap message contractMessage := msgExecuteContract.GetMsg() + + // Check that the contract message is an affiliate swap message + if ok := isAffiliateSwapMsg(contractMessage); !ok { + return swapInDenom, false + } + var affiliateSwapMsg AffiliateSwapMsg if err := json.Unmarshal(contractMessage, &affiliateSwapMsg); err != nil { // If we can't unmarshal it, it's not an affiliate swap message @@ -161,3 +170,29 @@ func isArbTxLooseSwapMsg(swapMsg poolmanagertypes.SwapMsgRoute, swapInDenom stri swapInDenom = swapMsg.TokenInDenom() return swapInDenom, false } + +// TODO: Make this generic by using isJsonSuperset from https://github.com/osmosis-labs/osmosis/blob/d56de7365428f0282eeab05c1cc75787370ef997/x/authenticator/authenticator/message_filter.go#L173C6-L173C12 +func isAffiliateSwapMsg(msg []byte) bool { + // Check that the contract message is a valid JSON object + jsonObject := make(map[string]interface{}) + err := json.Unmarshal(msg, &jsonObject) + if err != nil { + return false + } + + // check the main key is "swap" + swap, ok := jsonObject["swap"].(map[string]interface{}) + if !ok { + return false + } + + if routes, ok := swap["routes"].([]interface{}); !ok || len(routes) == 0 { + return false + } + + if tokenOutMinAmount, ok := swap["token_out_min_amount"].(map[string]interface{}); !ok || len(tokenOutMinAmount) == 0 { + return false + } + + return true +} diff --git a/x/txfees/keeper/txfee_filters/arb_tx_test.go b/x/txfees/keeper/txfee_filters/arb_tx_test.go index 3494d32704b..d1b6e2efa26 100644 --- a/x/txfees/keeper/txfee_filters/arb_tx_test.go +++ b/x/txfees/keeper/txfee_filters/arb_tx_test.go @@ -64,3 +64,18 @@ func (suite *KeeperTestSuite) TestIsArbTxLooseAuthz_AffiliateSwapMsg() { _, isArb := txfee_filters.IsArbTxLooseAuthz(executeMsg, executeMsg.Funds[0].Denom, map[types.LiquidityChangeType]bool{}) suite.Require().True(isArb) } + +func (suite *KeeperTestSuite) TestIsArbTxLooseAuthz_OtherMsg() { + otherMsg := []byte(`{"update_feed": {}}`) + + // https://celatone.osmosis.zone/osmosis-1/txs/315EB6284778EBB5BAC0F94CC740F5D7E35DDA5BBE4EC9EC79F012548589C6E5 + executeMsg := &wasmtypes.MsgExecuteContract{ + Contract: "osmo1etpha3a65tds0hmn3wfjeag6wgxgrkuwg2zh94cf5hapz7mz04dq6c25s5", + Sender: "osmo1dldrxz5p8uezxz3qstpv92de7wgfp7hvr72dcm", + Funds: sdk.NewCoins(sdk.NewCoin("ibc/498A0751C798A0D9A389AA3691123DADA57DAA4FE165D5C75894505B876BA6E4", sdk.NewInt(217084399))), + Msg: otherMsg, + } + + _, isArb := txfee_filters.IsArbTxLooseAuthz(executeMsg, executeMsg.Funds[0].Denom, map[types.LiquidityChangeType]bool{}) + suite.Require().False(isArb) +}