feat: Upgrade to CometBFT v1.x series (#24114)

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Co-authored-by: Julián Toledano <JulianToledano@users.noreply.github.com>
Co-authored-by: Julien Robert <julien@rbrt.fr>
Co-authored-by: Tyler <48813565+technicallyty@users.noreply.github.com>
Co-authored-by: Alex | Interchain Labs <alex@interchainlabs.io>
Co-authored-by: Zachary Becker <zachary@interchainlabs.io>
This commit is contained in:
Fabiana Cecin
2025-05-13 12:57:22 +00:00
committed by GitHub
co-authored by mergify[bot] Julián Toledano Julien Robert Tyler Alex | Interchain Labs Zachary Becker
parent b65dd23bad
commit b71d0894f0
315 changed files with 83967 additions and 4548 deletions
+7 -7
View File
@@ -479,7 +479,7 @@ func (m *Manager) RegisterServices(cfg Configurator) error {
// InitGenesis performs init genesis functionality for modules. Exactly one
// module must return a non-empty validator set update to correctly initialize
// the chain.
func (m *Manager) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, genesisData map[string]json.RawMessage) (*abci.ResponseInitChain, error) {
func (m *Manager) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, genesisData map[string]json.RawMessage) (*abci.InitChainResponse, error) {
var validatorUpdates []abci.ValidatorUpdate
ctx.Logger().Info("initializing blockchain state from genesis.json")
for _, moduleName := range m.OrderInitGenesis {
@@ -494,12 +494,12 @@ func (m *Manager) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, genesisData
// core API genesis
source, err := genesis.SourceFromRawJSON(genesisData[moduleName])
if err != nil {
return &abci.ResponseInitChain{}, err
return &abci.InitChainResponse{}, err
}
err = module.InitGenesis(ctx, source)
if err != nil {
return &abci.ResponseInitChain{}, err
return &abci.InitChainResponse{}, err
}
} else if module, ok := mod.(HasGenesis); ok {
ctx.Logger().Debug("running initialization for module", "module", moduleName)
@@ -512,7 +512,7 @@ func (m *Manager) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, genesisData
// only one module will update the validator set
if len(moduleValUpdates) > 0 {
if len(validatorUpdates) > 0 {
return &abci.ResponseInitChain{}, errors.New("validator InitGenesis updates already set by a previous module")
return &abci.InitChainResponse{}, errors.New("validator InitGenesis updates already set by a previous module")
}
validatorUpdates = moduleValUpdates
}
@@ -521,10 +521,10 @@ func (m *Manager) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, genesisData
// a chain must initialize with a non-empty validator set
if len(validatorUpdates) == 0 {
return &abci.ResponseInitChain{}, fmt.Errorf("validator set is empty after InitGenesis, please ensure at least one validator is initialized with a delegation greater than or equal to the DefaultPowerReduction (%d)", sdk.DefaultPowerReduction)
return &abci.InitChainResponse{}, fmt.Errorf("validator set is empty after InitGenesis, please ensure at least one validator is initialized with a delegation greater than or equal to the DefaultPowerReduction (%d)", sdk.DefaultPowerReduction)
}
return &abci.ResponseInitChain{
return &abci.InitChainResponse{
Validators: validatorUpdates,
}, nil
}
@@ -812,7 +812,7 @@ func (m *Manager) EndBlock(ctx sdk.Context) (sdk.EndBlock, error) {
}
for _, updates := range moduleValUpdates {
validatorUpdates = append(validatorUpdates, abci.ValidatorUpdate{PubKey: updates.PubKey, Power: updates.Power})
validatorUpdates = append(validatorUpdates, abci.ValidatorUpdate{PubKeyBytes: updates.PubKeyBytes, PubKeyType: updates.PubKeyType, Power: updates.Power})
}
}
} else {
+1 -1
View File
@@ -8,7 +8,7 @@ import (
"testing"
abci "github.com/cometbft/cometbft/abci/types"
cmtproto "github.com/cometbft/cometbft/proto/tendermint/types"
cmtproto "github.com/cometbft/cometbft/api/cometbft/types/v1"
"github.com/spf13/cobra"
"github.com/stretchr/testify/require"
"go.uber.org/mock/gomock"