Skip to content

Commit

Permalink
feat: NoLock gauge type and external gauge creation wiring to CL (#5459)
Browse files Browse the repository at this point in the history
* feat/docs: CL external incentives tool

* updates

* updates

* updates

* updates

* updates

* updates

* updates

* updates

* updates

* updates

* updates

* updates

* updates

* Apply suggestions from code review

* updates

* updates

* more assertions in TestCreateGauge_NoLockGauges

* add comments to CreateGauge

* update comments for Distribute

* updates

* revert

* changelog

* add incentives module docs

* fix test names

* CL module README

* updates

* typo

* fix test

* test updates

* Update x/incentives/README.md

Co-authored-by: Sishir Giri <[email protected]>

* Update x/incentives/keeper/gauge_test.go

* Update x/incentives/keeper/gauge.go

* refactor/fix: external vs internal pool id and gauge id links for "NoLock" gauge (#5475)

* refactor/fix: external vs internal pool id and gauge id links for "NoLock" gauge

* fix test

* Update x/incentives/keeper/gauge.go

* Update x/pool-incentives/keeper/keeper.go

* Update x/pool-incentives/keeper/keeper.go

* Update x/pool-incentives/keeper/keeper.go

Co-authored-by: Adam Tucker <[email protected]>

* Update x/pool-incentives/keeper/keeper_test.go

Co-authored-by: Adam Tucker <[email protected]>

* comment updates and renames

---------

Co-authored-by: Adam Tucker <[email protected]>

* superfluid comment

* disallow no lock gauge with duration set

* test gauge distribution state update

* error message improvement

* remove obsolete field

* clarify test name

* updates

* doc improvements

* clean up TestDistribute_InternalIncentives_NoLock

* clarifying comment

* updates

* Update x/incentives/keeper/distribute_test.go

Co-authored-by: Adam Tucker <[email protected]>

* error message

* zero duration check and test

* clean up

* lint

---------

Co-authored-by: Sishir Giri <[email protected]>
Co-authored-by: Adam Tucker <[email protected]>
  • Loading branch information
3 people authored Jun 10, 2023
1 parent b030ab1 commit 2fd0415
Show file tree
Hide file tree
Showing 37 changed files with 1,281 additions and 569 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ and control over token transfers.
* [#4682](https://github.com/osmosis-labs/osmosis/pull/4682) feat(CL): x/poolmanager spot price query for concentrated liquidity
* [#5138](https://github.com/osmosis-labs/osmosis/pull/5138) refactor: rename swap fee to spread factor
* [#5020](https://github.com/osmosis-labs/osmosis/pull/5020) Add gas config to the client.toml
* [#5459](https://github.com/osmosis-labs/osmosis/pull/5459) Create locktypes.LockQueryType.NoLock gauge. MsgCreateGauge takes pool id for new gauge type.

## State Breaking
* [#5380](https://github.com/osmosis-labs/osmosis/pull/5380) feat: add ica authorized messages in upgrade handler
Expand Down
9 changes: 9 additions & 0 deletions proto/osmosis/incentives/tx.proto
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,15 @@ message MsgCreateGauge {
// num_epochs_paid_over is the number of epochs distribution will be completed
// over
uint64 num_epochs_paid_over = 6;

// pool_id is the ID of the pool that the gauge is meant to be associated
// with. if pool_id is set, then the "QueryCondition.LockQueryType" must be
// "NoLock" with all other fields of the "QueryCondition.LockQueryType" struct
// unset, including "QueryCondition.Denom". However, note that, internally,
// the empty string in "QueryCondition.Denom" ends up being overwritten with
// incentivestypes.NoLockExternalGaugeDenom(<pool-id>) so that the gauges
// associated with a pool can be queried by this prefix if needed.
uint64 pool_id = 7;
}
message MsgCreateGaugeResponse {}

Expand Down
1 change: 1 addition & 0 deletions proto/osmosis/lockup/lock.proto
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ enum LockQueryType {

ByDuration = 0;
ByTime = 1;
NoLock = 2;
}

// QueryCondition is a struct used for querying locks upon different conditions.
Expand Down
5 changes: 2 additions & 3 deletions tests/cl-genesis-positions/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ require (
github.com/ignite/cli v0.23.0
github.com/osmosis-labs/osmosis/osmomath v0.0.3-dev.0.20230516205127-c213fddde069
github.com/osmosis-labs/osmosis/osmoutils v0.0.0-20230529060317-d6d2dda0fb22
// this commit points to https://github.com/osmosis-labs/osmosis/commit/b764323ce7702185d2089b9e76a0115c7058f37e
github.com/osmosis-labs/osmosis/v15 v15.0.0-20230601221251-b764323ce770
github.com/tendermint/tendermint v0.34.26
)

require github.com/osmosis-labs/osmosis/v16 v16.0.0-20230603032959-4d2ba21b8d1e

require (
cosmossdk.io/errors v1.0.0-beta.7 // indirect
filippo.io/edwards25519 v1.0.0-rc.1 // indirect
Expand Down Expand Up @@ -97,7 +97,6 @@ require (
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/mtibben/percent v0.2.1 // indirect
github.com/opencontainers/go-digest v1.0.0 // indirect
github.com/osmosis-labs/osmosis/v16 v16.0.0-20230603032959-4d2ba21b8d1e // indirect
github.com/osmosis-labs/osmosis/x/epochs v0.0.0-20230328024000-175ec88e4304 // indirect
github.com/osmosis-labs/osmosis/x/ibc-hooks v0.0.0-20230331072320-5d6f6cfa2627 // indirect
github.com/pelletier/go-toml/v2 v2.0.6 // indirect
Expand Down
4 changes: 0 additions & 4 deletions tests/cl-genesis-positions/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -699,10 +699,6 @@ github.com/osmosis-labs/osmosis/osmomath v0.0.3-dev.0.20230516205127-c213fddde06
github.com/osmosis-labs/osmosis/osmomath v0.0.3-dev.0.20230516205127-c213fddde069/go.mod h1:a7lhiXRpn8QJ21OhFpaEnUNErTSIafaYpp02q6uI/Dk=
github.com/osmosis-labs/osmosis/osmoutils v0.0.0-20230529060317-d6d2dda0fb22 h1:I14d+U4gDSL5dHoQ3G+kGLhZP5Zj3mOxMb/97Xflusc=
github.com/osmosis-labs/osmosis/osmoutils v0.0.0-20230529060317-d6d2dda0fb22/go.mod h1:GIvgXqD8NOtrpu5bJ052tZxWLFj4ekpi1BMwEHIvXVU=
github.com/osmosis-labs/osmosis/v15 v15.0.0-20230601221251-b764323ce770 h1:to+kNe/UeQwFpYHMqOkdY7TGIjt5mp+QxIniNRDzDUc=
github.com/osmosis-labs/osmosis/v15 v15.0.0-20230601221251-b764323ce770/go.mod h1:ww2QtVh+XW91yTpbyfM4mJBmIRk4AU0PigLL94zr0+8=
github.com/osmosis-labs/osmosis/v16 v16.0.0-20230602200356-bdf5b96b3674 h1:sCXD8SajkGC3AmHrwiklgTWHZUXcSHm8YFJKbvw6Lk4=
github.com/osmosis-labs/osmosis/v16 v16.0.0-20230602200356-bdf5b96b3674/go.mod h1:Vg+05vXFc682OEF52HTqhEKF+deQ0GSt9rkisCFJ8Ug=
github.com/osmosis-labs/osmosis/v16 v16.0.0-20230603032959-4d2ba21b8d1e h1:Rbkpe0cLh67eyWpCMN8u/6xDNHlWimrLceMEhtNJ0TI=
github.com/osmosis-labs/osmosis/v16 v16.0.0-20230603032959-4d2ba21b8d1e/go.mod h1:Vg+05vXFc682OEF52HTqhEKF+deQ0GSt9rkisCFJ8Ug=
github.com/osmosis-labs/osmosis/x/epochs v0.0.0-20230328024000-175ec88e4304 h1:RIrWLzIiZN5Xd2JOfSOtGZaf6V3qEQYg6EaDTAkMnCo=
Expand Down
10 changes: 6 additions & 4 deletions tests/cl-go-client/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ module cl-positions
go 1.20

require (
github.com/cosmos/cosmos-sdk v0.47.2
github.com/cosmos/cosmos-sdk v0.47.3
github.com/ignite/cli v0.23.0
github.com/osmosis-labs/osmosis/v15 v15.0.0-20230602143948-7c9acb65e46c
github.com/osmosis-labs/osmosis/v16 v16.0.0-20230608013130-4c65a87ef8f1
github.com/osmosis-labs/osmosis/x/epochs v0.0.0-20230328024000-175ec88e4304

)

Expand All @@ -25,6 +26,7 @@ require (
github.com/cenkalti/backoff/v4 v4.1.3 // indirect
github.com/cespare/xxhash v1.1.0 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 // indirect
github.com/coinbase/rosetta-sdk-go v0.7.9 // indirect
github.com/confio/ics23/go v0.9.0 // indirect
github.com/cosmos/btcutil v1.0.5 // indirect
Expand All @@ -48,7 +50,6 @@ require (
github.com/go-kit/kit v0.12.0 // indirect
github.com/go-kit/log v0.2.1 // indirect
github.com/go-logfmt/logfmt v0.5.1 // indirect
github.com/go-playground/locales v0.14.0 // indirect
github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 // indirect
github.com/gogo/gateway v1.1.0 // indirect
github.com/gogo/protobuf v1.3.3 // indirect
Expand All @@ -75,6 +76,7 @@ require (
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/jmhodges/levigo v1.0.0 // indirect
github.com/klauspost/compress v1.15.11 // indirect
github.com/klauspost/cpuid/v2 v2.2.5 // indirect
github.com/lib/pq v1.10.7 // indirect
github.com/libp2p/go-buffer-pool v0.1.0 // indirect
github.com/magiconair/properties v1.8.7 // indirect
Expand All @@ -88,7 +90,6 @@ require (
github.com/nxadm/tail v1.4.8 // indirect
github.com/osmosis-labs/osmosis/osmomath v0.0.3-dev.0.20230516205127-c213fddde069 // indirect
github.com/osmosis-labs/osmosis/osmoutils v0.0.0-20230606194542-47ea1e2c85ca // indirect
github.com/osmosis-labs/osmosis/v16 v16.0.0-20230603032959-4d2ba21b8d1e // indirect
github.com/pelletier/go-toml/v2 v2.0.8 // indirect
github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5 // indirect
github.com/pkg/errors v0.9.1 // indirect
Expand Down Expand Up @@ -123,6 +124,7 @@ require (
github.com/zondax/ledger-go v0.14.1 // indirect
go.etcd.io/bbolt v1.3.6 // indirect
go.opencensus.io v0.24.0 // indirect
golang.org/x/arch v0.3.0 // indirect
golang.org/x/crypto v0.9.0 // indirect
golang.org/x/exp v0.0.0-20230131160201-f062dba9d201 // indirect
golang.org/x/mod v0.10.0 // indirect
Expand Down
Loading

0 comments on commit 2fd0415

Please sign in to comment.