diff --git a/server/v2/cometbft/abci.go b/server/v2/cometbft/abci.go index 06c1e43e5ecb..c38bf7fc18cd 100644 --- a/server/v2/cometbft/abci.go +++ b/server/v2/cometbft/abci.go @@ -33,15 +33,14 @@ import ( var _ abci.Application = (*Consensus[transaction.Tx])(nil) type Consensus[T transaction.Tx] struct { - logger log.Logger - appName, version string - consensusAuthority string // Set by the application to grant authority to the consensus engine to send messages to the consensus module - app *appmanager.AppManager[T] - txCodec transaction.Codec[T] - store types.Store - streaming streaming.Manager - snapshotManager *snapshots.Manager - mempool mempool.Mempool[T] + logger log.Logger + appName, version string + app *appmanager.AppManager[T] + txCodec transaction.Codec[T] + store types.Store + streaming streaming.Manager + snapshotManager *snapshots.Manager + mempool mempool.Mempool[T] cfg Config indexedEvents map[string]struct{} @@ -67,7 +66,6 @@ type Consensus[T transaction.Tx] struct { func NewConsensus[T transaction.Tx]( logger log.Logger, appName string, - consensusAuthority string, // TODO remove app *appmanager.AppManager[T], mp mempool.Mempool[T], indexedEvents map[string]struct{}, @@ -80,7 +78,6 @@ func NewConsensus[T transaction.Tx]( return &Consensus[T]{ appName: appName, version: getCometBFTServerVersion(), - consensusAuthority: consensusAuthority, grpcMethodsMap: gRPCMethodsMap, app: app, cfg: cfg, @@ -246,7 +243,6 @@ func (c *Consensus[T]) InitChain(ctx context.Context, req *abciproto.InitChainRe if req.ConsensusParams != nil { ctx = context.WithValue(ctx, corecontext.CometParamsInitInfoKey, &consensustypes.MsgUpdateParams{ - Authority: c.consensusAuthority, Block: req.ConsensusParams.Block, Evidence: req.ConsensusParams.Evidence, Validator: req.ConsensusParams.Validator, diff --git a/server/v2/cometbft/abci_test.go b/server/v2/cometbft/abci_test.go index 76aee699f5b0..72801a611971 100644 --- a/server/v2/cometbft/abci_test.go +++ b/server/v2/cometbft/abci_test.go @@ -686,7 +686,7 @@ func setUpConsensus(t *testing.T, gasLimit uint64, mempool mempool.Mempool[mock. am, err := b.Build() require.NoError(t, err) - return NewConsensus[mock.Tx](log.NewNopLogger(), "testing-app", "authority", am, mempool, map[string]struct{}{}, nil, mockStore, Config{AppTomlConfig: DefaultAppTomlConfig()}, mock.TxCodec{}, "test") + return NewConsensus[mock.Tx](log.NewNopLogger(), "testing-app", am, mempool, map[string]struct{}{}, nil, mockStore, Config{AppTomlConfig: DefaultAppTomlConfig()}, mock.TxCodec{}, "test") } // Check target version same with store's latest version diff --git a/server/v2/cometbft/server.go b/server/v2/cometbft/server.go index 717a3dfe7629..09742b9b3003 100644 --- a/server/v2/cometbft/server.go +++ b/server/v2/cometbft/server.go @@ -104,7 +104,6 @@ func (s *CometBFTServer[T]) Init(appI serverv2.AppI[T], cfg map[string]any, logg consensus := NewConsensus( s.logger, appI.Name(), - appI.GetConsensusAuthority(), appI.GetAppManager(), s.serverOptions.Mempool(cfg), indexEvents, diff --git a/server/v2/types.go b/server/v2/types.go index f25dbb8ab388..afa82969131a 100644 --- a/server/v2/types.go +++ b/server/v2/types.go @@ -16,7 +16,6 @@ type AppI[T transaction.Tx] interface { Name() string InterfaceRegistry() server.InterfaceRegistry GetAppManager() *appmanager.AppManager[T] - GetConsensusAuthority() string // TODO remove GetGPRCMethodsToMessageMap() map[string]func() gogoproto.Message GetStore() any } diff --git a/simapp/v2/app_config.go b/simapp/v2/app_config.go index 4f8b0bcb9088..99697b94af70 100644 --- a/simapp/v2/app_config.go +++ b/simapp/v2/app_config.go @@ -266,10 +266,8 @@ var ( Config: appconfig.WrapAny(&govmodulev1.Module{}), }, { - Name: consensustypes.ModuleName, - Config: appconfig.WrapAny(&consensusmodulev1.Module{ - Authority: "consensus", // TODO remove. - }), + Name: consensustypes.ModuleName, + Config: appconfig.WrapAny(&consensusmodulev1.Module{}), }, { Name: accounts.ModuleName, diff --git a/simapp/v2/app_di.go b/simapp/v2/app_di.go index 733ab1ffc829..3a3245627639 100644 --- a/simapp/v2/app_di.go +++ b/simapp/v2/app_di.go @@ -13,7 +13,6 @@ import ( "cosmossdk.io/log" "cosmossdk.io/runtime/v2" "cosmossdk.io/store/v2/root" - consensuskeeper "cosmossdk.io/x/consensus/keeper" upgradekeeper "cosmossdk.io/x/upgrade/keeper" "github.com/cosmos/cosmos-sdk/client" @@ -38,8 +37,7 @@ type SimApp[T transaction.Tx] struct { // required keepers during wiring // others keepers are all in the app - UpgradeKeeper *upgradekeeper.Keeper - ConsensusParamsKeeper consensuskeeper.Keeper + UpgradeKeeper *upgradekeeper.Keeper } func init() { @@ -135,7 +133,6 @@ func NewSimApp[T transaction.Tx]( &app.txConfig, &app.interfaceRegistry, &app.UpgradeKeeper, - &app.ConsensusParamsKeeper, ); err != nil { panic(err) } @@ -186,11 +183,6 @@ func (app *SimApp[T]) TxConfig() client.TxConfig { return app.txConfig } -// GetConsensusAuthority gets the consensus authority. -func (app *SimApp[T]) GetConsensusAuthority() string { - return app.ConsensusParamsKeeper.GetAuthority() -} - // GetStore gets the app store. func (app *SimApp[T]) GetStore() any { return app.App.GetStore() diff --git a/store/v2/root/factory.go b/store/v2/root/factory.go index 4dfa01966314..e6f86917ab0d 100644 --- a/store/v2/root/factory.go +++ b/store/v2/root/factory.go @@ -109,6 +109,8 @@ func CreateRootStore(opts *FactoryOptions) (store.RootStore, error) { return nil, err } ssDb, err = rocksdb.New(dir) + default: + return nil, fmt.Errorf("unknown storage type: %s", opts.Options.SSType) } if err != nil { return nil, err @@ -168,12 +170,12 @@ func CreateRootStore(opts *FactoryOptions) (store.RootStore, error) { } oldTrees[string(key)] = tree } + sc, err = commitment.NewCommitStore(trees, oldTrees, opts.SCRawDB, opts.Logger) if err != nil { return nil, err } pm := pruning.NewManager(sc, ss, storeOpts.SCPruningOption, storeOpts.SSPruningOption) - return New(opts.Logger, ss, sc, pm, nil, nil) }