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

feat: prototype versioned app module upgrades #3729

Draft
wants to merge 133 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
133 commits
Select commit Hold shift + click to select a range
43dedfa
wip: multiplexer
rootulp Jul 19, 2024
3e23254
feat: delegate to current app
rootulp Jul 22, 2024
26eb806
refactor: rename var
rootulp Jul 22, 2024
ecb8d3e
refactor: rename
rootulp Jul 22, 2024
6f191ca
chore: add compile-time checks
rootulp Jul 24, 2024
6b08045
error
rootulp Jul 24, 2024
d96731f
make cmd to build binary
rootulp Jul 24, 2024
44661b3
try to use testnode start node
rootulp Jul 24, 2024
9e09257
go mod tidy
rootulp Jul 24, 2024
c6f0672
use fork of errors package
rootulp Jul 24, 2024
ee9c442
use error version with newlines
rootulp Jul 24, 2024
3242f20
fix make command
rootulp Jul 24, 2024
80a0653
workaround for init()
rootulp Jul 24, 2024
03519a9
feat: go mod for x/blob
rootulp Jul 31, 2024
d70cdeb
fix: use rootulp
rootulp Jul 31, 2024
c8e2b97
fix: imports
rootulp Jul 31, 2024
1b38c5b
feat: new go mod for x/blob
rootulp Jul 31, 2024
162a591
wip: error because ambiguous import
rootulp Aug 1, 2024
34fdad5
comments
rootulp Aug 2, 2024
c8abd64
feat: remove x/blob in favor of rootulp/blob
rootulp Aug 2, 2024
bf454e9
Revert "feat: remove x/blob in favor of rootulp/blob"
rootulp Aug 2, 2024
835a92b
Revert "comments"
rootulp Aug 2, 2024
f0c3b61
Revert "wip: error because ambiguous import"
rootulp Aug 2, 2024
8639f23
Revert "feat: new go mod for x/blob"
rootulp Aug 2, 2024
0afbc2a
Revert "fix: imports"
rootulp Aug 2, 2024
dd23cb9
Revert "fix: use rootulp"
rootulp Aug 2, 2024
c8171b8
Revert "feat: go mod for x/blob"
rootulp Aug 2, 2024
537b1e3
test passes if only 1 app is initialized
rootulp Aug 2, 2024
f6e0157
fix: passing unit test by bumping proto package version
rootulp Aug 2, 2024
73871d0
test: can initialize 2 apps at the same time
rootulp Aug 2, 2024
f94e56f
fails b/c context cancelled
rootulp Aug 3, 2024
a2f5a23
wip: context still cancelled prematurely
rootulp Aug 4, 2024
7e6032b
refactor: newCometNode
rootulp Aug 4, 2024
09b872e
refactor: node interaction api
rootulp Aug 4, 2024
140c8ab
fix: client context cancelled
rootulp Aug 4, 2024
23d590f
panic: leveldb: closed
rootulp Aug 4, 2024
f9cfb87
wip: try to create node from scratch
rootulp Aug 4, 2024
02fe6e1
Revert "wip: try to create node from scratch"
rootulp Aug 4, 2024
084d0e5
add comments
rootulp Aug 6, 2024
d089207
enable debug logs
rootulp Aug 6, 2024
393698c
refactor: use temp dir
rootulp Aug 7, 2024
4e758c2
debug: attempt to bind to specific ports
rootulp Aug 7, 2024
6cdc4f5
wip: refactor testnode package
rootulp Aug 7, 2024
fc37118
fix: stop filtering to just errors
rootulp Aug 7, 2024
ca6dd0d
issue is with multiplexer app
rootulp Aug 7, 2024
fbe9a2e
error: panic: leveldb: closed
rootulp Aug 7, 2024
2becb82
still: panic: leveldb: closed
rootulp Aug 7, 2024
3ef359e
still panic
rootulp Aug 7, 2024
f842f17
fix: stop cleaning up node
rootulp Aug 7, 2024
3ed4310
refactor: remove unnecessary rootDir
rootulp Aug 7, 2024
af59529
bug: not progressing past block height 0
rootulp Aug 7, 2024
f67284b
Revert "bug: not progressing past block height 0"
rootulp Aug 7, 2024
057ebcd
Revert "refactor: remove unnecessary rootDir"
rootulp Aug 7, 2024
f087316
fix: logger
rootulp Aug 7, 2024
d9bf079
refactor: clean up
rootulp Aug 7, 2024
f4cb007
wip
rootulp Aug 8, 2024
2fc392c
refactor: remove API server
rootulp Aug 9, 2024
a253034
HACKHACK: passing test
rootulp Aug 9, 2024
fbca2b5
fix: test by waiting for block height > 0
rootulp Aug 9, 2024
b063614
feat: pair w/ Callum
rootulp Aug 9, 2024
3fb927f
refactor: multiplexer nextAppVersion
rootulp Aug 9, 2024
75714fa
refactor: GetApplications
rootulp Aug 9, 2024
b64af99
refactor: unexport const
rootulp Aug 9, 2024
6438131
refactor: move test
rootulp Aug 9, 2024
5a5d496
wip: attempt to use v1 app with hard-coded upgrade height
rootulp Aug 9, 2024
94b1220
failing test
rootulp Aug 9, 2024
90bc71f
chore: upgrade to fork that prints more logs
rootulp Aug 9, 2024
95d06c7
refactor: clean up rootDir
rootulp Aug 9, 2024
6a2ed91
premature upgrade
rootulp Aug 9, 2024
dad7391
these logs helped
rootulp Aug 9, 2024
094c8e2
check for nil
rootulp Aug 9, 2024
8dd8259
more logs
rootulp Aug 9, 2024
fab168b
implement failing check
rootulp Aug 9, 2024
92be05c
v1 state machine is initChained with v2
rootulp Aug 9, 2024
55a4c3d
fix: start v1 state machine with v1 consensus param
rootulp Aug 9, 2024
139bde4
wip: cosmos-sdk is overwriting the consensus param updates
rootulp Aug 10, 2024
548d412
v2 state machine does not have params
rootulp Aug 10, 2024
53e5592
wip: RunMigrations interface
rootulp Aug 10, 2024
3fbef6a
wip: RunMigrations
rootulp Aug 10, 2024
9917b0a
bump to latest v1.x celestia-app that uses cosmos-sdk fork with RunMi…
rootulp Aug 10, 2024
6c9fbcc
crazy error for go imports
rootulp Aug 10, 2024
61480ad
wip: try again with interface
rootulp Aug 10, 2024
8ebabb7
feat: RunMigrations
rootulp Aug 10, 2024
9a7c0fa
attempt to fix nil panic
rootulp Aug 10, 2024
3cc0417
add log
rootulp Aug 12, 2024
e710924
bump to v1.33.0 with more logs
rootulp Aug 12, 2024
87e9e81
clean up method order
rootulp Aug 13, 2024
fca5307
emit logs for apps
rootulp Aug 13, 2024
4c450e6
wip: get/set commit multi store
rootulp Aug 13, 2024
8b7a64b
new error
rootulp Aug 13, 2024
ede5f3e
let v2 state machine handle v1 -> v2
rootulp Aug 13, 2024
e6a3c90
let v2 upgrade to v3 based on hard-coded flag
rootulp Aug 13, 2024
f3bb95d
cleanup
rootulp Aug 13, 2024
bef55d2
import app v3
rootulp Aug 13, 2024
80408d9
make modules support v3
rootulp Aug 13, 2024
bf5d067
attempt to create v3 app only when needed
rootulp Aug 13, 2024
9a576a0
remove unneeded RunMigrations
rootulp Aug 13, 2024
5ea48de
feat: share DB for all state machines
rootulp Aug 14, 2024
3f787ce
store does not exist for key: capability
rootulp Aug 14, 2024
3627aff
refactor: remove rootDir
rootulp Aug 14, 2024
d5495cb
auth key does not exist either
rootulp Aug 14, 2024
cc56704
explicitly setting rootDir does not resolve
rootulp Aug 14, 2024
55e74b0
enable debug logs for CometBFT
rootulp Aug 14, 2024
df47ab0
"kv store with key KVStoreKey{0x1400466f4b0, capability} has not been…
rootulp Aug 14, 2024
f71d1a2
delete root dir
rootulp Aug 14, 2024
8bf36bf
working prototype!
rootulp Aug 15, 2024
da51aea
move comment
rootulp Aug 15, 2024
8380d0e
prevent accidental downgrade from v3 -> v2
rootulp Aug 15, 2024
88f7fa5
no need to call info b/c v3 does not need to support v1 and v2
rootulp Aug 15, 2024
c8fb333
improve logs
rootulp Aug 15, 2024
3fe3996
chore: remove log
rootulp Aug 15, 2024
e30354e
revert go.mod changes
rootulp Aug 15, 2024
2f94921
feat: remove things from AppWithMigrations interface
rootulp Aug 15, 2024
3f81028
revert: remove v3 upgrade height
rootulp Aug 15, 2024
31d326a
revert: remove cms
rootulp Aug 15, 2024
94e1076
revert: variable rename
rootulp Aug 15, 2024
09950e4
add TODO
rootulp Aug 15, 2024
310e522
revert: variable rename
rootulp Aug 15, 2024
31f2e6f
refactor: remove unnecessary function
rootulp Aug 15, 2024
af3eda9
remove comments for me
rootulp Aug 15, 2024
acfdf66
refactor: inline func
rootulp Aug 15, 2024
0463d31
revert: remove logs
rootulp Aug 15, 2024
3469eb1
remove log
rootulp Aug 15, 2024
9224788
revert: extract testnode refactors to separate PR
rootulp Aug 15, 2024
0705a50
Merge branch 'main' into rp/prototype-multi-app
rootulp Aug 15, 2024
ea5ae42
fix: app
rootulp Aug 15, 2024
5cd7c24
fix: node
rootulp Aug 15, 2024
374df1e
feat: make app.go do v3 stuff
rootulp Aug 15, 2024
3a0c498
fix: make signal protos not conflict
rootulp Aug 16, 2024
6b47f0e
revert unnecessary replace
rootulp Aug 16, 2024
9e14799
refactor: multiplexer logger
rootulp Aug 16, 2024
e720578
resolve: config.Seal() conflict by conditionally sealing
rootulp Aug 16, 2024
28c8edd
avoid duplicate proto registry for signal types
rootulp Aug 16, 2024
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
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,5 @@ square/testdata
**/*.DS_Store
vendor
go.work
go.work.sum
go.work.sum
node/node
8 changes: 8 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -212,3 +212,11 @@ prebuilt-binary:
ghcr.io/goreleaser/goreleaser-cross:${GOLANG_CROSS_VERSION} \
release --clean
.PHONY: prebuilt-binary

## build-node: Build the node binary.
build-node:
@echo "--> Building celestia-app/node and outputting binary to build/node"
@mkdir -p build/
@cd ./node && go build -o ../build/node .
@go mod tidy
.PHONY: build-node
63 changes: 21 additions & 42 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ import (
mintkeeper "github.com/celestiaorg/celestia-app/v3/x/mint/keeper"
minttypes "github.com/celestiaorg/celestia-app/v3/x/mint/types"
"github.com/celestiaorg/celestia-app/v3/x/paramfilter"
"github.com/celestiaorg/celestia-app/v3/x/signal"
signaltypes "github.com/celestiaorg/celestia-app/v3/x/signal/types"
"github.com/celestiaorg/celestia-app/v3/x/tokenfilter"
"github.com/celestiaorg/celestia-app/x/signal"
signaltypes "github.com/celestiaorg/celestia-app/x/signal/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 @@ -172,8 +172,7 @@ type App struct {
MsgGateKeeper *ante.MsgVersioningGateKeeper
}

// New returns a reference to an uninitialized app. Callers must subsequently
// call app.Info or app.InitChain to initialize the baseapp.
// New returns a reference to an initialized app.
//
// NOTE: upgradeHeightV2 refers specifically to the height that a node will
// upgrade from v1 to v2. It will be deprecated in v3 in place for a dynamically
Expand All @@ -184,7 +183,7 @@ func New(
traceStore io.Writer,
invCheckPeriod uint,
encodingConfig encoding.Config,
upgradeHeightV2 int64,
upgradeHeightV2 int64, // TODO: remove this param
appOpts servertypes.AppOptions,
baseAppOptions ...func(*baseapp.BaseApp),
) *App {
Expand Down Expand Up @@ -437,6 +436,14 @@ func New(
tmos.Exit(err.Error())
}

height := app.LastBlockHeight()
ctx, err := app.CreateQueryContext(height, false)
if err != nil {
panic(err)
}
app.SetAppVersion(ctx, v3)
app.mountKeysAndInit(3)

return app
}

Expand All @@ -455,22 +462,9 @@ func (app *App) BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock) abci.R
func (app *App) EndBlocker(ctx sdk.Context, req abci.RequestEndBlock) abci.ResponseEndBlock {
res := app.manager.EndBlock(ctx, req)
currentVersion := app.AppVersion()
// For v1 only we upgrade using a agreed upon height known ahead of time
if currentVersion == v1 {
// check that we are at the height before the upgrade
if req.Height == app.upgradeHeightV2-1 {
app.BaseApp.Logger().Info(fmt.Sprintf("upgrading from app version %v to 2", currentVersion))
app.SetInitialAppVersionInConsensusParams(ctx, v2)
app.SetAppVersion(ctx, v2)

// The blobstream module was disabled in v2 so the following line
// removes the params subspace for blobstream.
if err := app.ParamsKeeper.DeleteSubspace(blobstreamtypes.ModuleName); err != nil {
panic(err)
}
}
// from v2 to v3 and onwards we use a signalling mechanism
} else if shouldUpgrade, newVersion := app.SignalKeeper.ShouldUpgrade(ctx); shouldUpgrade {

// from v3 onwards we use a signalling mechanism
if shouldUpgrade, newVersion := app.SignalKeeper.ShouldUpgrade(ctx); shouldUpgrade {
// Version changes must be increasing. Downgrades are not permitted
if newVersion > currentVersion {
app.SetAppVersion(ctx, newVersion)
Expand Down Expand Up @@ -511,35 +505,16 @@ func (app *App) migrateModules(ctx sdk.Context, fromVersion, toVersion uint64) e
// Info implements the ABCI interface. This method is a wrapper around baseapp's
// Info command so that it can take the app version and setup the multicommit
// store.
//
// Side-effect: calls baseapp.Init()
func (app *App) Info(req abci.RequestInfo) abci.ResponseInfo {
if height := app.LastBlockHeight(); height > 0 {
ctx, err := app.CreateQueryContext(height, false)
if err != nil {
panic(err)
}
appVersion := app.GetAppVersionFromParamStore(ctx)
if appVersion > 0 {
app.SetAppVersion(ctx, appVersion)
} else {
app.SetAppVersion(ctx, v1)
}
}

resp := app.BaseApp.Info(req)
// mount the stores for the provided app version
if resp.AppVersion > 0 && !app.IsSealed() {
app.mountKeysAndInit(resp.AppVersion)
}
return resp
return app.BaseApp.Info(req)
}

// InitChain implements the ABCI interface. This method is a wrapper around
// baseapp's InitChain so we can take the app version and setup the multicommit
// store.
//
// Side-effect: calls baseapp.Init()
// TODO: refactor this method because it no longer needs to support initializing a chain with an app version that isn't 3.
func (app *App) InitChain(req abci.RequestInitChain) (res abci.ResponseInitChain) {
// genesis must always contain the consensus params. The validator set however is derived from the
// initial genesis state. The genesis must always contain a non zero app version which is the initial
Expand Down Expand Up @@ -784,3 +759,7 @@ func (app *App) InitializeAppVersion(ctx sdk.Context) {
app.SetAppVersion(ctx, appVersion)
}
}

func (app *App) RunMigrations() []byte {
return []byte{}
}
13 changes: 0 additions & 13 deletions app/config.go

This file was deleted.

4 changes: 2 additions & 2 deletions app/module/configurator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"github.com/celestiaorg/celestia-app/v3/app"
"github.com/celestiaorg/celestia-app/v3/app/encoding"
"github.com/celestiaorg/celestia-app/v3/app/module"
"github.com/celestiaorg/celestia-app/v3/x/signal"
signaltypes "github.com/celestiaorg/celestia-app/v3/x/signal/types"
"github.com/celestiaorg/celestia-app/x/signal"
signaltypes "github.com/celestiaorg/celestia-app/x/signal/types"
"github.com/cosmos/cosmos-sdk/store"
storetypes "github.com/cosmos/cosmos-sdk/store/types"
"github.com/cosmos/cosmos-sdk/tests/mocks"
Expand Down
71 changes: 47 additions & 24 deletions app/modules.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import (
"github.com/celestiaorg/celestia-app/v3/x/minfee"
"github.com/celestiaorg/celestia-app/v3/x/mint"
minttypes "github.com/celestiaorg/celestia-app/v3/x/mint/types"
"github.com/celestiaorg/celestia-app/v3/x/signal"
signaltypes "github.com/celestiaorg/celestia-app/v3/x/signal/types"
"github.com/celestiaorg/celestia-app/x/signal"
signaltypes "github.com/celestiaorg/celestia-app/x/signal/types"
sdkmodule "github.com/cosmos/cosmos-sdk/types/module"
"github.com/cosmos/cosmos-sdk/x/auth"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
Expand Down Expand Up @@ -91,100 +91,103 @@ var (
ModuleEncodingRegisters = extractRegisters(ModuleBasics)
)

// TODO: remove this constant. The v2 state machin shouldn't need to support app version 3.
const v3 = uint64(3)

func (app *App) setupModuleManager(skipGenesisInvariants bool) error {
var err error
app.manager, err = module.NewManager([]module.VersionedModule{
{
Module: genutil.NewAppModule(app.AccountKeeper, app.StakingKeeper, app.BaseApp.DeliverTx, app.txConfig),
FromVersion: v1, ToVersion: v2,
FromVersion: v1, ToVersion: v3,
},
{
Module: auth.NewAppModule(app.appCodec, app.AccountKeeper, nil),
FromVersion: v1, ToVersion: v2,
FromVersion: v1, ToVersion: v3,
},
{
Module: vesting.NewAppModule(app.AccountKeeper, app.BankKeeper),
FromVersion: v1, ToVersion: v2,
FromVersion: v1, ToVersion: v3,
},
{
Module: bank.NewAppModule(app.appCodec, app.BankKeeper, app.AccountKeeper),
FromVersion: v1, ToVersion: v2,
FromVersion: v1, ToVersion: v3,
},
{
Module: capability.NewAppModule(app.appCodec, *app.CapabilityKeeper),
FromVersion: v1, ToVersion: v2,
FromVersion: v1, ToVersion: v3,
},
{
Module: feegrantmodule.NewAppModule(app.appCodec, app.AccountKeeper, app.BankKeeper, app.FeeGrantKeeper, app.interfaceRegistry),
FromVersion: v1, ToVersion: v2,
FromVersion: v1, ToVersion: v3,
},
{
Module: crisis.NewAppModule(&app.CrisisKeeper, skipGenesisInvariants),
FromVersion: v1, ToVersion: v2,
FromVersion: v1, ToVersion: v3,
},
{
Module: gov.NewAppModule(app.appCodec, app.GovKeeper, app.AccountKeeper, app.BankKeeper),
FromVersion: v1, ToVersion: v2,
FromVersion: v1, ToVersion: v3,
},
{
Module: mint.NewAppModule(app.appCodec, app.MintKeeper, app.AccountKeeper),
FromVersion: v1, ToVersion: v2,
FromVersion: v1, ToVersion: v3,
},
{
Module: slashing.NewAppModule(app.appCodec, app.SlashingKeeper, app.AccountKeeper, app.BankKeeper, app.StakingKeeper),
FromVersion: v1, ToVersion: v2,
FromVersion: v1, ToVersion: v3,
},
{
Module: distr.NewAppModule(app.appCodec, app.DistrKeeper, app.AccountKeeper, app.BankKeeper, app.StakingKeeper),
FromVersion: v1, ToVersion: v2,
FromVersion: v1, ToVersion: v3,
},
{
Module: staking.NewAppModule(app.appCodec, app.StakingKeeper, app.AccountKeeper, app.BankKeeper),
FromVersion: v1, ToVersion: v2,
FromVersion: v1, ToVersion: v3,
},
{
Module: evidence.NewAppModule(app.EvidenceKeeper),
FromVersion: v1, ToVersion: v2,
FromVersion: v1, ToVersion: v3,
},
{
Module: authzmodule.NewAppModule(app.appCodec, app.AuthzKeeper, app.AccountKeeper, app.BankKeeper, app.interfaceRegistry),
FromVersion: v1, ToVersion: v2,
FromVersion: v1, ToVersion: v3,
},
{
Module: ibc.NewAppModule(app.IBCKeeper),
FromVersion: v1, ToVersion: v2,
FromVersion: v1, ToVersion: v3,
},
{
Module: params.NewAppModule(app.ParamsKeeper),
FromVersion: v1, ToVersion: v2,
FromVersion: v1, ToVersion: v3,
},
{
Module: transfer.NewAppModule(app.TransferKeeper),
FromVersion: v1, ToVersion: v2,
FromVersion: v1, ToVersion: v3,
},
{
Module: blob.NewAppModule(app.appCodec, app.BlobKeeper),
FromVersion: v1, ToVersion: v2,
FromVersion: v1, ToVersion: v3,
},
{
Module: blobstream.NewAppModule(app.appCodec, app.BlobstreamKeeper),
FromVersion: v1, ToVersion: v1,
},
{
Module: signal.NewAppModule(app.SignalKeeper),
FromVersion: v2, ToVersion: v2,
FromVersion: v2, ToVersion: v3,
},
{
Module: minfee.NewAppModule(app.ParamsKeeper),
FromVersion: v2, ToVersion: v2,
FromVersion: v2, ToVersion: v3,
},
{
Module: packetforward.NewAppModule(app.PacketForwardKeeper),
FromVersion: v2, ToVersion: v2,
FromVersion: v2, ToVersion: v3,
},
{
Module: ica.NewAppModule(nil, &app.ICAHostKeeper),
FromVersion: v2, ToVersion: v2,
FromVersion: v2, ToVersion: v3,
},
})
if err != nil {
Expand Down Expand Up @@ -341,6 +344,26 @@ func versionedStoreKeys() map[uint64][]string {
stakingtypes.StoreKey,
upgradetypes.StoreKey,
},
3: {
authtypes.StoreKey,
authzkeeper.StoreKey,
banktypes.StoreKey,
blobtypes.StoreKey,
capabilitytypes.StoreKey,
distrtypes.StoreKey,
evidencetypes.StoreKey,
feegrant.StoreKey,
govtypes.StoreKey,
ibchost.StoreKey,
ibctransfertypes.StoreKey,
icahosttypes.StoreKey,
minttypes.StoreKey,
packetforwardtypes.StoreKey,
signaltypes.StoreKey,
slashingtypes.StoreKey,
stakingtypes.StoreKey,
upgradetypes.StoreKey,
},
}
}

Expand Down
17 changes: 17 additions & 0 deletions app/sdk_config.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package app

import sdk "github.com/cosmos/cosmos-sdk/types"

func init() {
maybeSetCosmosSDKConfig()
}

func maybeSetCosmosSDKConfig() {
config := sdk.GetConfig()
if !config.IsSealed() {
config.SetBech32PrefixForAccount(Bech32PrefixAccAddr, Bech32PrefixAccPub)
config.SetBech32PrefixForValidator(Bech32PrefixValAddr, Bech32PrefixValPub)
config.SetBech32PrefixForConsensusNode(Bech32PrefixConsAddr, Bech32PrefixConsPub)
config.Seal()
}
}
18 changes: 18 additions & 0 deletions app/sdk_config_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package app

import (
"testing"

sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/stretchr/testify/assert"
)

func Test_maybeSetCosmosSDKConfig(t *testing.T) {
config := sdk.GetConfig()
assert.Equal(t, Bech32PrefixAccAddr, config.GetBech32AccountAddrPrefix())
assert.Equal(t, Bech32PrefixAccPub, config.GetBech32AccountPubPrefix())
assert.Equal(t, Bech32PrefixValAddr, config.GetBech32ValidatorAddrPrefix())
assert.Equal(t, Bech32PrefixValPub, config.GetBech32ValidatorPubPrefix())
assert.Equal(t, Bech32PrefixConsAddr, config.GetBech32ConsensusAddrPrefix())
assert.Equal(t, Bech32PrefixConsPub, config.GetBech32ConsensusPubPrefix())
}
2 changes: 1 addition & 1 deletion app/test/circuit_breaker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"github.com/celestiaorg/celestia-app/v3/test/util"
"github.com/celestiaorg/celestia-app/v3/test/util/blobfactory"
"github.com/celestiaorg/celestia-app/v3/test/util/testfactory"
signaltypes "github.com/celestiaorg/celestia-app/v3/x/signal/types"
signaltypes "github.com/celestiaorg/celestia-app/x/signal/types"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/x/authz"
"github.com/stretchr/testify/assert"
Expand Down
2 changes: 1 addition & 1 deletion app/test/std_sdk_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
"github.com/celestiaorg/celestia-app/v3/test/util/testfactory"
"github.com/celestiaorg/celestia-app/v3/test/util/testnode"
"github.com/celestiaorg/celestia-app/v3/x/minfee"
signal "github.com/celestiaorg/celestia-app/v3/x/signal/types"
signal "github.com/celestiaorg/celestia-app/x/signal/types"
"github.com/celestiaorg/go-square/v2/share"
nodeservice "github.com/cosmos/cosmos-sdk/client/grpc/node"
"github.com/cosmos/cosmos-sdk/crypto/hd"
Expand Down
1 change: 0 additions & 1 deletion app/test/upgrade_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,6 @@ func TestBlobstreamRemovedInV2(t *testing.T) {

func SetupTestAppWithUpgradeHeight(t *testing.T, upgradeHeight int64) (*app.App, keyring.Keyring) {
t.Helper()

db := dbm.NewMemDB()
chainID := "test_chain"
encCfg := encoding.MakeConfig(app.ModuleEncodingRegisters...)
Expand Down
Loading
Loading