diff --git a/CHANGELOG.md b/CHANGELOG.md index c10c136f..677e50fa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,14 +24,21 @@ - [#20](https://github.com/KYVENetwork/chain/pull/20) Adjust investor vesting schedules from second funding round. +### Client Breaking + +- (`x/query`) [#23](https://github.com/KYVENetwork/chain/pull/23) Update the `StakerMetadata` query to reflect the new `Identity` and metadata fields. +- (`x/stakers`) [#23](https://github.com/KYVENetwork/chain/pull/23) Update `MsgUpdateMetadata` to reflect the new `Identity` and metadata fields. + ### API Breaking - [#22](https://github.com/KYVENetwork/chain/pull/22) Emit an event when updating module parameters. - (`x/delegation`) [#24](https://github.com/KYVENetwork/chain/pull/24) Emit an event when a user initiates a protocol unbonding. - (`x/pool`) [#24](https://github.com/KYVENetwork/chain/pull/24) Emit events for all module governance actions. +- (`x/stakers`) [#23](https://github.com/KYVENetwork/chain/pull/23) Update the event emitted when updating protocol node metadata. ### State Machine Breaking +- (`x/stakers`) [#23](https://github.com/KYVENetwork/chain/pull/23) Improve metadata by adding `Identity`, `SecurityContact`, `Details` fields, deprecating `Logo`. - (`x/bundles`) [#19](https://github.com/KYVENetwork/chain/pull/19) Migrate `NetworkFee` param to type `sdk.Dec`. - (`x/bundles`) [#22](https://github.com/KYVENetwork/chain/pull/22) Switch to a non-manipulable pseudo-random source seed for uploader selection. - (`x/delegation`) [#19](https://github.com/KYVENetwork/chain/pull/19) Migrate `VoteSlash`, `UploadSlash`, `TimeoutSlash` params to type `sdk.Dec`. diff --git a/app/app.go b/app/app.go index 5f505aec..5ccbed49 100644 --- a/app/app.go +++ b/app/app.go @@ -780,6 +780,7 @@ func NewKYVEApp( app.mm, app.configurator, app.AccountKeeper, + app.StakersKeeper, ), ) diff --git a/app/upgrades/v1_1/upgrade.go b/app/upgrades/v1_1/upgrade.go index b531b730..9b3b0c5d 100644 --- a/app/upgrades/v1_1/upgrade.go +++ b/app/upgrades/v1_1/upgrade.go @@ -9,6 +9,8 @@ import ( authTypes "github.com/cosmos/cosmos-sdk/x/auth/types" vestingExported "github.com/cosmos/cosmos-sdk/x/auth/vesting/exported" vestingTypes "github.com/cosmos/cosmos-sdk/x/auth/vesting/types" + // Stakers + stakersKeeper "github.com/KYVENetwork/chain/x/stakers/keeper" // Upgrade upgradeTypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" ) @@ -17,6 +19,7 @@ func CreateUpgradeHandler( mm *module.Manager, configurator module.Configurator, accountKeeper authKeeper.AccountKeeper, + stakerKeeper stakersKeeper.Keeper, ) upgradeTypes.UpgradeHandler { return func(ctx sdk.Context, _ upgradeTypes.Plan, vm module.VersionMap) (module.VersionMap, error) { if ctx.ChainID() == MainnetChainID { @@ -25,6 +28,8 @@ func CreateUpgradeHandler( } } + MigrateStakerMetadata(ctx, stakerKeeper) + return mm.RunMigrations(ctx, configurator, vm) } } @@ -32,8 +37,8 @@ func CreateUpgradeHandler( // AdjustInvestorVesting correctly adjusts the vesting schedules of investors // from our second funding round. In genesis, the accounts were set up with an // 18-month cliff instead of a 6-month cliff. -func AdjustInvestorVesting(ctx sdk.Context, accountKeeper authKeeper.AccountKeeper, address sdk.AccAddress) { - rawAccount := accountKeeper.GetAccount(ctx, address) +func AdjustInvestorVesting(ctx sdk.Context, keeper authKeeper.AccountKeeper, address sdk.AccAddress) { + rawAccount := keeper.GetAccount(ctx, address) account := rawAccount.(vestingExported.VestingAccount) baseAccount := authTypes.NewBaseAccount( @@ -43,5 +48,14 @@ func AdjustInvestorVesting(ctx sdk.Context, accountKeeper authKeeper.AccountKeep baseAccount, account.GetOriginalVesting(), StartTime, EndTime, ) - accountKeeper.SetAccount(ctx, updatedAccount) + keeper.SetAccount(ctx, updatedAccount) +} + +// MigrateStakerMetadata migrates all existing staker metadata. The `Logo` +// field has been deprecated and replaced by the `Identity` field. This new +// field must be a valid hex string; therefore, must be set to empty for now. +func MigrateStakerMetadata(ctx sdk.Context, keeper stakersKeeper.Keeper) { + for _, staker := range keeper.GetAllStakers(ctx) { + keeper.UpdateStakerMetadata(ctx, staker.Address, staker.Moniker, staker.Website, "", "", "") + } } diff --git a/docs/swagger.yml b/docs/swagger.yml index b5bc14ee..ab1ff296 100644 --- a/docs/swagger.yml +++ b/docs/swagger.yml @@ -534,11 +534,15 @@ paths: title: >- website is a https-link to the website of the staker - logo: + identity: type: string - title: >- - logo is a link to an image file (like jpg or - png) + title: identity from keybase.io + security_contact: + type: string + description: security_contact ... + details: + type: string + description: details ... pending_commission_change: description: >- pending_commission_change shows if the staker @@ -4032,11 +4036,15 @@ paths: title: >- website is a https-link to the website of the staker - logo: + identity: type: string - title: >- - logo is a link to an image file (like jpg or - png) + title: identity from keybase.io + security_contact: + type: string + description: security_contact ... + details: + type: string + description: details ... pending_commission_change: description: >- pending_commission_change shows if the staker @@ -6052,9 +6060,15 @@ paths: website: type: string title: website is a https-link to the website of the staker - logo: + identity: + type: string + title: identity from keybase.io + security_contact: + type: string + description: security_contact ... + details: type: string - title: logo is a link to an image file (like jpg or png) + description: details ... pending_commission_change: description: >- pending_commission_change shows if the staker plans @@ -6469,9 +6483,15 @@ paths: website: type: string title: website is a https-link to the website of the staker - logo: + identity: + type: string + title: identity from keybase.io + security_contact: + type: string + description: security_contact ... + details: type: string - title: logo is a link to an image file (like jpg or png) + description: details ... pending_commission_change: description: >- pending_commission_change shows if the staker plans @@ -6985,11 +7005,15 @@ paths: title: >- website is a https-link to the website of the staker - logo: + identity: type: string - title: >- - logo is a link to an image file (like jpg or - png) + title: identity from keybase.io + security_contact: + type: string + description: security_contact ... + details: + type: string + description: details ... pending_commission_change: description: >- pending_commission_change shows if the staker @@ -7460,9 +7484,15 @@ paths: website: type: string title: website is a https-link to the website of the staker - logo: + identity: + type: string + title: identity from keybase.io + security_contact: + type: string + description: security_contact ... + details: type: string - title: logo is a link to an image file (like jpg or png) + description: details ... pending_commission_change: description: >- pending_commission_change shows if the staker plans diff --git a/proto/kyve/query/v1beta1/query.proto b/proto/kyve/query/v1beta1/query.proto index 04be74af..a63fab18 100644 --- a/proto/kyve/query/v1beta1/query.proto +++ b/proto/kyve/query/v1beta1/query.proto @@ -107,15 +107,21 @@ message StakerMetadata { // website is a https-link to the website of the staker string website = 3; - // logo is a link to an image file (like jpg or png) - string logo = 4; + // identity from keybase.io + string identity = 4; + + // security_contact ... + string security_contact = 5; + + // details ... + string details = 6; // pending_commission_change shows if the staker plans // to change its commission. Delegators will see a warning in // the UI. A Commission change takes some time until // the commission is applied. Users have time to redelegate // if they not agree with the new commission. - CommissionChangeEntry pending_commission_change = 5; + CommissionChangeEntry pending_commission_change = 7; } // CommissionChangeEntry shows when the old commission diff --git a/proto/kyve/stakers/v1beta1/events.proto b/proto/kyve/stakers/v1beta1/events.proto index 5bc47f03..e7b162b9 100644 --- a/proto/kyve/stakers/v1beta1/events.proto +++ b/proto/kyve/stakers/v1beta1/events.proto @@ -25,6 +25,11 @@ message EventCreateStaker { string staker = 1; // amount ... uint64 amount = 2; + // commission + string commission = 3 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; } // EventUpdateMetadata is an event emitted when a protocol node updates their metadata. @@ -36,8 +41,12 @@ message EventUpdateMetadata { string moniker = 2; // website ... string website = 3; - // logo ... - string logo = 4; + // identity ... + string identity = 4; + // security_contact ... + string security_contact = 5; + // details ... + string details = 6; } // EventUpdateCommission ... diff --git a/proto/kyve/stakers/v1beta1/stakers.proto b/proto/kyve/stakers/v1beta1/stakers.proto index bc7c85fd..44403fa9 100644 --- a/proto/kyve/stakers/v1beta1/stakers.proto +++ b/proto/kyve/stakers/v1beta1/stakers.proto @@ -20,8 +20,12 @@ message Staker { string moniker = 3; // website ... string website = 4; - // logo ... - string logo = 5; + // identity is the 64 bit keybase.io identity string + string identity = 5; + // security_contact ... + string security_contact = 6; + // details are some additional notes the staker finds important + string details = 7; } // Valaccount gets authorized by a staker to diff --git a/proto/kyve/stakers/v1beta1/tx.proto b/proto/kyve/stakers/v1beta1/tx.proto index d1509d1f..f64353f0 100644 --- a/proto/kyve/stakers/v1beta1/tx.proto +++ b/proto/kyve/stakers/v1beta1/tx.proto @@ -50,8 +50,12 @@ message MsgUpdateMetadata { string moniker = 2; // website ... string website = 3; - // logo - string logo = 4; + // identity from keybase.io + string identity = 4; + // security_contact ... + string security_contact = 5; + // details ... + string details = 6; } // MsgUpdateMetadataResponse defines the Msg/MsgUpdateMetadata response type. diff --git a/testutil/integration/checks.go b/testutil/integration/checks.go index 0af79364..0a3ff216 100644 --- a/testutil/integration/checks.go +++ b/testutil/integration/checks.go @@ -425,7 +425,9 @@ func (suite *KeeperTestSuite) verifyFullStaker(fullStaker querytypes.FullStaker, } Expect(fullStaker.SelfDelegationUnbonding).To(Equal(selfDelegationUnbonding)) - Expect(fullStaker.Metadata.Logo).To(Equal(staker.Logo)) + Expect(fullStaker.Metadata.Identity).To(Equal(staker.Identity)) + Expect(fullStaker.Metadata.SecurityContact).To(Equal(staker.SecurityContact)) + Expect(fullStaker.Metadata.Details).To(Equal(staker.Details)) Expect(fullStaker.Metadata.Website).To(Equal(staker.Website)) Expect(fullStaker.Metadata.Commission).To(Equal(staker.Commission)) Expect(fullStaker.Metadata.Moniker).To(Equal(staker.Moniker)) diff --git a/x/query/keeper/helper.go b/x/query/keeper/helper.go index 6b9a9e40..83ecb35b 100644 --- a/x/query/keeper/helper.go +++ b/x/query/keeper/helper.go @@ -23,7 +23,9 @@ func (k Keeper) GetFullStaker(ctx sdk.Context, stakerAddress string) *types.Full Commission: staker.Commission, Moniker: staker.Moniker, Website: staker.Website, - Logo: staker.Logo, + Identity: staker.Identity, + SecurityContact: staker.SecurityContact, + Details: staker.Details, PendingCommissionChange: commissionChangeEntry, } @@ -38,23 +40,25 @@ func (k Keeper) GetFullStaker(ctx sdk.Context, stakerAddress string) *types.Full accountValaddress, _ := sdk.AccAddressFromBech32(valaccount.Valaddress) balanceValaccount := k.bankKeeper.GetBalance(ctx, accountValaddress, globalTypes.Denom).Amount.Uint64() - poolMemberships = append(poolMemberships, &types.PoolMembership{ - Pool: &types.BasicPool{ - Id: pool.Id, - Name: pool.Name, - Runtime: pool.Runtime, - Logo: pool.Logo, - OperatingCost: pool.OperatingCost, - UploadInterval: pool.UploadInterval, - TotalFunds: pool.TotalFunds, - TotalDelegation: k.delegationKeeper.GetDelegationOfPool(ctx, pool.Id), - Status: k.GetPoolStatus(ctx, &pool), + poolMemberships = append( + poolMemberships, &types.PoolMembership{ + Pool: &types.BasicPool{ + Id: pool.Id, + Name: pool.Name, + Runtime: pool.Runtime, + Logo: pool.Logo, + OperatingCost: pool.OperatingCost, + UploadInterval: pool.UploadInterval, + TotalFunds: pool.TotalFunds, + TotalDelegation: k.delegationKeeper.GetDelegationOfPool(ctx, pool.Id), + Status: k.GetPoolStatus(ctx, &pool), + }, + Points: valaccount.Points, + IsLeaving: valaccount.IsLeaving, + Valaddress: valaccount.Valaddress, + Balance: balanceValaccount, }, - Points: valaccount.Points, - IsLeaving: valaccount.IsLeaving, - Valaddress: valaccount.Valaddress, - Balance: balanceValaccount, - }) + ) } // Iterate all UnbondingDelegation entries to get total delegation unbonding amount diff --git a/x/query/types/query.pb.go b/x/query/types/query.pb.go index efd01080..67a036dd 100644 --- a/x/query/types/query.pb.go +++ b/x/query/types/query.pb.go @@ -268,14 +268,18 @@ type StakerMetadata struct { Moniker string `protobuf:"bytes,2,opt,name=moniker,proto3" json:"moniker,omitempty"` // website is a https-link to the website of the staker Website string `protobuf:"bytes,3,opt,name=website,proto3" json:"website,omitempty"` - // logo is a link to an image file (like jpg or png) - Logo string `protobuf:"bytes,4,opt,name=logo,proto3" json:"logo,omitempty"` + // identity from keybase.io + Identity string `protobuf:"bytes,4,opt,name=identity,proto3" json:"identity,omitempty"` + // security_contact ... + SecurityContact string `protobuf:"bytes,5,opt,name=security_contact,json=securityContact,proto3" json:"security_contact,omitempty"` + // details ... + Details string `protobuf:"bytes,6,opt,name=details,proto3" json:"details,omitempty"` // pending_commission_change shows if the staker plans // to change its commission. Delegators will see a warning in // the UI. A Commission change takes some time until // the commission is applied. Users have time to redelegate // if they not agree with the new commission. - PendingCommissionChange *CommissionChangeEntry `protobuf:"bytes,5,opt,name=pending_commission_change,json=pendingCommissionChange,proto3" json:"pending_commission_change,omitempty"` + PendingCommissionChange *CommissionChangeEntry `protobuf:"bytes,7,opt,name=pending_commission_change,json=pendingCommissionChange,proto3" json:"pending_commission_change,omitempty"` } func (m *StakerMetadata) Reset() { *m = StakerMetadata{} } @@ -325,9 +329,23 @@ func (m *StakerMetadata) GetWebsite() string { return "" } -func (m *StakerMetadata) GetLogo() string { +func (m *StakerMetadata) GetIdentity() string { if m != nil { - return m.Logo + return m.Identity + } + return "" +} + +func (m *StakerMetadata) GetSecurityContact() string { + if m != nil { + return m.SecurityContact + } + return "" +} + +func (m *StakerMetadata) GetDetails() string { + if m != nil { + return m.Details } return "" } @@ -493,52 +511,55 @@ func init() { func init() { proto.RegisterFile("kyve/query/v1beta1/query.proto", fileDescriptor_6b41255feae93a15) } var fileDescriptor_6b41255feae93a15 = []byte{ - // 719 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x94, 0xcf, 0x6e, 0xd3, 0x4a, - 0x14, 0xc6, 0xe3, 0x24, 0x4d, 0x9b, 0x93, 0xdb, 0xf4, 0x6a, 0x74, 0xef, 0xad, 0x5b, 0xdd, 0xba, - 0x55, 0x10, 0xb4, 0x45, 0xc2, 0x51, 0x8b, 0x90, 0x10, 0x0b, 0x16, 0x4d, 0x5a, 0x09, 0x41, 0x2b, - 0x64, 0x04, 0x12, 0x6c, 0xac, 0x89, 0x3d, 0x75, 0x46, 0xb1, 0x67, 0x8c, 0x67, 0x9c, 0x92, 0x77, - 0x40, 0x82, 0x47, 0x61, 0xc1, 0x43, 0x74, 0xd9, 0x25, 0xb0, 0xa8, 0x50, 0xfb, 0x22, 0x68, 0xc6, - 0x7f, 0x48, 0x4a, 0xd8, 0xb1, 0xca, 0x9c, 0xef, 0x7c, 0x73, 0xe2, 0xf9, 0x9d, 0x33, 0x03, 0xd6, - 0x68, 0x32, 0x26, 0xdd, 0xb7, 0x29, 0x49, 0x26, 0xdd, 0xf1, 0xde, 0x80, 0x48, 0xbc, 0x97, 0x45, - 0x76, 0x9c, 0x70, 0xc9, 0x11, 0x52, 0x79, 0x3b, 0x53, 0xf2, 0xfc, 0xfa, 0x3f, 0x01, 0x0f, 0xb8, - 0x4e, 0x77, 0xd5, 0x2a, 0x73, 0xae, 0xff, 0xaf, 0x2b, 0xc5, 0x9c, 0x87, 0x65, 0x21, 0x15, 0x64, - 0xd9, 0xce, 0xa7, 0x2a, 0x34, 0x0f, 0xb0, 0xa0, 0xde, 0x73, 0xce, 0x43, 0xd4, 0x86, 0x2a, 0xf5, - 0x4d, 0x63, 0xcb, 0xd8, 0xa9, 0x3b, 0x55, 0xea, 0x23, 0x04, 0x75, 0x86, 0x23, 0x62, 0x56, 0xb7, - 0x8c, 0x9d, 0xa6, 0xa3, 0xd7, 0xc8, 0x84, 0xc5, 0x24, 0x65, 0x92, 0x46, 0xc4, 0xac, 0x69, 0xb9, - 0x08, 0x95, 0x3b, 0xe4, 0x01, 0x37, 0xeb, 0x99, 0x5b, 0xad, 0xd1, 0x6d, 0x68, 0xf3, 0x98, 0x24, - 0x58, 0x52, 0x16, 0xb8, 0x1e, 0x17, 0xd2, 0x5c, 0xd0, 0xd5, 0x97, 0x4b, 0xb5, 0xc7, 0x85, 0x44, - 0xdb, 0xb0, 0x92, 0xc6, 0x21, 0xc7, 0xbe, 0x4b, 0x99, 0x24, 0xc9, 0x18, 0x87, 0x66, 0x43, 0xfb, - 0xda, 0x99, 0xfc, 0x24, 0x57, 0xd1, 0x26, 0xb4, 0x24, 0x97, 0x38, 0x74, 0x4f, 0x53, 0xe6, 0x0b, - 0x73, 0x51, 0x9b, 0x40, 0x4b, 0x47, 0x4a, 0x41, 0xbb, 0xf0, 0x77, 0x66, 0xf0, 0x49, 0x48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e, 0xb0, 0xcf, 0x2f, 0x37, 0x2b, 0xdf, 0x2e, 0x37, 0xef, 0x04, 0x54, - 0x0e, 0xd3, 0x81, 0xed, 0xf1, 0xa8, 0xeb, 0x71, 0x11, 0x71, 0x91, 0xff, 0xdc, 0x13, 0xfe, 0xa8, - 0x2b, 0x27, 0x31, 0x11, 0x76, 0x9f, 0x78, 0xce, 0x54, 0x05, 0xd5, 0xaf, 0x88, 0x33, 0x3a, 0x22, - 0x49, 0x3e, 0xd6, 0x45, 0xa8, 0x32, 0x67, 0x64, 0x20, 0xa8, 0x2c, 0x27, 0x3b, 0x0f, 0xe7, 0x4e, - 0x36, 0x81, 0xb5, 0x98, 0x68, 0x86, 0xee, 0xcf, 0xea, 0xae, 0x37, 0xc4, 0x2c, 0x20, 0x9a, 0x60, - 0x6b, 0x7f, 0x77, 0xde, 0xc1, 0x7b, 0xa5, 0xb9, 0xa7, 0xbd, 0x87, 0x4c, 0x26, 0x13, 0x67, 0x35, - 0xaf, 0x75, 0x33, 0xdb, 0x79, 0x6f, 0xc0, 0xbf, 0x73, 0xb7, 0xfc, 0x71, 0x30, 0xb7, 0x60, 0xd9, - 0x4b, 0x48, 0x36, 0x3e, 0x3e, 0x96, 0xd9, 0xad, 0xaf, 0x39, 0x7f, 0x15, 0x62, 0x1f, 0x4b, 0xd2, - 0xf9, 0x6c, 0x40, 0x7b, 0xb6, 0x75, 0x68, 0x0f, 0xea, 0xaa, 0x79, 0xfa, 0x0b, 0x5a, 0xc5, 0x25, - 0x9a, 0x3d, 0x73, 0xf9, 0xc2, 0x38, 0xda, 0x8a, 0xfe, 0x83, 0x46, 0xcc, 0x29, 0x93, 0x42, 0xff, - 0x47, 0xdd, 0xc9, 0x23, 0xb4, 0x01, 0x40, 0x85, 0x1b, 0x12, 0x3c, 0x56, 0x93, 0xab, 0x9a, 0xb0, - 0xe4, 0x34, 0xa9, 0x78, 0x96, 0x09, 0xc8, 0x02, 0x18, 0xe3, 0xb0, 0xb8, 0x6d, 0x59, 0x33, 0xa6, - 0x14, 0xd5, 0xc0, 0x01, 0x0e, 0x31, 0xf3, 0x48, 0x3e, 0xc2, 0x45, 0x78, 0xd0, 0x3f, 0xbf, 0xb2, - 0x8c, 0x8b, 0x2b, 0xcb, 0xf8, 0x7e, 0x65, 0x19, 0x1f, 0xaf, 0xad, 0xca, 0xc5, 0xb5, 0x55, 0xf9, - 0x72, 0x6d, 0x55, 0xde, 0xdc, 0x9d, 0x22, 0xf5, 0xf4, 0xf5, 0xab, 0xc3, 0x13, 0x22, 0xcf, 0x78, - 0x32, 0xea, 0x7a, 0x43, 0x4c, 0x59, 0xf7, 0x5d, 0xfe, 0x04, 0x6b, 0x62, 0x83, 0x86, 0x7e, 0x33, - 0xef, 0xff, 0x08, 0x00, 0x00, 0xff, 0xff, 0x97, 0x7e, 0xc8, 0xa1, 0x9d, 0x05, 0x00, 0x00, + // 765 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x94, 0x41, 0x6f, 0xe3, 0x44, + 0x14, 0xc7, 0xe3, 0x24, 0x4d, 0x93, 0x17, 0x9a, 0xa0, 0x11, 0x50, 0xb7, 0xa2, 0x6e, 0x15, 0x04, + 0x6d, 0x91, 0x70, 0xd4, 0x22, 0x24, 0xc4, 0x81, 0x43, 0x93, 0x56, 0x42, 0xd0, 0x0a, 0x19, 0x81, + 0x04, 0x17, 0x6b, 0x62, 0x4f, 0x9d, 0x51, 0xec, 0x19, 0xe3, 0x19, 0xa7, 0xe4, 0x3b, 0x70, 0xe0, + 0xa3, 0x70, 0xd8, 0x0f, 0xd1, 0x63, 0x8f, 0xbb, 0xab, 0x55, 0xb5, 0x6a, 0xbf, 0xc8, 0x6a, 0x66, + 0x6c, 0x6f, 0xd2, 0xcd, 0xde, 0xf6, 0x14, 0xbf, 0xff, 0xfb, 0xcf, 0xcb, 0xcc, 0xef, 0xbd, 0x19, + 0x70, 0x66, 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 0xb8, 0x92, 0xd1, 0x77, 0xd0, 0x12, + 0x12, 0xcb, 0x5c, 0xd8, 0x9d, 0x03, 0xeb, 0xa8, 0x77, 0xba, 0xe7, 0x6a, 0xa8, 0x9a, 0x4e, 0x81, + 0xca, 0x55, 0x58, 0x7e, 0xd3, 0x26, 0xaf, 0x30, 0x0f, 0x5e, 0xd4, 0x01, 0x2e, 0xf2, 0x58, 0xc9, + 0x33, 0x92, 0x29, 0x1e, 0x38, 0x0c, 0x33, 0x22, 0x84, 0x06, 0xd7, 0xf1, 0xca, 0x10, 0xfd, 0x08, + 0xed, 0x84, 0x48, 0x1c, 0x62, 0x89, 0x35, 0xc1, 0xee, 0xe9, 0xc0, 0x7d, 0xb7, 0x6d, 0xae, 0xa9, + 0x73, 0x59, 0x38, 0xbd, 0x6a, 0x8d, 0x82, 0x22, 0x48, 0x7c, 0xbd, 0x7c, 0x92, 0x86, 0x81, 0xa2, + 0xe4, 0xa5, 0x83, 0xfc, 0x00, 0x3b, 0x4f, 0x8c, 0x7e, 0xce, 0x26, 0x9c, 0x85, 0x94, 0x45, 0xba, + 0x1b, 0x4d, 0x6f, 0x7b, 0x75, 0xc9, 0xef, 0x65, 0x7a, 0x2d, 0xaf, 0x8d, 0xf5, 0xbc, 0x0e, 0xa1, + 0x5f, 0x98, 0x78, 0xe6, 0x07, 0x3c, 0x67, 0xb2, 0x6c, 0x52, 0x25, 0x8f, 0x94, 0x8a, 0xbe, 0x87, + 0x0d, 0x05, 0x51, 0xb5, 0xa7, 0xf1, 0xbe, 0x53, 0x2b, 0xb0, 0x97, 0x24, 0x99, 0x90, 0x4c, 0x4c, + 0x69, 0xea, 0x99, 0x05, 0x83, 0x57, 0x75, 0xe8, 0xad, 0xf2, 0x40, 0x57, 0x00, 0x01, 0x4f, 0x12, + 0x2a, 0x84, 0xda, 0x9a, 0x46, 0x7c, 0xe6, 0xde, 0xde, 0xef, 0xd7, 0x5e, 0xde, 0xef, 0x7f, 0x15, + 0x51, 0x39, 0xcd, 0x27, 0x6e, 0xc0, 0x93, 0x61, 0xc0, 0x45, 0xc2, 0x45, 0xf1, 0xf3, 0x8d, 0x08, + 0x67, 0x43, 0xb9, 0x48, 0x89, 0x70, 0xc7, 0x24, 0xf0, 0x96, 0x2a, 0xa8, 0x7e, 0x25, 0x9c, 0xd1, + 0x19, 0xc9, 0x8a, 0xb1, 0x2e, 0x43, 0x95, 0xb9, 0x21, 0x13, 0x41, 0x65, 0x35, 0xd9, 0x45, 0x88, + 0x76, 0xa1, 0x4d, 0x43, 0xc2, 0x24, 0x95, 0x8b, 0x62, 0xba, 0xab, 0x58, 0x01, 0x14, 0x24, 0xc8, + 0x33, 0x2a, 0x17, 0x7e, 0xc0, 0x99, 0xc4, 0x81, 0x99, 0xf1, 0x8e, 0xd7, 0x2f, 0xf5, 0x91, 0x91, + 0xd5, 0x1f, 0x84, 0x44, 0x62, 0x1a, 0x0b, 0x0d, 0xae, 0xe3, 0x95, 0x21, 0x22, 0xb0, 0x93, 0x12, + 0xdd, 0x10, 0xff, 0xed, 0x56, 0xfd, 0x60, 0x8a, 0x59, 0x44, 0xf4, 0x90, 0x77, 0x4f, 0x8f, 0xd7, + 0x51, 0x1c, 0x55, 0xe6, 0x91, 0xf6, 0x9e, 0x33, 0x99, 0x2d, 0xbc, 0xed, 0xa2, 0xd6, 0xd3, 0xec, + 0xe0, 0x5f, 0x0b, 0x3e, 0x5d, 0xbb, 0xe4, 0x83, 0x53, 0xfe, 0x02, 0xb6, 0x82, 0x8c, 0x98, 0x59, + 0x0c, 0xb1, 0x34, 0x4f, 0x48, 0xc3, 0xfb, 0xa8, 0x14, 0xc7, 0x58, 0x92, 0xc1, 0x33, 0x0b, 0x7a, + 0xab, 0x73, 0x80, 0x4e, 0xa0, 0xa9, 0x26, 0x41, 0xef, 0xa0, 0x5b, 0xde, 0xc8, 0xd5, 0x33, 0x57, + 0xcf, 0x95, 0xa7, 0xad, 0xe8, 0x33, 0x68, 0xa5, 0x9c, 0x32, 0x29, 0xf4, 0x7f, 0x34, 0xbd, 0x22, + 0x42, 0x7b, 0x00, 0x54, 0xf8, 0x31, 0xc1, 0x73, 0x75, 0x0d, 0x54, 0x47, 0xdb, 0x5e, 0x87, 0x8a, + 0x5f, 0x8c, 0x80, 0x1c, 0x80, 0x39, 0x8e, 0xcb, 0xab, 0x6b, 0xba, 0xba, 0xa4, 0xa8, 0x66, 0x4d, + 0x70, 0x8c, 0x59, 0x40, 0x8a, 0xfb, 0x50, 0x86, 0x67, 0xe3, 0xdb, 0x07, 0xc7, 0xba, 0x7b, 0x70, + 0xac, 0xd7, 0x0f, 0x8e, 0xf5, 0xdf, 0xa3, 0x53, 0xbb, 0x7b, 0x74, 0x6a, 0xcf, 0x1f, 0x9d, 0xda, + 0x5f, 0x5f, 0x2f, 0x91, 0xfa, 0xf9, 0xcf, 0x3f, 0xce, 0xaf, 0x88, 0xbc, 0xe1, 0xd9, 0x6c, 0x18, + 0x4c, 0x31, 0x65, 0xc3, 0x7f, 0x8a, 0xf7, 0x5c, 0x13, 0x9b, 0xb4, 0xf4, 0x03, 0xfc, 0xed, 0x9b, + 0x00, 0x00, 0x00, 0xff, 0xff, 0xb3, 0xdc, 0x12, 0x0e, 0xea, 0x05, 0x00, 0x00, } func (m *BasicPool) Marshal() (dAtA []byte, err error) { @@ -721,12 +742,26 @@ func (m *StakerMetadata) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintQuery(dAtA, i, uint64(size)) } i-- + dAtA[i] = 0x3a + } + if len(m.Details) > 0 { + i -= len(m.Details) + copy(dAtA[i:], m.Details) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Details))) + i-- + dAtA[i] = 0x32 + } + if len(m.SecurityContact) > 0 { + i -= len(m.SecurityContact) + copy(dAtA[i:], m.SecurityContact) + i = encodeVarintQuery(dAtA, i, uint64(len(m.SecurityContact))) + i-- dAtA[i] = 0x2a } - if len(m.Logo) > 0 { - i -= len(m.Logo) - copy(dAtA[i:], m.Logo) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Logo))) + if len(m.Identity) > 0 { + i -= len(m.Identity) + copy(dAtA[i:], m.Identity) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Identity))) i-- dAtA[i] = 0x22 } @@ -958,7 +993,15 @@ func (m *StakerMetadata) Size() (n int) { if l > 0 { n += 1 + l + sovQuery(uint64(l)) } - l = len(m.Logo) + l = len(m.Identity) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.SecurityContact) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.Details) if l > 0 { n += 1 + l + sovQuery(uint64(l)) } @@ -1632,7 +1675,7 @@ func (m *StakerMetadata) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Logo", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Identity", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1660,9 +1703,73 @@ func (m *StakerMetadata) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Logo = string(dAtA[iNdEx:postIndex]) + m.Identity = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SecurityContact", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + 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 ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SecurityContact = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Details", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + 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 ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Details = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 7: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field PendingCommissionChange", wireType) } diff --git a/x/stakers/client/cli/tx_update_metadata.go b/x/stakers/client/cli/tx_update_metadata.go index 0fce70f3..bec57ab2 100644 --- a/x/stakers/client/cli/tx_update_metadata.go +++ b/x/stakers/client/cli/tx_update_metadata.go @@ -10,9 +10,9 @@ import ( func CmdUpdateMetadata() *cobra.Command { cmd := &cobra.Command{ - Use: "update-metadata [moniker] [website] [logo]", + Use: "update-metadata [moniker] [website] [identity] [security_contact] [details]", Short: "Broadcast message update-metadata", - Args: cobra.ExactArgs(3), + Args: cobra.ExactArgs(5), RunE: func(cmd *cobra.Command, args []string) (err error) { clientCtx, err := client.GetClientTxContext(cmd) if err != nil { @@ -20,10 +20,12 @@ func CmdUpdateMetadata() *cobra.Command { } msg := types.MsgUpdateMetadata{ - Creator: clientCtx.GetFromAddress().String(), - Moniker: args[0], - Website: args[1], - Logo: args[2], + Creator: clientCtx.GetFromAddress().String(), + Moniker: args[0], + Website: args[1], + Identity: args[2], + SecurityContact: args[3], + Details: args[4], } if err := msg.ValidateBasic(); err != nil { diff --git a/x/stakers/keeper/getters_staker.go b/x/stakers/keeper/getters_staker.go index db8436c7..588addde 100644 --- a/x/stakers/keeper/getters_staker.go +++ b/x/stakers/keeper/getters_staker.go @@ -13,12 +13,22 @@ import ( ) // UpdateStakerMetadata ... -func (k Keeper) UpdateStakerMetadata(ctx sdk.Context, address string, moniker string, website string, logo string) { +func (k Keeper) UpdateStakerMetadata( + ctx sdk.Context, + address string, + moniker string, + website string, + identity string, + securityContact string, + details string, +) { staker, found := k.GetStaker(ctx, address) if found { staker.Moniker = moniker staker.Website = website - staker.Logo = logo + staker.Identity = identity + staker.SecurityContact = securityContact + staker.Details = details k.setStaker(ctx, staker) } } @@ -117,10 +127,18 @@ func (k Keeper) GetStaker( return val, true } -func (k Keeper) GetPaginatedStakerQuery(ctx sdk.Context, pagination *query.PageRequest, accumulator func(staker types.Staker)) (*query.PageResponse, error) { +func (k Keeper) GetPaginatedStakerQuery( + ctx sdk.Context, + pagination *query.PageRequest, + accumulator func(staker types.Staker), +) (*query.PageResponse, error) { store := prefix.NewStore(ctx.KVStore(k.storeKey), types.StakerKeyPrefix) - pageRes, err := query.FilteredPaginate(store, pagination, func(key []byte, value []byte, accumulate bool) (bool, error) { + pageRes, err := query.FilteredPaginate(store, pagination, func( + key []byte, + value []byte, + accumulate bool, + ) (bool, error) { if accumulate { var staker types.Staker if err := k.cdc.Unmarshal(value, &staker); err != nil { diff --git a/x/stakers/keeper/msg_server_create_staker.go b/x/stakers/keeper/msg_server_create_staker.go index 7bd95860..ca535900 100644 --- a/x/stakers/keeper/msg_server_create_staker.go +++ b/x/stakers/keeper/msg_server_create_staker.go @@ -43,8 +43,9 @@ func (k msgServer) CreateStaker( } _ = ctx.EventManager().EmitTypedEvent(&types.EventCreateStaker{ - Staker: msg.Creator, - Amount: msg.Amount, + Staker: msg.Creator, + Amount: msg.Amount, + Commission: msg.Commission, }) return &types.MsgCreateStakerResponse{}, nil diff --git a/x/stakers/keeper/msg_server_create_staker_test.go b/x/stakers/keeper/msg_server_create_staker_test.go index cc933974..936b9e36 100644 --- a/x/stakers/keeper/msg_server_create_staker_test.go +++ b/x/stakers/keeper/msg_server_create_staker_test.go @@ -61,8 +61,10 @@ var _ = Describe("msg_server_create_staker.go", Ordered, func() { Expect(staker.Commission).To(Equal(sdk.MustNewDecFromStr("0.2"))) Expect(staker.Moniker).To(BeEmpty()) - Expect(staker.Logo).To(BeEmpty()) + Expect(staker.Identity).To(BeEmpty()) Expect(staker.Website).To(BeEmpty()) + Expect(staker.SecurityContact).To(BeEmpty()) + Expect(staker.Details).To(BeEmpty()) Expect(valaccounts).To(BeEmpty()) }) @@ -99,8 +101,10 @@ var _ = Describe("msg_server_create_staker.go", Ordered, func() { Expect(staker.Commission).To(Equal(types.DefaultCommission)) Expect(staker.Moniker).To(BeEmpty()) - Expect(staker.Logo).To(BeEmpty()) + Expect(staker.Identity).To(BeEmpty()) Expect(staker.Website).To(BeEmpty()) + Expect(staker.SecurityContact).To(BeEmpty()) + Expect(staker.Details).To(BeEmpty()) Expect(valaccounts).To(HaveLen(0)) }) @@ -153,8 +157,10 @@ var _ = Describe("msg_server_create_staker.go", Ordered, func() { Expect(staker.Commission).To(Equal(types.DefaultCommission)) Expect(staker.Moniker).To(BeEmpty()) - Expect(staker.Logo).To(BeEmpty()) + Expect(staker.Identity).To(BeEmpty()) Expect(staker.Website).To(BeEmpty()) + Expect(staker.SecurityContact).To(BeEmpty()) + Expect(staker.Details).To(BeEmpty()) Expect(valaccounts).To(BeEmpty()) }) @@ -188,8 +194,10 @@ var _ = Describe("msg_server_create_staker.go", Ordered, func() { Expect(staker.Commission).To(Equal(types.DefaultCommission)) Expect(staker.Moniker).To(BeEmpty()) - Expect(staker.Logo).To(BeEmpty()) + Expect(staker.Identity).To(BeEmpty()) Expect(staker.Website).To(BeEmpty()) + Expect(staker.SecurityContact).To(BeEmpty()) + Expect(staker.Details).To(BeEmpty()) Expect(valaccounts).To(BeEmpty()) }) diff --git a/x/stakers/keeper/msg_server_update_metadata.go b/x/stakers/keeper/msg_server_update_metadata.go index 6f0dd049..40a408cf 100644 --- a/x/stakers/keeper/msg_server_update_metadata.go +++ b/x/stakers/keeper/msg_server_update_metadata.go @@ -11,7 +11,10 @@ import ( // UpdateMetadata allows a staker to change basic metadata like moniker, address, logo, etc. // The update is performed immediately. -func (k msgServer) UpdateMetadata(goCtx context.Context, msg *types.MsgUpdateMetadata) (*types.MsgUpdateMetadataResponse, error) { +func (k msgServer) UpdateMetadata( + goCtx context.Context, + msg *types.MsgUpdateMetadata, +) (*types.MsgUpdateMetadataResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) // Check if the sender is a protocol node (aka has staked into this pool). @@ -20,13 +23,15 @@ func (k msgServer) UpdateMetadata(goCtx context.Context, msg *types.MsgUpdateMet } // Apply new metadata to staker - k.UpdateStakerMetadata(ctx, msg.Creator, msg.Moniker, msg.Website, msg.Logo) + k.UpdateStakerMetadata(ctx, msg.Creator, msg.Moniker, msg.Website, msg.Identity, msg.SecurityContact, msg.Details) _ = ctx.EventManager().EmitTypedEvent(&types.EventUpdateMetadata{ - Staker: msg.Creator, - Moniker: msg.Moniker, - Website: msg.Website, - Logo: msg.Logo, + Staker: msg.Creator, + Moniker: msg.Moniker, + Website: msg.Website, + Identity: msg.Identity, + SecurityContact: msg.SecurityContact, + Details: msg.Details, }) return &types.MsgUpdateMetadataResponse{}, nil diff --git a/x/stakers/keeper/msg_server_update_metadata_test.go b/x/stakers/keeper/msg_server_update_metadata_test.go index fceb582f..81c1d662 100644 --- a/x/stakers/keeper/msg_server_update_metadata_test.go +++ b/x/stakers/keeper/msg_server_update_metadata_test.go @@ -1,6 +1,8 @@ package keeper_test import ( + "cosmossdk.io/errors" + errorsTypes "github.com/cosmos/cosmos-sdk/types/errors" . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" @@ -43,16 +45,20 @@ var _ = Describe("msg_server_update_metadata.go", Ordered, func() { Expect(staker.Moniker).To(BeEmpty()) Expect(staker.Website).To(BeEmpty()) - Expect(staker.Logo).To(BeEmpty()) + Expect(staker.Identity).To(BeEmpty()) + Expect(staker.SecurityContact).To(BeEmpty()) + Expect(staker.Details).To(BeEmpty()) }) It("Update metadata with real values of a newly created staker", func() { // ACT s.RunTxStakersSuccess(&stakerstypes.MsgUpdateMetadata{ - Creator: i.STAKER_0, - Moniker: "KYVE Node Runner", - Website: "https://kyve.network", - Logo: "https://arweave.net/Tewyv2P5VEG8EJ6AUQORdqNTectY9hlOrWPK8wwo-aU", + Creator: i.STAKER_0, + Moniker: "KYVE Node Runner", + Website: "https://kyve.network", + Identity: "7CD454E228C8F227", + SecurityContact: "security@kyve.network", + Details: "KYVE Protocol Node", }) // ASSERT @@ -60,24 +66,30 @@ var _ = Describe("msg_server_update_metadata.go", Ordered, func() { Expect(staker.Moniker).To(Equal("KYVE Node Runner")) Expect(staker.Website).To(Equal("https://kyve.network")) - Expect(staker.Logo).To(Equal("https://arweave.net/Tewyv2P5VEG8EJ6AUQORdqNTectY9hlOrWPK8wwo-aU")) + Expect(staker.Identity).To(Equal("7CD454E228C8F227")) + Expect(staker.SecurityContact).To(Equal("security@kyve.network")) + Expect(staker.Details).To(Equal("KYVE Protocol Node")) }) It("Reset metadata to empty values", func() { // ARRANGE s.RunTxStakersSuccess(&stakerstypes.MsgUpdateMetadata{ - Creator: i.STAKER_0, - Moniker: "KYVE Node Runner", - Website: "https://kyve.network", - Logo: "https://arweave.net/Tewyv2P5VEG8EJ6AUQORdqNTectY9hlOrWPK8wwo-aU", + Creator: i.STAKER_0, + Moniker: "KYVE Node Runner", + Website: "https://kyve.network", + Identity: "7CD454E228C8F227", + SecurityContact: "security@kyve.network", + Details: "KYVE Protocol Node", }) // ACT s.RunTxStakersSuccess(&stakerstypes.MsgUpdateMetadata{ - Creator: i.STAKER_0, - Moniker: "", - Website: "", - Logo: "", + Creator: i.STAKER_0, + Moniker: "", + Website: "", + Identity: "", + SecurityContact: "", + Details: "", }) // ASSERT @@ -85,7 +97,9 @@ var _ = Describe("msg_server_update_metadata.go", Ordered, func() { Expect(staker.Moniker).To(BeEmpty()) Expect(staker.Website).To(BeEmpty()) - Expect(staker.Logo).To(BeEmpty()) + Expect(staker.Identity).To(BeEmpty()) + Expect(staker.SecurityContact).To(BeEmpty()) + Expect(staker.Details).To(BeEmpty()) }) It("One below max length", func() { @@ -97,10 +111,12 @@ var _ = Describe("msg_server_update_metadata.go", Ordered, func() { // ACT msg := stakerstypes.MsgUpdateMetadata{ - Creator: i.STAKER_0, - Moniker: stringStillAllowed, - Website: stringStillAllowed, - Logo: stringStillAllowed, + Creator: i.STAKER_0, + Moniker: stringStillAllowed, + Website: stringStillAllowed, + Identity: "", + SecurityContact: stringStillAllowed, + Details: stringStillAllowed, } err := msg.ValidateBasic() @@ -118,14 +134,46 @@ var _ = Describe("msg_server_update_metadata.go", Ordered, func() { // ACT msg := stakerstypes.MsgUpdateMetadata{ - Creator: i.STAKER_0, - Moniker: stringTooLong, - Website: stringTooLong, - Logo: stringTooLong, + Creator: i.STAKER_0, + Moniker: stringTooLong, + Website: stringTooLong, + Identity: "", + SecurityContact: stringTooLong, + Details: stringTooLong, } err := msg.ValidateBasic() // ASSERT Expect(err).ToNot(BeNil()) }) + + It("Invalid Identity", func() { + // ARRANGE + invalidIdentity := "7CD454E228C8F22H" + + // ACT + msg := stakerstypes.MsgUpdateMetadata{ + Creator: i.STAKER_0, + Identity: invalidIdentity, + } + err := msg.ValidateBasic() + + // ASSERT + Expect(err.Error()).To(Equal(errors.Wrapf(errorsTypes.ErrLogic, stakerstypes.ErrInvalidIdentityString.Error(), msg.Identity).Error())) + }) + + It("Identity with lower-case hex letters", func() { + // ARRANGE + invalidIdentity := "7cd454e228c8f227" + + // ACT + msg := stakerstypes.MsgUpdateMetadata{ + Creator: i.STAKER_0, + Identity: invalidIdentity, + } + err := msg.ValidateBasic() + + // ASSERT + Expect(err).To(BeNil()) + }) }) diff --git a/x/stakers/spec/01_concepts.md b/x/stakers/spec/01_concepts.md index e656a75c..b163b81d 100644 --- a/x/stakers/spec/01_concepts.md +++ b/x/stakers/spec/01_concepts.md @@ -11,14 +11,17 @@ pools using valaccounts. ## Code Structure -This module adheres to our global coding structure, defined [here](../../../CodeStructure.md). +This module adheres to our global coding structure, defined +[here](../../../CodeStructure.md). ## Staker Every address can create one staker (itself). A staker has the following metadata which can be changed at any time. - Moniker -- Logo - Website +- Identity (keybase.io) +- Security contact (e.g. email) +- Details (arbitrary description) Additionally, a staker can specify a commission. However, this takes `CommissionChangeTime` seconds of time before the change is applied. diff --git a/x/stakers/spec/02_state.md b/x/stakers/spec/02_state.md index cf918dcf..493bb8fd 100644 --- a/x/stakers/spec/02_state.md +++ b/x/stakers/spec/02_state.md @@ -16,9 +16,11 @@ type Staker struct { Address string // Needs to be a valid decimal representation Commission sdk.Dec - Moniker uint64 - Website uint64 - Logo uint64 + Moniker string + Website string + Identity string + SecurityContact string + Details string } ``` diff --git a/x/stakers/spec/03_messages.md b/x/stakers/spec/03_messages.md index 56921f8f..9b1b11fa 100644 --- a/x/stakers/spec/03_messages.md +++ b/x/stakers/spec/03_messages.md @@ -12,8 +12,8 @@ self-delegation to the given staker. ## `MsgUpdateMetadata` -This message changes Moniker, Website and Logo of the staker. The message fails -if the user does not have created a staker yet. +This message changes Moniker, Website, Identity, SecurityContact and Details +of the staker. The message fails if the user does not have created a staker yet. ## `MsgUpdateCommission` diff --git a/x/stakers/spec/05_events.md b/x/stakers/spec/05_events.md index 8ee8ebcd..d1157772 100644 --- a/x/stakers/spec/05_events.md +++ b/x/stakers/spec/05_events.md @@ -31,6 +31,11 @@ message EventCreateStaker { string staker = 1; // amount for inital self-delegation uint64 amount = 2; + // commission + string commission = 3 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; } ``` @@ -51,8 +56,12 @@ message EventUpdateMetadata { string moniker = 2; // website ... string website = 3; - // logo ... - string logo = 4; + // identity ... + string identity = 4; + // security_contact ... + string security_contact = 5; + // details ... + string details = 6; } ``` diff --git a/x/stakers/types/errors.go b/x/stakers/types/errors.go index 35a19780..6e82dfb8 100644 --- a/x/stakers/types/errors.go +++ b/x/stakers/types/errors.go @@ -16,6 +16,7 @@ var ( ErrStakerAlreadyCreated = errors.Register(ModuleName, 1110, "Staker already created") ErrValaddressSameAsStaker = errors.Register(ModuleName, 1111, "Valaddress has same address as Valaddress") ErrCanNotJoinDisabledPool = errors.Register(ModuleName, 1112, "can not join disabled pool") + ErrInvalidIdentityString = errors.Register(ModuleName, 1113, "invalid identity: %s") ErrPoolLeaveAlreadyInProgress = errors.Register(ModuleName, 1117, "Pool leave is already in progress") ErrValaccountUnauthorized = errors.Register(ModuleName, 1118, "valaccount unauthorized") diff --git a/x/stakers/types/events.pb.go b/x/stakers/types/events.pb.go index c865279a..757b8f7e 100644 --- a/x/stakers/types/events.pb.go +++ b/x/stakers/types/events.pb.go @@ -96,6 +96,8 @@ type EventCreateStaker struct { Staker string `protobuf:"bytes,1,opt,name=staker,proto3" json:"staker,omitempty"` // amount ... Amount uint64 `protobuf:"varint,2,opt,name=amount,proto3" json:"amount,omitempty"` + // commission + Commission github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,3,opt,name=commission,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"commission"` } func (m *EventCreateStaker) Reset() { *m = EventCreateStaker{} } @@ -154,8 +156,12 @@ type EventUpdateMetadata struct { Moniker string `protobuf:"bytes,2,opt,name=moniker,proto3" json:"moniker,omitempty"` // website ... Website string `protobuf:"bytes,3,opt,name=website,proto3" json:"website,omitempty"` - // logo ... - Logo string `protobuf:"bytes,4,opt,name=logo,proto3" json:"logo,omitempty"` + // identity ... + Identity string `protobuf:"bytes,4,opt,name=identity,proto3" json:"identity,omitempty"` + // security_contact ... + SecurityContact string `protobuf:"bytes,5,opt,name=security_contact,json=securityContact,proto3" json:"security_contact,omitempty"` + // details ... + Details string `protobuf:"bytes,6,opt,name=details,proto3" json:"details,omitempty"` } func (m *EventUpdateMetadata) Reset() { *m = EventUpdateMetadata{} } @@ -212,9 +218,23 @@ func (m *EventUpdateMetadata) GetWebsite() string { return "" } -func (m *EventUpdateMetadata) GetLogo() string { +func (m *EventUpdateMetadata) GetIdentity() string { if m != nil { - return m.Logo + return m.Identity + } + return "" +} + +func (m *EventUpdateMetadata) GetSecurityContact() string { + if m != nil { + return m.SecurityContact + } + return "" +} + +func (m *EventUpdateMetadata) GetDetails() string { + if m != nil { + return m.Details } return "" } @@ -411,36 +431,39 @@ func init() { func init() { proto.RegisterFile("kyve/stakers/v1beta1/events.proto", fileDescriptor_7a1b3dc9634155a0) } var fileDescriptor_7a1b3dc9634155a0 = []byte{ - // 462 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x93, 0xdf, 0x6a, 0xd4, 0x40, - 0x14, 0xc6, 0x37, 0x6b, 0xd8, 0x65, 0x8f, 0x28, 0x18, 0xab, 0x86, 0x22, 0x69, 0xcd, 0x85, 0xf4, - 0x42, 0x13, 0xaa, 0x4f, 0xd0, 0x5d, 0x2b, 0xf8, 0xaf, 0x94, 0x88, 0x82, 0xde, 0x94, 0xb3, 0x99, - 0xc3, 0x36, 0x6c, 0x92, 0x13, 0x32, 0xb3, 0xd9, 0xee, 0x95, 0xaf, 0xe0, 0xbb, 0xf8, 0x12, 0xbd, - 0xec, 0xa5, 0x78, 0x51, 0x64, 0xf7, 0x45, 0x24, 0x93, 0xd9, 0x9a, 0x42, 0x17, 0xc4, 0xab, 0xcc, - 0x37, 0xf3, 0xe5, 0xf7, 0x7d, 0x73, 0x48, 0xe0, 0xc9, 0x74, 0x51, 0x51, 0x28, 0x15, 0x4e, 0xa9, - 0x94, 0x61, 0xb5, 0x3f, 0x26, 0x85, 0xfb, 0x21, 0x55, 0x94, 0x2b, 0x19, 0x14, 0x25, 0x2b, 0x76, - 0xb6, 0x6a, 0x4b, 0x60, 0x2c, 0x81, 0xb1, 0x6c, 0x6f, 0x4d, 0x78, 0xc2, 0xda, 0x10, 0xd6, 0xab, - 0xc6, 0xbb, 0x7d, 0x33, 0xae, 0xc0, 0x12, 0x33, 0x83, 0xf3, 0x7f, 0x58, 0x70, 0xef, 0xb0, 0xe6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d3, 0x50, 0x2d, 0x0a, 0x92, 0xc1, 0x2b, 0x8a, 0xa3, 0x16, 0xc1, - 0x3f, 0x83, 0x3b, 0xba, 0xc0, 0x5b, 0x4e, 0xf2, 0x63, 0xe6, 0xd4, 0x79, 0x04, 0xfd, 0x82, 0x39, - 0x3d, 0x49, 0x84, 0x4e, 0xb6, 0xa3, 0x5e, 0x2d, 0xdf, 0x88, 0x56, 0xa3, 0xee, 0xb5, 0x46, 0x1e, - 0x40, 0x85, 0x29, 0x0a, 0x51, 0x92, 0x94, 0xe6, 0xce, 0xad, 0x9d, 0xd6, 0xc4, 0xed, 0x6b, 0x13, - 0x3f, 0x80, 0xbb, 0x3a, 0xf9, 0x3d, 0x61, 0x45, 0xff, 0x15, 0x3d, 0x7c, 0x7d, 0xbe, 0xf4, 0xac, - 0x8b, 0xa5, 0x67, 0xfd, 0x5e, 0x7a, 0xd6, 0xf7, 0x95, 0xd7, 0xb9, 0x58, 0x79, 0x9d, 0x9f, 0x2b, - 0xaf, 0xf3, 0xf5, 0x59, 0x6b, 0x14, 0xef, 0xbe, 0x7c, 0x3e, 0x3c, 0x22, 0x35, 0xe7, 0x72, 0x1a, - 0xc6, 0xa7, 0x98, 0xe4, 0xe1, 0xd9, 0xd5, 0x6f, 0xa0, 0x87, 0x32, 0xee, 0xe9, 0xcf, 0xff, 0xe5, - 0x9f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x69, 0xd7, 0xac, 0xc1, 0x72, 0x03, 0x00, 0x00, + // 511 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x53, 0xcb, 0x6e, 0xd3, 0x40, + 0x14, 0x8d, 0x43, 0x48, 0xc8, 0x20, 0x5e, 0xa6, 0x80, 0x15, 0x21, 0xb7, 0x78, 0x81, 0x8a, 0x04, + 0xb6, 0x0a, 0x5f, 0xd0, 0x84, 0x22, 0xf1, 0xaa, 0x2a, 0x23, 0x90, 0x60, 0x13, 0x4d, 0x3c, 0x57, + 0xe9, 0x28, 0xf6, 0x5c, 0xcb, 0x33, 0x71, 0xea, 0x15, 0xbf, 0x80, 0xc4, 0xa7, 0xf0, 0x07, 0xac, + 0xba, 0xec, 0x12, 0xb1, 0xa8, 0x50, 0xf2, 0x23, 0xc8, 0xe3, 0x71, 0x70, 0xa5, 0x56, 0x42, 0xb0, + 0xb2, 0xcf, 0xbd, 0x67, 0xce, 0x39, 0xf7, 0x6a, 0x86, 0x3c, 0x98, 0x15, 0x39, 0x04, 0x52, 0xd1, + 0x19, 0x64, 0x32, 0xc8, 0x77, 0x26, 0xa0, 0xe8, 0x4e, 0x00, 0x39, 0x08, 0x25, 0xfd, 0x34, 0x43, + 0x85, 0xf6, 0x46, 0x49, 0xf1, 0x0d, 0xc5, 0x37, 0x94, 0xc1, 0xc6, 0x14, 0xa7, 0xa8, 0x09, 0x41, + 0xf9, 0x57, 0x71, 0x07, 0xe7, 0xcb, 0xa5, 0x34, 0xa3, 0x89, 0x91, 0xf3, 0xbe, 0x59, 0xe4, 0xd6, + 0x5e, 0xa9, 0xff, 0x3e, 0x65, 0x54, 0xc1, 0x81, 0xee, 0xd9, 0xbb, 0x84, 0x60, 0xcc, 0xc6, 0x15, + 0xd3, 0xb1, 0xb6, 0xac, 0xed, 0xab, 0x4f, 0xef, 0xfb, 0xe7, 0x39, 0xfb, 0xd5, 0x89, 0x61, 0xe7, + 0xf8, 0x74, 0xb3, 0x15, 0xf6, 0x31, 0x66, 0x7f, 0x24, 0x04, 0x2c, 0x6a, 0x89, 0xf6, 0xdf, 0x4b, + 0x08, 0x58, 0x18, 0x09, 0x87, 0xf4, 0x52, 0x5a, 0xc4, 0x48, 0x99, 0x73, 0x69, 0xcb, 0xda, 0xee, + 0x87, 0x35, 0xf4, 0xbe, 0xd6, 0xa9, 0x47, 0x19, 0x50, 0x05, 0xef, 0xb4, 0xa0, 0x7d, 0x97, 0x74, + 0x2b, 0x69, 0x9d, 0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, 0x6b, 0x24, 0x6a, 0x9f, 0x49, 0xe4, + 0x12, 0x92, 0xd3, 0x98, 0x32, 0x96, 0x81, 0x94, 0x66, 0x81, 0x8d, 0x4a, 0xe3, 0x3e, 0x74, 0x9a, + 0xf7, 0xc1, 0xdb, 0x25, 0xd7, 0xb5, 0xf3, 0x1b, 0xa0, 0x39, 0xfc, 0x93, 0xf5, 0xf0, 0xc5, 0xf1, + 0xd2, 0xb5, 0x4e, 0x96, 0xae, 0xf5, 0x6b, 0xe9, 0x5a, 0x5f, 0x56, 0x6e, 0xeb, 0x64, 0xe5, 0xb6, + 0x7e, 0xac, 0xdc, 0xd6, 0xa7, 0xc7, 0x8d, 0x55, 0xbc, 0xfe, 0xf8, 0x61, 0x6f, 0x1f, 0xd4, 0x02, + 0xb3, 0x59, 0x10, 0x1d, 0x52, 0x2e, 0x82, 0xa3, 0xf5, 0x2b, 0xd5, 0x4b, 0x99, 0x74, 0xf5, 0xeb, + 0x7c, 0xf6, 0x3b, 0x00, 0x00, 0xff, 0xff, 0x78, 0x7d, 0x88, 0x0f, 0x11, 0x04, 0x00, 0x00, } func (m *EventUpdateParams) Marshal() (dAtA []byte, err error) { @@ -513,6 +536,16 @@ func (m *EventCreateStaker) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + { + size := m.Commission.Size() + i -= size + if _, err := m.Commission.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintEvents(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a if m.Amount != 0 { i = encodeVarintEvents(dAtA, i, uint64(m.Amount)) i-- @@ -548,10 +581,24 @@ func (m *EventUpdateMetadata) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if len(m.Logo) > 0 { - i -= len(m.Logo) - copy(dAtA[i:], m.Logo) - i = encodeVarintEvents(dAtA, i, uint64(len(m.Logo))) + if len(m.Details) > 0 { + i -= len(m.Details) + copy(dAtA[i:], m.Details) + i = encodeVarintEvents(dAtA, i, uint64(len(m.Details))) + i-- + dAtA[i] = 0x32 + } + if len(m.SecurityContact) > 0 { + i -= len(m.SecurityContact) + copy(dAtA[i:], m.SecurityContact) + i = encodeVarintEvents(dAtA, i, uint64(len(m.SecurityContact))) + i-- + dAtA[i] = 0x2a + } + if len(m.Identity) > 0 { + i -= len(m.Identity) + copy(dAtA[i:], m.Identity) + i = encodeVarintEvents(dAtA, i, uint64(len(m.Identity))) i-- dAtA[i] = 0x22 } @@ -742,6 +789,8 @@ func (m *EventCreateStaker) Size() (n int) { if m.Amount != 0 { n += 1 + sovEvents(uint64(m.Amount)) } + l = m.Commission.Size() + n += 1 + l + sovEvents(uint64(l)) return n } @@ -763,7 +812,15 @@ func (m *EventUpdateMetadata) Size() (n int) { if l > 0 { n += 1 + l + sovEvents(uint64(l)) } - l = len(m.Logo) + l = len(m.Identity) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + l = len(m.SecurityContact) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + l = len(m.Details) if l > 0 { n += 1 + l + sovEvents(uint64(l)) } @@ -1058,6 +1115,40 @@ func (m *EventCreateStaker) Unmarshal(dAtA []byte) error { break } } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Commission", 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 + } + if err := m.Commission.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipEvents(dAtA[iNdEx:]) @@ -1206,7 +1297,71 @@ func (m *EventUpdateMetadata) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Logo", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Identity", 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.Identity = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SecurityContact", 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.SecurityContact = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Details", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1234,7 +1389,7 @@ func (m *EventUpdateMetadata) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Logo = string(dAtA[iNdEx:postIndex]) + m.Details = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex diff --git a/x/stakers/types/message_update_metadata.go b/x/stakers/types/message_update_metadata.go index ab53fb12..c9291699 100644 --- a/x/stakers/types/message_update_metadata.go +++ b/x/stakers/types/message_update_metadata.go @@ -1,7 +1,10 @@ package types import ( + "encoding/hex" + "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" errorsTypes "github.com/cosmos/cosmos-sdk/types/errors" ) @@ -32,13 +35,14 @@ func (msg *MsgUpdateMetadata) GetSignBytes() []byte { } func (msg *MsgUpdateMetadata) ValidateBasic() error { - _, err := sdk.AccAddressFromBech32(msg.Creator) - if err != nil { + if _, err := sdk.AccAddressFromBech32(msg.Creator); err != nil { return errors.Wrapf(errorsTypes.ErrInvalidAddress, "invalid creator address (%s)", err) } - if len(msg.Logo) > 255 { - return errors.Wrapf(errorsTypes.ErrLogic, ErrStringMaxLengthExceeded.Error(), len(msg.Logo), 255) + if len(msg.Identity) > 0 { + if hexBytes, identityErr := hex.DecodeString(msg.Identity); identityErr != nil || len(hexBytes) != 8 { + return errors.Wrapf(errorsTypes.ErrLogic, ErrInvalidIdentityString.Error(), msg.Identity) + } } if len(msg.Website) > 255 { @@ -49,5 +53,13 @@ func (msg *MsgUpdateMetadata) ValidateBasic() error { return errors.Wrapf(errorsTypes.ErrLogic, ErrStringMaxLengthExceeded.Error(), len(msg.Moniker), 255) } + if len(msg.SecurityContact) > 255 { + return errors.Wrapf(errorsTypes.ErrLogic, ErrStringMaxLengthExceeded.Error(), len(msg.Moniker), 255) + } + + if len(msg.Details) > 255 { + return errors.Wrapf(errorsTypes.ErrLogic, ErrStringMaxLengthExceeded.Error(), len(msg.Moniker), 255) + } + return nil } diff --git a/x/stakers/types/stakers.pb.go b/x/stakers/types/stakers.pb.go index 879a0ceb..ae6ac79c 100644 --- a/x/stakers/types/stakers.pb.go +++ b/x/stakers/types/stakers.pb.go @@ -35,8 +35,12 @@ type Staker struct { Moniker string `protobuf:"bytes,3,opt,name=moniker,proto3" json:"moniker,omitempty"` // website ... Website string `protobuf:"bytes,4,opt,name=website,proto3" json:"website,omitempty"` - // logo ... - Logo string `protobuf:"bytes,5,opt,name=logo,proto3" json:"logo,omitempty"` + // identity is the 64 bit keybase.io identity string + Identity string `protobuf:"bytes,5,opt,name=identity,proto3" json:"identity,omitempty"` + // security_contact ... + SecurityContact string `protobuf:"bytes,6,opt,name=security_contact,json=securityContact,proto3" json:"security_contact,omitempty"` + // details are some additional notes the staker finds important + Details string `protobuf:"bytes,7,opt,name=details,proto3" json:"details,omitempty"` } func (m *Staker) Reset() { *m = Staker{} } @@ -93,9 +97,23 @@ func (m *Staker) GetWebsite() string { return "" } -func (m *Staker) GetLogo() string { +func (m *Staker) GetIdentity() string { if m != nil { - return m.Logo + return m.Identity + } + return "" +} + +func (m *Staker) GetSecurityContact() string { + if m != nil { + return m.SecurityContact + } + return "" +} + +func (m *Staker) GetDetails() string { + if m != nil { + return m.Details } return "" } @@ -409,37 +427,40 @@ func init() { } var fileDescriptor_d209d1a2a74d375d = []byte{ - // 475 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x53, 0xdd, 0x6a, 0xd4, 0x40, - 0x14, 0xde, 0x74, 0xb7, 0xdb, 0xee, 0x41, 0xbd, 0x18, 0x56, 0x0d, 0x4a, 0x53, 0x59, 0x41, 0xbc, - 0xd0, 0x84, 0xe2, 0x1b, 0xf4, 0x47, 0x2c, 0x4a, 0xd1, 0x14, 0x0a, 0x7a, 0xb3, 0xcc, 0x26, 0x87, - 0x64, 0x48, 0x32, 0x67, 0xc9, 0xcc, 0xee, 0x76, 0xc1, 0x87, 0xf0, 0xc2, 0xa7, 0xf1, 0x09, 0x7a, - 0xd9, 0x4b, 0xf1, 0xa2, 0xc8, 0xee, 0x8b, 0xc8, 0x4c, 0x92, 0x92, 0xbd, 0x10, 0xc4, 0x5e, 0x65, - 0xbe, 0xef, 0x3b, 0x99, 0xf3, 0x9d, 0x6f, 0x38, 0x30, 0xca, 0x96, 0x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x43, 0x9c, 0xf4, 0xed, 0x9e, 0xbc, 0xf9, 0x13, 0x00, - 0x00, 0xff, 0xff, 0xbc, 0x83, 0xaf, 0xf4, 0x79, 0x03, 0x00, 0x00, + // 515 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x53, 0x5d, 0x6b, 0x13, 0x41, + 0x14, 0xcd, 0x36, 0x6d, 0x3e, 0x2e, 0x7e, 0x31, 0x44, 0x5d, 0x2a, 0xdd, 0x4a, 0x04, 0x51, 0xd0, + 0x2c, 0xc5, 0x7f, 0xd0, 0xb4, 0x62, 0x51, 0x8a, 0x6e, 0xa1, 0xa0, 0x2f, 0x61, 0x32, 0x7b, 0xd9, + 0x0c, 0xd9, 0xcc, 0x0d, 0x3b, 0x93, 0xa4, 0x01, 0xdf, 0x7d, 0xf5, 0xc1, 0x5f, 0xe3, 0x2f, 0xe8, + 0x63, 0x1f, 0xc5, 0x87, 0x22, 0xc9, 0x1f, 0x91, 0x99, 0xdd, 0x0d, 0xdb, 0x07, 0x41, 0xf4, 0x69, + 0xf7, 0x9c, 0x73, 0x67, 0xce, 0xbd, 0xe7, 0x32, 0xd0, 0x1d, 0x2f, 0xe7, 0x18, 0x6a, 0xc3, 0xc7, + 0x98, 0xe9, 0x70, 0x7e, 0x30, 0x44, 0xc3, 0x0f, 0x4a, 0xdc, 0x9b, 0x66, 0x64, 0x88, 0x75, 0x6c, + 0x4d, 0xaf, 0xe4, 0x8a, 0x9a, 0xdd, 0x4e, 0x42, 0x09, 0xb9, 0x82, 0xd0, 0xfe, 0xe5, 0xb5, 0xdd, + 0x2f, 0x5b, 0xd0, 0x38, 0x73, 0x95, 0xcc, 0x87, 0x26, 0x8f, 0xe3, 0x0c, 0xb5, 0xf6, 0xbd, 0xc7, + 0xde, 0xb3, 0x76, 0x54, 0x42, 0x76, 0x0a, 0x20, 0x68, 0x32, 0x91, 0x5a, 0x4b, 0x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0x13, 0xdd, 0xef, 0x1e, 0xdc, 0xef, 0x6f, 0xa2, 0xeb, 0x8f, 0xb8, 0x4a, 0xf0, + 0x58, 0x99, 0x6c, 0xc9, 0x3a, 0xb0, 0x23, 0x55, 0x8c, 0x17, 0x45, 0x7f, 0x39, 0xf8, 0x63, 0x7b, + 0x37, 0x77, 0x58, 0xff, 0xef, 0x1d, 0x3e, 0x81, 0xdb, 0x22, 0x43, 0x6e, 0x24, 0xa9, 0x41, 0xcc, + 0x8b, 0x7d, 0xd5, 0xa3, 0x5b, 0x25, 0x79, 0xc4, 0x0d, 0x76, 0x3f, 0xc3, 0x1d, 0x3b, 0x07, 0xbe, + 0x27, 0x4a, 0xff, 0xa5, 0xe9, 0xca, 0x12, 0xea, 0x37, 0x96, 0xf0, 0x57, 0xee, 0x6f, 0x00, 0x3e, + 0xcc, 0x70, 0x86, 0x67, 0x86, 0x1b, 0x64, 0x8f, 0xa0, 0x9d, 0xd2, 0x62, 0x50, 0x75, 0x6f, 0xa5, + 0xb4, 0x38, 0x71, 0x0d, 0xec, 0x01, 0x8c, 0x64, 0x32, 0x2a, 0xd4, 0x2d, 0xa7, 0xb6, 0x2d, 0xe3, + 0xe4, 0xc3, 0xd7, 0x97, 0xab, 0xc0, 0xbb, 0x5a, 0x05, 0xde, 0xaf, 0x55, 0xe0, 0x7d, 0x5d, 0x07, + 0xb5, 0xab, 0x75, 0x50, 0xfb, 0xb1, 0x0e, 0x6a, 0x9f, 0x5e, 0x54, 0xa2, 0x7b, 0xfb, 0xf1, 0xfc, + 0xf8, 0x14, 0xcd, 0x82, 0xb2, 0x71, 0x28, 0x46, 0x5c, 0xaa, 0xf0, 0x62, 0xf3, 0x52, 0x5d, 0x88, + 0xc3, 0x86, 0x7b, 0x74, 0xaf, 0x7e, 0x07, 0x00, 0x00, 0xff, 0xff, 0xa5, 0x53, 0x59, 0x34, 0xc6, + 0x03, 0x00, 0x00, } func (m *Staker) Marshal() (dAtA []byte, err error) { @@ -462,10 +483,24 @@ func (m *Staker) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if len(m.Logo) > 0 { - i -= len(m.Logo) - copy(dAtA[i:], m.Logo) - i = encodeVarintStakers(dAtA, i, uint64(len(m.Logo))) + if len(m.Details) > 0 { + i -= len(m.Details) + copy(dAtA[i:], m.Details) + i = encodeVarintStakers(dAtA, i, uint64(len(m.Details))) + i-- + dAtA[i] = 0x3a + } + if len(m.SecurityContact) > 0 { + i -= len(m.SecurityContact) + copy(dAtA[i:], m.SecurityContact) + i = encodeVarintStakers(dAtA, i, uint64(len(m.SecurityContact))) + i-- + dAtA[i] = 0x32 + } + if len(m.Identity) > 0 { + i -= len(m.Identity) + copy(dAtA[i:], m.Identity) + i = encodeVarintStakers(dAtA, i, uint64(len(m.Identity))) i-- dAtA[i] = 0x2a } @@ -719,7 +754,15 @@ func (m *Staker) Size() (n int) { if l > 0 { n += 1 + l + sovStakers(uint64(l)) } - l = len(m.Logo) + l = len(m.Identity) + if l > 0 { + n += 1 + l + sovStakers(uint64(l)) + } + l = len(m.SecurityContact) + if l > 0 { + n += 1 + l + sovStakers(uint64(l)) + } + l = len(m.Details) if l > 0 { n += 1 + l + sovStakers(uint64(l)) } @@ -977,7 +1020,71 @@ func (m *Staker) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 5: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Logo", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Identity", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStakers + } + 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 ErrInvalidLengthStakers + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthStakers + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Identity = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SecurityContact", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStakers + } + 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 ErrInvalidLengthStakers + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthStakers + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SecurityContact = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Details", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1005,7 +1112,7 @@ func (m *Staker) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Logo = string(dAtA[iNdEx:postIndex]) + m.Details = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex diff --git a/x/stakers/types/tx.pb.go b/x/stakers/types/tx.pb.go index 114d99e5..4a5d5aaa 100644 --- a/x/stakers/types/tx.pb.go +++ b/x/stakers/types/tx.pb.go @@ -133,8 +133,12 @@ type MsgUpdateMetadata struct { Moniker string `protobuf:"bytes,2,opt,name=moniker,proto3" json:"moniker,omitempty"` // website ... Website string `protobuf:"bytes,3,opt,name=website,proto3" json:"website,omitempty"` - // logo - Logo string `protobuf:"bytes,4,opt,name=logo,proto3" json:"logo,omitempty"` + // identity from keybase.io + Identity string `protobuf:"bytes,4,opt,name=identity,proto3" json:"identity,omitempty"` + // security_contact ... + SecurityContact string `protobuf:"bytes,5,opt,name=security_contact,json=securityContact,proto3" json:"security_contact,omitempty"` + // details ... + Details string `protobuf:"bytes,6,opt,name=details,proto3" json:"details,omitempty"` } func (m *MsgUpdateMetadata) Reset() { *m = MsgUpdateMetadata{} } @@ -191,9 +195,23 @@ func (m *MsgUpdateMetadata) GetWebsite() string { return "" } -func (m *MsgUpdateMetadata) GetLogo() string { +func (m *MsgUpdateMetadata) GetIdentity() string { if m != nil { - return m.Logo + return m.Identity + } + return "" +} + +func (m *MsgUpdateMetadata) GetSecurityContact() string { + if m != nil { + return m.SecurityContact + } + return "" +} + +func (m *MsgUpdateMetadata) GetDetails() string { + if m != nil { + return m.Details } return "" } @@ -632,46 +650,49 @@ func init() { func init() { proto.RegisterFile("kyve/stakers/v1beta1/tx.proto", fileDescriptor_f52b730e69b9fb06) } var fileDescriptor_f52b730e69b9fb06 = []byte{ - // 623 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x55, 0xcb, 0x6e, 0xd3, 0x40, - 0x14, 0x8d, 0xdb, 0xa8, 0x25, 0x97, 0x8a, 0x87, 0x09, 0xad, 0xeb, 0xaa, 0x6e, 0xb1, 0x54, 0x68, - 0x11, 0xb5, 0x15, 0x90, 0xd8, 0x37, 0x05, 0x24, 0x1e, 0xae, 0x2a, 0x57, 0x20, 0x1e, 0x8b, 0x6a, - 0x62, 0x8f, 0x1c, 0x93, 0xd8, 0x63, 0x79, 0x26, 0x69, 0xb2, 0xe2, 0x17, 0x90, 0xf8, 0x15, 0x3e, - 0xa2, 0xcb, 0x8a, 0x15, 0x62, 0x51, 0xa1, 0x44, 0xe2, 0x3b, 0x90, 0x5f, 0x13, 0x27, 0xcd, 0x4b, - 0xb0, 0xb2, 0xef, 0xdc, 0x33, 0xe7, 0x9e, 0xb9, 0x3e, 0xd7, 0x03, 0x9b, 0x8d, 0x6e, 0x1b, 0xeb, - 0x94, 0xa1, 0x06, 0x0e, 0xa9, 0xde, 0xae, 0xd4, 0x30, 0x43, 0x15, 0x9d, 0x75, 0xb4, 0x20, 0x24, - 0x8c, 0x88, 0xe5, 0x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0x19, 0x85, 0x07, 0x13, 0x09, 0x86, 0x81, 0xb2, 0x3e, 0x27, 0x90, 0xd7, 0x0a, 0xe0, - 0xd6, 0x15, 0x8b, 0xef, 0xcd, 0x20, 0x19, 0x40, 0xe5, 0xca, 0xdc, 0x50, 0x5e, 0xf1, 0x3d, 0x5c, - 0xe3, 0xa6, 0xbd, 0x37, 0x71, 0x7b, 0x06, 0x91, 0xf7, 0x66, 0x42, 0x38, 0xf3, 0x27, 0x28, 0x0d, - 0xdc, 0xa7, 0x4e, 0xdc, 0xc7, 0x31, 0xf2, 0xc3, 0xd9, 0x18, 0x4e, 0x6e, 0xc3, 0xca, 0x90, 0xff, - 0x76, 0x66, 0x9c, 0x3c, 0x81, 0x4d, 0xf9, 0xf4, 0xe3, 0x8c, 0x56, 0x7d, 0x71, 0xde, 0x53, 0x84, - 0x8b, 0x9e, 0x22, 0xfc, 0xee, 0x29, 0xc2, 0xd7, 0xbe, 0x52, 0xb8, 0xe8, 0x2b, 0x85, 0x9f, 0x7d, - 0xa5, 0xf0, 0xf1, 0x51, 0xee, 0x0f, 0xf2, 0xfa, 0xc3, 0xbb, 0xe7, 0x47, 0x98, 0x9d, 0x91, 0xb0, - 0xa1, 0x5b, 0x75, 0xe4, 0xfa, 0x7a, 0x87, 0xdf, 0x29, 0xf1, 0xbf, 0xa4, 0xb6, 0x14, 0x5f, 0x04, - 0x4f, 0xfe, 0x06, 0x00, 0x00, 0xff, 0xff, 0x4a, 0xb9, 0x9d, 0xe9, 0x70, 0x06, 0x00, 0x00, + // 665 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x55, 0x5d, 0x4f, 0xd4, 0x4c, + 0x14, 0xde, 0xc2, 0xbe, 0xc0, 0x9e, 0x97, 0x08, 0xd6, 0x15, 0x4a, 0x09, 0x05, 0x9b, 0xa0, 0x60, + 0xa4, 0x0d, 0x9a, 0x78, 0x0f, 0x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 0x82, 0xf2, 0x9f, 0x35, + 0x8e, 0x9b, 0xb6, 0xe8, 0x46, 0x84, 0x5b, 0x4f, 0x88, 0xe7, 0x96, 0x32, 0x98, 0x73, 0x30, 0x7b, + 0x41, 0x94, 0x4b, 0x78, 0xc4, 0x42, 0x4e, 0xcc, 0x6f, 0x0a, 0xdc, 0x74, 0xb8, 0xff, 0x3a, 0xc2, + 0x48, 0x10, 0x87, 0x08, 0x84, 0x91, 0x40, 0x7d, 0x24, 0x6b, 0x30, 0x1e, 0xb0, 0x90, 0x36, 0x49, + 0x9c, 0x6a, 0xae, 0xb9, 0x05, 0x4c, 0x22, 0x07, 0xa4, 0xc1, 0xa9, 0x20, 0x99, 0x62, 0xb7, 0x80, + 0xaa, 0x0e, 0x13, 0x14, 0x93, 0x50, 0x50, 0xd1, 0xd5, 0xaa, 0x69, 0x48, 0x62, 0x75, 0x15, 0xa6, + 0x39, 0xf1, 0xda, 0x31, 0x15, 0xdd, 0x3d, 0x8f, 0x85, 0x02, 0x79, 0x42, 0xfb, 0x2f, 0xe5, 0x4c, + 0x15, 0xe7, 0x5b, 0xd9, 0x71, 0x52, 0x00, 0x13, 0x81, 0x68, 0x8b, 0x6b, 0x63, 0x59, 0x81, 0x1c, + 0x9a, 0xf3, 0x30, 0x77, 0xa9, 0x07, 0xd9, 0xe1, 0x27, 0xb8, 0x25, 0x83, 0x5b, 0x72, 0x26, 0x7d, + 0x5a, 0xec, 0x9d, 0xfe, 0xc8, 0x3f, 0x4f, 0x7f, 0x01, 0xe6, 0xaf, 0x10, 0x20, 0xf5, 0x1d, 0xc2, + 0xff, 0x0e, 0xf7, 0x5f, 0x30, 0x1a, 0xee, 0x30, 0xd6, 0xea, 0xa3, 0x6b, 0x16, 0xc6, 0x23, 0xc6, + 0x5a, 0x7b, 0x14, 0x17, 0x76, 0x49, 0xe0, 0x73, 0xac, 0x1a, 0x00, 0x1d, 0xd4, 0x42, 0x18, 0xc7, + 0x84, 0xf3, 0x7c, 0xf8, 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x0f, 0xe8, 0x3c, 0xa3, 0xf5, 0x79, + 0xf4, 0x57, 0x19, 0x6d, 0xf3, 0xd9, 0xd1, 0xa9, 0xa1, 0x1c, 0x9f, 0x1a, 0xca, 0xaf, 0x53, 0x43, + 0xf9, 0x7c, 0x66, 0x54, 0x8e, 0xcf, 0x8c, 0xca, 0x8f, 0x33, 0xa3, 0xf2, 0xfe, 0x41, 0xe9, 0x0d, + 0xf2, 0xf2, 0xdd, 0x9b, 0xa7, 0xdb, 0x44, 0x1c, 0xb0, 0xb8, 0x69, 0x7b, 0xfb, 0x88, 0x86, 0xf6, + 0xa1, 0xfc, 0x42, 0xa5, 0xef, 0x92, 0xc6, 0x58, 0xfa, 0x59, 0x79, 0xf4, 0x27, 0x00, 0x00, 0xff, + 0xff, 0xe2, 0xf4, 0xaa, 0xce, 0xbe, 0x06, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1036,10 +1057,24 @@ func (m *MsgUpdateMetadata) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if len(m.Logo) > 0 { - i -= len(m.Logo) - copy(dAtA[i:], m.Logo) - i = encodeVarintTx(dAtA, i, uint64(len(m.Logo))) + if len(m.Details) > 0 { + i -= len(m.Details) + copy(dAtA[i:], m.Details) + i = encodeVarintTx(dAtA, i, uint64(len(m.Details))) + i-- + dAtA[i] = 0x32 + } + if len(m.SecurityContact) > 0 { + i -= len(m.SecurityContact) + copy(dAtA[i:], m.SecurityContact) + i = encodeVarintTx(dAtA, i, uint64(len(m.SecurityContact))) + i-- + dAtA[i] = 0x2a + } + if len(m.Identity) > 0 { + i -= len(m.Identity) + copy(dAtA[i:], m.Identity) + i = encodeVarintTx(dAtA, i, uint64(len(m.Identity))) i-- dAtA[i] = 0x22 } @@ -1397,7 +1432,15 @@ func (m *MsgUpdateMetadata) Size() (n int) { if l > 0 { n += 1 + l + sovTx(uint64(l)) } - l = len(m.Logo) + l = len(m.Identity) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.SecurityContact) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Details) if l > 0 { n += 1 + l + sovTx(uint64(l)) } @@ -1838,7 +1881,71 @@ func (m *MsgUpdateMetadata) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Logo", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Identity", 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.Identity = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SecurityContact", 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.SecurityContact = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Details", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1866,7 +1973,7 @@ func (m *MsgUpdateMetadata) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Logo = string(dAtA[iNdEx:postIndex]) + m.Details = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex