diff --git a/ibctesting/utils_test.go b/ibctesting/utils_test.go index e2add65f3..81d4d3413 100644 --- a/ibctesting/utils_test.go +++ b/ibctesting/utils_test.go @@ -202,6 +202,8 @@ func (s *utilSuite) registerSequencer() { RestApiUrls: []string{"https://api.wpd.evm.rollapp.noisnemyd.xyz:443"}, }, bond, + s.hubChain().SenderAccount.GetAddress().String(), + []string{}, ) s.Require().NoError(err) // message committed _, err = s.hubChain().SendMsgs(msgCreateSequencer) diff --git a/proto/dymensionxyz/dymension/sequencer/events.proto b/proto/dymensionxyz/dymension/sequencer/events.proto index 2af8917dc..8711c4765 100644 --- a/proto/dymensionxyz/dymension/sequencer/events.proto +++ b/proto/dymensionxyz/dymension/sequencer/events.proto @@ -5,7 +5,6 @@ package dymensionxyz.dymension.sequencer; import "cosmos_proto/cosmos.proto"; import "gogoproto/gogo.proto"; import "cosmos/base/v1beta1/coin.proto"; -import "cosmos/msg/v1/msg.proto"; option go_package = "github.com/dymensionxyz/dymension/v3/x/sequencer/types"; @@ -17,4 +16,30 @@ message EventIncreasedBond { cosmos.base.v1beta1.Coin added_amount = 2 [(gogoproto.nullable) = false]; // bond is the new active bond amount of the sequencer repeated cosmos.base.v1beta1.Coin bond = 3 [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; +} + +message EventRotationStarted { + // RollappId defines the rollapp to which the sequencer belongs. + string rollapp_id = 1; + // NextProposerAddr is the bech32-encoded address of the next proposer. + // can be empty if no sequencer is available to be the next proposer. + string next_proposer_addr = 2; + // RewardAddr is a bech32-encoded address of the sequencer's reward address. + string reward_addr = 3; + // WhitelistedRelayers is a list of the whitelisted relayer addresses. Addresses are bech32-encoded strings. + repeated string whitelisted_relayers = 4; +} + +message EventUpdateRewardAddress { + // Operator is the bech32-encoded address of the actor sending the update + string creator = 1; + // RewardAddr is a bech32 encoded sdk acc address + string reward_addr = 2; +} + +message EventUpdateWhitelistedRelayers { + // Operator is the bech32-encoded address of the actor sending the update + string creator = 1; + // Relayers is an array of the whitelisted relayer addresses. Addresses are bech32-encoded strings. + repeated string relayers = 2; } \ No newline at end of file diff --git a/proto/dymensionxyz/dymension/sequencer/sequencer.proto b/proto/dymensionxyz/dymension/sequencer/sequencer.proto index e880dc41b..a0192d0a4 100644 --- a/proto/dymensionxyz/dymension/sequencer/sequencer.proto +++ b/proto/dymensionxyz/dymension/sequencer/sequencer.proto @@ -47,6 +47,11 @@ message Sequencer { // notice_period_time defines the time when the sequencer will finish it's notice period if started google.protobuf.Timestamp notice_period_time = 11 [ (gogoproto.nullable) = false, (gogoproto.stdtime) = true ]; + + // RewardAddr is a bech32 encoded sdk acc address + string reward_addr = 12; + // WhitelistedRelayers is an array of the whitelisted relayer addresses. Addresses are bech32-encoded strings. + repeated string whitelisted_relayers = 13; } // BondReduction defines an object which holds the information about the sequencer and its queued unbonding amount diff --git a/proto/dymensionxyz/dymension/sequencer/tx.proto b/proto/dymensionxyz/dymension/sequencer/tx.proto index d361193e1..49858ec67 100644 --- a/proto/dymensionxyz/dymension/sequencer/tx.proto +++ b/proto/dymensionxyz/dymension/sequencer/tx.proto @@ -21,6 +21,10 @@ service Msg { rpc CreateSequencer (MsgCreateSequencer) returns (MsgCreateSequencerResponse); // UpdateSequencerInformation defines a method for updating the sequencer's metadata. rpc UpdateSequencerInformation (MsgUpdateSequencerInformation) returns (MsgUpdateSequencerInformationResponse); + // UpdateRewardAddress defines a method for updating the sequencer's reward address. + rpc UpdateRewardAddress(MsgUpdateRewardAddress) returns (MsgUpdateRewardAddressResponse); + // UpdateWhitelistedRelayers defines a method for updating the sequencer's whitelisted relater list. + rpc UpdateWhitelistedRelayers(MsgUpdateWhitelistedRelayers) returns (MsgUpdateWhitelistedRelayersResponse); // Unbond defines a method for removing coins from sequencer's bond rpc Unbond (MsgUnbond) returns (MsgUnbondResponse); // IncreaseBond defines a method for increasing a sequencer's bond amount @@ -63,6 +67,11 @@ message MsgCreateSequencer { SequencerMetadata metadata = 4 [(gogoproto.nullable) = false]; // entry bond for the sequencer. cosmos.base.v1beta1.Coin bond = 5 [(gogoproto.nullable) = false]; + // RewardAddr is the bech32-encoded sequencer's reward address. Empty is valid. + // If empty, the creator address is used. + string reward_addr = 6; + // WhitelistedRelayers is an array of the whitelisted relayer addresses. Addresses are bech32-encoded strings. + repeated string whitelisted_relayers = 7; } message MsgCreateSequencerResponse {} @@ -77,6 +86,26 @@ message MsgUpdateSequencerInformation { message MsgUpdateSequencerInformationResponse {} +message MsgUpdateRewardAddress { + option (cosmos.msg.v1.signer) = "creator"; + // Creator is the bech32-encoded address of the actor sending the update + string creator = 1; + // RewardAddr is a bech32 encoded sdk acc address + string reward_addr = 2; +} + +message MsgUpdateRewardAddressResponse {} + +message MsgUpdateWhitelistedRelayers { + option (cosmos.msg.v1.signer) = "creator"; + // Creator is the bech32-encoded address of the actor sending the update + string creator = 1; + // Relayers is an array of the whitelisted relayer addresses. Addresses are bech32-encoded strings. + repeated string relayers = 2; +} + +message MsgUpdateWhitelistedRelayersResponse {} + // MsgUnbond defines a SDK message for performing an undelegation from a // bond and a sequencer. message MsgUnbond { diff --git a/x/sequencer/client/cli/tx.go b/x/sequencer/client/cli/tx.go index d5467b35a..7dbd12aed 100644 --- a/x/sequencer/client/cli/tx.go +++ b/x/sequencer/client/cli/tx.go @@ -2,6 +2,7 @@ package cli import ( "fmt" + "strings" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" @@ -26,6 +27,8 @@ func GetTxCmd() *cobra.Command { cmd.AddCommand(CmdCreateSequencer()) cmd.AddCommand(CmdUpdateSequencer()) + cmd.AddCommand(CmdUpdateRewardAddress()) + cmd.AddCommand(CmdUpdateWhitelistedRelayers()) cmd.AddCommand(CmdUnbond()) cmd.AddCommand(CmdIncreaseBond()) cmd.AddCommand(CmdDecreaseBond()) @@ -33,11 +36,20 @@ func GetTxCmd() *cobra.Command { return cmd } +const ( + FlagRewardAddress = "reward-address" + FlagWhitelistedRelayers = "whitelisted-relayers" +) + func CmdCreateSequencer() *cobra.Command { cmd := &cobra.Command{ - Use: "create-sequencer [pubkey] [rollapp-id] [bond] [metadata]", + Use: "create-sequencer [pubkey] [rollapp-id] [bond] [metadata] --reward-address [reward_addr] --whitelisted-relayers [addr1,addr2,addr3]", Short: "Create a new sequencer for a rollapp", - Args: cobra.MinimumNArgs(3), + Long: `Create a new sequencer for a rollapp. +Metadata is an optional arg. +Reward address is an optional flag-arg. It expects a bech32-encoded address which will be used as a sequencer's reward address. +Whitelisted relayers is an optional flag-arg. It expects a comma-separated list of bech32-encoded addresses.`, + Args: cobra.MinimumNArgs(3), RunE: func(cmd *cobra.Command, args []string) (err error) { argPubkey := args[0] argRollappId := args[1] @@ -50,6 +62,13 @@ func CmdCreateSequencer() *cobra.Command { } } + rewardAddr, _ := cmd.Flags().GetString(FlagRewardAddress) + + var whitelistedRelayers []string + if relayers, _ := cmd.Flags().GetString(FlagWhitelistedRelayers); relayers != "" { + whitelistedRelayers = strings.Split(relayers, ",") + } + clientCtx, err := client.GetClientTxContext(cmd) if err != nil { return err @@ -72,6 +91,8 @@ func CmdCreateSequencer() *cobra.Command { argRollappId, &metadata, bondCoin, + rewardAddr, + whitelistedRelayers, ) if err != nil { return err @@ -82,6 +103,8 @@ func CmdCreateSequencer() *cobra.Command { } flags.AddTxFlagsToCmd(cmd) + cmd.Flags().String(FlagRewardAddress, "", "Sequencer reward address") + cmd.Flags().String(FlagWhitelistedRelayers, "", "Sequencer whitelisted relayers") return cmd } @@ -119,6 +142,60 @@ func CmdUpdateSequencer() *cobra.Command { return cmd } +func CmdUpdateRewardAddress() *cobra.Command { + short := "Update a sequencer reward address" + cmd := &cobra.Command{ + Use: "update-reward-address [addr]", + Example: "update-reward-address ethm1lhk5cnfrhgh26w5r6qft36qerg4dclfev9nprc --from foouser", + Args: cobra.ExactArgs(1), + Short: short, + RunE: func(cmd *cobra.Command, args []string) error { + ctx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + msg := &types.MsgUpdateRewardAddress{ + Creator: sdk.ValAddress(ctx.GetFromAddress()).String(), + RewardAddr: args[0], + } + + return tx.GenerateOrBroadcastTxCLI(ctx, cmd.Flags(), msg) + }, + } + + flags.AddTxFlagsToCmd(cmd) + + return cmd +} + +func CmdUpdateWhitelistedRelayers() *cobra.Command { + short := "Update a sequencer whitelisted relayer list" + cmd := &cobra.Command{ + Use: "update-whitelisted-relayers [relayers]", + Example: "update-whitelisted-relayers ethm1lhk5cnfrhgh26w5r6qft36qerg4dclfev9nprc,ethm1lhasdf8969asdfgj2g3j4,ethmasdfkjhgjkhg123j4hgasv7ghi4v --from foouser", + Args: cobra.ExactArgs(1), + Short: short, + RunE: func(cmd *cobra.Command, args []string) error { + ctx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + msg := &types.MsgUpdateWhitelistedRelayers{ + Creator: sdk.ValAddress(ctx.GetFromAddress()).String(), + Relayers: strings.Split(args[0], ","), + } + + return tx.GenerateOrBroadcastTxCLI(ctx, cmd.Flags(), msg) + }, + } + + flags.AddTxFlagsToCmd(cmd) + + return cmd +} + func CmdUnbond() *cobra.Command { cmd := &cobra.Command{ Use: "unbond", diff --git a/x/sequencer/keeper/msg_server_create_sequencer.go b/x/sequencer/keeper/msg_server_create_sequencer.go index 00516aab4..ba53cf9b9 100644 --- a/x/sequencer/keeper/msg_server_create_sequencer.go +++ b/x/sequencer/keeper/msg_server_create_sequencer.go @@ -78,6 +78,12 @@ func (k msgServer) CreateSequencer(goCtx context.Context, msg *types.MsgCreateSe return nil, err } + // set a reward address. if empty, use a creator address. + rewardAddr := msg.RewardAddr + if msg.RewardAddr == "" { + rewardAddr = msg.Creator + } + bond := sdk.NewCoins(msg.Bond) sequencer := types.Sequencer{ Address: msg.Creator, @@ -86,7 +92,9 @@ func (k msgServer) CreateSequencer(goCtx context.Context, msg *types.MsgCreateSe Metadata: msg.Metadata, Status: types.Bonded, Tokens: bond, + RewardAddr: rewardAddr, } + sequencer.SetWhitelistedRelayers(msg.WhitelistedRelayers) // we currently only support setting next proposer (or empty one) before the rotation started. This is in order to // avoid handling the case a potential next proposer bonds in the middle of a rotation. diff --git a/x/sequencer/keeper/msg_server_create_sequencer_test.go b/x/sequencer/keeper/msg_server_create_sequencer_test.go index 20e0e9007..67518981b 100644 --- a/x/sequencer/keeper/msg_server_create_sequencer_test.go +++ b/x/sequencer/keeper/msg_server_create_sequencer_test.go @@ -4,6 +4,7 @@ import ( "errors" "fmt" "reflect" + "slices" "time" errorsmod "cosmossdk.io/errors" @@ -155,6 +156,7 @@ func (suite *SequencerTestSuite) TestCreateSequencer() { for i := 0; i < 10; i++ { pubkey := ed25519.GenPrivKey().PubKey() addr := sdk.AccAddress(pubkey.Address()) + addr1 := sdk.AccAddress(pubkey.Address()) err := bankutil.FundAccount(suite.App.BankKeeper, suite.Ctx, addr, sdk.NewCoins(bond)) suite.Require().NoError(err) pkAny, err := codectypes.NewAnyWithValue(pubkey) @@ -169,15 +171,19 @@ func (suite *SequencerTestSuite) TestCreateSequencer() { Metadata: types.SequencerMetadata{ Rpcs: []string{"https://rpc.wpd.evm.rollapp.noisnemyd.xyz:443"}, }, + RewardAddr: addr1.String(), + WhitelistedRelayers: []string{addr.String()}, } // sequencerExpect is the expected result of creating a sequencer sequencerExpect := types.Sequencer{ - Address: sequencerMsg.GetCreator(), - DymintPubKey: sequencerMsg.GetDymintPubKey(), - Status: types.Bonded, - RollappId: rollappId, - Tokens: sdk.NewCoins(bond), - Metadata: sequencerMsg.GetMetadata(), + Address: sequencerMsg.GetCreator(), + DymintPubKey: sequencerMsg.GetDymintPubKey(), + Status: types.Bonded, + RollappId: rollappId, + Tokens: sdk.NewCoins(bond), + Metadata: sequencerMsg.GetMetadata(), + RewardAddr: addr1.String(), + WhitelistedRelayers: []string{addr.String()}, } // create sequencer @@ -517,6 +523,7 @@ func getAll(suite *SequencerTestSuite) (map[string]*types.Sequencer, int) { // equalSequencer receives two sequencers and compares them. If they are not equal, fails the test func (suite *SequencerTestSuite) equalSequencer(s1 *types.Sequencer, s2 *types.Sequencer) { + suite.T().Helper() eq := compareSequencers(s1, s2) suite.Require().True(eq, "expected: %v\nfound: %v", *s1, *s2) } @@ -558,5 +565,11 @@ func compareSequencers(s1, s2 *types.Sequencer) bool { if !reflect.DeepEqual(s1.Metadata, s2.Metadata) { return false } + if s1.RewardAddr != s2.RewardAddr { + return false + } + if !slices.Equal(s1.WhitelistedRelayers, s2.WhitelistedRelayers) { + return false + } return true } diff --git a/x/sequencer/keeper/msg_server_update_reward_address.go b/x/sequencer/keeper/msg_server_update_reward_address.go new file mode 100644 index 000000000..dc638ece4 --- /dev/null +++ b/x/sequencer/keeper/msg_server_update_reward_address.go @@ -0,0 +1,37 @@ +package keeper + +import ( + "context" + "fmt" + + errorsmod "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/dymensionxyz/gerr-cosmos/gerrc" + "github.com/dymensionxyz/sdk-utils/utils/uevent" + + "github.com/dymensionxyz/dymension/v3/x/sequencer/types" +) + +// UpdateRewardAddress defines a method for updating the sequencer's reward address. +func (k msgServer) UpdateRewardAddress(goCtx context.Context, msg *types.MsgUpdateRewardAddress) (*types.MsgUpdateRewardAddressResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + seq, ok := k.GetSequencer(ctx, msg.Creator) + if !ok { + return nil, errorsmod.Wrap(gerrc.ErrNotFound, "sequencer") + } + + seq.RewardAddr = msg.RewardAddr + + k.SetSequencer(ctx, seq) + + err := uevent.EmitTypedEvent(ctx, &types.EventUpdateRewardAddress{ + Creator: msg.Creator, + RewardAddr: msg.RewardAddr, + }) + if err != nil { + return nil, fmt.Errorf("emit event: %w", err) + } + + return &types.MsgUpdateRewardAddressResponse{}, nil +} diff --git a/x/sequencer/keeper/msg_server_update_reward_address_test.go b/x/sequencer/keeper/msg_server_update_reward_address_test.go new file mode 100644 index 000000000..3bc2a4840 --- /dev/null +++ b/x/sequencer/keeper/msg_server_update_reward_address_test.go @@ -0,0 +1,40 @@ +package keeper_test + +import ( + "github.com/dymensionxyz/dymension/v3/testutil/sample" + "github.com/dymensionxyz/dymension/v3/x/sequencer/types" +) + +func (suite *SequencerTestSuite) TestUpdateRewardAddress() { + rollappId, pk := suite.CreateDefaultRollapp() + defaultSequencerAddress := suite.CreateSequencer(suite.Ctx, rollappId, pk) + rewardAddr := sample.AccAddress() + + testCase := []struct { + name string + msg types.MsgUpdateRewardAddress + expectedErr error + }{ + { + name: "valid", + msg: types.MsgUpdateRewardAddress{ + Creator: defaultSequencerAddress, + RewardAddr: rewardAddr, + }, + expectedErr: nil, + }, + } + + for _, tc := range testCase { + suite.Run(tc.name, func() { + _, err := suite.msgServer.UpdateRewardAddress(suite.Ctx, &tc.msg) + if tc.expectedErr != nil { + suite.Require().ErrorIs(err, tc.expectedErr) + } else { + suite.Require().NoError(err) + seq, _ := suite.App.SequencerKeeper.GetSequencer(suite.Ctx, tc.msg.Creator) + suite.Require().Equal(tc.msg.RewardAddr, seq.RewardAddr) + } + }) + } +} diff --git a/x/sequencer/keeper/msg_server_update_whitelisted_relayers.go b/x/sequencer/keeper/msg_server_update_whitelisted_relayers.go new file mode 100644 index 000000000..46febc818 --- /dev/null +++ b/x/sequencer/keeper/msg_server_update_whitelisted_relayers.go @@ -0,0 +1,37 @@ +package keeper + +import ( + "context" + "fmt" + + errorsmod "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/dymensionxyz/gerr-cosmos/gerrc" + "github.com/dymensionxyz/sdk-utils/utils/uevent" + + "github.com/dymensionxyz/dymension/v3/x/sequencer/types" +) + +// UpdateWhitelistedRelayers defines a method for updating the sequencer's whitelisted relater list. +func (k msgServer) UpdateWhitelistedRelayers(goCtx context.Context, msg *types.MsgUpdateWhitelistedRelayers) (*types.MsgUpdateWhitelistedRelayersResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + seq, ok := k.GetSequencer(ctx, msg.Creator) + if !ok { + return nil, errorsmod.Wrap(gerrc.ErrNotFound, "sequencer") + } + + seq.SetWhitelistedRelayers(msg.Relayers) + + k.SetSequencer(ctx, seq) + + err := uevent.EmitTypedEvent(ctx, &types.EventUpdateWhitelistedRelayers{ + Creator: msg.Creator, + Relayers: msg.Relayers, + }) + if err != nil { + return nil, fmt.Errorf("emit event: %w", err) + } + + return &types.MsgUpdateWhitelistedRelayersResponse{}, nil +} diff --git a/x/sequencer/keeper/msg_server_update_whitelisted_relayers_test.go b/x/sequencer/keeper/msg_server_update_whitelisted_relayers_test.go new file mode 100644 index 000000000..f362bf3b9 --- /dev/null +++ b/x/sequencer/keeper/msg_server_update_whitelisted_relayers_test.go @@ -0,0 +1,43 @@ +package keeper_test + +import ( + "slices" + + "github.com/dymensionxyz/dymension/v3/testutil/sample" + "github.com/dymensionxyz/dymension/v3/x/sequencer/types" +) + +func (suite *SequencerTestSuite) TestUpdateWhitelistedRelayers() { + rollappId, pk := suite.CreateDefaultRollapp() + defaultSequencerAddress := suite.CreateSequencer(suite.Ctx, rollappId, pk) + relayers := []string{sample.AccAddress(), sample.AccAddress()} + + testCase := []struct { + name string + msg types.MsgUpdateWhitelistedRelayers + expectedErr error + }{ + { + name: "valid", + msg: types.MsgUpdateWhitelistedRelayers{ + Creator: defaultSequencerAddress, + Relayers: relayers, + }, + expectedErr: nil, + }, + } + + for _, tc := range testCase { + suite.Run(tc.name, func() { + _, err := suite.msgServer.UpdateWhitelistedRelayers(suite.Ctx, &tc.msg) + if tc.expectedErr != nil { + suite.Require().ErrorIs(err, tc.expectedErr) + } else { + suite.Require().NoError(err) + seq, _ := suite.App.SequencerKeeper.GetSequencer(suite.Ctx, tc.msg.Creator) + slices.Sort(tc.msg.Relayers) + suite.Require().Equal(tc.msg.Relayers, seq.WhitelistedRelayers) + } + }) + } +} diff --git a/x/sequencer/keeper/rotation.go b/x/sequencer/keeper/rotation.go index b54b1e558..cc77045d4 100644 --- a/x/sequencer/keeper/rotation.go +++ b/x/sequencer/keeper/rotation.go @@ -2,12 +2,14 @@ package keeper import ( "sort" + "strings" "time" errorsmod "cosmossdk.io/errors" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/dymensionxyz/dymension/v3/x/sequencer/types" "github.com/dymensionxyz/gerr-cosmos/gerrc" + + "github.com/dymensionxyz/dymension/v3/x/sequencer/types" ) func (k Keeper) startNoticePeriodForSequencer(ctx sdk.Context, seq *types.Sequencer) time.Time { @@ -96,11 +98,14 @@ func (k Keeper) startRotation(ctx sdk.Context, rollappId string) { k.Logger(ctx).Info("rotation started", "rollappId", rollappId, "nextProposer", nextProposer.Address) + // TODO: use corresponding typed event ctx.EventManager().EmitEvent( sdk.NewEvent( types.EventTypeRotationStarted, sdk.NewAttribute(types.AttributeKeyRollappId, rollappId), sdk.NewAttribute(types.AttributeKeyNextProposer, nextProposer.Address), + sdk.NewAttribute(types.AttributeKeyRewardAddr, nextProposer.RewardAddr), + sdk.NewAttribute(types.AttributeKeyWhitelistedRelayers, strings.Join(nextProposer.WhitelistedRelayers, ",")), ), ) } diff --git a/x/sequencer/simulation/create_sequencer.go b/x/sequencer/simulation/create_sequencer.go index 85210ed2a..10a3b752f 100644 --- a/x/sequencer/simulation/create_sequencer.go +++ b/x/sequencer/simulation/create_sequencer.go @@ -38,10 +38,12 @@ func SimulateMsgCreateSequencer( } msg := &types.MsgCreateSequencer{ - Creator: seqAddress, - DymintPubKey: pkAny, - RollappId: rollappId, - Metadata: types.SequencerMetadata{}, + Creator: seqAddress, + DymintPubKey: pkAny, + RollappId: rollappId, + Metadata: types.SequencerMetadata{}, + RewardAddr: seqAddress, + WhitelistedRelayers: []string{}, } bExpectedError := bFailNoRollapp diff --git a/x/sequencer/types/codec.go b/x/sequencer/types/codec.go index dae39e575..5aa71aff5 100644 --- a/x/sequencer/types/codec.go +++ b/x/sequencer/types/codec.go @@ -12,6 +12,8 @@ func RegisterCodec(cdc *codec.LegacyAmino) { cdc.RegisterConcrete(&MsgUnbond{}, "sequencer/Unbond", nil) cdc.RegisterConcrete(&MsgIncreaseBond{}, "sequencer/IncreaseBond", nil) cdc.RegisterConcrete(&MsgDecreaseBond{}, "sequencer/DecreaseBond", nil) + cdc.RegisterConcrete(&MsgUpdateRewardAddress{}, "sequencer/UpdateRewardAddress", nil) + cdc.RegisterConcrete(&MsgUpdateWhitelistedRelayers{}, "sequencer/UpdateWhitelistedRelayers", nil) } func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { @@ -20,6 +22,8 @@ func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { &MsgDecreaseBond{}, &MsgUnbond{}, &MsgIncreaseBond{}, + &MsgUpdateRewardAddress{}, + &MsgUpdateWhitelistedRelayers{}, ) msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) diff --git a/x/sequencer/types/events.go b/x/sequencer/types/events.go index f3258928f..18f5d5472 100644 --- a/x/sequencer/types/events.go +++ b/x/sequencer/types/events.go @@ -14,6 +14,8 @@ const ( // Attributes: // - AttributeKeyRollappId // - AttributeKeyNextProposer + // - AttributeKeyRewardAddr + // - AttributeKeyWhitelistedRelayers EventTypeRotationStarted = "proposer_rotation_started" // EventTypeProposerRotated is emitted when a proposer is rotated @@ -43,10 +45,12 @@ const ( // EventTypeBondIncreased is emitted when a sequencer's bond is increased EventTypeBondIncreased = "bond_increased" - AttributeKeyRollappId = "rollapp_id" - AttributeKeySequencer = "sequencer" - AttributeKeyBond = "bond" - AttributeKeyProposer = "proposer" - AttributeKeyNextProposer = "next_proposer" - AttributeKeyCompletionTime = "completion_time" + AttributeKeyRollappId = "rollapp_id" + AttributeKeySequencer = "sequencer" + AttributeKeyBond = "bond" + AttributeKeyProposer = "proposer" + AttributeKeyNextProposer = "next_proposer" + AttributeKeyRewardAddr = "reward_addr" + AttributeKeyWhitelistedRelayers = "whitelisted_relayers" + AttributeKeyCompletionTime = "completion_time" ) diff --git a/x/sequencer/types/events.pb.go b/x/sequencer/types/events.pb.go index 930f0af90..dbc15a01c 100644 --- a/x/sequencer/types/events.pb.go +++ b/x/sequencer/types/events.pb.go @@ -8,7 +8,6 @@ import ( _ "github.com/cosmos/cosmos-proto" github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" types "github.com/cosmos/cosmos-sdk/types" - _ "github.com/cosmos/cosmos-sdk/types/msgservice" _ "github.com/cosmos/gogoproto/gogoproto" proto "github.com/cosmos/gogoproto/proto" io "io" @@ -91,8 +90,192 @@ func (m *EventIncreasedBond) GetBond() github_com_cosmos_cosmos_sdk_types.Coins return nil } +type EventRotationStarted struct { + // RollappId defines the rollapp to which the sequencer belongs. + RollappId string `protobuf:"bytes,1,opt,name=rollapp_id,json=rollappId,proto3" json:"rollapp_id,omitempty"` + // NextProposerAddr is the bech32-encoded address of the next proposer. + // can be empty if no sequencer is available to be the next proposer. + NextProposerAddr string `protobuf:"bytes,2,opt,name=next_proposer_addr,json=nextProposerAddr,proto3" json:"next_proposer_addr,omitempty"` + // RewardAddr is a bech32-encoded address of the sequencer's reward address. + RewardAddr string `protobuf:"bytes,3,opt,name=reward_addr,json=rewardAddr,proto3" json:"reward_addr,omitempty"` + // WhitelistedRelayers is a list of the whitelisted relayer addresses. Addresses are bech32-encoded strings. + WhitelistedRelayers []string `protobuf:"bytes,4,rep,name=whitelisted_relayers,json=whitelistedRelayers,proto3" json:"whitelisted_relayers,omitempty"` +} + +func (m *EventRotationStarted) Reset() { *m = EventRotationStarted{} } +func (m *EventRotationStarted) String() string { return proto.CompactTextString(m) } +func (*EventRotationStarted) ProtoMessage() {} +func (*EventRotationStarted) Descriptor() ([]byte, []int) { + return fileDescriptor_1f8a63d7e7167eb3, []int{1} +} +func (m *EventRotationStarted) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EventRotationStarted) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_EventRotationStarted.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 *EventRotationStarted) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventRotationStarted.Merge(m, src) +} +func (m *EventRotationStarted) XXX_Size() int { + return m.Size() +} +func (m *EventRotationStarted) XXX_DiscardUnknown() { + xxx_messageInfo_EventRotationStarted.DiscardUnknown(m) +} + +var xxx_messageInfo_EventRotationStarted proto.InternalMessageInfo + +func (m *EventRotationStarted) GetRollappId() string { + if m != nil { + return m.RollappId + } + return "" +} + +func (m *EventRotationStarted) GetNextProposerAddr() string { + if m != nil { + return m.NextProposerAddr + } + return "" +} + +func (m *EventRotationStarted) GetRewardAddr() string { + if m != nil { + return m.RewardAddr + } + return "" +} + +func (m *EventRotationStarted) GetWhitelistedRelayers() []string { + if m != nil { + return m.WhitelistedRelayers + } + return nil +} + +type EventUpdateRewardAddress struct { + // Operator is the bech32-encoded address of the actor sending the update + Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"` + // RewardAddr is a bech32 encoded sdk acc address + RewardAddr string `protobuf:"bytes,2,opt,name=reward_addr,json=rewardAddr,proto3" json:"reward_addr,omitempty"` +} + +func (m *EventUpdateRewardAddress) Reset() { *m = EventUpdateRewardAddress{} } +func (m *EventUpdateRewardAddress) String() string { return proto.CompactTextString(m) } +func (*EventUpdateRewardAddress) ProtoMessage() {} +func (*EventUpdateRewardAddress) Descriptor() ([]byte, []int) { + return fileDescriptor_1f8a63d7e7167eb3, []int{2} +} +func (m *EventUpdateRewardAddress) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EventUpdateRewardAddress) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_EventUpdateRewardAddress.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 *EventUpdateRewardAddress) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventUpdateRewardAddress.Merge(m, src) +} +func (m *EventUpdateRewardAddress) XXX_Size() int { + return m.Size() +} +func (m *EventUpdateRewardAddress) XXX_DiscardUnknown() { + xxx_messageInfo_EventUpdateRewardAddress.DiscardUnknown(m) +} + +var xxx_messageInfo_EventUpdateRewardAddress proto.InternalMessageInfo + +func (m *EventUpdateRewardAddress) GetCreator() string { + if m != nil { + return m.Creator + } + return "" +} + +func (m *EventUpdateRewardAddress) GetRewardAddr() string { + if m != nil { + return m.RewardAddr + } + return "" +} + +type EventUpdateWhitelistedRelayers struct { + // Operator is the bech32-encoded address of the actor sending the update + Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"` + // Relayers is an array of the whitelisted relayer addresses. Addresses are bech32-encoded strings. + Relayers []string `protobuf:"bytes,2,rep,name=relayers,proto3" json:"relayers,omitempty"` +} + +func (m *EventUpdateWhitelistedRelayers) Reset() { *m = EventUpdateWhitelistedRelayers{} } +func (m *EventUpdateWhitelistedRelayers) String() string { return proto.CompactTextString(m) } +func (*EventUpdateWhitelistedRelayers) ProtoMessage() {} +func (*EventUpdateWhitelistedRelayers) Descriptor() ([]byte, []int) { + return fileDescriptor_1f8a63d7e7167eb3, []int{3} +} +func (m *EventUpdateWhitelistedRelayers) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EventUpdateWhitelistedRelayers) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_EventUpdateWhitelistedRelayers.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 *EventUpdateWhitelistedRelayers) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventUpdateWhitelistedRelayers.Merge(m, src) +} +func (m *EventUpdateWhitelistedRelayers) XXX_Size() int { + return m.Size() +} +func (m *EventUpdateWhitelistedRelayers) XXX_DiscardUnknown() { + xxx_messageInfo_EventUpdateWhitelistedRelayers.DiscardUnknown(m) +} + +var xxx_messageInfo_EventUpdateWhitelistedRelayers proto.InternalMessageInfo + +func (m *EventUpdateWhitelistedRelayers) GetCreator() string { + if m != nil { + return m.Creator + } + return "" +} + +func (m *EventUpdateWhitelistedRelayers) GetRelayers() []string { + if m != nil { + return m.Relayers + } + return nil +} + func init() { proto.RegisterType((*EventIncreasedBond)(nil), "dymensionxyz.dymension.sequencer.EventIncreasedBond") + proto.RegisterType((*EventRotationStarted)(nil), "dymensionxyz.dymension.sequencer.EventRotationStarted") + proto.RegisterType((*EventUpdateRewardAddress)(nil), "dymensionxyz.dymension.sequencer.EventUpdateRewardAddress") + proto.RegisterType((*EventUpdateWhitelistedRelayers)(nil), "dymensionxyz.dymension.sequencer.EventUpdateWhitelistedRelayers") } func init() { @@ -100,29 +283,38 @@ func init() { } var fileDescriptor_1f8a63d7e7167eb3 = []byte{ - // 337 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x91, 0xb1, 0x4e, 0xc3, 0x30, - 0x10, 0x86, 0x13, 0x5a, 0x21, 0x35, 0x65, 0x8a, 0x2a, 0x91, 0x76, 0x70, 0x23, 0xa6, 0x2e, 0xb5, - 0x29, 0x95, 0xba, 0x37, 0x88, 0x81, 0x0d, 0x95, 0x8d, 0xa5, 0x4a, 0x62, 0x2b, 0x44, 0x28, 0xbe, - 0x92, 0x73, 0xa3, 0x96, 0xa7, 0xe0, 0x39, 0x98, 0x79, 0x88, 0x8e, 0x15, 0x13, 0x13, 0xa0, 0xf6, - 0x09, 0x78, 0x03, 0x14, 0xc7, 0x0a, 0x5d, 0x60, 0xb2, 0xef, 0xee, 0xff, 0x7e, 0xfd, 0xba, 0x73, - 0x86, 0x7c, 0x9d, 0x09, 0x89, 0x29, 0xc8, 0xd5, 0xfa, 0x89, 0xd5, 0x05, 0x43, 0xf1, 0xb8, 0x14, - 0x32, 0x16, 0x39, 0x13, 0x85, 0x90, 0x0a, 0xe9, 0x22, 0x07, 0x05, 0xae, 0x7f, 0x28, 0xa7, 0x75, - 0x41, 0x6b, 0x79, 0xaf, 0x1b, 0x03, 0x66, 0x80, 0x73, 0xad, 0x67, 0x55, 0x51, 0xc1, 0xbd, 0x4e, - 0x02, 0x09, 0x54, 0xfd, 0xf2, 0x67, 0xba, 0xa4, 0xd2, 0xb0, 0x28, 0x44, 0xc1, 0x8a, 0x51, 0x24, - 0x54, 0x38, 0x62, 0x31, 0xa4, 0xd2, 0xcc, 0x4f, 0xcd, 0x3c, 0xc3, 0x84, 0x15, 0xa3, 0xf2, 0xa9, - 0x06, 0x67, 0xdf, 0xb6, 0xe3, 0x5e, 0x95, 0xe1, 0xae, 0x65, 0x9c, 0x8b, 0x10, 0x05, 0x0f, 0x40, - 0x72, 0x77, 0xe2, 0xb4, 0xea, 0x34, 0x9e, 0xed, 0xdb, 0x83, 0x56, 0xe0, 0xbd, 0xbd, 0x0e, 0x3b, - 0x26, 0xca, 0x94, 0xf3, 0x5c, 0x20, 0xde, 0xaa, 0x3c, 0x95, 0xc9, 0xec, 0x57, 0xea, 0x06, 0xce, - 0x49, 0xc8, 0xb9, 0xe0, 0xf3, 0x30, 0x83, 0xa5, 0x54, 0xde, 0x91, 0x6f, 0x0f, 0xda, 0x17, 0x5d, - 0x6a, 0xb8, 0x32, 0x1e, 0x35, 0xf1, 0xe8, 0x25, 0xa4, 0x32, 0x68, 0x6e, 0x3e, 0xfa, 0xd6, 0xac, - 0xad, 0xa1, 0xa9, 0x66, 0xdc, 0xb9, 0xd3, 0x8c, 0x40, 0x72, 0xaf, 0xe1, 0x37, 0xfe, 0x67, 0xcf, - 0x4b, 0xf6, 0xe5, 0xb3, 0x3f, 0x48, 0x52, 0x75, 0xbf, 0x8c, 0x68, 0x0c, 0x99, 0xd9, 0x95, 0x79, - 0x86, 0xc8, 0x1f, 0x98, 0x5a, 0x2f, 0x04, 0x6a, 0x00, 0x67, 0xda, 0x38, 0xb8, 0xd9, 0xec, 0x88, - 0xbd, 0xdd, 0x11, 0xfb, 0x6b, 0x47, 0xec, 0xe7, 0x3d, 0xb1, 0xb6, 0x7b, 0x62, 0xbd, 0xef, 0x89, - 0x75, 0x37, 0x39, 0x70, 0xfa, 0xe3, 0xa6, 0xc5, 0x98, 0xad, 0x0e, 0x0e, 0xab, 0xdd, 0xa3, 0x63, - 0xbd, 0xcc, 0xf1, 0x4f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xed, 0xb7, 0x3b, 0x80, 0x09, 0x02, 0x00, - 0x00, + // 491 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x53, 0xc1, 0x6e, 0xd3, 0x4c, + 0x10, 0x8e, 0x93, 0xe8, 0xff, 0xf1, 0x86, 0x03, 0x5a, 0x72, 0x70, 0x23, 0xe1, 0x58, 0x39, 0xe5, + 0x40, 0x6c, 0x42, 0xa5, 0xde, 0x6b, 0xc4, 0xa1, 0xb7, 0x6a, 0xab, 0x82, 0xc4, 0xc5, 0x5a, 0x7b, + 0x47, 0xe9, 0x8a, 0x64, 0xd7, 0xec, 0x6e, 0xd2, 0x84, 0xa7, 0xe0, 0x39, 0x38, 0x23, 0xf1, 0x0a, + 0x3d, 0x56, 0x9c, 0x38, 0x01, 0x4a, 0x9e, 0x80, 0x37, 0x40, 0x5e, 0x2f, 0xc6, 0x2a, 0xa2, 0xa7, + 0x64, 0xe6, 0xfb, 0xbe, 0x99, 0x6f, 0x66, 0xbc, 0x68, 0xc6, 0x76, 0x2b, 0x10, 0x9a, 0x4b, 0xb1, + 0xdd, 0xbd, 0x4f, 0x9a, 0x20, 0xd1, 0xf0, 0x6e, 0x0d, 0xa2, 0x00, 0x95, 0xc0, 0x06, 0x84, 0xd1, + 0x71, 0xa9, 0xa4, 0x91, 0x38, 0x6a, 0xd3, 0xe3, 0x26, 0x88, 0x1b, 0xfa, 0xe8, 0xa8, 0x90, 0x7a, + 0x25, 0x75, 0x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 0x89, 0xef, 0x32, 0x67, 0x0c, 0x3f, + 0x45, 0x58, 0xc0, 0xd6, 0x54, 0xcb, 0x2f, 0xa5, 0x06, 0x95, 0x51, 0xc6, 0x94, 0x1d, 0xd1, 0x27, + 0x8f, 0x2a, 0xe4, 0xdc, 0x01, 0xd5, 0x7a, 0xf0, 0x18, 0x0d, 0x14, 0x5c, 0x53, 0xc5, 0x6a, 0x5a, + 0xcf, 0xd2, 0x50, 0x9d, 0xb2, 0x84, 0x39, 0x1a, 0x5e, 0x5f, 0x71, 0x03, 0x4b, 0xae, 0x0d, 0xb0, + 0x4c, 0xc1, 0x92, 0xee, 0x40, 0xe9, 0xa0, 0x1f, 0xf5, 0xa6, 0x3e, 0x79, 0xdc, 0xc2, 0x88, 0x83, + 0x26, 0x97, 0x28, 0xb0, 0xc6, 0x2f, 0x4b, 0x46, 0x0d, 0x90, 0xa6, 0x16, 0x68, 0x8d, 0x03, 0xf4, + 0x7f, 0x75, 0x41, 0x23, 0xdd, 0xc1, 0xc8, 0xef, 0xf0, 0xae, 0x93, 0xee, 0x5d, 0x27, 0x93, 0x57, + 0x28, 0x6c, 0x95, 0x7d, 0xfd, 0x77, 0xe3, 0x7b, 0x8a, 0x8f, 0xd0, 0x83, 0xc6, 0x79, 0xd7, 0x3a, + 0x6f, 0xe2, 0xf4, 0xfc, 0x66, 0x1f, 0x7a, 0xb7, 0xfb, 0xd0, 0xfb, 0xb1, 0x0f, 0xbd, 0x0f, 0x87, + 0xb0, 0x73, 0x7b, 0x08, 0x3b, 0x5f, 0x0f, 0x61, 0xe7, 0xcd, 0x49, 0xeb, 0x64, 0xff, 0x78, 0x23, + 0x9b, 0xe3, 0x64, 0xdb, 0x7a, 0x28, 0xf6, 0x8c, 0xf9, 0x7f, 0xf6, 0xab, 0x3d, 0xfe, 0x15, 0x00, + 0x00, 0xff, 0xff, 0x4a, 0x2d, 0xed, 0xc2, 0x59, 0x03, 0x00, 0x00, } func (m *EventIncreasedBond) Marshal() (dAtA []byte, err error) { @@ -179,6 +371,135 @@ func (m *EventIncreasedBond) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *EventRotationStarted) 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 *EventRotationStarted) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EventRotationStarted) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.WhitelistedRelayers) > 0 { + for iNdEx := len(m.WhitelistedRelayers) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.WhitelistedRelayers[iNdEx]) + copy(dAtA[i:], m.WhitelistedRelayers[iNdEx]) + i = encodeVarintEvents(dAtA, i, uint64(len(m.WhitelistedRelayers[iNdEx]))) + i-- + dAtA[i] = 0x22 + } + } + if len(m.RewardAddr) > 0 { + i -= len(m.RewardAddr) + copy(dAtA[i:], m.RewardAddr) + i = encodeVarintEvents(dAtA, i, uint64(len(m.RewardAddr))) + i-- + dAtA[i] = 0x1a + } + if len(m.NextProposerAddr) > 0 { + i -= len(m.NextProposerAddr) + copy(dAtA[i:], m.NextProposerAddr) + i = encodeVarintEvents(dAtA, i, uint64(len(m.NextProposerAddr))) + i-- + dAtA[i] = 0x12 + } + if len(m.RollappId) > 0 { + i -= len(m.RollappId) + copy(dAtA[i:], m.RollappId) + i = encodeVarintEvents(dAtA, i, uint64(len(m.RollappId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *EventUpdateRewardAddress) 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 *EventUpdateRewardAddress) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EventUpdateRewardAddress) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.RewardAddr) > 0 { + i -= len(m.RewardAddr) + copy(dAtA[i:], m.RewardAddr) + i = encodeVarintEvents(dAtA, i, uint64(len(m.RewardAddr))) + i-- + dAtA[i] = 0x12 + } + if len(m.Creator) > 0 { + i -= len(m.Creator) + copy(dAtA[i:], m.Creator) + i = encodeVarintEvents(dAtA, i, uint64(len(m.Creator))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *EventUpdateWhitelistedRelayers) 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 *EventUpdateWhitelistedRelayers) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EventUpdateWhitelistedRelayers) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Relayers) > 0 { + for iNdEx := len(m.Relayers) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Relayers[iNdEx]) + copy(dAtA[i:], m.Relayers[iNdEx]) + i = encodeVarintEvents(dAtA, i, uint64(len(m.Relayers[iNdEx]))) + i-- + dAtA[i] = 0x12 + } + } + if len(m.Creator) > 0 { + i -= len(m.Creator) + copy(dAtA[i:], m.Creator) + i = encodeVarintEvents(dAtA, i, uint64(len(m.Creator))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + func encodeVarintEvents(dAtA []byte, offset int, v uint64) int { offset -= sovEvents(v) base := offset @@ -211,6 +532,69 @@ func (m *EventIncreasedBond) Size() (n int) { return n } +func (m *EventRotationStarted) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.RollappId) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + l = len(m.NextProposerAddr) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + l = len(m.RewardAddr) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + if len(m.WhitelistedRelayers) > 0 { + for _, s := range m.WhitelistedRelayers { + l = len(s) + n += 1 + l + sovEvents(uint64(l)) + } + } + return n +} + +func (m *EventUpdateRewardAddress) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Creator) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + l = len(m.RewardAddr) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + return n +} + +func (m *EventUpdateWhitelistedRelayers) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Creator) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + if len(m.Relayers) > 0 { + for _, s := range m.Relayers { + l = len(s) + n += 1 + l + sovEvents(uint64(l)) + } + } + return n +} + func sovEvents(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -366,6 +750,412 @@ func (m *EventIncreasedBond) Unmarshal(dAtA []byte) error { } return nil } +func (m *EventRotationStarted) 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 ErrIntOverflowEvents + } + 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: EventRotationStarted: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EventRotationStarted: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RollappId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + 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 ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RollappId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NextProposerAddr", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + 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 ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.NextProposerAddr = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RewardAddr", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + 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 ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RewardAddr = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field WhitelistedRelayers", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + 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 ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.WhitelistedRelayers = append(m.WhitelistedRelayers, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipEvents(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthEvents + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *EventUpdateRewardAddress) 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 ErrIntOverflowEvents + } + 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: EventUpdateRewardAddress: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EventUpdateRewardAddress: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Creator", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + 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 ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Creator = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RewardAddr", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + 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 ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RewardAddr = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipEvents(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthEvents + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *EventUpdateWhitelistedRelayers) 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 ErrIntOverflowEvents + } + 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: EventUpdateWhitelistedRelayers: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EventUpdateWhitelistedRelayers: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Creator", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + 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 ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Creator = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Relayers", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + 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 ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Relayers = append(m.Relayers, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipEvents(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthEvents + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipEvents(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/sequencer/types/msg_create_sequencer.go b/x/sequencer/types/msg_create_sequencer.go index f7840f75a..0f9f91dd5 100644 --- a/x/sequencer/types/msg_create_sequencer.go +++ b/x/sequencer/types/msg_create_sequencer.go @@ -1,11 +1,14 @@ package types import ( + "errors" + errorsmod "cosmossdk.io/errors" codectypes "github.com/cosmos/cosmos-sdk/codec/types" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/decred/dcrd/dcrec/edwards" + "github.com/dymensionxyz/gerr-cosmos/gerrc" "github.com/dymensionxyz/dymension/v3/x/rollapp/types" ) @@ -26,7 +29,16 @@ func (msg MsgCreateSequencer) UnpackInterfaces(unpacker codectypes.AnyUnpacker) } /* --------------------------- MsgCreateSequencer --------------------------- */ -func NewMsgCreateSequencer(creator string, pubkey cryptotypes.PubKey, rollappId string, metadata *SequencerMetadata, bond sdk.Coin) (*MsgCreateSequencer, error) { + +func NewMsgCreateSequencer( + creator string, + pubkey cryptotypes.PubKey, + rollappId string, + metadata *SequencerMetadata, + bond sdk.Coin, + rewardAddr string, + whitelistedRelayers []string, +) (*MsgCreateSequencer, error) { if metadata == nil { return nil, ErrInvalidRequest } @@ -39,11 +51,13 @@ func NewMsgCreateSequencer(creator string, pubkey cryptotypes.PubKey, rollappId } return &MsgCreateSequencer{ - Creator: creator, - DymintPubKey: pkAny, - RollappId: rollappId, - Metadata: *metadata, - Bond: bond, + Creator: creator, + DymintPubKey: pkAny, + RollappId: rollappId, + Metadata: *metadata, + Bond: bond, + RewardAddr: rewardAddr, + WhitelistedRelayers: whitelistedRelayers, }, nil } @@ -104,6 +118,18 @@ func (msg *MsgCreateSequencer) ValidateBasic() error { return errorsmod.Wrapf(ErrInvalidCoins, "invalid bond amount: %s", msg.Bond.String()) } + if msg.RewardAddr != "" { + _, err = sdk.AccAddressFromBech32(msg.RewardAddr) + if err != nil { + return errorsmod.Wrap(errors.Join(gerrc.ErrInvalidArgument, err), "get reward addr from bech32") + } + } + + err = ValidateWhitelistedRelayers(msg.WhitelistedRelayers) + if err != nil { + return errorsmod.Wrap(errors.Join(gerrc.ErrInvalidArgument, err), "validate whitelisted relayers") + } + return nil } diff --git a/x/sequencer/types/msg_create_sequencer_test.go b/x/sequencer/types/msg_create_sequencer_test.go index 28c62520b..7dae7e39e 100644 --- a/x/sequencer/types/msg_create_sequencer_test.go +++ b/x/sequencer/types/msg_create_sequencer_test.go @@ -8,6 +8,7 @@ import ( codectypes "github.com/cosmos/cosmos-sdk/codec/types" cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" + "github.com/dymensionxyz/gerr-cosmos/gerrc" "github.com/dymensionxyz/sdk-utils/utils/uptr" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" @@ -169,6 +170,49 @@ func TestMsgCreateSequencer_ValidateBasic(t *testing.T) { Bond: bond, }, err: ErrInvalidPubKey, + }, { + name: "invalid reward address", + msg: MsgCreateSequencer{ + Creator: sample.AccAddress(), + DymintPubKey: pkAny, + Bond: bond, + Metadata: SequencerMetadata{ + Rpcs: []string{"https://rpc.wpd.evm.rollapp.noisnemyd.xyz:443", "https://rpc.wpd.wasm.rollapp.noisnemyd.xyz:443"}, + EvmRpcs: []string{"https://rpc.wpd.evm.evm.noisnemyd.xyz:443"}, + RestApiUrls: []string{"https://api.wpd.evm.rollapp.noisnemyd.xyz:443"}, + }, + RewardAddr: "invalid", + }, + err: gerrc.ErrInvalidArgument, + }, { + name: "invalid whitelisted relayers", + msg: MsgCreateSequencer{ + Creator: sample.AccAddress(), + DymintPubKey: pkAny, + Bond: bond, + RewardAddr: sample.AccAddress(), + Metadata: SequencerMetadata{ + Rpcs: []string{"https://rpc.wpd.evm.rollapp.noisnemyd.xyz:443", "https://rpc.wpd.wasm.rollapp.noisnemyd.xyz:443"}, + EvmRpcs: []string{"https://rpc.wpd.evm.evm.noisnemyd.xyz:443"}, + RestApiUrls: []string{"https://api.wpd.evm.rollapp.noisnemyd.xyz:443"}, + }, + WhitelistedRelayers: []string{"invalid"}, + }, + err: gerrc.ErrInvalidArgument, + }, { + name: "valid whitelisted relayers", + msg: MsgCreateSequencer{ + Creator: sample.AccAddress(), + DymintPubKey: pkAny, + Bond: bond, + RewardAddr: sample.AccAddress(), + Metadata: SequencerMetadata{ + Rpcs: []string{"https://rpc.wpd.evm.rollapp.noisnemyd.xyz:443", "https://rpc.wpd.wasm.rollapp.noisnemyd.xyz:443"}, + EvmRpcs: []string{"https://rpc.wpd.evm.evm.noisnemyd.xyz:443"}, + RestApiUrls: []string{"https://api.wpd.evm.rollapp.noisnemyd.xyz:443"}, + }, + WhitelistedRelayers: []string{sample.AccAddress()}, + }, }, } for _, tt := range tests { diff --git a/x/sequencer/types/msg_update_reward_address.go b/x/sequencer/types/msg_update_reward_address.go new file mode 100644 index 000000000..ded316791 --- /dev/null +++ b/x/sequencer/types/msg_update_reward_address.go @@ -0,0 +1,28 @@ +package types + +import ( + "errors" + + errorsmod "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/dymensionxyz/gerr-cosmos/gerrc" +) + +var _ sdk.Msg = (*MsgUpdateRewardAddress)(nil) + +func (m *MsgUpdateRewardAddress) ValidateBasic() error { + _, err := sdk.ValAddressFromBech32(m.Creator) + if err != nil { + return errorsmod.Wrap(errors.Join(gerrc.ErrInvalidArgument, err), "get creator addr from bech32") + } + _, err = sdk.AccAddressFromBech32(m.RewardAddr) + if err != nil { + return errorsmod.Wrap(errors.Join(gerrc.ErrInvalidArgument, err), "get reward addr from bech32") + } + return nil +} + +func (m *MsgUpdateRewardAddress) GetSigners() []sdk.AccAddress { + addr, _ := sdk.ValAddressFromBech32(m.Creator) + return []sdk.AccAddress{sdk.AccAddress(addr)} +} diff --git a/x/sequencer/types/msg_update_reward_address_test.go b/x/sequencer/types/msg_update_reward_address_test.go new file mode 100644 index 000000000..c78888b1e --- /dev/null +++ b/x/sequencer/types/msg_update_reward_address_test.go @@ -0,0 +1,68 @@ +package types_test + +import ( + "testing" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/dymensionxyz/gerr-cosmos/gerrc" + "github.com/stretchr/testify/require" + + "github.com/dymensionxyz/dymension/v3/testutil/sample" + "github.com/dymensionxyz/dymension/v3/x/sequencer/types" +) + +func TestMsgUpdateRewardAddress(t *testing.T) { + valAddr := sdk.ValAddress(sample.Acc()) + rewardAddr := sample.AccAddress() + + tests := []struct { + name string + input types.MsgUpdateRewardAddress + errorIs error + errorContains string + }{ + { + name: "valid", + input: types.MsgUpdateRewardAddress{ + Creator: valAddr.String(), + RewardAddr: rewardAddr, + }, + errorIs: nil, + errorContains: "", + }, + { + name: "invalid creator", + input: types.MsgUpdateRewardAddress{ + Creator: "invalid_creator", + RewardAddr: rewardAddr, + }, + errorIs: gerrc.ErrInvalidArgument, + errorContains: "get creator addr from bech32", + }, + { + name: "invalid reward addr", + input: types.MsgUpdateRewardAddress{ + Creator: valAddr.String(), + RewardAddr: "invalid_reward_addr", + }, + errorIs: gerrc.ErrInvalidArgument, + errorContains: "get reward addr from bech32", + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + err := tt.input.ValidateBasic() + + expectError := tt.errorIs != nil + switch expectError { + case true: + require.Error(t, err) + require.ErrorIs(t, err, tt.errorIs) + require.Contains(t, err.Error(), tt.errorContains) + case false: + require.NoError(t, err) + } + }) + } +} diff --git a/x/sequencer/types/msg_update_whitelisted_relayers.go b/x/sequencer/types/msg_update_whitelisted_relayers.go new file mode 100644 index 000000000..10b98c7a0 --- /dev/null +++ b/x/sequencer/types/msg_update_whitelisted_relayers.go @@ -0,0 +1,60 @@ +package types + +import ( + "errors" + "fmt" + + errorsmod "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/bech32" + "github.com/dymensionxyz/gerr-cosmos/gerrc" +) + +var _ sdk.Msg = new(MsgUpdateWhitelistedRelayers) + +func (m *MsgUpdateWhitelistedRelayers) ValidateBasic() error { + _, err := sdk.ValAddressFromBech32(m.Creator) + if err != nil { + return errorsmod.Wrap(errors.Join(gerrc.ErrInvalidArgument, err), "get creator addr from bech32") + } + err = ValidateWhitelistedRelayers(m.Relayers) + if err != nil { + return errorsmod.Wrap(errors.Join(gerrc.ErrInvalidArgument, err), "validate whitelisted relayers") + } + return nil +} + +func ValidateWhitelistedRelayers(wr []string) error { + relayers := make(map[string]struct{}, len(wr)) + for _, r := range wr { + if _, ok := relayers[r]; ok { + return fmt.Errorf("duplicated relayer: %s", r) + } + relayers[r] = struct{}{} + + relayer, err := Bech32ToAddr[sdk.AccAddress](r) + if err != nil { + return fmt.Errorf("convert bech32 to relayer address: %s: %w", r, err) + } + err = sdk.VerifyAddressFormat(relayer) + if err != nil { + return fmt.Errorf("invalid relayer address: %s: %w", r, err) + } + } + return nil +} + +// Bech32ToAddr casts an arbitrary-prefixed bech32 string to either sdk.AccAddress or sdk.ValAddress. +// TODO: move to sdk-utils. +func Bech32ToAddr[T sdk.AccAddress | sdk.ValAddress](addr string) (T, error) { + _, bytes, err := bech32.DecodeAndConvert(addr) + if err != nil { + return nil, fmt.Errorf("decoding bech32 addr: %w", err) + } + return T(bytes), nil +} + +func (m *MsgUpdateWhitelistedRelayers) GetSigners() []sdk.AccAddress { + addr, _ := sdk.ValAddressFromBech32(m.Creator) + return []sdk.AccAddress{sdk.AccAddress(addr)} +} diff --git a/x/sequencer/types/msg_update_whitelisted_relayers_test.go b/x/sequencer/types/msg_update_whitelisted_relayers_test.go new file mode 100644 index 000000000..f786f3748 --- /dev/null +++ b/x/sequencer/types/msg_update_whitelisted_relayers_test.go @@ -0,0 +1,81 @@ +package types_test + +import ( + "testing" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/dymensionxyz/gerr-cosmos/gerrc" + "github.com/stretchr/testify/require" + + "github.com/dymensionxyz/dymension/v3/testutil/sample" + "github.com/dymensionxyz/dymension/v3/x/sequencer/types" +) + +func TestMsgUpdateWhitelistedRelayers(t *testing.T) { + valAddr := sdk.ValAddress(sample.Acc()) + addr := sample.AccAddress() + relayers := []string{ + sample.AccAddress(), + sample.AccAddress(), + } + + tests := []struct { + name string + input types.MsgUpdateWhitelistedRelayers + errorIs error + errorContains string + }{ + { + name: "valid", + input: types.MsgUpdateWhitelistedRelayers{ + Creator: valAddr.String(), + Relayers: relayers, + }, + errorIs: nil, + errorContains: "", + }, + { + name: "empty is valid", + input: types.MsgUpdateWhitelistedRelayers{ + Creator: valAddr.String(), + Relayers: []string{}, + }, + errorIs: nil, + errorContains: "", + }, + { + name: "invalid relayer addr", + input: types.MsgUpdateWhitelistedRelayers{ + Creator: valAddr.String(), + Relayers: []string{"invalid"}, + }, + errorIs: gerrc.ErrInvalidArgument, + errorContains: "validate whitelisted relayers", + }, + { + name: "duplicated relayers", + input: types.MsgUpdateWhitelistedRelayers{ + Creator: valAddr.String(), + Relayers: []string{addr, addr}, + }, + errorIs: gerrc.ErrInvalidArgument, + errorContains: "validate whitelisted relayers", + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + err := tt.input.ValidateBasic() + + expectError := tt.errorIs != nil + switch expectError { + case true: + require.Error(t, err) + require.ErrorIs(t, err, tt.errorIs) + require.Contains(t, err.Error(), tt.errorContains) + case false: + require.NoError(t, err) + } + }) + } +} diff --git a/x/sequencer/types/sequencer.go b/x/sequencer/types/sequencer.go index 9e6edffbf..cd0d0b24c 100644 --- a/x/sequencer/types/sequencer.go +++ b/x/sequencer/types/sequencer.go @@ -1,6 +1,8 @@ package types import ( + "slices" + tmprotocrypto "github.com/cometbft/cometbft/proto/tendermint/crypto" cometbfttypes "github.com/cometbft/cometbft/types" "github.com/cosmos/cosmos-sdk/codec" @@ -78,3 +80,8 @@ func (seq Sequencer) getCosmosPubKey() (cryptotypes.PubKey, error) { err := protoCodec.UnpackAny(seq.DymintPubKey, &pubKey) return pubKey, err } + +func (seq *Sequencer) SetWhitelistedRelayers(relayers []string) { + slices.Sort(relayers) + seq.WhitelistedRelayers = relayers +} diff --git a/x/sequencer/types/sequencer.pb.go b/x/sequencer/types/sequencer.pb.go index 7ef7aecf6..ea69bee45 100644 --- a/x/sequencer/types/sequencer.pb.go +++ b/x/sequencer/types/sequencer.pb.go @@ -57,6 +57,10 @@ type Sequencer struct { UnbondTime time.Time `protobuf:"bytes,10,opt,name=unbond_time,json=unbondTime,proto3,stdtime" json:"unbond_time"` // notice_period_time defines the time when the sequencer will finish it's notice period if started NoticePeriodTime time.Time `protobuf:"bytes,11,opt,name=notice_period_time,json=noticePeriodTime,proto3,stdtime" json:"notice_period_time"` + // RewardAddr is a bech32 encoded sdk acc address + RewardAddr string `protobuf:"bytes,12,opt,name=reward_addr,json=rewardAddr,proto3" json:"reward_addr,omitempty"` + // WhitelistedRelayers is an array of the whitelisted relayer addresses. Addresses are bech32-encoded strings. + WhitelistedRelayers []string `protobuf:"bytes,13,rep,name=whitelisted_relayers,json=whitelistedRelayers,proto3" json:"whitelisted_relayers,omitempty"` } func (m *Sequencer) Reset() { *m = Sequencer{} } @@ -170,6 +174,20 @@ func (m *Sequencer) GetNoticePeriodTime() time.Time { return time.Time{} } +func (m *Sequencer) GetRewardAddr() string { + if m != nil { + return m.RewardAddr + } + return "" +} + +func (m *Sequencer) GetWhitelistedRelayers() []string { + if m != nil { + return m.WhitelistedRelayers + } + return nil +} + // BondReduction defines an object which holds the information about the sequencer and its queued unbonding amount type BondReduction struct { // sequencer_address is the bech32-encoded address of the sequencer account which is the account that the message was sent from. @@ -244,48 +262,51 @@ func init() { } var fileDescriptor_997b8663a5fc0f58 = []byte{ - // 645 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x53, 0x41, 0x6f, 0xd3, 0x30, - 0x18, 0x6d, 0xd6, 0xad, 0x6b, 0x5d, 0x40, 0xc3, 0x14, 0xc8, 0x26, 0x94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0x27, 0xeb, 0x48, 0x9b, 0x25, - 0x73, 0x82, 0x74, 0x4e, 0xd0, 0x33, 0x96, 0x50, 0x77, 0x5b, 0x4e, 0xff, 0xf5, 0x62, 0x68, 0xc7, - 0x89, 0x38, 0x2c, 0x02, 0x14, 0xb2, 0x54, 0x87, 0x56, 0x3f, 0xb6, 0x78, 0x74, 0xe4, 0x88, 0x32, - 0x23, 0x5c, 0x11, 0xb8, 0xa7, 0xa5, 0xe1, 0x04, 0xdc, 0x2f, 0x68, 0xc0, 0x68, 0xe4, 0xe7, 0x72, - 0x20, 0x2e, 0xfc, 0x43, 0x92, 0xc4, 0x87, 0xc2, 0xec, 0x8d, 0x0c, 0xbb, 0xed, 0xdd, 0xab, 0x40, - 0xaf, 0xc2, 0x5e, 0x28, 0x08, 0x3e, 0x07, 0x7d, 0xcd, 0x91, 0x49, 0x36, 0x81, 0x72, 0x7d, 0xe3, - 0xaf, 0x3b, 0x7e, 0x5b, 0xc7, 0xdc, 0xed, 0xca, 0xf1, 0x4e, 0x2f, 0x86, 0x86, 0x07, 0x2a, 0xa2, - 0x84, 0xa0, 0x07, 0x20, 0x65, 0x22, 0x09, 0x89, 0x9f, 0x91, 0x3c, 0x61, 0x5a, 0xad, 0x7f, 0x03, - 0xb5, 0xb5, 0x8a, 0xbf, 0xaf, 0xe8, 0xb2, 0x61, 0x73, 0x66, 0x80, 0xdb, 0xae, 0x1a, 0x38, 0x2a, - 0x42, 0x91, 0x30, 0x0a, 0x1f, 0x83, 0xbb, 0x8d, 0xd5, 0xfe, 0xf5, 0xd4, 0xae, 0x35, 0xc0, 0xae, - 0x8e, 0xef, 0x1b, 0x30, 0x88, 0x48, 0x98, 0x13, 0xcc, 0x89, 0xaf, 0x16, 0xc4, 0x29, 0x2b, 0xa8, - 0xd0, 0x31, 0xfe, 0xcf, 0x05, 0x54, 0xf1, 0x81, 0x35, 0x59, 0x8e, 0xb0, 0xab, 0xa8, 0x72, 0xcb, - 0xeb, 0x92, 0x6a, 0xcb, 0xf6, 0x4d, 0xb6, 0x9c, 0x57, 0x95, 0x0d, 0xee, 0xfe, 0xd9, 0xa5, 0x65, - 0x9c, 0x5f, 0x5a, 0xc6, 0xaf, 0x4b, 0xcb, 0x38, 0x9d, 0x59, 0xad, 0xf3, 0x99, 0xd5, 0xfa, 0x31, - 0xb3, 0x5a, 0xef, 0x9f, 0xcc, 0x05, 0xe0, 0x1f, 0xff, 0xfa, 0xf1, 0x8e, 0x73, 0x32, 0xf7, 0xc3, - 0xab, 0x50, 0x04, 0x1d, 0x35, 0xc1, 0xce, 0xef, 0x00, 0x00, 0x00, 0xff, 0xff, 0xeb, 0x84, 0x3a, - 0x6a, 0x4c, 0x05, 0x00, 0x00, + // 695 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x54, 0x41, 0x6f, 0xd3, 0x3e, + 0x1c, 0x6d, 0xd6, 0xad, 0x6b, 0xdd, 0xed, 0xaf, 0xfd, 0xbd, 0x02, 0xde, 0x84, 0xd2, 0x68, 0xa7, + 0x48, 0x68, 0xc9, 0xda, 0x49, 0x70, 0x6e, 0x11, 0x12, 0x13, 0x42, 0x8c, 0x0c, 0x2e, 0x5c, 0x22, + 0x37, 0x31, 0x69, 0x58, 0x63, 0x07, 0xdb, 0xd9, 0x16, 0x3e, 0xc5, 0x3e, 0x07, 0x67, 0x3e, 0xc4, + 0xc4, 0x69, 0x47, 0x4e, 0x0c, 0xad, 0x9f, 0x82, 0x1b, 0x8a, 0xe3, 0x66, 0x1d, 0x08, 0xaa, 0x9d, + 0x92, 0x9f, 0x9f, 0xdf, 0xcb, 0xef, 0xf7, 0xfc, 0x1c, 0xb0, 0x17, 0xe6, 0x09, 0xa1, 0x22, 0x66, + 0xf4, 0x2c, 0xff, 0xe4, 0x56, 0x85, 0x2b, 0xc8, 0xc7, 0x8c, 0xd0, 0x80, 0xf0, 0x9b, 0x37, 0x27, + 0xe5, 0x4c, 0x32, 0x68, 0xcd, 0x33, 0x9c, 0xaa, 0x70, 0xaa, 0x7d, 0xdb, 0x5b, 0x01, 0x13, 0x09, + 0x13, 0xbe, 0xda, 0xef, 0x96, 0x45, 0x49, 0xde, 0xde, 0x8a, 0x18, 0x8b, 0x26, 0xc4, 0x55, 0xd5, + 0x28, 0x7b, 0xef, 0x62, 0x9a, 0x6b, 0xa8, 0x13, 0xb1, 0x88, 0x95, 0x94, 0xe2, 0x4d, 0xaf, 0x76, + 0x7f, 0x27, 0xc8, 0x38, 0x21, 0x42, 0xe2, 0x24, 0xd5, 0x1b, 0xcc, 0x52, 0xdf, 0x1d, 0x61, 0x41, + 0xdc, 0x93, 0xde, 0x88, 0x48, 0xdc, 0x73, 0x03, 0x16, 0x53, 0x8d, 0x3f, 0xd0, 0x78, 0x22, 0x22, + 0xf7, 0xa4, 0x57, 0x3c, 0x34, 0xe0, 0x2e, 0x9c, 0x3c, 0x21, 0x12, 0x87, 0x58, 0x62, 0x4d, 0x78, + 0xb2, 0x90, 0xc0, 0x52, 0xc2, 0xb1, 0x8c, 0x69, 0xe4, 0x0b, 0x89, 0x65, 0xa6, 0x87, 0xde, 0xf9, + 0xb9, 0x02, 0x5a, 0x47, 0xb3, 0x4d, 0x10, 0x81, 0x55, 0x1c, 0x86, 0x9c, 0x08, 0x81, 0x0c, 0xcb, + 0xb0, 0x5b, 0xde, 0xac, 0x84, 0x1e, 0x58, 0x0b, 0xf3, 0x24, 0xa6, 0xf2, 0x30, 0x1b, 0xbd, 0x20, + 0x39, 0x5a, 0xb2, 0x0c, 0xbb, 0xdd, 0xef, 0x38, 0xa5, 0x05, 0xce, 0xcc, 0x02, 0x67, 0x40, 0xf3, + 0x21, 0xfa, 0xfa, 0x65, 0xb7, 0xa3, 0xad, 0x0d, 0x78, 0x9e, 0x4a, 0xe6, 0x94, 0x2c, 0xef, 0x96, + 0x06, 0x7c, 0x08, 0x5a, 0x9c, 0x4d, 0x26, 0x38, 0x4d, 0x0f, 0x42, 0x54, 0x57, 0xdf, 0xbb, 0x59, + 0x80, 0x6f, 0x41, 0x73, 0x36, 0x24, 0x5a, 0x56, 0x5f, 0xdb, 0x77, 0x16, 0x1d, 0xaf, 0x53, 0x8d, + 0xf2, 0x52, 0x53, 0x87, 0xcb, 0x17, 0xdf, 0xbb, 0x35, 0xaf, 0x92, 0x82, 0xf7, 0x41, 0xe3, 0x03, + 0x8e, 0x27, 0x24, 0x44, 0x2b, 0x96, 0x61, 0x37, 0x3d, 0x5d, 0x41, 0x13, 0x34, 0x53, 0xce, 0x52, + 0x26, 0x08, 0x47, 0x8d, 0x02, 0x19, 0x2e, 0x21, 0xc3, 0xab, 0xd6, 0xe0, 0x01, 0x68, 0x94, 0xc6, + 0xa1, 0x55, 0xcb, 0xb0, 0xff, 0xeb, 0xf7, 0x16, 0x37, 0xf3, 0x6a, 0x66, 0xf9, 0x91, 0x22, 0x7a, + 0x5a, 0x00, 0x06, 0xa0, 0x21, 0xd9, 0x31, 0xa1, 0x02, 0x35, 0xad, 0xba, 0xdd, 0xee, 0x6f, 0x39, + 0xda, 0xac, 0x22, 0x27, 0x8e, 0xce, 0x89, 0xf3, 0x94, 0xc5, 0x74, 0xb8, 0x57, 0x74, 0xff, 0xf9, + 0xaa, 0x6b, 0x47, 0xb1, 0x1c, 0x67, 0x23, 0x27, 0x60, 0x89, 0x0e, 0xad, 0x7e, 0xec, 0x8a, 0xf0, + 0xd8, 0x95, 0x79, 0x4a, 0x84, 0x22, 0x08, 0x4f, 0x4b, 0xc3, 0x3e, 0xb8, 0x97, 0xd1, 0x11, 0xa3, + 0xa1, 0xcf, 0x8b, 0x86, 0x84, 0xf4, 0xc7, 0x24, 0x8e, 0xc6, 0x12, 0xb5, 0x2c, 0xc3, 0xae, 0x7b, + 0x9b, 0x25, 0xe8, 0x95, 0xd8, 0x73, 0x05, 0xc1, 0x67, 0xa0, 0xad, 0x39, 0x45, 0x92, 0x11, 0x50, + 0xae, 0x6f, 0xff, 0x71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ff, 0x8f, 0x93, 0x7d, 0xf7, 0x6c, + 0xee, 0x27, 0xa2, 0x82, 0x36, 0x6a, 0xa8, 0x0e, 0xf6, 0x7f, 0x05, 0x00, 0x00, 0xff, 0xff, 0x05, + 0x14, 0xe1, 0x41, 0xa0, 0x05, 0x00, 0x00, } func (m *Sequencer) Marshal() (dAtA []byte, err error) { @@ -308,6 +329,22 @@ func (m *Sequencer) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.WhitelistedRelayers) > 0 { + for iNdEx := len(m.WhitelistedRelayers) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.WhitelistedRelayers[iNdEx]) + copy(dAtA[i:], m.WhitelistedRelayers[iNdEx]) + i = encodeVarintSequencer(dAtA, i, uint64(len(m.WhitelistedRelayers[iNdEx]))) + i-- + dAtA[i] = 0x6a + } + } + if len(m.RewardAddr) > 0 { + i -= len(m.RewardAddr) + copy(dAtA[i:], m.RewardAddr) + i = encodeVarintSequencer(dAtA, i, uint64(len(m.RewardAddr))) + i-- + dAtA[i] = 0x62 + } n1, err1 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.NoticePeriodTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.NoticePeriodTime):]) if err1 != nil { return 0, err1 @@ -508,6 +545,16 @@ func (m *Sequencer) Size() (n int) { n += 1 + l + sovSequencer(uint64(l)) l = github_com_cosmos_gogoproto_types.SizeOfStdTime(m.NoticePeriodTime) n += 1 + l + sovSequencer(uint64(l)) + l = len(m.RewardAddr) + if l > 0 { + n += 1 + l + sovSequencer(uint64(l)) + } + if len(m.WhitelistedRelayers) > 0 { + for _, s := range m.WhitelistedRelayers { + l = len(s) + n += 1 + l + sovSequencer(uint64(l)) + } + } return n } @@ -874,6 +921,70 @@ func (m *Sequencer) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 12: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RewardAddr", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSequencer + } + 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 ErrInvalidLengthSequencer + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthSequencer + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RewardAddr = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 13: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field WhitelistedRelayers", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSequencer + } + 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 ErrInvalidLengthSequencer + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthSequencer + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.WhitelistedRelayers = append(m.WhitelistedRelayers, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipSequencer(dAtA[iNdEx:]) diff --git a/x/sequencer/types/tx.pb.go b/x/sequencer/types/tx.pb.go index 03f012347..744586c32 100644 --- a/x/sequencer/types/tx.pb.go +++ b/x/sequencer/types/tx.pb.go @@ -143,6 +143,11 @@ type MsgCreateSequencer struct { Metadata SequencerMetadata `protobuf:"bytes,4,opt,name=metadata,proto3" json:"metadata"` // entry bond for the sequencer. Bond types1.Coin `protobuf:"bytes,5,opt,name=bond,proto3" json:"bond"` + // RewardAddr is the bech32-encoded sequencer's reward address. Empty is valid. + // If empty, the creator address is used. + RewardAddr string `protobuf:"bytes,6,opt,name=reward_addr,json=rewardAddr,proto3" json:"reward_addr,omitempty"` + // WhitelistedRelayers is an array of the whitelisted relayer addresses. Addresses are bech32-encoded strings. + WhitelistedRelayers []string `protobuf:"bytes,7,rep,name=whitelisted_relayers,json=whitelistedRelayers,proto3" json:"whitelisted_relayers,omitempty"` } func (m *MsgCreateSequencer) Reset() { *m = MsgCreateSequencer{} } @@ -213,6 +218,20 @@ func (m *MsgCreateSequencer) GetBond() types1.Coin { return types1.Coin{} } +func (m *MsgCreateSequencer) GetRewardAddr() string { + if m != nil { + return m.RewardAddr + } + return "" +} + +func (m *MsgCreateSequencer) GetWhitelistedRelayers() []string { + if m != nil { + return m.WhitelistedRelayers + } + return nil +} + type MsgCreateSequencerResponse struct { } @@ -339,6 +358,186 @@ func (m *MsgUpdateSequencerInformationResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgUpdateSequencerInformationResponse proto.InternalMessageInfo +type MsgUpdateRewardAddress struct { + // Creator is the bech32-encoded address of the actor sending the update + Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"` + // RewardAddr is a bech32 encoded sdk acc address + RewardAddr string `protobuf:"bytes,2,opt,name=reward_addr,json=rewardAddr,proto3" json:"reward_addr,omitempty"` +} + +func (m *MsgUpdateRewardAddress) Reset() { *m = MsgUpdateRewardAddress{} } +func (m *MsgUpdateRewardAddress) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateRewardAddress) ProtoMessage() {} +func (*MsgUpdateRewardAddress) Descriptor() ([]byte, []int) { + return fileDescriptor_02cdd6b9ffa005b4, []int{6} +} +func (m *MsgUpdateRewardAddress) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateRewardAddress) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUpdateRewardAddress.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 *MsgUpdateRewardAddress) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateRewardAddress.Merge(m, src) +} +func (m *MsgUpdateRewardAddress) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateRewardAddress) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateRewardAddress.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateRewardAddress proto.InternalMessageInfo + +func (m *MsgUpdateRewardAddress) GetCreator() string { + if m != nil { + return m.Creator + } + return "" +} + +func (m *MsgUpdateRewardAddress) GetRewardAddr() string { + if m != nil { + return m.RewardAddr + } + return "" +} + +type MsgUpdateRewardAddressResponse struct { +} + +func (m *MsgUpdateRewardAddressResponse) Reset() { *m = MsgUpdateRewardAddressResponse{} } +func (m *MsgUpdateRewardAddressResponse) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateRewardAddressResponse) ProtoMessage() {} +func (*MsgUpdateRewardAddressResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_02cdd6b9ffa005b4, []int{7} +} +func (m *MsgUpdateRewardAddressResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateRewardAddressResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUpdateRewardAddressResponse.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 *MsgUpdateRewardAddressResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateRewardAddressResponse.Merge(m, src) +} +func (m *MsgUpdateRewardAddressResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateRewardAddressResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateRewardAddressResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateRewardAddressResponse proto.InternalMessageInfo + +type MsgUpdateWhitelistedRelayers struct { + // Creator is the bech32-encoded address of the actor sending the update + Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"` + // Relayers is an array of the whitelisted relayer addresses. Addresses are bech32-encoded strings. + Relayers []string `protobuf:"bytes,2,rep,name=relayers,proto3" json:"relayers,omitempty"` +} + +func (m *MsgUpdateWhitelistedRelayers) Reset() { *m = MsgUpdateWhitelistedRelayers{} } +func (m *MsgUpdateWhitelistedRelayers) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateWhitelistedRelayers) ProtoMessage() {} +func (*MsgUpdateWhitelistedRelayers) Descriptor() ([]byte, []int) { + return fileDescriptor_02cdd6b9ffa005b4, []int{8} +} +func (m *MsgUpdateWhitelistedRelayers) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateWhitelistedRelayers) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUpdateWhitelistedRelayers.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 *MsgUpdateWhitelistedRelayers) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateWhitelistedRelayers.Merge(m, src) +} +func (m *MsgUpdateWhitelistedRelayers) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateWhitelistedRelayers) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateWhitelistedRelayers.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateWhitelistedRelayers proto.InternalMessageInfo + +func (m *MsgUpdateWhitelistedRelayers) GetCreator() string { + if m != nil { + return m.Creator + } + return "" +} + +func (m *MsgUpdateWhitelistedRelayers) GetRelayers() []string { + if m != nil { + return m.Relayers + } + return nil +} + +type MsgUpdateWhitelistedRelayersResponse struct { +} + +func (m *MsgUpdateWhitelistedRelayersResponse) Reset() { *m = MsgUpdateWhitelistedRelayersResponse{} } +func (m *MsgUpdateWhitelistedRelayersResponse) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateWhitelistedRelayersResponse) ProtoMessage() {} +func (*MsgUpdateWhitelistedRelayersResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_02cdd6b9ffa005b4, []int{9} +} +func (m *MsgUpdateWhitelistedRelayersResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateWhitelistedRelayersResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUpdateWhitelistedRelayersResponse.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 *MsgUpdateWhitelistedRelayersResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateWhitelistedRelayersResponse.Merge(m, src) +} +func (m *MsgUpdateWhitelistedRelayersResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateWhitelistedRelayersResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateWhitelistedRelayersResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateWhitelistedRelayersResponse proto.InternalMessageInfo + // MsgUnbond defines a SDK message for performing an undelegation from a // bond and a sequencer. type MsgUnbond struct { @@ -349,7 +548,7 @@ func (m *MsgUnbond) Reset() { *m = MsgUnbond{} } func (m *MsgUnbond) String() string { return proto.CompactTextString(m) } func (*MsgUnbond) ProtoMessage() {} func (*MsgUnbond) Descriptor() ([]byte, []int) { - return fileDescriptor_02cdd6b9ffa005b4, []int{6} + return fileDescriptor_02cdd6b9ffa005b4, []int{10} } func (m *MsgUnbond) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -391,6 +590,7 @@ type MsgUnbondResponse struct { // If unbonding the proposer, the completion time is the time at which the notice period will be completed. // // Types that are valid to be assigned to CompletionTime: + // // *MsgUnbondResponse_UnbondingCompletionTime // *MsgUnbondResponse_NoticePeriodCompletionTime CompletionTime isMsgUnbondResponse_CompletionTime `protobuf_oneof:"completion_time"` @@ -400,7 +600,7 @@ func (m *MsgUnbondResponse) Reset() { *m = MsgUnbondResponse{} } func (m *MsgUnbondResponse) String() string { return proto.CompactTextString(m) } func (*MsgUnbondResponse) ProtoMessage() {} func (*MsgUnbondResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_02cdd6b9ffa005b4, []int{7} + return fileDescriptor_02cdd6b9ffa005b4, []int{11} } func (m *MsgUnbondResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -486,7 +686,7 @@ func (m *MsgIncreaseBond) Reset() { *m = MsgIncreaseBond{} } func (m *MsgIncreaseBond) String() string { return proto.CompactTextString(m) } func (*MsgIncreaseBond) ProtoMessage() {} func (*MsgIncreaseBond) Descriptor() ([]byte, []int) { - return fileDescriptor_02cdd6b9ffa005b4, []int{8} + return fileDescriptor_02cdd6b9ffa005b4, []int{12} } func (m *MsgIncreaseBond) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -537,7 +737,7 @@ func (m *MsgIncreaseBondResponse) Reset() { *m = MsgIncreaseBondResponse func (m *MsgIncreaseBondResponse) String() string { return proto.CompactTextString(m) } func (*MsgIncreaseBondResponse) ProtoMessage() {} func (*MsgIncreaseBondResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_02cdd6b9ffa005b4, []int{9} + return fileDescriptor_02cdd6b9ffa005b4, []int{13} } func (m *MsgIncreaseBondResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -578,7 +778,7 @@ func (m *MsgDecreaseBond) Reset() { *m = MsgDecreaseBond{} } func (m *MsgDecreaseBond) String() string { return proto.CompactTextString(m) } func (*MsgDecreaseBond) ProtoMessage() {} func (*MsgDecreaseBond) Descriptor() ([]byte, []int) { - return fileDescriptor_02cdd6b9ffa005b4, []int{10} + return fileDescriptor_02cdd6b9ffa005b4, []int{14} } func (m *MsgDecreaseBond) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -630,7 +830,7 @@ func (m *MsgDecreaseBondResponse) Reset() { *m = MsgDecreaseBondResponse func (m *MsgDecreaseBondResponse) String() string { return proto.CompactTextString(m) } func (*MsgDecreaseBondResponse) ProtoMessage() {} func (*MsgDecreaseBondResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_02cdd6b9ffa005b4, []int{11} + return fileDescriptor_02cdd6b9ffa005b4, []int{15} } func (m *MsgDecreaseBondResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -673,6 +873,10 @@ func init() { proto.RegisterType((*MsgCreateSequencerResponse)(nil), "dymensionxyz.dymension.sequencer.MsgCreateSequencerResponse") proto.RegisterType((*MsgUpdateSequencerInformation)(nil), "dymensionxyz.dymension.sequencer.MsgUpdateSequencerInformation") proto.RegisterType((*MsgUpdateSequencerInformationResponse)(nil), "dymensionxyz.dymension.sequencer.MsgUpdateSequencerInformationResponse") + proto.RegisterType((*MsgUpdateRewardAddress)(nil), "dymensionxyz.dymension.sequencer.MsgUpdateRewardAddress") + proto.RegisterType((*MsgUpdateRewardAddressResponse)(nil), "dymensionxyz.dymension.sequencer.MsgUpdateRewardAddressResponse") + proto.RegisterType((*MsgUpdateWhitelistedRelayers)(nil), "dymensionxyz.dymension.sequencer.MsgUpdateWhitelistedRelayers") + proto.RegisterType((*MsgUpdateWhitelistedRelayersResponse)(nil), "dymensionxyz.dymension.sequencer.MsgUpdateWhitelistedRelayersResponse") proto.RegisterType((*MsgUnbond)(nil), "dymensionxyz.dymension.sequencer.MsgUnbond") proto.RegisterType((*MsgUnbondResponse)(nil), "dymensionxyz.dymension.sequencer.MsgUnbondResponse") proto.RegisterType((*MsgIncreaseBond)(nil), "dymensionxyz.dymension.sequencer.MsgIncreaseBond") @@ -686,62 +890,71 @@ func init() { } var fileDescriptor_02cdd6b9ffa005b4 = []byte{ - // 873 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x56, 0x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0x01, 0x8a, 0x7c, 0x66, 0xbc, 0x95, 0x0d, 0x32, 0x0a, 0x56, - 0xdb, 0x0b, 0x04, 0x0b, 0xae, 0x13, 0x50, 0x1e, 0xbb, 0x5b, 0xcd, 0x4c, 0x20, 0xe9, 0x14, 0xf5, - 0x9d, 0x85, 0x53, 0xd2, 0xec, 0x63, 0x17, 0x25, 0x1b, 0x7b, 0x3a, 0x25, 0x23, 0xfb, 0xad, 0xfd, - 0x7e, 0x02, 0xca, 0x63, 0xef, 0x8f, 0xe6, 0x02, 0x05, 0x8c, 0x53, 0x32, 0xb2, 0xdf, 0xf6, 0x84, - 0x50, 0x1f, 0x7f, 0x7d, 0x7d, 0xf6, 0x5c, 0xea, 0xf4, 0xce, 0x2f, 0x6b, 0xd2, 0xc5, 0x65, 0x4d, - 0xfa, 0xe7, 0xb2, 0x26, 0x9d, 0x5e, 0xd5, 0x72, 0x17, 0x57, 0xb5, 0xdc, 0x9f, 0x57, 0xb5, 0xdc, - 0x67, 0x1b, 0xb6, 0xc3, 0x0e, 0x47, 0x03, 0xcd, 0x24, 0xee, 0x5d, 0xcf, 0xab, 0xa3, 0xb6, 0x7e, - 0x9c, 0x7e, 0x85, 0x06, 0x1e, 0xa2, 0x83, 0x62, 0x74, 0x4b, 0xdb, 0xff, 0x07, 0x00, 0x00, 0xff, - 0xff, 0x06, 0xf9, 0x66, 0x0e, 0xb6, 0x0a, 0x00, 0x00, + // 1014 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x57, 0xcb, 0x6f, 0x1b, 0x45, + 0x18, 0xf7, 0x3a, 0x69, 0x1a, 0x7f, 0x89, 0x12, 0xba, 0x8d, 0xc8, 0x7a, 0xd5, 0xd8, 0x96, 0xc5, + 0x23, 0x14, 0x75, 0x57, 0x8e, 0x51, 0x05, 0x11, 0x2a, 0xc4, 0x41, 0xa5, 0x11, 0xb2, 0x14, 0xb6, + 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x7f, 0x8e, 0x4b, 0xca, + 0xa3, 0x93, 0x52, 0xee, 0xe9, 0x49, 0x29, 0xf7, 0xc7, 0x49, 0x29, 0xf7, 0xc9, 0x4d, 0xdb, 0xe1, + 0x07, 0xbd, 0xb6, 0xd1, 0xa1, 0xee, 0x59, 0x5f, 0xff, 0x87, 0x75, 0xf3, 0xa8, 0xff, 0x8f, 0xa4, + 0xd0, 0x27, 0xac, 0xbd, 0x10, 0xcf, 0xb7, 0xfa, 0xff, 0x01, 0x00, 0x00, 0xff, 0xff, 0x21, 0x97, + 0x23, 0x18, 0x55, 0x0d, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -760,6 +973,10 @@ type MsgClient interface { CreateSequencer(ctx context.Context, in *MsgCreateSequencer, opts ...grpc.CallOption) (*MsgCreateSequencerResponse, error) // UpdateSequencerInformation defines a method for updating the sequencer's metadata. UpdateSequencerInformation(ctx context.Context, in *MsgUpdateSequencerInformation, opts ...grpc.CallOption) (*MsgUpdateSequencerInformationResponse, error) + // UpdateRewardAddress defines a method for updating the sequencer's reward address. + UpdateRewardAddress(ctx context.Context, in *MsgUpdateRewardAddress, opts ...grpc.CallOption) (*MsgUpdateRewardAddressResponse, error) + // UpdateWhitelistedRelayers defines a method for updating the sequencer's whitelisted relater list. + UpdateWhitelistedRelayers(ctx context.Context, in *MsgUpdateWhitelistedRelayers, opts ...grpc.CallOption) (*MsgUpdateWhitelistedRelayersResponse, error) // Unbond defines a method for removing coins from sequencer's bond Unbond(ctx context.Context, in *MsgUnbond, opts ...grpc.CallOption) (*MsgUnbondResponse, error) // IncreaseBond defines a method for increasing a sequencer's bond amount @@ -797,6 +1014,24 @@ func (c *msgClient) UpdateSequencerInformation(ctx context.Context, in *MsgUpdat return out, nil } +func (c *msgClient) UpdateRewardAddress(ctx context.Context, in *MsgUpdateRewardAddress, opts ...grpc.CallOption) (*MsgUpdateRewardAddressResponse, error) { + out := new(MsgUpdateRewardAddressResponse) + err := c.cc.Invoke(ctx, "/dymensionxyz.dymension.sequencer.Msg/UpdateRewardAddress", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) UpdateWhitelistedRelayers(ctx context.Context, in *MsgUpdateWhitelistedRelayers, opts ...grpc.CallOption) (*MsgUpdateWhitelistedRelayersResponse, error) { + out := new(MsgUpdateWhitelistedRelayersResponse) + err := c.cc.Invoke(ctx, "/dymensionxyz.dymension.sequencer.Msg/UpdateWhitelistedRelayers", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *msgClient) Unbond(ctx context.Context, in *MsgUnbond, opts ...grpc.CallOption) (*MsgUnbondResponse, error) { out := new(MsgUnbondResponse) err := c.cc.Invoke(ctx, "/dymensionxyz.dymension.sequencer.Msg/Unbond", in, out, opts...) @@ -839,6 +1074,10 @@ type MsgServer interface { CreateSequencer(context.Context, *MsgCreateSequencer) (*MsgCreateSequencerResponse, error) // UpdateSequencerInformation defines a method for updating the sequencer's metadata. UpdateSequencerInformation(context.Context, *MsgUpdateSequencerInformation) (*MsgUpdateSequencerInformationResponse, error) + // UpdateRewardAddress defines a method for updating the sequencer's reward address. + UpdateRewardAddress(context.Context, *MsgUpdateRewardAddress) (*MsgUpdateRewardAddressResponse, error) + // UpdateWhitelistedRelayers defines a method for updating the sequencer's whitelisted relater list. + UpdateWhitelistedRelayers(context.Context, *MsgUpdateWhitelistedRelayers) (*MsgUpdateWhitelistedRelayersResponse, error) // Unbond defines a method for removing coins from sequencer's bond Unbond(context.Context, *MsgUnbond) (*MsgUnbondResponse, error) // IncreaseBond defines a method for increasing a sequencer's bond amount @@ -860,6 +1099,12 @@ func (*UnimplementedMsgServer) CreateSequencer(ctx context.Context, req *MsgCrea func (*UnimplementedMsgServer) UpdateSequencerInformation(ctx context.Context, req *MsgUpdateSequencerInformation) (*MsgUpdateSequencerInformationResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method UpdateSequencerInformation not implemented") } +func (*UnimplementedMsgServer) UpdateRewardAddress(ctx context.Context, req *MsgUpdateRewardAddress) (*MsgUpdateRewardAddressResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateRewardAddress not implemented") +} +func (*UnimplementedMsgServer) UpdateWhitelistedRelayers(ctx context.Context, req *MsgUpdateWhitelistedRelayers) (*MsgUpdateWhitelistedRelayersResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateWhitelistedRelayers not implemented") +} func (*UnimplementedMsgServer) Unbond(ctx context.Context, req *MsgUnbond) (*MsgUnbondResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Unbond not implemented") } @@ -913,6 +1158,42 @@ func _Msg_UpdateSequencerInformation_Handler(srv interface{}, ctx context.Contex return interceptor(ctx, in, info, handler) } +func _Msg_UpdateRewardAddress_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgUpdateRewardAddress) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).UpdateRewardAddress(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/dymensionxyz.dymension.sequencer.Msg/UpdateRewardAddress", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).UpdateRewardAddress(ctx, req.(*MsgUpdateRewardAddress)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_UpdateWhitelistedRelayers_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgUpdateWhitelistedRelayers) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).UpdateWhitelistedRelayers(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/dymensionxyz.dymension.sequencer.Msg/UpdateWhitelistedRelayers", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).UpdateWhitelistedRelayers(ctx, req.(*MsgUpdateWhitelistedRelayers)) + } + return interceptor(ctx, in, info, handler) +} + func _Msg_Unbond_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(MsgUnbond) if err := dec(in); err != nil { @@ -997,6 +1278,14 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ MethodName: "UpdateSequencerInformation", Handler: _Msg_UpdateSequencerInformation_Handler, }, + { + MethodName: "UpdateRewardAddress", + Handler: _Msg_UpdateRewardAddress_Handler, + }, + { + MethodName: "UpdateWhitelistedRelayers", + Handler: _Msg_UpdateWhitelistedRelayers_Handler, + }, { MethodName: "Unbond", Handler: _Msg_Unbond_Handler, @@ -1101,6 +1390,22 @@ func (m *MsgCreateSequencer) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.WhitelistedRelayers) > 0 { + for iNdEx := len(m.WhitelistedRelayers) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.WhitelistedRelayers[iNdEx]) + copy(dAtA[i:], m.WhitelistedRelayers[iNdEx]) + i = encodeVarintTx(dAtA, i, uint64(len(m.WhitelistedRelayers[iNdEx]))) + i-- + dAtA[i] = 0x3a + } + } + if len(m.RewardAddr) > 0 { + i -= len(m.RewardAddr) + copy(dAtA[i:], m.RewardAddr) + i = encodeVarintTx(dAtA, i, uint64(len(m.RewardAddr))) + i-- + dAtA[i] = 0x32 + } { size, err := m.Bond.MarshalToSizedBuffer(dAtA[:i]) if err != nil { @@ -1236,7 +1541,7 @@ func (m *MsgUpdateSequencerInformationResponse) MarshalToSizedBuffer(dAtA []byte return len(dAtA) - i, nil } -func (m *MsgUnbond) Marshal() (dAtA []byte, err error) { +func (m *MsgUpdateRewardAddress) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1246,16 +1551,23 @@ func (m *MsgUnbond) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *MsgUnbond) MarshalTo(dAtA []byte) (int, error) { +func (m *MsgUpdateRewardAddress) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *MsgUnbond) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *MsgUpdateRewardAddress) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l + if len(m.RewardAddr) > 0 { + i -= len(m.RewardAddr) + copy(dAtA[i:], m.RewardAddr) + i = encodeVarintTx(dAtA, i, uint64(len(m.RewardAddr))) + i-- + dAtA[i] = 0x12 + } if len(m.Creator) > 0 { i -= len(m.Creator) copy(dAtA[i:], m.Creator) @@ -1266,7 +1578,7 @@ func (m *MsgUnbond) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *MsgUnbondResponse) Marshal() (dAtA []byte, err error) { +func (m *MsgUpdateRewardAddressResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1276,67 +1588,20 @@ func (m *MsgUnbondResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *MsgUnbondResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *MsgUpdateRewardAddressResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *MsgUnbondResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *MsgUpdateRewardAddressResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if m.CompletionTime != nil { - { - size := m.CompletionTime.Size() - i -= size - if _, err := m.CompletionTime.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - } - } - return len(dAtA) - i, nil -} - -func (m *MsgUnbondResponse_UnbondingCompletionTime) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgUnbondResponse_UnbondingCompletionTime) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.UnbondingCompletionTime != nil { - n6, err6 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(*m.UnbondingCompletionTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(*m.UnbondingCompletionTime):]) - if err6 != nil { - return 0, err6 - } - i -= n6 - i = encodeVarintTx(dAtA, i, uint64(n6)) - i-- - dAtA[i] = 0xa - } return len(dAtA) - i, nil } -func (m *MsgUnbondResponse_NoticePeriodCompletionTime) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} -func (m *MsgUnbondResponse_NoticePeriodCompletionTime) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.NoticePeriodCompletionTime != nil { - n7, err7 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(*m.NoticePeriodCompletionTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(*m.NoticePeriodCompletionTime):]) - if err7 != nil { - return 0, err7 - } - i -= n7 - i = encodeVarintTx(dAtA, i, uint64(n7)) - i-- - dAtA[i] = 0x12 - } - return len(dAtA) - i, nil -} -func (m *MsgIncreaseBond) Marshal() (dAtA []byte, err error) { +func (m *MsgUpdateWhitelistedRelayers) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1346,26 +1611,25 @@ func (m *MsgIncreaseBond) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *MsgIncreaseBond) MarshalTo(dAtA []byte) (int, error) { +func (m *MsgUpdateWhitelistedRelayers) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *MsgIncreaseBond) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *MsgUpdateWhitelistedRelayers) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - { - size, err := m.AddAmount.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err + if len(m.Relayers) > 0 { + for iNdEx := len(m.Relayers) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Relayers[iNdEx]) + copy(dAtA[i:], m.Relayers[iNdEx]) + i = encodeVarintTx(dAtA, i, uint64(len(m.Relayers[iNdEx]))) + i-- + dAtA[i] = 0x12 } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) } - i-- - dAtA[i] = 0x12 if len(m.Creator) > 0 { i -= len(m.Creator) copy(dAtA[i:], m.Creator) @@ -1376,7 +1640,7 @@ func (m *MsgIncreaseBond) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *MsgIncreaseBondResponse) Marshal() (dAtA []byte, err error) { +func (m *MsgUpdateWhitelistedRelayersResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1386,12 +1650,12 @@ func (m *MsgIncreaseBondResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *MsgIncreaseBondResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *MsgUpdateWhitelistedRelayersResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *MsgIncreaseBondResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *MsgUpdateWhitelistedRelayersResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -1399,7 +1663,7 @@ func (m *MsgIncreaseBondResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) return len(dAtA) - i, nil } -func (m *MsgDecreaseBond) Marshal() (dAtA []byte, err error) { +func (m *MsgUnbond) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1409,19 +1673,182 @@ func (m *MsgDecreaseBond) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *MsgDecreaseBond) MarshalTo(dAtA []byte) (int, error) { +func (m *MsgUnbond) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *MsgDecreaseBond) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *MsgUnbond) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - { - size, err := m.DecreaseAmount.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { + if len(m.Creator) > 0 { + i -= len(m.Creator) + copy(dAtA[i:], m.Creator) + i = encodeVarintTx(dAtA, i, uint64(len(m.Creator))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgUnbondResponse) 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 *MsgUnbondResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUnbondResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.CompletionTime != nil { + { + size := m.CompletionTime.Size() + i -= size + if _, err := m.CompletionTime.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } + } + return len(dAtA) - i, nil +} + +func (m *MsgUnbondResponse_UnbondingCompletionTime) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUnbondResponse_UnbondingCompletionTime) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.UnbondingCompletionTime != nil { + n6, err6 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(*m.UnbondingCompletionTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(*m.UnbondingCompletionTime):]) + if err6 != nil { + return 0, err6 + } + i -= n6 + i = encodeVarintTx(dAtA, i, uint64(n6)) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} +func (m *MsgUnbondResponse_NoticePeriodCompletionTime) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUnbondResponse_NoticePeriodCompletionTime) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.NoticePeriodCompletionTime != nil { + n7, err7 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(*m.NoticePeriodCompletionTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(*m.NoticePeriodCompletionTime):]) + if err7 != nil { + return 0, err7 + } + i -= n7 + i = encodeVarintTx(dAtA, i, uint64(n7)) + i-- + dAtA[i] = 0x12 + } + return len(dAtA) - i, nil +} +func (m *MsgIncreaseBond) 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 *MsgIncreaseBond) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgIncreaseBond) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.AddAmount.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if len(m.Creator) > 0 { + i -= len(m.Creator) + copy(dAtA[i:], m.Creator) + i = encodeVarintTx(dAtA, i, uint64(len(m.Creator))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgIncreaseBondResponse) 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 *MsgIncreaseBondResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgIncreaseBondResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgDecreaseBond) 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 *MsgDecreaseBond) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgDecreaseBond) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.DecreaseAmount.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { return 0, err } i -= size @@ -1527,6 +1954,16 @@ func (m *MsgCreateSequencer) Size() (n int) { n += 1 + l + sovTx(uint64(l)) l = m.Bond.Size() n += 1 + l + sovTx(uint64(l)) + l = len(m.RewardAddr) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if len(m.WhitelistedRelayers) > 0 { + for _, s := range m.WhitelistedRelayers { + l = len(s) + n += 1 + l + sovTx(uint64(l)) + } + } return n } @@ -1563,6 +2000,60 @@ func (m *MsgUpdateSequencerInformationResponse) Size() (n int) { return n } +func (m *MsgUpdateRewardAddress) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Creator) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.RewardAddr) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgUpdateRewardAddressResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgUpdateWhitelistedRelayers) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Creator) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if len(m.Relayers) > 0 { + for _, s := range m.Relayers { + l = len(s) + n += 1 + l + sovTx(uint64(l)) + } + } + return n +} + +func (m *MsgUpdateWhitelistedRelayersResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + func (m *MsgUnbond) Size() (n int) { if m == nil { return 0 @@ -2028,28 +2519,92 @@ func (m *MsgCreateSequencer) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RewardAddr", wireType) } - if (skippy < 0) || (iNdEx+skippy) < 0 { + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + 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 ErrInvalidLengthTx } - if (iNdEx + skippy) > l { + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { return io.ErrUnexpectedEOF } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgCreateSequencerResponse) Unmarshal(dAtA []byte) error { + m.RewardAddr = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field WhitelistedRelayers", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.WhitelistedRelayers = append(m.WhitelistedRelayers, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgCreateSequencerResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2264,6 +2819,334 @@ func (m *MsgUpdateSequencerInformationResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgUpdateRewardAddress) 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 ErrIntOverflowTx + } + 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: MsgUpdateRewardAddress: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateRewardAddress: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Creator", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Creator = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RewardAddr", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RewardAddr = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgUpdateRewardAddressResponse) 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 ErrIntOverflowTx + } + 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: MsgUpdateRewardAddressResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateRewardAddressResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgUpdateWhitelistedRelayers) 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 ErrIntOverflowTx + } + 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: MsgUpdateWhitelistedRelayers: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateWhitelistedRelayers: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Creator", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Creator = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Relayers", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Relayers = append(m.Relayers, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgUpdateWhitelistedRelayersResponse) 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 ErrIntOverflowTx + } + 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: MsgUpdateWhitelistedRelayersResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateWhitelistedRelayersResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *MsgUnbond) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0