From 52c7188a32e3578ce1d21f4d98e195b5bd7b911f Mon Sep 17 00:00:00 2001 From: Yilun Date: Wed, 7 Oct 2020 15:12:33 -0700 Subject: [PATCH] Change subscribe meta internal type from string to bytes Protobuf bytes and string have the same encoding but different restrictions: string can now only contain utf-8 characters. However, the current chain data contains non-utf-8 string in meta generated using old pb version, which will cause new version fail to save certain blocks. Changing internal type to bytes will resolve the issue without breaking compatibility. Signed-off-by: Yilun --- chain/bvs.go | 2 +- chain/store/stateGenerator.go | 4 +- pb/transaction.go | 2 +- pb/transaction.pb.go | 86 +++++++++++++++++------------------ pb/transaction.proto | 2 +- transaction/payload.go | 2 +- 6 files changed, 49 insertions(+), 49 deletions(-) diff --git a/chain/bvs.go b/chain/bvs.go index 283fbe37b..00a076410 100644 --- a/chain/bvs.go +++ b/chain/bvs.go @@ -247,7 +247,7 @@ func (bvs *BlockValidationState) VerifyTransactionWithBlock(txn *transaction.Tra defer func() { if e == nil { bvs.addChange(func() { - bvs.subscriptions[key] = subscriptionInfo{new: !subscribed, meta: subscribePayload.Meta} + bvs.subscriptions[key] = subscriptionInfo{new: !subscribed, meta: string(subscribePayload.Meta)} }) } }() diff --git a/chain/store/stateGenerator.go b/chain/store/stateGenerator.go index a2a3524a2..416fc8f2f 100644 --- a/chain/store/stateGenerator.go +++ b/chain/store/stateGenerator.go @@ -8,11 +8,11 @@ import ( "github.com/nknorg/nkn/v2/block" "github.com/nknorg/nkn/v2/chain" "github.com/nknorg/nkn/v2/common" + "github.com/nknorg/nkn/v2/config" "github.com/nknorg/nkn/v2/crypto" "github.com/nknorg/nkn/v2/pb" "github.com/nknorg/nkn/v2/program" "github.com/nknorg/nkn/v2/transaction" - "github.com/nknorg/nkn/v2/config" ) func (cs *ChainStore) spendTransaction(states *StateDB, txn *transaction.Transaction, totalFee common.Fixed64, genesis bool, height uint32) error { @@ -123,7 +123,7 @@ func (cs *ChainStore) spendTransaction(states *StateDB, txn *transaction.Transac } case pb.PayloadType_SUBSCRIBE_TYPE: subscribePayload := pl.(*pb.Subscribe) - if err = states.subscribe(subscribePayload.Topic, subscribePayload.Bucket, subscribePayload.Subscriber, subscribePayload.Identifier, subscribePayload.Meta, height+subscribePayload.Duration); err != nil { + if err = states.subscribe(subscribePayload.Topic, subscribePayload.Bucket, subscribePayload.Subscriber, subscribePayload.Identifier, string(subscribePayload.Meta), height+subscribePayload.Duration); err != nil { return err } case pb.PayloadType_UNSUBSCRIBE_TYPE: diff --git a/pb/transaction.go b/pb/transaction.go index d59441925..dd50f8d84 100644 --- a/pb/transaction.go +++ b/pb/transaction.go @@ -111,7 +111,7 @@ func (m *Subscribe) ToMap() map[string]interface{} { "topic": m.Topic, "bucket": m.Bucket, "duration": m.Duration, - "meta": m.Meta, + "meta": string(m.Meta), } } diff --git a/pb/transaction.pb.go b/pb/transaction.pb.go index 40a5d7fd8..24ecaf9aa 100644 --- a/pb/transaction.pb.go +++ b/pb/transaction.pb.go @@ -65,7 +65,7 @@ func (x PayloadType) String() string { return proto.EnumName(PayloadType_name, int32(x)) } func (PayloadType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_transaction_dee487b0d08e39df, []int{0} + return fileDescriptor_transaction_91398bc3e512953f, []int{0} } type UnsignedTx struct { @@ -82,7 +82,7 @@ func (m *UnsignedTx) Reset() { *m = UnsignedTx{} } func (m *UnsignedTx) String() string { return proto.CompactTextString(m) } func (*UnsignedTx) ProtoMessage() {} func (*UnsignedTx) Descriptor() ([]byte, []int) { - return fileDescriptor_transaction_dee487b0d08e39df, []int{0} + return fileDescriptor_transaction_91398bc3e512953f, []int{0} } func (m *UnsignedTx) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_UnsignedTx.Unmarshal(m, b) @@ -142,7 +142,7 @@ func (m *Transaction) Reset() { *m = Transaction{} } func (m *Transaction) String() string { return proto.CompactTextString(m) } func (*Transaction) ProtoMessage() {} func (*Transaction) Descriptor() ([]byte, []int) { - return fileDescriptor_transaction_dee487b0d08e39df, []int{1} + return fileDescriptor_transaction_91398bc3e512953f, []int{1} } func (m *Transaction) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_Transaction.Unmarshal(m, b) @@ -188,7 +188,7 @@ func (m *Program) Reset() { *m = Program{} } func (m *Program) String() string { return proto.CompactTextString(m) } func (*Program) ProtoMessage() {} func (*Program) Descriptor() ([]byte, []int) { - return fileDescriptor_transaction_dee487b0d08e39df, []int{2} + return fileDescriptor_transaction_91398bc3e512953f, []int{2} } func (m *Program) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_Program.Unmarshal(m, b) @@ -234,7 +234,7 @@ func (m *Payload) Reset() { *m = Payload{} } func (m *Payload) String() string { return proto.CompactTextString(m) } func (*Payload) ProtoMessage() {} func (*Payload) Descriptor() ([]byte, []int) { - return fileDescriptor_transaction_dee487b0d08e39df, []int{3} + return fileDescriptor_transaction_91398bc3e512953f, []int{3} } func (m *Payload) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_Payload.Unmarshal(m, b) @@ -281,7 +281,7 @@ func (m *Coinbase) Reset() { *m = Coinbase{} } func (m *Coinbase) String() string { return proto.CompactTextString(m) } func (*Coinbase) ProtoMessage() {} func (*Coinbase) Descriptor() ([]byte, []int) { - return fileDescriptor_transaction_dee487b0d08e39df, []int{4} + return fileDescriptor_transaction_91398bc3e512953f, []int{4} } func (m *Coinbase) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_Coinbase.Unmarshal(m, b) @@ -334,7 +334,7 @@ func (m *SigChainTxn) Reset() { *m = SigChainTxn{} } func (m *SigChainTxn) String() string { return proto.CompactTextString(m) } func (*SigChainTxn) ProtoMessage() {} func (*SigChainTxn) Descriptor() ([]byte, []int) { - return fileDescriptor_transaction_dee487b0d08e39df, []int{5} + return fileDescriptor_transaction_91398bc3e512953f, []int{5} } func (m *SigChainTxn) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_SigChainTxn.Unmarshal(m, b) @@ -381,7 +381,7 @@ func (m *RegisterName) Reset() { *m = RegisterName{} } func (m *RegisterName) String() string { return proto.CompactTextString(m) } func (*RegisterName) ProtoMessage() {} func (*RegisterName) Descriptor() ([]byte, []int) { - return fileDescriptor_transaction_dee487b0d08e39df, []int{6} + return fileDescriptor_transaction_91398bc3e512953f, []int{6} } func (m *RegisterName) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_RegisterName.Unmarshal(m, b) @@ -435,7 +435,7 @@ func (m *TransferName) Reset() { *m = TransferName{} } func (m *TransferName) String() string { return proto.CompactTextString(m) } func (*TransferName) ProtoMessage() {} func (*TransferName) Descriptor() ([]byte, []int) { - return fileDescriptor_transaction_dee487b0d08e39df, []int{7} + return fileDescriptor_transaction_91398bc3e512953f, []int{7} } func (m *TransferName) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_TransferName.Unmarshal(m, b) @@ -488,7 +488,7 @@ func (m *DeleteName) Reset() { *m = DeleteName{} } func (m *DeleteName) String() string { return proto.CompactTextString(m) } func (*DeleteName) ProtoMessage() {} func (*DeleteName) Descriptor() ([]byte, []int) { - return fileDescriptor_transaction_dee487b0d08e39df, []int{8} + return fileDescriptor_transaction_91398bc3e512953f, []int{8} } func (m *DeleteName) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_DeleteName.Unmarshal(m, b) @@ -528,7 +528,7 @@ type Subscribe struct { Topic string `protobuf:"bytes,3,opt,name=topic,proto3" json:"topic,omitempty"` Bucket uint32 `protobuf:"varint,4,opt,name=bucket,proto3" json:"bucket,omitempty"` // Deprecated: Do not use. Duration uint32 `protobuf:"varint,5,opt,name=duration,proto3" json:"duration,omitempty"` - Meta string `protobuf:"bytes,6,opt,name=meta,proto3" json:"meta,omitempty"` + Meta []byte `protobuf:"bytes,6,opt,name=meta,proto3" json:"meta,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -538,7 +538,7 @@ func (m *Subscribe) Reset() { *m = Subscribe{} } func (m *Subscribe) String() string { return proto.CompactTextString(m) } func (*Subscribe) ProtoMessage() {} func (*Subscribe) Descriptor() ([]byte, []int) { - return fileDescriptor_transaction_dee487b0d08e39df, []int{9} + return fileDescriptor_transaction_91398bc3e512953f, []int{9} } func (m *Subscribe) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_Subscribe.Unmarshal(m, b) @@ -594,11 +594,11 @@ func (m *Subscribe) GetDuration() uint32 { return 0 } -func (m *Subscribe) GetMeta() string { +func (m *Subscribe) GetMeta() []byte { if m != nil { return m.Meta } - return "" + return nil } type Unsubscribe struct { @@ -614,7 +614,7 @@ func (m *Unsubscribe) Reset() { *m = Unsubscribe{} } func (m *Unsubscribe) String() string { return proto.CompactTextString(m) } func (*Unsubscribe) ProtoMessage() {} func (*Unsubscribe) Descriptor() ([]byte, []int) { - return fileDescriptor_transaction_dee487b0d08e39df, []int{10} + return fileDescriptor_transaction_91398bc3e512953f, []int{10} } func (m *Unsubscribe) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_Unsubscribe.Unmarshal(m, b) @@ -668,7 +668,7 @@ func (m *TransferAsset) Reset() { *m = TransferAsset{} } func (m *TransferAsset) String() string { return proto.CompactTextString(m) } func (*TransferAsset) ProtoMessage() {} func (*TransferAsset) Descriptor() ([]byte, []int) { - return fileDescriptor_transaction_dee487b0d08e39df, []int{11} + return fileDescriptor_transaction_91398bc3e512953f, []int{11} } func (m *TransferAsset) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_TransferAsset.Unmarshal(m, b) @@ -721,7 +721,7 @@ func (m *GenerateID) Reset() { *m = GenerateID{} } func (m *GenerateID) String() string { return proto.CompactTextString(m) } func (*GenerateID) ProtoMessage() {} func (*GenerateID) Descriptor() ([]byte, []int) { - return fileDescriptor_transaction_dee487b0d08e39df, []int{12} + return fileDescriptor_transaction_91398bc3e512953f, []int{12} } func (m *GenerateID) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GenerateID.Unmarshal(m, b) @@ -771,7 +771,7 @@ func (m *NanoPay) Reset() { *m = NanoPay{} } func (m *NanoPay) String() string { return proto.CompactTextString(m) } func (*NanoPay) ProtoMessage() {} func (*NanoPay) Descriptor() ([]byte, []int) { - return fileDescriptor_transaction_dee487b0d08e39df, []int{13} + return fileDescriptor_transaction_91398bc3e512953f, []int{13} } func (m *NanoPay) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_NanoPay.Unmarshal(m, b) @@ -848,7 +848,7 @@ func (m *IssueAsset) Reset() { *m = IssueAsset{} } func (m *IssueAsset) String() string { return proto.CompactTextString(m) } func (*IssueAsset) ProtoMessage() {} func (*IssueAsset) Descriptor() ([]byte, []int) { - return fileDescriptor_transaction_dee487b0d08e39df, []int{14} + return fileDescriptor_transaction_91398bc3e512953f, []int{14} } func (m *IssueAsset) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_IssueAsset.Unmarshal(m, b) @@ -922,10 +922,10 @@ func init() { proto.RegisterEnum("pb.PayloadType", PayloadType_name, PayloadType_value) } -func init() { proto.RegisterFile("pb/transaction.proto", fileDescriptor_transaction_dee487b0d08e39df) } +func init() { proto.RegisterFile("pb/transaction.proto", fileDescriptor_transaction_91398bc3e512953f) } -var fileDescriptor_transaction_dee487b0d08e39df = []byte{ - // 833 bytes of a gzipped FileDescriptorProto +var fileDescriptor_transaction_91398bc3e512953f = []byte{ + // 834 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x95, 0xdd, 0x8e, 0xdb, 0x44, 0x14, 0xc7, 0xb1, 0x93, 0xcd, 0xc7, 0x49, 0x36, 0xdd, 0x4e, 0x57, 0x25, 0x2a, 0x1f, 0x0a, 0x46, 0x15, 0x0b, 0x17, 0x5b, 0xa9, 0x5c, 0x72, 0x43, 0x92, 0x75, 0xb7, 0x16, 0xe0, 0xae, 0xc6, 0x0e, @@ -958,25 +958,25 @@ var fileDescriptor_transaction_dee487b0d08e39df = []byte{ 0x7f, 0xc7, 0xb8, 0x43, 0xd4, 0xb3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 0xd5, 0x32, 0x70, 0xa3, 0xf0, 0xcd, 0x8d, 0x7b, 0xf6, 0x11, 0xfa, + 0x18, 0x1e, 0x85, 0x78, 0xe9, 0x07, 0x2f, 0x5c, 0x1c, 0x2d, 0x83, 0xc0, 0x0d, 0x1b, 0x87, 0x85, + 0x1e, 0x03, 0x0a, 0xbc, 0xeb, 0x68, 0xfd, 0x72, 0xe9, 0xf9, 0x51, 0xf8, 0xda, 0x6f, 0xb8, 0xad, + 0x38, 0x76, 0xaf, 0xbd, 0x20, 0x74, 0x71, 0xe4, 0x2f, 0x7f, 0x32, 0x89, 0x7a, 0x8a, 0x1f, 0x13, + 0xb5, 0xbc, 0x8f, 0xce, 0xe1, 0xec, 0xca, 0xfd, 0xd1, 0x0d, 0xdd, 0x0e, 0x3d, 0x41, 0x08, 0x66, + 0xc1, 0x66, 0x15, 0xac, 0xb1, 0xb7, 0x32, 0x6c, 0xa0, 0x22, 0x37, 0xfe, 0x3b, 0x74, 0xa8, 0xe8, + 0xb5, 0xeb, 0xbb, 0x78, 0x19, 0xba, 0x91, 0x77, 0xd5, 0xd0, 0x91, 0xaa, 0xc4, 0x5f, 0xfa, 0xaf, + 0xa2, 0x9b, 0xe5, 0x9b, 0x06, 0x8d, 0x55, 0xa0, 0x17, 0x04, 0x1b, 0xb7, 0x5b, 0x06, 0xc4, 0x03, + 0xfd, 0x67, 0xfa, 0xed, 0x3f, 0x01, 0x00, 0x00, 0xff, 0xff, 0xfd, 0x9c, 0xb8, 0xa5, 0x64, 0x07, + 0x00, 0x00, } diff --git a/pb/transaction.proto b/pb/transaction.proto index e92004cd2..330d224ec 100644 --- a/pb/transaction.proto +++ b/pb/transaction.proto @@ -72,7 +72,7 @@ message Subscribe { string topic = 3; uint32 bucket = 4 [deprecated = true]; uint32 duration = 5; - string meta = 6; + bytes meta = 6; } message Unsubscribe { diff --git a/transaction/payload.go b/transaction/payload.go index 4db34e4ec..36eb8eae2 100644 --- a/transaction/payload.go +++ b/transaction/payload.go @@ -105,7 +105,7 @@ func NewSubscribe(subscriber []byte, id, topic string, duration uint32, meta str Identifier: id, Topic: topic, Duration: duration, - Meta: meta, + Meta: []byte(meta), } }