Skip to content

Commit

Permalink
Merge branch 'main' into chore/fix-ci
Browse files Browse the repository at this point in the history
  • Loading branch information
keylogic1 authored Jun 27, 2024
2 parents 5c01d10 + a851380 commit 57633d7
Show file tree
Hide file tree
Showing 58 changed files with 4,433 additions and 425 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
# This job only runs for pull request comments
name: PR comment
if: ${{ github.event.issue.pull_request }}
runs-on: self-hosted
runs-on: ubuntu-latest
steps:
- name: Send Notification
uses: appleboy/telegram-action@master
Expand All @@ -26,7 +26,7 @@ jobs:
pull_requests_and_review:
name: Pull request action or review
if: ${{ !github.event.issue.pull_request }}
runs-on: self-hosted
runs-on: ubuntu-latest
steps:
- name: Send Notification
uses: appleboy/telegram-action@master
Expand Down
9 changes: 7 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ build-static-linux-amd64: go.sum $(BUILDDIR)/
$(DOCKER) cp neutronbinary:/bin/neutrond $(BUILDDIR)/neutrond-linux-amd64
$(DOCKER) rm -f neutronbinary

build-slinky-e2e-docker-image: go.sum $(BUILDDIR)/
build-e2e-docker-image: go.sum $(BUILDDIR)/
$(DOCKER) buildx create --name neutronbuilder || true
$(DOCKER) buildx use neutronbuilder
$(DOCKER) buildx build \
Expand All @@ -136,7 +136,12 @@ build-slinky-e2e-docker-image: go.sum $(BUILDDIR)/
-f Dockerfile.builder .

slinky-e2e-test:
cd ./tests/slinky && go mod tidy && go test -v -race -timeout 20m -count=1 ./...
@echo "Running e2e slinky tests..."
cd ./tests/slinky && go mod tidy && go test -v -race -timeout 30m -count=1 ./...

feemarket-e2e-test:
@echo "Running e2e feemarket tests..."
@cd ./tests/feemarket && go mod tidy && go test -p 1 -v -race -timeout 30m -count=1 ./...

install-test-binary: check_version go.sum
go install -mod=readonly $(BUILD_FLAGS_TEST_BINARY) ./cmd/neutrond
Expand Down
6 changes: 3 additions & 3 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import (
oracleclient "github.com/skip-mev/slinky/service/clients/oracle"
servicemetrics "github.com/skip-mev/slinky/service/metrics"

v400 "github.com/neutron-org/neutron/v4/app/upgrades/v4.0.0"
v401 "github.com/neutron-org/neutron/v4/app/upgrades/v4.0.1"
"github.com/neutron-org/neutron/v4/x/globalfee"
globalfeetypes "github.com/neutron-org/neutron/v4/x/globalfee/types"

Expand Down Expand Up @@ -225,7 +225,7 @@ const (
)

var (
Upgrades = []upgrades.Upgrade{v400.Upgrade}
Upgrades = []upgrades.Upgrade{v401.Upgrade}

// DefaultNodeHome default home directories for the application daemon
DefaultNodeHome string
Expand Down Expand Up @@ -1094,8 +1094,8 @@ func New(
crontypes.ModuleName,
globalfee.ModuleName,
feemarkettypes.ModuleName,
marketmaptypes.ModuleName,
oracletypes.ModuleName,
marketmaptypes.ModuleName,
ibcswaptypes.ModuleName,
dextypes.ModuleName,
dynamicfeestypes.ModuleName,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,13 @@ import (

const (
// UpgradeName defines the on-chain upgrade name.
UpgradeName = "v4.0.0"
UpgradeName = "v4.0.1"

// MarketMapAuthorityMultisig defines the address of a market-map authority governed by a
// multi-sig of contributors.
MarketMapAuthorityMultisig = "neutron1ua63s43u2p4v38pxhcxmps0tj2gudyw2hfeetz"

DecimalsAdjustment = 1_000_000_000_000
)

var Upgrade = upgrades.Upgrade{
Expand Down
90 changes: 48 additions & 42 deletions app/upgrades/v4.0.0/upgrades.go → app/upgrades/v4.0.1/upgrades.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,70 +92,76 @@ func setMarketMapParams(ctx sdk.Context, marketmapKeeper *marketmapkeeper.Keeper
}

// NtrnPrices describes prices of any token in NTRN for dynamic fee resolver
// there are several 18decimals coins, we need to adjust all the coins with the same base (6 decimals) prior to do any math
// by dividing by 10^12
var NtrnPrices = sdk.NewDecCoins(
// Token,Denom,TWAP30D (USD),Price in NTRN (30d TWAP of DENOM / 30d TWAP of NTRN),Price + 30% premium
// wstETH,factory/neutron1ug740qrkquxzrk2hh29qrlx3sktkfml3je7juusc2te7xmvsscns0n2wry/wstETH,3392.58,4772.232381488255,5790.006381488255
sdk.NewDecCoinFromDec("factory/neutron1ug740qrkquxzrk2hh29qrlx3sktkfml3je7juusc2te7xmvsscns0n2wry/wstETH", math.LegacyMustNewDecFromStr("5790.006381488255")),
// wstETH,factory/neutron1ug740qrkquxzrk2hh29qrlx3sktkfml3je7juusc2te7xmvsscns0n2wry/wstETH,3616.34,5779.670768739013,7513.571999360713
// 18 decimals coin
sdk.NewDecCoinFromDec("factory/neutron1ug740qrkquxzrk2hh29qrlx3sktkfml3je7juusc2te7xmvsscns0n2wry/wstETH", math.LegacyMustNewDecFromStr("7513.571999360713").QuoInt64(DecimalsAdjustment)),

// stATOM,ibc/B7864B03E1B9FD4F049243E92ABD691586F682137037A9F3FCA5222815620B3C,8.559,12.039668026445,14.607368026445
sdk.NewDecCoinFromDec("ibc/B7864B03E1B9FD4F049243E92ABD691586F682137037A9F3FCA5222815620B3C", math.LegacyMustNewDecFromStr("14.607368026445")),
// stATOM,ibc/B7864B03E1B9FD4F049243E92ABD691586F682137037A9F3FCA5222815620B3C,10.268,16.410420329231,21.333546427991
sdk.NewDecCoinFromDec("ibc/B7864B03E1B9FD4F049243E92ABD691586F682137037A9F3FCA5222815620B3C", math.LegacyMustNewDecFromStr("21.333546427991")),

// stTIA,ibc/6569E05DEE32B339D9286A52BE33DFCEFC97267F23EF9CFDE0C055140967A9A5,9.99,14.052609368406,17.049609368406
sdk.NewDecCoinFromDec("ibc/6569E05DEE32B339D9286A52BE33DFCEFC97267F23EF9CFDE0C055140967A9A5", math.LegacyMustNewDecFromStr("17.049609368406")),
// stTIA,ibc/6569E05DEE32B339D9286A52BE33DFCEFC97267F23EF9CFDE0C055140967A9A5,8.52,13.61674924085,17.70177401312
sdk.NewDecCoinFromDec("ibc/6569E05DEE32B339D9286A52BE33DFCEFC97267F23EF9CFDE0C055140967A9A5", math.LegacyMustNewDecFromStr("17.70177401312")),

// stkATOM,ibc/3649CE0C8A2C79048D8C6F31FF18FA69C9BC7EB193512E0BD03B733011290445,8.559,12.039668026445,14.607368026445
sdk.NewDecCoinFromDec("ibc/3649CE0C8A2C79048D8C6F31FF18FA69C9BC7EB193512E0BD03B733011290445", math.LegacyMustNewDecFromStr("14.607368026445")),
// stkATOM,ibc/3649CE0C8A2C79048D8C6F31FF18FA69C9BC7EB193512E0BD03B733011290445,9.656,15.432315806297,20.062010548187
sdk.NewDecCoinFromDec("ibc/3649CE0C8A2C79048D8C6F31FF18FA69C9BC7EB193512E0BD03B733011290445", math.LegacyMustNewDecFromStr("20.062010548187")),

// USDC.noble,ibc/B559A80D62249C8AA07A380E2A2BEA6E5CA9A6F079C912C3A9E9B494105E4F81,1,1.406667604445,1.706667604445
sdk.NewDecCoinFromDec("ibc/B559A80D62249C8AA07A380E2A2BEA6E5CA9A6F079C912C3A9E9B494105E4F81", math.LegacyMustNewDecFromStr("1.706667604445")),
// USDC.noble,ibc/B559A80D62249C8AA07A380E2A2BEA6E5CA9A6F079C912C3A9E9B494105E4F81,1,1.598210004795,2.077673006235
sdk.NewDecCoinFromDec("ibc/B559A80D62249C8AA07A380E2A2BEA6E5CA9A6F079C912C3A9E9B494105E4F81", math.LegacyMustNewDecFromStr("2.077673006235")),

// USDC.axl,ibc/F082B65C88E4B6D5EF1DB243CDA1D331D002759E938A0F5CD3FFDC5D53B3E349,1,1.406667604445,1.706667604445
sdk.NewDecCoinFromDec("ibc/F082B65C88E4B6D5EF1DB243CDA1D331D002759E938A0F5CD3FFDC5D53B3E349", math.LegacyMustNewDecFromStr("1.706667604445")),
// USDC.axl,ibc/F082B65C88E4B6D5EF1DB243CDA1D331D002759E938A0F5CD3FFDC5D53B3E349,1,1.598210004795,2.077673006235
sdk.NewDecCoinFromDec("ibc/F082B65C88E4B6D5EF1DB243CDA1D331D002759E938A0F5CD3FFDC5D53B3E349", math.LegacyMustNewDecFromStr("2.077673006235")),

// USDT,ibc/57503D7852EF4E1899FE6D71C5E81D7C839F76580F86F21E39348FC2BC9D7CE2,1,1.406667604445,1.706667604445
sdk.NewDecCoinFromDec("ibc/57503D7852EF4E1899FE6D71C5E81D7C839F76580F86F21E39348FC2BC9D7CE2", math.LegacyMustNewDecFromStr("1.706667604445")),
// USDT,ibc/57503D7852EF4E1899FE6D71C5E81D7C839F76580F86F21E39348FC2BC9D7CE2,1,1.598210004795,2.077673006235
sdk.NewDecCoinFromDec("ibc/57503D7852EF4E1899FE6D71C5E81D7C839F76580F86F21E39348FC2BC9D7CE2", math.LegacyMustNewDecFromStr("2.077673006235")),

// http://astro.cw/,ibc/5751B8BCDA688FD0A8EC0B292EEF1CDEAB4B766B63EC632778B196D317C40C3A,0.0020456,0.002877479252,0.003491159252
sdk.NewDecCoinFromDec("ibc/5751B8BCDA688FD0A8EC0B292EEF1CDEAB4B766B63EC632778B196D317C40C3A", math.LegacyMustNewDecFromStr("0.003491159252")),
// http://astro.cw/,ibc/5751B8BCDA688FD0A8EC0B292EEF1CDEAB4B766B63EC632778B196D317C40C3A,0.0693,0.110755953332,0.143982739322
sdk.NewDecCoinFromDec("ibc/5751B8BCDA688FD0A8EC0B292EEF1CDEAB4B766B63EC632778B196D317C40C3A", math.LegacyMustNewDecFromStr("0.143982739322")),

// ASTRO,factory/neutron1ffus553eet978k024lmssw0czsxwr97mggyv85lpcsdkft8v9ufsz3sa07/astro,0.0020456,0.002877479252,0.003491159252
sdk.NewDecCoinFromDec("factory/neutron1ffus553eet978k024lmssw0czsxwr97mggyv85lpcsdkft8v9ufsz3sa07/astro", math.LegacyMustNewDecFromStr("0.003491159252")),
// ASTRO,factory/neutron1ffus553eet978k024lmssw0czsxwr97mggyv85lpcsdkft8v9ufsz3sa07/astro,0.0693,0.110755953332,0.143982739322
sdk.NewDecCoinFromDec("factory/neutron1ffus553eet978k024lmssw0czsxwr97mggyv85lpcsdkft8v9ufsz3sa07/astro", math.LegacyMustNewDecFromStr("0.143982739322")),

// MARS,ibc/9598CDEB7C6DB7FC21E746C8E0250B30CD5154F39CA111A9D4948A4362F638BD,0.086318,0.12142073428,0.14731613428
sdk.NewDecCoinFromDec("ibc/9598CDEB7C6DB7FC21E746C8E0250B30CD5154F39CA111A9D4948A4362F638BD", math.LegacyMustNewDecFromStr("0.14731613428")),
// MARS,ibc/9598CDEB7C6DB7FC21E746C8E0250B30CD5154F39CA111A9D4948A4362F638BD,0.0652,0.104203292313,0.135464280003
sdk.NewDecCoinFromDec("ibc/9598CDEB7C6DB7FC21E746C8E0250B30CD5154F39CA111A9D4948A4362F638BD", math.LegacyMustNewDecFromStr("0.135464280003")),

// APOLLO,factory/neutron154gg0wtm2v4h9ur8xg32ep64e8ef0g5twlsgvfeajqwghdryvyqsqhgk8e/APOLLO,0.1824,0.256576171051,0.311296171051
sdk.NewDecCoinFromDec("factory/neutron154gg0wtm2v4h9ur8xg32ep64e8ef0g5twlsgvfeajqwghdryvyqsqhgk8e/APOLLO", math.LegacyMustNewDecFromStr("0.311296171051")),
// APOLLO,factory/neutron154gg0wtm2v4h9ur8xg32ep64e8ef0g5twlsgvfeajqwghdryvyqsqhgk8e/APOLLO,0.06079,0.097155186191,0.126301742051
sdk.NewDecCoinFromDec("factory/neutron154gg0wtm2v4h9ur8xg32ep64e8ef0g5twlsgvfeajqwghdryvyqsqhgk8e/APOLLO", math.LegacyMustNewDecFromStr("0.126301742051")),

// TIA,ibc/773B4D0A3CD667B2275D5A4A7A2F0909C0BA0F4059C0B9181E680DDF4965DCC7,9.99,14.052609368406,17.049609368406
sdk.NewDecCoinFromDec("ibc/773B4D0A3CD667B2275D5A4A7A2F0909C0BA0F4059C0B9181E680DDF4965DCC7", math.LegacyMustNewDecFromStr("17.049609368406")),
// TIA,ibc/773B4D0A3CD667B2275D5A4A7A2F0909C0BA0F4059C0B9181E680DDF4965DCC7,8.52,13.61674924085,17.70177401312
sdk.NewDecCoinFromDec("ibc/773B4D0A3CD667B2275D5A4A7A2F0909C0BA0F4059C0B9181E680DDF4965DCC7", math.LegacyMustNewDecFromStr("17.70177401312")),

// ATOM,ibc/C4CFF46FD6DE35CA4CF4CE031E643C8FDC9BA4B99AE598E9B0ED98FE3A2319F9,8.559,12.039668026445,14.607368026445
sdk.NewDecCoinFromDec("ibc/C4CFF46FD6DE35CA4CF4CE031E643C8FDC9BA4B99AE598E9B0ED98FE3A2319F9", math.LegacyMustNewDecFromStr("14.607368026445")),
// ATOM,ibc/C4CFF46FD6DE35CA4CF4CE031E643C8FDC9BA4B99AE598E9B0ED98FE3A2319F9,7.559,12.080869426243,15.705130254103
sdk.NewDecCoinFromDec("ibc/C4CFF46FD6DE35CA4CF4CE031E643C8FDC9BA4B99AE598E9B0ED98FE3A2319F9", math.LegacyMustNewDecFromStr("15.705130254103")),

// axlWETH,ibc/A585C2D15DCD3B010849B453A2CFCB5E213208A5AB665691792684C26274304D,3392.58,4772.232381488255,5790.006381488255
sdk.NewDecCoinFromDec("ibc/A585C2D15DCD3B010849B453A2CFCB5E213208A5AB665691792684C26274304D", math.LegacyMustNewDecFromStr("5790.006381488255")),
// axlWETH,ibc/A585C2D15DCD3B010849B453A2CFCB5E213208A5AB665691792684C26274304D,3616.34,5779.670768739013,7513.571999360713
// 18 decimals coin
sdk.NewDecCoinFromDec("ibc/A585C2D15DCD3B010849B453A2CFCB5E213208A5AB665691792684C26274304D", math.LegacyMustNewDecFromStr("7513.571999360713").QuoInt64(DecimalsAdjustment)),

// OSMO,ibc/376222D6D9DAE23092E29740E56B758580935A6D77C24C2ABD57A6A78A1F3955,0.8784,1.235616823745,1.499136823745
sdk.NewDecCoinFromDec("ibc/376222D6D9DAE23092E29740E56B758580935A6D77C24C2ABD57A6A78A1F3955", math.LegacyMustNewDecFromStr("1.499136823745")),
// OSMO,ibc/376222D6D9DAE23092E29740E56B758580935A6D77C24C2ABD57A6A78A1F3955,0.6699,1.070640882212,1.391833146872
sdk.NewDecCoinFromDec("ibc/376222D6D9DAE23092E29740E56B758580935A6D77C24C2ABD57A6A78A1F3955", math.LegacyMustNewDecFromStr("1.391833146872")),

// DYM,ibc/4A6A46D4263F2ED3DCE9CF866FE15E6903FB5E12D87EB8BDC1B6B1A1E2D397B4,3.043,4.280489520326,5.193389520326
sdk.NewDecCoinFromDec("ibc/4A6A46D4263F2ED3DCE9CF866FE15E6903FB5E12D87EB8BDC1B6B1A1E2D397B4", math.LegacyMustNewDecFromStr("5.193389520326")),
// DYM,ibc/4A6A46D4263F2ED3DCE9CF866FE15E6903FB5E12D87EB8BDC1B6B1A1E2D397B4,2.329,3.722231101167,4.838900431527
// 18 decimals coin
sdk.NewDecCoinFromDec("ibc/4A6A46D4263F2ED3DCE9CF866FE15E6903FB5E12D87EB8BDC1B6B1A1E2D397B4", math.LegacyMustNewDecFromStr("4.838900431527").QuoInt64(DecimalsAdjustment)),

// DYDX,ibc/2CB87BCE0937B1D1DFCEE79BE4501AAF3C265E923509AEAC410AD85D27F35130,2.036,2.86397524265,3.47477524265
sdk.NewDecCoinFromDec("ibc/2CB87BCE0937B1D1DFCEE79BE4501AAF3C265E923509AEAC410AD85D27F35130", math.LegacyMustNewDecFromStr("3.47477524265")),
// DYDX,ibc/2CB87BCE0937B1D1DFCEE79BE4501AAF3C265E923509AEAC410AD85D27F35130,1.71,2.732939108199,3.552820840659
// 18 decimals coin
sdk.NewDecCoinFromDec("ibc/2CB87BCE0937B1D1DFCEE79BE4501AAF3C265E923509AEAC410AD85D27F35130", math.LegacyMustNewDecFromStr("3.552820840659").QuoInt64(DecimalsAdjustment)),

// KUJI,ibc/1053E271314D36FECBC915B51474F8B3962597CE88FF3E4A74795B0E3F367A8B,1.49,2.095934730623,2.542934730623
sdk.NewDecCoinFromDec("ibc/1053E271314D36FECBC915B51474F8B3962597CE88FF3E4A74795B0E3F367A8B", math.LegacyMustNewDecFromStr("2.542934730623")),
// KUJI,ibc/1053E271314D36FECBC915B51474F8B3962597CE88FF3E4A74795B0E3F367A8B,1.22,1.949816205849,2.534761067589
sdk.NewDecCoinFromDec("ibc/1053E271314D36FECBC915B51474F8B3962597CE88FF3E4A74795B0E3F367A8B", math.LegacyMustNewDecFromStr("2.534761067589")),

// STARS,ibc/A139C0E0B5E87CBA8EAEEB12B9BEE13AC7C814CFBBFA87BBCADD67E31003466C,0.017794524,0.025030980447,0.030369337647
sdk.NewDecCoinFromDec("ibc/A139C0E0B5E87CBA8EAEEB12B9BEE13AC7C814CFBBFA87BBCADD67E31003466C", math.LegacyMustNewDecFromStr("0.030369337647")),
// STARS,ibc/A139C0E0B5E87CBA8EAEEB12B9BEE13AC7C814CFBBFA87BBCADD67E31003466C,0.0138,0.022055298066,0.028671887496
sdk.NewDecCoinFromDec("ibc/A139C0E0B5E87CBA8EAEEB12B9BEE13AC7C814CFBBFA87BBCADD67E31003466C", math.LegacyMustNewDecFromStr("0.028671887496")),

// AXL,ibc/C0E66D1C81D8AAF0E6896E05190FDFBC222367148F86AC3EA679C28327A763CD,1.0637,1.496272330848,1.815382330848
sdk.NewDecCoinFromDec("ibc/C0E66D1C81D8AAF0E6896E05190FDFBC222367148F86AC3EA679C28327A763CD", math.LegacyMustNewDecFromStr("1.815382330848")),
// AXL,ibc/C0E66D1C81D8AAF0E6896E05190FDFBC222367148F86AC3EA679C28327A763CD,0.802,1.281764423845,1.666293750985
sdk.NewDecCoinFromDec("ibc/C0E66D1C81D8AAF0E6896E05190FDFBC222367148F86AC3EA679C28327A763CD", math.LegacyMustNewDecFromStr("1.666293750985")),

// STRD,ibc/3552CECB7BCE1891DB6070D37EC6E954C972B1400141308FCD85FD148BD06DE5,1.713582985,2.410441672528,2.924516568028
sdk.NewDecCoinFromDec("ibc/3552CECB7BCE1891DB6070D37EC6E954C972B1400141308FCD85FD148BD06DE5", math.LegacyMustNewDecFromStr("2.924516568028")),
// STRD,ibc/3552CECB7BCE1891DB6070D37EC6E954C972B1400141308FCD85FD148BD06DE5,1.542,2.464439827393,3.203771775613
sdk.NewDecCoinFromDec("ibc/3552CECB7BCE1891DB6070D37EC6E954C972B1400141308FCD85FD148BD06DE5", math.LegacyMustNewDecFromStr("3.203771775613")),
)

func setDynamicFeesParams(ctx sdk.Context, dfKeeper *dynamicfeeskeeper.Keeper) error {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (

"github.com/stretchr/testify/suite"

v400 "github.com/neutron-org/neutron/v4/app/upgrades/v4.0.0"
v400 "github.com/neutron-org/neutron/v4/app/upgrades/v4.0.1"
"github.com/neutron-org/neutron/v4/testutil"
)

Expand Down
Loading

0 comments on commit 57633d7

Please sign in to comment.