Skip to content

Commit

Permalink
Merge branch 'main' into rp/goreleaser-cross
Browse files Browse the repository at this point in the history
  • Loading branch information
rootulp committed Dec 1, 2023
2 parents 698667f + c119b8f commit 5c73240
Show file tree
Hide file tree
Showing 39 changed files with 2,459 additions and 863 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
go.sum
- uses: golangci/[email protected]
with:
version: v1.54.2
version: v1.55.2
args: --timeout 10m
github-token: ${{ secrets.github_token }}
if: env.GIT_DIFF
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ This repo attempts to conform to [conventional commits](https://www.conventional
### Tools
1. Install [golangci-lint](https://golangci-lint.run/usage/install/)
1. Install [golangci-lint](https://golangci-lint.run/usage/install/) 1.55.2
1. Install [markdownlint](https://github.com/DavidAnson/markdownlint)
1. Install [hadolint](https://github.com/hadolint/hadolint)
1. Install [yamllint](https://yamllint.readthedocs.io/en/stable/quickstart.html)
Expand Down
34 changes: 21 additions & 13 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
mintkeeper "github.com/celestiaorg/celestia-app/x/mint/keeper"
minttypes "github.com/celestiaorg/celestia-app/x/mint/types"
"github.com/celestiaorg/celestia-app/x/upgrade"
upgradetypes "github.com/celestiaorg/celestia-app/x/upgrade/types"
"github.com/cosmos/cosmos-sdk/baseapp"
"github.com/cosmos/cosmos-sdk/client"
nodeservice "github.com/cosmos/cosmos-sdk/client/grpc/node"
Expand Down Expand Up @@ -85,6 +86,7 @@ import (
"github.com/celestiaorg/celestia-app/app/ante"
"github.com/celestiaorg/celestia-app/app/encoding"
"github.com/celestiaorg/celestia-app/pkg/appconsts"
v1 "github.com/celestiaorg/celestia-app/pkg/appconsts/v1"
v2 "github.com/celestiaorg/celestia-app/pkg/appconsts/v2"
"github.com/celestiaorg/celestia-app/pkg/proof"
blobmodule "github.com/celestiaorg/celestia-app/x/blob"
Expand Down Expand Up @@ -155,11 +157,12 @@ var (
vesting.AppModuleBasic{},
blobmodule.AppModuleBasic{},
bsmodule.AppModuleBasic{},
upgrade.AppModuleBasic{},
)

// ModuleEncodingRegisters keeps track of all the module methods needed to
// register interfaces and specific type to encoding config
ModuleEncodingRegisters = extractRegisters(ModuleBasics, upgrade.TypeRegister{})
ModuleEncodingRegisters = extractRegisters(ModuleBasics)

// module account permissions
maccPerms = map[string][]string{
Expand Down Expand Up @@ -267,9 +270,8 @@ func New(
keys := sdk.NewKVStoreKeys(
authtypes.StoreKey, authzkeeper.StoreKey, banktypes.StoreKey, stakingtypes.StoreKey,
minttypes.StoreKey, distrtypes.StoreKey, slashingtypes.StoreKey,
govtypes.StoreKey, paramstypes.StoreKey, upgrade.StoreKey, feegrant.StoreKey,
govtypes.StoreKey, paramstypes.StoreKey, upgradetypes.StoreKey, feegrant.StoreKey,
evidencetypes.StoreKey, capabilitytypes.StoreKey,
blobmoduletypes.StoreKey,
bsmoduletypes.StoreKey,
ibctransfertypes.StoreKey,
ibchost.StoreKey,
Expand Down Expand Up @@ -333,7 +335,7 @@ func New(
)

app.FeeGrantKeeper = feegrantkeeper.NewKeeper(appCodec, keys[feegrant.StoreKey], app.AccountKeeper)
app.UpgradeKeeper = upgrade.NewKeeper(keys[upgrade.StoreKey], upgradeHeight)
app.UpgradeKeeper = upgrade.NewKeeper(keys[upgradetypes.StoreKey], upgradeHeight, app.StakingKeeper)

app.BlobstreamKeeper = *bsmodulekeeper.NewKeeper(
appCodec,
Expand Down Expand Up @@ -399,8 +401,6 @@ func New(

app.BlobKeeper = *blobmodulekeeper.NewKeeper(
appCodec,
keys[blobmoduletypes.StoreKey],
keys[blobmoduletypes.MemStoreKey],
app.GetSubspace(blobmoduletypes.ModuleName),
)
blobmod := blobmodule.NewAppModule(appCodec, app.BlobKeeper)
Expand Down Expand Up @@ -442,6 +442,7 @@ func New(
transferModule,
blobmod,
bsmod,
upgrade.NewAppModule(app.UpgradeKeeper),
)

// During begin block slashing happens after distr.BeginBlocker so that
Expand All @@ -468,7 +469,7 @@ func New(
paramstypes.ModuleName,
authz.ModuleName,
vestingtypes.ModuleName,
upgrade.ModuleName,
upgradetypes.ModuleName,
)

app.mm.SetOrderEndBlockers(
Expand All @@ -491,7 +492,7 @@ func New(
paramstypes.ModuleName,
authz.ModuleName,
vestingtypes.ModuleName,
upgrade.ModuleName,
upgradetypes.ModuleName,
)

// NOTE: The genutils module must occur after staking so that pools are
Expand Down Expand Up @@ -519,7 +520,7 @@ func New(
feegrant.ModuleName,
paramstypes.ModuleName,
authz.ModuleName,
upgrade.ModuleName,
upgradetypes.ModuleName,
)

app.QueryRouter().AddRoute(proof.TxInclusionQueryPath, proof.QueryTxInclusionProof)
Expand Down Expand Up @@ -573,10 +574,17 @@ func (app *App) BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock) abci.R
// EndBlocker application updates every end block
func (app *App) EndBlocker(ctx sdk.Context, req abci.RequestEndBlock) abci.ResponseEndBlock {
res := app.mm.EndBlock(ctx, req)
// NOTE: this is a specific feature for upgrading to v2 as v3 and onward is expected
// to be coordinated through the signalling protocol
if app.UpgradeKeeper.ShouldUpgrade(req.Height) {
app.SetAppVersion(ctx, v2.Version)
// NOTE: this is a specific feature for upgrading from v1 to v2. It will be deprecated in v3
if app.UpgradeKeeper.ShouldUpgradeToV2(req.Height) {
if app.AppVersion(ctx) == v1.Version {
app.SetAppVersion(ctx, v2.Version)
}
// from v2 to v3 and onwards we use a signalling mechanism
} else if shouldUpgrade, version := app.UpgradeKeeper.ShouldUpgrade(); shouldUpgrade {
// Version changes must be increasing. Downgrades are not permitted
if version > app.AppVersion(ctx) {
app.SetAppVersion(ctx, version)
}
}
return res
}
Expand Down
2 changes: 1 addition & 1 deletion app/test/block_production_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package app
package app_test

import (
"testing"
Expand Down
Loading

0 comments on commit 5c73240

Please sign in to comment.