Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/go_modules/github.com/hashicorp/g…
Browse files Browse the repository at this point in the history
…o-getter-1.7.5
  • Loading branch information
mergify[bot] authored Nov 4, 2024
2 parents 1798416 + 35cb072 commit e5e5bd7
Show file tree
Hide file tree
Showing 133 changed files with 9,478 additions and 1,232 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
if: env.GIT_DIFF
uses: actions/setup-go@v5
with:
go-version: '1.21.1'
go-version: '1.23'
cache: true
env:
GOOS: ${{ matrix.targetos }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/code-ql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.21.1'
go-go-version: '1.23'
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/debug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
steps:
- uses: actions/setup-go@v5
with:
go-version: '1.21.1'
go-go-version: '1.23'
cache: true

- uses: actions/checkout@v4
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
steps:
- uses: actions/setup-go@v5
with:
go-version: '1.21.1'
go-go-version: '1.23'
- uses: actions/checkout@v4
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
Expand All @@ -37,7 +37,7 @@ jobs:
# within `super-linter`.
fetch-depth: 0
- name: Run super-linter
uses: github/super-linter@v6
uses: github/super-linter@v7
env:
VALIDATE_ALL_CODEBASE: false
VALIDATE_MARKDOWN: true
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,21 @@ jobs:
fetch-depth: 0
- uses: actions/setup-go@v5
with:
go-version: '1.21.1'
go-go-version: '1.23'
cache: true

- name: Set Env
run: echo "TM_VERSION=$(go list -m github.com/cometbft/cometbft | sed 's:.* ::')" >> $GITHUB_ENV
- name: Build
uses: goreleaser/goreleaser-action@v5
uses: goreleaser/goreleaser-action@v6
if: github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'Enable:ReleaseBuild')
with:
version: latest
args: build --rm-dist --skip-validate # skip validate skips initial sanity checks in order to be able to fully run
env:
TM_VERSION: ${{ env.TM_VERSION }}
- name: Release
uses: goreleaser/goreleaser-action@v5
uses: goreleaser/goreleaser-action@v6
if: startsWith(github.ref, 'refs/tags/')
with:
version: latest
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/simulations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
steps:
- uses: actions/setup-go@v5
with:
go-version: '1.21.1'
go-go-version: '1.23'

- name: Install runsim
run: export GO111MODULE="on" && go install github.com/cosmos/tools/cmd/[email protected]
Expand All @@ -38,7 +38,7 @@ jobs:
- uses: actions/setup-go@v5
if: env.GIT_DIFF
with:
go-version: '1.21.1'
go-go-version: '1.23'
cache: true
- name: Test application non-determinism
if: env.GIT_DIFF
Expand All @@ -60,7 +60,7 @@ jobs:
- uses: actions/setup-go@v5
if: env.GIT_DIFF
with:
go-version: '1.21.1'
go-go-version: '1.23'
cache: true
- uses: actions/cache@v4
if: env.GIT_DIFF
Expand All @@ -87,7 +87,7 @@ jobs:
- uses: actions/setup-go@v5
if: env.GIT_DIFF
with:
go-version: '1.21.1'
go-go-version: '1.23'
cache: true
- uses: actions/cache@v4
if: env.GIT_DIFF
Expand All @@ -113,7 +113,7 @@ jobs:
- uses: actions/setup-go@v5
if: env.GIT_DIFF
with:
go-version: '1.21.1'
go-go-version: '1.23'
cache: true
- uses: actions/cache@v4
if: env.GIT_DIFF
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
steps:
- uses: actions/setup-go@v5
with:
go-version: '1.21.1'
go-go-version: '1.23'
- name: Display Go Version
run: go version
- uses: actions/cache@v4
Expand All @@ -38,7 +38,7 @@ jobs:
- uses: actions/setup-go@v5
if: env.GIT_DIFF
with:
go-version: '1.21.1'
go-go-version: '1.23'
cache: true
- name: Test and Create Coverage Report
if: env.GIT_DIFF
Expand Down Expand Up @@ -100,7 +100,7 @@ jobs:
- uses: actions/setup-go@v5
if: env.GIT_DIFF
with:
go-version: '1.21.1'
go-go-version: '1.23'
cache: true

- name: Test E2E
Expand Down
6 changes: 3 additions & 3 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
run:
tests: false
skip-dirs:
- tests/simulation

govet:
# Enable analyzers by name (in addition to default).
Expand All @@ -19,9 +17,9 @@ linters:
# - wsl
- asciicheck
- bodyclose
- copyloopvar
- dogsled
- errcheck
- exportloopref
- goconst
- gocritic
- gofmt
Expand Down Expand Up @@ -62,6 +60,8 @@ issues:
- text: "SA1019: \"github.com/cosmos/ibc-go/v8/modules/core/02-client/types\" is deprecated"
linters:
- staticcheck
exclude-dirs:
- tests/simulation
max-same-issues: 50

linters-settings:
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Builder
FROM golang:1.21.1-alpine AS builder
FROM golang:1.23-alpine AS builder

RUN apk add --no-cache \
ca-certificates \
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ $ make install
Example command structure for running a node with a price feeder config file located at `./price-feeder.example.config` (See [price-feeder](https://github.com/ojo-network/price-feeder) repo for more information on configuring an Ojo price feeder)

```shell
$ ojod start --pricefeeder.config_path=./price-feeder.example.config --pricefeeder.log_level="INFO" --pricefeeder.chain_config=TRUE --pricefeeder.oracle_tick_time=5s
$ ojod start --pricefeeder.config_path=./price-feeder.example.config --pricefeeder.log_level="INFO"
```

## Networks
Expand Down
3 changes: 2 additions & 1 deletion ante/fee.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"

appparams "github.com/ojo-network/ojo/app/params"
"github.com/ojo-network/ojo/util"
oracletypes "github.com/ojo-network/ojo/x/oracle/types"
)

Expand Down Expand Up @@ -57,7 +58,7 @@ func checkFees(minGasPrices sdk.DecCoins, fees sdk.Coins, gasLimit uint64) error
// Determine the required fees by multiplying each required minimum gas
// price by the gas limit, where fee = ceil(minGasPrice * gasLimit).
// Zero fees are removed.
glDec := math.LegacyNewDec(int64(gasLimit))
glDec := math.LegacyNewDec(util.SafeUint64ToInt64(gasLimit))
for _, gp := range minGasPrices {
if gasLimit == 0 || gp.IsZero() {
continue
Expand Down
52 changes: 31 additions & 21 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ import (
ibctransferkeeper "github.com/cosmos/ibc-go/v8/modules/apps/transfer/keeper"
ibctransfertypes "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types"
ibc "github.com/cosmos/ibc-go/v8/modules/core"
ibcclienttypes "github.com/cosmos/ibc-go/v8/modules/core/02-client/types"
ibcconnectiontypes "github.com/cosmos/ibc-go/v8/modules/core/03-connection/types"
ibcporttypes "github.com/cosmos/ibc-go/v8/modules/core/05-port/types"
ibcexported "github.com/cosmos/ibc-go/v8/modules/core/exported"
ibckeeper "github.com/cosmos/ibc-go/v8/modules/core/keeper"
Expand All @@ -115,11 +117,14 @@ import (
gmpkeeper "github.com/ojo-network/ojo/x/gmp/keeper"
gmptypes "github.com/ojo-network/ojo/x/gmp/types"

"github.com/ojo-network/ojo/x/gasestimate"
gasestimatekeeper "github.com/ojo-network/ojo/x/gasestimate/keeper"
gasestimatetypes "github.com/ojo-network/ojo/x/gasestimate/types"

"github.com/ojo-network/ojo/x/airdrop"
airdropkeeper "github.com/ojo-network/ojo/x/airdrop/keeper"
airdroptypes "github.com/ojo-network/ojo/x/airdrop/types"

"github.com/ojo-network/ojo/pricefeeder"
oracleabci "github.com/ojo-network/ojo/x/oracle/abci"

customante "github.com/ojo-network/ojo/ante"
Expand All @@ -144,6 +149,7 @@ var (
ibctransfertypes.ModuleName: {authtypes.Minter, authtypes.Burner},
oracletypes.ModuleName: {authtypes.Minter},
gmptypes.ModuleName: {authtypes.Minter},
gasestimatetypes.ModuleName: {authtypes.Burner},
airdroptypes.ModuleName: {authtypes.Minter},
}
)
Expand Down Expand Up @@ -200,6 +206,7 @@ type App struct {
GroupKeeper groupkeeper.Keeper
OracleKeeper oraclekeeper.Keeper
GmpKeeper gmpkeeper.Keeper
GasEstimateKeeper gasestimatekeeper.Keeper
AirdropKeeper airdropkeeper.Keeper
ConsensusParamsKeeper consensusparamkeeper.Keeper

Expand All @@ -219,8 +226,6 @@ type App struct {

// module configurator
configurator module.Configurator

PriceFeeder *pricefeeder.PriceFeeder
}

// New returns a reference to an initialized blockchain app
Expand Down Expand Up @@ -265,7 +270,7 @@ func New(
govtypes.StoreKey, paramstypes.StoreKey, ibcexported.StoreKey, upgradetypes.StoreKey,
feegrant.StoreKey, evidencetypes.StoreKey, ibctransfertypes.StoreKey, capabilitytypes.StoreKey,
consensusparamtypes.StoreKey, group.StoreKey, oracletypes.StoreKey, gmptypes.StoreKey,
airdroptypes.StoreKey,
gasestimatetypes.ModuleName, airdroptypes.StoreKey,
)
tkeys := storetypes.NewTransientStoreKeys(paramstypes.TStoreKey)
memKeys := storetypes.NewMemoryStoreKeys(capabilitytypes.MemStoreKey)
Expand Down Expand Up @@ -410,6 +415,12 @@ func New(
authtypes.NewModuleAddress(govtypes.ModuleName).String(),
)

app.GasEstimateKeeper = gasestimatekeeper.NewKeeper(
appCodec,
keys[gasestimatetypes.ModuleName],
authtypes.NewModuleAddress(govtypes.ModuleName).String(),
)

app.OracleKeeper = oraclekeeper.NewKeeper(
appCodec,
keys[oracletypes.ModuleName],
Expand All @@ -418,6 +429,7 @@ func New(
app.BankKeeper,
app.DistrKeeper,
app.StakingKeeper,
app.GasEstimateKeeper,
distrtypes.ModuleName,
cast.ToBool(appOpts.Get("telemetry.enabled")),
authtypes.NewModuleAddress(govtypes.ModuleName).String(),
Expand All @@ -429,6 +441,8 @@ func New(
app.OracleKeeper,
authtypes.NewModuleAddress(govtypes.ModuleName).String(),
app.TransferKeeper,
app.BankKeeper,
app.GasEstimateKeeper,
)

app.AirdropKeeper = airdropkeeper.NewKeeper(
Expand Down Expand Up @@ -581,6 +595,7 @@ func New(
ibctm.NewAppModule(),
oracle.NewAppModule(appCodec, app.OracleKeeper, app.AccountKeeper, app.BankKeeper),
gmp.NewAppModule(appCodec, app.GmpKeeper, app.OracleKeeper),
gasestimate.NewAppModule(appCodec, app.GasEstimateKeeper),
airdrop.NewAppModule(appCodec, app.AirdropKeeper, app.AccountKeeper, app.BankKeeper),
consensus.NewAppModule(appCodec, app.ConsensusParamsKeeper),
)
Expand Down Expand Up @@ -632,6 +647,7 @@ func New(
vestingtypes.ModuleName,
oracletypes.ModuleName,
gmptypes.ModuleName,
gasestimatetypes.ModuleName,
airdroptypes.ModuleName,
consensusparamtypes.ModuleName,
)
Expand All @@ -658,6 +674,7 @@ func New(
vestingtypes.ModuleName,
oracletypes.ModuleName,
gmptypes.ModuleName,
gasestimatetypes.ModuleName,
airdroptypes.ModuleName,
consensusparamtypes.ModuleName,
)
Expand All @@ -673,7 +690,8 @@ func New(
minttypes.ModuleName, crisistypes.ModuleName, genutiltypes.ModuleName, ibctransfertypes.ModuleName,
ibcexported.ModuleName, evidencetypes.ModuleName, authz.ModuleName, feegrant.ModuleName,
group.ModuleName, paramstypes.ModuleName, upgradetypes.ModuleName, vestingtypes.ModuleName,
oracletypes.ModuleName, gmptypes.ModuleName, airdroptypes.ModuleName, consensusparamtypes.ModuleName,
oracletypes.ModuleName, gmptypes.ModuleName, gasestimatetypes.ModuleName,
airdroptypes.ModuleName, consensusparamtypes.ModuleName,
}
app.mm.SetOrderInitGenesis(genesisModuleOrder...)
app.mm.SetOrderExportGenesis(genesisModuleOrder...)
Expand Down Expand Up @@ -736,18 +754,9 @@ func New(
app.SetPrepareProposal(proposalHandler.PrepareProposalHandler())
app.SetProcessProposal(proposalHandler.ProcessProposalHandler())

preBlockHandler := oracleabci.NewPreBlockHandler(
app.Logger(),
app.OracleKeeper,
)
app.SetPreBlocker(preBlockHandler.PreBlocker())

// initialize empty price feeder object to pass reference into vote extension handler
app.PriceFeeder = &pricefeeder.PriceFeeder{}
voteExtensionsHandler := oracleabci.NewVoteExtensionHandler(
app.Logger(),
app.OracleKeeper,
app.PriceFeeder,
)
app.SetExtendVoteHandler(voteExtensionsHandler.ExtendVoteHandler())
app.SetVerifyVoteExtensionHandler(voteExtensionsHandler.VerifyVoteExtensionHandler())
Expand All @@ -759,6 +768,7 @@ func New(

// initialize BaseApp
app.SetInitChainer(app.InitChainer)
app.SetPreBlocker(app.PreBlocker)
app.SetBeginBlocker(app.BeginBlocker)
app.SetEndBlocker(app.EndBlocker)
app.setAnteHandler(txConfig)
Expand All @@ -781,11 +791,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, _ *abci.RequestFinalizeBlock) (*sdk.ResponsePreBlock, error) {
return app.mm.PreBlock(ctx)
}

// BeginBlocker application updates every begin block
func (app *App) BeginBlocker(ctx sdk.Context) (sdk.BeginBlock, error) {
return app.mm.BeginBlock(ctx)
Expand Down Expand Up @@ -1004,9 +1009,14 @@ func initParamsKeeper(
paramsKeeper.Subspace(slashingtypes.ModuleName)
paramsKeeper.Subspace(govtypes.ModuleName)
paramsKeeper.Subspace(crisistypes.ModuleName)
paramsKeeper.Subspace(ibctransfertypes.ModuleName)
paramsKeeper.Subspace(ibcexported.ModuleName)
paramsKeeper.Subspace(oracletypes.ModuleName)
paramsKeeper.Subspace(gasestimatetypes.ModuleName)

// register the key tables for legacy param subspaces
keyTable := ibcclienttypes.ParamKeyTable()
keyTable.RegisterParamSet(&ibcconnectiontypes.Params{})
paramsKeeper.Subspace(ibcexported.ModuleName).WithKeyTable(keyTable)
paramsKeeper.Subspace(ibctransfertypes.ModuleName).WithKeyTable(ibctransfertypes.ParamKeyTable())

return paramsKeeper
}
Expand Down
Loading

0 comments on commit e5e5bd7

Please sign in to comment.