From 44ba1a7327659d2e8c49935b3fab34dcb75b8ec3 Mon Sep 17 00:00:00 2001 From: Flavien Binet Date: Wed, 12 Jan 2022 09:32:59 +0100 Subject: [PATCH 01/13] chores: revert bls integration --- baseapp/baseapp.go | 10 +- client/flags/flags.go | 2 +- crypto/codec/amino.go | 5 - crypto/codec/proto.go | 2 - crypto/hd/algo.go | 42 -- crypto/keyring/keyring.go | 2 +- crypto/keys/bls12381/bls12381.go | 230 ----------- crypto/keys/bls12381/bls12381_test.go | 204 ---------- crypto/keys/bls12381/keys.pb.go | 496 ------------------------ crypto/keys/bls12381/multisig.go | 116 ------ crypto/keys/bls12381/multisig_test.go | 123 ------ crypto/keys/ed25519/ed25519_test.go | 14 - docs/core/proto-docs.md | 56 --- go.mod | 10 +- go.sum | 31 +- proto/cosmos/auth/v1beta1/auth.proto | 4 - proto/cosmos/crypto/bls12381/keys.proto | 22 -- simapp/helpers/test_helpers.go | 2 +- testutil/testdata/tx.go | 12 +- types/errors/errors.go | 3 - x/auth/ante/ante.go | 1 - x/auth/ante/ante_test.go | 8 +- x/auth/ante/sigverify.go | 51 --- x/auth/legacy/v040/migrate.go | 4 - x/auth/legacy/v040/migrate_test.go | 8 - x/auth/simulation/genesis.go | 14 +- x/auth/types/account.go | 23 -- x/auth/types/auth.pb.go | 162 ++------ x/auth/types/params.go | 23 +- x/auth/types/params_test.go | 12 +- 30 files changed, 70 insertions(+), 1622 deletions(-) delete mode 100644 crypto/keys/bls12381/bls12381.go delete mode 100644 crypto/keys/bls12381/bls12381_test.go delete mode 100644 crypto/keys/bls12381/keys.pb.go delete mode 100644 crypto/keys/bls12381/multisig.go delete mode 100644 crypto/keys/bls12381/multisig_test.go delete mode 100644 proto/cosmos/crypto/bls12381/keys.proto diff --git a/baseapp/baseapp.go b/baseapp/baseapp.go index e2de4cafb2..f52f377eda 100644 --- a/baseapp/baseapp.go +++ b/baseapp/baseapp.go @@ -705,21 +705,13 @@ func (app *BaseApp) runMsgs(ctx sdk.Context, msgs []sdk.Msg, mode runTxMode) (*s err error ) - if svcMsg, ok := msg.(sdk.ServiceMsg); ok { //nolint:gocritic + if svcMsg, ok := msg.(sdk.ServiceMsg); ok { msgFqName = svcMsg.MethodName handler := app.msgServiceRouter.Handler(msgFqName) if handler == nil { return nil, sdkerrors.Wrapf(sdkerrors.ErrUnknownRequest, "unrecognized message service method: %s; message index: %d", msgFqName, i) } msgResult, err = handler(ctx, svcMsg.Request) - } else if strings.Contains(msg.Type(), "fetchai.group.v1alpha1.Msg") { - // TODO: remove once cosmos-sdk is upgraded to v0.44 - msgRoute := strings.Replace(msg.Type(), "fetchai.group.v1alpha1.Msg", "fetchai.group.v1alpha1.Msg/", 1) - handler := app.msgServiceRouter.Handler(msgRoute) - if handler == nil { - return nil, sdkerrors.Wrapf(sdkerrors.ErrUnknownRequest, "unrecognized message route: %s; message index: %d", msgRoute, i) - } - msgResult, err = handler(ctx, msg) } else { // legacy sdk.Msg routing msgRoute := msg.Route() diff --git a/client/flags/flags.go b/client/flags/flags.go index d6127ccfef..7d4de556b6 100644 --- a/client/flags/flags.go +++ b/client/flags/flags.go @@ -15,7 +15,7 @@ const ( // failures due to state changes that might occur between the tx simulation // and the actual run. DefaultGasAdjustment = 1.0 - DefaultGasLimit = 210000 + DefaultGasLimit = 200000 GasFlagAuto = "auto" // DefaultKeyringBackend diff --git a/crypto/codec/amino.go b/crypto/codec/amino.go index 0043c6855c..d50a08864c 100644 --- a/crypto/codec/amino.go +++ b/crypto/codec/amino.go @@ -1,7 +1,6 @@ package codec import ( - "github.com/cosmos/cosmos-sdk/crypto/keys/bls12381" "github.com/tendermint/tendermint/crypto/sr25519" "github.com/cosmos/cosmos-sdk/codec" @@ -23,8 +22,6 @@ func RegisterCrypto(cdc *codec.LegacyAmino) { secp256k1.PubKeyName, nil) cdc.RegisterConcrete(&kmultisig.LegacyAminoPubKey{}, kmultisig.PubKeyAminoRoute, nil) - cdc.RegisterConcrete(&bls12381.PubKey{}, - bls12381.PubKeyName, nil) cdc.RegisterInterface((*cryptotypes.PrivKey)(nil), nil) cdc.RegisterConcrete(sr25519.PrivKey{}, @@ -33,6 +30,4 @@ func RegisterCrypto(cdc *codec.LegacyAmino) { ed25519.PrivKeyName, nil) cdc.RegisterConcrete(&secp256k1.PrivKey{}, secp256k1.PrivKeyName, nil) - cdc.RegisterConcrete(&bls12381.PrivKey{}, - bls12381.PrivKeyName, nil) } diff --git a/crypto/codec/proto.go b/crypto/codec/proto.go index 6bdac15ab6..9c07ca1105 100644 --- a/crypto/codec/proto.go +++ b/crypto/codec/proto.go @@ -2,7 +2,6 @@ package codec import ( codectypes "github.com/cosmos/cosmos-sdk/codec/types" - "github.com/cosmos/cosmos-sdk/crypto/keys/bls12381" "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" "github.com/cosmos/cosmos-sdk/crypto/keys/multisig" "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" @@ -15,5 +14,4 @@ func RegisterInterfaces(registry codectypes.InterfaceRegistry) { registry.RegisterImplementations((*cryptotypes.PubKey)(nil), &ed25519.PubKey{}) registry.RegisterImplementations((*cryptotypes.PubKey)(nil), &secp256k1.PubKey{}) registry.RegisterImplementations((*cryptotypes.PubKey)(nil), &multisig.LegacyAminoPubKey{}) - registry.RegisterImplementations((*cryptotypes.PubKey)(nil), &bls12381.PubKey{}) } diff --git a/crypto/hd/algo.go b/crypto/hd/algo.go index fcd4851996..f934ad08ae 100644 --- a/crypto/hd/algo.go +++ b/crypto/hd/algo.go @@ -1,7 +1,6 @@ package hd import ( - "github.com/cosmos/cosmos-sdk/crypto/keys/bls12381" bip39 "github.com/cosmos/go-bip39" "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" @@ -21,15 +20,11 @@ const ( Ed25519Type = PubKeyType("ed25519") // Sr25519Type represents the Sr25519Type signature system. Sr25519Type = PubKeyType("sr25519") - // Bls12381Type represents the Bls12381Type signature system. - Bls12381Type = PubKeyType("bls12381") ) var ( // Secp256k1 uses the Bitcoin secp256k1 ECDSA parameters. Secp256k1 = secp256k1Algo{} - // Bls12381 uses blst implememtation of bls signatures - Bls12381 = bls12381Algo{} ) type DeriveFn func(mnemonic string, bip39Passphrase, hdPath string) ([]byte, error) @@ -74,40 +69,3 @@ func (s secp256k1Algo) Generate() GenerateFn { return &secp256k1.PrivKey{Key: bzArr} } } - -type bls12381Algo struct { -} - -func (s bls12381Algo) Name() PubKeyType { - return Bls12381Type -} - -// todo: replace bitcoin private key generation -// Derive derives and returns the bls12381 private key for the given seed and HD path. -func (s bls12381Algo) Derive() DeriveFn { - return func(mnemonic string, bip39Passphrase, hdPath string) ([]byte, error) { - seed, err := bip39.NewSeedWithErrorChecking(mnemonic, bip39Passphrase) - if err != nil { - return nil, err - } - - masterPriv, ch := ComputeMastersFromSeed(seed) - if len(hdPath) == 0 { - return masterPriv[:], nil - } - derivedKey, err := DerivePrivateKeyForPath(masterPriv, ch, hdPath) - - return derivedKey, err - } -} - -// Generate generates a bls12381 private key from the given bytes. -func (s bls12381Algo) Generate() GenerateFn { - return func(bz []byte) types.PrivKey { - var bzArr = make([]byte, bls12381.SeedSize) - copy(bzArr, bz) - sk := bls12381.GenPrivKeyFromSecret(bzArr) - - return sk - } -} diff --git a/crypto/keyring/keyring.go b/crypto/keyring/keyring.go index 18f813ca1e..b18d607322 100644 --- a/crypto/keyring/keyring.go +++ b/crypto/keyring/keyring.go @@ -200,7 +200,7 @@ type keystore struct { func newKeystore(kr keyring.Keyring, opts ...Option) keystore { // Default options for keybase options := Options{ - SupportedAlgos: SigningAlgoList{hd.Secp256k1, hd.Bls12381}, + SupportedAlgos: SigningAlgoList{hd.Secp256k1}, SupportedAlgosLedger: SigningAlgoList{hd.Secp256k1}, } diff --git a/crypto/keys/bls12381/bls12381.go b/crypto/keys/bls12381/bls12381.go deleted file mode 100644 index 7aa9ffb98c..0000000000 --- a/crypto/keys/bls12381/bls12381.go +++ /dev/null @@ -1,230 +0,0 @@ -package bls12381 - -import ( - "crypto/subtle" - "fmt" - "io" - - "github.com/cosmos/cosmos-sdk/codec" - cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" - "github.com/cosmos/cosmos-sdk/types/errors" - blst "github.com/supranational/blst/bindings/go" - "github.com/tendermint/tendermint/crypto" - "github.com/tendermint/tendermint/crypto/tmhash" -) - -const ( - PrivKeyName = "tendermint/PrivKeyBls12381" - PubKeyName = "tendermint/PubKeyBls12381" - // PubKeySize is is the size, in bytes, of public keys as used in this package. - PubKeySize = 96 - // PrivKeySize is the size, in bytes, of private keys as used in this package. - // Uncompressed public key - PrivKeySize = 32 - // SignatureSize is the size of a bls signature. Namely the size of a compressed - // G2 point. - SignatureSize = 96 - keyType = "bls12381" - SeedSize = 32 -) - -var _ cryptotypes.PrivKey = &PrivKey{} -var _ codec.AminoMarshaler = &PrivKey{} - -// Bytes returns the byte representation of the Private Key. -func (privKey *PrivKey) Bytes() []byte { - return privKey.Key -} - -// PubKey performs the point-scalar multiplication from the privKey on the -// generator point to get the pubkey. -func (privKey *PrivKey) PubKey() cryptotypes.PubKey { - sk := new(blst.SecretKey).Deserialize(privKey.Key) - if sk == nil { - panic("Failed to deserialize secret key!") - } - pk := new(blst.P1Affine).From(sk) - pkBytes := pk.Serialize() - - return &PubKey{Key: pkBytes} -} - -// Sign produces a signature on the provided message. -// This assumes the privkey is wellformed in the golang format. - -func (privKey *PrivKey) Sign(msg []byte) ([]byte, error) { - dst := []byte("BLS_SIG_BLS12381G2_XMD:SHA-256_SSWU_RO_POP_") - sk := new(blst.SecretKey).Deserialize(privKey.Key) - if sk == nil { - panic("Failed to deserialize secret key!") - } - - sig := new(blst.P2Affine).Sign(sk, msg, dst) - if sig == nil { - panic("Failed to sign message!") - } - - sigBytes := sig.Compress() - - return sigBytes, nil -} - -// Equals - you probably don't need to use this. -// Runs in constant time based on length of the -func (privKey *PrivKey) Equals(other cryptotypes.LedgerPrivKey) bool { - return privKey.Type() == other.Type() && subtle.ConstantTimeCompare(privKey.Bytes(), other.Bytes()) == 1 -} - -func (privKey *PrivKey) Type() string { - return keyType -} - -// MarshalAmino overrides Amino binary marshalling. -func (privKey PrivKey) MarshalAmino() ([]byte, error) { - return privKey.Key, nil -} - -// UnmarshalAmino overrides Amino binary marshalling. -func (privKey *PrivKey) UnmarshalAmino(bz []byte) error { - if len(bz) != PrivKeySize { - return fmt.Errorf("invalid privkey size") - } - privKey.Key = bz - - return nil -} - -// MarshalAminoJSON overrides Amino JSON marshalling. -func (privKey PrivKey) MarshalAminoJSON() ([]byte, error) { - // When we marshal to Amino JSON, we don't marshal the "key" field itself, - // just its contents (i.e. the key bytes). - return privKey.MarshalAmino() -} - -// UnmarshalAminoJSON overrides Amino JSON marshalling. -func (privKey *PrivKey) UnmarshalAminoJSON(bz []byte) error { - return privKey.UnmarshalAmino(bz) -} - -// GenPrivKey generates a new BLS private key on curve bls12-381 private key. -// It uses OS randomness to generate the private key. -func GenPrivKey() *PrivKey { - return &PrivKey{Key: genPrivKey(crypto.CReader())} -} - -// genPrivKey generates a new bls12381 private key using the provided reader. -func genPrivKey(rand io.Reader) []byte { - var ikm [SeedSize]byte - _, err := io.ReadFull(rand, ikm[:]) - if err != nil { - panic(err) - } - - sk := blst.KeyGen(ikm[:]) - if sk == nil { - panic("failed to generate secret key!") - } - - skBytes := sk.Serialize() - - return skBytes -} - -// GenPrivKeyFromSecret hashes the secret with SHA2, and uses -// that 32 byte output to create the private key. -// NOTE: secret should be the output of a KDF like bcrypt, -// if it's derived from user input. -func GenPrivKeyFromSecret(secret []byte) *PrivKey { - ikm := crypto.Sha256(secret) // Not Ripemd160 because we want 32 bytes. - - sk := blst.KeyGen(ikm) - if sk == nil { - panic("failed to generate secret key from ikm") - } - skBytes := sk.Serialize() - - return &PrivKey{Key: skBytes} -} - -var _ cryptotypes.PubKey = &PubKey{} -var _ codec.AminoMarshaler = &PubKey{} - -// Validate public key, infinity and subgroup checking -func (pubKey *PubKey) Validate() bool { - pk := new(blst.P1Affine).Deserialize(pubKey.Key) - return pk.KeyValidate() -} - -// Address is the SHA256-20 of the raw pubkey bytes. -func (pubKey *PubKey) Address() crypto.Address { - if len(pubKey.Key) != PubKeySize { - panic("pubkey is incorrect size") - } - return crypto.Address(tmhash.SumTruncated(pubKey.Key)) -} - -// Bytes returns the PubKey byte format. -func (pubKey *PubKey) Bytes() []byte { - return pubKey.Key -} - -// VerifySignature assumes public key is already validated -func (pubKey *PubKey) VerifySignature(msg []byte, sig []byte) bool { - // make sure we use the same algorithm to sign - pk := new(blst.P1Affine).Deserialize(pubKey.Key) - if pk == nil { - panic("Failed to deserialize public key") - } - - sigma := new(blst.P2Affine).Uncompress(sig) - if sigma == nil { - panic("Failed to deserialize signature") - } - - dst := []byte("BLS_SIG_BLS12381G2_XMD:SHA-256_SSWU_RO_POP_") - - return sigma.Verify(true, pk, false, msg, dst) -} - -func (pubKey *PubKey) String() string { - return fmt.Sprintf("PubKeyBls12381{%X}", pubKey.Key) -} - -func (pubKey *PubKey) Type() string { - return keyType -} - -func (pubKey *PubKey) Equals(other cryptotypes.PubKey) bool { - if pubKey.Type() != other.Type() { - return false - } - - return subtle.ConstantTimeCompare(pubKey.Bytes(), other.Bytes()) == 1 -} - -// MarshalAmino overrides Amino binary marshalling. -func (pubKey PubKey) MarshalAmino() ([]byte, error) { - return pubKey.Key, nil -} - -// UnmarshalAmino overrides Amino binary marshalling. -func (pubKey *PubKey) UnmarshalAmino(bz []byte) error { - if len(bz) != PubKeySize { - return errors.Wrap(errors.ErrInvalidPubKey, "invalid pubkey size") - } - pubKey.Key = bz - - return nil -} - -// MarshalAminoJSON overrides Amino JSON marshalling. -func (pubKey PubKey) MarshalAminoJSON() ([]byte, error) { - // When we marshal to Amino JSON, we don't marshal the "key" field itself, - // just its contents (i.e. the key bytes). - return pubKey.MarshalAmino() -} - -// UnmarshalAminoJSON overrides Amino JSON marshalling. -func (pubKey *PubKey) UnmarshalAminoJSON(bz []byte) error { - return pubKey.UnmarshalAmino(bz) -} diff --git a/crypto/keys/bls12381/bls12381_test.go b/crypto/keys/bls12381/bls12381_test.go deleted file mode 100644 index 0e4bbf6ac2..0000000000 --- a/crypto/keys/bls12381/bls12381_test.go +++ /dev/null @@ -1,204 +0,0 @@ -package bls12381_test - -import ( - "encoding/base64" - "testing" - - "github.com/cosmos/cosmos-sdk/codec/types" - cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" - - "github.com/cosmos/cosmos-sdk/codec" - "github.com/cosmos/cosmos-sdk/crypto/keys/bls12381" - bench "github.com/cosmos/cosmos-sdk/crypto/keys/internal/benchmarking" - "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" - cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - "github.com/tendermint/tendermint/crypto" -) - -func TestSignAndValidateBls12381(t *testing.T) { - privKey := bls12381.GenPrivKey() - pubKey := privKey.PubKey() - - msg := crypto.CRandBytes(1000) - sig, err := privKey.Sign(msg) - require.Nil(t, err) - - // Test the signature - assert.True(t, pubKey.VerifySignature(msg, sig)) - -} - -func TestKeyFromSecret(t *testing.T) { - insecureSeed := []byte("a random number for testing") - privKey := bls12381.GenPrivKeyFromSecret(insecureSeed) - pubKey := privKey.PubKey() - - msg := []byte("hello") - sig, err := privKey.Sign(msg) - require.Nil(t, err) - assert.True(t, pubKey.VerifySignature(msg, sig)) -} - -func TestPubKeyEquals(t *testing.T) { - bls12381PubKey := bls12381.GenPrivKey().PubKey().(*bls12381.PubKey) - - testCases := []struct { - msg string - pubKey cryptotypes.PubKey - other cryptotypes.PubKey - expectEq bool - }{ - { - "different bytes", - bls12381PubKey, - bls12381.GenPrivKey().PubKey(), - false, - }, - { - "equals", - bls12381PubKey, - &bls12381.PubKey{ - Key: bls12381PubKey.Key, - }, - true, - }, - { - "different types", - bls12381PubKey, - secp256k1.GenPrivKey().PubKey(), - false, - }, - } - - for _, tc := range testCases { - t.Run(tc.msg, func(t *testing.T) { - eq := tc.pubKey.Equals(tc.other) - require.Equal(t, eq, tc.expectEq) - }) - } -} - -func TestPrivKeyEquals(t *testing.T) { - bls12381PrivKey := bls12381.GenPrivKey() - - testCases := []struct { - msg string - privKey cryptotypes.PrivKey - other cryptotypes.PrivKey - expectEq bool - }{ - { - "different bytes", - bls12381PrivKey, - bls12381.GenPrivKey(), - false, - }, - { - "equals", - bls12381PrivKey, - &bls12381.PrivKey{ - Key: bls12381PrivKey.Key, - }, - true, - }, - { - "different types", - bls12381PrivKey, - secp256k1.GenPrivKey(), - false, - }, - } - - for _, tc := range testCases { - t.Run(tc.msg, func(t *testing.T) { - eq := tc.privKey.Equals(tc.other) - require.Equal(t, eq, tc.expectEq) - }) - } -} - -func TestMarshalAmino(t *testing.T) { - aminoCdc := codec.NewLegacyAmino() - privKey := bls12381.GenPrivKey() - pubKey := privKey.PubKey().(*bls12381.PubKey) - - testCases := []struct { - desc string - msg codec.AminoMarshaler - typ interface{} - expBinary []byte - expJSON string - }{ - { - "bls12381 private key", - privKey, - &bls12381.PrivKey{}, - append([]byte{32}, privKey.Bytes()...), // Length-prefixed. - "\"" + base64.StdEncoding.EncodeToString(privKey.Bytes()) + "\"", - }, - { - "bls12381 public key", - pubKey, - &bls12381.PubKey{}, - append([]byte{96}, pubKey.Bytes()...), // Length-prefixed. - "\"" + base64.StdEncoding.EncodeToString(pubKey.Bytes()) + "\"", - }, - } - - for _, tc := range testCases { - t.Run(tc.desc, func(t *testing.T) { - // Do a round trip of encoding/decoding binary. - bz, err := aminoCdc.MarshalBinaryBare(tc.msg) - require.NoError(t, err) - require.Equal(t, tc.expBinary, bz) - - err = aminoCdc.UnmarshalBinaryBare(bz, tc.typ) - require.NoError(t, err) - - require.Equal(t, tc.msg, tc.typ) - - // Do a round trip of encoding/decoding JSON. - bz, err = aminoCdc.MarshalJSON(tc.msg) - require.NoError(t, err) - require.Equal(t, tc.expJSON, string(bz)) - - err = aminoCdc.UnmarshalJSON(bz, tc.typ) - require.NoError(t, err) - - require.Equal(t, tc.msg, tc.typ) - }) - } -} - -func TestMarshalJSON(t *testing.T) { - require := require.New(t) - privKey := bls12381.GenPrivKey() - pk := privKey.PubKey() - - registry := types.NewInterfaceRegistry() - cryptocodec.RegisterInterfaces(registry) - cdc := codec.NewProtoCodec(registry) - - bz, err := cdc.MarshalInterfaceJSON(pk) - require.NoError(err) - - var pk2 cryptotypes.PubKey - err = cdc.UnmarshalInterfaceJSON(bz, &pk2) - require.NoError(err) - require.True(pk2.Equals(pk)) -} - -func BenchmarkSignBls(b *testing.B) { - privKey := bls12381.GenPrivKey() - - bench.BenchmarkSigning(b, privKey) - -} - -func BenchmarkVerifyBls(b *testing.B) { - privKey := bls12381.GenPrivKey() - - bench.BenchmarkVerification(b, privKey) -} diff --git a/crypto/keys/bls12381/keys.pb.go b/crypto/keys/bls12381/keys.pb.go deleted file mode 100644 index 9a7569ca71..0000000000 --- a/crypto/keys/bls12381/keys.pb.go +++ /dev/null @@ -1,496 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: cosmos/crypto/bls12381/keys.proto - -package bls12381 - -import ( - fmt "fmt" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - io "io" - math "math" - math_bits "math/bits" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -// PubKey defines a bls public key -// Key is the uncompressed form of the pubkey. The first byte depends is a 0x02 byte -// if the y-coordinate is the lexicographically largest of the two associated with -// the x-coordinate. Otherwise the first byte is a 0x03. -// This prefix is followed with the x-coordinate. -type PubKey struct { - Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` -} - -func (m *PubKey) Reset() { *m = PubKey{} } -func (*PubKey) ProtoMessage() {} -func (*PubKey) Descriptor() ([]byte, []int) { - return fileDescriptor_295d2962e809fcdb, []int{0} -} -func (m *PubKey) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *PubKey) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_PubKey.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *PubKey) XXX_Merge(src proto.Message) { - xxx_messageInfo_PubKey.Merge(m, src) -} -func (m *PubKey) XXX_Size() int { - return m.Size() -} -func (m *PubKey) XXX_DiscardUnknown() { - xxx_messageInfo_PubKey.DiscardUnknown(m) -} - -var xxx_messageInfo_PubKey proto.InternalMessageInfo - -func (m *PubKey) GetKey() []byte { - if m != nil { - return m.Key - } - return nil -} - -// PrivKey defines a bls private key. -type PrivKey struct { - Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` -} - -func (m *PrivKey) Reset() { *m = PrivKey{} } -func (m *PrivKey) String() string { return proto.CompactTextString(m) } -func (*PrivKey) ProtoMessage() {} -func (*PrivKey) Descriptor() ([]byte, []int) { - return fileDescriptor_295d2962e809fcdb, []int{1} -} -func (m *PrivKey) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *PrivKey) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_PrivKey.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *PrivKey) XXX_Merge(src proto.Message) { - xxx_messageInfo_PrivKey.Merge(m, src) -} -func (m *PrivKey) XXX_Size() int { - return m.Size() -} -func (m *PrivKey) XXX_DiscardUnknown() { - xxx_messageInfo_PrivKey.DiscardUnknown(m) -} - -var xxx_messageInfo_PrivKey proto.InternalMessageInfo - -func (m *PrivKey) GetKey() []byte { - if m != nil { - return m.Key - } - return nil -} - -func init() { - proto.RegisterType((*PubKey)(nil), "cosmos.crypto.bls12381.PubKey") - proto.RegisterType((*PrivKey)(nil), "cosmos.crypto.bls12381.PrivKey") -} - -func init() { proto.RegisterFile("cosmos/crypto/bls12381/keys.proto", fileDescriptor_295d2962e809fcdb) } - -var fileDescriptor_295d2962e809fcdb = []byte{ - // 184 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x4c, 0xce, 0x2f, 0xce, - 0xcd, 0x2f, 0xd6, 0x4f, 0x2e, 0xaa, 0x2c, 0x28, 0xc9, 0xd7, 0x4f, 0xca, 0x29, 0x36, 0x34, 0x32, - 0xb6, 0x30, 0xd4, 0xcf, 0x4e, 0xad, 0x2c, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x83, - 0x28, 0xd1, 0x83, 0x28, 0xd1, 0x83, 0x29, 0x91, 0x12, 0x49, 0xcf, 0x4f, 0xcf, 0x07, 0x2b, 0xd1, - 0x07, 0xb1, 0x20, 0xaa, 0x95, 0x14, 0xb8, 0xd8, 0x02, 0x4a, 0x93, 0xbc, 0x53, 0x2b, 0x85, 0x04, - 0xb8, 0x98, 0xb3, 0x53, 0x2b, 0x25, 0x18, 0x15, 0x18, 0x35, 0x78, 0x82, 0x40, 0x4c, 0x2b, 0x96, - 0x19, 0x0b, 0xe4, 0x19, 0x94, 0xa4, 0xb9, 0xd8, 0x03, 0x8a, 0x32, 0xcb, 0xb0, 0x2a, 0x71, 0xf2, - 0x3e, 0xf1, 0x48, 0x8e, 0xf1, 0xc2, 0x23, 0x39, 0xc6, 0x07, 0x8f, 0xe4, 0x18, 0x27, 0x3c, 0x96, - 0x63, 0xb8, 0xf0, 0x58, 0x8e, 0xe1, 0xc6, 0x63, 0x39, 0x86, 0x28, 0xc3, 0xf4, 0xcc, 0x92, 0x8c, - 0xd2, 0x24, 0xbd, 0xe4, 0xfc, 0x5c, 0x7d, 0x98, 0xa3, 0xc1, 0x94, 0x6e, 0x71, 0x4a, 0x36, 0xcc, - 0xfd, 0x20, 0x67, 0xc3, 0x3d, 0x91, 0xc4, 0x06, 0x76, 0x92, 0x31, 0x20, 0x00, 0x00, 0xff, 0xff, - 0x0e, 0x2e, 0xb6, 0x08, 0xe5, 0x00, 0x00, 0x00, -} - -func (m *PubKey) 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 *PubKey) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *PubKey) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Key) > 0 { - i -= len(m.Key) - copy(dAtA[i:], m.Key) - i = encodeVarintKeys(dAtA, i, uint64(len(m.Key))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *PrivKey) 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 *PrivKey) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *PrivKey) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Key) > 0 { - i -= len(m.Key) - copy(dAtA[i:], m.Key) - i = encodeVarintKeys(dAtA, i, uint64(len(m.Key))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func encodeVarintKeys(dAtA []byte, offset int, v uint64) int { - offset -= sovKeys(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *PubKey) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Key) - if l > 0 { - n += 1 + l + sovKeys(uint64(l)) - } - return n -} - -func (m *PrivKey) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Key) - if l > 0 { - n += 1 + l + sovKeys(uint64(l)) - } - return n -} - -func sovKeys(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozKeys(x uint64) (n int) { - return sovKeys(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *PubKey) 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 ErrIntOverflowKeys - } - 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: PubKey: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: PubKey: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowKeys - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthKeys - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthKeys - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Key = append(m.Key[:0], dAtA[iNdEx:postIndex]...) - if m.Key == nil { - m.Key = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipKeys(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthKeys - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *PrivKey) 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 ErrIntOverflowKeys - } - 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: PrivKey: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: PrivKey: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowKeys - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthKeys - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthKeys - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Key = append(m.Key[:0], dAtA[iNdEx:postIndex]...) - if m.Key == nil { - m.Key = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipKeys(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthKeys - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipKeys(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, ErrIntOverflowKeys - } - 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, ErrIntOverflowKeys - } - 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, ErrIntOverflowKeys - } - 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, ErrInvalidLengthKeys - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupKeys - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthKeys - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthKeys = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowKeys = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupKeys = fmt.Errorf("proto: unexpected end of group") -) diff --git a/crypto/keys/bls12381/multisig.go b/crypto/keys/bls12381/multisig.go deleted file mode 100644 index e7a854c463..0000000000 --- a/crypto/keys/bls12381/multisig.go +++ /dev/null @@ -1,116 +0,0 @@ -package bls12381 - -import ( - "encoding/base64" - "fmt" - - blst "github.com/supranational/blst/bindings/go" -) - -func aggregatePublicKey(pks []*PubKey) (*blst.P1Affine, error) { - pubkeys := make([]*blst.P1Affine, len(pks)) - for i, pk := range pks { - pubkeys[i] = new(blst.P1Affine).Deserialize(pk.Key) - if pubkeys[i] == nil { - return nil, fmt.Errorf("failed to deserialize public key") - } - } - - aggregator := new(blst.P1Aggregate) - b := aggregator.Aggregate(pubkeys, false) - if !b { - return nil, fmt.Errorf("failed to aggregate public keys") - } - apk := aggregator.ToAffine() - - return apk, nil -} - -// AggregateSignature combines a set of verified signatures into a single bls signature -func AggregateSignature(sigs [][]byte) ([]byte, error) { - sigmas := make([]*blst.P2Affine, len(sigs)) - for i, sig := range sigs { - sigmas[i] = new(blst.P2Affine).Uncompress(sig) - if sigmas[i] == nil { - return nil, fmt.Errorf("failed to deserialize the %d-th signature", i) - } - } - - aggregator := new(blst.P2Aggregate) - b := aggregator.Aggregate(sigmas, false) - if !b { - return nil, fmt.Errorf("failed to aggregate signatures") - } - aggSigBytes := aggregator.ToAffine().Compress() - return aggSigBytes, nil -} - -// VerifyMultiSignature assumes public key is already validated -func VerifyMultiSignature(msg []byte, sig []byte, pks []*PubKey) error { - return VerifyAggregateSignature([][]byte{msg}, false, sig, [][]*PubKey{pks}) -} - -func Unique(msgs [][]byte) bool { - if len(msgs) <= 1 { - return true - } - msgMap := make(map[string]bool, len(msgs)) - for _, msg := range msgs { - s := base64.StdEncoding.EncodeToString(msg) - if _, ok := msgMap[s]; ok { - return false - } - msgMap[s] = true - } - return true -} - -func VerifyAggregateSignature(msgs [][]byte, msgCheck bool, sig []byte, pkss [][]*PubKey) error { - n := len(msgs) - if n == 0 { - return fmt.Errorf("messages cannot be empty") - } - - for i, msg := range msgs { - if len(msg) == 0 { - return fmt.Errorf("%d-th message is empty", i) - } - } - - if len(pkss) != n { - return fmt.Errorf("the number of messages and public key sets must match") - } - - for i, pks := range pkss { - if len(pks) == 0 { - return fmt.Errorf("%d-th public key set is empty", i) - } - } - - if msgCheck { - if !Unique(msgs) { - return fmt.Errorf("messages must be pairwise distinct") - } - } - - apks := make([]*blst.P1Affine, len(pkss)) - for i, pks := range pkss { - apk, err := aggregatePublicKey(pks) - if err != nil { - return fmt.Errorf("cannot aggregate public keys: %s", err.Error()) - } - apks[i] = apk - } - - sigma := new(blst.P2Affine).Uncompress(sig) - if sigma == nil { - return fmt.Errorf("failed to deserialize signature") - } - - dst := []byte("BLS_SIG_BLS12381G2_XMD:SHA-256_SSWU_RO_POP_") - if !sigma.AggregateVerify(true, apks, false, msgs, dst) { - return fmt.Errorf("failed to verify signature") - } - - return nil -} diff --git a/crypto/keys/bls12381/multisig_test.go b/crypto/keys/bls12381/multisig_test.go deleted file mode 100644 index 20168ee4cc..0000000000 --- a/crypto/keys/bls12381/multisig_test.go +++ /dev/null @@ -1,123 +0,0 @@ -package bls12381_test - -import ( - "fmt" - "testing" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - - bls "github.com/cosmos/cosmos-sdk/crypto/keys/bls12381" -) - -func TestBlsMultiSig(t *testing.T) { - total := 5 - pks := make([]*bls.PubKey, total) - sigs := make([][]byte, total) - msg := []byte("hello world") - for i := 0; i < total; i++ { - sk := bls.GenPrivKey() - pk, ok := sk.PubKey().(*bls.PubKey) - require.True(t, ok) - - sig, err := sk.Sign(msg) - require.Nil(t, err) - - pks[i] = pk - sigs[i] = sig - } - - aggSig, err := bls.AggregateSignature(sigs) - require.Nil(t, err) - - assert.Nil(t, bls.VerifyMultiSignature(msg, aggSig, pks)) - -} - -func TestBlsAggSig(t *testing.T) { - total := 5 - pks := make([][]*bls.PubKey, total) - sigs := make([][]byte, total) - msgs := make([][]byte, total) - for i := 0; i < total; i++ { - msgs[i] = []byte(fmt.Sprintf("message %d", i)) - sk := bls.GenPrivKey() - pk, ok := sk.PubKey().(*bls.PubKey) - require.True(t, ok) - - sig, err := sk.Sign(msgs[i]) - require.Nil(t, err) - - pks[i] = []*bls.PubKey{pk} - sigs[i] = sig - } - - aggSig, err := bls.AggregateSignature(sigs) - require.Nil(t, err) - - assert.Nil(t, bls.VerifyAggregateSignature(msgs, true, aggSig, pks)) -} - -func benchmarkBlsVerifyMulti(total int, b *testing.B) { - pks := make([]*bls.PubKey, total) - sigs := make([][]byte, total) - msg := []byte("hello world") - for i := 0; i < total; i++ { - sk := bls.GenPrivKey() - pk, ok := sk.PubKey().(*bls.PubKey) - require.True(b, ok) - - sig, err := sk.Sign(msg) - require.Nil(b, err) - - pks[i] = pk - sigs[i] = sig - } - - aggSig, err := bls.AggregateSignature(sigs) - require.Nil(b, err) - - b.ResetTimer() - for i := 0; i < b.N; i++ { - bls.VerifyMultiSignature(msg, aggSig, pks) - } -} - -func BenchmarkBlsVerifyMulti8(b *testing.B) { benchmarkBlsVerifyMulti(8, b) } -func BenchmarkBlsVerifyMulti16(b *testing.B) { benchmarkBlsVerifyMulti(16, b) } -func BenchmarkBlsVerifyMulti32(b *testing.B) { benchmarkBlsVerifyMulti(32, b) } -func BenchmarkBlsVerifyMulti64(b *testing.B) { benchmarkBlsVerifyMulti(64, b) } -func BenchmarkBlsVerifyMulti128(b *testing.B) { benchmarkBlsVerifyMulti(128, b) } - -func benchmarkBlsVerifyAgg(total int, b *testing.B) { - pks := make([][]*bls.PubKey, total) - sigs := make([][]byte, total) - msgs := make([][]byte, total) - for i := 0; i < total; i++ { - msgs[i] = []byte(fmt.Sprintf("message %d", i)) - sk := bls.GenPrivKey() - pk, ok := sk.PubKey().(*bls.PubKey) - require.True(b, ok) - - sig, err := sk.Sign(msgs[i]) - require.Nil(b, err) - - pks[i] = []*bls.PubKey{pk} - sigs[i] = sig - } - - aggSig, err := bls.AggregateSignature(sigs) - require.Nil(b, err) - - b.ResetTimer() - - for i := 0; i < b.N; i++ { - bls.VerifyAggregateSignature(msgs, false, aggSig, pks) - } -} - -func BenchmarkBlsVerifyAgg8(b *testing.B) { benchmarkBlsVerifyAgg(8, b) } -func BenchmarkBlsVerifyAgg16(b *testing.B) { benchmarkBlsVerifyAgg(16, b) } -func BenchmarkBlsVerifyAgg32(b *testing.B) { benchmarkBlsVerifyAgg(32, b) } -func BenchmarkBlsVerifyAgg64(b *testing.B) { benchmarkBlsVerifyAgg(64, b) } -func BenchmarkBlsVerifyAgg128(b *testing.B) { benchmarkBlsVerifyAgg(128, b) } diff --git a/crypto/keys/ed25519/ed25519_test.go b/crypto/keys/ed25519/ed25519_test.go index 2291a01de8..59cce4066a 100644 --- a/crypto/keys/ed25519/ed25519_test.go +++ b/crypto/keys/ed25519/ed25519_test.go @@ -3,7 +3,6 @@ package ed25519_test import ( stded25519 "crypto/ed25519" "encoding/base64" - bench "github.com/cosmos/cosmos-sdk/crypto/keys/internal/benchmarking" "testing" "github.com/stretchr/testify/assert" @@ -229,16 +228,3 @@ func TestMarshalAmino_BackwardsCompatibility(t *testing.T) { }) } } - -func BenchmarkSignEd25519(b *testing.B) { - privKey := ed25519.GenPrivKey() - - bench.BenchmarkSigning(b, privKey) - -} - -func BenchmarkVerifyEd25519(b *testing.B) { - privKey := ed25519.GenPrivKey() - - bench.BenchmarkVerification(b, privKey) -} diff --git a/docs/core/proto-docs.md b/docs/core/proto-docs.md index e1cc1ec4c7..114db56ecc 100644 --- a/docs/core/proto-docs.md +++ b/docs/core/proto-docs.md @@ -168,10 +168,6 @@ - [Msg](#cosmos.crisis.v1beta1.Msg) -- [cosmos/crypto/bls12381/keys.proto](#cosmos/crypto/bls12381/keys.proto) - - [PrivKey](#cosmos.crypto.bls12381.PrivKey) - - [PubKey](#cosmos.crypto.bls12381.PubKey) - - [cosmos/crypto/ed25519/keys.proto](#cosmos/crypto/ed25519/keys.proto) - [PrivKey](#cosmos.crypto.ed25519.PrivKey) - [PubKey](#cosmos.crypto.ed25519.PubKey) @@ -1147,7 +1143,6 @@ type for additional functionality (e.g. vesting). | `pub_key` | [google.protobuf.Any](#google.protobuf.Any) | | | | `account_number` | [uint64](#uint64) | | | | `sequence` | [uint64](#uint64) | | | -| `pop_is_valid` | [bool](#bool) | | | @@ -1184,7 +1179,6 @@ Params defines the parameters for the auth module. | `tx_size_cost_per_byte` | [uint64](#uint64) | | | | `sig_verify_cost_ed25519` | [uint64](#uint64) | | | | `sig_verify_cost_secp256k1` | [uint64](#uint64) | | | -| `sig_verify_cost_bls12381` | [uint64](#uint64) | | | @@ -2788,56 +2782,6 @@ Msg defines the bank Msg service. - -

Top

- -## cosmos/crypto/bls12381/keys.proto - - - - - -### PrivKey -PrivKey defines a bls private key. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `key` | [bytes](#bytes) | | | - - - - - - - - -### PubKey -PubKey defines a bls public key -Key is the uncompressed form of the pubkey. The first byte depends is a 0x02 byte -if the y-coordinate is the lexicographically largest of the two associated with -the x-coordinate. Otherwise the first byte is a 0x03. -This prefix is followed with the x-coordinate. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `key` | [bytes](#bytes) | | | - - - - - - - - - - - - - - -

Top

diff --git a/go.mod b/go.mod index 4b4c677524..dcae062fd3 100644 --- a/go.mod +++ b/go.mod @@ -7,8 +7,8 @@ require ( github.com/DataDog/zstd v1.4.5 // indirect github.com/armon/go-metrics v0.3.8 github.com/bgentry/speakeasy v0.1.0 - github.com/btcsuite/btcd v0.22.0-beta - github.com/btcsuite/btcutil v1.0.3-0.20201208143702-a53e38424cce + github.com/btcsuite/btcd v0.21.0-beta + github.com/btcsuite/btcutil v1.0.2 github.com/confio/ics23/go v0.6.6 github.com/cosmos/go-bip39 v1.0.0 github.com/cosmos/iavl v0.17.1 @@ -27,7 +27,6 @@ require ( github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 github.com/grpc-ecosystem/grpc-gateway v1.16.0 github.com/hashicorp/golang-lru v0.5.4 - github.com/lib/pq v1.10.2 // indirect github.com/magiconair/properties v1.8.5 github.com/mattn/go-isatty v0.0.12 github.com/mitchellh/mapstructure v1.3.3 // indirect @@ -46,14 +45,13 @@ require ( github.com/spf13/pflag v1.0.5 github.com/spf13/viper v1.7.1 github.com/stretchr/testify v1.7.0 - github.com/supranational/blst v0.3.5 github.com/tendermint/btcd v0.1.1 github.com/tendermint/crypto v0.0.0-20191022145703-50d29ede1e15 github.com/tendermint/go-amino v0.16.0 github.com/tendermint/tendermint v0.34.13 github.com/tendermint/tm-db v0.6.4 - golang.org/x/crypto v0.0.0-20210817164053-32db794688a5 - google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c + golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad + google.golang.org/genproto v0.0.0-20210114201628-6edceaf6022f google.golang.org/grpc v1.40.0 google.golang.org/protobuf v1.26.0 gopkg.in/ini.v1 v1.61.0 // indirect diff --git a/go.sum b/go.sum index e595cc51c3..b48ef06495 100644 --- a/go.sum +++ b/go.sum @@ -68,15 +68,13 @@ github.com/bits-and-blooms/bitset v1.2.0/go.mod h1:gIdJ4wp64HaoK2YrL1Q5/N7Y16edY github.com/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c/go.mod h1:MKsuJmJgSg28kpZDP6UIiPt0e0Oz0kqKNGyRaWEPv84= github.com/btcsuite/btcd v0.0.0-20190115013929-ed77733ec07d/go.mod h1:d3C0AkH6BRcvO8T0UEPu53cnw4IbV63x1bEjildYhO0= github.com/btcsuite/btcd v0.20.1-beta/go.mod h1:wVuoA8VJLEcwgqHBwHmzLRazpKxTv13Px/pDuV7OomQ= +github.com/btcsuite/btcd v0.21.0-beta h1:At9hIZdJW0s9E/fAz28nrz6AmcNlSVucCH796ZteX1M= github.com/btcsuite/btcd v0.21.0-beta/go.mod h1:ZSWyehm27aAuS9bvkATT+Xte3hjHZ+MRgMY/8NJ7K94= -github.com/btcsuite/btcd v0.22.0-beta h1:LTDpDKUM5EeOFBPM8IXpinEcmZ6FWfNZbE3lfrfdnWo= -github.com/btcsuite/btcd v0.22.0-beta/go.mod h1:9n5ntfhhHQBIhUvlhDvD3Qg6fRUj4jkN0VB8L8svzOA= github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f/go.mod h1:TdznJufoqS23FtqVCzL0ZqgP5MqXbb4fg/WgDys70nA= github.com/btcsuite/btcutil v0.0.0-20180706230648-ab6388e0c60a/go.mod h1:+5NJ2+qvTyV9exUAL/rxXi3DcLg2Ts+ymUAY5y4NvMg= github.com/btcsuite/btcutil v0.0.0-20190425235716-9e5f4b9a998d/go.mod h1:+5NJ2+qvTyV9exUAL/rxXi3DcLg2Ts+ymUAY5y4NvMg= +github.com/btcsuite/btcutil v1.0.2 h1:9iZ1Terx9fMIOtq1VrwdqfsATL9MC2l8ZrUY6YZ2uts= github.com/btcsuite/btcutil v1.0.2/go.mod h1:j9HUFwoQRsZL3V4n+qG+CUnEGHOarIxfC3Le2Yhbcts= -github.com/btcsuite/btcutil v1.0.3-0.20201208143702-a53e38424cce h1:YtWJF7RHm2pYCvA5t0RPmAaLUhREsKuKd+SLhxFbFeQ= -github.com/btcsuite/btcutil v1.0.3-0.20201208143702-a53e38424cce/go.mod h1:0DVlHczLPewLcPGEIeUEzfOJhqGPQ0mJJRDBtD307+o= github.com/btcsuite/go-socks v0.0.0-20170105172521-4720035b7bfd/go.mod h1:HHNXQzUsZCxOoE+CPiyCTO6x34Zs86zZUiwtpXoGdtg= github.com/btcsuite/goleveldb v0.0.0-20160330041536-7834afc9e8cd/go.mod h1:F+uVaaLLH7j4eDXPRvw78tMflu7Ie2bzYOH4Y8rRKBY= github.com/btcsuite/goleveldb v1.0.0/go.mod h1:QiK9vBlgftBg6rWQIj6wFzbPfRjiykIEhBH4obrXJ/I= @@ -365,9 +363,8 @@ github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfn github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/lib/pq v1.2.0 h1:LXpIM/LZ5xGFhOpXAQUIMM1HdyqzVYM13zNdjCEEcA0= github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= -github.com/lib/pq v1.10.2 h1:AqzbZs4ZoCBp+GtejcpCpcxM3zlSMx29dXbUSeVtJb8= -github.com/lib/pq v1.10.2/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/libp2p/go-buffer-pool v0.0.2 h1:QNK2iAFa8gjAe1SPz6mHSMuCcjs+X1wlHzeOSqcmlfs= github.com/libp2p/go-buffer-pool v0.0.2/go.mod h1:MvaB6xw5vOrDl8rYZGLFdKAuk/hRoRZd1Vi32+RXyFM= github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= @@ -605,8 +602,6 @@ github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5Cc github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= -github.com/supranational/blst v0.3.5 h1:/pey7U712GgJBSD1XTiJ5iBqjYIH3QNdrjRoGXlJJ60= -github.com/supranational/blst v0.3.5/go.mod h1:jZJtfjgudtNl4en1tzwPIV3KjUnQUvG3/j+w+fVonLw= github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= github.com/syndtr/goleveldb v1.0.1-0.20200815110645-5c35d600f0ca h1:Ld/zXl5t4+D69SiV4JoN7kkfvJdOWlPpfxrzxpLMoUk= github.com/syndtr/goleveldb v1.0.1-0.20200815110645-5c35d600f0ca/go.mod h1:u2MKkTVTVJWe5D1rCvame8WqhBd88EuIwODJZ1VHCPM= @@ -640,7 +635,6 @@ github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/zondax/hid v0.9.0 h1:eiT3P6vNxAEVxXMw66eZUAAnU2zD33JBkfG/EnfAKl8= github.com/zondax/hid v0.9.0/go.mod h1:l5wttcP0jwtdLjqjMMWFVEE7d1zO0jvSPA9OPZxWpEM= go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= @@ -680,8 +674,8 @@ golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20201117144127-c1f2f97bffc9/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= -golang.org/x/crypto v0.0.0-20210817164053-32db794688a5 h1:HWj/xjIHfjYU5nVXpTM0s39J9CbLn7Cc5a7IC5rwsMQ= -golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad h1:DN0cp81fZ3njFcrLCytUHRSUkqBjfTo4Tx9RJTWs0EY= +golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -696,7 +690,6 @@ golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHl golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= @@ -705,7 +698,6 @@ golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzB golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/net v0.0.0-20180719180050-a680a1efc54d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -736,8 +728,6 @@ golang.org/x/net v0.0.0-20200813134508-3edf25e44fcc/go.mod h1:/O7V0waA8r7cgGh81R golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20210903162142-ad29c8ab022f h1:w6wWR0H+nyVpbSAQbzVEIACVyr/h8l/BEkY6Sokc7Eg= golang.org/x/net v0.0.0-20210903162142-ad29c8ab022f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -752,7 +742,6 @@ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -800,11 +789,8 @@ golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210309074719-68d13333faf2/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210426230700-d19ff857e887/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210903071746-97244b99971b h1:3Dq0eVHn0uaQJmPO+/aYPI/fRMqdrVDbu7MQcku54gg= golang.org/x/sys v0.0.0-20210903071746-97244b99971b/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -815,7 +801,6 @@ golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6 h1:aRYxNxv6iGQlyVaZmk6ZgYEDa+Jg18DxebPSrd6bg1M= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -842,12 +827,10 @@ golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/tools v0.0.0-20191112195655-aa38f8e97acc/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200103221440-774c71fcf114/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= -golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -881,8 +864,8 @@ google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEY google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201111145450-ac7456db90a6/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201119123407-9b1e624d6bc4/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c h1:wtujag7C+4D6KMoulW9YauvK2lgdvCMS260jsqqBXr0= -google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= +google.golang.org/genproto v0.0.0-20210114201628-6edceaf6022f h1:izedQ6yVIc5mZsRuXzmSreCOlzI0lCU1HpG8yEdMiKw= +google.golang.org/genproto v0.0.0-20210114201628-6edceaf6022f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/grpc v1.33.2 h1:EQyQC3sa8M+p6Ulc8yy9SWSS2GVwyRc83gAbG8lrl4o= google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= diff --git a/proto/cosmos/auth/v1beta1/auth.proto b/proto/cosmos/auth/v1beta1/auth.proto index 9be92bd2ce..72e1d9ec28 100644 --- a/proto/cosmos/auth/v1beta1/auth.proto +++ b/proto/cosmos/auth/v1beta1/auth.proto @@ -2,7 +2,6 @@ syntax = "proto3"; package cosmos.auth.v1beta1; import "cosmos_proto/cosmos.proto"; -//import "cosmos.proto"; import "gogoproto/gogo.proto"; import "google/protobuf/any.proto"; @@ -23,7 +22,6 @@ message BaseAccount { [(gogoproto.jsontag) = "public_key,omitempty", (gogoproto.moretags) = "yaml:\"public_key\""]; uint64 account_number = 3 [(gogoproto.moretags) = "yaml:\"account_number\""]; uint64 sequence = 4; - bool pop_is_valid = 5; } // ModuleAccount defines an account for modules that holds coins on a pool. @@ -49,6 +47,4 @@ message Params { [(gogoproto.customname) = "SigVerifyCostED25519", (gogoproto.moretags) = "yaml:\"sig_verify_cost_ed25519\""]; uint64 sig_verify_cost_secp256k1 = 5 [(gogoproto.customname) = "SigVerifyCostSecp256k1", (gogoproto.moretags) = "yaml:\"sig_verify_cost_secp256k1\""]; - uint64 sig_verify_cost_bls12381 = 6 - [(gogoproto.customname) = "SigVerifyCostBls12381", (gogoproto.moretags) = "yaml:\"sig_verify_cost_bls12381\""]; } diff --git a/proto/cosmos/crypto/bls12381/keys.proto b/proto/cosmos/crypto/bls12381/keys.proto deleted file mode 100644 index 54740c32c9..0000000000 --- a/proto/cosmos/crypto/bls12381/keys.proto +++ /dev/null @@ -1,22 +0,0 @@ -syntax = "proto3"; -package cosmos.crypto.bls12381; - -import "gogoproto/gogo.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/crypto/keys/bls12381"; - -// PubKey defines a bls public key -// Key is the uncompressed form of the pubkey. The first byte depends is a 0x02 byte -// if the y-coordinate is the lexicographically largest of the two associated with -// the x-coordinate. Otherwise the first byte is a 0x03. -// This prefix is followed with the x-coordinate. -message PubKey { - option (gogoproto.goproto_stringer) = false; - - bytes key = 1; -} - -// PrivKey defines a bls private key. -message PrivKey { - bytes key = 1; -} \ No newline at end of file diff --git a/simapp/helpers/test_helpers.go b/simapp/helpers/test_helpers.go index b133b4a13c..9ccecbd976 100644 --- a/simapp/helpers/test_helpers.go +++ b/simapp/helpers/test_helpers.go @@ -14,7 +14,7 @@ import ( // SimAppChainID hardcoded chainID for simulation const ( - DefaultGenTxGas = 2000000 + DefaultGenTxGas = 1000000 SimAppChainID = "simulation-app" ) diff --git a/testutil/testdata/tx.go b/testutil/testdata/tx.go index c58fdc70ca..1538460830 100644 --- a/testutil/testdata/tx.go +++ b/testutil/testdata/tx.go @@ -3,8 +3,6 @@ package testdata import ( "encoding/json" - "github.com/cosmos/cosmos-sdk/crypto/keys/bls12381" - "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" sdk "github.com/cosmos/cosmos-sdk/types" @@ -18,14 +16,6 @@ func KeyTestPubAddr() (cryptotypes.PrivKey, cryptotypes.PubKey, sdk.AccAddress) return key, pub, addr } -// KeyTestPubAddrBls12381 generates a new secp256k1 keypair. -func KeyTestPubAddrBls12381() (cryptotypes.PrivKey, cryptotypes.PubKey, sdk.AccAddress) { - key := bls12381.GenPrivKey() - pub := key.PubKey() - addr := sdk.AccAddress(pub.Address()) - return key, pub, addr -} - // NewTestFeeAmount is a test fee amount. func NewTestFeeAmount() sdk.Coins { return sdk.NewCoins(sdk.NewInt64Coin("atom", 150)) @@ -33,7 +23,7 @@ func NewTestFeeAmount() sdk.Coins { // NewTestGasLimit is a test fee gas limit. func NewTestGasLimit() uint64 { - return 150000 + return 100000 } // NewTestMsg creates a message for testing with the given signers. diff --git a/types/errors/errors.go b/types/errors/errors.go index f2a699c53e..026f5f569b 100644 --- a/types/errors/errors.go +++ b/types/errors/errors.go @@ -134,9 +134,6 @@ var ( // supported. ErrNotSupported = Register(RootCodespace, 37, "feature not supported") - // ErrInvalidPop to doc - ErrInvalidPop = Register(RootCodespace, 111000, "invalid pop for public key") - // ErrPanic is only set when we recover from a panic, so we know to // redact potentially sensitive system info ErrPanic = Register(UndefinedCodespace, 111222, "panic") diff --git a/x/auth/ante/ante.go b/x/auth/ante/ante.go index ee474b8fbc..8cc025bad2 100644 --- a/x/auth/ante/ante.go +++ b/x/auth/ante/ante.go @@ -28,7 +28,6 @@ func NewAnteHandler( NewDeductFeeDecorator(ak, bankKeeper), NewSigGasConsumeDecorator(ak, sigGasConsumer), NewSigVerificationDecorator(ak, signModeHandler), - NewSetPopValidDecorator(ak), NewIncrementSequenceDecorator(ak), ) } diff --git a/x/auth/ante/ante_test.go b/x/auth/ante/ante_test.go index 50a71141ef..7659f3e104 100644 --- a/x/auth/ante/ante_test.go +++ b/x/auth/ante/ante_test.go @@ -562,7 +562,7 @@ func (suite *AnteTestSuite) TestAnteHandlerMemoGas() { "tx with memo has enough gas", func() { feeAmount = sdk.NewCoins(sdk.NewInt64Coin("atom", 0)) - gasLimit = 60000 + gasLimit = 50000 suite.txBuilder.SetMemo(strings.Repeat("0123456789", 10)) }, false, @@ -1091,9 +1091,9 @@ func (suite *AnteTestSuite) TestAnteHandlerReCheck() { name string params types.Params }{ - {"memo size check", types.NewParams(1, types.DefaultTxSigLimit, types.DefaultTxSizeCostPerByte, types.DefaultSigVerifyCostED25519, types.DefaultSigVerifyCostSecp256k1, types.DefaultSigVerifyCostBls12381)}, - {"txsize check", types.NewParams(types.DefaultMaxMemoCharacters, types.DefaultTxSigLimit, 10000000, types.DefaultSigVerifyCostED25519, types.DefaultSigVerifyCostSecp256k1, types.DefaultSigVerifyCostBls12381)}, - {"sig verify cost check secp256k1", types.NewParams(types.DefaultMaxMemoCharacters, types.DefaultTxSigLimit, types.DefaultTxSizeCostPerByte, types.DefaultSigVerifyCostED25519, 100000000, types.DefaultSigVerifyCostBls12381)}, + {"memo size check", types.NewParams(1, types.DefaultTxSigLimit, types.DefaultTxSizeCostPerByte, types.DefaultSigVerifyCostED25519, types.DefaultSigVerifyCostSecp256k1)}, + {"txsize check", types.NewParams(types.DefaultMaxMemoCharacters, types.DefaultTxSigLimit, 10000000, types.DefaultSigVerifyCostED25519, types.DefaultSigVerifyCostSecp256k1)}, + {"sig verify cost check", types.NewParams(types.DefaultMaxMemoCharacters, types.DefaultTxSigLimit, types.DefaultTxSizeCostPerByte, types.DefaultSigVerifyCostED25519, 100000000)}, } for _, tc := range testCases { // set testcase parameters diff --git a/x/auth/ante/sigverify.go b/x/auth/ante/sigverify.go index 5ef9ffbfae..6aa0c2a345 100644 --- a/x/auth/ante/sigverify.go +++ b/x/auth/ante/sigverify.go @@ -6,7 +6,6 @@ import ( "encoding/hex" "fmt" - "github.com/cosmos/cosmos-sdk/crypto/keys/bls12381" "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" kmultisig "github.com/cosmos/cosmos-sdk/crypto/keys/multisig" "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" @@ -85,15 +84,6 @@ func (spkd SetPubKeyDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate b if acc.GetPubKey() != nil { continue } - - // Validate public key for bls12381 so that the public key only needs to be checked once - pubkey, ok := pk.(*bls12381.PubKey) - if ok { - if !pubkey.Validate() { - return ctx, sdkerrors.Wrap(sdkerrors.ErrInvalidPubKey, "Invalid public key: either infinity or not subgroup element") - } - } - err = acc.SetPubKey(pk) if err != nil { return ctx, sdkerrors.Wrap(sdkerrors.ErrInvalidPubKey, err.Error()) @@ -318,43 +308,6 @@ func (svd SigVerificationDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simul return next(ctx, tx, simulate) } -// SetPopValidDecorator handles the validation status of the proof-of-possession (POP) of an individual public key. -// A valid transaction and signature can be viewed as a POP for the signer's public key. -// POP is required when forming a compact multisig group in order to prevent rogue public key attacks. -type SetPopValidDecorator struct { - ak AccountKeeper -} - -func NewSetPopValidDecorator(ak AccountKeeper) SetPopValidDecorator { - return SetPopValidDecorator{ - ak: ak, - } -} - -func (spvd SetPopValidDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, next sdk.AnteHandler) (sdk.Context, error) { - sigTx, ok := tx.(authsigning.SigVerifiableTx) - if !ok { - return ctx, sdkerrors.Wrap(sdkerrors.ErrTxDecode, "invalid transaction type") - } - - for _, addr := range sigTx.GetSigners() { - acc := spvd.ak.GetAccount(ctx, addr) - pk := acc.GetPubKey() - - switch pk.(type) { - case *bls12381.PubKey, *secp256k1.PubKey, *ed25519.PubKey: - if !acc.GetPopValid() { - if err := acc.SetPopValid(true); err != nil { - return ctx, sdkerrors.Wrap(sdkerrors.ErrInvalidPop, err.Error()) - } - spvd.ak.SetAccount(ctx, acc) - } - } - } - - return next(ctx, tx, simulate) -} - // IncrementSequenceDecorator handles incrementing sequences of all signers. // Use the IncrementSequenceDecorator decorator to prevent replay attacks. Note, // there is no need to execute IncrementSequenceDecorator on RecheckTX since @@ -455,10 +408,6 @@ func DefaultSigVerificationGasConsumer( } return nil - case *bls12381.PubKey: - meter.ConsumeGas(params.SigVerifyCostBls12381, "ante verify: bls12381") - return nil - default: return sdkerrors.Wrapf(sdkerrors.ErrInvalidPubKey, "unrecognized public key type: %T", pubkey) } diff --git a/x/auth/legacy/v040/migrate.go b/x/auth/legacy/v040/migrate.go index f7ef9b4c92..363ec7ba82 100644 --- a/x/auth/legacy/v040/migrate.go +++ b/x/auth/legacy/v040/migrate.go @@ -8,9 +8,6 @@ import ( v040vesting "github.com/cosmos/cosmos-sdk/x/auth/vesting/types" ) -// blsCostMultiplier is used to calculate bls signature verification cost = blsCostMultiplier * SigVerifyCostED25519 -const blsCostMultiplier = 10 - // convertBaseAccount converts a 0.39 BaseAccount to a 0.40 BaseAccount. func convertBaseAccount(old *v039auth.BaseAccount) *v040auth.BaseAccount { var any *codectypes.Any @@ -121,7 +118,6 @@ func Migrate(authGenState v039auth.GenesisState) *v040auth.GenesisState { MaxMemoCharacters: authGenState.Params.MaxMemoCharacters, TxSigLimit: authGenState.Params.TxSigLimit, TxSizeCostPerByte: authGenState.Params.TxSizeCostPerByte, - SigVerifyCostBls12381: blsCostMultiplier * authGenState.Params.SigVerifyCostED25519, SigVerifyCostED25519: authGenState.Params.SigVerifyCostED25519, SigVerifyCostSecp256k1: authGenState.Params.SigVerifyCostSecp256k1, }, diff --git a/x/auth/legacy/v040/migrate_test.go b/x/auth/legacy/v040/migrate_test.go index 1cbe94276c..e241046095 100644 --- a/x/auth/legacy/v040/migrate_test.go +++ b/x/auth/legacy/v040/migrate_test.go @@ -89,7 +89,6 @@ func TestMigrate(t *testing.T) { "@type": "/cosmos.auth.v1beta1.BaseAccount", "account_number": "1", "address": "cosmos13syh7de9xndv9wmklccpfvc0d8dcyvay4s6z6l", - "pop_is_valid": false, "pub_key": { "@type": "/cosmos.crypto.secp256k1.PubKey", "key": "A8oWyJkohwy8XZ0Df92jFMBTtTPMvYJplYIrlEHTKPYk" @@ -101,7 +100,6 @@ func TestMigrate(t *testing.T) { "base_account": { "account_number": "1", "address": "cosmos1v57fx2l2rt6ehujuu99u2fw05779m5e2ux4z2h", - "pop_is_valid": false, "pub_key": { "@type": "/cosmos.crypto.secp256k1.PubKey", "key": "AruDygh5HprMOpHOEato85dLgAsybMJVyxBGUa3KuWCr" @@ -118,7 +116,6 @@ func TestMigrate(t *testing.T) { "base_account": { "account_number": "1", "address": "cosmos18hnp9fjflrkeeqn4gmhjhzljusxzmjeartdckw", - "pop_is_valid": false, "pub_key": { "@type": "/cosmos.crypto.secp256k1.PubKey", "key": "A5aEFDIdQHh0OYmNXNv1sHBNURDWWgVkXC2IALcWLLwJ" @@ -151,7 +148,6 @@ func TestMigrate(t *testing.T) { "base_account": { "account_number": "1", "address": "cosmos1t9kvvejvk6hjtddx6antck39s206csqduq3ke3", - "pop_is_valid": false, "pub_key": { "@type": "/cosmos.crypto.secp256k1.PubKey", "key": "AoXDzxwTnljemHxfnJcwrKqODBP6Q2l3K3U3UhVDzyah" @@ -176,7 +172,6 @@ func TestMigrate(t *testing.T) { "base_account": { "account_number": "1", "address": "cosmos1s4ss9zquz7skvguechzlk3na635jdrecl0sgy2", - "pop_is_valid": false, "pub_key": { "@type": "/cosmos.crypto.secp256k1.PubKey", "key": "A2a4P4TQ1OKzpfu0eKnCoEtmTvoiclSx0G9higenUGws" @@ -212,7 +207,6 @@ func TestMigrate(t *testing.T) { "base_account": { "account_number": "1", "address": "cosmos1mcc6rwrj4hswf8p9ct82c7lmf77w9tuk07rha4", - "pop_is_valid": false, "pub_key": { "@type": "/cosmos.crypto.secp256k1.PubKey", "key": "A4tuAfmZlhjK5cjp6ImR704miybHnITVNOyJORdDPFu3" @@ -234,14 +228,12 @@ func TestMigrate(t *testing.T) { "@type": "/cosmos.auth.v1beta1.BaseAccount", "account_number": "1", "address": "cosmos16ydaqh0fcnh4qt7a3jme4mmztm2qel5axcpw00", - "pop_is_valid": false, "pub_key": null, "sequence": "0" } ], "params": { "max_memo_characters": "10", - "sig_verify_cost_bls12381": "400", "sig_verify_cost_ed25519": "40", "sig_verify_cost_secp256k1": "50", "tx_sig_limit": "20", diff --git a/x/auth/simulation/genesis.go b/x/auth/simulation/genesis.go index c0311e66a2..2da36b54fa 100644 --- a/x/auth/simulation/genesis.go +++ b/x/auth/simulation/genesis.go @@ -19,7 +19,6 @@ const ( TxSizeCostPerByte = "tx_size_cost_per_byte" SigVerifyCostED25519 = "sig_verify_cost_ed25519" SigVerifyCostSECP256K1 = "sig_verify_cost_secp256k1" - SigVerifyCostBLS12381 = "sig_verify_cost_bls12381" ) // RandomGenesisAccounts defines the default RandomGenesisAccountsFn used on the SDK. @@ -88,11 +87,6 @@ func GenSigVerifyCostSECP256K1(r *rand.Rand) uint64 { return uint64(simulation.RandIntBetween(r, 500, 1000)) } -// GenSigVerifyCostBLS12381 randomized SigVerifyCostBLS12381 -func GenSigVerifyCostBLS12381(r *rand.Rand) uint64 { - return uint64(simulation.RandIntBetween(r, 6000, 12000)) -} - // RandomizedGenState generates a random GenesisState for auth func RandomizedGenState(simState *module.SimulationState, randGenAccountsFn types.RandomGenesisAccountsFn) { var maxMemoChars uint64 @@ -125,14 +119,8 @@ func RandomizedGenState(simState *module.SimulationState, randGenAccountsFn type func(r *rand.Rand) { sigVerifyCostSECP256K1 = GenSigVerifyCostSECP256K1(r) }, ) - var sigVerifyCostBLS12381 uint64 - simState.AppParams.GetOrGenerate( - simState.Cdc, SigVerifyCostBLS12381, &sigVerifyCostBLS12381, simState.Rand, - func(r *rand.Rand) { sigVerifyCostBLS12381 = GenSigVerifyCostBLS12381(r) }, - ) - params := types.NewParams(maxMemoChars, txSigLimit, txSizeCostPerByte, - sigVerifyCostED25519, sigVerifyCostSECP256K1, sigVerifyCostBLS12381) + sigVerifyCostED25519, sigVerifyCostSECP256K1) genesisAccs := randGenAccountsFn(simState) authGenesis := types.NewGenesisState(params, genesisAccs) diff --git a/x/auth/types/account.go b/x/auth/types/account.go index 9b1b89ec6c..eb9939ffce 100644 --- a/x/auth/types/account.go +++ b/x/auth/types/account.go @@ -32,7 +32,6 @@ func NewBaseAccount(address sdk.AccAddress, pubKey cryptotypes.PubKey, accountNu Address: address.String(), AccountNumber: accountNumber, Sequence: sequence, - PopIsValid: false, } err := acc.SetPubKey(pubKey) @@ -118,20 +117,6 @@ func (acc *BaseAccount) SetSequence(seq uint64) error { return nil } -// SetPopValid - Implements sdk.AccountI. -func (acc *BaseAccount) SetPopValid(isValid bool) error { - if acc.PubKey == nil { - return errors.New("public key is not set yet") - } - acc.PopIsValid = isValid - return nil -} - -// GetPopValid - Implements sdk.AccountI. -func (acc *BaseAccount) GetPopValid() bool { - return acc.PopIsValid -} - // Validate checks for errors on the account fields func (acc BaseAccount) Validate() error { if acc.Address == "" || acc.PubKey == nil { @@ -237,11 +222,6 @@ func (ma ModuleAccount) SetSequence(seq uint64) error { return fmt.Errorf("not supported for module accounts") } -// SetPopValid - Implements AccountI -func (ma ModuleAccount) SetPopValid(isValid bool) error { - return fmt.Errorf("not supported for module accounts") -} - // Validate checks for errors on the account fields func (ma ModuleAccount) Validate() error { if strings.TrimSpace(ma.Name) == "" { @@ -344,9 +324,6 @@ type AccountI interface { GetSequence() uint64 SetSequence(uint64) error - GetPopValid() bool - SetPopValid(bool) error - // Ensure that account implements stringer String() string } diff --git a/x/auth/types/auth.pb.go b/x/auth/types/auth.pb.go index c8afc4e899..fa52ac5a8b 100644 --- a/x/auth/types/auth.pb.go +++ b/x/auth/types/auth.pb.go @@ -33,7 +33,6 @@ type BaseAccount struct { PubKey *types.Any `protobuf:"bytes,2,opt,name=pub_key,json=pubKey,proto3" json:"public_key,omitempty" yaml:"public_key"` AccountNumber uint64 `protobuf:"varint,3,opt,name=account_number,json=accountNumber,proto3" json:"account_number,omitempty" yaml:"account_number"` Sequence uint64 `protobuf:"varint,4,opt,name=sequence,proto3" json:"sequence,omitempty"` - PopIsValid bool `protobuf:"varint,5,opt,name=pop_is_valid,json=popIsValid,proto3" json:"pop_is_valid,omitempty"` } func (m *BaseAccount) Reset() { *m = BaseAccount{} } @@ -114,7 +113,6 @@ type Params struct { TxSizeCostPerByte uint64 `protobuf:"varint,3,opt,name=tx_size_cost_per_byte,json=txSizeCostPerByte,proto3" json:"tx_size_cost_per_byte,omitempty" yaml:"tx_size_cost_per_byte"` SigVerifyCostED25519 uint64 `protobuf:"varint,4,opt,name=sig_verify_cost_ed25519,json=sigVerifyCostEd25519,proto3" json:"sig_verify_cost_ed25519,omitempty" yaml:"sig_verify_cost_ed25519"` SigVerifyCostSecp256k1 uint64 `protobuf:"varint,5,opt,name=sig_verify_cost_secp256k1,json=sigVerifyCostSecp256k1,proto3" json:"sig_verify_cost_secp256k1,omitempty" yaml:"sig_verify_cost_secp256k1"` - SigVerifyCostBls12381 uint64 `protobuf:"varint,6,opt,name=sig_verify_cost_bls12381,json=sigVerifyCostBls12381,proto3" json:"sig_verify_cost_bls12381,omitempty" yaml:"sig_verify_cost_bls12381"` } func (m *Params) Reset() { *m = Params{} } @@ -184,13 +182,6 @@ func (m *Params) GetSigVerifyCostSecp256k1() uint64 { return 0 } -func (m *Params) GetSigVerifyCostBls12381() uint64 { - if m != nil { - return m.SigVerifyCostBls12381 - } - return 0 -} - func init() { proto.RegisterType((*BaseAccount)(nil), "cosmos.auth.v1beta1.BaseAccount") proto.RegisterType((*ModuleAccount)(nil), "cosmos.auth.v1beta1.ModuleAccount") @@ -200,53 +191,49 @@ func init() { func init() { proto.RegisterFile("cosmos/auth/v1beta1/auth.proto", fileDescriptor_7e1f7e915d020d2d) } var fileDescriptor_7e1f7e915d020d2d = []byte{ - // 738 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x54, 0xcf, 0x4e, 0xe3, 0x46, - 0x18, 0x8f, 0x21, 0x0d, 0x61, 0x02, 0x48, 0x98, 0x04, 0x9c, 0xb4, 0xf2, 0x58, 0x3e, 0xa5, 0x52, - 0xe3, 0x28, 0x41, 0x54, 0x25, 0xaa, 0xaa, 0x62, 0xda, 0x03, 0x6a, 0x41, 0xc8, 0x48, 0x1c, 0xaa, - 0x4a, 0xde, 0xb1, 0x33, 0x18, 0x8b, 0x38, 0x63, 0x3c, 0x63, 0x14, 0xf3, 0x04, 0x7b, 0xdc, 0xe3, - 0xde, 0x96, 0x87, 0xe0, 0x0d, 0xf6, 0xb2, 0x47, 0xc4, 0x61, 0xb5, 0x27, 0x6b, 0x15, 0x2e, 0xab, - 0x3d, 0xfa, 0x09, 0x56, 0x1e, 0x3b, 0x21, 0x41, 0xd9, 0x53, 0xfc, 0xfd, 0xbe, 0xdf, 0x9f, 0x99, - 0x6f, 0x26, 0x03, 0x64, 0x9b, 0x50, 0x8f, 0xd0, 0x36, 0x0a, 0xd9, 0x65, 0xfb, 0xa6, 0x63, 0x61, - 0x86, 0x3a, 0xbc, 0xd0, 0xfc, 0x80, 0x30, 0x22, 0x6e, 0x65, 0x7d, 0x8d, 0x43, 0x79, 0xbf, 0x51, - 0xcf, 0x40, 0x93, 0x53, 0xda, 0x39, 0x83, 0x17, 0x8d, 0xaa, 0x43, 0x1c, 0x92, 0xe1, 0xe9, 0x57, - 0x8e, 0xd6, 0x1d, 0x42, 0x9c, 0x01, 0x6e, 0xf3, 0xca, 0x0a, 0x2f, 0xda, 0x68, 0x18, 0x65, 0x2d, - 0xf5, 0xdd, 0x12, 0xa8, 0xe8, 0x88, 0xe2, 0x03, 0xdb, 0x26, 0xe1, 0x90, 0x89, 0x12, 0x58, 0x41, - 0xfd, 0x7e, 0x80, 0x29, 0x95, 0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 0x00, 0xff, 0xff, 0xd9, 0x96, 0xbb, 0xf8, 0x0f, 0x05, + // 674 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x54, 0x4d, 0x4f, 0xdb, 0x4a, + 0x14, 0x8d, 0x5f, 0xf2, 0xf8, 0x98, 0x00, 0x12, 0x26, 0x80, 0x93, 0xf7, 0x64, 0x5b, 0x5e, 0xe5, + 0x49, 0x2f, 0x8e, 0x92, 0x8a, 0x4a, 0x64, 0x51, 0x15, 0xd3, 0x2e, 0x50, 0x0b, 0x42, 0x46, 0xea, + 0xa2, 0xaa, 0xe4, 0x8e, 0x9d, 0xc1, 0x58, 0x64, 0x32, 0xc6, 0x33, 0x46, 0x31, 0xbf, 0xa0, 0xcb, + 0x2e, 0xbb, 0xe4, 0x47, 0xf0, 0x0f, 0xba, 0xe9, 0x12, 0xb1, 0xea, 0xca, 0xad, 0xc2, 0xa6, 0xea, + 0x32, 0xfb, 0x4a, 0x95, 0x67, 0x9c, 0x90, 0xa0, 0x74, 0x95, 0xb9, 0xe7, 0x9c, 0x7b, 0xee, 0x9d, + 0x7b, 0xe3, 0x01, 0xaa, 0x47, 0x28, 0x26, 0xb4, 0x09, 0x63, 0x76, 0xd6, 0xbc, 0x6c, 0xb9, 0x88, + 0xc1, 0x16, 0x0f, 0xcc, 0x30, 0x22, 0x8c, 0xc8, 0x1b, 0x82, 0x37, 0x39, 0x94, 0xf3, 0xb5, 0xaa, + 0x00, 0x1d, 0x2e, 0x69, 0xe6, 0x0a, 0x1e, 0xd4, 0x2a, 0x3e, 0xf1, 0x89, 0xc0, 0xb3, 0x53, 0x8e, + 0x56, 0x7d, 0x42, 0xfc, 0x1e, 0x6a, 0xf2, 0xc8, 0x8d, 0x4f, 0x9b, 0xb0, 0x9f, 0x08, 0xca, 0xf8, + 0x25, 0x81, 0xb2, 0x05, 0x29, 0xda, 0xf3, 0x3c, 0x12, 0x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a5, 0x5b, 0x9d, 0x61, 0xaa, 0x55, 0x4e, 0x02, 0xff, 0x0d, 0x57, + 0x64, 0xa9, 0x2f, 0x5f, 0x70, 0x7e, 0x94, 0x6a, 0xaa, 0xa8, 0xf6, 0x07, 0x03, 0xc3, 0xae, 0xd0, + 0x99, 0x3c, 0x01, 0xcb, 0x09, 0xa8, 0x3e, 0xce, 0xa0, 0xc8, 0x0b, 0xdb, 0x3b, 0x4f, 0xcf, 0x5b, + 0xca, 0xdf, 0xbc, 0xe8, 0xb3, 0x61, 0xaa, 0x6d, 0xcd, 0x14, 0x3d, 0x19, 0x2b, 0x46, 0xa9, 0xa6, + 0xcf, 0x2f, 0x3b, 0x31, 0x31, 0xec, 0x2d, 0x3a, 0x37, 0xb7, 0xb3, 0x94, 0xff, 0x67, 0x25, 0x6b, + 0xff, 0xcb, 0x50, 0x95, 0x6e, 0x87, 0xaa, 0xf4, 0x7d, 0xa8, 0x4a, 0x1f, 0xef, 0xd5, 0xc2, 0xed, + 0xbd, 0x5a, 0xf8, 0x7a, 0xaf, 0x16, 0xde, 0xfe, 0xe7, 0x07, 0xec, 0x2c, 0x76, 0x4d, 0x8f, 0xe0, + 0xfc, 0x2d, 0xc8, 0x7f, 0x1a, 0xb4, 0x7b, 0xde, 0x1c, 0x88, 0xa7, 0x85, 0x25, 0x21, 0xa2, 0xee, + 0x02, 0xff, 0x52, 0x9f, 0xfc, 0x0e, 0x00, 0x00, 0xff, 0xff, 0x49, 0x90, 0x16, 0xd9, 0x76, 0x04, 0x00, 0x00, } @@ -284,9 +271,6 @@ func (this *Params) Equal(that interface{}) bool { if this.SigVerifyCostSecp256k1 != that1.SigVerifyCostSecp256k1 { return false } - if this.SigVerifyCostBls12381 != that1.SigVerifyCostBls12381 { - return false - } return true } func (m *BaseAccount) Marshal() (dAtA []byte, err error) { @@ -309,16 +293,6 @@ func (m *BaseAccount) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if m.PopIsValid { - i-- - if m.PopIsValid { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x28 - } if m.Sequence != 0 { i = encodeVarintAuth(dAtA, i, uint64(m.Sequence)) i-- @@ -422,11 +396,6 @@ func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if m.SigVerifyCostBls12381 != 0 { - i = encodeVarintAuth(dAtA, i, uint64(m.SigVerifyCostBls12381)) - i-- - dAtA[i] = 0x30 - } if m.SigVerifyCostSecp256k1 != 0 { i = encodeVarintAuth(dAtA, i, uint64(m.SigVerifyCostSecp256k1)) i-- @@ -486,9 +455,6 @@ func (m *BaseAccount) Size() (n int) { if m.Sequence != 0 { n += 1 + sovAuth(uint64(m.Sequence)) } - if m.PopIsValid { - n += 2 - } return n } @@ -536,9 +502,6 @@ func (m *Params) Size() (n int) { if m.SigVerifyCostSecp256k1 != 0 { n += 1 + sovAuth(uint64(m.SigVerifyCostSecp256k1)) } - if m.SigVerifyCostBls12381 != 0 { - n += 1 + sovAuth(uint64(m.SigVerifyCostBls12381)) - } return n } @@ -683,26 +646,6 @@ func (m *BaseAccount) Unmarshal(dAtA []byte) error { break } } - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field PopIsValid", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAuth - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.PopIsValid = bool(v != 0) default: iNdEx = preIndex skippy, err := skipAuth(dAtA[iNdEx:]) @@ -998,25 +941,6 @@ func (m *Params) Unmarshal(dAtA []byte) error { break } } - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field SigVerifyCostBls12381", wireType) - } - m.SigVerifyCostBls12381 = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAuth - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.SigVerifyCostBls12381 |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } default: iNdEx = preIndex skippy, err := skipAuth(dAtA[iNdEx:]) diff --git a/x/auth/types/params.go b/x/auth/types/params.go index 632de20cae..13db369d23 100644 --- a/x/auth/types/params.go +++ b/x/auth/types/params.go @@ -15,7 +15,6 @@ const ( DefaultTxSizeCostPerByte uint64 = 10 DefaultSigVerifyCostED25519 uint64 = 590 DefaultSigVerifyCostSecp256k1 uint64 = 1000 - DefaultSigVerifyCostBls12381 uint64 = 6300 ) // Parameter keys @@ -25,14 +24,13 @@ var ( KeyTxSizeCostPerByte = []byte("TxSizeCostPerByte") KeySigVerifyCostED25519 = []byte("SigVerifyCostED25519") KeySigVerifyCostSecp256k1 = []byte("SigVerifyCostSecp256k1") - KeySigVerifyCostBls12381 = []byte("SigVerifyCostBls12381") ) var _ paramtypes.ParamSet = &Params{} // NewParams creates a new Params object func NewParams( - maxMemoCharacters, txSigLimit, txSizeCostPerByte, sigVerifyCostED25519, sigVerifyCostSecp256k1 uint64, sigVerifyCostBls12381 uint64, + maxMemoCharacters, txSigLimit, txSizeCostPerByte, sigVerifyCostED25519, sigVerifyCostSecp256k1 uint64, ) Params { return Params{ MaxMemoCharacters: maxMemoCharacters, @@ -40,7 +38,6 @@ func NewParams( TxSizeCostPerByte: txSizeCostPerByte, SigVerifyCostED25519: sigVerifyCostED25519, SigVerifyCostSecp256k1: sigVerifyCostSecp256k1, - SigVerifyCostBls12381: sigVerifyCostBls12381, } } @@ -58,7 +55,6 @@ func (p *Params) ParamSetPairs() paramtypes.ParamSetPairs { paramtypes.NewParamSetPair(KeyTxSizeCostPerByte, &p.TxSizeCostPerByte, validateTxSizeCostPerByte), paramtypes.NewParamSetPair(KeySigVerifyCostED25519, &p.SigVerifyCostED25519, validateSigVerifyCostED25519), paramtypes.NewParamSetPair(KeySigVerifyCostSecp256k1, &p.SigVerifyCostSecp256k1, validateSigVerifyCostSecp256k1), - paramtypes.NewParamSetPair(KeySigVerifyCostBls12381, &p.SigVerifyCostBls12381, validateSigVerifyCostBls12381), } } @@ -70,7 +66,6 @@ func DefaultParams() Params { TxSizeCostPerByte: DefaultTxSizeCostPerByte, SigVerifyCostED25519: DefaultSigVerifyCostED25519, SigVerifyCostSecp256k1: DefaultSigVerifyCostSecp256k1, - SigVerifyCostBls12381: DefaultSigVerifyCostBls12381, } } @@ -119,19 +114,6 @@ func validateSigVerifyCostSecp256k1(i interface{}) error { return nil } -func validateSigVerifyCostBls12381(i interface{}) error { - v, ok := i.(uint64) - if !ok { - return fmt.Errorf("invalid parameter type: %T", i) - } - - if v == 0 { - return fmt.Errorf("invalid BLS12381 signature verification cost: %d", v) - } - - return nil -} - func validateMaxMemoCharacters(i interface{}) error { v, ok := i.(uint64) if !ok { @@ -169,9 +151,6 @@ func (p Params) Validate() error { if err := validateSigVerifyCostSecp256k1(p.SigVerifyCostSecp256k1); err != nil { return err } - if err := validateSigVerifyCostBls12381(p.SigVerifyCostBls12381); err != nil { - return err - } if err := validateMaxMemoCharacters(p.MaxMemoCharacters); err != nil { return err } diff --git a/x/auth/types/params_test.go b/x/auth/types/params_test.go index 854514499f..fcec36cb83 100644 --- a/x/auth/types/params_test.go +++ b/x/auth/types/params_test.go @@ -26,17 +26,15 @@ func TestParams_Validate(t *testing.T) { }{ {"default params", types.DefaultParams(), nil}, {"invalid tx signature limit", types.NewParams(types.DefaultMaxMemoCharacters, 0, types.DefaultTxSizeCostPerByte, - types.DefaultSigVerifyCostED25519, types.DefaultSigVerifyCostSecp256k1, types.DefaultSigVerifyCostBls12381), fmt.Errorf("invalid tx signature limit: 0")}, + types.DefaultSigVerifyCostED25519, types.DefaultSigVerifyCostSecp256k1), fmt.Errorf("invalid tx signature limit: 0")}, {"invalid ED25519 signature verification cost", types.NewParams(types.DefaultMaxMemoCharacters, types.DefaultTxSigLimit, types.DefaultTxSizeCostPerByte, - 0, types.DefaultSigVerifyCostSecp256k1, types.DefaultSigVerifyCostBls12381), fmt.Errorf("invalid ED25519 signature verification cost: 0")}, + 0, types.DefaultSigVerifyCostSecp256k1), fmt.Errorf("invalid ED25519 signature verification cost: 0")}, {"invalid SECK256k1 signature verification cost", types.NewParams(types.DefaultMaxMemoCharacters, types.DefaultTxSigLimit, types.DefaultTxSizeCostPerByte, - types.DefaultSigVerifyCostED25519, 0, types.DefaultSigVerifyCostBls12381), fmt.Errorf("invalid SECK256k1 signature verification cost: 0")}, - {"invalid BLS12381 signature verification cost", types.NewParams(types.DefaultMaxMemoCharacters, types.DefaultTxSigLimit, types.DefaultTxSizeCostPerByte, - types.DefaultSigVerifyCostED25519, types.DefaultSigVerifyCostSecp256k1, 0), fmt.Errorf("invalid BLS12381 signature verification cost: 0")}, + types.DefaultSigVerifyCostED25519, 0), fmt.Errorf("invalid SECK256k1 signature verification cost: 0")}, {"invalid max memo characters", types.NewParams(0, types.DefaultTxSigLimit, types.DefaultTxSizeCostPerByte, - types.DefaultSigVerifyCostED25519, types.DefaultSigVerifyCostSecp256k1, types.DefaultSigVerifyCostBls12381), fmt.Errorf("invalid max memo characters: 0")}, + types.DefaultSigVerifyCostED25519, types.DefaultSigVerifyCostSecp256k1), fmt.Errorf("invalid max memo characters: 0")}, {"invalid tx size cost per byte", types.NewParams(types.DefaultMaxMemoCharacters, types.DefaultTxSigLimit, 0, - types.DefaultSigVerifyCostED25519, types.DefaultSigVerifyCostSecp256k1, types.DefaultSigVerifyCostBls12381), fmt.Errorf("invalid tx size cost per byte: 0")}, + types.DefaultSigVerifyCostED25519, types.DefaultSigVerifyCostSecp256k1), fmt.Errorf("invalid tx size cost per byte: 0")}, } for _, tt := range tests { tt := tt From c777681d48247f543775c019bd7c06ee577685a6 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Mon, 11 Oct 2021 11:49:23 +0200 Subject: [PATCH 02/13] fix: --home flag parsing (backport #10226) (#10272) * fix: --home flag parsing (#10226) ## Description Closes: #XXXX --- CHANGELOG.md | 4 ++++ client/cmd.go | 15 --------------- client/keys/list_test.go | 2 -- simapp/simd/cmd/root.go | 11 +++++++++-- x/genutil/client/cli/init.go | 3 +-- 5 files changed, 14 insertions(+), 21 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cacb1f0b6e..54c4bf73f0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -36,6 +36,10 @@ Ref: https://keepachangelog.com/en/1.0.0/ ## Unreleased +### Bug Fixes + +* (client) [#10226](https://github.com/cosmos/cosmos-sdk/pull/10226) Fix --home flag parsing. + ## [v0.42.10](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.42.10) - 2021-09-28 ### Improvements diff --git a/client/cmd.go b/client/cmd.go index f27aea3691..57b404fc48 100644 --- a/client/cmd.go +++ b/client/cmd.go @@ -245,21 +245,6 @@ func readTxCommandFlags(clientCtx Context, flagSet *pflag.FlagSet) (Context, err return clientCtx, nil } -// ReadHomeFlag checks if home flag is changed. -// If this is a case, we update HomeDir field of Client Context -/* Discovered a bug with Cory -./build/simd init andrei --home ./test -cd test/config there is no client.toml configuration file -*/ -func ReadHomeFlag(clientCtx Context, cmd *cobra.Command) Context { - if cmd.Flags().Changed(flags.FlagHome) { - rootDir, _ := cmd.Flags().GetString(flags.FlagHome) - clientCtx = clientCtx.WithHomeDir(rootDir) - } - - return clientCtx -} - // GetClientQueryContext returns a Context from a command with fields set based on flags // defined in AddQueryFlagsToCmd. An error is returned if any flag query fails. // diff --git a/client/keys/list_test.go b/client/keys/list_test.go index 5904f74bfd..7e3760384c 100644 --- a/client/keys/list_test.go +++ b/client/keys/list_test.go @@ -57,7 +57,6 @@ func Test_runListCmd(t *testing.T) { cmd.SetArgs([]string{ fmt.Sprintf("--%s=%s", flags.FlagHome, tt.kbDir), fmt.Sprintf("--%s=false", flagListNames), - fmt.Sprintf("--%s=%s", flags.FlagKeyringBackend, keyring.BackendTest), }) if err := cmd.ExecuteContext(ctx); (err != nil) != tt.wantErr { @@ -67,7 +66,6 @@ func Test_runListCmd(t *testing.T) { cmd.SetArgs([]string{ fmt.Sprintf("--%s=%s", flags.FlagHome, tt.kbDir), fmt.Sprintf("--%s=true", flagListNames), - fmt.Sprintf("--%s=%s", flags.FlagKeyringBackend, keyring.BackendTest), }) if err := cmd.ExecuteContext(ctx); (err != nil) != tt.wantErr { diff --git a/simapp/simd/cmd/root.go b/simapp/simd/cmd/root.go index 5b1cd1ca5e..2a393fdc12 100644 --- a/simapp/simd/cmd/root.go +++ b/simapp/simd/cmd/root.go @@ -53,9 +53,16 @@ func NewRootCmd() (*cobra.Command, params.EncodingConfig) { Use: "simd", Short: "simulation app", PersistentPreRunE: func(cmd *cobra.Command, _ []string) error { - initClientCtx = client.ReadHomeFlag(initClientCtx, cmd) + // set the default command outputs + cmd.SetOut(cmd.OutOrStdout()) + cmd.SetErr(cmd.ErrOrStderr()) - initClientCtx, err := config.ReadFromClientConfig(initClientCtx) + initClientCtx, err := client.ReadPersistentCommandFlags(initClientCtx, cmd.Flags()) + if err != nil { + return err + } + + initClientCtx, err = config.ReadFromClientConfig(initClientCtx) if err != nil { return err } diff --git a/x/genutil/client/cli/init.go b/x/genutil/client/cli/init.go index f5fda79c69..377857ae73 100644 --- a/x/genutil/client/cli/init.go +++ b/x/genutil/client/cli/init.go @@ -7,7 +7,6 @@ import ( "os" "path/filepath" - "github.com/cosmos/go-bip39" "github.com/pkg/errors" "github.com/spf13/cobra" cfg "github.com/tendermint/tendermint/config" @@ -23,6 +22,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" "github.com/cosmos/cosmos-sdk/x/genutil" + "github.com/cosmos/go-bip39" ) const ( @@ -76,7 +76,6 @@ func InitCmd(mbm module.BasicManager, defaultNodeHome string) *cobra.Command { serverCtx := server.GetServerContextFromCmd(cmd) config := serverCtx.Config - config.SetRoot(clientCtx.HomeDir) chainID, _ := cmd.Flags().GetString(flags.FlagChainID) From c21d875a99b357f11ffb1d551b5fe731258e5dc6 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Tue, 12 Oct 2021 12:46:58 +0200 Subject: [PATCH 03/13] fix: null guard for tx fee amounts (backport #10327) (#10343) * fix: null guard for tx fee amounts (#10327) ## Description It is possible to submit a TX with a fees object containing a Coin with a nil amount. This results in a rather cryptic redacted panic response when the basic validation checks fee Coins for negative amounts. This PR adds an additional check for nil to provide a friendlier error message. --- CHANGELOG.md | 4 ++++ types/coin.go | 18 ++++++++++++++++++ types/coin_test.go | 27 +++++++++++++++++++++++++++ types/tx/types.go | 7 +++++++ 4 files changed, 56 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 54c4bf73f0..b80649f56d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -36,6 +36,10 @@ Ref: https://keepachangelog.com/en/1.0.0/ ## Unreleased +### Improvements + +* [\#10327](https://github.com/cosmos/cosmos-sdk/pull/10327) Add null guard for possible nil `Amount` in tx fee `Coins` + ### Bug Fixes * (client) [#10226](https://github.com/cosmos/cosmos-sdk/pull/10226) Fix --home flag parsing. diff --git a/types/coin.go b/types/coin.go index b86cff5186..2749edadc7 100644 --- a/types/coin.go +++ b/types/coin.go @@ -129,6 +129,11 @@ func (coin Coin) IsNegative() bool { return coin.Amount.Sign() == -1 } +// IsNil returns true if the coin amount is nil and false otherwise. +func (coin Coin) IsNil() bool { + return coin.Amount.i == nil +} + //----------------------------------------------------------------------------- // Coins @@ -543,6 +548,19 @@ func (coins Coins) IsAnyNegative() bool { return false } +// IsAnyNil returns true if there is at least one coin whose amount +// is nil; returns false otherwise. It returns false if the coin set +// is empty too. +func (coins Coins) IsAnyNil() bool { + for _, coin := range coins { + if coin.IsNil() { + return true + } + } + + return false +} + // negative returns a set of coins with all amount negative. // // TODO: Remove once unsigned integers are used. diff --git a/types/coin_test.go b/types/coin_test.go index ab69f16a17..bb1d00f138 100644 --- a/types/coin_test.go +++ b/types/coin_test.go @@ -237,6 +237,20 @@ func (s *coinTestSuite) TestCoinIsZero() { s.Require().False(res) } +func (s *coinTestSuite) TestCoinIsNil() { + coin := sdk.Coin{} + res := coin.IsNil() + s.Require().True(res) + + coin = sdk.Coin{Denom: "uatom"} + res = coin.IsNil() + s.Require().True(res) + + coin = sdk.NewInt64Coin(testDenom1, 1) + res = coin.IsNil() + s.Require().False(res) +} + func (s *coinTestSuite) TestFilteredZeroCoins() { cases := []struct { name string @@ -902,6 +916,19 @@ func (s *coinTestSuite) TestCoinsIsAnyGT() { } } +func (s *coinTestSuite) TestCoinsIsAnyNil() { + twoAtom := sdk.NewInt64Coin("atom", 2) + fiveAtom := sdk.NewInt64Coin("atom", 5) + threeEth := sdk.NewInt64Coin("eth", 3) + nilAtom := sdk.Coin{Denom: "atom"} + + s.Require().True(sdk.Coins{twoAtom, fiveAtom, threeEth, nilAtom}.IsAnyNil()) + s.Require().True(sdk.Coins{twoAtom, nilAtom, fiveAtom, threeEth}.IsAnyNil()) + s.Require().True(sdk.Coins{nilAtom, twoAtom, fiveAtom, threeEth}.IsAnyNil()) + s.Require().False(sdk.Coins{twoAtom, fiveAtom, threeEth}.IsAnyNil()) + +} + func (s *coinTestSuite) TestMarshalJSONCoins() { cdc := codec.NewLegacyAmino() sdk.RegisterLegacyAminoCodec(cdc) diff --git a/types/tx/types.go b/types/tx/types.go index 0392b2fcfd..65313f735b 100644 --- a/types/tx/types.go +++ b/types/tx/types.go @@ -72,6 +72,13 @@ func (t *Tx) ValidateBasic() error { ) } + if fee.Amount.IsAnyNil() { + return sdkerrors.Wrapf( + sdkerrors.ErrInsufficientFee, + "invalid fee provided: null", + ) + } + if fee.Amount.IsAnyNegative() { return sdkerrors.Wrapf( sdkerrors.ErrInsufficientFee, From 2838a45a7692fab3176501325275d7cbc5e8d5ba Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Thu, 14 Oct 2021 11:11:25 +0200 Subject: [PATCH 04/13] perf: Only do memory allocation when zero coin is found (backport #10339) (#10362) * perf: Only do memory allocation when zero coin is found (#10339) ## Description Closes: #10333 Added a loop that checks for zero coins before making any memory allocations. If no zero coins are found, just return the `coins` slice as is. If a zero coin is found, then allocate the new array, stop looking for the first zero, and restart the loop to "remove" the 0's. --- CHANGELOG.md | 1 + types/coin.go | 13 ++++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b80649f56d..02c2c0ce32 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -39,6 +39,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### Improvements * [\#10327](https://github.com/cosmos/cosmos-sdk/pull/10327) Add null guard for possible nil `Amount` in tx fee `Coins` +* [\#10339](https://github.com/cosmos/cosmos-sdk/pull/10339) Improve performance of `removeZeroCoins` by only allocating memory when necessary ### Bug Fixes diff --git a/types/coin.go b/types/coin.go index 2749edadc7..bcc8cd78ee 100644 --- a/types/coin.go +++ b/types/coin.go @@ -579,7 +579,18 @@ func (coins Coins) negative() Coins { // removeZeroCoins removes all zero coins from the given coin set in-place. func removeZeroCoins(coins Coins) Coins { - result := make([]Coin, 0, len(coins)) + for i := 0; i < len(coins); i++ { + if coins[i].IsZero() { + break + } else if i == len(coins)-1 { + return coins + } + } + + var result []Coin + if len(coins) > 0 { + result = make([]Coin, 0, len(coins)-1) + } for _, coin := range coins { if !coin.IsZero() { From 6242def6cefd46f83bb7000526d0d35ded5c1166 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Fri, 15 Oct 2021 18:20:16 +0200 Subject: [PATCH 05/13] build(deps): bump github.com/tendermint/tendermint from 0.34.13 to 0.34.14 (backport #10357) (#10376) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * build(deps): bump github.com/tendermint/tendermint from 0.34.13 to 0.34.14 (#10357) Bumps [github.com/tendermint/tendermint](https://github.com/tendermint/tendermint) from 0.34.13 to 0.34.14.
Release notes

Sourced from github.com/tendermint/tendermint's releases.

0.34.14 (WARNING: BETA SOFTWARE)

https://github.com/tendermint/tendermint/blob/v0.34.14/CHANGELOG.md#v0.34.14

Changelog

Sourced from github.com/tendermint/tendermint's changelog.

v0.34.14

This release backports the rollback feature to allow recovery in the event of an incorrect app hash.

FEATURES

  • #6982 The tendermint binary now has built-in suppport for running the end-to-end test application (with state sync support) (@​cmwaters).
  • [cli] #7033 Add a rollback command to rollback to the previous tendermint state. This may be useful in the event of non-determinstic app hash or when reverting an upgrade. @​cmwaters

IMPROVEMENTS

BUG FIXES

Commits

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=github.com/tendermint/tendermint&package-manager=go_modules&previous-version=0.34.13&new-version=0.34.14)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- CHANGELOG.md | 1 + go.mod | 2 +- go.sum | 3 ++- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 02c2c0ce32..998b7aad7f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -40,6 +40,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * [\#10327](https://github.com/cosmos/cosmos-sdk/pull/10327) Add null guard for possible nil `Amount` in tx fee `Coins` * [\#10339](https://github.com/cosmos/cosmos-sdk/pull/10339) Improve performance of `removeZeroCoins` by only allocating memory when necessary +* (deps) [\#10376](https://github.com/cosmos/cosmos-sdk/pull/10376) Bump Tendermint to [v0.34.14](https://github.com/tendermint/tendermint/releases/tag/v0.34.14). ### Bug Fixes diff --git a/go.mod b/go.mod index dcae062fd3..5e28d86b31 100644 --- a/go.mod +++ b/go.mod @@ -48,7 +48,7 @@ require ( github.com/tendermint/btcd v0.1.1 github.com/tendermint/crypto v0.0.0-20191022145703-50d29ede1e15 github.com/tendermint/go-amino v0.16.0 - github.com/tendermint/tendermint v0.34.13 + github.com/tendermint/tendermint v0.34.14 github.com/tendermint/tm-db v0.6.4 golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad google.golang.org/genproto v0.0.0-20210114201628-6edceaf6022f diff --git a/go.sum b/go.sum index b48ef06495..c06bace7b6 100644 --- a/go.sum +++ b/go.sum @@ -616,8 +616,9 @@ github.com/tendermint/go-amino v0.16.0/go.mod h1:TQU0M1i/ImAo+tYpZi73AU3V/dKeCoM github.com/tendermint/tendermint v0.34.0-rc4/go.mod h1:yotsojf2C1QBOw4dZrTcxbyxmPUrT4hNuOQWX9XUwB4= github.com/tendermint/tendermint v0.34.0-rc6/go.mod h1:ugzyZO5foutZImv0Iyx/gOFCX6mjJTgbLHTwi17VDVg= github.com/tendermint/tendermint v0.34.0/go.mod h1:Aj3PIipBFSNO21r+Lq3TtzQ+uKESxkbA3yo/INM4QwQ= -github.com/tendermint/tendermint v0.34.13 h1:fu+tsHudbOr5PvepjH0q47Jae59hQAvn3IqAHv2EbC8= github.com/tendermint/tendermint v0.34.13/go.mod h1:6RVVRBqwtKhA+H59APKumO+B7Nye4QXSFc6+TYxAxCI= +github.com/tendermint/tendermint v0.34.14 h1:GCXmlS8Bqd2Ix3TQCpwYLUNHe+Y+QyJsm5YE+S/FkPo= +github.com/tendermint/tendermint v0.34.14/go.mod h1:FrwVm3TvsVicI9Z7FlucHV6Znfd5KBc/Lpp69cCwtk0= github.com/tendermint/tm-db v0.6.2/go.mod h1:GYtQ67SUvATOcoY8/+x6ylk8Qo02BQyLrAs+yAcLvGI= github.com/tendermint/tm-db v0.6.3/go.mod h1:lfA1dL9/Y/Y8wwyPp2NMLyn5P5Ptr/gvDFNWtrCWSf8= github.com/tendermint/tm-db v0.6.4 h1:3N2jlnYQkXNQclQwd/eKV/NzlqPlfK21cpRRIx80XXQ= From 358378f78dc8c6e2eb2e6f0ab3446e8c44afe922 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Tue, 9 Nov 2021 13:48:45 +0100 Subject: [PATCH 06/13] fix: unmarshalling issue with multisig keys in master (backport #10061) (#10113) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: unmarshalling issue with multisig keys in master (#10061) (cherry picked from commit 3d3bc7c43218c37c6d0033d578cc7b24968a9be2) # Conflicts: # CHANGELOG.md # crypto/keys/multisig/multisig_test.go * fix conflicts * fix conflicts * Update crypto/keys/multisig/multisig_test.go * Removed unused imports * fix changelog * Update CHANGELOG.md * Fix TestLegacyMultisig test (#10275) Co-authored-by: Henrik Aasted Sørensen Co-authored-by: Aleksandr Bezobchuk Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> Co-authored-by: Robert Zaremba Co-authored-by: Mario Karagiorgas --- CHANGELOG.md | 3 ++- crypto/keys/multisig/amino.go | 23 ++++++++++++++-- crypto/keys/multisig/multisig_test.go | 38 ++++++++++++++++++++++++++- 3 files changed, 60 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 998b7aad7f..c07c1fe137 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -57,6 +57,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### Bug Fixes * [\#9969](https://github.com/cosmos/cosmos-sdk/pull/9969) fix: use keyring in config for add-genesis-account cmd. +* [\#10061](https://github.com/cosmos/cosmos-sdk/pull/10061) Ensure that `LegacyAminoPubKey` struct correctly unmarshals from JSON ### Client Breaking Changes @@ -64,7 +65,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### API Breaking Changes -* [\#10077](https://github.com/cosmos/cosmos-sdk/pull/10077) Remove telemetry on `GasKV` and `CacheKV` store Get/Set operations, significantly improving their performance. ++ [\#10077](https://github.com/cosmos/cosmos-sdk/pull/10077) Remove telemetry on `GasKV` and `CacheKV` store Get/Set operations, significantly improving their performance. ## [v0.42.9](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.42.9) - 2021-08-04 diff --git a/crypto/keys/multisig/amino.go b/crypto/keys/multisig/amino.go index 4849a23173..641fe1f691 100644 --- a/crypto/keys/multisig/amino.go +++ b/crypto/keys/multisig/amino.go @@ -78,9 +78,28 @@ func (m *LegacyAminoPubKey) UnmarshalAminoJSON(tmPk tmMultisig) error { // Instead of just doing `*m = *protoPk`, we prefer to modify in-place the // existing Anys inside `m` (instead of allocating new Anys), as so not to // break the `.compat` fields in the existing Anys. + if m.PubKeys == nil { + m.PubKeys = make([]*types.Any, len(tmPk.PubKeys)) + } for i := range m.PubKeys { - m.PubKeys[i].TypeUrl = protoPk.PubKeys[i].TypeUrl - m.PubKeys[i].Value = protoPk.PubKeys[i].Value + if m.PubKeys[i] == nil { + // create the compat jsonBz value + bz, err := AminoCdc.MarshalJSON(tmPk.PubKeys[i]) + if err != nil { + return err + } + + m.PubKeys[i] = protoPk.PubKeys[i] + // UnmarshalJSON(): + // just sets the compat.jsonBz value. + // always succeeds: err == nil + if err := m.PubKeys[i].UnmarshalJSON(bz); err != nil { + return err + } + } else { + m.PubKeys[i].TypeUrl = protoPk.PubKeys[i].TypeUrl + m.PubKeys[i].Value = protoPk.PubKeys[i].Value + } } m.Threshold = protoPk.Threshold diff --git a/crypto/keys/multisig/multisig_test.go b/crypto/keys/multisig/multisig_test.go index 1284c6c884..0285ae0ef9 100644 --- a/crypto/keys/multisig/multisig_test.go +++ b/crypto/keys/multisig/multisig_test.go @@ -17,6 +17,15 @@ import ( "github.com/cosmos/cosmos-sdk/x/auth/legacy/legacytx" ) +func generatePubKeys(n int) []cryptotypes.PubKey { + pks := make([]cryptotypes.PubKey, n) + for i := 0; i < n; i++ { + pks[i] = secp256k1.GenPrivKey().PubKey() + } + + return pks +} + func TestAddress(t *testing.T) { msg := []byte{1, 2, 3, 4} pubKeys, _ := generatePubKeysAndSignatures(5, msg) @@ -379,5 +388,32 @@ func TestAminoUnmarshalJSON(t *testing.T) { var pk cryptotypes.PubKey err := cdc.UnmarshalJSON([]byte(pkJSON), &pk) require.NoError(t, err) - require.Equal(t, uint32(3), pk.(*kmultisig.LegacyAminoPubKey).Threshold) + lpk := pk.(*kmultisig.LegacyAminoPubKey) + require.Equal(t, uint32(3), lpk.Threshold) + require.Equal(t, 5, len(pk.(*kmultisig.LegacyAminoPubKey).PubKeys)) + + for _, key := range pk.(*kmultisig.LegacyAminoPubKey).PubKeys { + require.NotNil(t, key) + pk := secp256k1.PubKey{} + err := pk.Unmarshal(key.Value) + require.NoError(t, err) + } +} + +func TestProtoMarshalJSON(t *testing.T) { + require := require.New(t) + pubkeys := generatePubKeys(3) + msig := kmultisig.NewLegacyAminoPubKey(2, pubkeys) + + registry := types.NewInterfaceRegistry() + cryptocodec.RegisterInterfaces(registry) + cdc := codec.NewProtoCodec(registry) + + bz, err := cdc.MarshalInterfaceJSON(msig) + require.NoError(err) + + var pk2 cryptotypes.PubKey + err = cdc.UnmarshalInterfaceJSON(bz, &pk2) + require.NoError(err) + require.True(pk2.Equals(msig)) } From f605fa67ce72b00441f05440c8aaf7e9dbba6012 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Fri, 12 Nov 2021 11:15:15 -0500 Subject: [PATCH 07/13] fix: query account balance by ibc denom (backport #10394) (#10524) * fix: query account balance by ibc denom (#10394) ## Description Closes: #10381 --- CHANGELOG.md | 1 + docs/core/proto-docs.md | 1 - proto/cosmos/bank/v1beta1/query.proto | 2 +- x/bank/client/rest/grpc_query_test.go | 4 ++-- x/bank/types/query.pb.gw.go | 28 ++++++++++++--------------- 5 files changed, 16 insertions(+), 20 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c07c1fe137..a1a3c5766e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -45,6 +45,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### Bug Fixes * (client) [#10226](https://github.com/cosmos/cosmos-sdk/pull/10226) Fix --home flag parsing. +* [\#10394](https://github.com/cosmos/cosmos-sdk/issues/10394) Fixes issue related to grpc-gateway of account balance by ibc-denom. ## [v0.42.10](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.42.10) - 2021-09-28 diff --git a/docs/core/proto-docs.md b/docs/core/proto-docs.md index 114db56ecc..8a9337c151 100644 --- a/docs/core/proto-docs.md +++ b/docs/core/proto-docs.md @@ -10281,4 +10281,3 @@ that implements Misbehaviour interface expected by ICS-02 | bool | | bool | boolean | boolean | bool | bool | boolean | TrueClass/FalseClass | | string | A string must always contain UTF-8 encoded or 7-bit ASCII text. | string | String | str/unicode | string | string | string | String (UTF-8) | | bytes | May contain any arbitrary sequence of bytes. | string | ByteString | str | []byte | ByteString | string | String (ASCII-8BIT) | - diff --git a/proto/cosmos/bank/v1beta1/query.proto b/proto/cosmos/bank/v1beta1/query.proto index bc5e29137a..ddf146d9d9 100644 --- a/proto/cosmos/bank/v1beta1/query.proto +++ b/proto/cosmos/bank/v1beta1/query.proto @@ -13,7 +13,7 @@ option go_package = "github.com/cosmos/cosmos-sdk/x/bank/types"; service Query { // Balance queries the balance of a single coin for a single account. rpc Balance(QueryBalanceRequest) returns (QueryBalanceResponse) { - option (google.api.http).get = "/cosmos/bank/v1beta1/balances/{address}/{denom}"; + option (google.api.http).get = "/cosmos/bank/v1beta1/balances/{address}/by_denom"; } // AllBalances queries the balance of all coins for a single account. diff --git a/x/bank/client/rest/grpc_query_test.go b/x/bank/client/rest/grpc_query_test.go index 83ee93c263..e6e04f30fe 100644 --- a/x/bank/client/rest/grpc_query_test.go +++ b/x/bank/client/rest/grpc_query_test.go @@ -227,7 +227,7 @@ func (s *IntegrationTestSuite) TestBalancesGRPCHandler() { }, { "gPRC account balance of a denom", - fmt.Sprintf("%s/cosmos/bank/v1beta1/balances/%s/%s", baseURL, val.Address.String(), s.cfg.BondDenom), + fmt.Sprintf("%s/cosmos/bank/v1beta1/balances/%s/by_denom?denom=%s", baseURL, val.Address.String(), s.cfg.BondDenom), &types.QueryBalanceResponse{}, &types.QueryBalanceResponse{ Balance: &sdk.Coin{ @@ -238,7 +238,7 @@ func (s *IntegrationTestSuite) TestBalancesGRPCHandler() { }, { "gPRC account balance of a bogus denom", - fmt.Sprintf("%s/cosmos/bank/v1beta1/balances/%s/foobar", baseURL, val.Address.String()), + fmt.Sprintf("%s/cosmos/bank/v1beta1/balances/%s/by_denom?denom=foobar", baseURL, val.Address.String()), &types.QueryBalanceResponse{}, &types.QueryBalanceResponse{ Balance: &sdk.Coin{ diff --git a/x/bank/types/query.pb.gw.go b/x/bank/types/query.pb.gw.go index 06c7e2d04a..7c846ca744 100644 --- a/x/bank/types/query.pb.gw.go +++ b/x/bank/types/query.pb.gw.go @@ -31,6 +31,10 @@ var _ = runtime.String var _ = utilities.NewDoubleArray var _ = descriptor.ForMessage +var ( + filter_Query_Balance_0 = &utilities.DoubleArray{Encoding: map[string]int{"address": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} +) + func request_Query_Balance_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq QueryBalanceRequest var metadata runtime.ServerMetadata @@ -53,15 +57,11 @@ func request_Query_Balance_0(ctx context.Context, marshaler runtime.Marshaler, c return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "address", err) } - val, ok = pathParams["denom"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "denom") + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - - protoReq.Denom, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "denom", err) + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Balance_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } msg, err := client.Balance(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) @@ -91,15 +91,11 @@ func local_request_Query_Balance_0(ctx context.Context, marshaler runtime.Marsha return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "address", err) } - val, ok = pathParams["denom"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "denom") + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - - protoReq.Denom, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "denom", err) + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Balance_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } msg, err := server.Balance(ctx, &protoReq) From 0d5a0c1e9b76199688d537cb6e05076bba869cbe Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Tue, 16 Nov 2021 14:12:18 +0100 Subject: [PATCH 08/13] chore: Iavl iterator (backport #10544) (#10546) * chore: Iavl iterator (#10544) ## Description Closes: #10335 This PR adds a custom version of cosmos/iavl(cosmos/iavl#440) that removes the usage of channel-based approach on iterating IAVL tree. replaces https://github.com/cosmos/cosmos-sdk/pull/10404 --- go.mod | 5 +- go.sum | 45 ++----------- store/iavl/store.go | 161 +------------------------------------------- 3 files changed, 9 insertions(+), 202 deletions(-) diff --git a/go.mod b/go.mod index 5e28d86b31..6cbb2da5a4 100644 --- a/go.mod +++ b/go.mod @@ -11,7 +11,7 @@ require ( github.com/btcsuite/btcutil v1.0.2 github.com/confio/ics23/go v0.6.6 github.com/cosmos/go-bip39 v1.0.0 - github.com/cosmos/iavl v0.17.1 + github.com/cosmos/iavl v0.17.2 github.com/cosmos/ledger-cosmos-go v0.11.1 github.com/dgraph-io/ristretto v0.0.3 // indirect github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 // indirect @@ -52,10 +52,11 @@ require ( github.com/tendermint/tm-db v0.6.4 golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad google.golang.org/genproto v0.0.0-20210114201628-6edceaf6022f - google.golang.org/grpc v1.40.0 + google.golang.org/grpc v1.42.0 google.golang.org/protobuf v1.26.0 gopkg.in/ini.v1 v1.61.0 // indirect gopkg.in/yaml.v2 v2.4.0 + ) replace google.golang.org/grpc => google.golang.org/grpc v1.33.2 diff --git a/go.sum b/go.sum index c06bace7b6..c9c3278e30 100644 --- a/go.sum +++ b/go.sum @@ -1,4 +1,3 @@ -bazil.org/fuse v0.0.0-20160811212531-371fbbdaa898/go.mod h1:Xbm+BRKSBEpa4q4hTSxohYNQpsxXPbPry4JJWOB3LB8= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= @@ -98,14 +97,11 @@ github.com/clbanning/x2j v0.0.0-20191024224557-825249438eec/go.mod h1:jMjuTZXRI4 github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= -github.com/confio/ics23/go v0.0.0-20200817220745-f173e6211efb/go.mod h1:E45NqnlpxGnpfTWL/xauN7MRwEE28T4Dd4uraToOaKg= -github.com/confio/ics23/go v0.6.3/go.mod h1:E45NqnlpxGnpfTWL/xauN7MRwEE28T4Dd4uraToOaKg= github.com/confio/ics23/go v0.6.6 h1:pkOy18YxxJ/r0XFDCnrl4Bjv6h4LkBSpLS6F38mrKL8= github.com/confio/ics23/go v0.6.6/go.mod h1:E45NqnlpxGnpfTWL/xauN7MRwEE28T4Dd4uraToOaKg= github.com/containerd/console v1.0.2/go.mod h1:ytZPjGgY2oeTkAONYafi2kSj0aYggsf8acV1PGKCbzQ= +github.com/containerd/continuity v0.0.0-20190827140505-75bee3e2ccb6 h1:NmTXa/uVnDyp0TY5MKi197+3HWcnYWfnHGyaFthlnGw= github.com/containerd/continuity v0.0.0-20190827140505-75bee3e2ccb6/go.mod h1:GL3xCUCBDV3CZiTSEKksMWbLE66hEyuu9qyDOOqM47Y= -github.com/containerd/continuity v0.1.0 h1:UFRRY5JemiAhPZrr/uE0n8fMTLcZsUvySPr1+D7pgr8= -github.com/containerd/continuity v0.1.0/go.mod h1:ICJu0PwR54nI0yPEnJ6jcS+J7CZAUXrLh8lPo2knzsM= github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= @@ -120,11 +116,8 @@ github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfc github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d/go.mod h1:tSxLoYXyBmiFeKpvmq4dzayMdCjCnu8uqmCysIGBT2Y= github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY= github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw= -github.com/cosmos/iavl v0.15.0-rc3.0.20201009144442-230e9bdf52cd/go.mod h1:3xOIaNNX19p0QrX0VqWa6voPRoJRGGYtny+DH8NEPvE= -github.com/cosmos/iavl v0.15.0-rc5/go.mod h1:WqoPL9yPTQ85QBMT45OOUzPxG/U/JcJoN7uMjgxke/I= -github.com/cosmos/iavl v0.15.3/go.mod h1:OLjQiAQ4fGD2KDZooyJG9yz+p2ao2IAYSbke8mVvSA4= -github.com/cosmos/iavl v0.17.1 h1:b/Cl8h1PRMvsu24+TYNlKchIu7W6tmxIBGe6E9u2Ybw= -github.com/cosmos/iavl v0.17.1/go.mod h1:7aisPZK8yCpQdy3PMvKeO+bhq1NwDjUwjzxwwROUxFk= +github.com/cosmos/iavl v0.17.2 h1:BT2u7DUvLLB+RYz9RItn/8n7Bt5xe5rj8QRTkk/PQU0= +github.com/cosmos/iavl v0.17.2/go.mod h1:prJoErZFABYZGDHka1R6Oay4z9PrNeFFiMKHDAMOi4w= github.com/cosmos/keyring v1.1.7-0.20210622111912-ef00f8ac3d76 h1:DdzS1m6o/pCqeZ8VOAit/gyATedRgjvkVI+UCrLpyuU= github.com/cosmos/keyring v1.1.7-0.20210622111912-ef00f8ac3d76/go.mod h1:0mkLWIoZuQ7uBoospo5Q9zIpqq6rYCPJDSUdeCJvPM8= github.com/cosmos/ledger-cosmos-go v0.11.1 h1:9JIYsGnXP613pb2vPjFeMMjBI5lEDsEaF6oYorTy6J4= @@ -143,7 +136,6 @@ github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/decred/dcrd/lru v1.0.0/go.mod h1:mxKOwFd7lFjN2GZYsiz/ecgqR6kkYAl+0pz0tEMk218= -github.com/dgraph-io/badger/v2 v2.2007.1/go.mod h1:26P/7fbL4kUZVEVKLAKXkBXKOydDmM2p1e+NhhnBCAE= github.com/dgraph-io/badger/v2 v2.2007.2 h1:EjjK0KqwaFMlPin1ajhP943VPENHJdEz1KLIegjaI3k= github.com/dgraph-io/badger/v2 v2.2007.2/go.mod h1:26P/7fbL4kUZVEVKLAKXkBXKOydDmM2p1e+NhhnBCAE= github.com/dgraph-io/ristretto v0.0.3-0.20200630154024-f66de99634de/go.mod h1:KPxhHT9ZxKefz+PCeOGsrHpl1qZ7i70dGTu2u+Ahh6E= @@ -190,7 +182,6 @@ github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWo github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= -github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.10.0 h1:dXFJfIHVvUcpSgDOV+Ne6t7jXri8Tfv2uOLHUZ2XNuo= @@ -271,21 +262,17 @@ github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2z github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI= github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= -github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/gorilla/websocket v1.4.2 h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0Ufc= github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/gotestyourself/gotestyourself v2.2.0+incompatible/go.mod h1:zZKM6oeNM8k+FRljX1mnzVYeS8wiGgQyvST1/GafPbY= github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= -github.com/grpc-ecosystem/go-grpc-middleware v1.2.1/go.mod h1:EaizFBKfUKtMIF5iaDEhniwNedqGo9FuLFzppDr3uwI= -github.com/grpc-ecosystem/go-grpc-middleware v1.2.2/go.mod h1:EaizFBKfUKtMIF5iaDEhniwNedqGo9FuLFzppDr3uwI= github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 h1:+9834+KizmvFV7pXQGSXQTsaWhq2GjuNUt0aUU0YBYw= github.com/grpc-ecosystem/go-grpc-middleware v1.3.0/go.mod h1:z0ButlSOZa5vEBq9m2m2hlwIgKw+rp3sdCBRoJY+30Y= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= github.com/grpc-ecosystem/grpc-gateway v1.8.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= -github.com/grpc-ecosystem/grpc-gateway v1.14.7/go.mod h1:oYZKL012gGh6LMyg/xA7Q2yq6j8bu0wa+9w14EEthWU= github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c h1:6rhixN/i8ZofjG1Y75iExal34USq5p+wiN1tpie8IrU= @@ -432,9 +419,8 @@ github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7J github.com/onsi/gomega v1.10.1 h1:o0+MgICZLuZ7xjH7Vx6zS/zcu93/BEp1VwkIW1mEXCE= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk= +github.com/opencontainers/go-digest v1.0.0-rc1 h1:WzifXhOVOEOuFYOJAW6aQqW0TooG2iki3E3Ii+WN7gQ= github.com/opencontainers/go-digest v1.0.0-rc1/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= -github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= -github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= github.com/opencontainers/image-spec v1.0.1 h1:JMemWkRwHx4Zj+fVxWoMCFm/8sYGGrUVojFA6h/TRcI= github.com/opencontainers/image-spec v1.0.1/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0= github.com/opencontainers/runc v0.1.1/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59PVA73FjuZG0U= @@ -540,7 +526,6 @@ github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da/go.mod h1:gi+0XIa01GRL2eRQVjQkKGqKF3SF9vZR/HnPullcV2E= -github.com/sasha-s/go-deadlock v0.2.0/go.mod h1:StQn567HiB1fF2yJ44N9au7wOhrPS3iZqiDbRupzT10= github.com/sasha-s/go-deadlock v0.2.1-0.20190427202633-1595213edefa h1:0U2s5loxrTy6/VgfVoLuVLFJcURKLH49ie0zSch7gh4= github.com/sasha-s/go-deadlock v0.2.1-0.20190427202633-1595213edefa/go.mod h1:F73l+cr82YSh10GxyRI6qZiCgK64VaZjwesgfQ1/iLM= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= @@ -571,7 +556,6 @@ github.com/spf13/cast v1.3.1 h1:nFm6S0SMdyzrzcmThSipiEubIDy8WEXKNZ0UOgiRpng= github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= -github.com/spf13/cobra v1.0.0/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHNrgE= github.com/spf13/cobra v1.1.1/go.mod h1:WnodtKOvamDL/PwE2M4iKs8aMDBZ5Q5klgD3qfVJQMI= github.com/spf13/cobra v1.1.3 h1:xghbfqPkxzxP3C/f3n5DdpAbdKLj4ZE4BWQI362l53M= github.com/spf13/cobra v1.1.3/go.mod h1:pGADOWyqRD/YMrPZigI/zbliZ2wVD/23d+is3pSWzOo= @@ -583,7 +567,6 @@ github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnIn github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= -github.com/spf13/viper v1.4.0/go.mod h1:PTJ7Z/lr49W6bUbkmS1V3by4uWynFiR9p7+dSq/yZzE= github.com/spf13/viper v1.7.0/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= github.com/spf13/viper v1.7.1 h1:pM5oEahlgWv/WnHXpgbKz7iLIxRf65tye2Ci+XFK5sk= github.com/spf13/viper v1.7.1/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= @@ -613,20 +596,13 @@ github.com/tendermint/crypto v0.0.0-20191022145703-50d29ede1e15 h1:hqAk8riJvK4RM github.com/tendermint/crypto v0.0.0-20191022145703-50d29ede1e15/go.mod h1:z4YtwM70uOnk8h0pjJYlj3zdYwi9l03By6iAIF5j/Pk= github.com/tendermint/go-amino v0.16.0 h1:GyhmgQKvqF82e2oZeuMSp9JTN0N09emoSZlb2lyGa2E= github.com/tendermint/go-amino v0.16.0/go.mod h1:TQU0M1i/ImAo+tYpZi73AU3V/dKeCoMC9Sphe2ZwGME= -github.com/tendermint/tendermint v0.34.0-rc4/go.mod h1:yotsojf2C1QBOw4dZrTcxbyxmPUrT4hNuOQWX9XUwB4= -github.com/tendermint/tendermint v0.34.0-rc6/go.mod h1:ugzyZO5foutZImv0Iyx/gOFCX6mjJTgbLHTwi17VDVg= -github.com/tendermint/tendermint v0.34.0/go.mod h1:Aj3PIipBFSNO21r+Lq3TtzQ+uKESxkbA3yo/INM4QwQ= -github.com/tendermint/tendermint v0.34.13/go.mod h1:6RVVRBqwtKhA+H59APKumO+B7Nye4QXSFc6+TYxAxCI= github.com/tendermint/tendermint v0.34.14 h1:GCXmlS8Bqd2Ix3TQCpwYLUNHe+Y+QyJsm5YE+S/FkPo= github.com/tendermint/tendermint v0.34.14/go.mod h1:FrwVm3TvsVicI9Z7FlucHV6Znfd5KBc/Lpp69cCwtk0= -github.com/tendermint/tm-db v0.6.2/go.mod h1:GYtQ67SUvATOcoY8/+x6ylk8Qo02BQyLrAs+yAcLvGI= -github.com/tendermint/tm-db v0.6.3/go.mod h1:lfA1dL9/Y/Y8wwyPp2NMLyn5P5Ptr/gvDFNWtrCWSf8= github.com/tendermint/tm-db v0.6.4 h1:3N2jlnYQkXNQclQwd/eKV/NzlqPlfK21cpRRIx80XXQ= github.com/tendermint/tm-db v0.6.4/go.mod h1:dptYhIpJ2M5kUuenLr+Yyf3zQOv1SgBZcl8/BmWlMBw= github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= -github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= @@ -672,8 +648,6 @@ golang.org/x/crypto v0.0.0-20200510223506-06a226fb4e37/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200709230013-948cd5f35899/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20201117144127-c1f2f97bffc9/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad h1:DN0cp81fZ3njFcrLCytUHRSUkqBjfTo4Tx9RJTWs0EY= golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= @@ -682,7 +656,6 @@ golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= -golang.org/x/exp v0.0.0-20200331195152-e8c3332aa8e5/go.mod h1:4M0jN8W1tt0AVLNr8HDosyJCDCDuyL9N9+3m7wDWgKw= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= @@ -696,7 +669,6 @@ golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCc golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= -golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/net v0.0.0-20180719180050-a680a1efc54d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -713,16 +685,13 @@ golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190522155817-f3200d17e092/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20191002035440-2ec189313ef0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200421231249-e086a090c8fd/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200813134508-3edf25e44fcc/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= @@ -767,7 +736,6 @@ golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190924154521-2837fb4f24fe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191115151921-52ab43148777/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -778,7 +746,6 @@ golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200420163511-1957bb5e6d1f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -828,7 +795,6 @@ golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/tools v0.0.0-20191112195655-aa38f8e97acc/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200103221440-774c71fcf114/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= @@ -862,8 +828,6 @@ google.golang.org/genproto v0.0.0-20200324203455-a04cca1dde73/go.mod h1:55QSHmfG google.golang.org/genproto v0.0.0-20200423170343-7949de9c1215/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= -google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201111145450-ac7456db90a6/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201119123407-9b1e624d6bc4/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210114201628-6edceaf6022f h1:izedQ6yVIc5mZsRuXzmSreCOlzI0lCU1HpG8yEdMiKw= google.golang.org/genproto v0.0.0-20210114201628-6edceaf6022f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= @@ -886,7 +850,6 @@ gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLks gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20200902074654-038fdea0a05b h1:QRR6H1YWRnHb4Y/HeNFCTJLFVxaq6wH4YuVdsUOr75U= gopkg.in/check.v1 v1.0.0-20200902074654-038fdea0a05b/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= diff --git a/store/iavl/store.go b/store/iavl/store.go index e3a3f897d7..b10b36896f 100644 --- a/store/iavl/store.go +++ b/store/iavl/store.go @@ -4,7 +4,6 @@ import ( "errors" "fmt" "io" - "sync" "time" ics23 "github.com/confio/ics23/go" @@ -17,7 +16,6 @@ import ( "github.com/cosmos/cosmos-sdk/store/tracekv" "github.com/cosmos/cosmos-sdk/store/types" "github.com/cosmos/cosmos-sdk/telemetry" - sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/cosmos/cosmos-sdk/types/kv" ) @@ -372,29 +370,7 @@ func getProofFromTree(tree *iavl.MutableTree, key []byte, exists bool) *tmcrypto // Implements types.Iterator. type iavlIterator struct { - // Domain - start, end []byte - - key []byte // The current key (mutable) - value []byte // The current value (mutable) - - // Underlying store - tree *iavl.ImmutableTree - - // Channel to push iteration values. - iterCh chan kv.Pair - - // Close this to release goroutine. - quitCh chan struct{} - - // Close this to signal that state is initialized. - initCh chan struct{} - - mtx sync.Mutex - - ascending bool // Iteration order - - invalid bool // True once, true forever (mutable) + *iavl.Iterator } var _ types.Iterator = (*iavlIterator)(nil) @@ -404,140 +380,7 @@ var _ types.Iterator = (*iavlIterator)(nil) // goroutine. func newIAVLIterator(tree *iavl.ImmutableTree, start, end []byte, ascending bool) *iavlIterator { iter := &iavlIterator{ - tree: tree, - start: sdk.CopyBytes(start), - end: sdk.CopyBytes(end), - ascending: ascending, - iterCh: make(chan kv.Pair), // Set capacity > 0? - quitCh: make(chan struct{}), - initCh: make(chan struct{}), + Iterator: tree.Iterator(start, end, ascending), } - go iter.iterateRoutine() - go iter.initRoutine() return iter } - -// Run this to funnel items from the tree to iterCh. -func (iter *iavlIterator) iterateRoutine() { - iter.tree.IterateRange( - iter.start, iter.end, iter.ascending, - func(key, value []byte) bool { - select { - case <-iter.quitCh: - return true // done with iteration. - case iter.iterCh <- kv.Pair{Key: key, Value: value}: - return false // yay. - } - }, - ) - close(iter.iterCh) // done. -} - -// Run this to fetch the first item. -func (iter *iavlIterator) initRoutine() { - iter.receiveNext() - close(iter.initCh) -} - -// Implements types.Iterator. -func (iter *iavlIterator) Domain() (start, end []byte) { - return iter.start, iter.end -} - -// Implements types.Iterator. -func (iter *iavlIterator) Valid() bool { - iter.waitInit() - iter.mtx.Lock() - - validity := !iter.invalid - iter.mtx.Unlock() - return validity -} - -// Implements types.Iterator. -func (iter *iavlIterator) Next() { - iter.waitInit() - iter.mtx.Lock() - iter.assertIsValid(true) - - iter.receiveNext() - iter.mtx.Unlock() -} - -// Implements types.Iterator. -func (iter *iavlIterator) Key() []byte { - iter.waitInit() - iter.mtx.Lock() - iter.assertIsValid(true) - - key := iter.key - iter.mtx.Unlock() - return key -} - -// Implements types.Iterator. -func (iter *iavlIterator) Value() []byte { - iter.waitInit() - iter.mtx.Lock() - iter.assertIsValid(true) - - val := iter.value - iter.mtx.Unlock() - return val -} - -// Close closes the IAVL iterator by closing the quit channel and waiting for -// the iterCh to finish/close. -func (iter *iavlIterator) Close() error { - close(iter.quitCh) - // wait iterCh to close - for range iter.iterCh { - } - - return nil -} - -// Error performs a no-op. -func (iter *iavlIterator) Error() error { - return nil -} - -//---------------------------------------- - -func (iter *iavlIterator) setNext(key, value []byte) { - iter.assertIsValid(false) - - iter.key = key - iter.value = value -} - -func (iter *iavlIterator) setInvalid() { - iter.assertIsValid(false) - - iter.invalid = true -} - -func (iter *iavlIterator) waitInit() { - <-iter.initCh -} - -func (iter *iavlIterator) receiveNext() { - kvPair, ok := <-iter.iterCh - if ok { - iter.setNext(kvPair.Key, kvPair.Value) - } else { - iter.setInvalid() - } -} - -// assertIsValid panics if the iterator is invalid. If unlockMutex is true, -// it also unlocks the mutex before panicing, to prevent deadlocks in code that -// recovers from panics -func (iter *iavlIterator) assertIsValid(unlockMutex bool) { - if iter.invalid { - if unlockMutex { - iter.mtx.Unlock() - } - panic("invalid iterator") - } -} From 47980d9a6b9637b0d18a8440fb87ed1c373af8f1 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Thu, 2 Dec 2021 16:23:15 +0100 Subject: [PATCH 09/13] build(deps): Bump github.com/cosmos/iavl from 0.17.2 to 0.17.3 (backport #10654) (#10664) * build(deps): Bump github.com/cosmos/iavl from 0.17.2 to 0.17.3 (#10654) Bumps [github.com/cosmos/iavl](https://github.com/cosmos/iavl) from 0.17.2 to 0.17.3. - [Release notes](https://github.com/cosmos/iavl/releases) - [Changelog](https://github.com/cosmos/iavl/blob/v0.17.3/CHANGELOG.md) - [Commits](https://github.com/cosmos/iavl/compare/v0.17.2...v0.17.3) --- CHANGELOG.md | 1 + go.mod | 2 +- go.sum | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a1a3c5766e..75f26e61cc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -41,6 +41,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * [\#10327](https://github.com/cosmos/cosmos-sdk/pull/10327) Add null guard for possible nil `Amount` in tx fee `Coins` * [\#10339](https://github.com/cosmos/cosmos-sdk/pull/10339) Improve performance of `removeZeroCoins` by only allocating memory when necessary * (deps) [\#10376](https://github.com/cosmos/cosmos-sdk/pull/10376) Bump Tendermint to [v0.34.14](https://github.com/tendermint/tendermint/releases/tag/v0.34.14). +* (deps) [\#10654](https://github.com/cosmos/cosmos-sdk/pull/10654) Bump IAVL version to 0.17.3. ### Bug Fixes diff --git a/go.mod b/go.mod index 6cbb2da5a4..2c4c8df5d9 100644 --- a/go.mod +++ b/go.mod @@ -11,7 +11,7 @@ require ( github.com/btcsuite/btcutil v1.0.2 github.com/confio/ics23/go v0.6.6 github.com/cosmos/go-bip39 v1.0.0 - github.com/cosmos/iavl v0.17.2 + github.com/cosmos/iavl v0.17.3 github.com/cosmos/ledger-cosmos-go v0.11.1 github.com/dgraph-io/ristretto v0.0.3 // indirect github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 // indirect diff --git a/go.sum b/go.sum index c9c3278e30..63cbbcfeaa 100644 --- a/go.sum +++ b/go.sum @@ -116,8 +116,8 @@ github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfc github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d/go.mod h1:tSxLoYXyBmiFeKpvmq4dzayMdCjCnu8uqmCysIGBT2Y= github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY= github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw= -github.com/cosmos/iavl v0.17.2 h1:BT2u7DUvLLB+RYz9RItn/8n7Bt5xe5rj8QRTkk/PQU0= -github.com/cosmos/iavl v0.17.2/go.mod h1:prJoErZFABYZGDHka1R6Oay4z9PrNeFFiMKHDAMOi4w= +github.com/cosmos/iavl v0.17.3 h1:s2N819a2olOmiauVa0WAhoIJq9EhSXE9HDBAoR9k+8Y= +github.com/cosmos/iavl v0.17.3/go.mod h1:prJoErZFABYZGDHka1R6Oay4z9PrNeFFiMKHDAMOi4w= github.com/cosmos/keyring v1.1.7-0.20210622111912-ef00f8ac3d76 h1:DdzS1m6o/pCqeZ8VOAit/gyATedRgjvkVI+UCrLpyuU= github.com/cosmos/keyring v1.1.7-0.20210622111912-ef00f8ac3d76/go.mod h1:0mkLWIoZuQ7uBoospo5Q9zIpqq6rYCPJDSUdeCJvPM8= github.com/cosmos/ledger-cosmos-go v0.11.1 h1:9JIYsGnXP613pb2vPjFeMMjBI5lEDsEaF6oYorTy6J4= From a738eaa381d9c3e685323b16a414cefb51f87b0e Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Thu, 2 Dec 2021 16:44:44 +0100 Subject: [PATCH 10/13] fix: Add Events to TxResponse (backport #10630) (#10644) * fix: Add Events to TxResponse (#10630) (cherry picked from commit c4bedf8a5677c11cf6c81d920c7668ef4b435f5d) # Conflicts: # CHANGELOG.md # go.sum # types/abci.pb.go # types/result.go * Michael sucks * Who Let the Bugs Out?? * Reinventing the wheel. Again. * No changes made Co-authored-by: Aleksandr Bezobchuk Co-authored-by: Aleksandr Bezobchuk --- CHANGELOG.md | 1 + proto/cosmos/base/abci/v1beta1/abci.proto | 7 + types/abci.pb.go | 180 +++++++++++++++------- types/result.go | 51 +----- types/result_test.go | 64 ++++++-- 5 files changed, 186 insertions(+), 117 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 75f26e61cc..ff0e05f81d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -38,6 +38,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### Improvements +* (types) [\#10630](https://github.com/cosmos/cosmos-sdk/pull/10630) Add an `Events` field to the `TxResponse` type that captures _all_ events emitted by a transaction, unlike `Logs` which only contains events emitted during message execution. * [\#10327](https://github.com/cosmos/cosmos-sdk/pull/10327) Add null guard for possible nil `Amount` in tx fee `Coins` * [\#10339](https://github.com/cosmos/cosmos-sdk/pull/10339) Improve performance of `removeZeroCoins` by only allocating memory when necessary * (deps) [\#10376](https://github.com/cosmos/cosmos-sdk/pull/10376) Bump Tendermint to [v0.34.14](https://github.com/tendermint/tendermint/releases/tag/v0.34.14). diff --git a/proto/cosmos/base/abci/v1beta1/abci.proto b/proto/cosmos/base/abci/v1beta1/abci.proto index 72da2aacc3..e24ae7bd5e 100644 --- a/proto/cosmos/base/abci/v1beta1/abci.proto +++ b/proto/cosmos/base/abci/v1beta1/abci.proto @@ -39,6 +39,13 @@ message TxResponse { // the timestamps of the valid votes in the block.LastCommit. For height == 1, // it's genesis time. string timestamp = 12; + // Events defines all the events emitted by processing a transaction. Note, + // these events include those emitted by processing all the messages and those + // emitted from the ante handler. Whereas Logs contains the events, with + // additional metadata, emitted only by processing the messages. + // + // Since: cosmos-sdk 0.42.11, 0.44.5, 0.45 + repeated tendermint.abci.Event events = 13 [(gogoproto.nullable) = false]; } // ABCIMessageLog defines a structure containing an indexed tx ABCI message log. diff --git a/types/abci.pb.go b/types/abci.pb.go index 44b35c3536..2e5a4604a7 100644 --- a/types/abci.pb.go +++ b/types/abci.pb.go @@ -57,6 +57,13 @@ type TxResponse struct { // the timestamps of the valid votes in the block.LastCommit. For height == 1, // it's genesis time. Timestamp string `protobuf:"bytes,12,opt,name=timestamp,proto3" json:"timestamp,omitempty"` + // Events defines all the events emitted by processing a transaction. Note, + // these events include those emitted by processing all the messages and those + // emitted from the ante handler. Whereas Logs contains the events, with + // additional metadata, emitted only by processing the messages. + // + // Since: cosmos-sdk 0.42.11, 0.44.5, 0.45 + Events []types1.Event `protobuf:"bytes,13,rep,name=events,proto3" json:"events"` } func (m *TxResponse) Reset() { *m = TxResponse{} } @@ -609,65 +616,66 @@ func init() { } var fileDescriptor_4e37629bc7eb0df8 = []byte{ - // 922 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x55, 0x31, 0x73, 0x1b, 0x45, - 0x14, 0xd6, 0x49, 0xca, 0xc9, 0x7a, 0x72, 0x30, 0x2c, 0x26, 0x39, 0x27, 0xa0, 0x13, 0xe7, 0x64, - 0x46, 0x0d, 0xa7, 0x89, 0x13, 0x18, 0xc6, 0x05, 0x43, 0x2e, 0x10, 0xe2, 0x99, 0x84, 0x62, 0xad, - 0x0c, 0x33, 0x34, 0x9a, 0x95, 0xb4, 0x59, 0x1d, 0xd1, 0xdd, 0x6a, 0x6e, 0x57, 0xb6, 0xd4, 0x51, - 0x52, 0x52, 0xa5, 0xa0, 0xa2, 0xe6, 0x97, 0xa4, 0xc3, 0x65, 0x0a, 0x46, 0x80, 0xdd, 0xa5, 0xf4, - 0x2f, 0x60, 0xf6, 0xed, 0x59, 0x3a, 0x93, 0x91, 0x2b, 0xed, 0xfb, 0xde, 0xdb, 0xb7, 0x6f, 0xbf, - 0xef, 0xd3, 0x1e,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89, 0x35, 0x3e, 0xb0, 0x55, - 0x6a, 0x03, 0xf2, 0x05, 0x54, 0xf4, 0x4c, 0x79, 0x2e, 0xf2, 0x79, 0x67, 0x3d, 0x9f, 0xab, 0xcf, - 0x02, 0x35, 0x1b, 0x2c, 0xa3, 0xd1, 0xd7, 0x6f, 0xfe, 0x6d, 0x96, 0x5e, 0x9f, 0x36, 0x9d, 0x93, - 0xd3, 0xa6, 0xf3, 0xcf, 0x69, 0xd3, 0xf9, 0xf5, 0xac, 0x59, 0x3a, 0x39, 0x6b, 0x96, 0xde, 0x9c, - 0x35, 0x4b, 0x3f, 0x06, 0x22, 0xd6, 0xa3, 0x69, 0x3f, 0x1c, 0xc8, 0xa4, 0x93, 0x7f, 0xe6, 0xec, - 0xcf, 0x67, 0x6a, 0xf8, 0xd2, 0x7e, 0x93, 0xfa, 0x2e, 0xbe, 0x87, 0xf7, 0xff, 0x0b, 0x00, 0x00, - 0xff, 0xff, 0xd8, 0xa9, 0x21, 0xb7, 0x08, 0x07, 0x00, 0x00, + // 929 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x55, 0xcf, 0x6f, 0x1b, 0x45, + 0x14, 0xf6, 0xda, 0xee, 0x3a, 0x7e, 0x4e, 0x08, 0x0c, 0xa1, 0xdd, 0xb4, 0xe0, 0x35, 0x9b, 0x56, + 0xf2, 0x85, 0xb5, 0x9a, 0x06, 0x84, 0x7a, 0x40, 0xd4, 0x85, 0xd2, 0x48, 0x2d, 0x87, 0x89, 0x2b, + 0x24, 0x2e, 0xd6, 0xd8, 0x9e, 0x8e, 0x97, 0x7a, 0x77, 0xac, 0x9d, 0xd9, 0x64, 0x7d, 0xe3, 0xc8, + 0x91, 0x13, 0x07, 0x4e, 0x9c, 0xf9, 0x4b, 0x7a, 0x40, 0x22, 0xc7, 0x1e, 0x90, 0x81, 0xe4, 0xd6, + 0x63, 0xfe, 0x02, 0x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b, 0xfd, 0xbd, + 0xd7, 0x4b, 0xbf, 0x84, 0x16, 0xe2, 0x2d, 0xb0, 0x00, 0x37, 0x95, 0x33, 0x50, 0xb6, 0xea, 0x70, + 0x16, 0xc5, 0x91, 0xd4, 0xcf, 0x72, 0x1d, 0x1b, 0x07, 0x7d, 0x02, 0x35, 0x99, 0x0b, 0xcf, 0xd5, + 0x7c, 0xde, 0x5e, 0xcf, 0x67, 0xf1, 0x67, 0x82, 0xd5, 0x01, 0xc3, 0x68, 0xff, 0xf3, 0x57, 0x7f, + 0xb7, 0x2b, 0x2f, 0xcf, 0xda, 0xce, 0xe9, 0x59, 0xdb, 0xf9, 0xeb, 0xac, 0xed, 0xfc, 0x78, 0xde, + 0xae, 0x9c, 0x9e, 0xb7, 0x2b, 0xaf, 0xce, 0xdb, 0x95, 0x6f, 0x03, 0x16, 0xc9, 0x69, 0x36, 0x0a, + 0xc7, 0x3c, 0xee, 0xd9, 0x3f, 0x47, 0xf3, 0xf3, 0x91, 0x98, 0xbc, 0x30, 0xff, 0x64, 0x23, 0x57, + 0xbf, 0xa2, 0xf7, 0xfe, 0x09, 0x00, 0x00, 0xff, 0xff, 0x03, 0x85, 0x77, 0x9d, 0x3e, 0x07, 0x00, + 0x00, } func (m *TxResponse) Marshal() (dAtA []byte, err error) { @@ -690,6 +698,20 @@ func (m *TxResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.Events) > 0 { + for iNdEx := len(m.Events) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Events[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintAbci(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x6a + } + } if len(m.Timestamp) > 0 { i -= len(m.Timestamp) copy(dAtA[i:], m.Timestamp) @@ -1239,6 +1261,12 @@ func (m *TxResponse) Size() (n int) { if l > 0 { n += 1 + l + sovAbci(uint64(l)) } + if len(m.Events) > 0 { + for _, e := range m.Events { + l = e.Size() + n += 1 + l + sovAbci(uint64(l)) + } + } return n } @@ -1875,6 +1903,40 @@ func (m *TxResponse) Unmarshal(dAtA []byte) error { } m.Timestamp = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 13: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Events", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAbci + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthAbci + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthAbci + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Events = append(m.Events, types1.Event{}) + if err := m.Events[len(m.Events)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipAbci(dAtA[iNdEx:]) diff --git a/types/result.go b/types/result.go index 6a50ecffba..88aa24e34c 100644 --- a/types/result.go +++ b/types/result.go @@ -3,14 +3,10 @@ package types import ( "encoding/hex" "encoding/json" - "fmt" "math" "strings" "github.com/gogo/protobuf/proto" - - yaml "gopkg.in/yaml.v2" - abci "github.com/tendermint/tendermint/abci/types" ctypes "github.com/tendermint/tendermint/rpc/core/types" @@ -21,12 +17,12 @@ import ( var cdc = codec.NewLegacyAmino() func (gi GasInfo) String() string { - bz, _ := yaml.Marshal(gi) + bz, _ := codec.MarshalYAML(codec.NewProtoCodec(nil), &gi) return string(bz) } func (r Result) String() string { - bz, _ := yaml.Marshal(r) + bz, _ := codec.MarshalYAML(codec.NewProtoCodec(nil), &r) return string(bz) } @@ -83,6 +79,7 @@ func NewResponseResultTx(res *ctypes.ResultTx, anyTx *codectypes.Any, timestamp GasUsed: res.TxResult.GasUsed, Tx: anyTx, Timestamp: timestamp, + Events: res.TxResult.Events, } } @@ -123,6 +120,7 @@ func newTxResponseCheckTx(res *ctypes.ResultBroadcastTxCommit) *TxResponse { Info: res.CheckTx.Info, GasWanted: res.CheckTx.GasWanted, GasUsed: res.CheckTx.GasUsed, + Events: res.CheckTx.Events, } } @@ -149,6 +147,7 @@ func newTxResponseDeliverTx(res *ctypes.ResultBroadcastTxCommit) *TxResponse { Info: res.DeliverTx.Info, GasWanted: res.DeliverTx.GasWanted, GasUsed: res.DeliverTx.GasUsed, + Events: res.DeliverTx.Events, } } @@ -171,44 +170,8 @@ func NewResponseFormatBroadcastTx(res *ctypes.ResultBroadcastTx) *TxResponse { } func (r TxResponse) String() string { - var sb strings.Builder - sb.WriteString("Response:\n") - - if r.Height > 0 { - sb.WriteString(fmt.Sprintf(" Height: %d\n", r.Height)) - } - if r.TxHash != "" { - sb.WriteString(fmt.Sprintf(" TxHash: %s\n", r.TxHash)) - } - if r.Code > 0 { - sb.WriteString(fmt.Sprintf(" Code: %d\n", r.Code)) - } - if r.Data != "" { - sb.WriteString(fmt.Sprintf(" Data: %s\n", r.Data)) - } - if r.RawLog != "" { - sb.WriteString(fmt.Sprintf(" Raw Log: %s\n", r.RawLog)) - } - if r.Logs != nil { - sb.WriteString(fmt.Sprintf(" Logs: %s\n", r.Logs)) - } - if r.Info != "" { - sb.WriteString(fmt.Sprintf(" Info: %s\n", r.Info)) - } - if r.GasWanted != 0 { - sb.WriteString(fmt.Sprintf(" GasWanted: %d\n", r.GasWanted)) - } - if r.GasUsed != 0 { - sb.WriteString(fmt.Sprintf(" GasUsed: %d\n", r.GasUsed)) - } - if r.Codespace != "" { - sb.WriteString(fmt.Sprintf(" Codespace: %s\n", r.Codespace)) - } - if r.Timestamp != "" { - sb.WriteString(fmt.Sprintf(" Timestamp: %s\n", r.Timestamp)) - } - - return strings.TrimSpace(sb.String()) + bz, _ := codec.MarshalYAML(codec.NewProtoCodec(nil), &r) + return string(bz) } // Empty returns true if the response is empty diff --git a/types/result_test.go b/types/result_test.go index 6ca9731f8c..ab47b544a2 100644 --- a/types/result_test.go +++ b/types/result_test.go @@ -7,10 +7,8 @@ import ( "testing" "github.com/golang/protobuf/proto" - "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" - abci "github.com/tendermint/tendermint/abci/types" "github.com/tendermint/tendermint/libs/bytes" ctypes "github.com/tendermint/tendermint/rpc/core/types" @@ -101,18 +99,20 @@ func (s *resultTestSuite) TestResponseResultTx() { s.Require().Equal(want, sdk.NewResponseResultTx(resultTx, nil, "timestamp")) s.Require().Equal((*sdk.TxResponse)(nil), sdk.NewResponseResultTx(nil, nil, "timestamp")) - s.Require().Equal(`Response: - Height: 10 - TxHash: 74657374 - Code: 1 - Data: 64617461 - Raw Log: [] - Logs: [] - Info: info - GasWanted: 100 - GasUsed: 90 - Codespace: codespace - Timestamp: timestamp`, sdk.NewResponseResultTx(resultTx, nil, "timestamp").String()) + s.Require().Equal(`code: 1 +codespace: codespace +data: "64617461" +events: [] +gas_used: "90" +gas_wanted: "100" +height: "10" +info: info +logs: [] +raw_log: '[]' +timestamp: timestamp +tx: null +txhash: "74657374" +`, sdk.NewResponseResultTx(resultTx, nil, "timestamp").String()) s.Require().True(sdk.TxResponse{}.Empty()) s.Require().False(want.Empty()) @@ -154,6 +154,18 @@ func (s *resultTestSuite) TestResponseFormatBroadcastTxCommit() { GasWanted: 99, GasUsed: 100, Codespace: "codespace", + Events: []abci.Event{ + { + Type: "message", + Attributes: []abci.EventAttribute{ + { + Key: []byte("action"), + Value: []byte("foo"), + Index: true, + }, + }, + }, + }, }, } deliverTxResult := &ctypes.ResultBroadcastTxCommit{ @@ -167,6 +179,18 @@ func (s *resultTestSuite) TestResponseFormatBroadcastTxCommit() { GasWanted: 99, GasUsed: 100, Codespace: "codespace", + Events: []abci.Event{ + { + Type: "message", + Attributes: []abci.EventAttribute{ + { + Key: []byte("action"), + Value: []byte("foo"), + Index: true, + }, + }, + }, + }, }, } want := &sdk.TxResponse{ @@ -180,6 +204,18 @@ func (s *resultTestSuite) TestResponseFormatBroadcastTxCommit() { Info: "info", GasWanted: 99, GasUsed: 100, + Events: []abci.Event{ + { + Type: "message", + Attributes: []abci.EventAttribute{ + { + Key: []byte("action"), + Value: []byte("foo"), + Index: true, + }, + }, + }, + }, } s.Require().Equal(want, sdk.NewResponseFormatBroadcastTxCommit(checkTxResult)) From 04d26a1a953e69a89bae68bf3fe7be23717fbabf Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Thu, 2 Dec 2021 16:50:16 +0100 Subject: [PATCH 11/13] fix: bech32 address test to satisfy the specification (#10163) (#10164) (#10665) ## Description Closes: #10163 --- types/address_test.go | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/types/address_test.go b/types/address_test.go index 5796c891ac..97fef6e506 100644 --- a/types/address_test.go +++ b/types/address_test.go @@ -407,12 +407,12 @@ func (s *addressTestSuite) TestBech32ifyAddressBytes() { want string wantErr bool }{ - {"empty address", args{"prefixA", []byte{}}, "", false}, + {"empty address", args{"prefixa", []byte{}}, "", false}, {"empty prefix", args{"", addr20byte}, "", true}, - {"10-byte address", args{"prefixA", addr10byte}, "prefixA1qqqsyqcyq5rqwzqfwvmuzx", false}, - {"10-byte address", args{"prefixB", addr10byte}, "prefixB1qqqsyqcyq5rqwzqf4xftmx", false}, - {"20-byte address", args{"prefixA", addr20byte}, "prefixA1qqqsyqcyq5rqwzqfpg9scrgwpugpzysn6j4npq", false}, - {"20-byte address", args{"prefixB", addr20byte}, "prefixB1qqqsyqcyq5rqwzqfpg9scrgwpugpzysn8e9wka", false}, + {"10-byte address", args{"prefixa", addr10byte}, "prefixa1qqqsyqcyq5rqwzqf3953cc", false}, + {"10-byte address", args{"prefixb", addr10byte}, "prefixb1qqqsyqcyq5rqwzqf20xxpc", false}, + {"20-byte address", args{"prefixa", addr20byte}, "prefixa1qqqsyqcyq5rqwzqfpg9scrgwpugpzysn7hzdtn", false}, + {"20-byte address", args{"prefixb", addr20byte}, "prefixb1qqqsyqcyq5rqwzqfpg9scrgwpugpzysnrujsuw", false}, } for _, tt := range tests { tt := tt @@ -440,12 +440,12 @@ func (s *addressTestSuite) TestMustBech32ifyAddressBytes() { want string wantPanic bool }{ - {"empty address", args{"prefixA", []byte{}}, "", false}, + {"empty address", args{"prefixa", []byte{}}, "", false}, {"empty prefix", args{"", addr20byte}, "", true}, - {"10-byte address", args{"prefixA", addr10byte}, "prefixA1qqqsyqcyq5rqwzqfwvmuzx", false}, - {"10-byte address", args{"prefixB", addr10byte}, "prefixB1qqqsyqcyq5rqwzqf4xftmx", false}, - {"20-byte address", args{"prefixA", addr20byte}, "prefixA1qqqsyqcyq5rqwzqfpg9scrgwpugpzysn6j4npq", false}, - {"20-byte address", args{"prefixB", addr20byte}, "prefixB1qqqsyqcyq5rqwzqfpg9scrgwpugpzysn8e9wka", false}, + {"10-byte address", args{"prefixa", addr10byte}, "prefixa1qqqsyqcyq5rqwzqf3953cc", false}, + {"10-byte address", args{"prefixb", addr10byte}, "prefixb1qqqsyqcyq5rqwzqf20xxpc", false}, + {"20-byte address", args{"prefixa", addr20byte}, "prefixa1qqqsyqcyq5rqwzqfpg9scrgwpugpzysn7hzdtn", false}, + {"20-byte address", args{"prefixb", addr20byte}, "prefixb1qqqsyqcyq5rqwzqfpg9scrgwpugpzysnrujsuw", false}, } for _, tt := range tests { tt := tt From 75aa55b9f8ae662220f572bf1692f63074bd6cda Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Mon, 6 Dec 2021 10:23:41 +0100 Subject: [PATCH 12/13] build(deps): Use self-maintained btcutil (#10082) (backport #10201) (#10622) * build(deps): Use self-maintained btcutil (#10082) (#10201) ## Description Closes: #10082 --- CHANGELOG.md | 2 ++ client/keys/show_test.go | 2 +- crypto/keys/secp256k1/secp256k1_test.go | 2 +- go.mod | 7 +++---- go.sum | 15 ++++++++------- types/bech32/bech32.go | 2 +- 6 files changed, 16 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ff0e05f81d..80a583390f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -43,6 +43,8 @@ Ref: https://keepachangelog.com/en/1.0.0/ * [\#10339](https://github.com/cosmos/cosmos-sdk/pull/10339) Improve performance of `removeZeroCoins` by only allocating memory when necessary * (deps) [\#10376](https://github.com/cosmos/cosmos-sdk/pull/10376) Bump Tendermint to [v0.34.14](https://github.com/tendermint/tendermint/releases/tag/v0.34.14). * (deps) [\#10654](https://github.com/cosmos/cosmos-sdk/pull/10654) Bump IAVL version to 0.17.3. +* (deps) [\#10201](https://github.com/cosmos/cosmos-sdk/pull/10201) Migrate from `enigmampc/btcutil` to `cosmos/btcutil`. + ### Bug Fixes diff --git a/client/keys/show_test.go b/client/keys/show_test.go index 7f43450b81..68b78303f6 100644 --- a/client/keys/show_test.go +++ b/client/keys/show_test.go @@ -121,7 +121,7 @@ func Test_runShowCmd(t *testing.T) { require.EqualError(t, cmd.ExecuteContext(ctx), "invalid is not a valid name or address: decoding bech32 failed: invalid bech32 string length 7") cmd.SetArgs([]string{"invalid1", "invalid2"}) - require.EqualError(t, cmd.ExecuteContext(ctx), "invalid1 is not a valid name or address: decoding bech32 failed: invalid index of 1") + require.EqualError(t, cmd.ExecuteContext(ctx), "invalid1 is not a valid name or address: decoding bech32 failed: invalid separator index 7") fakeKeyName1 := "runShowCmd_Key1" fakeKeyName2 := "runShowCmd_Key2" diff --git a/crypto/keys/secp256k1/secp256k1_test.go b/crypto/keys/secp256k1/secp256k1_test.go index 56c67f594b..1994e5057f 100644 --- a/crypto/keys/secp256k1/secp256k1_test.go +++ b/crypto/keys/secp256k1/secp256k1_test.go @@ -8,7 +8,7 @@ import ( "testing" btcSecp256k1 "github.com/btcsuite/btcd/btcec" - "github.com/btcsuite/btcutil/base58" + "github.com/cosmos/btcutil/base58" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "github.com/tendermint/tendermint/crypto" diff --git a/go.mod b/go.mod index 2c4c8df5d9..3baa1b3f36 100644 --- a/go.mod +++ b/go.mod @@ -7,15 +7,14 @@ require ( github.com/DataDog/zstd v1.4.5 // indirect github.com/armon/go-metrics v0.3.8 github.com/bgentry/speakeasy v0.1.0 - github.com/btcsuite/btcd v0.21.0-beta - github.com/btcsuite/btcutil v1.0.2 + github.com/btcsuite/btcd v0.22.0-beta github.com/confio/ics23/go v0.6.6 + github.com/cosmos/btcutil v1.0.4 github.com/cosmos/go-bip39 v1.0.0 github.com/cosmos/iavl v0.17.3 github.com/cosmos/ledger-cosmos-go v0.11.1 github.com/dgraph-io/ristretto v0.0.3 // indirect github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 // indirect - github.com/enigmampc/btcutil v1.0.3-0.20200723161021-e2fb6adb2a25 github.com/gogo/gateway v1.1.0 github.com/gogo/protobuf v1.3.3 github.com/golang/mock v1.4.4 @@ -53,7 +52,7 @@ require ( golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad google.golang.org/genproto v0.0.0-20210114201628-6edceaf6022f google.golang.org/grpc v1.42.0 - google.golang.org/protobuf v1.26.0 + google.golang.org/protobuf v1.27.0 gopkg.in/ini.v1 v1.61.0 // indirect gopkg.in/yaml.v2 v2.4.0 diff --git a/go.sum b/go.sum index 63cbbcfeaa..67e9bb3a4a 100644 --- a/go.sum +++ b/go.sum @@ -67,13 +67,15 @@ github.com/bits-and-blooms/bitset v1.2.0/go.mod h1:gIdJ4wp64HaoK2YrL1Q5/N7Y16edY github.com/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c/go.mod h1:MKsuJmJgSg28kpZDP6UIiPt0e0Oz0kqKNGyRaWEPv84= github.com/btcsuite/btcd v0.0.0-20190115013929-ed77733ec07d/go.mod h1:d3C0AkH6BRcvO8T0UEPu53cnw4IbV63x1bEjildYhO0= github.com/btcsuite/btcd v0.20.1-beta/go.mod h1:wVuoA8VJLEcwgqHBwHmzLRazpKxTv13Px/pDuV7OomQ= -github.com/btcsuite/btcd v0.21.0-beta h1:At9hIZdJW0s9E/fAz28nrz6AmcNlSVucCH796ZteX1M= github.com/btcsuite/btcd v0.21.0-beta/go.mod h1:ZSWyehm27aAuS9bvkATT+Xte3hjHZ+MRgMY/8NJ7K94= +github.com/btcsuite/btcd v0.22.0-beta h1:LTDpDKUM5EeOFBPM8IXpinEcmZ6FWfNZbE3lfrfdnWo= +github.com/btcsuite/btcd v0.22.0-beta/go.mod h1:9n5ntfhhHQBIhUvlhDvD3Qg6fRUj4jkN0VB8L8svzOA= github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f/go.mod h1:TdznJufoqS23FtqVCzL0ZqgP5MqXbb4fg/WgDys70nA= github.com/btcsuite/btcutil v0.0.0-20180706230648-ab6388e0c60a/go.mod h1:+5NJ2+qvTyV9exUAL/rxXi3DcLg2Ts+ymUAY5y4NvMg= github.com/btcsuite/btcutil v0.0.0-20190425235716-9e5f4b9a998d/go.mod h1:+5NJ2+qvTyV9exUAL/rxXi3DcLg2Ts+ymUAY5y4NvMg= -github.com/btcsuite/btcutil v1.0.2 h1:9iZ1Terx9fMIOtq1VrwdqfsATL9MC2l8ZrUY6YZ2uts= github.com/btcsuite/btcutil v1.0.2/go.mod h1:j9HUFwoQRsZL3V4n+qG+CUnEGHOarIxfC3Le2Yhbcts= +github.com/btcsuite/btcutil v1.0.3-0.20201208143702-a53e38424cce h1:YtWJF7RHm2pYCvA5t0RPmAaLUhREsKuKd+SLhxFbFeQ= +github.com/btcsuite/btcutil v1.0.3-0.20201208143702-a53e38424cce/go.mod h1:0DVlHczLPewLcPGEIeUEzfOJhqGPQ0mJJRDBtD307+o= github.com/btcsuite/go-socks v0.0.0-20170105172521-4720035b7bfd/go.mod h1:HHNXQzUsZCxOoE+CPiyCTO6x34Zs86zZUiwtpXoGdtg= github.com/btcsuite/goleveldb v0.0.0-20160330041536-7834afc9e8cd/go.mod h1:F+uVaaLLH7j4eDXPRvw78tMflu7Ie2bzYOH4Y8rRKBY= github.com/btcsuite/goleveldb v1.0.0/go.mod h1:QiK9vBlgftBg6rWQIj6wFzbPfRjiykIEhBH4obrXJ/I= @@ -113,6 +115,8 @@ github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7 github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= +github.com/cosmos/btcutil v1.0.4 h1:n7C2ngKXo7UC9gNyMNLbzqz7Asuf+7Qv4gnX/rOdQ44= +github.com/cosmos/btcutil v1.0.4/go.mod h1:Ffqc8Hn6TJUdDgHBwIZLtrLQC1KdJ9jGJl/TvgUaxbU= github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d/go.mod h1:tSxLoYXyBmiFeKpvmq4dzayMdCjCnu8uqmCysIGBT2Y= github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY= github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw= @@ -159,8 +163,6 @@ github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5m github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU= github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= github.com/edsrzf/mmap-go v1.0.0/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M= -github.com/enigmampc/btcutil v1.0.3-0.20200723161021-e2fb6adb2a25 h1:2vLKys4RBU4pn2T/hjXMbvwTr1Cvy5THHrQkbeY9HRk= -github.com/enigmampc/btcutil v1.0.3-0.20200723161021-e2fb6adb2a25/go.mod h1:hTr8+TLQmkUkgcuh3mcr5fjrT9c64ZzsBCdCEC6UppY= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/facebookgo/ensure v0.0.0-20160127193407-b4ab57deab51 h1:0JZ+dUmQeA8IIVUMzysrX4/AKuQwWhV2dYQuPZdvdSQ= @@ -340,7 +342,6 @@ github.com/keybase/go-keychain v0.0.0-20190712205309-48d3d31d256d/go.mod h1:JJNr github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/kkdai/bstream v0.0.0-20161212061736-f391b8402d23/go.mod h1:J+Gs4SYgM6CZQHDETBtE9HaSEkGmuNXF86RwHhHUvq4= -github.com/kkdai/bstream v1.0.0/go.mod h1:FDnDOHt5Yx4p3FaHcioFT0QjDOtgUpvjeZqAs+NVZZA= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= @@ -646,7 +647,6 @@ golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20200115085410-6d4e4cb37c7d/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200510223506-06a226fb4e37/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200709230013-948cd5f35899/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20201117144127-c1f2f97bffc9/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad h1:DN0cp81fZ3njFcrLCytUHRSUkqBjfTo4Tx9RJTWs0EY= @@ -844,8 +844,9 @@ google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpAD google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.26.0 h1:bxAC2xTBsZGibn2RTntX0oH50xLsqy1OxA9tTL3p/lk= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.27.0 h1:KhgSLlr/moiqjv0qUsSnLvdUL7NH7PHW8aZGn7Jpjko= +google.golang.org/protobuf v1.27.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/types/bech32/bech32.go b/types/bech32/bech32.go index 22a177663e..59bd8b9541 100644 --- a/types/bech32/bech32.go +++ b/types/bech32/bech32.go @@ -3,7 +3,7 @@ package bech32 import ( "fmt" - "github.com/enigmampc/btcutil/bech32" + "github.com/cosmos/btcutil/bech32" ) // ConvertAndEncode converts from a base64 encoded byte string to base32 encoded byte string and then to bech32. From 47de4f07bf50af08f397f657665eafa35893a3f4 Mon Sep 17 00:00:00 2001 From: Amaury <1293565+amaurym@users.noreply.github.com> Date: Tue, 7 Dec 2021 13:22:40 +0100 Subject: [PATCH 13/13] chore: v0.42.11 changelog and release notes (#10695) --- CHANGELOG.md | 7 ++++++- RELEASE_NOTES.md | 22 +++++++++++++--------- 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 80a583390f..46fc621cc6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -36,6 +36,8 @@ Ref: https://keepachangelog.com/en/1.0.0/ ## Unreleased +## [v0.42.11](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.42.11) - 2021-12-07 + ### Improvements * (types) [\#10630](https://github.com/cosmos/cosmos-sdk/pull/10630) Add an `Events` field to the `TxResponse` type that captures _all_ events emitted by a transaction, unlike `Logs` which only contains events emitted during message execution. @@ -49,7 +51,10 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### Bug Fixes * (client) [#10226](https://github.com/cosmos/cosmos-sdk/pull/10226) Fix --home flag parsing. -* [\#10394](https://github.com/cosmos/cosmos-sdk/issues/10394) Fixes issue related to grpc-gateway of account balance by ibc-denom. + +### Client Breaking Changes + +* [\#10394](https://github.com/cosmos/cosmos-sdk/issues/10394) Fixes issue related to grpc-gateway of account balance by ibc-denom. Please use `/cosmos/bank/v1beta1/balances/{address}/by_denom?denom={DENOM or IBC-DENOM}` for querying balances by denom. ## [v0.42.10](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.42.10) - 2021-09-28 diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 9a2a97f9b0..b6e995e99b 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -1,15 +1,19 @@ -# Cosmos SDK v0.42.10 "Stargate" Release Notes +# Cosmos SDK v0.42.11 "Stargate" Release Notes -This release includes a new `AnteHandler` that rejects redundant IBC transactions to save relayers fees. This is a backport of [ibc-go \#235](https://github.com/cosmos/ibc-go/pull/235). +This release includes a client-breaking change for HTTP users querying account balances by denom: -v0.42.10 also includes multiple performance improvements, such as: +```diff +- /cosmos/bank/v1beta1/balances/
/ ++ /cosmos/bank/v1beta1/balances/
/by_denom?denom= +``` -- improve ABCI performance under concurrent load via [Tendermint v0.34.13](https://github.com/tendermint/tendermint/blob/master/CHANGELOG.md#v03413), -- improve CacheKVStore datastructures / algorithms, to no longer take O(N^2) time when interleaving iterators and insertions. -- bump IAVL to v0.17.1 which includes performance improvements on a batch load. +This change was made to fix querying IBC denoms via HTTP. -We fixed the keyring to use pre-configured data for `add-genesis-account` command. +v0.42.11 also includes multiple bugfixes and performance improvements, such as: -Finally, when using the `client.Context`, we modified ABCI queries to use `abci.QueryRequest`'s `Height` field if it is non-zero, otherwise continue using `client.Context`'s height. This is a minor client-breaking change for users of the `client.Context`. +- Upgrade IAVL to 0.17.3 to solve race condition bug in IAVL. +- Bump Tendermint to [v0.34.14](https://github.com/tendermint/tendermint/releases/tag/v0.34.14). -See the [Cosmos SDK v0.42.10 milestone](https://github.com/cosmos/cosmos-sdk/milestone/55?closed=1) on our issue tracker for the exhaustive list of all changes. +Finally, when querying for transactions, we added an `Events` field to the `TxResponse` type that captures _all_ events emitted by a transaction, unlike `Logs` which only contains events emitted during message execution. `Logs` and `Events` may currently contain duplicate data, but `Logs` will be deprecated in a future version. + +See our [CHANGELOG](./CHANGELOG.md) for the exhaustive list of all changes, or a full [commit diff](https://github.com/cosmos/cosmos-sdk/compare/v0.42.09...v0.42.10).