From 50957d084118cd9d1e8ef166dd90a7a363a4344e Mon Sep 17 00:00:00 2001 From: Thomas Bruyelle Date: Mon, 6 Feb 2023 18:17:31 +0100 Subject: [PATCH] feat: Equivocation gov proposal (#703) This change adds a new kind of gov proposal that will slash and tombstone validators for double-signing. The proposal handler is added in the `provider` module, and use the `evidence` module to handle the equivocations. Co-authored-by: Albert Le Batteux Co-authored-by: Jehan --- Makefile | 4 + app/provider/app.go | 22 +- .../ccv/provider/v1/provider.proto | 10 + testutil/keeper/mocks.go | 118 +++-- testutil/keeper/unit_test_helpers.go | 17 +- .../cosmos/evidence/v1beta1/evidence.proto | 21 + x/ccv/provider/client/proposal_handler.go | 130 ++++- x/ccv/provider/keeper/keeper.go | 9 +- x/ccv/provider/keeper/proposal.go | 8 + x/ccv/provider/keeper/proposal_test.go | 27 + x/ccv/provider/proposal_handler.go | 7 +- x/ccv/provider/proposal_handler_test.go | 45 +- x/ccv/provider/types/codec.go | 4 + x/ccv/provider/types/proposal.go | 38 ++ x/ccv/provider/types/proposal_test.go | 60 ++- x/ccv/provider/types/provider.pb.go | 495 ++++++++++++++---- x/ccv/types/expected_keepers.go | 5 + 17 files changed, 835 insertions(+), 185 deletions(-) create mode 100644 third_party/proto/cosmos/evidence/v1beta1/evidence.proto diff --git a/Makefile b/Makefile index e15ec30681..e0454f6a74 100644 --- a/Makefile +++ b/Makefile @@ -96,6 +96,7 @@ SDK_QUERY = third_party/proto/cosmos/base/query/v1beta1 SDK_BASE = third_party/proto/cosmos/base/v1beta1 SDK_UPGRADE = third_party/proto/cosmos/upgrade/v1beta1 SDK_STAKING = third_party/proto/cosmos/staking/v1beta1 +SDK_EVIDENCE = third_party/proto/cosmos/evidence/v1beta1 GOGO_PROTO_TYPES = third_party/proto/gogoproto CONFIO_TYPES = third_party/proto/confio @@ -117,6 +118,9 @@ proto-update-deps: @mkdir -p $(SDK_STAKING) @curl -sSL $(SDK_PROTO_URL)/staking/v1beta1/staking.proto > $(SDK_STAKING)/staking.proto + @mkdir -p $(SDK_EVIDENCE) + @curl -sSL $(SDK_PROTO_URL)/evidence/v1beta1/evidence.proto > $(SDK_EVIDENCE)/evidence.proto + ## Importing of tendermint protobuf definitions currently requires the ## use of `sed` in order to build properly with cosmos-sdk's proto file layout ## (which is the standard Buf.build FILE_LAYOUT) diff --git a/app/provider/app.go b/app/provider/app.go index 2df7db954e..34cc7f3ebf 100644 --- a/app/provider/app.go +++ b/app/provider/app.go @@ -147,6 +147,7 @@ var ( ibcclientclient.UpgradeProposalHandler, ibcproviderclient.ConsumerAdditionProposalHandler, ibcproviderclient.ConsumerRemovalProposalHandler, + ibcproviderclient.EquivocationProposalHandler, ), params.AppModuleBasic{}, crisis.AppModuleBasic{}, @@ -421,6 +422,14 @@ func New( scopedIBCKeeper, ) + // create evidence keeper with router + app.EvidenceKeeper = *evidencekeeper.NewKeeper( + appCodec, + keys[evidencetypes.StoreKey], + app.StakingKeeper, + app.SlashingKeeper, + ) + app.ProviderKeeper = ibcproviderkeeper.NewKeeper( appCodec, keys[providertypes.StoreKey], @@ -433,6 +442,7 @@ func New( app.StakingKeeper, app.SlashingKeeper, app.AccountKeeper, + app.EvidenceKeeper, authtypes.FeeCollectorName, ) @@ -446,7 +456,7 @@ func New( AddRoute(distrtypes.RouterKey, distr.NewCommunityPoolSpendProposalHandler(app.DistrKeeper)). AddRoute(upgradetypes.RouterKey, upgrade.NewSoftwareUpgradeProposalHandler(app.UpgradeKeeper)). AddRoute(ibchost.RouterKey, ibcclient.NewClientProposalHandler(app.IBCKeeper.ClientKeeper)). - AddRoute(providertypes.RouterKey, ibcprovider.NewConsumerChainProposalHandler(app.ProviderKeeper)). + AddRoute(providertypes.RouterKey, ibcprovider.NewProviderProposalHandler(app.ProviderKeeper)). AddRoute(ibcclienttypes.RouterKey, ibcclient.NewClientProposalHandler(app.IBCKeeper.ClientKeeper)) app.GovKeeper = govkeeper.NewKeeper( @@ -479,16 +489,6 @@ func New( ibcRouter.AddRoute(providertypes.ModuleName, providerModule) app.IBCKeeper.SetRouter(ibcRouter) - // create evidence keeper with router - evidenceKeeper := evidencekeeper.NewKeeper( - appCodec, - keys[evidencetypes.StoreKey], - app.StakingKeeper, - app.SlashingKeeper, - ) - - app.EvidenceKeeper = *evidenceKeeper - skipGenesisInvariants := cast.ToBool(appOpts.Get(crisis.FlagSkipGenesisInvariants)) // NOTE: Any module instantiated in the module manager that is later modified diff --git a/proto/interchain_security/ccv/provider/v1/provider.proto b/proto/interchain_security/ccv/provider/v1/provider.proto index 214518e4c4..16f3a7bff6 100644 --- a/proto/interchain_security/ccv/provider/v1/provider.proto +++ b/proto/interchain_security/ccv/provider/v1/provider.proto @@ -10,6 +10,7 @@ import "google/protobuf/duration.proto"; import "ibc/core/client/v1/client.proto"; import "ibc/lightclients/tendermint/v1/tendermint.proto"; import "tendermint/crypto/keys.proto"; +import "cosmos/evidence/v1beta1/evidence.proto"; // ConsumerAdditionProposal is a governance proposal on the provider chain to spawn a new consumer chain. // If it passes, then all validators on the provider chain are expected to validate the consumer chain at spawn time @@ -77,6 +78,15 @@ message ConsumerRemovalProposal { [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; } +message EquivocationProposal { + // the title of the proposal + string title = 1; + // the description of the proposal + string description = 2; + // the list of equivocations that will be processed + repeated cosmos.evidence.v1beta1.Equivocation equivocations = 3; +} + // A persisted queue entry indicating that a slash packet data instance needs to be handled. // This type belongs in the "global" queue, to coordinate slash packet handling times between consumers. message GlobalSlashEntry { diff --git a/testutil/keeper/mocks.go b/testutil/keeper/mocks.go index e9c9533b10..66fc77dbce 100644 --- a/testutil/keeper/mocks.go +++ b/testutil/keeper/mocks.go @@ -1,6 +1,7 @@ // Code generated by MockGen. DO NOT EDIT. // Source: x/ccv/types/expected_keepers.go +// Package keeper is a generated GoMock package. package keeper import ( @@ -11,14 +12,15 @@ import ( types "github.com/cosmos/cosmos-sdk/types" types0 "github.com/cosmos/cosmos-sdk/x/auth/types" types1 "github.com/cosmos/cosmos-sdk/x/capability/types" - types2 "github.com/cosmos/cosmos-sdk/x/slashing/types" - types3 "github.com/cosmos/cosmos-sdk/x/staking/types" - types4 "github.com/cosmos/ibc-go/v4/modules/core/02-client/types" - types5 "github.com/cosmos/ibc-go/v4/modules/core/03-connection/types" - types6 "github.com/cosmos/ibc-go/v4/modules/core/04-channel/types" + types2 "github.com/cosmos/cosmos-sdk/x/evidence/types" + types3 "github.com/cosmos/cosmos-sdk/x/slashing/types" + types4 "github.com/cosmos/cosmos-sdk/x/staking/types" + types5 "github.com/cosmos/ibc-go/v4/modules/core/02-client/types" + types6 "github.com/cosmos/ibc-go/v4/modules/core/03-connection/types" + types7 "github.com/cosmos/ibc-go/v4/modules/core/04-channel/types" exported "github.com/cosmos/ibc-go/v4/modules/core/exported" gomock "github.com/golang/mock/gomock" - types7 "github.com/tendermint/tendermint/abci/types" + types8 "github.com/tendermint/tendermint/abci/types" ) // MockStakingKeeper is a mock of StakingKeeper interface. @@ -44,11 +46,39 @@ func (m *MockStakingKeeper) EXPECT() *MockStakingKeeperMockRecorder { return m.recorder } +// GetLastTotalPower mocks base method. +func (m *MockStakingKeeper) GetLastTotalPower(ctx types.Context) types.Int { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetLastTotalPower", ctx) + ret0, _ := ret[0].(types.Int) + return ret0 +} + +// GetLastTotalPower indicates an expected call of GetLastTotalPower. +func (mr *MockStakingKeeperMockRecorder) GetLastTotalPower(ctx interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetLastTotalPower", reflect.TypeOf((*MockStakingKeeper)(nil).GetLastTotalPower), ctx) +} + +// GetLastValidatorPower mocks base method. +func (m *MockStakingKeeper) GetLastValidatorPower(ctx types.Context, operator types.ValAddress) int64 { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetLastValidatorPower", ctx, operator) + ret0, _ := ret[0].(int64) + return ret0 +} + +// GetLastValidatorPower indicates an expected call of GetLastValidatorPower. +func (mr *MockStakingKeeperMockRecorder) GetLastValidatorPower(ctx, operator interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetLastValidatorPower", reflect.TypeOf((*MockStakingKeeper)(nil).GetLastValidatorPower), ctx, operator) +} + // GetValidator mocks base method. -func (m *MockStakingKeeper) GetValidator(ctx types.Context, addr types.ValAddress) (types3.Validator, bool) { +func (m *MockStakingKeeper) GetValidator(ctx types.Context, addr types.ValAddress) (types4.Validator, bool) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetValidator", ctx, addr) - ret0, _ := ret[0].(types3.Validator) + ret0, _ := ret[0].(types4.Validator) ret1, _ := ret[1].(bool) return ret0, ret1 } @@ -60,10 +90,10 @@ func (mr *MockStakingKeeperMockRecorder) GetValidator(ctx, addr interface{}) *go } // GetValidatorByConsAddr mocks base method. -func (m *MockStakingKeeper) GetValidatorByConsAddr(ctx types.Context, consAddr types.ConsAddress) (types3.Validator, bool) { +func (m *MockStakingKeeper) GetValidatorByConsAddr(ctx types.Context, consAddr types.ConsAddress) (types4.Validator, bool) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetValidatorByConsAddr", ctx, consAddr) - ret0, _ := ret[0].(types3.Validator) + ret0, _ := ret[0].(types4.Validator) ret1, _ := ret[1].(bool) return ret0, ret1 } @@ -75,10 +105,10 @@ func (mr *MockStakingKeeperMockRecorder) GetValidatorByConsAddr(ctx, consAddr in } // GetValidatorUpdates mocks base method. -func (m *MockStakingKeeper) GetValidatorUpdates(ctx types.Context) []types7.ValidatorUpdate { +func (m *MockStakingKeeper) GetValidatorUpdates(ctx types.Context) []types8.ValidatorUpdate { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetValidatorUpdates", ctx) - ret0, _ := ret[0].([]types7.ValidatorUpdate) + ret0, _ := ret[0].([]types8.ValidatorUpdate) return ret0 } @@ -141,7 +171,7 @@ func (mr *MockStakingKeeperMockRecorder) PutUnbondingOnHold(ctx, id interface{}) } // Slash mocks base method. -func (m *MockStakingKeeper) Slash(arg0 types.Context, arg1 types.ConsAddress, arg2, arg3 int64, arg4 types.Dec, arg5 types3.InfractionType) { +func (m *MockStakingKeeper) Slash(arg0 types.Context, arg1 types.ConsAddress, arg2, arg3 int64, arg4 types.Dec, arg5 types4.InfractionType) { m.ctrl.T.Helper() m.ctrl.Call(m, "Slash", arg0, arg1, arg2, arg3, arg4, arg5) } @@ -180,33 +210,39 @@ func (mr *MockStakingKeeperMockRecorder) UnbondingTime(ctx interface{}) *gomock. return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UnbondingTime", reflect.TypeOf((*MockStakingKeeper)(nil).UnbondingTime), ctx) } -// GetLastTotalPower mocks base method. -func (m *MockStakingKeeper) GetLastTotalPower(ctx types.Context) (val types.Int) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetLastTotalPower", ctx) - ret0, _ := ret[0].(types.Int) - return ret0 +// MockEvidenceKeeper is a mock of EvidenceKeeper interface. +type MockEvidenceKeeper struct { + ctrl *gomock.Controller + recorder *MockEvidenceKeeperMockRecorder } -// GetLastTotalPower indicates an expected call of GetLastTotalPower. -func (mr *MockStakingKeeperMockRecorder) GetLastTotalPower(ctx interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetLastTotalPower", reflect.TypeOf((*MockStakingKeeper)(nil).GetLastTotalPower), ctx) +// MockEvidenceKeeperMockRecorder is the mock recorder for MockEvidenceKeeper. +type MockEvidenceKeeperMockRecorder struct { + mock *MockEvidenceKeeper } -// GetLastValidatorPower mocks base method. -func (m *MockStakingKeeper) GetLastValidatorPower(ctx types.Context, addr types.ValAddress) (power int64) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetLastValidatorPower", ctx, addr) - ret0, _ := ret[0].(int64) - return ret0 +// NewMockEvidenceKeeper creates a new mock instance. +func NewMockEvidenceKeeper(ctrl *gomock.Controller) *MockEvidenceKeeper { + mock := &MockEvidenceKeeper{ctrl: ctrl} + mock.recorder = &MockEvidenceKeeperMockRecorder{mock} + return mock } +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockEvidenceKeeper) EXPECT() *MockEvidenceKeeperMockRecorder { + return m.recorder +} -// GetLastValidatorPower indicates an expected call of GetLastValidatorPower. -func (mr *MockStakingKeeperMockRecorder) GetLastValidatorPower(ctx, addr interface{}) *gomock.Call { +// HandleEquivocationEvidence mocks base method. +func (m *MockEvidenceKeeper) HandleEquivocationEvidence(ctx types.Context, evidence *types2.Equivocation) { + m.ctrl.T.Helper() + m.ctrl.Call(m, "HandleEquivocationEvidence", ctx, evidence) +} + +// HandleEquivocationEvidence indicates an expected call of HandleEquivocationEvidence. +func (mr *MockEvidenceKeeperMockRecorder) HandleEquivocationEvidence(ctx, evidence interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetLastValidatorPower", reflect.TypeOf((*MockStakingKeeper)(nil).GetLastValidatorPower), ctx, addr) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "HandleEquivocationEvidence", reflect.TypeOf((*MockEvidenceKeeper)(nil).HandleEquivocationEvidence), ctx, evidence) } // MockSlashingKeeper is a mock of SlashingKeeper interface. @@ -247,10 +283,10 @@ func (mr *MockSlashingKeeperMockRecorder) DowntimeJailDuration(arg0 interface{}) } // GetValidatorSigningInfo mocks base method. -func (m *MockSlashingKeeper) GetValidatorSigningInfo(ctx types.Context, address types.ConsAddress) (types2.ValidatorSigningInfo, bool) { +func (m *MockSlashingKeeper) GetValidatorSigningInfo(ctx types.Context, address types.ConsAddress) (types3.ValidatorSigningInfo, bool) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetValidatorSigningInfo", ctx, address) - ret0, _ := ret[0].(types2.ValidatorSigningInfo) + ret0, _ := ret[0].(types3.ValidatorSigningInfo) ret1, _ := ret[1].(bool) return ret0, ret1 } @@ -365,10 +401,10 @@ func (mr *MockChannelKeeperMockRecorder) ChanCloseInit(ctx, portID, channelID, c } // GetChannel mocks base method. -func (m *MockChannelKeeper) GetChannel(ctx types.Context, srcPort, srcChan string) (types6.Channel, bool) { +func (m *MockChannelKeeper) GetChannel(ctx types.Context, srcPort, srcChan string) (types7.Channel, bool) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetChannel", ctx, srcPort, srcChan) - ret0, _ := ret[0].(types6.Channel) + ret0, _ := ret[0].(types7.Channel) ret1, _ := ret[1].(bool) return ret0, ret1 } @@ -483,10 +519,10 @@ func (m *MockConnectionKeeper) EXPECT() *MockConnectionKeeperMockRecorder { } // GetConnection mocks base method. -func (m *MockConnectionKeeper) GetConnection(ctx types.Context, connectionID string) (types5.ConnectionEnd, bool) { +func (m *MockConnectionKeeper) GetConnection(ctx types.Context, connectionID string) (types6.ConnectionEnd, bool) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetConnection", ctx, connectionID) - ret0, _ := ret[0].(types5.ConnectionEnd) + ret0, _ := ret[0].(types6.ConnectionEnd) ret1, _ := ret[1].(bool) return ret0, ret1 } @@ -741,7 +777,7 @@ func (m *MockIBCTransferKeeper) EXPECT() *MockIBCTransferKeeperMockRecorder { } // SendTransfer mocks base method. -func (m *MockIBCTransferKeeper) SendTransfer(ctx types.Context, sourcePort, sourceChannel string, token types.Coin, sender types.AccAddress, receiver string, timeoutHeight types4.Height, timeoutTimestamp uint64) error { +func (m *MockIBCTransferKeeper) SendTransfer(ctx types.Context, sourcePort, sourceChannel string, token types.Coin, sender types.AccAddress, receiver string, timeoutHeight types5.Height, timeoutTimestamp uint64) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "SendTransfer", ctx, sourcePort, sourceChannel, token, sender, receiver, timeoutHeight, timeoutTimestamp) ret0, _ := ret[0].(error) @@ -778,10 +814,10 @@ func (m *MockIBCCoreKeeper) EXPECT() *MockIBCCoreKeeperMockRecorder { } // ChannelOpenInit mocks base method. -func (m *MockIBCCoreKeeper) ChannelOpenInit(goCtx context.Context, msg *types6.MsgChannelOpenInit) (*types6.MsgChannelOpenInitResponse, error) { +func (m *MockIBCCoreKeeper) ChannelOpenInit(goCtx context.Context, msg *types7.MsgChannelOpenInit) (*types7.MsgChannelOpenInitResponse, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "ChannelOpenInit", goCtx, msg) - ret0, _ := ret[0].(*types6.MsgChannelOpenInitResponse) + ret0, _ := ret[0].(*types7.MsgChannelOpenInitResponse) ret1, _ := ret[1].(error) return ret0, ret1 } diff --git a/testutil/keeper/unit_test_helpers.go b/testutil/keeper/unit_test_helpers.go index 7f2267d0a2..3dd5d98299 100644 --- a/testutil/keeper/unit_test_helpers.go +++ b/testutil/keeper/unit_test_helpers.go @@ -86,6 +86,7 @@ type MockedKeepers struct { *MockBankKeeper *MockIBCTransferKeeper *MockIBCCoreKeeper + *MockEvidenceKeeper } // NewMockedKeepers instantiates a struct with pointers to properly instantiated mocked keepers. @@ -102,12 +103,12 @@ func NewMockedKeepers(ctrl *gomock.Controller) MockedKeepers { MockBankKeeper: NewMockBankKeeper(ctrl), MockIBCTransferKeeper: NewMockIBCTransferKeeper(ctrl), MockIBCCoreKeeper: NewMockIBCCoreKeeper(ctrl), + MockEvidenceKeeper: NewMockEvidenceKeeper(ctrl), } } // NewInMemProviderKeeper instantiates an in-mem provider keeper from params and mocked keepers func NewInMemProviderKeeper(params InMemKeeperParams, mocks MockedKeepers) providerkeeper.Keeper { - return providerkeeper.NewKeeper( params.Cdc, params.StoreKey, @@ -120,13 +121,13 @@ func NewInMemProviderKeeper(params InMemKeeperParams, mocks MockedKeepers) provi mocks.MockStakingKeeper, mocks.MockSlashingKeeper, mocks.MockAccountKeeper, + mocks.MockEvidenceKeeper, "", ) } // NewInMemConsumerKeeper instantiates an in-mem consumer keeper from params and mocked keepers func NewInMemConsumerKeeper(params InMemKeeperParams, mocks MockedKeepers) consumerkeeper.Keeper { - return consumerkeeper.NewKeeper( params.Cdc, params.StoreKey, @@ -150,8 +151,8 @@ func NewInMemConsumerKeeper(params InMemKeeperParams, mocks MockedKeepers) consu // Note: Calling ctrl.Finish() at the end of a test function ensures that // no unexpected calls to external keepers are made. func GetProviderKeeperAndCtx(t *testing.T, params InMemKeeperParams) ( - providerkeeper.Keeper, sdk.Context, *gomock.Controller, MockedKeepers) { - + providerkeeper.Keeper, sdk.Context, *gomock.Controller, MockedKeepers, +) { ctrl := gomock.NewController(t) mocks := NewMockedKeepers(ctrl) return NewInMemProviderKeeper(params, mocks), params.Ctx, ctrl, mocks @@ -162,8 +163,8 @@ func GetProviderKeeperAndCtx(t *testing.T, params InMemKeeperParams) ( // Note: Calling ctrl.Finish() at the end of a test function ensures that // no unexpected calls to external keepers are made. func GetConsumerKeeperAndCtx(t *testing.T, params InMemKeeperParams) ( - consumerkeeper.Keeper, sdk.Context, *gomock.Controller, MockedKeepers) { - + consumerkeeper.Keeper, sdk.Context, *gomock.Controller, MockedKeepers, +) { ctrl := gomock.NewController(t) mocks := NewMockedKeepers(ctrl) return NewInMemConsumerKeeper(params, mocks), params.Ctx, ctrl, mocks @@ -219,8 +220,8 @@ func GetNewVSCMaturedPacketData() ccvtypes.VSCMaturedPacketData { // SetupForStoppingConsumerChain registers expected mock calls and corresponding state setup // which asserts that a consumer chain was properly stopped from StopConsumerChain(). func SetupForStoppingConsumerChain(t *testing.T, ctx sdk.Context, - providerKeeper *providerkeeper.Keeper, mocks MockedKeepers) { - + providerKeeper *providerkeeper.Keeper, mocks MockedKeepers, +) { expectations := GetMocksForCreateConsumerClient(ctx, &mocks, "chainID", clienttypes.NewHeight(4, 5)) expectations = append(expectations, GetMocksForSetConsumerChain(ctx, &mocks, "chainID")...) diff --git a/third_party/proto/cosmos/evidence/v1beta1/evidence.proto b/third_party/proto/cosmos/evidence/v1beta1/evidence.proto new file mode 100644 index 0000000000..14612c314f --- /dev/null +++ b/third_party/proto/cosmos/evidence/v1beta1/evidence.proto @@ -0,0 +1,21 @@ +syntax = "proto3"; +package cosmos.evidence.v1beta1; + +option go_package = "github.com/cosmos/cosmos-sdk/x/evidence/types"; +option (gogoproto.equal_all) = true; + +import "gogoproto/gogo.proto"; +import "google/protobuf/timestamp.proto"; + +// Equivocation implements the Evidence interface and defines evidence of double +// signing misbehavior. +message Equivocation { + option (gogoproto.goproto_stringer) = false; + option (gogoproto.goproto_getters) = false; + option (gogoproto.equal) = false; + + int64 height = 1; + google.protobuf.Timestamp time = 2 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; + int64 power = 3; + string consensus_address = 4 [(gogoproto.moretags) = "yaml:\"consensus_address\""]; +} \ No newline at end of file diff --git a/x/ccv/provider/client/proposal_handler.go b/x/ccv/provider/client/proposal_handler.go index 2feb155178..8be7f0fb56 100644 --- a/x/ccv/provider/client/proposal_handler.go +++ b/x/ccv/provider/client/proposal_handler.go @@ -2,11 +2,11 @@ package client import ( "encoding/json" + "fmt" "io/ioutil" "net/http" - "time" - "path/filepath" + "time" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/tx" @@ -23,6 +23,7 @@ import ( var ( ConsumerAdditionProposalHandler = govclient.NewProposalHandler(SubmitConsumerAdditionPropTxCmd, ConsumerAdditionProposalRESTHandler) ConsumerRemovalProposalHandler = govclient.NewProposalHandler(SubmitConsumerRemovalProposalTxCmd, ConsumerRemovalProposalRESTHandler) + EquivocationProposalHandler = govclient.NewProposalHandler(SubmitEquivocationProposalTxCmd, EquivocationProposalRESTHandler) ) // SubmitConsumerAdditionPropTxCmd returns a CLI command handler for submitting @@ -149,6 +150,64 @@ Where proposal.json contains: } } +// SubmitEquivocationProposalTxCmd returns a CLI command handler for submitting +// a equivocation proposal via a transaction. +func SubmitEquivocationProposalTxCmd() *cobra.Command { + return &cobra.Command{ + Use: "equivocation [proposal-file]", + Args: cobra.ExactArgs(1), + Short: "Submit an equivocation proposal", + Long: fmt.Sprintf(`Submit an equivocation proposal along with an initial deposit. +The proposal details must be supplied via a JSON file. + +Example: +$ tx gov submit-proposal equivocation --from= + +Where proposal.json contains: +{ + "title": "Equivoque Foo validator", + "description": "He double-signs on the Foobar consumer chain", + "equivocations": [ + { + "height": 10420042, + "time": "2023-01-27T15:59:50.121607-08:00", + "power": 10, + "consensus_address": "%s1s5afhd6gxevu37mkqcvvsj8qeylhn0rz46zdlq" + } + ], + "deposit": "10000stake" +} +`, sdk.GetConfig().GetBech32ConsensusAddrPrefix()), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + proposal, err := ParseEquivocationProposalJSON(args[0]) + if err != nil { + return err + } + + content := types.NewEquivocationProposal(proposal.Title, proposal.Description, proposal.Equivocations) + + from := clientCtx.GetFromAddress() + + deposit, err := sdk.ParseCoinsNormalized(proposal.Deposit) + if err != nil { + return err + } + + msg, err := govtypes.NewMsgSubmitProposal(content, deposit, from) + if err != nil { + return err + } + + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) + }, + } +} + type ConsumerAdditionProposalJSON struct { Title string `json:"title"` Description string `json:"description"` @@ -225,6 +284,46 @@ type ConsumerRemovalProposalReq struct { Deposit sdk.Coins `json:"deposit"` } +type EquivocationProposalJSON struct { + // evidencetypes "github.com/cosmos/cosmos-sdk/x/evidence/types" + types.EquivocationProposal + + Deposit string `json:"deposit"` +} + +type EquivocationProposalReq struct { + BaseReq rest.BaseReq `json:"base_req"` + Proposer sdk.AccAddress `json:"proposer"` + + // evidencetypes "github.com/cosmos/cosmos-sdk/x/evidence/types" + types.EquivocationProposal + + Deposit sdk.Coins `json:"deposit"` +} + +func ParseEquivocationProposalJSON(proposalFile string) (EquivocationProposalJSON, error) { + proposal := EquivocationProposalJSON{} + + contents, err := ioutil.ReadFile(filepath.Clean(proposalFile)) + if err != nil { + return proposal, err + } + + if err := json.Unmarshal(contents, &proposal); err != nil { + return proposal, err + } + + return proposal, nil +} + +// EquivocationProposalRESTHandler returns a ProposalRESTHandler that exposes the equivocation rest handler. +func EquivocationProposalRESTHandler(clientCtx client.Context) govrest.ProposalRESTHandler { + return govrest.ProposalRESTHandler{ + SubRoute: "equivocation", + Handler: postEquivocationProposalHandlerFn(clientCtx), + } +} + func ParseConsumerRemovalProposalJSON(proposalFile string) (ConsumerRemovalProposalJSON, error) { proposal := ConsumerRemovalProposalJSON{} @@ -315,3 +414,30 @@ func postConsumerRemovalProposalHandlerFn(clientCtx client.Context) http.Handler tx.WriteGeneratedTxResponse(clientCtx, w, req.BaseReq, msg) } } + +func postEquivocationProposalHandlerFn(clientCtx client.Context) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + var req EquivocationProposalReq + if !rest.ReadRESTReq(w, r, clientCtx.LegacyAmino, &req) { + return + } + + req.BaseReq = req.BaseReq.Sanitize() + if !req.BaseReq.ValidateBasic(w) { + return + } + + content := types.NewEquivocationProposal(req.Title, req.Description, req.Equivocations) + + msg, err := govtypes.NewMsgSubmitProposal(content, req.Deposit, req.Proposer) + if rest.CheckBadRequestError(w, err) { + return + } + + if rest.CheckBadRequestError(w, msg.ValidateBasic()) { + return + } + + tx.WriteGeneratedTxResponse(clientCtx, w, req.BaseReq, msg) + } +} diff --git a/x/ccv/provider/keeper/keeper.go b/x/ccv/provider/keeper/keeper.go index ef2c4d289d..daf45ac749 100644 --- a/x/ccv/provider/keeper/keeper.go +++ b/x/ccv/provider/keeper/keeper.go @@ -38,6 +38,7 @@ type Keeper struct { clientKeeper ccv.ClientKeeper stakingKeeper ccv.StakingKeeper slashingKeeper ccv.SlashingKeeper + evidenceKeeper ccv.EvidenceKeeper feeCollectorName string } @@ -47,7 +48,8 @@ func NewKeeper( channelKeeper ccv.ChannelKeeper, portKeeper ccv.PortKeeper, connectionKeeper ccv.ConnectionKeeper, clientKeeper ccv.ClientKeeper, stakingKeeper ccv.StakingKeeper, slashingKeeper ccv.SlashingKeeper, - accountKeeper ccv.AccountKeeper, feeCollectorName string, + accountKeeper ccv.AccountKeeper, evidenceKeeper ccv.EvidenceKeeper, + feeCollectorName string, ) Keeper { // set KeyTable if it has not already been set if !paramSpace.HasKeyTable() { @@ -66,6 +68,7 @@ func NewKeeper( clientKeeper: clientKeeper, stakingKeeper: stakingKeeper, slashingKeeper: slashingKeeper, + evidenceKeeper: evidenceKeeper, feeCollectorName: feeCollectorName, } } @@ -569,8 +572,8 @@ func (k Keeper) ConsumeMaturedUnbondingOps(ctx sdk.Context) []uint64 { // Retrieves the underlying client state corresponding to a connection ID. func (k Keeper) getUnderlyingClient(ctx sdk.Context, connectionID string) ( - clientID string, tmClient *ibctmtypes.ClientState, err error) { - + clientID string, tmClient *ibctmtypes.ClientState, err error, +) { conn, ok := k.connectionKeeper.GetConnection(ctx, connectionID) if !ok { return "", nil, sdkerrors.Wrapf(conntypes.ErrConnectionNotFound, diff --git a/x/ccv/provider/keeper/proposal.go b/x/ccv/provider/keeper/proposal.go index ff8091c575..4843ca3e4b 100644 --- a/x/ccv/provider/keeper/proposal.go +++ b/x/ccv/provider/keeper/proposal.go @@ -601,3 +601,11 @@ func (k Keeper) StopConsumerChainInCachedCtx(ctx sdk.Context, p types.ConsumerRe err = k.StopConsumerChain(ctx, p.ChainId, true) return } + +// HandleEquivocationProposal handles an equivocation proposal. +func (k Keeper) HandleEquivocationProposal(ctx sdk.Context, p *types.EquivocationProposal) error { + for _, ev := range p.Equivocations { + k.evidenceKeeper.HandleEquivocationEvidence(ctx, ev) + } + return nil +} diff --git a/x/ccv/provider/keeper/proposal_test.go b/x/ccv/provider/keeper/proposal_test.go index 583d96b5bb..d1b48c6efe 100644 --- a/x/ccv/provider/keeper/proposal_test.go +++ b/x/ccv/provider/keeper/proposal_test.go @@ -9,6 +9,7 @@ import ( _go "github.com/confio/ics23/go" sdk "github.com/cosmos/cosmos-sdk/types" + evidencetypes "github.com/cosmos/cosmos-sdk/x/evidence/types" clienttypes "github.com/cosmos/ibc-go/v4/modules/core/02-client/types" ibctmtypes "github.com/cosmos/ibc-go/v4/modules/light-clients/07-tendermint/types" "github.com/golang/mock/gomock" @@ -999,3 +1000,29 @@ func TestBeginBlockCCR(t *testing.T) { ctx, invalidProp.ChainId, invalidProp.StopTime) require.False(t, found) } + +func TestHandleEquivocationProposal(t *testing.T) { + keeperParams := testkeeper.NewInMemKeeperParams(t) + keeper, ctx, _, mocks := testkeeper.GetProviderKeeperAndCtx(t, keeperParams) + equivocation1 := &evidencetypes.Equivocation{ + Time: time.Now(), + Height: 1, + Power: 1, + ConsensusAddress: "addr1", + } + equivocation2 := &evidencetypes.Equivocation{ + Time: time.Now(), + Height: 1, + Power: 1, + ConsensusAddress: "addr2", + } + prop := &providertypes.EquivocationProposal{ + Equivocations: []*evidencetypes.Equivocation{equivocation1, equivocation2}, + } + mocks.MockEvidenceKeeper.EXPECT().HandleEquivocationEvidence(ctx, equivocation1) + mocks.MockEvidenceKeeper.EXPECT().HandleEquivocationEvidence(ctx, equivocation2) + + err := keeper.HandleEquivocationProposal(ctx, prop) + + require.NoError(t, err) +} diff --git a/x/ccv/provider/proposal_handler.go b/x/ccv/provider/proposal_handler.go index efb5f30bbc..01ffd88dac 100644 --- a/x/ccv/provider/proposal_handler.go +++ b/x/ccv/provider/proposal_handler.go @@ -8,15 +8,18 @@ import ( "github.com/cosmos/interchain-security/x/ccv/provider/types" ) -// NewConsumerChainProposalHandler defines the handler for consumer addition and consumer removal proposals. +// NewProviderProposalHandler defines the handler for consumer addition, +// consumer removal and equivocation proposals. // Passed proposals are executed during EndBlock. -func NewConsumerChainProposalHandler(k keeper.Keeper) govtypes.Handler { +func NewProviderProposalHandler(k keeper.Keeper) govtypes.Handler { return func(ctx sdk.Context, content govtypes.Content) error { switch c := content.(type) { case *types.ConsumerAdditionProposal: return k.HandleConsumerAdditionProposal(ctx, c) case *types.ConsumerRemovalProposal: return k.HandleConsumerRemovalProposal(ctx, c) + case *types.EquivocationProposal: + return k.HandleEquivocationProposal(ctx, c) default: return sdkerrors.Wrapf(sdkerrors.ErrUnknownRequest, "unrecognized ccv proposal content type: %T", c) } diff --git a/x/ccv/provider/proposal_handler_test.go b/x/ccv/provider/proposal_handler_test.go index 30a2224ee1..20bc6dcd8e 100644 --- a/x/ccv/provider/proposal_handler_test.go +++ b/x/ccv/provider/proposal_handler_test.go @@ -1,29 +1,30 @@ package provider_test import ( + "testing" + "time" + sdk "github.com/cosmos/cosmos-sdk/types" distributiontypes "github.com/cosmos/cosmos-sdk/x/distribution/types" + evidencetypes "github.com/cosmos/cosmos-sdk/x/evidence/types" "github.com/golang/mock/gomock" "github.com/stretchr/testify/require" clienttypes "github.com/cosmos/ibc-go/v4/modules/core/02-client/types" - "testing" - "time" - govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" testkeeper "github.com/cosmos/interchain-security/testutil/keeper" "github.com/cosmos/interchain-security/x/ccv/provider" providertypes "github.com/cosmos/interchain-security/x/ccv/provider/types" ) -// TestConsumerChainProposalHandler tests the highest level handler for proposals concerning both -// creating and stopping consumer chains. -func TestConsumerChainProposalHandler(t *testing.T) { - +// TestProviderProposalHandler tests the highest level handler for proposals +// concerning creating, stopping consumer chains and submitting equivocations. +func TestProviderProposalHandler(t *testing.T) { // Snapshot times asserted in tests now := time.Now().UTC() hourFromNow := now.Add(time.Hour).UTC() + equivocation := &evidencetypes.Equivocation{Height: 42} testCases := []struct { name string @@ -31,6 +32,7 @@ func TestConsumerChainProposalHandler(t *testing.T) { blockTime time.Time expValidConsumerAddition bool expValidConsumerRemoval bool + expValidEquivocation bool }{ { name: "valid consumer addition proposal", @@ -54,6 +56,13 @@ func TestConsumerChainProposalHandler(t *testing.T) { blockTime: hourFromNow, expValidConsumerRemoval: true, }, + { + name: "valid equivocation posal", + content: providertypes.NewEquivocationProposal( + "title", "description", []*evidencetypes.Equivocation{equivocation}), + blockTime: hourFromNow, + expValidEquivocation: true, + }, { name: "nil proposal", content: nil, @@ -71,27 +80,33 @@ func TestConsumerChainProposalHandler(t *testing.T) { // Setup keeperParams := testkeeper.NewInMemKeeperParams(t) - providerKeeper, ctx, ctrl, mocks := testkeeper.GetProviderKeeperAndCtx(t, keeperParams) + providerKeeper, ctx, _, mocks := testkeeper.GetProviderKeeperAndCtx(t, keeperParams) providerKeeper.SetParams(ctx, providertypes.DefaultParams()) ctx = ctx.WithBlockTime(tc.blockTime) // Mock expectations depending on expected outcome - if tc.expValidConsumerAddition { - gomock.InOrder(testkeeper.GetMocksForCreateConsumerClient(ctx, &mocks, "chainID", clienttypes.NewHeight(2, 3))...) - } - if tc.expValidConsumerRemoval { + switch { + case tc.expValidConsumerAddition: + gomock.InOrder(testkeeper.GetMocksForCreateConsumerClient( + ctx, &mocks, "chainID", clienttypes.NewHeight(2, 3), + )...) + + case tc.expValidConsumerRemoval: testkeeper.SetupForStoppingConsumerChain(t, ctx, &providerKeeper, mocks) + + case tc.expValidEquivocation: + mocks.MockEvidenceKeeper.EXPECT().HandleEquivocationEvidence(ctx, equivocation) } // Execution - proposalHandler := provider.NewConsumerChainProposalHandler(providerKeeper) + proposalHandler := provider.NewProviderProposalHandler(providerKeeper) err := proposalHandler(ctx, tc.content) - if tc.expValidConsumerAddition || tc.expValidConsumerRemoval { + if tc.expValidConsumerAddition || tc.expValidConsumerRemoval || + tc.expValidEquivocation { require.NoError(t, err) } else { require.Error(t, err) } - ctrl.Finish() } } diff --git a/x/ccv/provider/types/codec.go b/x/ccv/provider/types/codec.go index e19308ba88..97772e7f00 100644 --- a/x/ccv/provider/types/codec.go +++ b/x/ccv/provider/types/codec.go @@ -27,6 +27,10 @@ func RegisterInterfaces(registry codectypes.InterfaceRegistry) { (*sdk.Msg)(nil), &MsgAssignConsumerKey{}, ) + registry.RegisterImplementations( + (*govtypes.Content)(nil), + &EquivocationProposal{}, + ) msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) } diff --git a/x/ccv/provider/types/proposal.go b/x/ccv/provider/types/proposal.go index c31bb23b72..f5c702a322 100644 --- a/x/ccv/provider/types/proposal.go +++ b/x/ccv/provider/types/proposal.go @@ -1,11 +1,13 @@ package types import ( + "errors" "fmt" "strings" time "time" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + evidencetypes "github.com/cosmos/cosmos-sdk/x/evidence/types" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" clienttypes "github.com/cosmos/ibc-go/v4/modules/core/02-client/types" ccvtypes "github.com/cosmos/interchain-security/x/ccv/types" @@ -14,16 +16,19 @@ import ( const ( ProposalTypeConsumerAddition = "ConsumerAddition" ProposalTypeConsumerRemoval = "ConsumerRemoval" + ProposalTypeEquivocation = "Equivocation" ) var ( _ govtypes.Content = &ConsumerAdditionProposal{} _ govtypes.Content = &ConsumerRemovalProposal{} + _ govtypes.Content = &EquivocationProposal{} ) func init() { govtypes.RegisterProposalType(ProposalTypeConsumerAddition) govtypes.RegisterProposalType(ProposalTypeConsumerRemoval) + govtypes.RegisterProposalType(ProposalTypeEquivocation) } // NewConsumerAdditionProposal creates a new consumer addition proposal. @@ -182,3 +187,36 @@ func (sccp *ConsumerRemovalProposal) ValidateBasic() error { } return nil } + +// NewEquivocationProposal creates a new equivocation proposal. +func NewEquivocationProposal(title, description string, equivocations []*evidencetypes.Equivocation) govtypes.Content { + return &EquivocationProposal{ + Title: title, + Description: description, + Equivocations: equivocations, + } +} + +// ProposalRoute returns the routing key of an equivocation proposal. +func (sp *EquivocationProposal) ProposalRoute() string { return RouterKey } + +// ProposalType returns the type of a equivocation proposal. +func (sp *EquivocationProposal) ProposalType() string { + return ProposalTypeEquivocation +} + +// ValidateBasic runs basic stateless validity checks +func (sp *EquivocationProposal) ValidateBasic() error { + if err := govtypes.ValidateAbstract(sp); err != nil { + return err + } + if len(sp.Equivocations) == 0 { + return errors.New("invalid equivocation proposal: empty equivocations") + } + for i := 0; i < len(sp.Equivocations); i++ { + if err := sp.Equivocations[i].ValidateBasic(); err != nil { + return err + } + } + return nil +} diff --git a/x/ccv/provider/types/proposal_test.go b/x/ccv/provider/types/proposal_test.go index edca61d814..a1ff43fa9b 100644 --- a/x/ccv/provider/types/proposal_test.go +++ b/x/ccv/provider/types/proposal_test.go @@ -5,6 +5,8 @@ import ( "testing" "time" + evidencetypes "github.com/cosmos/cosmos-sdk/x/evidence/types" + "github.com/golang/protobuf/proto" //nolint - see: https://github.com/cosmos/interchain-security/issues/236 "github.com/stretchr/testify/require" @@ -17,7 +19,7 @@ import ( "github.com/cosmos/interchain-security/x/ccv/provider/types" ) -func TestValidateBasic(t *testing.T) { +func TestConsumerAdditionProposalValidateBasic(t *testing.T) { initialHeight := clienttypes.NewHeight(2, 3) testCases := []struct { @@ -274,3 +276,59 @@ func TestConsumerAdditionProposalString(t *testing.T) { require.Equal(t, expect, proposal.String(), "string method for ConsumerAdditionProposal returned unexpected string") } + +func TestEquivocationProposalValidateBasic(t *testing.T) { + tests := []struct { + name string + proposal govtypes.Content + expectedError string + }{ + { + name: "fail: validate abstract - empty title", + proposal: types.NewEquivocationProposal("", "", nil), + expectedError: "proposal title cannot be blank: invalid proposal content", + }, + { + name: "fail: equivocations is empty", + proposal: types.NewEquivocationProposal("title", "desc", nil), + expectedError: "invalid equivocation proposal: empty equivocations", + }, + { + name: "fail: invalid equivocation", + proposal: types.NewEquivocationProposal("title", "desc", + []*evidencetypes.Equivocation{ + { + Time: time.Now(), + Height: 1, + Power: 1, + ConsensusAddress: "addr", + }, + {}, // invalid one + }), + expectedError: "invalid equivocation time: 0001-01-01 00:00:00 +0000 UTC", + }, + { + name: "ok", + proposal: types.NewEquivocationProposal("title", "desc", + []*evidencetypes.Equivocation{ + { + Time: time.Now(), + Height: 1, + Power: 1, + ConsensusAddress: "addr", + }, + }), + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + err := tt.proposal.ValidateBasic() + + if tt.expectedError != "" { + require.EqualError(t, err, tt.expectedError) + return + } + require.NoError(t, err) + }) + } +} diff --git a/x/ccv/provider/types/provider.pb.go b/x/ccv/provider/types/provider.pb.go index 8dc156c012..a52166adf3 100644 --- a/x/ccv/provider/types/provider.pb.go +++ b/x/ccv/provider/types/provider.pb.go @@ -5,8 +5,9 @@ package types import ( fmt "fmt" + types1 "github.com/cosmos/cosmos-sdk/x/evidence/types" types "github.com/cosmos/ibc-go/v4/modules/core/02-client/types" - types1 "github.com/cosmos/ibc-go/v4/modules/light-clients/07-tendermint/types" + types2 "github.com/cosmos/ibc-go/v4/modules/light-clients/07-tendermint/types" _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" @@ -181,6 +182,69 @@ func (m *ConsumerRemovalProposal) GetStopTime() time.Time { return time.Time{} } +type EquivocationProposal struct { + // the title of the proposal + Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` + // the description of the proposal + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` + // the list of equivocations that will be processed + Equivocations []*types1.Equivocation `protobuf:"bytes,3,rep,name=equivocations,proto3" json:"equivocations,omitempty"` +} + +func (m *EquivocationProposal) Reset() { *m = EquivocationProposal{} } +func (m *EquivocationProposal) String() string { return proto.CompactTextString(m) } +func (*EquivocationProposal) ProtoMessage() {} +func (*EquivocationProposal) Descriptor() ([]byte, []int) { + return fileDescriptor_f22ec409a72b7b72, []int{2} +} +func (m *EquivocationProposal) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EquivocationProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_EquivocationProposal.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *EquivocationProposal) XXX_Merge(src proto.Message) { + xxx_messageInfo_EquivocationProposal.Merge(m, src) +} +func (m *EquivocationProposal) XXX_Size() int { + return m.Size() +} +func (m *EquivocationProposal) XXX_DiscardUnknown() { + xxx_messageInfo_EquivocationProposal.DiscardUnknown(m) +} + +var xxx_messageInfo_EquivocationProposal proto.InternalMessageInfo + +func (m *EquivocationProposal) GetTitle() string { + if m != nil { + return m.Title + } + return "" +} + +func (m *EquivocationProposal) GetDescription() string { + if m != nil { + return m.Description + } + return "" +} + +func (m *EquivocationProposal) GetEquivocations() []*types1.Equivocation { + if m != nil { + return m.Equivocations + } + return nil +} + // A persisted queue entry indicating that a slash packet data instance needs to be handled. // This type belongs in the "global" queue, to coordinate slash packet handling times between consumers. type GlobalSlashEntry struct { @@ -203,7 +267,7 @@ func (m *GlobalSlashEntry) Reset() { *m = GlobalSlashEntry{} } func (m *GlobalSlashEntry) String() string { return proto.CompactTextString(m) } func (*GlobalSlashEntry) ProtoMessage() {} func (*GlobalSlashEntry) Descriptor() ([]byte, []int) { - return fileDescriptor_f22ec409a72b7b72, []int{2} + return fileDescriptor_f22ec409a72b7b72, []int{3} } func (m *GlobalSlashEntry) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -262,7 +326,7 @@ func (m *GlobalSlashEntry) GetProviderValConsAddr() []byte { // Params defines the parameters for CCV Provider module type Params struct { - TemplateClient *types1.ClientState `protobuf:"bytes,1,opt,name=template_client,json=templateClient,proto3" json:"template_client,omitempty"` + TemplateClient *types2.ClientState `protobuf:"bytes,1,opt,name=template_client,json=templateClient,proto3" json:"template_client,omitempty"` // TrustingPeriodFraction is used to compute the consumer and provider IBC client's TrustingPeriod from the chain defined UnbondingPeriod TrustingPeriodFraction string `protobuf:"bytes,2,opt,name=trusting_period_fraction,json=trustingPeriodFraction,proto3" json:"trusting_period_fraction,omitempty"` // Sent IBC packets will timeout after this duration @@ -288,7 +352,7 @@ func (m *Params) Reset() { *m = Params{} } func (m *Params) String() string { return proto.CompactTextString(m) } func (*Params) ProtoMessage() {} func (*Params) Descriptor() ([]byte, []int) { - return fileDescriptor_f22ec409a72b7b72, []int{3} + return fileDescriptor_f22ec409a72b7b72, []int{4} } func (m *Params) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -317,7 +381,7 @@ func (m *Params) XXX_DiscardUnknown() { var xxx_messageInfo_Params proto.InternalMessageInfo -func (m *Params) GetTemplateClient() *types1.ClientState { +func (m *Params) GetTemplateClient() *types2.ClientState { if m != nil { return m.TemplateClient } @@ -382,7 +446,7 @@ func (m *HandshakeMetadata) Reset() { *m = HandshakeMetadata{} } func (m *HandshakeMetadata) String() string { return proto.CompactTextString(m) } func (*HandshakeMetadata) ProtoMessage() {} func (*HandshakeMetadata) Descriptor() ([]byte, []int) { - return fileDescriptor_f22ec409a72b7b72, []int{4} + return fileDescriptor_f22ec409a72b7b72, []int{5} } func (m *HandshakeMetadata) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -435,7 +499,7 @@ func (m *SlashAcks) Reset() { *m = SlashAcks{} } func (m *SlashAcks) String() string { return proto.CompactTextString(m) } func (*SlashAcks) ProtoMessage() {} func (*SlashAcks) Descriptor() ([]byte, []int) { - return fileDescriptor_f22ec409a72b7b72, []int{5} + return fileDescriptor_f22ec409a72b7b72, []int{6} } func (m *SlashAcks) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -481,7 +545,7 @@ func (m *ConsumerAdditionProposals) Reset() { *m = ConsumerAdditionPropo func (m *ConsumerAdditionProposals) String() string { return proto.CompactTextString(m) } func (*ConsumerAdditionProposals) ProtoMessage() {} func (*ConsumerAdditionProposals) Descriptor() ([]byte, []int) { - return fileDescriptor_f22ec409a72b7b72, []int{6} + return fileDescriptor_f22ec409a72b7b72, []int{7} } func (m *ConsumerAdditionProposals) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -527,7 +591,7 @@ func (m *ConsumerRemovalProposals) Reset() { *m = ConsumerRemovalProposa func (m *ConsumerRemovalProposals) String() string { return proto.CompactTextString(m) } func (*ConsumerRemovalProposals) ProtoMessage() {} func (*ConsumerRemovalProposals) Descriptor() ([]byte, []int) { - return fileDescriptor_f22ec409a72b7b72, []int{7} + return fileDescriptor_f22ec409a72b7b72, []int{8} } func (m *ConsumerRemovalProposals) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -572,7 +636,7 @@ func (m *AddressList) Reset() { *m = AddressList{} } func (m *AddressList) String() string { return proto.CompactTextString(m) } func (*AddressList) ProtoMessage() {} func (*AddressList) Descriptor() ([]byte, []int) { - return fileDescriptor_f22ec409a72b7b72, []int{8} + return fileDescriptor_f22ec409a72b7b72, []int{9} } func (m *AddressList) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -617,7 +681,7 @@ func (m *ChannelToChain) Reset() { *m = ChannelToChain{} } func (m *ChannelToChain) String() string { return proto.CompactTextString(m) } func (*ChannelToChain) ProtoMessage() {} func (*ChannelToChain) Descriptor() ([]byte, []int) { - return fileDescriptor_f22ec409a72b7b72, []int{9} + return fileDescriptor_f22ec409a72b7b72, []int{10} } func (m *ChannelToChain) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -671,7 +735,7 @@ func (m *VscUnbondingOps) Reset() { *m = VscUnbondingOps{} } func (m *VscUnbondingOps) String() string { return proto.CompactTextString(m) } func (*VscUnbondingOps) ProtoMessage() {} func (*VscUnbondingOps) Descriptor() ([]byte, []int) { - return fileDescriptor_f22ec409a72b7b72, []int{10} + return fileDescriptor_f22ec409a72b7b72, []int{11} } func (m *VscUnbondingOps) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -726,7 +790,7 @@ func (m *UnbondingOp) Reset() { *m = UnbondingOp{} } func (m *UnbondingOp) String() string { return proto.CompactTextString(m) } func (*UnbondingOp) ProtoMessage() {} func (*UnbondingOp) Descriptor() ([]byte, []int) { - return fileDescriptor_f22ec409a72b7b72, []int{11} + return fileDescriptor_f22ec409a72b7b72, []int{12} } func (m *UnbondingOp) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -778,7 +842,7 @@ func (m *InitTimeoutTimestamp) Reset() { *m = InitTimeoutTimestamp{} } func (m *InitTimeoutTimestamp) String() string { return proto.CompactTextString(m) } func (*InitTimeoutTimestamp) ProtoMessage() {} func (*InitTimeoutTimestamp) Descriptor() ([]byte, []int) { - return fileDescriptor_f22ec409a72b7b72, []int{12} + return fileDescriptor_f22ec409a72b7b72, []int{13} } func (m *InitTimeoutTimestamp) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -830,7 +894,7 @@ func (m *VscSendTimestamp) Reset() { *m = VscSendTimestamp{} } func (m *VscSendTimestamp) String() string { return proto.CompactTextString(m) } func (*VscSendTimestamp) ProtoMessage() {} func (*VscSendTimestamp) Descriptor() ([]byte, []int) { - return fileDescriptor_f22ec409a72b7b72, []int{13} + return fileDescriptor_f22ec409a72b7b72, []int{14} } func (m *VscSendTimestamp) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -883,7 +947,7 @@ func (m *KeyAssignmentReplacement) Reset() { *m = KeyAssignmentReplaceme func (m *KeyAssignmentReplacement) String() string { return proto.CompactTextString(m) } func (*KeyAssignmentReplacement) ProtoMessage() {} func (*KeyAssignmentReplacement) Descriptor() ([]byte, []int) { - return fileDescriptor_f22ec409a72b7b72, []int{14} + return fileDescriptor_f22ec409a72b7b72, []int{15} } func (m *KeyAssignmentReplacement) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -936,6 +1000,7 @@ func (m *KeyAssignmentReplacement) GetPower() int64 { func init() { proto.RegisterType((*ConsumerAdditionProposal)(nil), "interchain_security.ccv.provider.v1.ConsumerAdditionProposal") proto.RegisterType((*ConsumerRemovalProposal)(nil), "interchain_security.ccv.provider.v1.ConsumerRemovalProposal") + proto.RegisterType((*EquivocationProposal)(nil), "interchain_security.ccv.provider.v1.EquivocationProposal") proto.RegisterType((*GlobalSlashEntry)(nil), "interchain_security.ccv.provider.v1.GlobalSlashEntry") proto.RegisterType((*Params)(nil), "interchain_security.ccv.provider.v1.Params") proto.RegisterType((*HandshakeMetadata)(nil), "interchain_security.ccv.provider.v1.HandshakeMetadata") @@ -956,91 +1021,95 @@ func init() { } var fileDescriptor_f22ec409a72b7b72 = []byte{ - // 1339 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x57, 0x4b, 0x6f, 0xdc, 0x36, - 0x10, 0xb6, 0xec, 0xf5, 0x63, 0xb9, 0x8e, 0x1f, 0x74, 0x1e, 0x72, 0xea, 0xae, 0x37, 0x9b, 0x1e, - 0x5c, 0x04, 0xd1, 0xc2, 0xce, 0xa5, 0x30, 0x5a, 0x14, 0xf6, 0xa6, 0x89, 0xdd, 0x34, 0x89, 0x23, - 0xbb, 0x2e, 0xda, 0x1e, 0x04, 0x8a, 0xa2, 0x77, 0x09, 0x4b, 0xa2, 0x42, 0x72, 0x95, 0xec, 0x3f, - 0xe8, 0x31, 0x45, 0x2f, 0x39, 0xe6, 0x1f, 0xf4, 0x6f, 0xe4, 0x98, 0x63, 0x4f, 0x69, 0xe1, 0x1c, - 0x7b, 0xeb, 0x2f, 0x28, 0x48, 0xea, 0xb1, 0xda, 0x38, 0x80, 0x83, 0xa2, 0x37, 0x71, 0xe6, 0x9b, - 0x8f, 0x33, 0x9c, 0x07, 0x29, 0xb0, 0x45, 0x63, 0x49, 0x38, 0xee, 0x23, 0x1a, 0x7b, 0x82, 0xe0, - 0x01, 0xa7, 0x72, 0xd8, 0xc1, 0x38, 0xed, 0x24, 0x9c, 0xa5, 0x34, 0x20, 0xbc, 0x93, 0x6e, 0x16, - 0xdf, 0x4e, 0xc2, 0x99, 0x64, 0xf0, 0xe6, 0x39, 0x36, 0x0e, 0xc6, 0xa9, 0x53, 0xe0, 0xd2, 0xcd, - 0xeb, 0x97, 0x7b, 0xac, 0xc7, 0x34, 0xbe, 0xa3, 0xbe, 0x8c, 0xe9, 0xf5, 0xf5, 0x1e, 0x63, 0xbd, - 0x90, 0x74, 0xf4, 0xca, 0x1f, 0x9c, 0x74, 0x24, 0x8d, 0x88, 0x90, 0x28, 0x4a, 0x32, 0x40, 0x73, - 0x1c, 0x10, 0x0c, 0x38, 0x92, 0x94, 0xc5, 0x39, 0x01, 0xf5, 0x71, 0x07, 0x33, 0x4e, 0x3a, 0x38, - 0xa4, 0x24, 0x96, 0xca, 0x3d, 0xf3, 0x95, 0x01, 0x3a, 0x0a, 0x10, 0xd2, 0x5e, 0x5f, 0x1a, 0xb1, - 0xe8, 0x48, 0x12, 0x07, 0x84, 0x47, 0xd4, 0x80, 0xcb, 0x55, 0x66, 0xb0, 0x36, 0xa2, 0xc7, 0x7c, - 0x98, 0x48, 0xd6, 0x39, 0x25, 0x43, 0x61, 0xb4, 0xed, 0xdf, 0x66, 0x80, 0xdd, 0x65, 0xb1, 0x18, - 0x44, 0x84, 0xef, 0x04, 0x01, 0x55, 0xae, 0x1c, 0x70, 0x96, 0x30, 0x81, 0x42, 0x78, 0x19, 0x4c, - 0x4b, 0x2a, 0x43, 0x62, 0x5b, 0x2d, 0x6b, 0xa3, 0xee, 0x9a, 0x05, 0x6c, 0x81, 0x46, 0x40, 0x04, - 0xe6, 0x34, 0x51, 0x60, 0x7b, 0x52, 0xeb, 0x46, 0x45, 0x70, 0x15, 0xcc, 0x99, 0xd3, 0xa3, 0x81, - 0x3d, 0xa5, 0xd5, 0xb3, 0x7a, 0xbd, 0x1f, 0xc0, 0xfb, 0x60, 0x81, 0xc6, 0x54, 0x52, 0x14, 0x7a, - 0x7d, 0xa2, 0xa2, 0xb0, 0x6b, 0x2d, 0x6b, 0xa3, 0xb1, 0x75, 0xdd, 0xa1, 0x3e, 0x76, 0x54, 0xe0, - 0x4e, 0x16, 0x6e, 0xba, 0xe9, 0xec, 0x69, 0xc4, 0x6e, 0xed, 0xf5, 0xdb, 0xf5, 0x09, 0xf7, 0x52, - 0x66, 0x67, 0x84, 0xf0, 0x06, 0x98, 0xef, 0x91, 0x98, 0x08, 0x2a, 0xbc, 0x3e, 0x12, 0x7d, 0x7b, - 0xba, 0x65, 0x6d, 0xcc, 0xbb, 0x8d, 0x4c, 0xb6, 0x87, 0x44, 0x1f, 0xae, 0x83, 0x86, 0x4f, 0x63, - 0xc4, 0x87, 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, 0x9a, 0x13, 0x7f, 0xbc, 0x6b, 0x4e, 0xfc, 0xb4, 0xdd, 0xa3, 0xb2, - 0x3f, 0xf0, 0x1d, 0xcc, 0xa2, 0x0e, 0x66, 0x22, 0x62, 0xa2, 0x53, 0x56, 0xfb, 0xed, 0xe2, 0x5f, - 0xe3, 0x79, 0xf5, 0x6f, 0x43, 0x0e, 0x13, 0x22, 0xfc, 0x19, 0x7d, 0x24, 0x77, 0xfe, 0x0d, 0x00, - 0x00, 0xff, 0xff, 0x23, 0xe7, 0x0b, 0x44, 0x9e, 0x0c, 0x00, 0x00, + // 1406 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x57, 0x4b, 0x6f, 0xdb, 0xc6, + 0x16, 0x36, 0x2d, 0xf9, 0xa1, 0x91, 0x9f, 0xb4, 0x93, 0xd0, 0xb9, 0xbe, 0xb2, 0xa2, 0xdc, 0x7b, + 0xa1, 0x8b, 0x20, 0x14, 0xec, 0x6c, 0x0a, 0xa3, 0x45, 0x61, 0x2b, 0x0f, 0xbb, 0x6e, 0x12, 0x87, + 0x76, 0x5d, 0xb4, 0x5d, 0x10, 0xc3, 0xe1, 0x58, 0x1a, 0x98, 0xe4, 0x30, 0x33, 0x23, 0x26, 0xfa, + 0x07, 0x5d, 0xa6, 0xe8, 0x26, 0x40, 0x37, 0xf9, 0x07, 0xfd, 0x1b, 0x59, 0x66, 0xd9, 0x55, 0x5a, + 0x38, 0xcb, 0xee, 0xfa, 0x0b, 0x8a, 0x99, 0xe1, 0x43, 0x54, 0x1c, 0xc0, 0x41, 0xdb, 0x1d, 0xe7, + 0x9c, 0xef, 0x7c, 0xf3, 0x38, 0xe7, 0x7c, 0x33, 0x04, 0x5b, 0x24, 0x12, 0x98, 0xa1, 0x3e, 0x24, + 0x91, 0xcb, 0x31, 0x1a, 0x30, 0x22, 0x86, 0x1d, 0x84, 0x92, 0x4e, 0xcc, 0x68, 0x42, 0x7c, 0xcc, + 0x3a, 0xc9, 0x66, 0xfe, 0x6d, 0xc7, 0x8c, 0x0a, 0x6a, 0xde, 0xbc, 0x20, 0xc6, 0x46, 0x28, 0xb1, + 0x73, 0x5c, 0xb2, 0x79, 0x7d, 0xb5, 0x47, 0x7b, 0x54, 0xe1, 0x3b, 0xf2, 0x4b, 0x87, 0x5e, 0xdf, + 0xe8, 0x51, 0xda, 0x0b, 0x70, 0x47, 0x8d, 0xbc, 0xc1, 0x69, 0x47, 0x90, 0x10, 0x73, 0x01, 0xc3, + 0x38, 0x05, 0x34, 0xc6, 0x01, 0xfe, 0x80, 0x41, 0x41, 0x68, 0x94, 0x11, 0x10, 0x0f, 0x75, 0x10, + 0x65, 0xb8, 0x83, 0x02, 0x82, 0x23, 0x21, 0x97, 0xa7, 0xbf, 0x52, 0x40, 0x47, 0x02, 0x02, 0xd2, + 0xeb, 0x0b, 0x6d, 0xe6, 0x1d, 0x81, 0x23, 0x1f, 0xb3, 0x90, 0x68, 0x70, 0x31, 0x4a, 0x03, 0xd6, + 0x47, 0xfc, 0x88, 0x0d, 0x63, 0x41, 0x3b, 0x67, 0x78, 0xc8, 0x53, 0xef, 0xff, 0x10, 0xe5, 0x21, + 0xe5, 0x1d, 0x2c, 0x37, 0x16, 0x21, 0xdc, 0x49, 0x36, 0x3d, 0x2c, 0xe0, 0x66, 0x6e, 0xd0, 0xb8, + 0xd6, 0x8f, 0xd3, 0xc0, 0xea, 0xd2, 0x88, 0x0f, 0x42, 0xcc, 0x76, 0x7c, 0x9f, 0xc8, 0x25, 0x1f, + 0x32, 0x1a, 0x53, 0x0e, 0x03, 0x73, 0x15, 0x4c, 0x09, 0x22, 0x02, 0x6c, 0x19, 0x4d, 0xa3, 0x5d, + 0x73, 0xf4, 0xc0, 0x6c, 0x82, 0xba, 0x8f, 0x39, 0x62, 0x24, 0x96, 0x60, 0x6b, 0x52, 0xf9, 0x46, + 0x4d, 0xe6, 0x1a, 0x98, 0x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8d, 0x5d, 0x93, 0x64, 0x0d, 0x00, 0x00, } func (m *ConsumerAdditionProposal) Marshal() (dAtA []byte, err error) { @@ -1212,6 +1281,57 @@ func (m *ConsumerRemovalProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) return len(dAtA) - i, nil } +func (m *EquivocationProposal) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *EquivocationProposal) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EquivocationProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Equivocations) > 0 { + for iNdEx := len(m.Equivocations) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Equivocations[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintProvider(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + } + if len(m.Description) > 0 { + i -= len(m.Description) + copy(dAtA[i:], m.Description) + i = encodeVarintProvider(dAtA, i, uint64(len(m.Description))) + i-- + dAtA[i] = 0x12 + } + if len(m.Title) > 0 { + i -= len(m.Title) + copy(dAtA[i:], m.Title) + i = encodeVarintProvider(dAtA, i, uint64(len(m.Title))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + func (m *GlobalSlashEntry) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -1844,6 +1964,29 @@ func (m *ConsumerRemovalProposal) Size() (n int) { return n } +func (m *EquivocationProposal) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Title) + if l > 0 { + n += 1 + l + sovProvider(uint64(l)) + } + l = len(m.Description) + if l > 0 { + n += 1 + l + sovProvider(uint64(l)) + } + if len(m.Equivocations) > 0 { + for _, e := range m.Equivocations { + l = e.Size() + n += 1 + l + sovProvider(uint64(l)) + } + } + return n +} + func (m *GlobalSlashEntry) Size() (n int) { if m == nil { return 0 @@ -2713,6 +2856,154 @@ func (m *ConsumerRemovalProposal) Unmarshal(dAtA []byte) error { } return nil } +func (m *EquivocationProposal) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProvider + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: EquivocationProposal: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EquivocationProposal: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Title", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProvider + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthProvider + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProvider + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Title = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProvider + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthProvider + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthProvider + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Description = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Equivocations", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProvider + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthProvider + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthProvider + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Equivocations = append(m.Equivocations, &types1.Equivocation{}) + if err := m.Equivocations[len(m.Equivocations)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipProvider(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthProvider + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *GlobalSlashEntry) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -2940,7 +3231,7 @@ func (m *Params) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } if m.TemplateClient == nil { - m.TemplateClient = &types1.ClientState{} + m.TemplateClient = &types2.ClientState{} } if err := m.TemplateClient.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err diff --git a/x/ccv/types/expected_keepers.go b/x/ccv/types/expected_keepers.go index af88f00f00..6ce079f454 100644 --- a/x/ccv/types/expected_keepers.go +++ b/x/ccv/types/expected_keepers.go @@ -7,6 +7,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" auth "github.com/cosmos/cosmos-sdk/x/auth/types" capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types" + evidencetypes "github.com/cosmos/cosmos-sdk/x/evidence/types" slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" clienttypes "github.com/cosmos/ibc-go/v4/modules/core/02-client/types" @@ -36,6 +37,10 @@ type StakingKeeper interface { GetLastTotalPower(ctx sdk.Context) sdk.Int } +type EvidenceKeeper interface { + HandleEquivocationEvidence(ctx sdk.Context, evidence *evidencetypes.Equivocation) +} + // SlashingKeeper defines the contract expected to perform ccv slashing type SlashingKeeper interface { JailUntil(sdk.Context, sdk.ConsAddress, time.Time) // called from provider keeper only