Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tendermint: update to rc3 #6892

Merged
merged 37 commits into from
Aug 14, 2020
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
554a0cf
modify light imports
tac0turtle Jul 30, 2020
d3534f0
change abci.header to tmproto.header
tac0turtle Jul 30, 2020
49aea06
Merge branch 'master' into tm_update_1
tac0turtle Jul 30, 2020
f781527
use rc
tac0turtle Jul 30, 2020
11d3f78
rc
tac0turtle Jul 30, 2020
f98e70a
fix import
tac0turtle Jul 30, 2020
03052b4
Merge branch 'master' into tm_update_1
tac0turtle Jul 30, 2020
dc9b87a
Merge branch 'master' into tm_update_1
alexanderbez Jul 30, 2020
331ba70
Merge PR #6893: fix key imports
tac0turtle Jul 30, 2020
96d8a51
fix rc2
tac0turtle Jul 30, 2020
660ca11
Merge branch 'master' into tm_update_1
tac0turtle Jul 30, 2020
e1d04b7
Merge branch 'master' into tm_update_1
fedekunze Jul 30, 2020
0dcc665
tendermint: update 3 (#6899)
tac0turtle Jul 30, 2020
ba7d377
Merge branch 'master' into tm_update_1
tac0turtle Aug 3, 2020
9d0f660
tendermint: update 4 (#6919)
tac0turtle Aug 3, 2020
f19c9ce
Merge branch 'master' into tm_update_1
tac0turtle Aug 3, 2020
30bd547
Merge branch 'master' into tm_update_1
tac0turtle Aug 4, 2020
a585659
Merge branch 'master' into tm_update_1
tac0turtle Aug 5, 2020
4762dd0
Merge branch 'master' into tm_update_1
tac0turtle Aug 6, 2020
91173b1
tendermint: update 5 (#6923)
tac0turtle Aug 6, 2020
b37f69d
bump to latest master
tac0turtle Aug 6, 2020
00efa6f
Merge branch 'master' into tm_update_1
tac0turtle Aug 6, 2020
6fae6b0
Merge branch 'master' into tm_update_1
tac0turtle Aug 7, 2020
0193208
Merge branch 'master' into tm_update_1
tac0turtle Aug 11, 2020
b0884e9
Merge branch 'master' into tm_update_1
tac0turtle Aug 11, 2020
280a4af
Merge branch 'master' into tm_update_1
tac0turtle Aug 12, 2020
144234b
Merge branch 'master' into tm_update_1
tac0turtle Aug 12, 2020
48ac48f
Merge branch 'master' into tm_update_1
tac0turtle Aug 13, 2020
82f0abc
tendermint: update (#6972)
tac0turtle Aug 14, 2020
3fb12d0
Merge branch 'master' into tm_update_1
tac0turtle Aug 14, 2020
b5e7705
Update x/ibc/07-tendermint/types/test_utils.go
tac0turtle Aug 14, 2020
22d47e2
address comment
tac0turtle Aug 14, 2020
af478fb
Merge branch 'master' into tm_update_1
tac0turtle Aug 14, 2020
12a7ac5
go mod
tac0turtle Aug 14, 2020
dc4782c
bring back things
tac0turtle Aug 14, 2020
09feb5d
fix test
fedekunze Aug 14, 2020
9cdb890
update tm proto files
fedekunze Aug 14, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion baseapp/abci.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"time"

abci "github.com/tendermint/tendermint/abci/types"
tmproto "github.com/tendermint/tendermint/proto/tendermint/types"

"github.com/cosmos/cosmos-sdk/codec"
"github.com/cosmos/cosmos-sdk/telemetry"
Expand All @@ -19,7 +20,7 @@ import (
// InitChain implements the ABCI interface. It runs the initialization logic
// directly on the CommitMultiStore.
func (app *BaseApp) InitChain(req abci.RequestInitChain) (res abci.ResponseInitChain) {
initHeader := abci.Header{ChainID: req.ChainId, Time: req.Time}
initHeader := tmproto.Header{ChainID: req.ChainId, Time: req.Time}

// initialize the deliver state and check state with a correct header
app.setDeliverState(initHeader)
Expand Down
12 changes: 6 additions & 6 deletions baseapp/baseapp.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ import (
"strings"

"github.com/gogo/protobuf/proto"

abci "github.com/tendermint/tendermint/abci/types"
"github.com/tendermint/tendermint/crypto/tmhash"
"github.com/tendermint/tendermint/libs/log"
tmproto "github.com/tendermint/tendermint/proto/tendermint/types"
dbm "github.com/tendermint/tm-db"

"github.com/cosmos/cosmos-sdk/store"
Expand Down Expand Up @@ -257,7 +257,7 @@ func (app *BaseApp) init() error {
}

// needed for the export command which inits from store but never calls initchain
app.setCheckState(abci.Header{})
app.setCheckState(tmproto.Header{})
app.Seal()

return nil
Expand Down Expand Up @@ -307,7 +307,7 @@ func (app *BaseApp) IsSealed() bool { return app.sealed }
// (i.e. a CacheMultiStore) and a new Context with the cache-wrapped multi-store,
// provided header, and minimum gas prices set. It is set on InitChain and reset
// on Commit.
func (app *BaseApp) setCheckState(header abci.Header) {
func (app *BaseApp) setCheckState(header tmproto.Header) {
ms := app.cms.CacheMultiStore()
app.checkState = &state{
ms: ms,
Expand All @@ -319,7 +319,7 @@ func (app *BaseApp) setCheckState(header abci.Header) {
// (i.e. a CacheMultiStore) and a new Context with the cache-wrapped multi-store,
// and provided header. It is set on InitChain and BeginBlock and set to nil on
// Commit.
func (app *BaseApp) setDeliverState(header abci.Header) {
func (app *BaseApp) setDeliverState(header tmproto.Header) {
ms := app.cms.CacheMultiStore()
app.deliverState = &state{
ms: ms,
Expand All @@ -344,14 +344,14 @@ func (app *BaseApp) GetConsensusParams(ctx sdk.Context) *abci.ConsensusParams {
}

if app.paramStore.Has(ctx, ParamStoreKeyEvidenceParams) {
var ep abci.EvidenceParams
var ep tmproto.EvidenceParams

app.paramStore.Get(ctx, ParamStoreKeyEvidenceParams, &ep)
cp.Evidence = &ep
}

if app.paramStore.Has(ctx, ParamStoreKeyValidatorParams) {
var vp abci.ValidatorParams
var vp tmproto.ValidatorParams

app.paramStore.Get(ctx, ParamStoreKeyValidatorParams, &vp)
cp.Validator = &vp
Expand Down
44 changes: 22 additions & 22 deletions baseapp/baseapp_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,18 @@ import (
"sync"
"testing"

"github.com/cosmos/cosmos-sdk/testutil/testdata"

"github.com/gogo/protobuf/jsonpb"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
abci "github.com/tendermint/tendermint/abci/types"
"github.com/tendermint/tendermint/libs/log"
tmproto "github.com/tendermint/tendermint/proto/tendermint/types"
dbm "github.com/tendermint/tm-db"

"github.com/cosmos/cosmos-sdk/codec"
"github.com/cosmos/cosmos-sdk/store/rootmulti"
store "github.com/cosmos/cosmos-sdk/store/types"
"github.com/cosmos/cosmos-sdk/testutil/testdata"
sdk "github.com/cosmos/cosmos-sdk/types"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
)
Expand Down Expand Up @@ -137,13 +137,13 @@ func TestLoadVersion(t *testing.T) {
require.Equal(t, emptyCommitID, lastID)

// execute a block, collect commit ID
header := abci.Header{Height: 1}
header := tmproto.Header{Height: 1}
app.BeginBlock(abci.RequestBeginBlock{Header: header})
res := app.Commit()
commitID1 := sdk.CommitID{Version: 1, Hash: res.Data}

// execute a block, collect commit ID
header = abci.Header{Height: 2}
header = tmproto.Header{Height: 2}
app.BeginBlock(abci.RequestBeginBlock{Header: header})
res = app.Commit()
commitID2 := sdk.CommitID{Version: 2, Hash: res.Data}
Expand Down Expand Up @@ -242,7 +242,7 @@ func TestSetLoader(t *testing.T) {
require.Nil(t, err)

// "execute" one block
app.BeginBlock(abci.RequestBeginBlock{Header: abci.Header{Height: 2}})
app.BeginBlock(abci.RequestBeginBlock{Header: tmproto.Header{Height: 2}})
res := app.Commit()
require.NotNil(t, res.Data)

Expand Down Expand Up @@ -287,7 +287,7 @@ func TestLoadVersionInvalid(t *testing.T) {
err = app.LoadVersion(-1)
require.Error(t, err)

header := abci.Header{Height: 1}
header := tmproto.Header{Height: 1}
app.BeginBlock(abci.RequestBeginBlock{Header: header})
res := app.Commit()
commitID1 := sdk.CommitID{Version: 1, Hash: res.Data}
Expand Down Expand Up @@ -337,7 +337,7 @@ func TestLoadVersionPruning(t *testing.T) {
// Commit seven blocks, of which 7 (latest) is kept in addition to 6, 5
// (keep recent) and 3 (keep every).
for i := int64(1); i <= 7; i++ {
app.BeginBlock(abci.RequestBeginBlock{Header: abci.Header{Height: i}})
app.BeginBlock(abci.RequestBeginBlock{Header: tmproto.Header{Height: i}})
res := app.Commit()
lastCommitID = sdk.CommitID{Version: i, Hash: res.Data}
}
Expand Down Expand Up @@ -527,7 +527,7 @@ func TestInitChainer(t *testing.T) {
require.Equal(t, value, res.Value)

// commit and ensure we can still query
header := abci.Header{Height: app.LastBlockHeight() + 1}
header := tmproto.Header{Height: app.LastBlockHeight() + 1}
app.BeginBlock(abci.RequestBeginBlock{Header: header})
app.Commit()

Expand Down Expand Up @@ -783,7 +783,7 @@ func TestCheckTx(t *testing.T) {
require.Equal(t, nTxs, storedCounter)

// If a block is committed, CheckTx state should be reset.
header := abci.Header{Height: 1}
header := tmproto.Header{Height: 1}
app.BeginBlock(abci.RequestBeginBlock{Header: header})
app.EndBlock(abci.RequestEndBlock{})
app.Commit()
Expand Down Expand Up @@ -818,7 +818,7 @@ func TestDeliverTx(t *testing.T) {
txPerHeight := 5

for blockN := 0; blockN < nBlocks; blockN++ {
header := abci.Header{Height: int64(blockN) + 1}
header := tmproto.Header{Height: int64(blockN) + 1}
app.BeginBlock(abci.RequestBeginBlock{Header: header})

for i := 0; i < txPerHeight; i++ {
Expand Down Expand Up @@ -872,7 +872,7 @@ func TestMultiMsgDeliverTx(t *testing.T) {
// run a multi-msg tx
// with all msgs the same route

header := abci.Header{Height: 1}
header := tmproto.Header{Height: 1}
app.BeginBlock(abci.RequestBeginBlock{Header: header})
tx := newTxCounter(0, 0, 1, 2)
txBytes, err := codec.MarshalBinaryBare(tx)
Expand Down Expand Up @@ -953,7 +953,7 @@ func TestSimulateTx(t *testing.T) {
nBlocks := 3
for blockN := 0; blockN < nBlocks; blockN++ {
count := int64(blockN + 1)
header := abci.Header{Height: count}
header := tmproto.Header{Height: count}
app.BeginBlock(abci.RequestBeginBlock{Header: header})

tx := newTxCounter(count, count)
Expand Down Expand Up @@ -1008,7 +1008,7 @@ func TestRunInvalidTransaction(t *testing.T) {

app := setupBaseApp(t, anteOpt, routerOpt)

header := abci.Header{Height: 1}
header := tmproto.Header{Height: 1}
app.BeginBlock(abci.RequestBeginBlock{Header: header})

// transaction with no messages
Expand Down Expand Up @@ -1136,7 +1136,7 @@ func TestTxGasLimits(t *testing.T) {

app := setupBaseApp(t, anteOpt, routerOpt)

header := abci.Header{Height: 1}
header := tmproto.Header{Height: 1}
app.BeginBlock(abci.RequestBeginBlock{Header: header})

testCases := []struct {
Expand Down Expand Up @@ -1250,7 +1250,7 @@ func TestMaxBlockGasLimits(t *testing.T) {
tx := tc.tx

// reset the block gas
header := abci.Header{Height: app.LastBlockHeight() + 1}
header := tmproto.Header{Height: app.LastBlockHeight() + 1}
app.BeginBlock(abci.RequestBeginBlock{Header: header})

// execute the transaction multiple times
Expand Down Expand Up @@ -1304,7 +1304,7 @@ func TestCustomRunTxPanicHandler(t *testing.T) {

app := setupBaseApp(t, anteOpt, routerOpt)

header := abci.Header{Height: 1}
header := tmproto.Header{Height: 1}
app.BeginBlock(abci.RequestBeginBlock{Header: header})

app.AddRunTxRecoveryHandler(func(recoveryObj interface{}) error {
Expand Down Expand Up @@ -1346,7 +1346,7 @@ func TestBaseAppAnteHandler(t *testing.T) {
app.InitChain(abci.RequestInitChain{})
registerTestCodec(cdc)

header := abci.Header{Height: app.LastBlockHeight() + 1}
header := tmproto.Header{Height: app.LastBlockHeight() + 1}
app.BeginBlock(abci.RequestBeginBlock{Header: header})

// execute a tx that will fail ante handler execution
Expand Down Expand Up @@ -1454,7 +1454,7 @@ func TestGasConsumptionBadTx(t *testing.T) {

app.InitChain(abci.RequestInitChain{})

header := abci.Header{Height: app.LastBlockHeight() + 1}
header := tmproto.Header{Height: app.LastBlockHeight() + 1}
app.BeginBlock(abci.RequestBeginBlock{Header: header})

tx := newTxCounter(5, 0)
Expand Down Expand Up @@ -1519,7 +1519,7 @@ func TestQuery(t *testing.T) {
require.Equal(t, 0, len(res.Value))

// query is still empty after a DeliverTx before we commit
header := abci.Header{Height: app.LastBlockHeight() + 1}
header := tmproto.Header{Height: app.LastBlockHeight() + 1}
app.BeginBlock(abci.RequestBeginBlock{Header: header})

_, resTx, err = app.Deliver(tx)
Expand All @@ -1545,7 +1545,7 @@ func TestGRPCQuery(t *testing.T) {
app := setupBaseApp(t, grpcQueryOpt)

app.InitChain(abci.RequestInitChain{})
header := abci.Header{Height: app.LastBlockHeight() + 1}
header := tmproto.Header{Height: app.LastBlockHeight() + 1}
app.BeginBlock(abci.RequestBeginBlock{Header: header})
app.Commit()

Expand Down Expand Up @@ -1602,7 +1602,7 @@ func TestP2PQuery(t *testing.T) {
func TestGetMaximumBlockGas(t *testing.T) {
app := setupBaseApp(t)
app.InitChain(abci.RequestInitChain{})
ctx := app.NewContext(true, abci.Header{})
ctx := app.NewContext(true, tmproto.Header{})

app.StoreConsensusParams(ctx, &abci.ConsensusParams{Block: &abci.BlockParams{MaxGas: 0}})
require.Equal(t, uint64(0), app.getMaximumBlockGas(ctx))
Expand Down Expand Up @@ -1660,7 +1660,7 @@ func TestWithRouter(t *testing.T) {
txPerHeight := 5

for blockN := 0; blockN < nBlocks; blockN++ {
header := abci.Header{Height: int64(blockN) + 1}
header := tmproto.Header{Height: int64(blockN) + 1}
app.BeginBlock(abci.RequestBeginBlock{Header: header})

for i := 0; i < txPerHeight; i++ {
Expand Down
6 changes: 3 additions & 3 deletions baseapp/helpers.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package baseapp

import (
abci "github.com/tendermint/tendermint/abci/types"
tmproto "github.com/tendermint/tendermint/proto/tendermint/types"

sdk "github.com/cosmos/cosmos-sdk/types"
)
Expand All @@ -19,7 +19,7 @@ func (app *BaseApp) Deliver(tx sdk.Tx) (sdk.GasInfo, *sdk.Result, error) {
}

// Context with current {check, deliver}State of the app used by tests.
func (app *BaseApp) NewContext(isCheckTx bool, header abci.Header) sdk.Context {
func (app *BaseApp) NewContext(isCheckTx bool, header tmproto.Header) sdk.Context {
if isCheckTx {
return sdk.NewContext(app.checkState.ms, header, true, app.logger).
WithMinGasPrices(app.minGasPrices)
Expand All @@ -28,6 +28,6 @@ func (app *BaseApp) NewContext(isCheckTx bool, header abci.Header) sdk.Context {
return sdk.NewContext(app.deliverState.ms, header, false, app.logger)
}

func (app *BaseApp) NewUncachedContext(isCheckTx bool, header abci.Header) sdk.Context {
func (app *BaseApp) NewUncachedContext(isCheckTx bool, header tmproto.Header) sdk.Context {
return sdk.NewContext(app.cms, header, isCheckTx, app.logger)
}
4 changes: 2 additions & 2 deletions client/debug/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func Cmd() *cobra.Command {
// to decode the pubkey string from hex, base64, and finally bech32. If all
// encodings fail, an error is returned.
func getPubKeyFromString(pkstr string) (crypto.PubKey, error) {
var pubKey ed25519.PubKeyEd25519
var pubKey ed25519.PubKey

bz, err := hex.DecodeString(pkstr)
if err == nil {
Expand Down Expand Up @@ -85,7 +85,7 @@ $ %s debug pubkey cosmos1e0jnq2sun3dzjh8p2xq95kk0expwmd7shwjpfg
return err
}

edPK, ok := pk.(ed25519.PubKeyEd25519)
edPK, ok := pk.(ed25519.PubKey)
if !ok {
return fmt.Errorf("invalid pubkey type; expected ED25519")
}
Expand Down
24 changes: 12 additions & 12 deletions crypto/codec/amino.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,22 +21,22 @@ func init() {
// codec.
func RegisterCrypto(cdc *codec.Codec) {
cdc.RegisterInterface((*crypto.PubKey)(nil), nil)
cdc.RegisterConcrete(ed25519.PubKeyEd25519{},
ed25519.PubKeyAminoName, nil)
cdc.RegisterConcrete(sr25519.PubKeySr25519{},
sr25519.PubKeyAminoName, nil)
cdc.RegisterConcrete(secp256k1.PubKeySecp256k1{},
secp256k1.PubKeyAminoName, nil)
cdc.RegisterConcrete(ed25519.PubKey{},
ed25519.PubKeyName, nil)
cdc.RegisterConcrete(sr25519.PubKey{},
sr25519.PubKeyName, nil)
cdc.RegisterConcrete(secp256k1.PubKey{},
secp256k1.PubKeyName, nil)
cdc.RegisterConcrete(multisig.PubKeyMultisigThreshold{},
multisig.PubKeyAminoRoute, nil)

cdc.RegisterInterface((*crypto.PrivKey)(nil), nil)
cdc.RegisterConcrete(ed25519.PrivKeyEd25519{},
ed25519.PrivKeyAminoName, nil)
cdc.RegisterConcrete(sr25519.PrivKeySr25519{},
sr25519.PrivKeyAminoName, nil)
cdc.RegisterConcrete(secp256k1.PrivKeySecp256k1{},
secp256k1.PrivKeyAminoName, nil)
cdc.RegisterConcrete(ed25519.PrivKey{},
ed25519.PrivKeyName, nil)
cdc.RegisterConcrete(sr25519.PrivKey{},
sr25519.PrivKeyName, nil)
cdc.RegisterConcrete(secp256k1.PrivKey{},
secp256k1.PrivKeyName, nil)
}

// PrivKeyFromBytes unmarshals private key bytes and returns a PrivKey
Expand Down
2 changes: 1 addition & 1 deletion crypto/keyring/keyring.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ import (
"github.com/pkg/errors"
"github.com/tendermint/crypto/bcrypt"
tmcrypto "github.com/tendermint/tendermint/crypto"
cryptoamino "github.com/tendermint/tendermint/crypto/encoding/amino"

"github.com/cosmos/cosmos-sdk/client/input"
"github.com/cosmos/cosmos-sdk/crypto"
cryptoamino "github.com/cosmos/cosmos-sdk/crypto/codec"
"github.com/cosmos/cosmos-sdk/crypto/hd"
"github.com/cosmos/cosmos-sdk/crypto/ledger"
sdk "github.com/cosmos/cosmos-sdk/types"
Expand Down
2 changes: 1 addition & 1 deletion crypto/keyring/types_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
)

func Test_writeReadLedgerInfo(t *testing.T) {
var tmpKey secp256k1.PubKeySecp256k1
var tmpKey secp256k1.PubKey
bz, _ := hex.DecodeString("035AD6810A47F073553FF30D2FCC7E0D3B1C0B74B61A1AAA2582344037151E143A")
copy(tmpKey[:], bz)

Expand Down
2 changes: 1 addition & 1 deletion crypto/ledger/ledger_mock.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ func (mock LedgerSECP256K1Mock) GetAddressPubKeySECP256K1(derivationPath []uint3
return nil, "", fmt.Errorf("error parsing public key: %v", err)
}

var compressedPublicKey tmsecp256k1.PubKeySecp256k1
var compressedPublicKey tmsecp256k1.PubKey
copy(compressedPublicKey[:], cmp.SerializeCompressed())

// Generate the bech32 addr using existing tmcrypto/etc.
Expand Down
4 changes: 2 additions & 2 deletions crypto/ledger/ledger_secp256k1.go
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ func getPubKeyUnsafe(device SECP256K1, path hd.BIP44Params) (tmcrypto.PubKey, er
return nil, fmt.Errorf("error parsing public key: %v", err)
}

var compressedPublicKey tmsecp256k1.PubKeySecp256k1
var compressedPublicKey tmsecp256k1.PubKey
copy(compressedPublicKey[:], cmp.SerializeCompressed())

return compressedPublicKey, nil
Expand All @@ -268,7 +268,7 @@ func getPubKeyAddrSafe(device SECP256K1, path hd.BIP44Params, hrp string) (tmcry
return nil, "", fmt.Errorf("error parsing public key: %v", err)
}

var compressedPublicKey tmsecp256k1.PubKeySecp256k1
var compressedPublicKey tmsecp256k1.PubKey
copy(compressedPublicKey[:], cmp.SerializeCompressed())

return compressedPublicKey, addr, nil
Expand Down
Loading