Proto Tx with Any (#7276)

* WIP on protobuf keys

* Use Type() and Bytes() in sr25519 pub key Equals

* Add tests

* Add few more tests

* Update other pub/priv key types Equals

* Fix PrivKey's Sign method

* Rename variables in tests

* Fix infinite recursive calls

* Use tm ed25519 keys

* Add Sign and VerifySignature tests

* Remove ed25519 and sr25519 references

* proto linting

* Add proto crypto file

* Implement some of the new multisig proto type methods

* Add tests for MultisigThresholdPubKey

* Add tests for pubkey pb/amino conversion functions

* Move crypto types.go and register new proto pubkeys

* Add missing pointer ref

* Address review comments

* panic in MultisigThresholdPubKey VerifySignature

* Use internal crypto.PubKey in multisig

* Add tests for MultisigThresholdPubKey VerifyMultisignature

* Only keep LegacyAminoMultisigThresholdPubKey and move to proto keys to v1

* Remove conversion functions and introduce internal PubKey type

* Override Amino marshaling for proto pubkeys

* Merge master

* Make proto-gen

* Start removal of old PubKeyMultisigThreshold references

* Fix tests

* Fix solomachine

* Fix ante handler tests

* Pull latest go-amino

* Remove ed25519

* Remove old secp256k1 PubKey and PrivKey

* Uncomment test case

* Fix linting issues

* More linting

* Revert tests keys values

* Add Amino overrides to proto keys

* Add pubkey test

* Fix tests

* Use threshold isntead of K

* Standardize Type

* Revert standardize types commit

* Fix build

* Fix lint

* Fix lint

* Add comment

* Register crypto.PubKey

* Add empty key in BuildSimTx

* Simplify proto names

* Unpack interfaces for signing desc

* Fix IBC tests?

* Format proto

* Use secp256k1 in ibc

* Fixed merge issues

* Uncomment tests

* Update x/ibc/testing/solomachine.go

* UnpackInterfaces for solomachine types

* Remove old multisig

* Add amino marshal for multisig

* Fix lint

* Correctly register amino

* One test left!

* Remove old struct

* Fix test

* Fix test

* Unpack into tmcrypto

* Remove old threshold pubkey tests

* Fix register amino

* Fix lint

* Use sdk crypto PubKey in multisig UnpackInterfaces

* Potential fix?

* Register LegacyAminoPubKey

* Register our own PubKey

* Register tmcrypto PubKey

* Register both PubKeys

* Register interfaces in test

* Refactor fiels

* Add comments

* Use anil's suggestion

* Add norace back

* Check nil

* Address comments

* FIx lint

* Add tests for solomachine unpack interfaces

* Fix query tx by hash

* Better name in amino register

* Display StdTx instead of proto Tx

* Remove useless check

Co-authored-by: Aaron Craelius <aaronc@users.noreply.github.com>
Co-authored-by: blushi <marie.gauthier63@gmail.com>
Co-authored-by: Alexander Bezobchuk <alexanderbez@users.noreply.github.com>
Co-authored-by: colin axnér <25233464+colin-axner@users.noreply.github.com>
This commit is contained in:
Amaury Martiny
2020-09-21 16:48:28 +00:00
committed by GitHub
co-authored by Aaron Craelius blushi Alexander Bezobchuk colin axnér
parent 535510be1f
commit 7cd25abb87
42 changed files with 584 additions and 619 deletions
+21
View File
@@ -3,6 +3,7 @@ package signing
import (
"fmt"
codectypes "github.com/cosmos/cosmos-sdk/codec/types"
"github.com/tendermint/tendermint/crypto"
)
@@ -84,3 +85,23 @@ func SignatureDataFromProto(descData *SignatureDescriptor_Data) SignatureData {
panic(fmt.Errorf("unexpected case %+v", descData))
}
}
var _, _ codectypes.UnpackInterfacesMessage = &SignatureDescriptors{}, &SignatureDescriptor{}
// UnpackInterfaces implements the UnpackInterfaceMessages.UnpackInterfaces method
func (sds *SignatureDescriptors) UnpackInterfaces(unpacker codectypes.AnyUnpacker) error {
for _, sig := range sds.Signatures {
err := sig.UnpackInterfaces(unpacker)
if err != nil {
return err
}
}
return nil
}
// UnpackInterfaces implements the UnpackInterfaceMessages.UnpackInterfaces method
func (sd *SignatureDescriptor) UnpackInterfaces(unpacker codectypes.AnyUnpacker) error {
return unpacker.UnpackAny(sd.PublicKey, new(crypto.PubKey))
}
+42 -40
View File
@@ -5,7 +5,8 @@ package signing
import (
fmt "fmt"
types "github.com/cosmos/cosmos-sdk/crypto/types"
types "github.com/cosmos/cosmos-sdk/codec/types"
types1 "github.com/cosmos/cosmos-sdk/crypto/types"
proto "github.com/gogo/protobuf/proto"
io "io"
math "math"
@@ -113,7 +114,7 @@ func (m *SignatureDescriptors) GetSignatures() []*SignatureDescriptor {
// itself. It is primarily used for coordinating signatures between clients.
type SignatureDescriptor struct {
// public_key is the public key of the signer
PublicKey *types.PublicKey `protobuf:"bytes,1,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"`
PublicKey *types.Any `protobuf:"bytes,1,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"`
Data *SignatureDescriptor_Data `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"`
// sequence is the sequence of the account, which describes the
// number of committed transactions signed by a given address. It is used to prevent
@@ -154,7 +155,7 @@ func (m *SignatureDescriptor) XXX_DiscardUnknown() {
var xxx_messageInfo_SignatureDescriptor proto.InternalMessageInfo
func (m *SignatureDescriptor) GetPublicKey() *types.PublicKey {
func (m *SignatureDescriptor) GetPublicKey() *types.Any {
if m != nil {
return m.PublicKey
}
@@ -321,7 +322,7 @@ func (m *SignatureDescriptor_Data_Single) GetSignature() []byte {
// Multi is the signature data for a multisig public key
type SignatureDescriptor_Data_Multi struct {
// bitarray specifies which keys within the multisig are signing
Bitarray *types.CompactBitArray `protobuf:"bytes,1,opt,name=bitarray,proto3" json:"bitarray,omitempty"`
Bitarray *types1.CompactBitArray `protobuf:"bytes,1,opt,name=bitarray,proto3" json:"bitarray,omitempty"`
// signatures is the signatures of the multi-signature
Signatures []*SignatureDescriptor_Data `protobuf:"bytes,2,rep,name=signatures,proto3" json:"signatures,omitempty"`
}
@@ -359,7 +360,7 @@ func (m *SignatureDescriptor_Data_Multi) XXX_DiscardUnknown() {
var xxx_messageInfo_SignatureDescriptor_Data_Multi proto.InternalMessageInfo
func (m *SignatureDescriptor_Data_Multi) GetBitarray() *types.CompactBitArray {
func (m *SignatureDescriptor_Data_Multi) GetBitarray() *types1.CompactBitArray {
if m != nil {
return m.Bitarray
}
@@ -387,40 +388,41 @@ func init() {
}
var fileDescriptor_9a54958ff3d0b1b9 = []byte{
// 525 bytes of a gzipped FileDescriptorProto
// 543 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x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 0x56, 0xbb, 0x83, 0x17, 0x03, 0xb5, 0x57, 0x16, 0x50, 0x05,
0xca, 0xeb, 0x52, 0x6f, 0xa0, 0xa9, 0xdd, 0x49, 0x59, 0x44, 0x87, 0x70, 0x67, 0x9d, 0x9d, 0xa8,
0x6f, 0x27, 0xe7, 0xed, 0xb3, 0xf2, 0x0e, 0x7a, 0x00, 0xf7, 0xd6, 0xe9, 0x33, 0xb5, 0xdf, 0xee,
0xbe, 0x33, 0xda, 0xc3, 0xc1, 0x68, 0x6c, 0xbc, 0xd4, 0xc7, 0xa3, 0xf2, 0xe7, 0x4e, 0xff, 0xfb,
0x5c, 0x16, 0xaf, 0xe7, 0xb2, 0xf8, 0x73, 0x2e, 0x8b, 0x5f, 0x16, 0xb2, 0x70, 0xbd, 0x90, 0x85,
0x1f, 0x0b, 0x59, 0x78, 0x7f, 0xec, 0xb8, 0xfc, 0x43, 0x64, 0x61, 0x9b, 0x7a, 0x4a, 0xf6, 0xcf,
0x4d, 0x7f, 0x8e, 0xd9, 0xf4, 0x52, 0xe1, 0x71, 0x40, 0x36, 0x3f, 0x07, 0xd6, 0x5e, 0x72, 0xfd,
0xad, 0xdf, 0x01, 0x00, 0x00, 0xff, 0xff, 0xd1, 0x38, 0x12, 0x3c, 0x2a, 0x04, 0x00, 0x00,
}
func (m *SignatureDescriptors) Marshal() (dAtA []byte, err error) {
@@ -939,7 +941,7 @@ func (m *SignatureDescriptor) Unmarshal(dAtA []byte) error {
return io.ErrUnexpectedEOF
}
if m.PublicKey == nil {
m.PublicKey = &types.PublicKey{}
m.PublicKey = &types.Any{}
}
if err := m.PublicKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
@@ -1312,7 +1314,7 @@ func (m *SignatureDescriptor_Data_Multi) Unmarshal(dAtA []byte) error {
return io.ErrUnexpectedEOF
}
if m.Bitarray == nil {
m.Bitarray = &types.CompactBitArray{}
m.Bitarray = &types1.CompactBitArray{}
}
if err := m.Bitarray.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
+55 -55
View File
@@ -394,7 +394,7 @@ type SignerInfo struct {
// public_key is the public key of the signer. It is optional for accounts
// that already exist in state. If unset, the verifier can use the required \
// signer address for this position and lookup the public key.
PublicKey *types1.PublicKey `protobuf:"bytes,1,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"`
PublicKey *types.Any `protobuf:"bytes,1,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"`
// mode_info describes the signing mode of the signer and is a nested
// structure to support nested multisig pubkey's
ModeInfo *ModeInfo `protobuf:"bytes,2,opt,name=mode_info,json=modeInfo,proto3" json:"mode_info,omitempty"`
@@ -437,7 +437,7 @@ func (m *SignerInfo) XXX_DiscardUnknown() {
var xxx_messageInfo_SignerInfo proto.InternalMessageInfo
func (m *SignerInfo) GetPublicKey() *types1.PublicKey {
func (m *SignerInfo) GetPublicKey() *types.Any {
if m != nil {
return m.PublicKey
}
@@ -724,59 +724,59 @@ func init() {
func init() { proto.RegisterFile("cosmos/tx/v1beta1/tx.proto", fileDescriptor_96d1575ffde80842) }
var fileDescriptor_96d1575ffde80842 = []byte{
// 823 bytes of a gzipped FileDescriptorProto
// 817 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x54, 0x4f, 0x6f, 0xdc, 0x44,
0x14, 0x5f, 0xef, 0x6e, 0x36, 0xde, 0x97, 0xa4, 0xa5, 0xa3, 0x0a, 0x6d, 0x36, 0xaa, 0x1b, 0x8c,
0x02, 0x2b, 0xa1, 0xda, 0x6d, 0x38, 0xf0, 0x47, 0x48, 0x90, 0x6d, 0x29, 0xa9, 0xa0, 0x80, 0x26,
0x39, 0xf5, 0x62, 0x8d, 0xbd, 0x13, 0xef, 0xa8, 0xeb, 0x99, 0xc5, 0x33, 0x2e, 0xf6, 0x27, 0xe0,
0x02, 0x12, 0x42, 0xe2, 0x3b, 0x20, 0x3e, 0x49, 0x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 0xf5,
0xe7, 0xae, 0x9c, 0x3e, 0x8b, 0xd4, 0x72, 0x41, 0xa5, 0x21, 0x48, 0x6c, 0xa5, 0xd1, 0x1e, 0x0c,
0x32, 0x22, 0xe3, 0x39, 0xcb, 0x99, 0x32, 0x4d, 0xe8, 0x61, 0x2f, 0x23, 0xf2, 0x2b, 0x6d, 0x4f,
0x3e, 0x79, 0x71, 0xe6, 0x3b, 0x2f, 0xcf, 0x7c, 0xe7, 0xef, 0x33, 0xdf, 0xf9, 0xe9, 0xdc, 0xef,
0xbc, 0x3c, 0xf7, 0x3b, 0xbf, 0x9f, 0xfb, 0x9d, 0xa7, 0x77, 0xd6, 0x07, 0x8a, 0x54, 0x95, 0xf4,
0xcd, 0x60, 0x3e, 0xf8, 0x37, 0x00, 0x00, 0xff, 0xff, 0x29, 0x4f, 0x1c, 0xdf, 0xc3, 0x06, 0x00,
0x00,
}
func (m *Tx) Marshal() (dAtA []byte, err error) {
@@ -2420,7 +2420,7 @@ func (m *SignerInfo) Unmarshal(dAtA []byte) error {
return io.ErrUnexpectedEOF
}
if m.PublicKey == nil {
m.PublicKey = &types1.PublicKey{}
m.PublicKey = &types.Any{}
}
if err := m.PublicKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
+27 -2
View File
@@ -6,12 +6,14 @@ import (
codectypes "github.com/cosmos/cosmos-sdk/codec/types"
sdk "github.com/cosmos/cosmos-sdk/types"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
"github.com/tendermint/tendermint/crypto"
)
// MaxGasWanted defines the max gas allowed.
const MaxGasWanted = uint64((1 << 63) - 1)
var _, _ codectypes.UnpackInterfacesMessage = &Tx{}, &TxBody{}
// Interface implementation checks.
var _, _, _, _ codectypes.UnpackInterfacesMessage = &Tx{}, &TxBody{}, &AuthInfo{}, &SignerInfo{}
var _ sdk.Tx = &Tx{}
// GetMsgs implements the GetMsgs method on sdk.Tx.
@@ -100,8 +102,15 @@ func (t *Tx) GetSigners() []sdk.AccAddress {
// UnpackInterfaces implements the UnpackInterfaceMessages.UnpackInterfaces method
func (t *Tx) UnpackInterfaces(unpacker codectypes.AnyUnpacker) error {
if t.Body != nil {
return t.Body.UnpackInterfaces(unpacker)
if err := t.Body.UnpackInterfaces(unpacker); err != nil {
return err
}
}
if t.AuthInfo != nil {
return t.AuthInfo.UnpackInterfaces(unpacker)
}
return nil
}
@@ -117,6 +126,22 @@ func (m *TxBody) UnpackInterfaces(unpacker codectypes.AnyUnpacker) error {
return nil
}
// UnpackInterfaces implements the UnpackInterfaceMessages.UnpackInterfaces method
func (m *AuthInfo) UnpackInterfaces(unpacker codectypes.AnyUnpacker) error {
for _, signerInfo := range m.SignerInfos {
err := signerInfo.UnpackInterfaces(unpacker)
if err != nil {
return err
}
}
return nil
}
// UnpackInterfaces implements the UnpackInterfaceMessages.UnpackInterfaces method
func (m *SignerInfo) UnpackInterfaces(unpacker codectypes.AnyUnpacker) error {
return unpacker.UnpackAny(m.PublicKey, new(crypto.PubKey))
}
// RegisterInterfaces registers the sdk.Tx interface.
func RegisterInterfaces(registry codectypes.InterfaceRegistry) {
registry.RegisterInterface("cosmos.tx.v1beta1.Tx", (*sdk.Tx)(nil))