Skip to content

Commit

Permalink
fix: add indirect incentivized pools to incentivized pools query (#5589)
Browse files Browse the repository at this point in the history
* add indirect incentivized pools to inc pool query

* add changelog entry

* type conversion

* fix behavior

* fix behavior

* use map to prevent unnecessary second iteration

* nil pointer error

* implement shared proto file

* use longest duration as holder value

* use longest lockable duration

* add duration into incentivizedPoolIDs map
  • Loading branch information
czarcas7ic authored Jun 22, 2023
1 parent 23ca8f7 commit 53ca015
Show file tree
Hide file tree
Showing 15 changed files with 1,389 additions and 525 deletions.
16 changes: 8 additions & 8 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Types of changes (Stanzas):
"Bug Fixes" for any bug fixes.
"Client Breaking" for breaking CLI commands and REST routes used by end-users.
"API Breaking" for breaking exported APIs used by developers building on SDK.
"State Machine Breaking" for any changes that result in a different AppState
"State Machine Breaking" for any changes that result in a different AppState
given same genesisState and txList.
Ref: https://keepachangelog.com/en/1.0.0/
-->
Expand Down Expand Up @@ -65,8 +65,8 @@ ProtoRev Changes (x/protorev):
- Modifies the payment schedule for the dev account from weekly to after every trade.
- Triggers backruns, joinPool, and exitPool using hooks.

TokenFactory before send hooks (x/tokenfactory):
- This enhancement allows for executing custom logic before sending tokens, providing more flexibility
TokenFactory before send hooks (x/tokenfactory):
- This enhancement allows for executing custom logic before sending tokens, providing more flexibility
and control over token transfers.


Expand Down Expand Up @@ -104,7 +104,7 @@ and control over token transfers.
## State Breaking
* [#5380](https://github.com/osmosis-labs/osmosis/pull/5380) feat: add ica authorized messages in upgrade handler
* [#5363](https://github.com/osmosis-labs/osmosis/pull/5363) fix: twap record upgrade handler
* [#5265](https://github.com/osmosis-labs/osmosis/pull/5265) fix: expect single synthetic lock per native lock ID
* [#5265](https://github.com/osmosis-labs/osmosis/pull/5265) fix: expect single synthetic lock per native lock ID
* [#4983](https://github.com/osmosis-labs/osmosis/pull/4983) implement gas consume on denom creation
* [#4830](https://github.com/osmosis-labs/osmosis/pull/4830) Scale gas costs by denoms in gauge (AddToGaugeReward)
* [#5511](https://github.com/osmosis-labs/osmosis/pull/5511) Scale gas costs by denoms in gauge (CreateGauge)
Expand All @@ -115,12 +115,11 @@ and control over token transfers.
* [#5468](https://github.com/osmosis-labs/osmosis/pull/5468) fix: Reduce tokenfactory denom creation gas fee to 1_000_000

## Dependencies
* [#4783](https://github.com/osmosis-labs/osmosis/pull/4783) Update wasmd to 0.31
* [#5404](https://github.com/osmosis-labs/osmosis/pull/5404) Cosmwasm Cherry security patch
* [#4783](https://github.com/osmosis-labs/osmosis/pull/4783) Update wasmd to 0.31
* [#5404](https://github.com/osmosis-labs/osmosis/pull/5404) Cosmwasm Cherry security patch
* [#5320](https://github.com/osmosis-labs/osmosis/pull/5320) minor: huckleberry ibc patch

### Misc Improvements

* [#5356](https://github.com/osmosis-labs/osmosis/pull/5356) Fix wrong restHandler for ReplaceMigrationRecordsProposal
* [#5020](https://github.com/osmosis-labs/osmosis/pull/5020) Add gas config to the client.toml
* [#5105](https://github.com/osmosis-labs/osmosis/pull/5105) Lint stableswap in the same manner as all of Osmosis
Expand All @@ -140,11 +139,12 @@ and control over token transfers.
* [#5239](https://github.com/osmosis-labs/osmosis/pull/5239) Implement `GetTotalPoolShares` public keeper function for GAMM.
* [#5261](https://github.com/osmosis-labs/osmosis/pull/5261) Allows `UpdateFeeTokenProposal` to take in multiple fee tokens instead of just one.
* [#5265](https://github.com/osmosis-labs/osmosis/pull/5265) Ensure a lock cannot point to multiple synthetic locks. Deprecates `SyntheticLockupsByLockupID` in favor of `SyntheticLockupByLockupID`.
* [#4950] (https://github.com/osmosis-labs/osmosis/pull/4950) Add in/out tokens to Concentrated Liquidity's AfterConcentratedPoolSwap hook
* [#4950](https://github.com/osmosis-labs/osmosis/pull/4950) Add in/out tokens to Concentrated Liquidity's AfterConcentratedPoolSwap hook
* [#4629](https://github.com/osmosis-labs/osmosis/pull/4629) Add amino proto annotations
* [#4830](https://github.com/osmosis-labs/osmosis/pull/4830) Add gas cost when we AddToGaugeRewards, linearly increase with coins to add
* [#5000](https://github.com/osmosis-labs/osmosis/pull/5000) osmomath.Power panics for base < 1 to temporarily restrict broken logic for such base.
* [#4336](https://github.com/osmosis-labs/osmosis/pull/4336) Move epochs module into its own go.mod
* [#5589](https://github.com/osmosis-labs/osmosis/pull/5589) Include linked balancer pool in incentivized pools query



Expand Down
1 change: 1 addition & 0 deletions app/keepers/keepers.go
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,7 @@ func (appKeepers *AppKeepers) InitNormalKeepers(
appKeepers.DistrKeeper,
appKeepers.PoolManagerKeeper,
appKeepers.EpochsKeeper,
appKeepers.SuperfluidKeeper,
)
appKeepers.PoolIncentivesKeeper = &poolIncentivesKeeper
appKeepers.PoolManagerKeeper.SetPoolIncentivesKeeper(appKeepers.PoolIncentivesKeeper)
Expand Down
20 changes: 1 addition & 19 deletions proto/osmosis/gamm/v1beta1/genesis.proto
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import "gogoproto/gogo.proto";
import "google/protobuf/any.proto";
import "cosmos_proto/cosmos.proto";
import "cosmos/base/v1beta1/coin.proto";
import "osmosis/gamm/v1beta1/shared.proto";

// Params holds parameters for the incentives module
message Params {
Expand All @@ -26,22 +27,3 @@ message GenesisState {
Params params = 3 [ (gogoproto.nullable) = false ];
MigrationRecords migration_records = 4;
}

// MigrationRecords contains all the links between balancer and concentrated
// pools
message MigrationRecords {
repeated BalancerToConcentratedPoolLink balancer_to_concentrated_pool_links =
1 [ (gogoproto.nullable) = false ];
}

// BalancerToConcentratedPoolLink defines a single link between a single
// balancer pool and a single concentrated liquidity pool. This link is used to
// allow a balancer pool to migrate to a single canonical full range
// concentrated liquidity pool position
// A balancer pool can be linked to a maximum of one cl pool, and a cl pool can
// be linked to a maximum of one balancer pool.
message BalancerToConcentratedPoolLink {
option (gogoproto.equal) = true;
uint64 balancer_pool_id = 1;
uint64 cl_pool_id = 2;
}
1 change: 1 addition & 0 deletions proto/osmosis/gamm/v1beta1/gov.proto
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package osmosis.gamm.v1beta1;

import "gogoproto/gogo.proto";
import "osmosis/gamm/v1beta1/genesis.proto";
import "osmosis/gamm/v1beta1/shared.proto";
import "cosmos_proto/cosmos.proto";
import "amino/amino.proto";

Expand Down
28 changes: 28 additions & 0 deletions proto/osmosis/gamm/v1beta1/shared.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
syntax = "proto3";
package osmosis.gamm.v1beta1;

import "gogoproto/gogo.proto";
import "google/protobuf/any.proto";
import "cosmos_proto/cosmos.proto";
import "cosmos/base/v1beta1/coin.proto";

option go_package = "github.com/osmosis-labs/osmosis/v16/x/gamm/types";

// MigrationRecords contains all the links between balancer and concentrated
// pools
message MigrationRecords {
repeated BalancerToConcentratedPoolLink balancer_to_concentrated_pool_links =
1 [ (gogoproto.nullable) = false ];
}

// BalancerToConcentratedPoolLink defines a single link between a single
// balancer pool and a single concentrated liquidity pool. This link is used to
// allow a balancer pool to migrate to a single canonical full range
// concentrated liquidity pool position
// A balancer pool can be linked to a maximum of one cl pool, and a cl pool can
// be linked to a maximum of one balancer pool.
message BalancerToConcentratedPoolLink {
option (gogoproto.equal) = true;
uint64 balancer_pool_id = 1;
uint64 cl_pool_id = 2;
}
33 changes: 33 additions & 0 deletions proto/osmosis/pool-incentives/v1beta1/shared.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
syntax = "proto3";
package osmosis.poolincentives.v1beta1;

import "gogoproto/gogo.proto";
import "google/protobuf/duration.proto";
import "osmosis/pool-incentives/v1beta1/incentives.proto";

option go_package = "github.com/osmosis-labs/osmosis/v16/x/pool-incentives/types";

// MigrationRecords contains all the links between balancer and concentrated
// pools.
//
// This is copied over from the gamm proto file in order to circumnavigate
// the circular dependency between the two modules.
message MigrationRecords {
repeated BalancerToConcentratedPoolLink balancer_to_concentrated_pool_links =
1 [ (gogoproto.nullable) = false ];
}

// BalancerToConcentratedPoolLink defines a single link between a single
// balancer pool and a single concentrated liquidity pool. This link is used to
// allow a balancer pool to migrate to a single canonical full range
// concentrated liquidity pool position
// A balancer pool can be linked to a maximum of one cl pool, and a cl pool can
// be linked to a maximum of one balancer pool.
//
// This is copied over from the gamm proto file in order to circumnavigate
// the circular dependency between the two modules.
message BalancerToConcentratedPoolLink {
option (gogoproto.equal) = true;
uint64 balancer_pool_id = 1;
uint64 cl_pool_id = 2;
}
Loading

0 comments on commit 53ca015

Please sign in to comment.