Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into chore/dex_event_cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
jcompagni10 committed Aug 20, 2024
2 parents 5fcb189 + fe3e338 commit 61ca7ce
Show file tree
Hide file tree
Showing 47 changed files with 792 additions and 841 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ on:

jobs:
docker:
runs-on: self-hosted
runs-on:
group: Neutron-Core
env:
DOCKER_BUILDKIT: 1

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ permissions:
jobs:
golangci:
name: lint
runs-on: self-hosted
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on: [push, pull_request]
jobs:
tests:
name: Test
runs-on: self-hosted
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.22
uses: actions/setup-go@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test_trigger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ on:
jobs:
dispatch:
name: Dispatch Tests Workflow
runs-on: self-hosted
runs-on: ubuntu-latest
steps:
- name: Evaluate PR Merged Status and Labels
run: |
Expand Down
24 changes: 4 additions & 20 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,6 @@ import (
oraclekeeper "github.com/skip-mev/slinky/x/oracle/keeper"
oracletypes "github.com/skip-mev/slinky/x/oracle/types"

"github.com/cosmos/cosmos-sdk/crypto/keyring"
runtimeservices "github.com/cosmos/cosmos-sdk/runtime/services"
)

Expand Down Expand Up @@ -413,7 +412,7 @@ type App struct {

// AutoCLIOpts returns options based upon the modules in the neutron v4 app.
func (app *App) AutoCLIOpts(initClientCtx client.Context) autocli.AppOptions {
modules := make(map[string]appmodule.AppModule, 0)
modules := make(map[string]appmodule.AppModule)
for _, m := range app.mm.Modules {
if moduleWithName, ok := m.(module.HasName); ok {
moduleName := moduleWithName.Name()
Expand All @@ -423,18 +422,12 @@ func (app *App) AutoCLIOpts(initClientCtx client.Context) autocli.AppOptions {
}
}

cliKR, err := keyring.NewAutoCLIKeyring(initClientCtx.Keyring)
if err != nil {
panic(err)
}

return autocli.AppOptions{
Modules: modules,
ModuleOptions: runtimeservices.ExtractAutoCLIOptions(app.mm.Modules),
AddressCodec: authcodec.NewBech32Codec(sdk.GetConfig().GetBech32AccountAddrPrefix()),
ValidatorAddressCodec: authcodec.NewBech32Codec(sdk.GetConfig().GetBech32ValidatorAddrPrefix()),
ConsensusAddressCodec: authcodec.NewBech32Codec(sdk.GetConfig().GetBech32ConsensusAddrPrefix()),
Keyring: cliKR,
ClientCtx: initClientCtx,
}
}
Expand Down Expand Up @@ -615,6 +608,7 @@ func New(
app.AccountKeeper, scopedICAHostKeeper, app.MsgServiceRouter(),
authtypes.NewModuleAddress(adminmoduletypes.ModuleName).String(),
)
app.ICAHostKeeper.WithQueryRouter(app.GRPCQueryRouter())

app.ContractManagerKeeper = *contractmanagermodulekeeper.NewKeeper(
appCodec,
Expand Down Expand Up @@ -1141,7 +1135,6 @@ func New(

// initialize BaseApp
app.SetInitChainer(app.InitChainer)
app.SetPreBlocker(app.PreBlocker)
app.SetBeginBlocker(app.BeginBlocker)
app.SetEndBlocker(app.EndBlocker)

Expand Down Expand Up @@ -1296,6 +1289,8 @@ func New(
),
)

app.SetPreBlocker(app.oraclePreBlockHandler.WrappedPreBlocker(app.mm))

// Create the vote extensions handler that will be used to extend and verify
// vote extensions (i.e. oracle data).
veCodec := compression.NewCompressionVoteExtensionCodec(
Expand Down Expand Up @@ -1460,17 +1455,6 @@ func (app *App) Name() string { return app.BaseApp.Name() }
// GetBaseApp returns the base app of the application
func (app *App) GetBaseApp() *baseapp.BaseApp { return app.BaseApp }

// PreBlocker application updates every pre block
func (app *App) PreBlocker(ctx sdk.Context, req *abci.RequestFinalizeBlock) (*sdk.ResponsePreBlock, error) {
rsp, err := app.mm.PreBlock(ctx)
if err != nil {
return nil, err
}

_, err = app.oraclePreBlockHandler.PreBlocker()(ctx, req)
return rsp, err
}

// BeginBlocker application updates every begin block
func (app *App) BeginBlocker(ctx sdk.Context) (sdk.BeginBlock, error) {
return app.mm.BeginBlock(ctx)
Expand Down
6 changes: 3 additions & 3 deletions app/upgrades/v4.0.1/upgrades.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import (
"fmt"
"sort"

"github.com/skip-mev/slinky/cmd/constants/marketmaps"

appparams "github.com/neutron-org/neutron/v4/app/params"

"cosmossdk.io/errors"
Expand All @@ -28,8 +30,6 @@ import (
marketmapkeeper "github.com/skip-mev/slinky/x/marketmap/keeper"
marketmaptypes "github.com/skip-mev/slinky/x/marketmap/types"

slinkyconstants "github.com/skip-mev/slinky/cmd/constants"

"github.com/neutron-org/neutron/v4/app/upgrades"
)

Expand Down Expand Up @@ -204,7 +204,7 @@ func setFeeMarketParams(ctx sdk.Context, feemarketKeeper *feemarketkeeper.Keeper
}

func setMarketState(ctx sdk.Context, mmKeeper *marketmapkeeper.Keeper) error {
markets := marketMapToDeterministicallyOrderedMarkets(slinkyconstants.CoreMarketMap)
markets := marketMapToDeterministicallyOrderedMarkets(marketmaps.CoreMarketMap)
for _, market := range markets {
if err := mmKeeper.CreateMarket(ctx, market); err != nil {
return err
Expand Down
6 changes: 3 additions & 3 deletions app/upgrades/v4.0.1/upgrades_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import (
"sort"
"testing"

"github.com/skip-mev/slinky/cmd/constants/marketmaps"
marketmaptypes "github.com/skip-mev/slinky/x/marketmap/types"

slinkyconstants "github.com/skip-mev/slinky/cmd/constants"
slinkytypes "github.com/skip-mev/slinky/pkg/types"

upgradetypes "cosmossdk.io/x/upgrade/types"
Expand Down Expand Up @@ -44,7 +44,7 @@ func (suite *UpgradeTestSuite) TestOracleUpgrade() {
// we need to properly set consensus params for tests or we get a panic
suite.Require().NoError(app.ConsensusParamsKeeper.ParamsStore.Set(ctx, *oldParams.Params))

markets := slinkyconstants.CoreMarketMap.Markets
markets := marketmaps.CoreMarketMap.Markets
suite.Require().NoError(err)

upgrade := upgradetypes.Plan{
Expand All @@ -64,7 +64,7 @@ func (suite *UpgradeTestSuite) TestOracleUpgrade() {
mm, err := app.MarketMapKeeper.GetAllMarkets(ctx)
gotMM := marketmaptypes.MarketMap{Markets: mm}
suite.Require().NoError(err)
suite.Require().True(slinkyconstants.CoreMarketMap.Equal(gotMM))
suite.Require().True(marketmaps.CoreMarketMap.Equal(gotMM))

numCps, err := app.OracleKeeper.GetNumCurrencyPairs(ctx)
suite.Require().NoError(err)
Expand Down
2 changes: 0 additions & 2 deletions cmd/neutrond/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import (
"github.com/cosmos/cosmos-sdk/client/flags"
"github.com/cosmos/cosmos-sdk/client/keys"
"github.com/cosmos/cosmos-sdk/client/rpc"
"github.com/cosmos/cosmos-sdk/crypto/keyring"
"github.com/cosmos/cosmos-sdk/server"
servertypes "github.com/cosmos/cosmos-sdk/server/types"
"github.com/cosmos/cosmos-sdk/version"
Expand Down Expand Up @@ -126,7 +125,6 @@ func NewRootCmd() (*cobra.Command, params.EncodingConfig) {

autoCliOpts := tempApplication.AutoCliOpts()
initClientCtx, _ = config.ReadFromClientConfig(initClientCtx)
autoCliOpts.Keyring, _ = keyring.NewAutoCLIKeyring(initClientCtx.Keyring)
autoCliOpts.ClientCtx = initClientCtx

if err := autoCliOpts.EnhanceRootCommand(rootCmd); err != nil {
Expand Down
42 changes: 13 additions & 29 deletions docs/static/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15075,16 +15075,8 @@ definitions:
type: array
soft_opt_out_threshold:
title: >-
The threshold for the percentage of validators at the bottom of
the set who

can opt out of running the consumer chain without being punished.
For

example, a value of 0.05 means that the validators in the bottom
5% of the

set can opt out
!!! DEPRECATED !!! soft_opt_out_threshold is deprecated. see
docs/docs/adrs/adr-015-partial-set-security.md
type: string
transfer_timeout_period:
title: Sent transfer related IBC packets will timeout after this duration
Expand Down Expand Up @@ -15396,15 +15388,8 @@ definitions:
type: array
soft_opt_out_threshold:
title: >-
The threshold for the percentage of validators at the bottom of the
set who

can opt out of running the consumer chain without being punished. For

example, a value of 0.05 means that the validators in the bottom 5% of
the

set can opt out
!!! DEPRECATED !!! soft_opt_out_threshold is deprecated. see
docs/docs/adrs/adr-015-partial-set-security.md
type: string
transfer_timeout_period:
title: Sent transfer related IBC packets will timeout after this duration
Expand Down Expand Up @@ -15860,6 +15845,7 @@ definitions:
- GOOD_TIL_TIME
type: string
shares_cancelled:
title: 'TODO: remove this in next release. It is no longer used'
type: string
shares_owned:
type: string
Expand Down Expand Up @@ -16193,6 +16179,7 @@ definitions:
- GOOD_TIL_TIME
type: string
shares_cancelled:
title: 'TODO: remove this in next release. It is no longer used'
type: string
shares_owned:
type: string
Expand Down Expand Up @@ -16256,6 +16243,7 @@ definitions:
- GOOD_TIL_TIME
type: string
shares_cancelled:
title: 'TODO: remove this in next release. It is no longer used'
type: string
shares_owned:
type: string
Expand Down Expand Up @@ -16794,6 +16782,7 @@ definitions:
- GOOD_TIL_TIME
type: string
shares_cancelled:
title: 'TODO: remove this in next release. It is no longer used'
type: string
shares_owned:
type: string
Expand Down Expand Up @@ -38817,16 +38806,8 @@ paths:
type: array
soft_opt_out_threshold:
title: >-
The threshold for the percentage of validators at the
bottom of the set who

can opt out of running the consumer chain without being
punished. For

example, a value of 0.05 means that the validators in the
bottom 5% of the

set can opt out
!!! DEPRECATED !!! soft_opt_out_threshold is deprecated.
see docs/docs/adrs/adr-015-partial-set-security.md
type: string
transfer_timeout_period:
title: >-
Expand Down Expand Up @@ -41155,6 +41136,7 @@ paths:
- GOOD_TIL_TIME
type: string
shares_cancelled:
title: 'TODO: remove this in next release. It is no longer used'
type: string
shares_owned:
type: string
Expand Down Expand Up @@ -41263,6 +41245,7 @@ paths:
- GOOD_TIL_TIME
type: string
shares_cancelled:
title: 'TODO: remove this in next release. It is no longer used'
type: string
shares_owned:
type: string
Expand Down Expand Up @@ -42488,6 +42471,7 @@ paths:
- GOOD_TIL_TIME
type: string
shares_cancelled:
title: 'TODO: remove this in next release. It is no longer used'
type: string
shares_owned:
type: string
Expand Down
Loading

0 comments on commit 61ca7ce

Please sign in to comment.