build(deps): Bump cosmossdk.io/core from 0.11.0 to 0.12.0 (#17688)

This commit is contained in:
Marko 2023-09-13 23:04:50 +02:00 committed by GitHub
parent c946e14211
commit e47795e3d4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
39 changed files with 146 additions and 487 deletions

View File

@ -15,6 +15,7 @@ import (
"google.golang.org/grpc/codes"
grpcstatus "google.golang.org/grpc/status"
corecomet "cosmossdk.io/core/comet"
coreheader "cosmossdk.io/core/header"
errorsmod "cosmossdk.io/errors"
"cosmossdk.io/store/rootmulti"
@ -428,7 +429,12 @@ func (app *BaseApp) PrepareProposal(req *abci.RequestPrepareProposal) (resp *abc
WithBlockTime(req.Time).
WithProposer(req.ProposerAddress).
WithExecMode(sdk.ExecModePrepareProposal).
WithCometInfo(prepareProposalInfo{req}).
WithCometInfo(corecomet.Info{
Evidence: sdk.ToSDKEvidence(req.Misbehavior),
ValidatorsHash: req.NextValidatorsHash,
ProposerAddress: req.ProposerAddress,
LastCommit: sdk.ToSDKExtendedCommitInfo(req.LocalLastCommit),
}).
WithHeaderInfo(coreheader.Info{
ChainID: app.chainID,
Height: req.Height,
@ -514,7 +520,13 @@ func (app *BaseApp) ProcessProposal(req *abci.RequestProcessProposal) (resp *abc
WithBlockTime(req.Time).
WithHeaderHash(req.Hash).
WithProposer(req.ProposerAddress).
WithCometInfo(cometInfo{ProposerAddress: req.ProposerAddress, ValidatorsHash: req.NextValidatorsHash, Misbehavior: req.Misbehavior, LastCommit: req.ProposedLastCommit}).
WithCometInfo(corecomet.Info{
ProposerAddress: req.ProposerAddress,
ValidatorsHash: req.NextValidatorsHash,
Evidence: sdk.ToSDKEvidence(req.Misbehavior),
LastCommit: sdk.ToSDKCommitInfo(req.ProposedLastCommit),
},
).
WithExecMode(sdk.ExecModeProcessProposal).
WithHeaderInfo(coreheader.Info{
ChainID: app.chainID,
@ -713,11 +725,11 @@ func (app *BaseApp) FinalizeBlock(req *abci.RequestFinalizeBlock) (*abci.Respons
WithConsensusParams(app.GetConsensusParams(app.finalizeBlockState.ctx)).
WithVoteInfos(req.DecidedLastCommit.Votes).
WithExecMode(sdk.ExecModeFinalize).
WithCometInfo(cometInfo{
Misbehavior: req.Misbehavior,
WithCometInfo(corecomet.Info{
Evidence: sdk.ToSDKEvidence(req.Misbehavior),
ValidatorsHash: req.NextValidatorsHash,
ProposerAddress: req.ProposerAddress,
LastCommit: req.DecidedLastCommit,
LastCommit: sdk.ToSDKCommitInfo(req.DecidedLastCommit),
})
// GasMeter must be set after we get a context with updated consensus params.

View File

@ -1,197 +0,0 @@
package baseapp
import (
"time"
abci "github.com/cometbft/cometbft/abci/types"
"cosmossdk.io/core/comet"
)
var _ comet.BlockInfo = (*cometInfo)(nil)
// CometInfo defines the properties provided by comet to the application
type cometInfo struct {
Misbehavior []abci.Misbehavior
ValidatorsHash []byte
ProposerAddress []byte
LastCommit abci.CommitInfo
}
func (r cometInfo) GetEvidence() comet.EvidenceList {
return evidenceWrapper{evidence: r.Misbehavior}
}
func (r cometInfo) GetValidatorsHash() []byte {
return r.ValidatorsHash
}
func (r cometInfo) GetProposerAddress() []byte {
return r.ProposerAddress
}
func (r cometInfo) GetLastCommit() comet.CommitInfo {
return commitInfoWrapper{r.LastCommit}
}
type evidenceWrapper struct {
evidence []abci.Misbehavior
}
func (e evidenceWrapper) Len() int {
return len(e.evidence)
}
func (e evidenceWrapper) Get(i int) comet.Evidence {
return misbehaviorWrapper{e.evidence[i]}
}
// commitInfoWrapper is a wrapper around abci.CommitInfo that implements CommitInfo interface
type commitInfoWrapper struct {
abci.CommitInfo
}
var _ comet.CommitInfo = (*commitInfoWrapper)(nil)
func (c commitInfoWrapper) Round() int32 {
return c.CommitInfo.Round
}
func (c commitInfoWrapper) Votes() comet.VoteInfos {
return abciVoteInfoWrapper{c.CommitInfo.Votes}
}
// abciVoteInfoWrapper is a wrapper around abci.VoteInfo that implements VoteInfos interface
type abciVoteInfoWrapper struct {
votes []abci.VoteInfo
}
var _ comet.VoteInfos = (*abciVoteInfoWrapper)(nil)
func (e abciVoteInfoWrapper) Len() int {
return len(e.votes)
}
func (e abciVoteInfoWrapper) Get(i int) comet.VoteInfo {
return voteInfoWrapper{e.votes[i]}
}
// voteInfoWrapper is a wrapper around abci.VoteInfo that implements VoteInfo interface
type voteInfoWrapper struct {
abci.VoteInfo
}
var _ comet.VoteInfo = (*voteInfoWrapper)(nil)
func (v voteInfoWrapper) GetBlockIDFlag() comet.BlockIDFlag {
return comet.BlockIDFlag(v.VoteInfo.BlockIdFlag)
}
func (v voteInfoWrapper) Validator() comet.Validator {
return validatorWrapper{v.VoteInfo.Validator}
}
// validatorWrapper is a wrapper around abci.Validator that implements Validator interface
type validatorWrapper struct {
abci.Validator
}
var _ comet.Validator = (*validatorWrapper)(nil)
func (v validatorWrapper) Address() []byte {
return v.Validator.Address
}
func (v validatorWrapper) Power() int64 {
return v.Validator.Power
}
type misbehaviorWrapper struct {
abci.Misbehavior
}
func (m misbehaviorWrapper) Type() comet.MisbehaviorType {
return comet.MisbehaviorType(m.Misbehavior.Type)
}
func (m misbehaviorWrapper) Height() int64 {
return m.Misbehavior.Height
}
func (m misbehaviorWrapper) Validator() comet.Validator {
return validatorWrapper{m.Misbehavior.Validator}
}
func (m misbehaviorWrapper) Time() time.Time {
return m.Misbehavior.Time
}
func (m misbehaviorWrapper) TotalVotingPower() int64 {
return m.Misbehavior.TotalVotingPower
}
type prepareProposalInfo struct {
*abci.RequestPrepareProposal
}
var _ comet.BlockInfo = (*prepareProposalInfo)(nil)
func (r prepareProposalInfo) GetEvidence() comet.EvidenceList {
return evidenceWrapper{r.Misbehavior}
}
func (r prepareProposalInfo) GetValidatorsHash() []byte {
return r.NextValidatorsHash
}
func (r prepareProposalInfo) GetProposerAddress() []byte {
return r.RequestPrepareProposal.ProposerAddress
}
func (r prepareProposalInfo) GetLastCommit() comet.CommitInfo {
return extendedCommitInfoWrapper{r.RequestPrepareProposal.LocalLastCommit}
}
var _ comet.BlockInfo = (*prepareProposalInfo)(nil)
type extendedCommitInfoWrapper struct {
abci.ExtendedCommitInfo
}
var _ comet.CommitInfo = (*extendedCommitInfoWrapper)(nil)
func (e extendedCommitInfoWrapper) Round() int32 {
return e.ExtendedCommitInfo.Round
}
func (e extendedCommitInfoWrapper) Votes() comet.VoteInfos {
return extendedVoteInfoWrapperList{e.ExtendedCommitInfo.Votes}
}
type extendedVoteInfoWrapperList struct {
votes []abci.ExtendedVoteInfo
}
var _ comet.VoteInfos = (*extendedVoteInfoWrapperList)(nil)
func (e extendedVoteInfoWrapperList) Len() int {
return len(e.votes)
}
func (e extendedVoteInfoWrapperList) Get(i int) comet.VoteInfo {
return extendedVoteInfoWrapper{e.votes[i]}
}
type extendedVoteInfoWrapper struct {
abci.ExtendedVoteInfo
}
var _ comet.VoteInfo = (*extendedVoteInfoWrapper)(nil)
func (e extendedVoteInfoWrapper) GetBlockIDFlag() comet.BlockIDFlag {
return comet.BlockIDFlag(e.ExtendedVoteInfo.BlockIdFlag)
}
func (e extendedVoteInfoWrapper) Validator() comet.Validator {
return validatorWrapper{e.ExtendedVoteInfo.Validator}
}

2
go.mod
View File

@ -7,7 +7,7 @@ module github.com/cosmos/cosmos-sdk
require (
cosmossdk.io/api v0.7.1-0.20230820170544-1bd37053e0c0
cosmossdk.io/collections v0.4.0
cosmossdk.io/core v0.11.0
cosmossdk.io/core v0.12.0
cosmossdk.io/depinject v1.0.0-alpha.4
cosmossdk.io/errors v1.0.0
cosmossdk.io/log v1.2.1

4
go.sum
View File

@ -39,8 +39,8 @@ cosmossdk.io/api v0.7.1-0.20230820170544-1bd37053e0c0 h1:z1aCAqEXi5fzC5tjanWnkP/
cosmossdk.io/api v0.7.1-0.20230820170544-1bd37053e0c0/go.mod h1:h4YT2OHIBT/YIwWrc5L+4dY05ZIqvo89zs6m7j4/RSk=
cosmossdk.io/collections v0.4.0 h1:PFmwj2W8szgpD5nOd8GWH6AbYNi1f2J6akWXJ7P5t9s=
cosmossdk.io/collections v0.4.0/go.mod h1:oa5lUING2dP+gdDquow+QjlF45eL1t4TJDypgGd+tv0=
cosmossdk.io/core v0.11.0 h1:vtIafqUi+1ZNAE/oxLOQQ7Oek2n4S48SWLG8h/+wdbo=
cosmossdk.io/core v0.11.0/go.mod h1:LaTtayWBSoacF5xNzoF8tmLhehqlA9z1SWiPuNC6X1w=
cosmossdk.io/core v0.12.0 h1:aFuvkG6eDv0IQC+UDjx86wxNWVAxdCFk7OABJ1Vh4RU=
cosmossdk.io/core v0.12.0/go.mod h1:LaTtayWBSoacF5xNzoF8tmLhehqlA9z1SWiPuNC6X1w=
cosmossdk.io/depinject v1.0.0-alpha.4 h1:PLNp8ZYAMPTUKyG9IK2hsbciDWqna2z1Wsl98okJopc=
cosmossdk.io/depinject v1.0.0-alpha.4/go.mod h1:HeDk7IkR5ckZ3lMGs/o91AVUc7E596vMaOmslGFM3yU=
cosmossdk.io/errors v1.0.0 h1:nxF07lmlBbB8NKQhtJ+sJm6ef5uV1XkvPXG2bUntb04=

View File

@ -14,7 +14,6 @@ import (
stakingmodulev1 "cosmossdk.io/api/cosmos/staking/module/v1"
"cosmossdk.io/core/address"
"cosmossdk.io/core/appmodule"
"cosmossdk.io/core/comet"
"cosmossdk.io/core/event"
"cosmossdk.io/core/genesis"
"cosmossdk.io/core/header"
@ -73,7 +72,6 @@ func init() {
ProvideTransientStoreService,
ProvideEventService,
ProvideHeaderInfoService,
ProvideCometInfoService,
ProvideBasicManager,
ProvideAppVersionModifier,
ProvideAddressCodec,
@ -247,10 +245,6 @@ func ProvideEventService() event.Service {
return EventService{}
}
func ProvideCometInfoService() comet.BlockInfoService {
return cometInfoService{}
}
func ProvideHeaderInfoService(app *AppBuilder) header.Service {
return headerInfoService{}
}

View File

@ -6,7 +6,6 @@ import (
appv1alpha1 "cosmossdk.io/api/cosmos/app/v1alpha1"
autocliv1 "cosmossdk.io/api/cosmos/autocli/v1"
reflectionv1 "cosmossdk.io/api/cosmos/reflection/v1"
"cosmossdk.io/core/comet"
"cosmossdk.io/core/header"
"github.com/cosmos/cosmos-sdk/runtime/services"
@ -27,14 +26,6 @@ func (a *App) registerRuntimeServices(cfg module.Configurator) error {
return nil
}
var _ comet.BlockInfoService = cometInfoService{}
type cometInfoService struct{}
func (cometInfoService) GetCometBlockInfo(ctx context.Context) comet.BlockInfo {
return sdk.UnwrapSDKContext(ctx).CometInfo()
}
var _ header.Service = headerInfoService{}
type headerInfoService struct{}

View File

@ -364,7 +364,7 @@ func NewSimApp(
// create evidence keeper with router
evidenceKeeper := evidencekeeper.NewKeeper(
appCodec, runtime.NewKVStoreService(keys[evidencetypes.StoreKey]), app.StakingKeeper, app.SlashingKeeper, app.AccountKeeper.AddressCodec(), runtime.ProvideCometInfoService(),
appCodec, runtime.NewKVStoreService(keys[evidencetypes.StoreKey]), app.StakingKeeper, app.SlashingKeeper, app.AccountKeeper.AddressCodec(),
)
// If evidence needs to be handled for the app, set routes in router here and seal
app.EvidenceKeeper = *evidenceKeeper

View File

@ -6,7 +6,7 @@ require (
cosmossdk.io/api v0.7.1-0.20230820170544-1bd37053e0c0
cosmossdk.io/client/v2 v2.0.0-20230630094428-02b760776860
cosmossdk.io/collections v0.4.0
cosmossdk.io/core v0.11.0
cosmossdk.io/core v0.12.0
cosmossdk.io/depinject v1.0.0-alpha.4
cosmossdk.io/log v1.2.1
cosmossdk.io/math v1.1.2

View File

@ -191,8 +191,8 @@ cosmossdk.io/api v0.7.1-0.20230820170544-1bd37053e0c0 h1:z1aCAqEXi5fzC5tjanWnkP/
cosmossdk.io/api v0.7.1-0.20230820170544-1bd37053e0c0/go.mod h1:h4YT2OHIBT/YIwWrc5L+4dY05ZIqvo89zs6m7j4/RSk=
cosmossdk.io/collections v0.4.0 h1:PFmwj2W8szgpD5nOd8GWH6AbYNi1f2J6akWXJ7P5t9s=
cosmossdk.io/collections v0.4.0/go.mod h1:oa5lUING2dP+gdDquow+QjlF45eL1t4TJDypgGd+tv0=
cosmossdk.io/core v0.11.0 h1:vtIafqUi+1ZNAE/oxLOQQ7Oek2n4S48SWLG8h/+wdbo=
cosmossdk.io/core v0.11.0/go.mod h1:LaTtayWBSoacF5xNzoF8tmLhehqlA9z1SWiPuNC6X1w=
cosmossdk.io/core v0.12.0 h1:aFuvkG6eDv0IQC+UDjx86wxNWVAxdCFk7OABJ1Vh4RU=
cosmossdk.io/core v0.12.0/go.mod h1:LaTtayWBSoacF5xNzoF8tmLhehqlA9z1SWiPuNC6X1w=
cosmossdk.io/depinject v1.0.0-alpha.4 h1:PLNp8ZYAMPTUKyG9IK2hsbciDWqna2z1Wsl98okJopc=
cosmossdk.io/depinject v1.0.0-alpha.4/go.mod h1:HeDk7IkR5ckZ3lMGs/o91AVUc7E596vMaOmslGFM3yU=
cosmossdk.io/errors v1.0.0 h1:nxF07lmlBbB8NKQhtJ+sJm6ef5uV1XkvPXG2bUntb04=

View File

@ -23,8 +23,8 @@ schema = 3
version = "v0.4.0"
hash = "sha256-minFyzgO/D+Oda4E3B1qvOAN5qd65SjS6nmjca4cp/8="
[mod."cosmossdk.io/core"]
version = "v0.11.0"
hash = "sha256-zUiOF04lWHK8OZqGhwVuzKYfig5I0107D+8fWX5/pbQ="
version = "v0.12.0"
hash = "sha256-/BbjTNEoPUQaHf0j+QEp3rmCkrzlYqWhE9lpffGCib0="
[mod."cosmossdk.io/depinject"]
version = "v1.0.0-alpha.4"
hash = "sha256-xpLH0K6ivQznFrLw2hmhWIIyYgqjstV47OhTEj/c1oQ="

View File

@ -5,7 +5,7 @@ go 1.21
require (
cosmossdk.io/api v0.7.1-0.20230820170544-1bd37053e0c0
cosmossdk.io/collections v0.4.0
cosmossdk.io/core v0.11.0
cosmossdk.io/core v0.12.0
cosmossdk.io/depinject v1.0.0-alpha.4
cosmossdk.io/errors v1.0.0
cosmossdk.io/log v1.2.1

View File

@ -191,8 +191,8 @@ cosmossdk.io/api v0.7.1-0.20230820170544-1bd37053e0c0 h1:z1aCAqEXi5fzC5tjanWnkP/
cosmossdk.io/api v0.7.1-0.20230820170544-1bd37053e0c0/go.mod h1:h4YT2OHIBT/YIwWrc5L+4dY05ZIqvo89zs6m7j4/RSk=
cosmossdk.io/collections v0.4.0 h1:PFmwj2W8szgpD5nOd8GWH6AbYNi1f2J6akWXJ7P5t9s=
cosmossdk.io/collections v0.4.0/go.mod h1:oa5lUING2dP+gdDquow+QjlF45eL1t4TJDypgGd+tv0=
cosmossdk.io/core v0.11.0 h1:vtIafqUi+1ZNAE/oxLOQQ7Oek2n4S48SWLG8h/+wdbo=
cosmossdk.io/core v0.11.0/go.mod h1:LaTtayWBSoacF5xNzoF8tmLhehqlA9z1SWiPuNC6X1w=
cosmossdk.io/core v0.12.0 h1:aFuvkG6eDv0IQC+UDjx86wxNWVAxdCFk7OABJ1Vh4RU=
cosmossdk.io/core v0.12.0/go.mod h1:LaTtayWBSoacF5xNzoF8tmLhehqlA9z1SWiPuNC6X1w=
cosmossdk.io/depinject v1.0.0-alpha.4 h1:PLNp8ZYAMPTUKyG9IK2hsbciDWqna2z1Wsl98okJopc=
cosmossdk.io/depinject v1.0.0-alpha.4/go.mod h1:HeDk7IkR5ckZ3lMGs/o91AVUc7E596vMaOmslGFM3yU=
cosmossdk.io/errors v1.0.0 h1:nxF07lmlBbB8NKQhtJ+sJm6ef5uV1XkvPXG2bUntb04=

View File

@ -125,7 +125,7 @@ func initFixture(tb testing.TB) *fixture {
slashingKeeper := slashingkeeper.NewKeeper(cdc, codec.NewLegacyAmino(), runtime.NewKVStoreService(keys[slashingtypes.StoreKey]), stakingKeeper, authority.String())
evidenceKeeper := keeper.NewKeeper(cdc, runtime.NewKVStoreService(keys[evidencetypes.StoreKey]), stakingKeeper, slashingKeeper, addresscodec.NewBech32Codec("cosmos"), runtime.ProvideCometInfoService())
evidenceKeeper := keeper.NewKeeper(cdc, runtime.NewKVStoreService(keys[evidencetypes.StoreKey]), stakingKeeper, slashingKeeper, addresscodec.NewBech32Codec("cosmos"))
router := evidencetypes.NewRouter()
router = router.AddRoute(evidencetypes.RouteEquivocation, testEquivocationHandler(evidenceKeeper))
evidenceKeeper.SetRouter(router)
@ -205,14 +205,14 @@ func TestHandleDoubleSign(t *testing.T) {
assert.NilError(t, err)
oldTokens := val.GetTokens()
nci := NewCometInfo(abci.RequestFinalizeBlock{
Misbehavior: []abci.Misbehavior{{
Validator: abci.Validator{Address: valpubkey.Address(), Power: power},
Type: abci.MisbehaviorType_DUPLICATE_VOTE,
nci := comet.Info{
Evidence: []comet.Evidence{{
Validator: comet.Validator{Address: valpubkey.Address(), Power: power},
Type: comet.DuplicateVote,
Time: time.Now().UTC(),
Height: 1,
}},
})
}
ctx = ctx.WithCometInfo(nci)
assert.NilError(t, f.evidenceKeeper.BeginBlocker(ctx.WithCometInfo(nci)))
@ -285,14 +285,12 @@ func TestHandleDoubleSign_TooOld(t *testing.T) {
assert.NilError(t, err)
assert.DeepEqual(t, amt, val.GetBondedTokens())
nci := NewCometInfo(abci.RequestFinalizeBlock{
Misbehavior: []abci.Misbehavior{{
Validator: abci.Validator{Address: valpubkey.Address(), Power: power},
Type: abci.MisbehaviorType_DUPLICATE_VOTE,
Time: ctx.BlockTime(),
Height: 0,
}},
})
nci := comet.Info{Evidence: []comet.Evidence{{
Validator: comet.Validator{Address: valpubkey.Address(), Power: power},
Type: comet.MisbehaviorType(abci.MisbehaviorType_DUPLICATE_VOTE),
Time: ctx.BlockTime(),
Height: 0,
}}}
assert.NilError(t, f.app.BaseApp.StoreConsensusParams(ctx, *simtestutil.DefaultConsensusParams))
cp := f.app.BaseApp.GetConsensusParams(ctx)
@ -349,80 +347,3 @@ func testEquivocationHandler(_ interface{}) evidencetypes.Handler {
return nil
}
}
type CometService struct {
Evidence []abci.Misbehavior
}
func NewCometInfo(bg abci.RequestFinalizeBlock) comet.BlockInfo {
return CometService{
Evidence: bg.Misbehavior,
}
}
func (r CometService) GetEvidence() comet.EvidenceList {
return evidenceWrapper{evidence: r.Evidence}
}
func (CometService) GetValidatorsHash() []byte {
return []byte{}
}
func (CometService) GetProposerAddress() []byte {
return []byte{}
}
func (CometService) GetLastCommit() comet.CommitInfo {
return nil
}
type evidenceWrapper struct {
evidence []abci.Misbehavior
}
func (e evidenceWrapper) Len() int {
return len(e.evidence)
}
func (e evidenceWrapper) Get(i int) comet.Evidence {
return misbehaviorWrapper{e.evidence[i]}
}
type misbehaviorWrapper struct {
abci.Misbehavior
}
func (m misbehaviorWrapper) Type() comet.MisbehaviorType {
return comet.MisbehaviorType(m.Misbehavior.Type)
}
func (m misbehaviorWrapper) Height() int64 {
return m.Misbehavior.Height
}
func (m misbehaviorWrapper) Validator() comet.Validator {
return validatorWrapper{m.Misbehavior.Validator}
}
func (m misbehaviorWrapper) Time() time.Time {
return m.Misbehavior.Time
}
func (m misbehaviorWrapper) TotalVotingPower() int64 {
return m.Misbehavior.TotalVotingPower
}
// validatorWrapper is a wrapper around abci.Validator that implements Validator interface
type validatorWrapper struct {
abci.Validator
}
var _ comet.Validator = (*validatorWrapper)(nil)
func (v validatorWrapper) Address() []byte {
return v.Validator.Address
}
func (v validatorWrapper) Power() int64 {
return v.Validator.Power
}

View File

@ -41,7 +41,7 @@ require (
cosmossdk.io/api v0.7.1-0.20230820170544-1bd37053e0c0 // indirect
cosmossdk.io/client/v2 v2.0.0-20230630094428-02b760776860 // indirect
cosmossdk.io/collections v0.4.0 // indirect
cosmossdk.io/core v0.11.0 // indirect
cosmossdk.io/core v0.12.0 // indirect
cosmossdk.io/depinject v1.0.0-alpha.4 // indirect
cosmossdk.io/errors v1.0.0 // indirect
cosmossdk.io/store v1.0.0-rc.0 // indirect

View File

@ -191,8 +191,8 @@ cosmossdk.io/api v0.7.1-0.20230820170544-1bd37053e0c0 h1:z1aCAqEXi5fzC5tjanWnkP/
cosmossdk.io/api v0.7.1-0.20230820170544-1bd37053e0c0/go.mod h1:h4YT2OHIBT/YIwWrc5L+4dY05ZIqvo89zs6m7j4/RSk=
cosmossdk.io/collections v0.4.0 h1:PFmwj2W8szgpD5nOd8GWH6AbYNi1f2J6akWXJ7P5t9s=
cosmossdk.io/collections v0.4.0/go.mod h1:oa5lUING2dP+gdDquow+QjlF45eL1t4TJDypgGd+tv0=
cosmossdk.io/core v0.11.0 h1:vtIafqUi+1ZNAE/oxLOQQ7Oek2n4S48SWLG8h/+wdbo=
cosmossdk.io/core v0.11.0/go.mod h1:LaTtayWBSoacF5xNzoF8tmLhehqlA9z1SWiPuNC6X1w=
cosmossdk.io/core v0.12.0 h1:aFuvkG6eDv0IQC+UDjx86wxNWVAxdCFk7OABJ1Vh4RU=
cosmossdk.io/core v0.12.0/go.mod h1:LaTtayWBSoacF5xNzoF8tmLhehqlA9z1SWiPuNC6X1w=
cosmossdk.io/depinject v1.0.0-alpha.4 h1:PLNp8ZYAMPTUKyG9IK2hsbciDWqna2z1Wsl98okJopc=
cosmossdk.io/depinject v1.0.0-alpha.4/go.mod h1:HeDk7IkR5ckZ3lMGs/o91AVUc7E596vMaOmslGFM3yU=
cosmossdk.io/errors v1.0.0 h1:nxF07lmlBbB8NKQhtJ+sJm6ef5uV1XkvPXG2bUntb04=

View File

@ -61,7 +61,7 @@ type Context struct {
kvGasConfig storetypes.GasConfig
transientKVGasConfig storetypes.GasConfig
streamingManager storetypes.StreamingManager
cometInfo comet.BlockInfo
cometInfo comet.Info
headerInfo header.Info
}
@ -88,7 +88,7 @@ func (c Context) Priority() int64 { return c.prior
func (c Context) KVGasConfig() storetypes.GasConfig { return c.kvGasConfig }
func (c Context) TransientKVGasConfig() storetypes.GasConfig { return c.transientKVGasConfig }
func (c Context) StreamingManager() storetypes.StreamingManager { return c.streamingManager }
func (c Context) CometInfo() comet.BlockInfo { return c.cometInfo }
func (c Context) CometInfo() comet.Info { return c.cometInfo }
func (c Context) HeaderInfo() header.Info { return c.headerInfo }
// clone the header before returning
@ -302,7 +302,7 @@ func (c Context) WithStreamingManager(sm storetypes.StreamingManager) Context {
}
// WithCometInfo returns a Context with an updated comet info
func (c Context) WithCometInfo(cometInfo comet.BlockInfo) Context {
func (c Context) WithCometInfo(cometInfo comet.Info) Context {
c.cometInfo = cometInfo
return c
}
@ -393,3 +393,58 @@ func UnwrapSDKContext(ctx context.Context) Context {
}
return ctx.Value(SdkContextKey).(Context)
}
// ToSDKEvidence takes comet evidence and returns sdk evidence
func ToSDKEvidence(ev []abci.Misbehavior) []comet.Evidence {
evidence := make([]comet.Evidence, len(ev))
for i, e := range ev {
evidence[i] = comet.Evidence{
Type: comet.MisbehaviorType(e.Type),
Height: e.Height,
Time: e.Time,
TotalVotingPower: e.TotalVotingPower,
Validator: comet.Validator{
Address: e.Validator.Address,
Power: e.Validator.Power,
},
}
}
return evidence
}
// ToSDKDecidedCommitInfo takes comet commit info and returns sdk commit info
func ToSDKCommitInfo(commit abci.CommitInfo) comet.CommitInfo {
ci := comet.CommitInfo{
Round: commit.Round,
}
for _, v := range commit.Votes {
ci.Votes = append(ci.Votes, comet.VoteInfo{
Validator: comet.Validator{
Address: v.Validator.Address,
Power: v.Validator.Power,
},
BlockIDFlag: comet.BlockIDFlag(v.BlockIdFlag),
})
}
return ci
}
// ToSDKExtendedCommitInfo takes comet extended commit info and returns sdk commit info
func ToSDKExtendedCommitInfo(commit abci.ExtendedCommitInfo) comet.CommitInfo {
ci := comet.CommitInfo{
Round: commit.Round,
}
for _, v := range commit.Votes {
ci.Votes = append(ci.Votes, comet.VoteInfo{
Validator: comet.Validator{
Address: v.Validator.Address,
Power: v.Validator.Power,
},
BlockIDFlag: comet.BlockIDFlag(v.BlockIdFlag),
})
}
return ci
}

File diff suppressed because one or more lines are too long

View File

@ -17,7 +17,8 @@ type ProtoMsg[T any] interface {
// RegisterInitHandler registers an initialisation handler for a smart account that uses protobuf.
func RegisterInitHandler[
Req any, ProtoReq ProtoMsg[Req], Resp any, ProtoResp ProtoMsg[Resp],
](router *InitBuilder, handler func(ctx context.Context, req ProtoReq) (ProtoResp, error)) {
](router *InitBuilder, handler func(ctx context.Context, req ProtoReq) (ProtoResp, error),
) {
reqName := ProtoReq(new(Req)).ProtoReflect().Descriptor().FullName()
respName := ProtoResp(new(Resp)).ProtoReflect().Descriptor().FullName()
@ -47,7 +48,8 @@ func RegisterInitHandler[
// RegisterExecuteHandler registers an execution handler for a smart account that uses protobuf.
func RegisterExecuteHandler[
Req any, ProtoReq ProtoMsg[Req], Resp any, ProtoResp ProtoMsg[Resp],
](router *ExecuteBuilder, handler func(ctx context.Context, req ProtoReq) (ProtoResp, error)) {
](router *ExecuteBuilder, handler func(ctx context.Context, req ProtoReq) (ProtoResp, error),
) {
reqName := ProtoReq(new(Req)).ProtoReflect().Descriptor().FullName()
// check if not registered already
if _, ok := router.handlers[string(reqName)]; ok {
@ -67,6 +69,7 @@ func RegisterExecuteHandler[
// RegisterQueryHandler registers a query handler for a smart account that uses protobuf.
func RegisterQueryHandler[
Req any, ProtoReq ProtoMsg[Req], Resp any, ProtoResp ProtoMsg[Resp],
](router *QueryBuilder, handler func(ctx context.Context, req ProtoReq) (ProtoResp, error)) {
](router *QueryBuilder, handler func(ctx context.Context, req ProtoReq) (ProtoResp, error),
) {
RegisterExecuteHandler(router.er, handler)
}

View File

@ -5,7 +5,7 @@ go 1.21
require (
cosmossdk.io/api v0.7.1-0.20230820170544-1bd37053e0c0
cosmossdk.io/collections v0.4.0
cosmossdk.io/core v0.11.0
cosmossdk.io/core v0.12.0
cosmossdk.io/depinject v1.0.0-alpha.4
cosmossdk.io/errors v1.0.0
cosmossdk.io/math v1.1.2

View File

@ -39,8 +39,8 @@ cosmossdk.io/api v0.7.1-0.20230820170544-1bd37053e0c0 h1:z1aCAqEXi5fzC5tjanWnkP/
cosmossdk.io/api v0.7.1-0.20230820170544-1bd37053e0c0/go.mod h1:h4YT2OHIBT/YIwWrc5L+4dY05ZIqvo89zs6m7j4/RSk=
cosmossdk.io/collections v0.4.0 h1:PFmwj2W8szgpD5nOd8GWH6AbYNi1f2J6akWXJ7P5t9s=
cosmossdk.io/collections v0.4.0/go.mod h1:oa5lUING2dP+gdDquow+QjlF45eL1t4TJDypgGd+tv0=
cosmossdk.io/core v0.11.0 h1:vtIafqUi+1ZNAE/oxLOQQ7Oek2n4S48SWLG8h/+wdbo=
cosmossdk.io/core v0.11.0/go.mod h1:LaTtayWBSoacF5xNzoF8tmLhehqlA9z1SWiPuNC6X1w=
cosmossdk.io/core v0.12.0 h1:aFuvkG6eDv0IQC+UDjx86wxNWVAxdCFk7OABJ1Vh4RU=
cosmossdk.io/core v0.12.0/go.mod h1:LaTtayWBSoacF5xNzoF8tmLhehqlA9z1SWiPuNC6X1w=
cosmossdk.io/depinject v1.0.0-alpha.4 h1:PLNp8ZYAMPTUKyG9IK2hsbciDWqna2z1Wsl98okJopc=
cosmossdk.io/depinject v1.0.0-alpha.4/go.mod h1:HeDk7IkR5ckZ3lMGs/o91AVUc7E596vMaOmslGFM3yU=
cosmossdk.io/errors v1.0.0 h1:nxF07lmlBbB8NKQhtJ+sJm6ef5uV1XkvPXG2bUntb04=

View File

@ -36,6 +36,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
* (keeper) [#15825](https://github.com/cosmos/cosmos-sdk/pull/15825) Evidence constructor now requires an `address.Codec` (`import "cosmossdk.io/core/address"`)
* [#16336](https://github.com/cosmos/cosmos-sdk/pull/16336) Use collections for state management:
* Removed: keeper `SetEvidence`, `GetEvidence`, `IterateEvidences`, `GetAllEvidences`, `MustMarshalEvidence`, `MustUnmarshalEvidence`, `MarshalEvidence`, `UnmarshalEvidence`
* [#17688](https://github.com/cosmos/cosmos-sdk/pull/17688) Remove `comet.Info` as an arg to evidence
### Client Breaking Changes

View File

@ -5,7 +5,7 @@ go 1.21
require (
cosmossdk.io/api v0.7.1-0.20230820170544-1bd37053e0c0
cosmossdk.io/collections v0.4.0
cosmossdk.io/core v0.11.0
cosmossdk.io/core v0.12.0
cosmossdk.io/depinject v1.0.0-alpha.4
cosmossdk.io/errors v1.0.0
cosmossdk.io/log v1.2.1

View File

@ -39,8 +39,8 @@ cosmossdk.io/api v0.7.1-0.20230820170544-1bd37053e0c0 h1:z1aCAqEXi5fzC5tjanWnkP/
cosmossdk.io/api v0.7.1-0.20230820170544-1bd37053e0c0/go.mod h1:h4YT2OHIBT/YIwWrc5L+4dY05ZIqvo89zs6m7j4/RSk=
cosmossdk.io/collections v0.4.0 h1:PFmwj2W8szgpD5nOd8GWH6AbYNi1f2J6akWXJ7P5t9s=
cosmossdk.io/collections v0.4.0/go.mod h1:oa5lUING2dP+gdDquow+QjlF45eL1t4TJDypgGd+tv0=
cosmossdk.io/core v0.11.0 h1:vtIafqUi+1ZNAE/oxLOQQ7Oek2n4S48SWLG8h/+wdbo=
cosmossdk.io/core v0.11.0/go.mod h1:LaTtayWBSoacF5xNzoF8tmLhehqlA9z1SWiPuNC6X1w=
cosmossdk.io/core v0.12.0 h1:aFuvkG6eDv0IQC+UDjx86wxNWVAxdCFk7OABJ1Vh4RU=
cosmossdk.io/core v0.12.0/go.mod h1:LaTtayWBSoacF5xNzoF8tmLhehqlA9z1SWiPuNC6X1w=
cosmossdk.io/depinject v1.0.0-alpha.4 h1:PLNp8ZYAMPTUKyG9IK2hsbciDWqna2z1Wsl98okJopc=
cosmossdk.io/depinject v1.0.0-alpha.4/go.mod h1:HeDk7IkR5ckZ3lMGs/o91AVUc7E596vMaOmslGFM3yU=
cosmossdk.io/errors v1.0.0 h1:nxF07lmlBbB8NKQhtJ+sJm6ef5uV1XkvPXG2bUntb04=

View File

@ -17,27 +17,22 @@ import (
func (k Keeper) BeginBlocker(ctx context.Context) error {
defer telemetry.ModuleMeasureSince(types.ModuleName, time.Now(), telemetry.MetricKeyBeginBlocker)
bi := k.cometInfo.GetCometBlockInfo(ctx)
if bi == nil {
// If we don't have block info, we don't have any evidence to process. Block info may be nil during
// genesis calls or in tests.
return nil
}
bi := sdk.UnwrapSDKContext(ctx).CometInfo()
evidences := bi.GetEvidence()
evidences := bi.Evidence
sdkCtx := sdk.UnwrapSDKContext(ctx)
for i := 0; i < evidences.Len(); i++ {
switch evidences.Get(i).Type() {
for _, evidence := range evidences {
switch evidence.Type {
// It's still ongoing discussion how should we treat and slash attacks with
// premeditation. So for now we agree to treat them in the same way.
case comet.LightClientAttack, comet.DuplicateVote:
evidence := types.FromABCIEvidence(evidences.Get(i), k.stakingKeeper.ConsensusAddressCodec())
evidence := types.FromABCIEvidence(evidence, k.stakingKeeper.ConsensusAddressCodec())
err := k.handleEquivocationEvidence(ctx, evidence)
if err != nil {
return err
}
default:
k.Logger(sdkCtx).Error(fmt.Sprintf("ignored unknown evidence type: %x", evidences.Get(i).Type()))
k.Logger(sdkCtx).Error(fmt.Sprintf("ignored unknown evidence type: %x", evidence.Type))
}
}
return nil

View File

@ -8,7 +8,6 @@ import (
"cosmossdk.io/collections"
"cosmossdk.io/core/address"
"cosmossdk.io/core/comet"
"cosmossdk.io/core/store"
"cosmossdk.io/errors"
"cosmossdk.io/log"
@ -30,8 +29,6 @@ type Keeper struct {
slashingKeeper types.SlashingKeeper
addressCodec address.Codec
cometInfo comet.BlockInfoService
Schema collections.Schema
// Evidences key: evidence hash bytes | value: Evidence
Evidences collections.Map[[]byte, exported.Evidence]
@ -40,7 +37,7 @@ type Keeper struct {
// NewKeeper creates a new Keeper object.
func NewKeeper(
cdc codec.BinaryCodec, storeService store.KVStoreService, stakingKeeper types.StakingKeeper,
slashingKeeper types.SlashingKeeper, ac address.Codec, ci comet.BlockInfoService,
slashingKeeper types.SlashingKeeper, ac address.Codec,
) *Keeper {
sb := collections.NewSchemaBuilder(storeService)
k := &Keeper{
@ -49,7 +46,6 @@ func NewKeeper(
stakingKeeper: stakingKeeper,
slashingKeeper: slashingKeeper,
addressCodec: ac,
cometInfo: ci,
Evidences: collections.NewMap(sb, types.KeyPrefixEvidence, "evidences", collections.BytesKey, codec.CollInterfaceValue[exported.Evidence](cdc)),
}
schema, err := sb.Build()

View File

@ -77,7 +77,6 @@ type KeeperTestSuite struct {
accountKeeper *evidencetestutil.MockAccountKeeper
slashingKeeper *evidencetestutil.MockSlashingKeeper
stakingKeeper *evidencetestutil.MockStakingKeeper
blockInfo *evidencetestutil.MockCometinfo
queryClient types.QueryClient
encCfg moduletestutil.TestEncodingConfig
msgServer types.MsgServer
@ -97,7 +96,6 @@ func (suite *KeeperTestSuite) SetupTest() {
slashingKeeper := evidencetestutil.NewMockSlashingKeeper(ctrl)
accountKeeper := evidencetestutil.NewMockAccountKeeper(ctrl)
bankKeeper := evidencetestutil.NewMockBankKeeper(ctrl)
suite.blockInfo = &evidencetestutil.MockCometinfo{}
evidenceKeeper := keeper.NewKeeper(
encCfg.Codec,
@ -105,7 +103,6 @@ func (suite *KeeperTestSuite) SetupTest() {
stakingKeeper,
slashingKeeper,
address.NewBech32Codec("cosmos"),
&evidencetestutil.MockCometinfo{},
)
suite.stakingKeeper = stakingKeeper

View File

@ -12,7 +12,6 @@ import (
modulev1 "cosmossdk.io/api/cosmos/evidence/module/v1"
"cosmossdk.io/core/address"
"cosmossdk.io/core/appmodule"
"cosmossdk.io/core/comet"
store "cosmossdk.io/core/store"
"cosmossdk.io/depinject"
eviclient "cosmossdk.io/x/evidence/client"
@ -196,8 +195,6 @@ type ModuleInputs struct {
StakingKeeper types.StakingKeeper
SlashingKeeper types.SlashingKeeper
AddressCodec address.Codec
BlockInfoService comet.BlockInfoService
}
type ModuleOutputs struct {
@ -208,7 +205,7 @@ type ModuleOutputs struct {
}
func ProvideModule(in ModuleInputs) ModuleOutputs {
k := keeper.NewKeeper(in.Cdc, in.StoreService, in.StakingKeeper, in.SlashingKeeper, in.AddressCodec, in.BlockInfoService)
k := keeper.NewKeeper(in.Cdc, in.StoreService, in.StakingKeeper, in.SlashingKeeper, in.AddressCodec)
m := NewAppModule(*k)
return ModuleOutputs{EvidenceKeeper: *k, Module: m}

View File

@ -11,7 +11,6 @@ import (
stakingv1beta1 "cosmossdk.io/api/cosmos/staking/v1beta1"
address "cosmossdk.io/core/address"
comet "cosmossdk.io/core/comet"
math "cosmossdk.io/math"
types "github.com/cosmos/cosmos-sdk/crypto/types"
types0 "github.com/cosmos/cosmos-sdk/types"
@ -336,40 +335,3 @@ func (mr *MockBankKeeperMockRecorder) SendCoinsFromModuleToAccount(ctx, senderMo
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendCoinsFromModuleToAccount", reflect.TypeOf((*MockBankKeeper)(nil).SendCoinsFromModuleToAccount), ctx, senderModule, recipientAddr, amt)
}
// MockCometinfo is a mock of Cometinfo interface.
type MockCometinfo struct {
ctrl *gomock.Controller
recorder *MockCometinfoMockRecorder
}
// MockCometinfoMockRecorder is the mock recorder for MockCometinfo.
type MockCometinfoMockRecorder struct {
mock *MockCometinfo
}
// NewMockCometinfo creates a new mock instance.
func NewMockCometinfo(ctrl *gomock.Controller) *MockCometinfo {
mock := &MockCometinfo{ctrl: ctrl}
mock.recorder = &MockCometinfoMockRecorder{mock}
return mock
}
// EXPECT returns an object that allows the caller to indicate expected use.
func (m *MockCometinfo) EXPECT() *MockCometinfoMockRecorder {
return m.recorder
}
// GetCometBlockInfo mocks base method.
func (m *MockCometinfo) GetCometBlockInfo(arg0 context.Context) comet.BlockInfo {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "GetCometBlockInfo", arg0)
ret0, _ := ret[0].(comet.BlockInfo)
return ret0
}
// GetCometBlockInfo indicates an expected call of GetCometBlockInfo.
func (mr *MockCometinfoMockRecorder) GetCometBlockInfo(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetCometBlockInfo", reflect.TypeOf((*MockCometinfo)(nil).GetCometBlockInfo), arg0)
}

View File

@ -77,15 +77,15 @@ func (e Equivocation) GetTotalPower() int64 { return 0 }
// FromABCIEvidence converts a CometBFT concrete Evidence type to
// SDK Evidence using Equivocation as the concrete type.
func FromABCIEvidence(e comet.Evidence, conAc address.Codec) *Equivocation {
consAddr, err := conAc.BytesToString(e.Validator().Address())
consAddr, err := conAc.BytesToString(e.Validator.Address)
if err != nil {
panic(err)
}
return &Equivocation{
Height: e.Height(),
Power: e.Validator().Power(),
Height: e.Height,
Power: e.Validator.Power,
ConsensusAddress: consAddr,
Time: e.Time(),
Time: e.Time,
}
}

View File

@ -75,64 +75,21 @@ func TestEquivocationValidateBasic(t *testing.T) {
func TestEvidenceAddressConversion(t *testing.T) {
sdk.GetConfig().SetBech32PrefixForConsensusNode("testcnclcons", "testcnclconspub")
tmEvidence := NewCometMisbehavior(1, 100, time.Now(), comet.DuplicateVote,
validator{address: []byte{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, power: 100})
comet.Validator{Address: []byte{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, Power: 100})
evidence := types.FromABCIEvidence(tmEvidence, address.NewBech32Codec("testcnclcons"))
consAddr := evidence.GetConsensusAddress(address.NewBech32Codec("testcnclcons"))
// Check the address is the same after conversion
require.Equal(t, tmEvidence.Validator().Address(), consAddr.Bytes())
require.Equal(t, tmEvidence.Validator.Address, consAddr.Bytes())
sdk.GetConfig().SetBech32PrefixForConsensusNode(sdk.Bech32PrefixConsAddr, sdk.Bech32PrefixConsPub)
}
type Misbehavior struct {
height int64
time time.Time
totalVotingPower int64
validator validator
misBehaviorType comet.MisbehaviorType
}
func NewCometMisbehavior(height, tvp int64, t time.Time, tpe comet.MisbehaviorType, val validator) comet.Evidence {
return Misbehavior{
height: height,
time: t,
totalVotingPower: tvp,
misBehaviorType: tpe,
validator: val,
func NewCometMisbehavior(height, tvp int64, t time.Time, tpe comet.MisbehaviorType, val comet.Validator) comet.Evidence {
return comet.Evidence{
Height: height,
Time: t,
TotalVotingPower: tvp,
Type: tpe,
Validator: val,
}
}
func (m Misbehavior) Type() comet.MisbehaviorType {
return m.misBehaviorType
}
func (m Misbehavior) Height() int64 {
return m.height
}
func (m Misbehavior) Validator() comet.Validator {
return m.validator
}
func (m Misbehavior) Time() time.Time {
return m.time
}
func (m Misbehavior) TotalVotingPower() int64 {
return m.totalVotingPower
}
type validator struct {
address []byte
power int64
}
var _ comet.Validator = (*validator)(nil)
func (v validator) Address() []byte {
return v.address
}
func (v validator) Power() int64 {
return v.power
}

View File

@ -6,7 +6,6 @@ import (
st "cosmossdk.io/api/cosmos/staking/v1beta1"
"cosmossdk.io/core/address"
"cosmossdk.io/core/comet"
"cosmossdk.io/math"
cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types"
@ -48,8 +47,4 @@ type (
SendCoinsFromModuleToAccount(ctx sdk.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins) error
GetAllBalances(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins
}
Cometinfo interface {
comet.BlockInfoService
}
)

View File

@ -5,7 +5,7 @@ go 1.21
require (
cosmossdk.io/api v0.7.1-0.20230820170544-1bd37053e0c0
cosmossdk.io/collections v0.4.0
cosmossdk.io/core v0.11.0
cosmossdk.io/core v0.12.0
cosmossdk.io/depinject v1.0.0-alpha.4
cosmossdk.io/errors v1.0.0
cosmossdk.io/log v1.2.1

View File

@ -39,8 +39,8 @@ cosmossdk.io/api v0.7.1-0.20230820170544-1bd37053e0c0 h1:z1aCAqEXi5fzC5tjanWnkP/
cosmossdk.io/api v0.7.1-0.20230820170544-1bd37053e0c0/go.mod h1:h4YT2OHIBT/YIwWrc5L+4dY05ZIqvo89zs6m7j4/RSk=
cosmossdk.io/collections v0.4.0 h1:PFmwj2W8szgpD5nOd8GWH6AbYNi1f2J6akWXJ7P5t9s=
cosmossdk.io/collections v0.4.0/go.mod h1:oa5lUING2dP+gdDquow+QjlF45eL1t4TJDypgGd+tv0=
cosmossdk.io/core v0.11.0 h1:vtIafqUi+1ZNAE/oxLOQQ7Oek2n4S48SWLG8h/+wdbo=
cosmossdk.io/core v0.11.0/go.mod h1:LaTtayWBSoacF5xNzoF8tmLhehqlA9z1SWiPuNC6X1w=
cosmossdk.io/core v0.12.0 h1:aFuvkG6eDv0IQC+UDjx86wxNWVAxdCFk7OABJ1Vh4RU=
cosmossdk.io/core v0.12.0/go.mod h1:LaTtayWBSoacF5xNzoF8tmLhehqlA9z1SWiPuNC6X1w=
cosmossdk.io/depinject v1.0.0-alpha.4 h1:PLNp8ZYAMPTUKyG9IK2hsbciDWqna2z1Wsl98okJopc=
cosmossdk.io/depinject v1.0.0-alpha.4/go.mod h1:HeDk7IkR5ckZ3lMGs/o91AVUc7E596vMaOmslGFM3yU=
cosmossdk.io/errors v1.0.0 h1:nxF07lmlBbB8NKQhtJ+sJm6ef5uV1XkvPXG2bUntb04=

View File

@ -6,7 +6,6 @@ import (
codectypes "github.com/cosmos/cosmos-sdk/codec/types"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/msgservice"
distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types"
)
// RegisterLegacyAminoCodec registers all the necessary types and interfaces for the
@ -33,10 +32,6 @@ func RegisterInterfaces(registry codectypes.InterfaceRegistry) {
(*Content)(nil),
&TextProposal{},
)
registry.RegisterImplementations(
(*Content)(nil),
&distrtypes.CommunityPoolSpendProposal{}, //nolint: staticcheck // avoid using `CommunityPoolSpendProposal`, might be reomved in future.
)
msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc)
}

View File

@ -4,7 +4,7 @@ go 1.21
require (
cosmossdk.io/api v0.7.1-0.20230820170544-1bd37053e0c0
cosmossdk.io/core v0.11.0
cosmossdk.io/core v0.12.0
cosmossdk.io/depinject v1.0.0-alpha.4
cosmossdk.io/errors v1.0.0
cosmossdk.io/log v1.2.1

View File

@ -39,8 +39,8 @@ cosmossdk.io/api v0.7.1-0.20230820170544-1bd37053e0c0 h1:z1aCAqEXi5fzC5tjanWnkP/
cosmossdk.io/api v0.7.1-0.20230820170544-1bd37053e0c0/go.mod h1:h4YT2OHIBT/YIwWrc5L+4dY05ZIqvo89zs6m7j4/RSk=
cosmossdk.io/collections v0.4.0 h1:PFmwj2W8szgpD5nOd8GWH6AbYNi1f2J6akWXJ7P5t9s=
cosmossdk.io/collections v0.4.0/go.mod h1:oa5lUING2dP+gdDquow+QjlF45eL1t4TJDypgGd+tv0=
cosmossdk.io/core v0.11.0 h1:vtIafqUi+1ZNAE/oxLOQQ7Oek2n4S48SWLG8h/+wdbo=
cosmossdk.io/core v0.11.0/go.mod h1:LaTtayWBSoacF5xNzoF8tmLhehqlA9z1SWiPuNC6X1w=
cosmossdk.io/core v0.12.0 h1:aFuvkG6eDv0IQC+UDjx86wxNWVAxdCFk7OABJ1Vh4RU=
cosmossdk.io/core v0.12.0/go.mod h1:LaTtayWBSoacF5xNzoF8tmLhehqlA9z1SWiPuNC6X1w=
cosmossdk.io/depinject v1.0.0-alpha.4 h1:PLNp8ZYAMPTUKyG9IK2hsbciDWqna2z1Wsl98okJopc=
cosmossdk.io/depinject v1.0.0-alpha.4/go.mod h1:HeDk7IkR5ckZ3lMGs/o91AVUc7E596vMaOmslGFM3yU=
cosmossdk.io/errors v1.0.0 h1:nxF07lmlBbB8NKQhtJ+sJm6ef5uV1XkvPXG2bUntb04=

View File

@ -4,7 +4,7 @@ go 1.21
require (
cosmossdk.io/api v0.7.1-0.20230820170544-1bd37053e0c0
cosmossdk.io/core v0.11.0
cosmossdk.io/core v0.12.0
cosmossdk.io/depinject v1.0.0-alpha.4
cosmossdk.io/errors v1.0.0
cosmossdk.io/log v1.2.1

View File

@ -191,8 +191,8 @@ cosmossdk.io/api v0.7.1-0.20230820170544-1bd37053e0c0 h1:z1aCAqEXi5fzC5tjanWnkP/
cosmossdk.io/api v0.7.1-0.20230820170544-1bd37053e0c0/go.mod h1:h4YT2OHIBT/YIwWrc5L+4dY05ZIqvo89zs6m7j4/RSk=
cosmossdk.io/collections v0.4.0 h1:PFmwj2W8szgpD5nOd8GWH6AbYNi1f2J6akWXJ7P5t9s=
cosmossdk.io/collections v0.4.0/go.mod h1:oa5lUING2dP+gdDquow+QjlF45eL1t4TJDypgGd+tv0=
cosmossdk.io/core v0.11.0 h1:vtIafqUi+1ZNAE/oxLOQQ7Oek2n4S48SWLG8h/+wdbo=
cosmossdk.io/core v0.11.0/go.mod h1:LaTtayWBSoacF5xNzoF8tmLhehqlA9z1SWiPuNC6X1w=
cosmossdk.io/core v0.12.0 h1:aFuvkG6eDv0IQC+UDjx86wxNWVAxdCFk7OABJ1Vh4RU=
cosmossdk.io/core v0.12.0/go.mod h1:LaTtayWBSoacF5xNzoF8tmLhehqlA9z1SWiPuNC6X1w=
cosmossdk.io/depinject v1.0.0-alpha.4 h1:PLNp8ZYAMPTUKyG9IK2hsbciDWqna2z1Wsl98okJopc=
cosmossdk.io/depinject v1.0.0-alpha.4/go.mod h1:HeDk7IkR5ckZ3lMGs/o91AVUc7E596vMaOmslGFM3yU=
cosmossdk.io/errors v1.0.0 h1:nxF07lmlBbB8NKQhtJ+sJm6ef5uV1XkvPXG2bUntb04=

View File

@ -6,7 +6,6 @@ import (
"github.com/cosmos/cosmos-sdk/codec/types"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/msgservice"
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1"
)
// RegisterLegacyAminoCodec registers concrete types on the LegacyAmino codec
@ -20,12 +19,6 @@ func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) {
// RegisterInterfaces registers the interfaces types with the Interface Registry.
func RegisterInterfaces(registry types.InterfaceRegistry) {
registry.RegisterImplementations(
(*govtypes.Content)(nil),
&SoftwareUpgradeProposal{},
&CancelSoftwareUpgradeProposal{},
)
registry.RegisterImplementations((*sdk.Msg)(nil),
&MsgSoftwareUpgrade{},
&MsgCancelUpgrade{},