Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev/takeover 1886 #2

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
6511fcc
Added section to Contributing.md detailing our desired pre-release co…
xBalbinus Jun 27, 2022
59472d7
Cleanup root folder (#1883)
ValarDragon Jun 28, 2022
41a8524
Update add-issue-pr-to-project.yml (#1891)
xBalbinus Jun 28, 2022
c31b9d2
Improve readability in x/tokenfactory test (#1876)
mattverse Jun 29, 2022
21f7f98
Fix epochs modules tests (#1893)
ValarDragon Jun 29, 2022
33f5e40
chore(deps): Bump github.com/stretchr/testify from 1.7.5 to 1.8.0 (#1…
dependabot[bot] Jun 30, 2022
9f64027
e2e: chain initialization refactor for extensibility (#1898)
p0mvn Jun 30, 2022
85529c7
fix: e2e flakiness related to err checking containers (#1902)
p0mvn Jun 30, 2022
f79a273
refactor FundCommunityPoolFromModule to use SDK (#1909)
rrrliu Jun 30, 2022
76344cd
Write test for AddEpochInfo (#1895)
ValarDragon Jun 30, 2022
699b713
Locks amount invariant (#1884)
hieuvubk Jun 30, 2022
52d46b2
Issue 1525: sub-section: combine superfluid query and staking query o…
nghuyenthevinh2000 Jun 30, 2022
3790f88
[Query] Make pool incentives query show % of incentives going to that…
stackman27 Jun 30, 2022
a540ce7
We broke adding issues to Project, this fixes it (#1912)
ValarDragon Jun 30, 2022
b13fbff
chore: update labeler.yml (#1913)
alexanderbez Jun 30, 2022
ee48cf5
chore: x/mint docs and clean up, excluding mint keeper (#1857)
p0mvn Jun 30, 2022
d9a4f94
test: x/mint thirdening - identify rounding errors (#1874)
p0mvn Jun 30, 2022
15736e5
x/gamm: Internal audit and documentation (#1858)
AlpinYukseloglu Jun 30, 2022
e2d4911
refactor: consolidate pool implementation (#1868)
alexanderbez Jun 30, 2022
28fe669
e2e: remove unused skipRunValidatorIndexes (#1923)
p0mvn Jun 30, 2022
add306e
e2e: fix image choice when upgrade logic is disabled (#1922)
p0mvn Jun 30, 2022
25bf1d8
chore: x/lockup documentation, module cleanup (#1900)
mattverse Jul 1, 2022
5ba829f
e2e: ExecCmd debug log on error (#1924)
p0mvn Jul 1, 2022
0f3e8b9
Delete cmd/testnetify (#1933)
ValarDragon Jul 1, 2022
01dee57
x/gamm: Add check to ensure JoinPoolNoSwap cannot be called with arbi…
AlpinYukseloglu Jul 1, 2022
c0573d1
Add deadcode linter (#1934)
ValarDragon Jul 1, 2022
2007bab
Generalize gamm Inverse relationship test , add Inverse relationship …
mattverse Jul 1, 2022
fc11147
x/gamm: Delete the height < v10forkheight { use broken code } check (…
AlpinYukseloglu Jul 1, 2022
99304f2
x/lock: Fix `ExtendLockup` API (#1937)
mattverse Jul 1, 2022
b33920a
chore: x/mint genesis - audit, clean up and tests (#1872)
p0mvn Jul 1, 2022
197a9b1
Re-use code in superfluid TotalDelegationByDelegator (#1938)
ValarDragon Jul 3, 2022
8f018a6
gofumpt matienance (#1948)
faddat Jul 3, 2022
aca83eb
lint: enable unused in golangci-lint (#1939)
p0mvn Jul 4, 2022
0956d89
Making CI for testing generated proto correctness (#1892)
xBalbinus Jul 4, 2022
5be8292
lint: remove unused v10 fork height not caught during merge (#1953)
p0mvn Jul 4, 2022
1517e65
refactor ref method (#1951)
mattverse Jul 4, 2022
cc82980
lint: enable gosimple (#1957)
p0mvn Jul 4, 2022
c115593
Refactor `lock` method (#1936)
mattverse Jul 5, 2022
14ca3fd
x/gamm: Rename CalcExitPoolShares to CalcExitPoolCoinsFromShares #1970
AlpinYukseloglu Jul 5, 2022
c35d886
Clean up pool asset (#1967)
hieuvubk Jul 5, 2022
49d632f
x/gamm: Add check for correct input asset denoms to CalcJoinPoolShare…
AlpinYukseloglu Jul 5, 2022
298d7cf
test/devux: helper function for assertions conditional on panics (#1964)
stackman27 Jul 5, 2022
e398235
lint: enable stylecheck (#1960)
p0mvn Jul 5, 2022
1da14b8
e2e: refactor initialization with single node logic (#1963)
p0mvn Jul 5, 2022
1a67b02
lint: fix issue from parallel e2e pull request (#1974)
p0mvn Jul 5, 2022
133e139
chore: x/tokenfactory audit (#1962)
alexanderbez Jul 5, 2022
f0270d0
chore(e2e): update initialization image (#1976)
p0mvn Jul 5, 2022
198a4de
chore: refactor unlock test (#1968)
mattverse Jul 6, 2022
4fb906f
rename params.go to pool_params.go, consolidate pool functions to poo…
rrrliu Jul 6, 2022
28417c0
Remove the EndBlock ordering constraints, that didn't matter before (…
ValarDragon Jul 6, 2022
a364494
Add TWAP stub package (#1982)
ValarDragon Jul 7, 2022
33dc056
Merge branch 'main' into dev/takeover_1886
ValarDragon Jul 7, 2022
920b74e
Add Changelog
ValarDragon Jul 7, 2022
63e976b
Add requested test updates
ValarDragon Jul 7, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
2 changes: 2 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
- x/superfluid/**/*
"C:x/txfees":
- x/txfees/**/*
"C:x/tokenfactory":
- x/tokenfactory/**/*
"T:build":
- Makefile
- Dockerfile
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ on:
issues:
types:
- opened
pull_request:
types:
- opened
jobs:
add-to-project:
name: Add issue to chain dev project
Expand Down
16 changes: 16 additions & 0 deletions .github/workflows/add-pr-to-project.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Add new PRs to project

on:
pull_request:
types:
- opened
jobs:
add-to-project:
name: Add PR to chain dev project
if: ${{ github.event.pull_request.head.repo.full_name == 'osmosis-labs/osmosis' }}
runs-on: ubuntu-latest
steps:
- uses: actions/add-to-project@main
with:
project-url: https://github.com/orgs/osmosis-labs/projects/1
github-token: ${{ secrets.ADD_TO_PROJECT_PAT }}
29 changes: 29 additions & 0 deletions .github/workflows/check-generated.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Verify that generated code is up-to-date.
#
# Note that we run these checks regardless whether the input files have
# changed, because generated code can change in response to toolchain updates
# even if no files in the repository are modified.
name: Check generated code
on:
workflow_dispatch:
pull_request:
branches:
- '*'

permissions:
contents: read

jobs:
check-proto:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v3
with:
go-version: '1.18'

- uses: actions/checkout@v3
with:
fetch-depth: 1 # we need a .git directory to run git diff

- name: "Check protobuf generated code"
run: contrib/scripts/check-generated.sh
20 changes: 15 additions & 5 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ linters:
# - bodyclose <- needs go 1.18 support
# - contextcheck <- needs go 1.18 support
# - cyclop
# - deadcode <- re-enable in another pr
- deadcode
- depguard
# - dogsled <- disabled because we would like to participate in the iditerod
# - dupl <- really just catches cli stub text
Expand Down Expand Up @@ -45,9 +45,9 @@ linters:
- gomodguard
- goprintffuncname
# - gosec <- triggers too much for this round and should be re-enabled later
# - gosimple <- later
- gosimple # specializes in simplifying code, subset of staticcheck binary.
- govet
# - ifshort <- seems to be of questionable value
# - ifshort <- questionable value, unclear if globally helping readability.
- importas
- ineffassign
# - ireturn <- disabled because we want to return interfaces
Expand All @@ -70,7 +70,7 @@ linters:
# - sqlclosecheck <- needs go 1.18 support
# - staticcheck <- later
# - structcheck <- later
# - stylecheck <- enable later, atriggers on underscores in variable names and on poolId
- stylecheck # replacement of golint, subset of staticcheck binary.
# - tagliatelle <- disabled for defying cosmos idiom
- tenv
- testpackage
Expand All @@ -79,7 +79,7 @@ linters:
- typecheck
- unconvert
# - unparam <- looks for unused parameters (enable later)
# - unused <- looks for unused variables (enable later)
- unused # looks for unused variables, subset of staticcheck binary.
# - varcheck <- later
# - varnamelen <- disabled because defies idiom
# - wastedassign
Expand All @@ -95,5 +95,15 @@ issues:
- path: client/docs
linters:
- all
- path: x/gamm/pool-models/stableswap
linters:
# Stableswap is in development.
# We should re-enable deadcode and unused linting
# across its files, once stableswap is fully complete.
- unused
- deadcode
- linters:
- stylecheck
text: "ST1003:" # requires identifiers with "id" to be "ID".
max-issues-per-linter: 10000
max-same-issues: 10000
12 changes: 11 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Breaking Changes


* [#1889](https://github.com/osmosis-labs/osmosis/pull/1825) Add proto responses to gamm LP messages:
* MsgJoinPoolResponse: share_out_amount and token_in fields
* MsgExitPoolResponse: token_out field
* [#1825](https://github.com/osmosis-labs/osmosis/pull/1825) Fixes Interchain Accounts (host side) by adding it to AppModuleBasics
* [#1699](https://github.com/osmosis-labs/osmosis/pull/1699) Fixes bug in sig fig rounding on spot price queries for small values

#### golang API breaks
#### Golang API breaks

* [#1937](https://github.com/osmosis-labs/osmosis/pull/1937) Change `lockupKeeper.ExtendLock` to take in lockID instead of the direct lock struct.
* [#1893](https://github.com/osmosis-labs/osmosis/pull/1893) Change `EpochsKeeper.SetEpochInfo` to `AddEpochInfo`, which has more safety checks with it. (Makes it suitable to be called within upgrades)
* [#1671](https://github.com/osmosis-labs/osmosis/pull/1671) Remove methods that constitute AppModuleSimulation APIs for several modules' AppModules, which implemented no-ops
* [#1671](https://github.com/osmosis-labs/osmosis/pull/1671) Add hourly epochs to `x/epochs` DefaultGenesis.
* [#1665](https://github.com/osmosis-labs/osmosis/pull/1665) Delete app/App interface, instead use simapp.App
Expand All @@ -60,12 +66,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
* [#1312] Stableswap: Createpool logic
* [#1230] Stableswap CFMM equations
* [#1429] solver for multi-asset CFMM
* [#1539] Superfluid: Combine superfluid and staking query on querying delegation by delegator

### Bug Fixes

* [1930](https://github.com/osmosis-labs/osmosis/pull/1930) Ensure you can't `JoinPoolNoSwap` tokens that are not in the pool
* [1700](https://github.com/osmosis-labs/osmosis/pull/1700) Upgrade sdk fork with missing snapshot manager fix.
* [1716](https://github.com/osmosis-labs/osmosis/pull/1716) Fix secondary over-LP shares bug with uneven swap amounts in `CalcJoinPoolShares`.
* [1759](https://github.com/osmosis-labs/osmosis/pull/1759) Fix pagination filter in incentives query.
* [1698](https://github.com/osmosis-labs/osmosis/pull/1698) Register wasm snapshotter extension.
* [1931](https://github.com/osmosis-labs/osmosis/pull/1931) Add explicit check for input denoms to `CalcJoinPoolShares`

## [v9.0.0 - Nitrogen](https://github.com/osmosis-labs/osmosis/releases/tag/v9.0.0)

Expand Down
49 changes: 46 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,51 @@ For v6.x, and v4.x, most PRs to them should go to main and get a "backport" labe

### How to build proto files. (rm -rf vendor/ && make build-reproducible once docker is installed)

You can do rm -rf vendor and make build-reproducible to redownload all dependencies - this should pull the latest docker image of Osmosis. You should also make sure to do make proto-all to auto-generate your protobuf files. Makes ure you have docker installed.
You can do rm -rf vendor and make build-reproducible to redownload all dependencies - this should pull the latest docker image of Osmosis. You should also make sure to do make proto-all to auto-generate your protobuf files. Makes ure you have docker installed.

If you get something like `W0503 22:16:30.068560 158 services.go:38] No HttpRule found for method: Msg.CreateBalancerPool` feel free to ignore that.
If you get something like `W0503 22:16:30.068560 158 services.go:38] No HttpRule found for method: Msg.CreateBalancerPool` feel free to ignore that.

Make sure to also do make all to run all the linting tests before you commit and push, as well as `gofmt`-ing the file you've modified or added to make sure everything still abides by the standards.
You can also feel free to do `make format` if you're getting errors related to `gofmt`. Setting this up to be [automatic](https://www.jetbrains.com/help/go/reformat-and-rearrange-code.html#reformat-on-save) for yourself is recommended.

## Major Release

There are several steps that go into a major release

* Run the [existing binary creation tool](https://github.com/osmosis-labs/osmosis/blob/main/.github/workflows/release.yml). Running `make -f contrib/images/osmobuilder/Makefile release` on the root of the repo will replicate the CI that creates the release folder containing the binaries.

* Make a PR to main, with a cosmovisor config, generated in tandem with the binaries from tool.
* Should be its own PR, as it may get denied for Fork upgrades.

* Make a PR to main to update the import paths and go.mod for the new major release

* Should also make a commit into every open PR to main to do the same find/replace. (Unless this will cause conflicts)

* Do a PR if that commit has conflicts

* (Eventually) Make a PR that adds a version handler for the next upgrade
* [Add v10 upgrade boilerplate #1649](https://github.com/osmosis-labs/osmosis/pull/1649/files)

* Update chain JSON schema's recommended versions in `chain.schema.json` located in the root directory.

### Pre-release auditing process

For every module with notable changes, we assign someone who was not a primary author of those changes to review the entire module.

Deliverables of review are:

* PR's with in-line code comments for things they had to figure out (or questions)

* Tests / test comments needed to convince themselves of correctness

* Spec updates

* Small refactors that helped in understanding / making code conform to consistency stds / improve code signal-to-noise ratio welcome

* (As with all PRs, should not be a monolithic PR that gets PR'd, even though that may be the natural way its first formed)

At the moment, we're looking for a tool that lets us statically figure out every message that had something in its code path that changed. Until a tool is found, we must do this manually.

We test in testnet & e2e testnet behaviors about every message that has changed

We communicate with various integrators if they'd like release-blocking QA testing for major releases
* Chainapsis has communicated wanting a series of osmosis-frontend functionalities to be checked for correctness on a testnet as a release blocking item
16 changes: 9 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#!/usr/bin/make -f

PACKAGES_SIMTEST=$(shell go list ./... | grep '/simulation')
VERSION := $(shell echo $(shell git describe --tags) | sed 's/^v//')
COMMIT := $(shell git log -1 --format='%H')
LEDGER_ENABLED ?= true
Expand Down Expand Up @@ -114,10 +113,6 @@ build-contract-tests-hooks:
mkdir -p $(BUILDDIR)
go build -mod=readonly $(BUILD_FLAGS) -o $(BUILDDIR)/ ./cmd/contract_tests

build-e2e-chain-init:
mkdir -p $(BUILDDIR)
go build -mod=readonly $(BUILD_FLAGS) -o $(BUILDDIR)/ ./tests/e2e/chain_init

go-mod-cache: go.sum
@echo "--> Download go modules to local cache"
@go mod download
Expand Down Expand Up @@ -245,11 +240,18 @@ test-e2e-skip-upgrade:
benchmark:
@go test -mod=readonly -bench=. $(PACKAGES_UNIT)

build-e2e-script:
mkdir -p $(BUILDDIR)
go build -mod=readonly $(BUILD_FLAGS) -o $(BUILDDIR)/ ./tests/e2e/initialization/$(E2E_SCRIPT_NAME)

docker-build-debug:
@docker build -t osmosis:debug --build-arg BASE_IMG_TAG=debug -f Dockerfile .

docker-build-e2e-chain-init:
@docker build -t osmosis-e2e-chain-init:debug -f tests/e2e/chain_init/chain-init.Dockerfile .
docker-build-e2e-init-chain:
@docker build -t osmosis-e2e-init-chain:debug --build-arg E2E_SCRIPT_NAME=chain -f tests/e2e/initialization/init.Dockerfile .

docker-build-e2e-init-node:
@docker build -t osmosis-e2e-init-node:debug --build-arg E2E_SCRIPT_NAME=node -f tests/e2e/initialization/init.Dockerfile .

###############################################################################
### Linting ###
Expand Down
9 changes: 0 additions & 9 deletions RELEASE.md

This file was deleted.

52 changes: 26 additions & 26 deletions app/apptesting/gamm.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ var DefaultAcctFunds sdk.Coins = sdk.NewCoins(
)

// Returns a Univ2 pool with the initial liquidity being the provided balances
func (suite *KeeperTestHelper) PrepareUni2PoolWithAssets(asset1, asset2 sdk.Coin) uint64 {
return suite.PrepareBalancerPoolWithPoolAsset(
func (s *KeeperTestHelper) PrepareUni2PoolWithAssets(asset1, asset2 sdk.Coin) uint64 {
return s.PrepareBalancerPoolWithPoolAsset(
[]balancer.PoolAsset{
{
Weight: sdk.NewInt(1),
Expand All @@ -30,30 +30,30 @@ func (suite *KeeperTestHelper) PrepareUni2PoolWithAssets(asset1, asset2 sdk.Coin
)
}

func (suite *KeeperTestHelper) PrepareBalancerPool() uint64 {
poolId := suite.PrepareBalancerPoolWithPoolParams(balancer.PoolParams{
func (s *KeeperTestHelper) PrepareBalancerPool() uint64 {
poolId := s.PrepareBalancerPoolWithPoolParams(balancer.PoolParams{
SwapFee: sdk.NewDec(0),
ExitFee: sdk.NewDec(0),
})

spotPrice, err := suite.App.GAMMKeeper.CalculateSpotPrice(suite.Ctx, poolId, "foo", "bar")
suite.NoError(err)
suite.Equal(sdk.NewDec(2).String(), spotPrice.String())
spotPrice, err = suite.App.GAMMKeeper.CalculateSpotPrice(suite.Ctx, poolId, "bar", "baz")
suite.NoError(err)
suite.Equal(sdk.NewDecWithPrec(15, 1).String(), spotPrice.String())
spotPrice, err = suite.App.GAMMKeeper.CalculateSpotPrice(suite.Ctx, poolId, "baz", "foo")
suite.NoError(err)
s := sdk.NewDec(1).Quo(sdk.NewDec(3))
sp := s.MulInt(gammtypes.SigFigs).RoundInt().ToDec().QuoInt(gammtypes.SigFigs)
suite.Equal(sp.String(), spotPrice.String())
spotPrice, err := s.App.GAMMKeeper.CalculateSpotPrice(s.Ctx, poolId, "foo", "bar")
s.NoError(err)
s.Equal(sdk.NewDec(2).String(), spotPrice.String())
spotPrice, err = s.App.GAMMKeeper.CalculateSpotPrice(s.Ctx, poolId, "bar", "baz")
s.NoError(err)
s.Equal(sdk.NewDecWithPrec(15, 1).String(), spotPrice.String())
spotPrice, err = s.App.GAMMKeeper.CalculateSpotPrice(s.Ctx, poolId, "baz", "foo")
s.NoError(err)
oneThird := sdk.NewDec(1).Quo(sdk.NewDec(3))
sp := oneThird.MulInt(gammtypes.SigFigs).RoundInt().ToDec().QuoInt(gammtypes.SigFigs)
s.Equal(sp.String(), spotPrice.String())

return poolId
}

func (suite *KeeperTestHelper) PrepareBalancerPoolWithPoolParams(poolParams balancer.PoolParams) uint64 {
func (s *KeeperTestHelper) PrepareBalancerPoolWithPoolParams(poolParams balancer.PoolParams) uint64 {
// Mint some assets to the account.
suite.FundAcc(suite.TestAccs[0], DefaultAcctFunds)
s.FundAcc(s.TestAccs[0], DefaultAcctFunds)

poolAssets := []balancer.PoolAsset{
{
Expand All @@ -69,27 +69,27 @@ func (suite *KeeperTestHelper) PrepareBalancerPoolWithPoolParams(poolParams bala
Token: sdk.NewCoin("baz", sdk.NewInt(5000000)),
},
}
msg := balancer.NewMsgCreateBalancerPool(suite.TestAccs[0], poolParams, poolAssets, "")
poolId, err := suite.App.GAMMKeeper.CreatePool(suite.Ctx, msg)
suite.NoError(err)
msg := balancer.NewMsgCreateBalancerPool(s.TestAccs[0], poolParams, poolAssets, "")
poolId, err := s.App.GAMMKeeper.CreatePool(s.Ctx, msg)
s.NoError(err)
return poolId
}

func (suite *KeeperTestHelper) PrepareBalancerPoolWithPoolAsset(assets []balancer.PoolAsset) uint64 {
suite.Require().Len(assets, 2)
func (s *KeeperTestHelper) PrepareBalancerPoolWithPoolAsset(assets []balancer.PoolAsset) uint64 {
s.Require().Len(assets, 2)

// Add coins for pool creation fee + coins needed to mint balances
fundCoins := sdk.Coins{sdk.NewCoin("uosmo", sdk.NewInt(10000000000))}
for _, a := range assets {
fundCoins = fundCoins.Add(a.Token)
}
suite.FundAcc(suite.TestAccs[0], fundCoins)
s.FundAcc(s.TestAccs[0], fundCoins)

msg := balancer.NewMsgCreateBalancerPool(suite.TestAccs[0], balancer.PoolParams{
msg := balancer.NewMsgCreateBalancerPool(s.TestAccs[0], balancer.PoolParams{
SwapFee: sdk.ZeroDec(),
ExitFee: sdk.ZeroDec(),
}, assets, "")
poolId, err := suite.App.GAMMKeeper.CreatePool(suite.Ctx, msg)
suite.NoError(err)
poolId, err := s.App.GAMMKeeper.CreatePool(s.Ctx, msg)
s.NoError(err)
return poolId
}
Loading