From 88ecb481e19acd61ba25616ab7d07206df08fe54 Mon Sep 17 00:00:00 2001 From: Amaury M <1293565+amaurym@users.noreply.github.com> Date: Thu, 17 Jun 2021 16:36:09 +0200 Subject: [PATCH 01/17] Put back old fields --- docs/core/proto-docs.md | 3 + proto/cosmos/gov/v1beta1/gov.proto | 9 +- proto/cosmos/upgrade/v1beta1/upgrade.proto | 13 +- x/gov/types/gov.pb.go | 212 ++++++++++++--------- x/upgrade/types/upgrade.pb.go | 173 ++++++++++++++--- 5 files changed, 276 insertions(+), 134 deletions(-) diff --git a/docs/core/proto-docs.md b/docs/core/proto-docs.md index fe31a7f910c0..8b8d540e7893 100644 --- a/docs/core/proto-docs.md +++ b/docs/core/proto-docs.md @@ -4986,6 +4986,7 @@ A Vote consists of a proposal ID, the voter, and the vote option. | ----- | ---- | ----- | ----------- | | `proposal_id` | [uint64](#uint64) | | | | `voter` | [string](#string) | | | +| `option` | [VoteOption](#cosmos.gov.v1beta1.VoteOption) | | | | `options` | [WeightedVoteOption](#cosmos.gov.v1beta1.WeightedVoteOption) | repeated | | @@ -7872,8 +7873,10 @@ Plan specifies information about a planned upgrade and when it should occur. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | `name` | [string](#string) | | Sets the name for the upgrade. This name will be used by the upgraded version of the software to apply any special "on-upgrade" commands during the first BeginBlock method after the upgrade is applied. It is also used to detect whether a software version can handle a given upgrade. If no upgrade handler with this name has been set in the software, it will be assumed that the software is out-of-date when the upgrade Time or Height is reached and the software will exit. | +| `time` | [google.protobuf.Timestamp](#google.protobuf.Timestamp) | | Deprecated: Time based upgrades have been deprecated. Time based upgrade logic has been removed from the SDK. | | `height` | [int64](#int64) | | The height at which the upgrade must be performed. Only used if Time is not set. | | `info` | [string](#string) | | Any application specific upgrade info to be included on-chain such as a git commit that validators could automatically upgrade to | +| `upgraded_client_state` | [google.protobuf.Any](#google.protobuf.Any) | | Deprecated: UpgradedClientState field has been deprecated. IBC upgrade logic has been moved to the IBC module in the sub module 02-client. | diff --git a/proto/cosmos/gov/v1beta1/gov.proto b/proto/cosmos/gov/v1beta1/gov.proto index 392534c535a1..fe013381b59a 100644 --- a/proto/cosmos/gov/v1beta1/gov.proto +++ b/proto/cosmos/gov/v1beta1/gov.proto @@ -129,11 +129,10 @@ message Vote { option (gogoproto.goproto_stringer) = false; option (gogoproto.equal) = false; - uint64 proposal_id = 1 [(gogoproto.moretags) = "yaml:\"proposal_id\""]; - string voter = 2; - reserved 3; - reserved "option"; - repeated WeightedVoteOption options = 4 [(gogoproto.nullable) = false]; + uint64 proposal_id = 1 [(gogoproto.moretags) = "yaml:\"proposal_id\""]; + string voter = 2; + VoteOption option = 3; + repeated WeightedVoteOption options = 4 [(gogoproto.nullable) = false]; } // DepositParams defines the params for deposits on governance proposals. diff --git a/proto/cosmos/upgrade/v1beta1/upgrade.proto b/proto/cosmos/upgrade/v1beta1/upgrade.proto index ad3d34ca10df..0215274b772d 100644 --- a/proto/cosmos/upgrade/v1beta1/upgrade.proto +++ b/proto/cosmos/upgrade/v1beta1/upgrade.proto @@ -22,10 +22,9 @@ message Plan { // reached and the software will exit. string name = 1; - // Time based upgrades have been deprecated. Time based upgrade logic + // Deprecated: Time based upgrades have been deprecated. Time based upgrade logic // has been removed from the SDK. - reserved 2; - reserved "time"; + google.protobuf.Timestamp time = 2 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; // The height at which the upgrade must be performed. // Only used if Time is not set. @@ -35,17 +34,15 @@ message Plan { // such as a git commit that validators could automatically upgrade to string info = 4; - // UpgradedClientState field has been deprecated. IBC upgrade logic has been + // Deprecated: UpgradedClientState field has been deprecated. IBC upgrade logic has been // moved to the IBC module in the sub module 02-client. - reserved 5; - reserved "option"; + google.protobuf.Any upgraded_client_state = 5 [(gogoproto.moretags) = "yaml:\"upgraded_client_state\""]; } // SoftwareUpgradeProposal is a gov Content type for initiating a software // upgrade. message SoftwareUpgradeProposal { - option (gogoproto.equal) = true; - option (gogoproto.goproto_stringer) = false; + option (gogoproto.equal) = true; string title = 1; string description = 2; diff --git a/x/gov/types/gov.pb.go b/x/gov/types/gov.pb.go index 5f49a4ae4100..4ad5218245fc 100644 --- a/x/gov/types/gov.pb.go +++ b/x/gov/types/gov.pb.go @@ -328,6 +328,7 @@ var xxx_messageInfo_TallyResult proto.InternalMessageInfo type Vote struct { ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty" yaml:"proposal_id"` Voter string `protobuf:"bytes,2,opt,name=voter,proto3" json:"voter,omitempty"` + Option VoteOption `protobuf:"varint,3,opt,name=option,proto3,enum=cosmos.gov.v1beta1.VoteOption" json:"option,omitempty"` Options []WeightedVoteOption `protobuf:"bytes,4,rep,name=options,proto3" json:"options"` } @@ -503,98 +504,98 @@ func init() { func init() { proto.RegisterFile("cosmos/gov/v1beta1/gov.proto", fileDescriptor_6e82113c1a9a4b7c) } var fileDescriptor_6e82113c1a9a4b7c = []byte{ - // 1450 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x57, 0x51, 0x68, 0xdb, 0x56, - 0x17, 0xb6, 0x6c, 0xc7, 0x89, 0xaf, 0x9d, 0x44, 0xbd, 0x49, 0x13, 0xc7, 0x7f, 0x7f, 0xc9, 0xbf, - 0xfe, 0x51, 0x42, 0x69, 0x9d, 0x36, 0x1b, 0x1b, 0x4b, 0x61, 0x9b, 0x15, 0x2b, 0xab, 0x4b, 0xb1, - 0x8d, 0xac, 0x3a, 0xb4, 0x7b, 0x10, 0x8a, 0x7d, 0xeb, 0x68, 0xb3, 0x74, 0x3d, 0xeb, 0x3a, 0x4d, - 0xd8, 0xcb, 0x1e, 0x8b, 0x07, 0xa3, 0x8f, 0x85, 0x61, 0x28, 0x8c, 0xbd, 0xec, 0x79, 0x7b, 0xdd, - 0x73, 0x18, 0x83, 0x95, 0x3d, 0x95, 0x0d, 0xdc, 0x35, 0x85,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x8a, 0x3e, 0x46, 0x35, 0x82, 0xce, 0xe4, 0xdf, 0xca, 0x15, 0xee, 0x28, 0x79, 0x7e, 0x2a, - 0xc8, 0xbf, 0x65, 0x98, 0x4d, 0x54, 0xa7, 0xe5, 0x94, 0x8b, 0x87, 0x2f, 0x85, 0xd0, 0xf3, 0x97, - 0x42, 0xe8, 0xf3, 0x23, 0x21, 0x74, 0x78, 0x24, 0x70, 0xcf, 0x8e, 0x04, 0xee, 0xf7, 0x23, 0x81, - 0x7b, 0xfc, 0x4a, 0x08, 0x3d, 0x7b, 0x25, 0x84, 0x9e, 0xbf, 0x12, 0x42, 0xf7, 0xff, 0x7e, 0x21, - 0xee, 0x7b, 0xff, 0xd0, 0x79, 0xfd, 0xbc, 0x13, 0xf3, 0x76, 0xc8, 0x9b, 0x7f, 0x05, 0x00, 0x00, - 0xff, 0xff, 0x51, 0x93, 0x54, 0x90, 0xeb, 0x0d, 0x00, 0x00, + // 1443 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x57, 0x41, 0x6c, 0xdb, 0x54, + 0x18, 0x8e, 0x93, 0x34, 0x6d, 0x5e, 0xd2, 0xd6, 0x7b, 0xed, 0xda, 0x34, 0x0c, 0x3b, 0x18, 0x34, + 0x55, 0xd3, 0x96, 0x6e, 0x05, 0x81, 0xe8, 0x24, 0x20, 0x6e, 0x5c, 0x16, 0x34, 0x25, 0x91, 0xe3, + 0xa5, 0xda, 0x38, 0x58, 0x6e, 0xf2, 0x96, 0x1a, 0x62, 0xbf, 0x10, 0xbf, 0x74, 0xad, 0xb8, 0x70, + 0x9c, 0x82, 0x84, 0x76, 0x9c, 0x84, 0x22, 0x4d, 0x42, 0x5c, 0x38, 0x73, 0xe6, 0x5c, 0x21, 0x24, + 0x26, 0x4e, 0x13, 0x48, 0x19, 0xeb, 0x24, 0x34, 0xf5, 0xd8, 0x03, 0x67, 0x64, 0xbf,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, 0x3f, 0x15, 0xe4, 0xdf, 0x32, 0xcc, 0x26, 0xaa, 0x53, + 0x39, 0xe5, 0xe2, 0xe1, 0x0b, 0x21, 0xf4, 0xec, 0x85, 0x10, 0xfa, 0xea, 0x48, 0x08, 0x1d, 0x1e, + 0x09, 0xdc, 0xd3, 0x23, 0x81, 0xfb, 0xf3, 0x48, 0xe0, 0x1e, 0xbd, 0x14, 0x42, 0x4f, 0x5f, 0x0a, + 0xa1, 0x67, 0x2f, 0x85, 0xd0, 0xbd, 0x7f, 0x5f, 0x88, 0xfb, 0xde, 0xbf, 0x7e, 0x5e, 0x3f, 0xef, + 0xc4, 0xbc, 0x1d, 0xf2, 0xf6, 0x3f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x8c, 0x96, 0x4a, 0x1c, 0x15, + 0x0e, 0x00, 0x00, } func (this *TextProposal) Equal(that interface{}) bool { @@ -1032,6 +1033,11 @@ func (m *Vote) MarshalToSizedBuffer(dAtA []byte) (int, error) { dAtA[i] = 0x22 } } + if m.Option != 0 { + i = encodeVarintGov(dAtA, i, uint64(m.Option)) + i-- + dAtA[i] = 0x18 + } if len(m.Voter) > 0 { i -= len(m.Voter) copy(dAtA[i:], m.Voter) @@ -1305,6 +1311,9 @@ func (m *Vote) Size() (n int) { if l > 0 { n += 1 + l + sovGov(uint64(l)) } + if m.Option != 0 { + n += 1 + sovGov(uint64(m.Option)) + } if len(m.Options) > 0 { for _, e := range m.Options { l = e.Size() @@ -2304,6 +2313,25 @@ func (m *Vote) Unmarshal(dAtA []byte) error { } m.Voter = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Option", wireType) + } + m.Option = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Option |= VoteOption(b&0x7F) << shift + if b < 0x80 { + break + } + } case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Options", wireType) diff --git a/x/upgrade/types/upgrade.pb.go b/x/upgrade/types/upgrade.pb.go index 50a2cad90647..3eddd44b5ec0 100644 --- a/x/upgrade/types/upgrade.pb.go +++ b/x/upgrade/types/upgrade.pb.go @@ -5,19 +5,22 @@ package types import ( fmt "fmt" - _ "github.com/cosmos/cosmos-sdk/codec/types" + types "github.com/cosmos/cosmos-sdk/codec/types" _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" + github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" _ "google.golang.org/protobuf/types/known/timestamppb" io "io" math "math" math_bits "math/bits" + time "time" ) // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal var _ = fmt.Errorf var _ = math.Inf +var _ = time.Kitchen // This is a compile-time assertion to ensure that this generated file // is compatible with the proto package it is being compiled against. @@ -35,12 +38,18 @@ type Plan struct { // assumed that the software is out-of-date when the upgrade Time or Height is // reached and the software will exit. Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + // Deprecated: Time based upgrades have been deprecated. Time based upgrade logic + // has been removed from the SDK. + Time time.Time `protobuf:"bytes,2,opt,name=time,proto3,stdtime" json:"time"` // The height at which the upgrade must be performed. // Only used if Time is not set. Height int64 `protobuf:"varint,3,opt,name=height,proto3" json:"height,omitempty"` // Any application specific upgrade info to be included on-chain // such as a git commit that validators could automatically upgrade to Info string `protobuf:"bytes,4,opt,name=info,proto3" json:"info,omitempty"` + // Deprecated: UpgradedClientState field has been deprecated. IBC upgrade logic has been + // moved to the IBC module in the sub module 02-client. + UpgradedClientState *types.Any `protobuf:"bytes,5,opt,name=upgraded_client_state,json=upgradedClientState,proto3" json:"upgraded_client_state,omitempty" yaml:"upgraded_client_state"` } func (m *Plan) Reset() { *m = Plan{} } @@ -83,8 +92,9 @@ type SoftwareUpgradeProposal struct { Plan Plan `protobuf:"bytes,3,opt,name=plan,proto3" json:"plan"` } -func (m *SoftwareUpgradeProposal) Reset() { *m = SoftwareUpgradeProposal{} } -func (*SoftwareUpgradeProposal) ProtoMessage() {} +func (m *SoftwareUpgradeProposal) Reset() { *m = SoftwareUpgradeProposal{} } +func (m *SoftwareUpgradeProposal) String() string { return proto.CompactTextString(m) } +func (*SoftwareUpgradeProposal) ProtoMessage() {} func (*SoftwareUpgradeProposal) Descriptor() ([]byte, []int) { return fileDescriptor_ccf2a7d4d7b48dca, []int{1} } @@ -207,32 +217,36 @@ func init() { } var fileDescriptor_ccf2a7d4d7b48dca = []byte{ - // 398 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x52, 0xc1, 0xaa, 0xd3, 0x40, - 0x14, 0xcd, 0xb4, 0xd3, 0x58, 0xa7, 0x08, 0x25, 0x94, 0x1a, 0x8b, 0x26, 0xa5, 0xb8, 0xe8, 0x42, - 0x13, 0xaa, 0xe0, 0xc2, 0x65, 0x5d, 0x08, 0x05, 0xa1, 0x44, 0x74, 0xe1, 0x6e, 0x92, 0x4c, 0xd3, - 0x68, 0x92, 0x1b, 0x32, 0x93, 0x6a, 0xff, 0x42, 0x70, 0xe3, 0xb2, 0x9f, 0xd3, 0x65, 0x97, 0xae, - 0x44, 0xdb, 0xcd, 0xfb, 0x8c, 0x47, 0x66, 0x92, 0xf7, 0xca, 0xa3, 0xcb, 0xb7, 0x9a, 0x73, 0xee, - 0x9c, 0x39, 0x73, 0xee, 0xe5, 0x92, 0xe7, 0x01, 0xf0, 0x14, 0xb8, 0x5b, 0xe6, 0x51, 0x41, 0x43, - 0xe6, 0x6e, 0x66, 0x3e, 0x13, 0x74, 0xd6, 0x70, 0x27, 0x2f, 0x40, 0x80, 0x31, 0x54, 0x2a, 0xa7, - 0xa9, 0xd6, 0xaa, 0xd1, 0x93, 0x08, 0x20, 0x4a, 0x98, 0x2b, 0x55, 0x7e, 0xb9, 0x72, 0x69, 0xb6, - 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 0x2a, 0xf5, 0xa5, 0x69, 0x9b, 0xe4, 0xc1, 0x46, 0x5d, - 0x4b, 0x33, 0xec, 0x35, 0x54, 0x1a, 0xa1, 0xca, 0x68, 0xbe, 0xd8, 0xff, 0xb7, 0xb4, 0xfd, 0xd1, - 0x42, 0x87, 0xa3, 0x85, 0xfe, 0x1d, 0x2d, 0xf4, 0xf3, 0x64, 0x69, 0x87, 0x93, 0xa5, 0xfd, 0x39, - 0x59, 0xda, 0x97, 0x17, 0x51, 0x2c, 0xd6, 0xa5, 0xef, 0x04, 0x90, 0xba, 0xf5, 0x9a, 0xa9, 0xe3, - 0x25, 0x0f, 0xbf, 0xb9, 0x3f, 0x6e, 0x76, 0x4e, 0x6c, 0x73, 0xc6, 0x7d, 0x5d, 0x2e, 0xc0, 0xeb, - 0xeb, 0x00, 0x00, 0x00, 0xff, 0xff, 0xdd, 0xcd, 0xee, 0x69, 0x92, 0x02, 0x00, 0x00, + // 461 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x52, 0x31, 0x6f, 0xd3, 0x40, + 0x14, 0xf6, 0x51, 0xb7, 0xb4, 0x17, 0xb1, 0x1c, 0xa1, 0x98, 0xa8, 0xd8, 0x56, 0xc4, 0x90, 0x01, + 0xce, 0x6a, 0x91, 0x10, 0xca, 0x46, 0x3a, 0x20, 0x21, 0x21, 0x55, 0x2e, 0x30, 0xb0, 0x54, 0x17, + 0xfb, 0xe2, 0x1c, 0x9c, 0xef, 0x2c, 0xdf, 0xa5, 0x90, 0x5f, 0x41, 0x47, 0xc6, 0xfe, 0x9c, 0x8c, + 0x1d, 0x99, 0x0a, 0x24, 0x0b, 0x33, 0x03, 0x33, 0xba, 0x3b, 0x1b, 0x45, 0x90, 0x91, 0xc9, 0xef, + 0x7d, 0xfe, 0xde, 0xf7, 0xde, 0xfb, 0xde, 0xc1, 0x07, 0x99, 0x54, 0xa5, 0x54, 0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, 0x00, 0x00, } func (this *Plan) Equal(that interface{}) bool { @@ -257,12 +271,18 @@ func (this *Plan) Equal(that interface{}) bool { if this.Name != that1.Name { return false } + if !this.Time.Equal(that1.Time) { + return false + } if this.Height != that1.Height { return false } if this.Info != that1.Info { return false } + if !this.UpgradedClientState.Equal(that1.UpgradedClientState) { + return false + } return true } func (this *SoftwareUpgradeProposal) Equal(that interface{}) bool { @@ -369,6 +389,18 @@ func (m *Plan) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.UpgradedClientState != nil { + { + size, err := m.UpgradedClientState.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintUpgrade(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } if len(m.Info) > 0 { i -= len(m.Info) copy(dAtA[i:], m.Info) @@ -381,6 +413,14 @@ func (m *Plan) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x18 } + n2, err2 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.Time, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.Time):]) + if err2 != nil { + return 0, err2 + } + i -= n2 + i = encodeVarintUpgrade(dAtA, i, uint64(n2)) + i-- + dAtA[i] = 0x12 if len(m.Name) > 0 { i -= len(m.Name) copy(dAtA[i:], m.Name) @@ -531,6 +571,8 @@ func (m *Plan) Size() (n int) { if l > 0 { n += 1 + l + sovUpgrade(uint64(l)) } + l = github_com_gogo_protobuf_types.SizeOfStdTime(m.Time) + n += 1 + l + sovUpgrade(uint64(l)) if m.Height != 0 { n += 1 + sovUpgrade(uint64(m.Height)) } @@ -538,6 +580,10 @@ func (m *Plan) Size() (n int) { if l > 0 { n += 1 + l + sovUpgrade(uint64(l)) } + if m.UpgradedClientState != nil { + l = m.UpgradedClientState.Size() + n += 1 + l + sovUpgrade(uint64(l)) + } return n } @@ -660,6 +706,39 @@ func (m *Plan) Unmarshal(dAtA []byte) error { } m.Name = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Time", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUpgrade + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthUpgrade + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthUpgrade + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.Time, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex case 3: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Height", wireType) @@ -711,6 +790,42 @@ func (m *Plan) Unmarshal(dAtA []byte) error { } m.Info = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field UpgradedClientState", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUpgrade + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthUpgrade + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthUpgrade + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.UpgradedClientState == nil { + m.UpgradedClientState = &types.Any{} + } + if err := m.UpgradedClientState.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipUpgrade(dAtA[iNdEx:]) From dc13f9de93e24456872ce94540da16349ed6fc15 Mon Sep 17 00:00:00 2001 From: Amaury M <1293565+amaurym@users.noreply.github.com> Date: Thu, 17 Jun 2021 16:51:42 +0200 Subject: [PATCH 02/17] Error with time-based upgrades --- proto/cosmos/upgrade/v1beta1/upgrade.proto | 1 + x/gov/types/vote.go | 2 +- x/upgrade/types/plan.go | 6 +++ x/upgrade/types/plan_test.go | 15 +++++- x/upgrade/types/upgrade.pb.go | 61 +++++++++++----------- 5 files changed, 51 insertions(+), 34 deletions(-) diff --git a/proto/cosmos/upgrade/v1beta1/upgrade.proto b/proto/cosmos/upgrade/v1beta1/upgrade.proto index 0215274b772d..65fbb92c71ed 100644 --- a/proto/cosmos/upgrade/v1beta1/upgrade.proto +++ b/proto/cosmos/upgrade/v1beta1/upgrade.proto @@ -43,6 +43,7 @@ message Plan { // upgrade. message SoftwareUpgradeProposal { option (gogoproto.equal) = true; + option (gogoproto.goproto_stringer) = false; string title = 1; string description = 2; diff --git a/x/gov/types/vote.go b/x/gov/types/vote.go index 97174fa660ac..03d1e5a44f42 100644 --- a/x/gov/types/vote.go +++ b/x/gov/types/vote.go @@ -13,7 +13,7 @@ import ( // NewVote creates a new Vote instance //nolint:interfacer func NewVote(proposalID uint64, voter sdk.AccAddress, options WeightedVoteOptions) Vote { - return Vote{proposalID, voter.String(), options} + return Vote{ProposalId: proposalID, Voter: voter.String(), Options: options} } func (v Vote) String() string { diff --git a/x/upgrade/types/plan.go b/x/upgrade/types/plan.go index cdafbed8895a..9e4bc85ab8fe 100644 --- a/x/upgrade/types/plan.go +++ b/x/upgrade/types/plan.go @@ -17,6 +17,12 @@ func (p Plan) String() string { // ValidateBasic does basic validation of a Plan func (p Plan) ValidateBasic() error { + if !p.Time.IsZero() { + return sdkerrors.ErrInvalidRequest.Wrap("time-based upgrades have been deprecated in the SDK") + } + if p.UpgradedClientState != nil { + return sdkerrors.ErrInvalidRequest.Wrap("upgrade logic for IBC has been moved to the IBC module") + } if len(p.Name) == 0 { return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "name cannot be empty") } diff --git a/x/upgrade/types/plan_test.go b/x/upgrade/types/plan_test.go index 338b7378755d..bbd969eae0b3 100644 --- a/x/upgrade/types/plan_test.go +++ b/x/upgrade/types/plan_test.go @@ -9,9 +9,9 @@ import ( "github.com/tendermint/tendermint/libs/log" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - "github.com/cosmos/cosmos-sdk/x/upgrade/types" - + codectypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/x/upgrade/types" ) func mustParseTime(s string) time.Time { @@ -69,6 +69,17 @@ func TestPlanValid(t *testing.T) { Height: 123450000, }, }, + "time-base upgrade": { + p: types.Plan{ + Time: time.Now(), + }, + }, + "IBC upgrade": { + p: types.Plan{ + Height: 123450000, + UpgradedClientState: &codectypes.Any{}, + }, + }, "no due at": { p: types.Plan{ Name: "missing", diff --git a/x/upgrade/types/upgrade.pb.go b/x/upgrade/types/upgrade.pb.go index 3eddd44b5ec0..6507dd82c74c 100644 --- a/x/upgrade/types/upgrade.pb.go +++ b/x/upgrade/types/upgrade.pb.go @@ -92,9 +92,8 @@ type SoftwareUpgradeProposal struct { Plan Plan `protobuf:"bytes,3,opt,name=plan,proto3" json:"plan"` } -func (m *SoftwareUpgradeProposal) Reset() { *m = SoftwareUpgradeProposal{} } -func (m *SoftwareUpgradeProposal) String() string { return proto.CompactTextString(m) } -func (*SoftwareUpgradeProposal) ProtoMessage() {} +func (m *SoftwareUpgradeProposal) Reset() { *m = SoftwareUpgradeProposal{} } +func (*SoftwareUpgradeProposal) ProtoMessage() {} func (*SoftwareUpgradeProposal) Descriptor() ([]byte, []int) { return fileDescriptor_ccf2a7d4d7b48dca, []int{1} } @@ -218,35 +217,35 @@ func init() { var fileDescriptor_ccf2a7d4d7b48dca = []byte{ // 461 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x52, 0x31, 0x6f, 0xd3, 0x40, + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x53, 0xbf, 0x6f, 0xd3, 0x40, 0x14, 0xf6, 0x51, 0xb7, 0xb4, 0x17, 0xb1, 0x1c, 0xa1, 0x98, 0xa8, 0xd8, 0x56, 0xc4, 0x90, 0x01, - 0xce, 0x6a, 0x91, 0x10, 0xca, 0x46, 0x3a, 0x20, 0x21, 0x21, 0x55, 0x2e, 0x30, 0xb0, 0x54, 0x17, - 0xfb, 0xe2, 0x1c, 0x9c, 0xef, 0x2c, 0xdf, 0xa5, 0x90, 0x5f, 0x41, 0x47, 0xc6, 0xfe, 0x9c, 0x8c, - 0x1d, 0x99, 0x0a, 0x24, 0x0b, 0x33, 0x03, 0x33, 0xba, 0x3b, 0x1b, 0x45, 0x90, 0x91, 0xc9, 0xef, - 0x7d, 0xfe, 0xde, 0xf7, 0xde, 0xfb, 0xde, 0xc1, 0x07, 0x99, 0x54, 0xa5, 0x54, 0xc9, 0xac, 0x2a, - 0x6a, 0x92, 0xd3, 0xe4, 0xfc, 0x70, 0x4c, 0x35, 0x39, 0x6c, 0x73, 0x5c, 0xd5, 0x52, 0x4b, 0xb4, - 0xef, 0x58, 0xb8, 0x45, 0x1b, 0x56, 0xef, 0x5e, 0x21, 0x65, 0xc1, 0x69, 0x62, 0x59, 0xe3, 0xd9, - 0x24, 0x21, 0x62, 0xee, 0x4a, 0x7a, 0xdd, 0x42, 0x16, 0xd2, 0x86, 0x89, 0x89, 0x1a, 0x34, 0xfa, - 0xbb, 0x40, 0xb3, 0x92, 0x2a, 0x4d, 0xca, 0xca, 0x11, 0xfa, 0xbf, 0x00, 0xf4, 0x4f, 0x38, 0x11, - 0x08, 0x41, 0x5f, 0x90, 0x92, 0x06, 0x20, 0x06, 0x83, 0xbd, 0xd4, 0xc6, 0xe8, 0x29, 0xf4, 0x0d, - 0x3f, 0xb8, 0x11, 0x83, 0x41, 0xe7, 0xa8, 0x87, 0x9d, 0x18, 0x6e, 0xc5, 0xf0,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 0x5a, 0x2b, 0x33, 0xf1, 0xa6, 0xab, 0x07, 0xf0, 0xe6, 0xb9, 0xfb, 0x6d, 0xc5, - 0xfc, 0xb4, 0x4d, 0xad, 0x10, 0x30, 0x42, 0xa3, 0x17, 0x8b, 0xef, 0xa1, 0xb7, 0x58, 0x86, 0xe0, - 0x6a, 0x19, 0x82, 0x6f, 0xcb, 0x10, 0x5c, 0xac, 0x42, 0xef, 0x6a, 0x15, 0x7a, 0x5f, 0x56, 0xa1, - 0xf7, 0xf6, 0x61, 0xc1, 0xf4, 0x74, 0x36, 0xc6, 0x99, 0x2c, 0x93, 0xe6, 0xbd, 0xbb, 0xcf, 0x23, - 0x95, 0xbf, 0x4f, 0x3e, 0xfe, 0x79, 0xfc, 0x7a, 0x5e, 0x51, 0x35, 0xde, 0xb1, 0x87, 0x7d, 0xfc, - 0x3b, 0x00, 0x00, 0xff, 0xff, 0xe4, 0x85, 0xca, 0x92, 0x1b, 0x03, 0x00, 0x00, + 0xce, 0x6a, 0x91, 0x10, 0xea, 0x46, 0x3a, 0x20, 0x21, 0x21, 0x55, 0x2e, 0x30, 0xb0, 0x54, 0x17, + 0xfb, 0xe2, 0x1c, 0x9c, 0xef, 0x2c, 0xdf, 0xa5, 0x90, 0xff, 0xa2, 0x12, 0x0b, 0x63, 0xff, 0x9c, + 0x8c, 0x1d, 0x99, 0x02, 0x24, 0x0b, 0x33, 0x03, 0x33, 0xba, 0x3b, 0x1b, 0x45, 0x90, 0x91, 0xc9, + 0xef, 0x7d, 0xfe, 0xde, 0xf7, 0xbd, 0x1f, 0x36, 0x7c, 0x90, 0x49, 0x55, 0x4a, 0x95, 0x4c, 0xab, + 0xa2, 0x26, 0x39, 0x4d, 0x2e, 0x0e, 0x47, 0x54, 0x93, 0xc3, 0x36, 0xc7, 0x55, 0x2d, 0xb5, 0x44, + 0xfb, 0x8e, 0x85, 0x5b, 0xb4, 0x61, 0xf5, 0xee, 0x15, 0x52, 0x16, 0x9c, 0x26, 0x96, 0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65, 0xb8, 0x04, 0xc5, 0xb0, 0x93, 0x53, 0x95, 0xd5, 0xac, 0xd2, 0x4c, 0x0a, + 0xbb, 0x94, 0xbd, 0x74, 0x1d, 0x42, 0x4f, 0xa0, 0x5f, 0x71, 0x22, 0xec, 0xcc, 0x9d, 0xa3, 0x03, + 0xbc, 0xf9, 0x8a, 0xd8, 0xec, 0x7b, 0xe8, 0x9b, 0x8d, 0xa5, 0x96, 0xbf, 0xd6, 0x15, 0x81, 0xf7, + 0x4f, 0x88, 0xc8, 0x28, 0xff, 0xcf, 0xad, 0xad, 0x59, 0x3c, 0x87, 0xb7, 0x5e, 0xca, 0x7c, 0xca, + 0xe9, 0x1b, 0x5a, 0x2b, 0xd3, 0xf5, 0xa6, 0xcb, 0x07, 0xf0, 0xe6, 0x85, 0x7b, 0x6d, 0xc5, 0xfc, + 0xb4, 0x4d, 0xad, 0x10, 0x30, 0x42, 0xc3, 0x17, 0xf3, 0xef, 0xa1, 0x37, 0x5f, 0x86, 0xe0, 0x7a, + 0x19, 0x82, 0x6f, 0xcb, 0x10, 0x5c, 0xae, 0x42, 0xef, 0x7a, 0x15, 0x7a, 0x5f, 0x56, 0xa1, 0xf7, + 0xf6, 0x61, 0xc1, 0xf4, 0x64, 0x3a, 0xc2, 0x99, 0x2c, 0x93, 0xe6, 0x9b, 0x77, 0x8f, 0x47, 0x2a, + 0x7f, 0x9f, 0x7c, 0xfc, 0xf3, 0x03, 0xe8, 0x59, 0x45, 0xd5, 0x68, 0xc7, 0x1e, 0xf7, 0xf1, 0xef, + 0x00, 0x00, 0x00, 0xff, 0xff, 0x51, 0x11, 0x33, 0x0e, 0x1f, 0x03, 0x00, 0x00, } func (this *Plan) Equal(that interface{}) bool { From ce49abe60728688cf11cc01c0dec3b13b602a7e0 Mon Sep 17 00:00:00 2001 From: Amaury M <1293565+amaurym@users.noreply.github.com> Date: Thu, 17 Jun 2021 17:52:27 +0200 Subject: [PATCH 03/17] Simplify gov migration --- x/gov/legacy/v040/genesis.pb.go | 592 -------------------------------- x/gov/legacy/v040/gov.pb.go | 302 ---------------- x/gov/legacy/v040/vote.go | 78 ----- x/gov/legacy/v043/json.go | 5 +- x/gov/legacy/v043/json_test.go | 20 +- x/gov/legacy/v043/store.go | 18 +- x/gov/legacy/v043/store_test.go | 2 +- 7 files changed, 26 insertions(+), 991 deletions(-) delete mode 100644 x/gov/legacy/v040/genesis.pb.go delete mode 100644 x/gov/legacy/v040/gov.pb.go delete mode 100644 x/gov/legacy/v040/vote.go diff --git a/x/gov/legacy/v040/genesis.pb.go b/x/gov/legacy/v040/genesis.pb.go deleted file mode 100644 index 2dc67061a936..000000000000 --- a/x/gov/legacy/v040/genesis.pb.go +++ /dev/null @@ -1,592 +0,0 @@ -// Package v040 is taken from: -// https://github.com/cosmos/cosmos-sdk/blob/v0.42.1/x/gov/types/genesis.pb.go -// by copy-pasted only the relevants parts for Genesis. -//nolint -package v040 - -import ( - fmt "fmt" - io "io" - math_bits "math/bits" - - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - - "github.com/cosmos/cosmos-sdk/x/gov/types" -) - -// GenesisState defines the gov module's genesis state. -type GenesisState struct { - // starting_proposal_id is the ID of the starting proposal. - StartingProposalId uint64 `protobuf:"varint,1,opt,name=starting_proposal_id,json=startingProposalId,proto3" json:"starting_proposal_id,omitempty" yaml:"starting_proposal_id"` - // deposits defines all the deposits present at genesis. - Deposits types.Deposits `protobuf:"bytes,2,rep,name=deposits,proto3,castrepeated=Deposits" json:"deposits"` - // votes defines all the votes present at genesis. - Votes Votes `protobuf:"bytes,3,rep,name=votes,proto3,castrepeated=Votes" json:"votes"` - // proposals defines all the proposals present at genesis. - Proposals types.Proposals `protobuf:"bytes,4,rep,name=proposals,proto3,castrepeated=Proposals" json:"proposals"` - // params defines all the paramaters of related to deposit. - DepositParams types.DepositParams `protobuf:"bytes,5,opt,name=deposit_params,json=depositParams,proto3" json:"deposit_params" yaml:"deposit_params"` - // params defines all the paramaters of related to voting. - VotingParams types.VotingParams `protobuf:"bytes,6,opt,name=voting_params,json=votingParams,proto3" json:"voting_params" yaml:"voting_params"` - // params defines all the paramaters of related to tally. - TallyParams types.TallyParams `protobuf:"bytes,7,opt,name=tally_params,json=tallyParams,proto3" json:"tally_params" yaml:"tally_params"` -} - -func (m *GenesisState) Reset() { *m = GenesisState{} } -func (m *GenesisState) String() string { return proto.CompactTextString(m) } -func (*GenesisState) ProtoMessage() {} - -func (m *GenesisState) GetStartingProposalId() uint64 { - if m != nil { - return m.StartingProposalId - } - return 0 -} - -func (m *GenesisState) GetDeposits() types.Deposits { - if m != nil { - return m.Deposits - } - return nil -} - -func (m *GenesisState) GetVotes() Votes { - if m != nil { - return m.Votes - } - return nil -} - -func (m *GenesisState) GetProposals() types.Proposals { - if m != nil { - return m.Proposals - } - return nil -} - -func (m *GenesisState) GetDepositParams() types.DepositParams { - if m != nil { - return m.DepositParams - } - return types.DepositParams{} -} - -func (m *GenesisState) GetVotingParams() types.VotingParams { - if m != nil { - return m.VotingParams - } - return types.VotingParams{} -} - -func (m *GenesisState) GetTallyParams() types.TallyParams { - if m != nil { - return m.TallyParams - } - return types.TallyParams{} -} - -func (m *GenesisState) 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 *GenesisState) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.TallyParams.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x3a - { - size, err := m.VotingParams.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x32 - { - size, err := m.DepositParams.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - if len(m.Proposals) > 0 { - for iNdEx := len(m.Proposals) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Proposals[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - } - if len(m.Votes) > 0 { - for iNdEx := len(m.Votes) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Votes[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - } - if len(m.Deposits) > 0 { - for iNdEx := len(m.Deposits) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Deposits[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - if m.StartingProposalId != 0 { - i = encodeVarintGenesis(dAtA, i, uint64(m.StartingProposalId)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func encodeVarintGenesis(dAtA []byte, offset int, v uint64) int { - offset -= sovGenesis(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *GenesisState) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.StartingProposalId != 0 { - n += 1 + sovGenesis(uint64(m.StartingProposalId)) - } - if len(m.Deposits) > 0 { - for _, e := range m.Deposits { - l = e.Size() - n += 1 + l + sovGenesis(uint64(l)) - } - } - if len(m.Votes) > 0 { - for _, e := range m.Votes { - l = e.Size() - n += 1 + l + sovGenesis(uint64(l)) - } - } - if len(m.Proposals) > 0 { - for _, e := range m.Proposals { - l = e.Size() - n += 1 + l + sovGenesis(uint64(l)) - } - } - l = m.DepositParams.Size() - n += 1 + l + sovGenesis(uint64(l)) - l = m.VotingParams.Size() - n += 1 + l + sovGenesis(uint64(l)) - l = m.TallyParams.Size() - n += 1 + l + sovGenesis(uint64(l)) - return n -} - -func sovGenesis(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func (m *GenesisState) 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 ErrIntOverflowGenesis - } - 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: GenesisState: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: GenesisState: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field StartingProposalId", wireType) - } - m.StartingProposalId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.StartingProposalId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Deposits", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenesis - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Deposits = append(m.Deposits, types.Deposit{}) - if err := m.Deposits[len(m.Deposits)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Votes", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenesis - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Votes = append(m.Votes, Vote{}) - if err := m.Votes[len(m.Votes)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Proposals", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenesis - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Proposals = append(m.Proposals, types.Proposal{}) - if err := m.Proposals[len(m.Proposals)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DepositParams", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenesis - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.DepositParams.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field VotingParams", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenesis - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.VotingParams.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TallyParams", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenesis - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.TallyParams.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGenesis(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGenesis - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipGenesis(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowGenesis - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowGenesis - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowGenesis - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthGenesis - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupGenesis - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthGenesis - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthGenesis = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowGenesis = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/gov/legacy/v040/gov.pb.go b/x/gov/legacy/v040/gov.pb.go deleted file mode 100644 index 34ca3d82a0f9..000000000000 --- a/x/gov/legacy/v040/gov.pb.go +++ /dev/null @@ -1,302 +0,0 @@ -// Package v040 is taken from: -// https://github.com/cosmos/cosmos-sdk/blob/v0.41.1/x/gov/types/gov.pb.go -// by copy-pasted only the relevants parts for Vote. -package v040 - -import ( - "fmt" - "io" - math_bits "math/bits" - - "github.com/cosmos/cosmos-sdk/x/gov/types" -) - -type Vote struct { - ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty" yaml:"proposal_id"` //nolint:golint - Voter string `protobuf:"bytes,2,opt,name=voter,proto3" json:"voter,omitempty"` - Option types.VoteOption `protobuf:"varint,3,opt,name=option,proto3,enum=cosmos.gov.v1beta1.VoteOption" json:"option,omitempty"` -} - -func (m *Vote) Reset() { *m = Vote{} } -func (*Vote) ProtoMessage() {} - -func (m *Vote) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.ProposalId != 0 { - n += 1 + sovGov(m.ProposalId) - } - l = len(m.Voter) - if l > 0 { - n += 1 + l + sovGov(uint64(l)) - } - if m.Option != 0 { - n += 1 + sovGov(uint64(m.Option)) - } - return n -} - -func (m *Vote) 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 *Vote) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Vote) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Option != 0 { - i = encodeVarintGov(dAtA, i, uint64(m.Option)) - i-- - dAtA[i] = 0x18 - } - if len(m.Voter) > 0 { - i -= len(m.Voter) - copy(dAtA[i:], m.Voter) - i = encodeVarintGov(dAtA, i, uint64(len(m.Voter))) - i-- - dAtA[i] = 0x12 - } - if m.ProposalId != 0 { - i = encodeVarintGov(dAtA, i, m.ProposalId) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func encodeVarintGov(dAtA []byte, offset int, v uint64) int { - offset -= sovGov(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} - -func sovGov(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} - -func (m *Vote) 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 ErrIntOverflowGov - } - 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: Vote: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Vote: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ProposalId", wireType) - } - m.ProposalId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGov - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ProposalId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Voter", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGov - } - 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 ErrInvalidLengthGov - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGov - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Voter = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Option", wireType) - } - m.Option = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGov - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Option |= types.VoteOption(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipGov(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGov - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} - -func skipGov(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowGov - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowGov - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowGov - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthGov - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupGov - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthGov - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthGov = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowGov = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupGov = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/gov/legacy/v040/vote.go b/x/gov/legacy/v040/vote.go deleted file mode 100644 index 59bde951070b..000000000000 --- a/x/gov/legacy/v040/vote.go +++ /dev/null @@ -1,78 +0,0 @@ -// Package v040 is copy-pasted from: -// https://github.com/cosmos/cosmos-sdk/blob/v0.41.1/x/gov/types/vote.go -package v040 - -import ( - "fmt" - - yaml "gopkg.in/yaml.v2" - - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/x/gov/types" -) - -// NewVote creates a new Vote instance -//nolint:interfacer -func NewVote(proposalID uint64, voter sdk.AccAddress, option types.VoteOption) Vote { - return Vote{proposalID, voter.String(), option} -} - -func (v Vote) String() string { - out, _ := yaml.Marshal(v) - return string(out) -} - -// Votes is a collection of Vote objects -type Votes []Vote - -// Equal returns true if two slices (order-dependant) of votes are equal. -func (v Votes) Equal(other Votes) bool { - if len(v) != len(other) { - return false - } - - for i, vote := range v { - if vote.String() != other[i].String() { - return false - } - } - - return true -} - -func (v Votes) String() string { - if len(v) == 0 { - return "[]" - } - out := fmt.Sprintf("Votes for Proposal %d:", v[0].ProposalId) - for _, vot := range v { - out += fmt.Sprintf("\n %s: %s", vot.Voter, vot.Option) - } - return out -} - -// Empty returns whether a vote is empty. -func (v Vote) Empty() bool { - return v.String() == Vote{}.String() -} - -// VoteOptionFromString returns a VoteOption from a string. It returns an error -// if the string is invalid. -func VoteOptionFromString(str string) (types.VoteOption, error) { - option, ok := types.VoteOption_value[str] - if !ok { - return types.OptionEmpty, fmt.Errorf("'%s' is not a valid vote option", str) - } - return types.VoteOption(option), nil -} - -// ValidVoteOption returns true if the vote option is valid and false otherwise. -func ValidVoteOption(option types.VoteOption) bool { - if option == types.OptionYes || - option == types.OptionAbstain || - option == types.OptionNo || - option == types.OptionNoWithVeto { - return true - } - return false -} diff --git a/x/gov/legacy/v043/json.go b/x/gov/legacy/v043/json.go index db6e47757724..16de6cdf4743 100644 --- a/x/gov/legacy/v043/json.go +++ b/x/gov/legacy/v043/json.go @@ -1,12 +1,11 @@ package v043 import ( - v040gov "github.com/cosmos/cosmos-sdk/x/gov/legacy/v040" "github.com/cosmos/cosmos-sdk/x/gov/types" ) // migrateWeightedVotes migrates the ADR-037 weighted votes. -func migrateJSONWeightedVotes(oldVotes v040gov.Votes) types.Votes { +func migrateJSONWeightedVotes(oldVotes types.Votes) types.Votes { newVotes := make(types.Votes, len(oldVotes)) for i, oldVote := range oldVotes { newVotes[i] = migrateVote(oldVote) @@ -19,7 +18,7 @@ func migrateJSONWeightedVotes(oldVotes v040gov.Votes) types.Votes { // v0.43 x/gov genesis state. The migration includes: // // - Gov weighted votes. -func MigrateJSON(oldState *v040gov.GenesisState) *types.GenesisState { +func MigrateJSON(oldState *types.GenesisState) *types.GenesisState { return &types.GenesisState{ StartingProposalId: oldState.StartingProposalId, Deposits: oldState.Deposits, diff --git a/x/gov/legacy/v043/json_test.go b/x/gov/legacy/v043/json_test.go index 1f8bb2a69f60..d9f045774661 100644 --- a/x/gov/legacy/v043/json_test.go +++ b/x/gov/legacy/v043/json_test.go @@ -10,7 +10,6 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/simapp" sdk "github.com/cosmos/cosmos-sdk/types" - v040gov "github.com/cosmos/cosmos-sdk/x/gov/legacy/v040" v043gov "github.com/cosmos/cosmos-sdk/x/gov/legacy/v043" "github.com/cosmos/cosmos-sdk/x/gov/types" ) @@ -24,13 +23,13 @@ func TestMigrateJSON(t *testing.T) { voter, err := sdk.AccAddressFromBech32("cosmos1fl48vsnmsdzcv85q5d2q4z5ajdha8yu34mf0eh") require.NoError(t, err) - govGenState := &v040gov.GenesisState{ - Votes: v040gov.Votes{ - v040gov.NewVote(1, voter, types.OptionAbstain), - v040gov.NewVote(2, voter, types.OptionEmpty), - v040gov.NewVote(3, voter, types.OptionNo), - v040gov.NewVote(4, voter, types.OptionNoWithVeto), - v040gov.NewVote(5, voter, types.OptionYes), + govGenState := &types.GenesisState{ + Votes: types.Votes{ + types.Vote{ProposalId: 1, Voter: voter.String(), Option: types.OptionAbstain}, + types.Vote{ProposalId: 2, Voter: voter.String(), Option: types.OptionEmpty}, + types.Vote{ProposalId: 3, Voter: voter.String(), Option: types.OptionNo}, + types.Vote{ProposalId: 4, Voter: voter.String(), Option: types.OptionNoWithVeto}, + types.Vote{ProposalId: 5, Voter: voter.String(), Option: types.OptionYes}, }, } @@ -63,6 +62,7 @@ func TestMigrateJSON(t *testing.T) { }, "votes": [ { + "option": "VOTE_OPTION_UNSPECIFIED", "options": [ { "option": "VOTE_OPTION_ABSTAIN", @@ -73,6 +73,7 @@ func TestMigrateJSON(t *testing.T) { "voter": "cosmos1fl48vsnmsdzcv85q5d2q4z5ajdha8yu34mf0eh" }, { + "option": "VOTE_OPTION_UNSPECIFIED", "options": [ { "option": "VOTE_OPTION_UNSPECIFIED", @@ -83,6 +84,7 @@ func TestMigrateJSON(t *testing.T) { "voter": "cosmos1fl48vsnmsdzcv85q5d2q4z5ajdha8yu34mf0eh" }, { + "option": "VOTE_OPTION_UNSPECIFIED", "options": [ { "option": "VOTE_OPTION_NO", @@ -93,6 +95,7 @@ func TestMigrateJSON(t *testing.T) { "voter": "cosmos1fl48vsnmsdzcv85q5d2q4z5ajdha8yu34mf0eh" }, { + "option": "VOTE_OPTION_UNSPECIFIED", "options": [ { "option": "VOTE_OPTION_NO_WITH_VETO", @@ -103,6 +106,7 @@ func TestMigrateJSON(t *testing.T) { "voter": "cosmos1fl48vsnmsdzcv85q5d2q4z5ajdha8yu34mf0eh" }, { + "option": "VOTE_OPTION_UNSPECIFIED", "options": [ { "option": "VOTE_OPTION_YES", diff --git a/x/gov/legacy/v043/store.go b/x/gov/legacy/v043/store.go index c5da33d951c4..2de980dbab37 100644 --- a/x/gov/legacy/v043/store.go +++ b/x/gov/legacy/v043/store.go @@ -1,11 +1,12 @@ package v043 import ( + "fmt" + "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/store/prefix" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/address" - v040gov "github.com/cosmos/cosmos-sdk/x/gov/legacy/v040" "github.com/cosmos/cosmos-sdk/x/gov/types" ) @@ -33,27 +34,30 @@ func migratePrefixProposalAddress(store sdk.KVStore, prefixBz []byte) { } // migrateStoreWeightedVotes migrates a legacy vote to an ADR-037 weighted vote. -func migrateVote(oldVote v040gov.Vote) types.Vote { +// Important: the `oldVote` has its `Option` field set, whereas the new weighted +// vote has its `Options` field set. +func migrateVote(oldVote types.Vote) types.Vote { return types.Vote{ ProposalId: oldVote.ProposalId, Voter: oldVote.Voter, - Options: []types.WeightedVoteOption{{Option: oldVote.Option, Weight: sdk.NewDec(1)}}, + Options: types.NewNonSplitVoteOption(oldVote.Option), } } // migrateStoreWeightedVotes migrates in-place all legacy votes to ADR-037 weighted votes. func migrateStoreWeightedVotes(store sdk.KVStore, cdc codec.BinaryCodec) error { - iterator := sdk.KVStorePrefixIterator(store, v040gov.VotesKeyPrefix) + iterator := sdk.KVStorePrefixIterator(store, types.VotesKeyPrefix) defer iterator.Close() for ; iterator.Valid(); iterator.Next() { - var oldVote v040gov.Vote + var oldVote types.Vote err := cdc.Unmarshal(iterator.Value(), &oldVote) if err != nil { return err } newVote := migrateVote(oldVote) + fmt.Println("migrateStoreWeightedVotes newVote=", newVote) bz, err := cdc.Marshal(&newVote) if err != nil { return err @@ -71,7 +75,7 @@ func migrateStoreWeightedVotes(store sdk.KVStore, cdc codec.BinaryCodec) error { // - Change addresses to be length-prefixed. func MigrateStore(ctx sdk.Context, storeKey sdk.StoreKey, cdc codec.BinaryCodec) error { store := ctx.KVStore(storeKey) - migratePrefixProposalAddress(store, v040gov.DepositsKeyPrefix) - migratePrefixProposalAddress(store, v040gov.VotesKeyPrefix) + migratePrefixProposalAddress(store, types.DepositsKeyPrefix) + migratePrefixProposalAddress(store, types.VotesKeyPrefix) return migrateStoreWeightedVotes(store, cdc) } diff --git a/x/gov/legacy/v043/store_test.go b/x/gov/legacy/v043/store_test.go index db2ffa873773..b65b126b03ec 100644 --- a/x/gov/legacy/v043/store_test.go +++ b/x/gov/legacy/v043/store_test.go @@ -28,7 +28,7 @@ func TestMigrateStore(t *testing.T) { // Use dummy value for keys where we don't test values. dummyValue := []byte("foo") // Use real values for votes, as we're testing weighted votes. - oldVote := v040gov.Vote{ProposalId: 1, Voter: "foobar", Option: types.OptionNoWithVeto} + oldVote := types.Vote{ProposalId: 1, Voter: "foobar", Option: types.OptionNoWithVeto} oldVoteValue := cdc.MustMarshal(&oldVote) newVote := types.Vote{ProposalId: 1, Voter: "foobar", Options: types.WeightedVoteOptions{{Option: types.OptionNoWithVeto, Weight: sdk.NewDec(1)}}} newVoteValue := cdc.MustMarshal(&newVote) From 7ab4aefb78fff3a7d203e31522c74c51595f4488 Mon Sep 17 00:00:00 2001 From: Amaury M <1293565+amaurym@users.noreply.github.com> Date: Thu, 17 Jun 2021 18:01:14 +0200 Subject: [PATCH 04/17] Fix tests --- proto/cosmos/upgrade/v1beta1/upgrade.proto | 2 +- x/genutil/legacy/v043/migrate.go | 3 ++- x/gov/legacy/v040/migrate.go | 2 +- x/gov/legacy/v040/migrate_test.go | 4 +++- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/proto/cosmos/upgrade/v1beta1/upgrade.proto b/proto/cosmos/upgrade/v1beta1/upgrade.proto index 65fbb92c71ed..5318da331363 100644 --- a/proto/cosmos/upgrade/v1beta1/upgrade.proto +++ b/proto/cosmos/upgrade/v1beta1/upgrade.proto @@ -42,7 +42,7 @@ message Plan { // SoftwareUpgradeProposal is a gov Content type for initiating a software // upgrade. message SoftwareUpgradeProposal { - option (gogoproto.equal) = true; + option (gogoproto.equal) = true; option (gogoproto.goproto_stringer) = false; string title = 1; diff --git a/x/genutil/legacy/v043/migrate.go b/x/genutil/legacy/v043/migrate.go index e9321593934e..8dba9ffe60de 100644 --- a/x/genutil/legacy/v043/migrate.go +++ b/x/genutil/legacy/v043/migrate.go @@ -5,6 +5,7 @@ import ( "github.com/cosmos/cosmos-sdk/x/genutil/types" v040gov "github.com/cosmos/cosmos-sdk/x/gov/legacy/v040" v043gov "github.com/cosmos/cosmos-sdk/x/gov/legacy/v043" + gov "github.com/cosmos/cosmos-sdk/x/gov/types" ) // Migrate migrates exported state from v0.40 to a v0.43 genesis state. @@ -12,7 +13,7 @@ func Migrate(appState types.AppMap, clientCtx client.Context) types.AppMap { // Migrate x/gov. if appState[v040gov.ModuleName] != nil { // unmarshal relative source genesis application state - var oldGovState v040gov.GenesisState + var oldGovState gov.GenesisState clientCtx.Codec.MustUnmarshalJSON(appState[v040gov.ModuleName], &oldGovState) // delete deprecated x/gov genesis state diff --git a/x/gov/legacy/v040/migrate.go b/x/gov/legacy/v040/migrate.go index 4845c8303d94..3adedde50932 100644 --- a/x/gov/legacy/v040/migrate.go +++ b/x/gov/legacy/v040/migrate.go @@ -163,7 +163,7 @@ func Migrate(oldGovState v036gov.GenesisState) *v040gov.GenesisState { newVotes[i] = v040gov.Vote{ ProposalId: oldVote.ProposalID, Voter: oldVote.Voter.String(), - Options: v040gov.NewNonSplitVoteOption(migrateVoteOption(oldVote.Option)), + Option: migrateVoteOption(oldVote.Option), } } diff --git a/x/gov/legacy/v040/migrate_test.go b/x/gov/legacy/v040/migrate_test.go index 3c9d512df51e..664696bf296e 100644 --- a/x/gov/legacy/v040/migrate_test.go +++ b/x/gov/legacy/v040/migrate_test.go @@ -175,7 +175,9 @@ func TestMigrate(t *testing.T) { "plan": { "height": "123", "info": "foo_upgrade_info", - "name": "foo_upgrade_name" + "name": "foo_upgrade_name", + "time": "0001-01-01T00:00:00Z", + "upgraded_client_state": null }, "title": "foo_software_upgrade" }, From 5c386c534175b525d562017713cc3690acbd813e Mon Sep 17 00:00:00 2001 From: Amaury M <1293565+amaurym@users.noreply.github.com> Date: Thu, 17 Jun 2021 20:34:47 +0200 Subject: [PATCH 05/17] Fix test --- x/gov/keeper/grpc_query_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/x/gov/keeper/grpc_query_test.go b/x/gov/keeper/grpc_query_test.go index 32d0d2907c2e..7ed177192428 100644 --- a/x/gov/keeper/grpc_query_test.go +++ b/x/gov/keeper/grpc_query_test.go @@ -395,8 +395,8 @@ func (suite *KeeperTestSuite) TestGRPCQueryVotes() { app.GovKeeper.SetProposal(ctx, proposal) votes = []types.Vote{ - {proposal.ProposalId, addrs[0].String(), types.NewNonSplitVoteOption(types.OptionAbstain)}, - {proposal.ProposalId, addrs[1].String(), types.NewNonSplitVoteOption(types.OptionYes)}, + {ProposalId: proposal.ProposalId, Voter: addrs[0].String(), Options: types.NewNonSplitVoteOption(types.OptionAbstain)}, + {ProposalId: proposal.ProposalId, Voter: addrs[1].String(), Options: types.NewNonSplitVoteOption(types.OptionYes)}, } accAddr1, err1 := sdk.AccAddressFromBech32(votes[0].Voter) accAddr2, err2 := sdk.AccAddressFromBech32(votes[1].Voter) From 1ec356c27ff830fd4cb065f95552597b1f2d0a95 Mon Sep 17 00:00:00 2001 From: Amaury M <1293565+amaurym@users.noreply.github.com> Date: Fri, 18 Jun 2021 09:52:31 +0200 Subject: [PATCH 06/17] Tweak --- CHANGELOG.md | 3 ++- buf.yaml | 2 -- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 06289b0ccd9b..7e0a50f5daf3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -77,6 +77,7 @@ if input key is empty, or input data contains empty key. * via legacy `msg.Type()` (e.g. `message.action='send'`) is being deprecated, new `Msg`s won't emit these events. * Please use concrete `Msg` TypeURLs instead (e.g. `message.action='/cosmos.bank.v1beta1.MsgSend'`). * [\#9291](https://github.com/cosmos/cosmos-sdk/pull/9291) Migration scripts prior to v0.38 have been removed from the CLI `migrate` command. The oldest supported migration is v0.39->v0.42. +* (x/upgrade) [\#9534](https://github.com/cosmos/cosmos-sdk/pull/9534) Upgrade `Plan`'s `upgraded_client_state` field has been deprecated, and will error if not empty. ### API Breaking Changes @@ -123,7 +124,7 @@ if input key is empty, or input data contains empty key. * (x/{bank,distrib,gov,slashing,staking}) [\#8363](https://github.com/cosmos/cosmos-sdk/issues/8363) Store keys have been modified to allow for variable-length addresses. * (x/evidence) [\#8502](https://github.com/cosmos/cosmos-sdk/pull/8502) `HandleEquivocationEvidence` persists the evidence to state. -* (x/gov) [\#7733](https://github.com/cosmos/cosmos-sdk/pull/7733) ADR 037 Implementation: Governance Split Votes +* (x/gov) [\#7733](https://github.com/cosmos/cosmos-sdk/pull/7733) ADR 037 Implementation: Governance Split Votes, use `MsgWeightedVote` to send a split vote. Sending a regular `MsgVote` will convert the underlying vote option into a weighted vote with weight 1. * (x/bank) [\#8656](https://github.com/cosmos/cosmos-sdk/pull/8656) balance and supply are now correctly tracked via `coin_spent`, `coin_received`, `coinbase` and `burn` events. * (x/bank) [\#8517](https://github.com/cosmos/cosmos-sdk/pull/8517) Supply is now stored and tracked as `sdk.Coins` * (store) [\#8790](https://github.com/cosmos/cosmos-sdk/pull/8790) Reduce gas costs by 10x for transient store operations. diff --git a/buf.yaml b/buf.yaml index 5418e290609b..37f716cabaa2 100644 --- a/buf.yaml +++ b/buf.yaml @@ -26,8 +26,6 @@ lint: breaking: use: - FILE - except: - - FIELD_NO_DELETE ignore: - tendermint - gogoproto From 362d1c7b6b2923a945992f4376250e98aa519c2a Mon Sep 17 00:00:00 2001 From: Amaury M <1293565+amaurym@users.noreply.github.com> Date: Fri, 18 Jun 2021 10:07:24 +0200 Subject: [PATCH 07/17] Improve comments --- CHANGELOG.md | 3 +-- docs/core/proto-docs.md | 4 ++-- proto/cosmos/upgrade/v1beta1/upgrade.proto | 2 ++ x/upgrade/types/upgrade.pb.go | 2 ++ 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7e0a50f5daf3..0c3457e9a100 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -77,7 +77,6 @@ if input key is empty, or input data contains empty key. * via legacy `msg.Type()` (e.g. `message.action='send'`) is being deprecated, new `Msg`s won't emit these events. * Please use concrete `Msg` TypeURLs instead (e.g. `message.action='/cosmos.bank.v1beta1.MsgSend'`). * [\#9291](https://github.com/cosmos/cosmos-sdk/pull/9291) Migration scripts prior to v0.38 have been removed from the CLI `migrate` command. The oldest supported migration is v0.39->v0.42. -* (x/upgrade) [\#9534](https://github.com/cosmos/cosmos-sdk/pull/9534) Upgrade `Plan`'s `upgraded_client_state` field has been deprecated, and will error if not empty. ### API Breaking Changes @@ -89,7 +88,7 @@ if input key is empty, or input data contains empty key. * (client/keys) [\#8500](https://github.com/cosmos/cosmos-sdk/pull/8500) `InfoImporter` interface is removed from legacy keybase. * (x/staking) [\#8505](https://github.com/cosmos/cosmos-sdk/pull/8505) `sdk.PowerReduction` has been renamed to `sdk.DefaultPowerReduction`, and most staking functions relying on power reduction take a new function argument, instead of relying on that global variable. * [\#8629](https://github.com/cosmos/cosmos-sdk/pull/8629) Deprecated `SetFullFundraiserPath` from `Config` in favor of `SetPurpose` and `SetCoinType`. -* (x/upgrade) [\#8673](https://github.com/cosmos/cosmos-sdk/pull/8673) Remove IBC logic from x/upgrade. Deprecates IBC fields in an Upgrade Plan. IBC upgrade logic moved to 02-client and an IBC UpgradeProposal is added. +* (x/upgrade) [\#8673](https://github.com/cosmos/cosmos-sdk/pull/8673) Remove IBC logic from x/upgrade. Deprecates IBC fields in an Upgrade Plan, an error will be thrown if they are set. IBC upgrade logic moved to 02-client and an IBC UpgradeProposal is added. * (x/bank) [\#8517](https://github.com/cosmos/cosmos-sdk/pull/8517) `SupplyI` interface and `Supply` are removed and uses `sdk.Coins` for supply tracking * (x/upgrade) [\#8743](https://github.com/cosmos/cosmos-sdk/pull/8743) `UpgradeHandler` includes a new argument `VersionMap` which helps facilitate in-place migrations. * (x/auth) [\#8129](https://github.com/cosmos/cosmos-sdk/pull/8828) Updated `SigVerifiableTx.GetPubKeys` method signature to return error. diff --git a/docs/core/proto-docs.md b/docs/core/proto-docs.md index 8b8d540e7893..66d960b8728b 100644 --- a/docs/core/proto-docs.md +++ b/docs/core/proto-docs.md @@ -7873,10 +7873,10 @@ Plan specifies information about a planned upgrade and when it should occur. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | `name` | [string](#string) | | Sets the name for the upgrade. This name will be used by the upgraded version of the software to apply any special "on-upgrade" commands during the first BeginBlock method after the upgrade is applied. It is also used to detect whether a software version can handle a given upgrade. If no upgrade handler with this name has been set in the software, it will be assumed that the software is out-of-date when the upgrade Time or Height is reached and the software will exit. | -| `time` | [google.protobuf.Timestamp](#google.protobuf.Timestamp) | | Deprecated: Time based upgrades have been deprecated. Time based upgrade logic has been removed from the SDK. | +| `time` | [google.protobuf.Timestamp](#google.protobuf.Timestamp) | | Deprecated: Time based upgrades have been deprecated. Time based upgrade logic has been removed from the SDK. If this field is not empty, an error will be thrown. | | `height` | [int64](#int64) | | The height at which the upgrade must be performed. Only used if Time is not set. | | `info` | [string](#string) | | Any application specific upgrade info to be included on-chain such as a git commit that validators could automatically upgrade to | -| `upgraded_client_state` | [google.protobuf.Any](#google.protobuf.Any) | | Deprecated: UpgradedClientState field has been deprecated. IBC upgrade logic has been moved to the IBC module in the sub module 02-client. | +| `upgraded_client_state` | [google.protobuf.Any](#google.protobuf.Any) | | Deprecated: UpgradedClientState field has been deprecated. IBC upgrade logic has been moved to the IBC module in the sub module 02-client. If this field is not empty, an error will be thrown. | diff --git a/proto/cosmos/upgrade/v1beta1/upgrade.proto b/proto/cosmos/upgrade/v1beta1/upgrade.proto index 5318da331363..de4299e62cf9 100644 --- a/proto/cosmos/upgrade/v1beta1/upgrade.proto +++ b/proto/cosmos/upgrade/v1beta1/upgrade.proto @@ -24,6 +24,7 @@ message Plan { // Deprecated: Time based upgrades have been deprecated. Time based upgrade logic // has been removed from the SDK. + // If this field is not empty, an error will be thrown. google.protobuf.Timestamp time = 2 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; // The height at which the upgrade must be performed. @@ -36,6 +37,7 @@ message Plan { // Deprecated: UpgradedClientState field has been deprecated. IBC upgrade logic has been // moved to the IBC module in the sub module 02-client. + // If this field is not empty, an error will be thrown. google.protobuf.Any upgraded_client_state = 5 [(gogoproto.moretags) = "yaml:\"upgraded_client_state\""]; } diff --git a/x/upgrade/types/upgrade.pb.go b/x/upgrade/types/upgrade.pb.go index 6507dd82c74c..787f1b33a7a5 100644 --- a/x/upgrade/types/upgrade.pb.go +++ b/x/upgrade/types/upgrade.pb.go @@ -40,6 +40,7 @@ type Plan struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // Deprecated: Time based upgrades have been deprecated. Time based upgrade logic // has been removed from the SDK. + // If this field is not empty, an error will be thrown. Time time.Time `protobuf:"bytes,2,opt,name=time,proto3,stdtime" json:"time"` // The height at which the upgrade must be performed. // Only used if Time is not set. @@ -49,6 +50,7 @@ type Plan struct { Info string `protobuf:"bytes,4,opt,name=info,proto3" json:"info,omitempty"` // Deprecated: UpgradedClientState field has been deprecated. IBC upgrade logic has been // moved to the IBC module in the sub module 02-client. + // If this field is not empty, an error will be thrown. UpgradedClientState *types.Any `protobuf:"bytes,5,opt,name=upgraded_client_state,json=upgradedClientState,proto3" json:"upgraded_client_state,omitempty" yaml:"upgraded_client_state"` } From dfcab08a5c19905c102794b83469400d067f6bd0 Mon Sep 17 00:00:00 2001 From: Amaury M <1293565+amaurym@users.noreply.github.com> Date: Fri, 18 Jun 2021 17:05:05 +0200 Subject: [PATCH 08/17] Add deprecated proto option --- docs/core/proto-docs.md | 6 +- proto/cosmos/gov/v1beta1/gov.proto | 11 +- proto/cosmos/upgrade/v1beta1/upgrade.proto | 5 +- x/gov/types/gov.pb.go | 195 +++++++++++---------- x/upgrade/types/upgrade.pb.go | 64 +++---- 5 files changed, 144 insertions(+), 137 deletions(-) diff --git a/docs/core/proto-docs.md b/docs/core/proto-docs.md index 66d960b8728b..14f83ecc0df1 100644 --- a/docs/core/proto-docs.md +++ b/docs/core/proto-docs.md @@ -4986,7 +4986,7 @@ A Vote consists of a proposal ID, the voter, and the vote option. | ----- | ---- | ----- | ----------- | | `proposal_id` | [uint64](#uint64) | | | | `voter` | [string](#string) | | | -| `option` | [VoteOption](#cosmos.gov.v1beta1.VoteOption) | | | +| `option` | [VoteOption](#cosmos.gov.v1beta1.VoteOption) | | **Deprecated.** Deprecated: Prefer to use `options` instead. If this field is set, the VoteOption will be converted into a WeightedVoteOption with weight 1. | | `options` | [WeightedVoteOption](#cosmos.gov.v1beta1.WeightedVoteOption) | repeated | | @@ -7873,10 +7873,10 @@ Plan specifies information about a planned upgrade and when it should occur. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | `name` | [string](#string) | | Sets the name for the upgrade. This name will be used by the upgraded version of the software to apply any special "on-upgrade" commands during the first BeginBlock method after the upgrade is applied. It is also used to detect whether a software version can handle a given upgrade. If no upgrade handler with this name has been set in the software, it will be assumed that the software is out-of-date when the upgrade Time or Height is reached and the software will exit. | -| `time` | [google.protobuf.Timestamp](#google.protobuf.Timestamp) | | Deprecated: Time based upgrades have been deprecated. Time based upgrade logic has been removed from the SDK. If this field is not empty, an error will be thrown. | +| `time` | [google.protobuf.Timestamp](#google.protobuf.Timestamp) | | **Deprecated.** Deprecated: Time based upgrades have been deprecated. Time based upgrade logic has been removed from the SDK. If this field is not empty, an error will be thrown. | | `height` | [int64](#int64) | | The height at which the upgrade must be performed. Only used if Time is not set. | | `info` | [string](#string) | | Any application specific upgrade info to be included on-chain such as a git commit that validators could automatically upgrade to | -| `upgraded_client_state` | [google.protobuf.Any](#google.protobuf.Any) | | Deprecated: UpgradedClientState field has been deprecated. IBC upgrade logic has been moved to the IBC module in the sub module 02-client. If this field is not empty, an error will be thrown. | +| `upgraded_client_state` | [google.protobuf.Any](#google.protobuf.Any) | | **Deprecated.** Deprecated: UpgradedClientState field has been deprecated. IBC upgrade logic has been moved to the IBC module in the sub module 02-client. If this field is not empty, an error will be thrown. | diff --git a/proto/cosmos/gov/v1beta1/gov.proto b/proto/cosmos/gov/v1beta1/gov.proto index fe013381b59a..12ed66e2ab71 100644 --- a/proto/cosmos/gov/v1beta1/gov.proto +++ b/proto/cosmos/gov/v1beta1/gov.proto @@ -129,10 +129,13 @@ message Vote { option (gogoproto.goproto_stringer) = false; option (gogoproto.equal) = false; - uint64 proposal_id = 1 [(gogoproto.moretags) = "yaml:\"proposal_id\""]; - string voter = 2; - VoteOption option = 3; - repeated WeightedVoteOption options = 4 [(gogoproto.nullable) = false]; + uint64 proposal_id = 1 [(gogoproto.moretags) = "yaml:\"proposal_id\""]; + string voter = 2; + // Deprecated: Prefer to use `options` instead. If this field is set, + // the VoteOption will be converted into a WeightedVoteOption with + // weight 1. + VoteOption option = 3 [deprecated = true]; + repeated WeightedVoteOption options = 4 [(gogoproto.nullable) = false]; } // DepositParams defines the params for deposits on governance proposals. diff --git a/proto/cosmos/upgrade/v1beta1/upgrade.proto b/proto/cosmos/upgrade/v1beta1/upgrade.proto index de4299e62cf9..4e1d69aaaaca 100644 --- a/proto/cosmos/upgrade/v1beta1/upgrade.proto +++ b/proto/cosmos/upgrade/v1beta1/upgrade.proto @@ -25,7 +25,7 @@ message Plan { // Deprecated: Time based upgrades have been deprecated. Time based upgrade logic // has been removed from the SDK. // If this field is not empty, an error will be thrown. - google.protobuf.Timestamp time = 2 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; + google.protobuf.Timestamp time = 2 [deprecated = true, (gogoproto.stdtime) = true, (gogoproto.nullable) = false]; // The height at which the upgrade must be performed. // Only used if Time is not set. @@ -38,7 +38,8 @@ message Plan { // Deprecated: UpgradedClientState field has been deprecated. IBC upgrade logic has been // moved to the IBC module in the sub module 02-client. // If this field is not empty, an error will be thrown. - google.protobuf.Any upgraded_client_state = 5 [(gogoproto.moretags) = "yaml:\"upgraded_client_state\""]; + google.protobuf.Any upgraded_client_state = 5 + [deprecated = true, (gogoproto.moretags) = "yaml:\"upgraded_client_state\""]; } // SoftwareUpgradeProposal is a gov Content type for initiating a software diff --git a/x/gov/types/gov.pb.go b/x/gov/types/gov.pb.go index 4ad5218245fc..43b95b6a5ee2 100644 --- a/x/gov/types/gov.pb.go +++ b/x/gov/types/gov.pb.go @@ -326,10 +326,13 @@ var xxx_messageInfo_TallyResult proto.InternalMessageInfo // Vote defines a vote on a governance proposal. // A Vote consists of a proposal ID, the voter, and the vote option. type Vote struct { - ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty" yaml:"proposal_id"` - Voter string `protobuf:"bytes,2,opt,name=voter,proto3" json:"voter,omitempty"` - Option VoteOption `protobuf:"varint,3,opt,name=option,proto3,enum=cosmos.gov.v1beta1.VoteOption" json:"option,omitempty"` - Options []WeightedVoteOption `protobuf:"bytes,4,rep,name=options,proto3" json:"options"` + ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty" yaml:"proposal_id"` + Voter string `protobuf:"bytes,2,opt,name=voter,proto3" json:"voter,omitempty"` + // Deprecated: Prefer to use `options` instead. If this field is set, + // the VoteOption will be converted into a WeightedVoteOption with + // weight 1. + Option VoteOption `protobuf:"varint,3,opt,name=option,proto3,enum=cosmos.gov.v1beta1.VoteOption" json:"option,omitempty"` // Deprecated: Do not use. + Options []WeightedVoteOption `protobuf:"bytes,4,rep,name=options,proto3" json:"options"` } func (m *Vote) Reset() { *m = Vote{} } @@ -504,98 +507,98 @@ func init() { func init() { proto.RegisterFile("cosmos/gov/v1beta1/gov.proto", fileDescriptor_6e82113c1a9a4b7c) } var fileDescriptor_6e82113c1a9a4b7c = []byte{ - // 1443 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x57, 0x41, 0x6c, 0xdb, 0x54, - 0x18, 0x8e, 0x93, 0x34, 0x6d, 0x5e, 0xd2, 0xd6, 0x7b, 0xed, 0xda, 0x34, 0x0c, 0x3b, 0x18, 0x34, - 0x55, 0xd3, 0x96, 0x6e, 0x05, 0x81, 0xe8, 0x24, 0x20, 0x6e, 0x5c, 0x16, 0x34, 0x25, 0x91, 0xe3, - 0xa5, 0xda, 0x38, 0x58, 0x6e, 0xf2, 0x96, 0x1a, 0x62, 0xbf, 0x10, 0xbf, 0x74, 0xad, 0xb8, 0x70, - 0x9c, 0x82, 0x84, 0x76, 0x9c, 0x84, 0x22, 0x4d, 0x42, 0x5c, 0x38, 0x73, 0xe6, 0x5c, 0x21, 0x24, - 0x26, 0x4e, 0x13, 0x48, 0x19, 0xeb, 0x24, 0x34, 0xf5, 0xd8, 0x03, 0x67, 0x64, 0xbf, 0xe7, 0xc6, - 0x49, 0x2a, 0x4a, 0x38, 0xd5, 0xfe, 0xdf, 0xff, 0x7d, 0xff, 0xff, 0x7f, 0xf9, 0xff, 0xff, 0xb9, - 0xe0, 0x52, 0x0d, 0x3b, 0x16, 0x76, 0xd6, 0x1a, 0x78, 0x6f, 0x6d, 0xef, 0xc6, 0x0e, 0x22, 0xc6, - 0x0d, 0xf7, 0x39, 0xdb, 0x6a, 0x63, 0x82, 0x21, 0xa4, 0xa7, 0x59, 0xd7, 0xc2, 0x4e, 0xd3, 0x02, - 0x43, 0xec, 0x18, 0x0e, 0x3a, 0x85, 0xd4, 0xb0, 0x69, 0x53, 0x4c, 0x7a, 0xb1, 0x81, 0x1b, 0xd8, - 0x7b, 0x5c, 0x73,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0x96, 0x4a, 0x1c, 0x15, - 0x0e, 0x00, 0x00, + // 1454 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x57, 0x51, 0x68, 0xdb, 0x56, + 0x17, 0xb6, 0x6c, 0xc7, 0x89, 0xaf, 0x9d, 0x44, 0xbd, 0x49, 0x13, 0xc7, 0x7f, 0x7f, 0xc9, 0xbf, + 0xfe, 0x9f, 0x12, 0x4a, 0xeb, 0xb4, 0xf9, 0xc7, 0xc6, 0x52, 0xd8, 0x66, 0xc5, 0xca, 0xea, 0x51, + 0x6c, 0x23, 0xab, 0x0e, 0xed, 0x1e, 0x84, 0x62, 0xdf, 0x3a, 0xda, 0x2c, 0x5d, 0xcf, 0xba, 0x4e, + 0x13, 0xf6, 0xb2, 0xc7, 0xe2, 0xc1, 0xe8, 0x63, 0x61, 0x18, 0x0a, 0x63, 0x2f, 0x7b, 0xde, 0xf3, + 0x9e, 0xc3, 0x18, 0xac, 0xec, 0xa9, 0x6c, 0xe0, 0xae, 0x09, 0x8c, 0x92, 0xc7, 0x3c, 0xec, 0x79, + 0x48, 0xf7, 0x2a, 0x96, 0xed, 0xb0, 0xd4, 0x7b, 0x8a, 0x74, 0xee, 0xf9, 0xbe, 0x73, 0xce, 0xe7, + 0x73, 0xce, 0x55, 0xc0, 0x95, 0x1a, 0x76, 0x2c, 0xec, 0xac, 0x35, 0xf0, 0xde, 0xda, 0xde, 0xad, + 0x1d, 0x44, 0x8c, 0x5b, 0xee, 0x73, 0xb6, 0xd5, 0xc6, 0x04, 0x43, 0x48, 0x4f, 0xb3, 0xae, 0x85, + 0x9d, 0xa6, 0x05, 0x86, 0xd8, 0x31, 0x1c, 0x74, 0x06, 0xa9, 0x61, 0xd3, 0xa6, 0x98, 0xf4, 0x62, + 0x03, 0x37, 0xb0, 0xf7, 0xb8, 0xe6, 0x3e, 0x31, 0xeb, 0x0a, 0x45, 0xe9, 0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x69, 0x44, 0x64, 0x4a, 0x22, 0xa9, 0x8c, 0x0d, 0xb6, 0x00, + 0x7c, 0x68, 0xda, 0x46, 0x53, 0x27, 0x46, 0xb3, 0x79, 0xa0, 0xb7, 0x91, 0xd3, 0x69, 0x92, 0x54, + 0xd4, 0xcb, 0x4f, 0x3c, 0x2f, 0x86, 0xe6, 0xfa, 0xa9, 0x9e, 0x9b, 0xfc, 0x1f, 0x57, 0xd8, 0xd3, + 0xbe, 0xb8, 0x42, 0x83, 0x8c, 0x13, 0x49, 0x2a, 0xef, 0x19, 0x03, 0x20, 0xf8, 0x31, 0x48, 0x38, + 0x9d, 0x1d, 0xcb, 0x24, 0xba, 0x3b, 0x71, 0xa9, 0x29, 0x2f, 0x54, 0x7a, 0x4c, 0x0a, 0xcd, 0x1f, + 0x47, 0x59, 0x60, 0x51, 0x58, 0xbf, 0x04, 0xc0, 0xd2, 0x93, 0x97, 0x22, 0xa7, 0x02, 0x6a, 0x71, + 0x01, 0xd0, 0x04, 0x3c, 0x6b, 0x11, 0x1d, 0xd9, 0x75, 0x1a, 0x21, 0x76, 0x61, 0x84, 0xff, 0xb2, + 0x08, 0xcb, 0x34, 0xc2, 0x28, 0x03, 0x0d, 0x33, 0xc7, 0xcc, 0x8a, 0x5d, 0xf7, 0x42, 0x3d, 0xe6, + 0xc0, 0x2c, 0xc1, 0xc4, 0x68, 0xea, 0xec, 0x20, 0x35, 0x7d, 0x51, 0x23, 0xde, 0x61, 0x71, 0x16, + 0x69, 0x9c, 0x21, 0xb4, 0x34, 0x51, 0x83, 0x26, 0x3d, 0xac, 0x3f, 0x62, 0x4d, 0x70, 0x69, 0x0f, + 0x13, 0xd3, 0x6e, 0xb8, 0x3f, 0x6f, 0x9b, 0x09, 0x3b, 0x73, 0x61, 0xd9, 0xff, 0x63, 0xe9, 0xa4, + 0x68, 0x3a, 0x63, 0x14, 0xb4, 0xee, 0x79, 0x6a, 0xaf, 0xb8, 0x66, 0xaf, 0xf0, 0x87, 0x80,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x09, 0xcb, 0xb4, 0xcf, 0xe6, 0x94, 0xbb, 0x68, 0x4e, 0x75, + 0x97, 0xfb, 0xa4, 0x2f, 0x5e, 0x0e, 0xa0, 0xae, 0x63, 0xcb, 0x24, 0xc8, 0x6a, 0x91, 0x83, 0x81, + 0x4e, 0x81, 0xe3, 0xc9, 0xc6, 0x17, 0x58, 0xa6, 0xed, 0x0f, 0xef, 0x57, 0x1c, 0x80, 0x96, 0xb1, + 0xef, 0x13, 0xe9, 0x2d, 0xd4, 0x36, 0x71, 0x9d, 0x5d, 0x11, 0x2b, 0x63, 0x23, 0x95, 0x67, 0x9f, + 0x1a, 0xb4, 0x4d, 0x4e, 0xfa, 0xe2, 0x95, 0x71, 0xf0, 0x50, 0xae, 0x6c, 0x39, 0x8f, 0x7b, 0x49, + 0x4f, 0xdd, 0xa1, 0xe3, 0x2d, 0x63, 0xdf, 0x97, 0x8b, 0x9a, 0xbf, 0xe4, 0x40, 0xb2, 0xea, 0x4d, + 0x22, 0xd3, 0xef, 0x73, 0xc0, 0x26, 0xd3, 0xcf, 0x8d, 0xbb, 0x28, 0xb7, 0xdb, 0x2c, 0xb7, 0xe5, + 0x21, 0xdc, 0x50, 0x5a, 0x8b, 0x43, 0x8b, 0x20, 0x98, 0x51, 0x92, 0xda, 0x58, 0x36, 0xbf, 0xf9, + 0xf3, 0xcf, 0x92, 0x79, 0x00, 0x62, 0x9f, 0x75, 0x70, 0xbb, 0x63, 0x79, 0x59, 0x24, 0x65, 0x79, + 0xb2, 0x8f, 0xa1, 0x93, 0xbe, 0xc8, 0x53, 0xfc, 0x20, 0x1b, 0x95, 0x31, 0xc2, 0x1a, 0x88, 0x93, + 0xdd, 0x36, 0x72, 0x76, 0x71, 0x93, 0xfe, 0x00, 0xc9, 0x89, 0x86, 0x91, 0xd2, 0x2f, 0x9c, 0x51, + 0x04, 0x22, 0x0c, 0x78, 0x61, 0x97, 0x03, 0x73, 0xee, 0x84, 0xea, 0x83, 0x50, 0x11, 0x2f,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, 0x00, 0x00, } func (this *TextProposal) Equal(that interface{}) bool { diff --git a/x/upgrade/types/upgrade.pb.go b/x/upgrade/types/upgrade.pb.go index 787f1b33a7a5..f3b0b2d5ac4a 100644 --- a/x/upgrade/types/upgrade.pb.go +++ b/x/upgrade/types/upgrade.pb.go @@ -41,7 +41,7 @@ type Plan struct { // Deprecated: Time based upgrades have been deprecated. Time based upgrade logic // has been removed from the SDK. // If this field is not empty, an error will be thrown. - Time time.Time `protobuf:"bytes,2,opt,name=time,proto3,stdtime" json:"time"` + Time time.Time `protobuf:"bytes,2,opt,name=time,proto3,stdtime" json:"time"` // Deprecated: Do not use. // The height at which the upgrade must be performed. // Only used if Time is not set. Height int64 `protobuf:"varint,3,opt,name=height,proto3" json:"height,omitempty"` @@ -51,7 +51,7 @@ type Plan struct { // Deprecated: UpgradedClientState field has been deprecated. IBC upgrade logic has been // moved to the IBC module in the sub module 02-client. // If this field is not empty, an error will be thrown. - UpgradedClientState *types.Any `protobuf:"bytes,5,opt,name=upgraded_client_state,json=upgradedClientState,proto3" json:"upgraded_client_state,omitempty" yaml:"upgraded_client_state"` + UpgradedClientState *types.Any `protobuf:"bytes,5,opt,name=upgraded_client_state,json=upgradedClientState,proto3" json:"upgraded_client_state,omitempty" yaml:"upgraded_client_state"` // Deprecated: Do not use. } func (m *Plan) Reset() { *m = Plan{} } @@ -218,36 +218,36 @@ func init() { } var fileDescriptor_ccf2a7d4d7b48dca = []byte{ - // 461 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x53, 0xbf, 0x6f, 0xd3, 0x40, - 0x14, 0xf6, 0x51, 0xb7, 0xb4, 0x17, 0xb1, 0x1c, 0xa1, 0x98, 0xa8, 0xd8, 0x56, 0xc4, 0x90, 0x01, - 0xce, 0x6a, 0x91, 0x10, 0xea, 0x46, 0x3a, 0x20, 0x21, 0x21, 0x55, 0x2e, 0x30, 0xb0, 0x54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, 0x7a, 0x5f, 0x56, 0xa1, 0xf7, - 0xf6, 0x61, 0xc1, 0xf4, 0x64, 0x3a, 0xc2, 0x99, 0x2c, 0x93, 0xe6, 0x9b, 0x77, 0x8f, 0x47, 0x2a, - 0x7f, 0x9f, 0x7c, 0xfc, 0xf3, 0x03, 0xe8, 0x59, 0x45, 0xd5, 0x68, 0xc7, 0x1e, 0xf7, 0xf1, 0xef, - 0x00, 0x00, 0x00, 0xff, 0xff, 0x51, 0x11, 0x33, 0x0e, 0x1f, 0x03, 0x00, 0x00, + // 462 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x53, 0x3d, 0x6f, 0xd3, 0x40, + 0x18, 0xf6, 0x51, 0xb7, 0xd0, 0x8b, 0x58, 0x8e, 0x50, 0x4c, 0x54, 0xec, 0xc8, 0x62, 0xc8, 0x00, + 0x67, 0xb5, 0x48, 0x0c, 0xd9, 0x48, 0x07, 0x24, 0x24, 0xa4, 0xca, 0x05, 0x06, 0x96, 0xea, 0x62, + 0x5f, 0x9c, 0x13, 0xe7, 0x3b, 0xcb, 0x77, 0x29, 0xe4, 0x5f, 0x54, 0x62, 0x61, 0xec, 0xcf, 0xc9, + 0xd8, 0x91, 0x29, 0x40, 0xb2, 0x30, 0x33, 0x32, 0xa1, 0xbb, 0xb3, 0x51, 0x04, 0x19, 0x3b, 0xf9, + 0xfd, 0x78, 0xde, 0xe7, 0x79, 0x3f, 0x7c, 0xf0, 0x71, 0x26, 0x55, 0x29, 0x55, 0x32, 0xab, 0x8a, + 0x9a, 0xe4, 0x34, 0xb9, 0x38, 0x1a, 0x53, 0x4d, 0x8e, 0x5a, 0x1f, 0x57, 0xb5, 0xd4, 0x12, 0x1d, + 0x38, 0x14, 0x6e, 0xa3, 0x0d, 0xaa, 0xf7, 0xb0, 0x90, 0xb2, 0xe0, 0x34, 0xb1, 0xa8, 0xf1, 0x6c, + 0x92, 0x10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d4, 0x87, 0x9d, 0x9c, 0xaa, 0xac, 0x66, 0x95, 0x66, + 0x52, 0xd8, 0xc5, 0xec, 0xa7, 0x9b, 0x21, 0xf4, 0x1c, 0xfa, 0x15, 0x27, 0xc2, 0x4e, 0xdd, 0x39, + 0x3e, 0xc4, 0xdb, 0x2f, 0x89, 0xcd, 0xce, 0x47, 0xbe, 0xd9, 0x5a, 0x6a, 0xf1, 0x1b, 0x5d, 0x11, + 0xf8, 0xe8, 0x84, 0x88, 0x8c, 0xf2, 0x1b, 0x6e, 0x6d, 0x43, 0xe2, 0x25, 0xbc, 0xfb, 0x5a, 0xe6, + 0x33, 0x4e, 0xdf, 0xd1, 0x5a, 0x99, 0xae, 0xb7, 0x5d, 0x3f, 0x80, 0xb7, 0x2f, 0x5c, 0xda, 0x92, + 0xf9, 0x69, 0xeb, 0x5a, 0x22, 0x60, 0x88, 0x46, 0xaf, 0x16, 0x3f, 0x42, 0x6f, 0xb1, 0x0a, 0xc1, + 0xf5, 0x2a, 0x04, 0xdf, 0x57, 0x21, 0xb8, 0x5c, 0x87, 0xde, 0xf5, 0x3a, 0xf4, 0xbe, 0xae, 0x43, + 0xef, 0xfd, 0x93, 0x82, 0xe9, 0xe9, 0x6c, 0x8c, 0x33, 0x59, 0x26, 0xcd, 0x7f, 0xef, 0x3e, 0x4f, + 0x55, 0xfe, 0x21, 0xf9, 0xf4, 0xf7, 0x11, 0xe8, 0x79, 0x45, 0xd5, 0x78, 0xcf, 0x9e, 0xf7, 0xd9, + 0x9f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x2b, 0x67, 0xe1, 0x07, 0x23, 0x03, 0x00, 0x00, } func (this *Plan) Equal(that interface{}) bool { From d1d03fd41e1655709e83cf4bf1b3904c093e10c1 Mon Sep 17 00:00:00 2001 From: Amaury M <1293565+amaurym@users.noreply.github.com> Date: Mon, 21 Jun 2021 12:37:12 +0200 Subject: [PATCH 09/17] Add graceful fallback for Vote.Option --- x/gov/keeper/vote.go | 7 +++++++ x/gov/keeper/vote_test.go | 4 ++++ 2 files changed, 11 insertions(+) diff --git a/x/gov/keeper/vote.go b/x/gov/keeper/vote.go index c54ce875c81f..5ad98f063864 100644 --- a/x/gov/keeper/vote.go +++ b/x/gov/keeper/vote.go @@ -68,6 +68,13 @@ func (keeper Keeper) GetVote(ctx sdk.Context, proposalID uint64, voterAddr sdk.A } keeper.cdc.MustUnmarshal(bz, &vote) + + // Graceful fallback of deprecated `Option` field, in case there's only 1 + // VoteOption. + if len(vote.Options) == 1 && vote.Options[0].Weight.Equal(sdk.MustNewDecFromStr("1.0")) { + vote.Option = vote.Options[0].Option + } + return vote, true } diff --git a/x/gov/keeper/vote_test.go b/x/gov/keeper/vote_test.go index ae6ebc4a5693..80df4671666b 100644 --- a/x/gov/keeper/vote_test.go +++ b/x/gov/keeper/vote_test.go @@ -40,6 +40,7 @@ func TestVotes(t *testing.T) { require.Equal(t, proposalID, vote.ProposalId) require.True(t, len(vote.Options) == 1) require.Equal(t, types.OptionAbstain, vote.Options[0].Option) + require.Equal(t, types.OptionAbstain, vote.Option) // Test change of vote require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, addrs[0], types.NewNonSplitVoteOption(types.OptionYes))) @@ -49,6 +50,7 @@ func TestVotes(t *testing.T) { require.Equal(t, proposalID, vote.ProposalId) require.True(t, len(vote.Options) == 1) require.Equal(t, types.OptionYes, vote.Options[0].Option) + require.Equal(t, types.OptionYes, vote.Option) // Test second vote require.NoError(t, app.GovKeeper.AddVote(ctx, proposalID, addrs[1], types.WeightedVoteOptions{ @@ -70,6 +72,7 @@ func TestVotes(t *testing.T) { require.True(t, vote.Options[1].Weight.Equal(sdk.NewDecWithPrec(30, 2))) require.True(t, vote.Options[2].Weight.Equal(sdk.NewDecWithPrec(5, 2))) require.True(t, vote.Options[3].Weight.Equal(sdk.NewDecWithPrec(5, 2))) + require.Equal(t, types.OptionEmpty, vote.Option) // Test vote iterator // NOTE order of deposits is determined by the addresses @@ -87,4 +90,5 @@ func TestVotes(t *testing.T) { require.True(t, votes[1].Options[1].Weight.Equal(sdk.NewDecWithPrec(30, 2))) require.True(t, votes[1].Options[2].Weight.Equal(sdk.NewDecWithPrec(5, 2))) require.True(t, votes[1].Options[3].Weight.Equal(sdk.NewDecWithPrec(5, 2))) + require.Equal(t, types.OptionEmpty, vote.Option) } From e89c86998e35c2fc1692a2a70832c376e6b52072 Mon Sep 17 00:00:00 2001 From: Amaury M <1293565+amaurym@users.noreply.github.com> Date: Mon, 21 Jun 2021 12:40:28 +0200 Subject: [PATCH 10/17] nolint --- x/gov/keeper/vote.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x/gov/keeper/vote.go b/x/gov/keeper/vote.go index 5ad98f063864..7f3f1ac02433 100644 --- a/x/gov/keeper/vote.go +++ b/x/gov/keeper/vote.go @@ -72,7 +72,7 @@ func (keeper Keeper) GetVote(ctx sdk.Context, proposalID uint64, voterAddr sdk.A // Graceful fallback of deprecated `Option` field, in case there's only 1 // VoteOption. if len(vote.Options) == 1 && vote.Options[0].Weight.Equal(sdk.MustNewDecFromStr("1.0")) { - vote.Option = vote.Options[0].Option + vote.Option = vote.Options[0].Option //nolint staticcheck } return vote, true From f68526b502600609750e2558dc61f1d618aaebf7 Mon Sep 17 00:00:00 2001 From: Amaury M <1293565+amaurym@users.noreply.github.com> Date: Mon, 21 Jun 2021 14:36:47 +0200 Subject: [PATCH 11/17] Fix test --- x/gov/keeper/grpc_query_test.go | 2 +- x/gov/keeper/querier_test.go | 5 ++++- x/gov/keeper/vote.go | 7 ++++++- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/x/gov/keeper/grpc_query_test.go b/x/gov/keeper/grpc_query_test.go index 7ed177192428..49505d1f6bac 100644 --- a/x/gov/keeper/grpc_query_test.go +++ b/x/gov/keeper/grpc_query_test.go @@ -298,7 +298,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryVote() { Voter: addrs[0].String(), } - expRes = &types.QueryVoteResponse{Vote: types.NewVote(proposal.ProposalId, addrs[0], types.NewNonSplitVoteOption(types.OptionAbstain))} + expRes = &types.QueryVoteResponse{Vote: types.Vote{ProposalId: proposal.ProposalId, Voter: addrs[0].String(), Option: types.OptionAbstain, Options: []types.WeightedVoteOption{{Option: types.OptionAbstain, Weight: sdk.MustNewDecFromStr("1.0")}}}} }, true, }, diff --git a/x/gov/keeper/querier_test.go b/x/gov/keeper/querier_test.go index 282f1a44c210..2f92dda28105 100644 --- a/x/gov/keeper/querier_test.go +++ b/x/gov/keeper/querier_test.go @@ -271,7 +271,10 @@ func TestQueries(t *testing.T) { require.Equal(t, vote1, votes[0]) vote := getQueriedVote(t, ctx, legacyQuerierCdc, querier, proposal2.ProposalId, TestAddrs[0]) - require.Equal(t, vote1, vote) + // vote and vote1 only differ by the fact that vote has its `Option` field populated thanks to graceful fallback in GetVote + require.Equal(t, vote1.Options, vote.Options) + require.Equal(t, vote1.Voter, vote.Voter) + require.Equal(t, vote1.ProposalId, vote.ProposalId) // Test query votes on types.Proposal 3 votes = getQueriedVotes(t, ctx, legacyQuerierCdc, querier, proposal3.ProposalId, 1, 0) diff --git a/x/gov/keeper/vote.go b/x/gov/keeper/vote.go index 7f3f1ac02433..4a98cbcf29a6 100644 --- a/x/gov/keeper/vote.go +++ b/x/gov/keeper/vote.go @@ -72,7 +72,7 @@ func (keeper Keeper) GetVote(ctx sdk.Context, proposalID uint64, voterAddr sdk.A // Graceful fallback of deprecated `Option` field, in case there's only 1 // VoteOption. if len(vote.Options) == 1 && vote.Options[0].Weight.Equal(sdk.MustNewDecFromStr("1.0")) { - vote.Option = vote.Options[0].Option //nolint staticcheck + vote.Option = vote.Options[0].Option //nolint staticcheck // Deprecated field } return vote, true @@ -80,6 +80,11 @@ func (keeper Keeper) GetVote(ctx sdk.Context, proposalID uint64, voterAddr sdk.A // SetVote sets a Vote to the gov store func (keeper Keeper) SetVote(ctx sdk.Context, vote types.Vote) { + // vote.Option is a deprecated field, we don't set it in state + if vote.Option != types.OptionEmpty { //nolint staticcheck // Deprecated field + panic(fmt.Errorf("expected empty vote.Option, got %s", vote.Option)) //nolint staticcheck // Deprecated field + } + store := ctx.KVStore(keeper.storeKey) bz := keeper.cdc.MustMarshal(&vote) addr, err := sdk.AccAddressFromBech32(vote.Voter) From 387774a2d4b83c4c2f365b233caf8739be4b4bfb Mon Sep 17 00:00:00 2001 From: Amaury M <1293565+amaurym@users.noreply.github.com> Date: Mon, 21 Jun 2021 17:21:49 +0200 Subject: [PATCH 12/17] Fix lint? --- x/gov/keeper/vote.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/x/gov/keeper/vote.go b/x/gov/keeper/vote.go index 4a98cbcf29a6..db0b37b68f03 100644 --- a/x/gov/keeper/vote.go +++ b/x/gov/keeper/vote.go @@ -72,7 +72,7 @@ func (keeper Keeper) GetVote(ctx sdk.Context, proposalID uint64, voterAddr sdk.A // Graceful fallback of deprecated `Option` field, in case there's only 1 // VoteOption. if len(vote.Options) == 1 && vote.Options[0].Weight.Equal(sdk.MustNewDecFromStr("1.0")) { - vote.Option = vote.Options[0].Option //nolint staticcheck // Deprecated field + vote.Option = vote.Options[0].Option //nolint } return vote, true @@ -81,8 +81,8 @@ func (keeper Keeper) GetVote(ctx sdk.Context, proposalID uint64, voterAddr sdk.A // SetVote sets a Vote to the gov store func (keeper Keeper) SetVote(ctx sdk.Context, vote types.Vote) { // vote.Option is a deprecated field, we don't set it in state - if vote.Option != types.OptionEmpty { //nolint staticcheck // Deprecated field - panic(fmt.Errorf("expected empty vote.Option, got %s", vote.Option)) //nolint staticcheck // Deprecated field + if vote.Option != types.OptionEmpty { //nolint + panic(fmt.Errorf("expected empty vote.Option, got %s", vote.Option)) //nolint } store := ctx.KVStore(keeper.storeKey) From 38a1756641cca2d71345cd63076b2b904b3490dc Mon Sep 17 00:00:00 2001 From: Amaury M <1293565+amaurym@users.noreply.github.com> Date: Tue, 22 Jun 2021 10:30:37 +0200 Subject: [PATCH 13/17] Populate option on all queries --- x/gov/keeper/querier_test.go | 22 +++++++++++++++------- x/gov/keeper/vote.go | 21 +++++++++++++++------ 2 files changed, 30 insertions(+), 13 deletions(-) diff --git a/x/gov/keeper/querier_test.go b/x/gov/keeper/querier_test.go index 2f92dda28105..b3cf4dfd923f 100644 --- a/x/gov/keeper/querier_test.go +++ b/x/gov/keeper/querier_test.go @@ -268,19 +268,16 @@ func TestQueries(t *testing.T) { // Test query votes on types.Proposal 2 votes := getQueriedVotes(t, ctx, legacyQuerierCdc, querier, proposal2.ProposalId, 1, 0) require.Len(t, votes, 1) - require.Equal(t, vote1, votes[0]) + checkEqualVotes(t, vote1, votes[0]) vote := getQueriedVote(t, ctx, legacyQuerierCdc, querier, proposal2.ProposalId, TestAddrs[0]) - // vote and vote1 only differ by the fact that vote has its `Option` field populated thanks to graceful fallback in GetVote - require.Equal(t, vote1.Options, vote.Options) - require.Equal(t, vote1.Voter, vote.Voter) - require.Equal(t, vote1.ProposalId, vote.ProposalId) + checkEqualVotes(t, vote1, vote) // Test query votes on types.Proposal 3 votes = getQueriedVotes(t, ctx, legacyQuerierCdc, querier, proposal3.ProposalId, 1, 0) require.Len(t, votes, 2) - require.Equal(t, vote2, votes[0]) - require.Equal(t, vote3, votes[1]) + checkEqualVotes(t, vote2, votes[0]) + checkEqualVotes(t, vote3, votes[1]) // Test query all proposals proposals = getQueriedProposals(t, ctx, legacyQuerierCdc, querier, nil, nil, types.StatusNil, 1, 0) @@ -387,3 +384,14 @@ func TestPaginatedVotesQuery(t *testing.T) { }) } } + +// checkEqualVotes checks that two votes are equal, without taking into account +// graceful fallback for `Option`. +// When querying, the keeper populates the `vote.Option` field when there's +// only 1 vote, this function checks equality of structs while skipping that +// field. +func checkEqualVotes(t *testing.T, vote1, vote2 types.Vote) { + require.Equal(t, vote1.Options, vote2.Options) + require.Equal(t, vote1.Voter, vote2.Voter) + require.Equal(t, vote1.ProposalId, vote2.ProposalId) +} diff --git a/x/gov/keeper/vote.go b/x/gov/keeper/vote.go index db0b37b68f03..81a67fe2c773 100644 --- a/x/gov/keeper/vote.go +++ b/x/gov/keeper/vote.go @@ -44,6 +44,7 @@ func (keeper Keeper) AddVote(ctx sdk.Context, proposalID uint64, voterAddr sdk.A // GetAllVotes returns all the votes from the store func (keeper Keeper) GetAllVotes(ctx sdk.Context) (votes types.Votes) { keeper.IterateAllVotes(ctx, func(vote types.Vote) bool { + vote = populateLegacyOption(vote) votes = append(votes, vote) return false }) @@ -53,6 +54,7 @@ func (keeper Keeper) GetAllVotes(ctx sdk.Context) (votes types.Votes) { // GetVotes returns all the votes from a proposal func (keeper Keeper) GetVotes(ctx sdk.Context, proposalID uint64) (votes types.Votes) { keeper.IterateVotes(ctx, proposalID, func(vote types.Vote) bool { + vote = populateLegacyOption(vote) votes = append(votes, vote) return false }) @@ -68,12 +70,7 @@ func (keeper Keeper) GetVote(ctx sdk.Context, proposalID uint64, voterAddr sdk.A } keeper.cdc.MustUnmarshal(bz, &vote) - - // Graceful fallback of deprecated `Option` field, in case there's only 1 - // VoteOption. - if len(vote.Options) == 1 && vote.Options[0].Weight.Equal(sdk.MustNewDecFromStr("1.0")) { - vote.Option = vote.Options[0].Option //nolint - } + vote = populateLegacyOption(vote) return vote, true } @@ -103,6 +100,7 @@ func (keeper Keeper) IterateAllVotes(ctx sdk.Context, cb func(vote types.Vote) ( for ; iterator.Valid(); iterator.Next() { var vote types.Vote keeper.cdc.MustUnmarshal(iterator.Value(), &vote) + vote = populateLegacyOption(vote) if cb(vote) { break @@ -119,6 +117,7 @@ func (keeper Keeper) IterateVotes(ctx sdk.Context, proposalID uint64, cb func(vo for ; iterator.Valid(); iterator.Next() { var vote types.Vote keeper.cdc.MustUnmarshal(iterator.Value(), &vote) + vote = populateLegacyOption(vote) if cb(vote) { break @@ -131,3 +130,13 @@ func (keeper Keeper) deleteVote(ctx sdk.Context, proposalID uint64, voterAddr sd store := ctx.KVStore(keeper.storeKey) store.Delete(types.VoteKey(proposalID, voterAddr)) } + +// populateLegacyOption adds graceful fallback of deprecated `Option` field, in case +// there's only 1 VoteOption. +func populateLegacyOption(vote types.Vote) types.Vote { + if len(vote.Options) == 1 && vote.Options[0].Weight.Equal(sdk.MustNewDecFromStr("1.0")) { + vote.Option = vote.Options[0].Option //nolint + } + + return vote +} From 1a0dcd42c8ba61dbd7863a27921995c272591a70 Mon Sep 17 00:00:00 2001 From: Amaury M <1293565+amaurym@users.noreply.github.com> Date: Tue, 22 Jun 2021 10:47:31 +0200 Subject: [PATCH 14/17] Update comments in proto --- docs/core/proto-docs.md | 2 +- proto/cosmos/gov/v1beta1/gov.proto | 6 +++--- x/gov/types/gov.pb.go | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/core/proto-docs.md b/docs/core/proto-docs.md index 583b06dfe68e..c4e33fd6d37b 100644 --- a/docs/core/proto-docs.md +++ b/docs/core/proto-docs.md @@ -4987,7 +4987,7 @@ A Vote consists of a proposal ID, the voter, and the vote option. | ----- | ---- | ----- | ----------- | | `proposal_id` | [uint64](#uint64) | | | | `voter` | [string](#string) | | | -| `option` | [VoteOption](#cosmos.gov.v1beta1.VoteOption) | | **Deprecated.** Deprecated: Prefer to use `options` instead. If this field is set, the VoteOption will be converted into a WeightedVoteOption with weight 1. | +| `option` | [VoteOption](#cosmos.gov.v1beta1.VoteOption) | | **Deprecated.** Deprecated: Prefer to use `options` instead. This field is set in queries if an only if `len(options) == 1` and that option has weight 1. In all other cases, this field will default to OptionEmpty. | | `options` | [WeightedVoteOption](#cosmos.gov.v1beta1.WeightedVoteOption) | repeated | | diff --git a/proto/cosmos/gov/v1beta1/gov.proto b/proto/cosmos/gov/v1beta1/gov.proto index 12ed66e2ab71..c4cf72ce35a3 100644 --- a/proto/cosmos/gov/v1beta1/gov.proto +++ b/proto/cosmos/gov/v1beta1/gov.proto @@ -131,9 +131,9 @@ message Vote { uint64 proposal_id = 1 [(gogoproto.moretags) = "yaml:\"proposal_id\""]; string voter = 2; - // Deprecated: Prefer to use `options` instead. If this field is set, - // the VoteOption will be converted into a WeightedVoteOption with - // weight 1. + // Deprecated: Prefer to use `options` instead. This field is set in queries + // if an only if `len(options) == 1` and that option has weight 1. In all + // other cases, this field will default to OptionEmpty. VoteOption option = 3 [deprecated = true]; repeated WeightedVoteOption options = 4 [(gogoproto.nullable) = false]; } diff --git a/x/gov/types/gov.pb.go b/x/gov/types/gov.pb.go index 43b95b6a5ee2..013c0fa730fb 100644 --- a/x/gov/types/gov.pb.go +++ b/x/gov/types/gov.pb.go @@ -328,9 +328,9 @@ var xxx_messageInfo_TallyResult proto.InternalMessageInfo type Vote struct { ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty" yaml:"proposal_id"` Voter string `protobuf:"bytes,2,opt,name=voter,proto3" json:"voter,omitempty"` - // Deprecated: Prefer to use `options` instead. If this field is set, - // the VoteOption will be converted into a WeightedVoteOption with - // weight 1. + // Deprecated: Prefer to use `options` instead. This field is set in queries + // if an only if `len(options) == 1` and that option has weight 1. In all + // other cases, this field will default to OptionEmpty. Option VoteOption `protobuf:"varint,3,opt,name=option,proto3,enum=cosmos.gov.v1beta1.VoteOption" json:"option,omitempty"` // Deprecated: Do not use. Options []WeightedVoteOption `protobuf:"bytes,4,rep,name=options,proto3" json:"options"` } From 429ed40cf9c217e7ec3f189890dc7ad955962a9c Mon Sep 17 00:00:00 2001 From: Amaury M <1293565+amaurym@users.noreply.github.com> Date: Tue, 22 Jun 2021 13:26:57 +0200 Subject: [PATCH 15/17] Use pointer --- x/gov/keeper/vote.go | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/x/gov/keeper/vote.go b/x/gov/keeper/vote.go index 81a67fe2c773..5368b9dc2085 100644 --- a/x/gov/keeper/vote.go +++ b/x/gov/keeper/vote.go @@ -44,7 +44,7 @@ func (keeper Keeper) AddVote(ctx sdk.Context, proposalID uint64, voterAddr sdk.A // GetAllVotes returns all the votes from the store func (keeper Keeper) GetAllVotes(ctx sdk.Context) (votes types.Votes) { keeper.IterateAllVotes(ctx, func(vote types.Vote) bool { - vote = populateLegacyOption(vote) + populateLegacyOption(&vote) votes = append(votes, vote) return false }) @@ -54,7 +54,7 @@ func (keeper Keeper) GetAllVotes(ctx sdk.Context) (votes types.Votes) { // GetVotes returns all the votes from a proposal func (keeper Keeper) GetVotes(ctx sdk.Context, proposalID uint64) (votes types.Votes) { keeper.IterateVotes(ctx, proposalID, func(vote types.Vote) bool { - vote = populateLegacyOption(vote) + populateLegacyOption(&vote) votes = append(votes, vote) return false }) @@ -70,7 +70,7 @@ func (keeper Keeper) GetVote(ctx sdk.Context, proposalID uint64, voterAddr sdk.A } keeper.cdc.MustUnmarshal(bz, &vote) - vote = populateLegacyOption(vote) + populateLegacyOption(&vote) return vote, true } @@ -100,7 +100,7 @@ func (keeper Keeper) IterateAllVotes(ctx sdk.Context, cb func(vote types.Vote) ( for ; iterator.Valid(); iterator.Next() { var vote types.Vote keeper.cdc.MustUnmarshal(iterator.Value(), &vote) - vote = populateLegacyOption(vote) + populateLegacyOption(&vote) if cb(vote) { break @@ -117,7 +117,7 @@ func (keeper Keeper) IterateVotes(ctx sdk.Context, proposalID uint64, cb func(vo for ; iterator.Valid(); iterator.Next() { var vote types.Vote keeper.cdc.MustUnmarshal(iterator.Value(), &vote) - vote = populateLegacyOption(vote) + populateLegacyOption(&vote) if cb(vote) { break @@ -133,10 +133,8 @@ func (keeper Keeper) deleteVote(ctx sdk.Context, proposalID uint64, voterAddr sd // populateLegacyOption adds graceful fallback of deprecated `Option` field, in case // there's only 1 VoteOption. -func populateLegacyOption(vote types.Vote) types.Vote { +func populateLegacyOption(vote *types.Vote) { if len(vote.Options) == 1 && vote.Options[0].Weight.Equal(sdk.MustNewDecFromStr("1.0")) { vote.Option = vote.Options[0].Option //nolint } - - return vote } From 4d960dd463a1bc633e17c4fd1edb480c1c0c5676 Mon Sep 17 00:00:00 2001 From: Amaury M <1293565+amaurym@users.noreply.github.com> Date: Tue, 22 Jun 2021 13:34:11 +0200 Subject: [PATCH 16/17] Fix sims, remove panic in SetVote --- x/gov/keeper/vote.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x/gov/keeper/vote.go b/x/gov/keeper/vote.go index 5368b9dc2085..cb58c95da5ed 100644 --- a/x/gov/keeper/vote.go +++ b/x/gov/keeper/vote.go @@ -79,7 +79,7 @@ func (keeper Keeper) GetVote(ctx sdk.Context, proposalID uint64, voterAddr sdk.A func (keeper Keeper) SetVote(ctx sdk.Context, vote types.Vote) { // vote.Option is a deprecated field, we don't set it in state if vote.Option != types.OptionEmpty { //nolint - panic(fmt.Errorf("expected empty vote.Option, got %s", vote.Option)) //nolint + vote.Option = types.OptionEmpty //nolint } store := ctx.KVStore(keeper.storeKey) From b08a3ff04d424d168ce610f88921c5f8cb74dd5a Mon Sep 17 00:00:00 2001 From: Amaury <1293565+amaurym@users.noreply.github.com> Date: Wed, 23 Jun 2021 10:33:15 +0200 Subject: [PATCH 17/17] Update proto/cosmos/gov/v1beta1/gov.proto Co-authored-by: likhita-809 <78951027+likhita-809@users.noreply.github.com> --- proto/cosmos/gov/v1beta1/gov.proto | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proto/cosmos/gov/v1beta1/gov.proto b/proto/cosmos/gov/v1beta1/gov.proto index c4cf72ce35a3..b38c14d06cc8 100644 --- a/proto/cosmos/gov/v1beta1/gov.proto +++ b/proto/cosmos/gov/v1beta1/gov.proto @@ -132,7 +132,7 @@ message Vote { uint64 proposal_id = 1 [(gogoproto.moretags) = "yaml:\"proposal_id\""]; string voter = 2; // Deprecated: Prefer to use `options` instead. This field is set in queries - // if an only if `len(options) == 1` and that option has weight 1. In all + // if and only if `len(options) == 1` and that option has weight 1. In all // other cases, this field will default to OptionEmpty. VoteOption option = 3 [deprecated = true]; repeated WeightedVoteOption options = 4 [(gogoproto.nullable) = false];