chore: bump TM to v0.35.0 release candidate (#10210)

Integrate Tendermint v0.35.0, including changes to build and test
plumbing necessary to make everything build. This change does not
update any SDK APIs to make use of new features.

Co-authored-by: marbar3778 <marbar3778@yahoo.com>
Co-authored-by: tycho garen <garen@tychoish.com>
Co-authored-by: M. J. Fromberger <michael.j.fromberger@gmail.com>
Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com>
Co-authored-by: Callum Waters <cmwaters19@gmail.com>
This commit is contained in:
Aleksandr Bezobchuk
2021-11-16 11:24:38 -08:00
committed by GitHub
co-authored by marbar3778 tycho garen M. J. Fromberger Amaury Callum Waters
parent 3f368577ed
commit af8ad3d20d
83 changed files with 1465 additions and 623 deletions
-6
View File
@@ -116,12 +116,6 @@ func (app *BaseApp) Info(req abci.RequestInfo) abci.ResponseInfo {
}
}
// SetOption implements the ABCI interface.
func (app *BaseApp) SetOption(req abci.RequestSetOption) (res abci.ResponseSetOption) {
// TODO: Implement!
return
}
// FilterPeerByAddrPort filters peers by address/port.
func (app *BaseApp) FilterPeerByAddrPort(info string) abci.ResponseQuery {
if app.addrPeerFilter != nil {
+1 -1
View File
@@ -106,7 +106,7 @@ func TestGetBlockRentionHeight(t *testing.T) {
tc.bapp.SetParamStore(&paramStore{db: dbm.NewMemDB()})
tc.bapp.InitChain(abci.RequestInitChain{
ConsensusParams: &abci.ConsensusParams{
ConsensusParams: &tmprototypes.ConsensusParams{
Evidence: &tmprototypes.EvidenceParams{
MaxAgeNumBlocks: tc.maxAgeBlocks,
},
+4 -4
View File
@@ -376,15 +376,15 @@ func (app *BaseApp) setDeliverState(header tmproto.Header) {
// GetConsensusParams returns the current consensus parameters from the BaseApp's
// ParamStore. If the BaseApp has no ParamStore defined, nil is returned.
func (app *BaseApp) GetConsensusParams(ctx sdk.Context) *abci.ConsensusParams {
func (app *BaseApp) GetConsensusParams(ctx sdk.Context) *tmproto.ConsensusParams {
if app.paramStore == nil {
return nil
}
cp := new(abci.ConsensusParams)
cp := new(tmproto.ConsensusParams)
if app.paramStore.Has(ctx, ParamStoreKeyBlockParams) {
var bp abci.BlockParams
var bp tmproto.BlockParams
app.paramStore.Get(ctx, ParamStoreKeyBlockParams, &bp)
cp.Block = &bp
@@ -408,7 +408,7 @@ func (app *BaseApp) GetConsensusParams(ctx sdk.Context) *abci.ConsensusParams {
}
// StoreConsensusParams sets the consensus parameters to the baseapp's param store.
func (app *BaseApp) StoreConsensusParams(ctx sdk.Context, cp *abci.ConsensusParams) {
func (app *BaseApp) StoreConsensusParams(ctx sdk.Context, cp *tmproto.ConsensusParams) {
if app.paramStore == nil {
panic("cannot store consensus params with no params store set")
}
+12 -11
View File
@@ -80,7 +80,8 @@ func (ps *paramStore) Get(_ sdk.Context, key []byte, ptr interface{}) {
}
func defaultLogger() log.Logger {
return log.NewTMLogger(log.NewSyncWriter(os.Stdout)).With("module", "sdk/app")
logger, _ := log.NewDefaultLogger("plain", "info", false)
return logger.With("module", "sdk/app")
}
func newBaseApp(name string, options ...func(*baseapp.BaseApp)) *baseapp.BaseApp {
@@ -1431,8 +1432,8 @@ func TestMaxBlockGasLimits(t *testing.T) {
app := setupBaseApp(t, txHandlerOpt)
app.InitChain(abci.RequestInitChain{
ConsensusParams: &abci.ConsensusParams{
Block: &abci.BlockParams{
ConsensusParams: &tmproto.ConsensusParams{
Block: &tmproto.BlockParams{
MaxGas: 100,
},
},
@@ -1611,8 +1612,8 @@ func TestGasConsumptionBadTx(t *testing.T) {
app := setupBaseApp(t, txHandlerOpt)
app.InitChain(abci.RequestInitChain{
ConsensusParams: &abci.ConsensusParams{
Block: &abci.BlockParams{
ConsensusParams: &tmproto.ConsensusParams{
Block: &tmproto.BlockParams{
MaxGas: 9,
},
},
@@ -1776,16 +1777,16 @@ func TestGetMaximumBlockGas(t *testing.T) {
app.InitChain(abci.RequestInitChain{})
ctx := app.NewContext(true, tmproto.Header{})
app.StoreConsensusParams(ctx, &abci.ConsensusParams{Block: &abci.BlockParams{MaxGas: 0}})
app.StoreConsensusParams(ctx, &tmproto.ConsensusParams{Block: &tmproto.BlockParams{MaxGas: 0}})
require.Equal(t, uint64(0), app.GetMaximumBlockGas(ctx))
app.StoreConsensusParams(ctx, &abci.ConsensusParams{Block: &abci.BlockParams{MaxGas: -1}})
app.StoreConsensusParams(ctx, &tmproto.ConsensusParams{Block: &tmproto.BlockParams{MaxGas: -1}})
require.Equal(t, uint64(0), app.GetMaximumBlockGas(ctx))
app.StoreConsensusParams(ctx, &abci.ConsensusParams{Block: &abci.BlockParams{MaxGas: 5000000}})
app.StoreConsensusParams(ctx, &tmproto.ConsensusParams{Block: &tmproto.BlockParams{MaxGas: 5000000}})
require.Equal(t, uint64(5000000), app.GetMaximumBlockGas(ctx))
app.StoreConsensusParams(ctx, &abci.ConsensusParams{Block: &abci.BlockParams{MaxGas: -5000000}})
app.StoreConsensusParams(ctx, &tmproto.ConsensusParams{Block: &tmproto.BlockParams{MaxGas: -5000000}})
require.Panics(t, func() { app.GetMaximumBlockGas(ctx) })
}
@@ -2014,8 +2015,8 @@ func TestBaseApp_EndBlock(t *testing.T) {
name := t.Name()
logger := defaultLogger()
cp := &abci.ConsensusParams{
Block: &abci.BlockParams{
cp := &tmproto.ConsensusParams{
Block: &tmproto.BlockParams{
MaxGas: 5000000,
},
}
+2 -2
View File
@@ -2,7 +2,6 @@ package baseapp_test
import (
"context"
"os"
"sync"
"testing"
@@ -55,7 +54,8 @@ func TestRegisterQueryServiceTwice(t *testing.T) {
// Setup baseapp.
db := dbm.NewMemDB()
encCfg := simapp.MakeTestEncodingConfig()
app := baseapp.NewBaseApp("test", log.NewTMLogger(log.NewSyncWriter(os.Stdout)), db, encCfg.TxConfig.TxDecoder())
logger, _ := log.NewDefaultLogger("plain", "info", false)
app := baseapp.NewBaseApp("test", logger, db, encCfg.TxConfig.TxDecoder())
app.SetInterfaceRegistry(encCfg.InterfaceRegistry)
testdata.RegisterInterfaces(encCfg.InterfaceRegistry)
+1 -2
View File
@@ -4,7 +4,6 @@ import (
"errors"
"fmt"
abci "github.com/tendermint/tendermint/abci/types"
tmproto "github.com/tendermint/tendermint/proto/tendermint/types"
sdk "github.com/cosmos/cosmos-sdk/types"
@@ -31,7 +30,7 @@ type ParamStore interface {
// ValidateBlockParams defines a stateless validation on BlockParams. This function
// is called whenever the parameters are updated or stored.
func ValidateBlockParams(i interface{}) error {
v, ok := i.(abci.BlockParams)
v, ok := i.(tmproto.BlockParams)
if !ok {
return fmt.Errorf("invalid parameter type: %T", i)
}
+5 -6
View File
@@ -4,7 +4,6 @@ import (
"testing"
"github.com/stretchr/testify/require"
abci "github.com/tendermint/tendermint/abci/types"
tmproto "github.com/tendermint/tendermint/proto/tendermint/types"
"github.com/cosmos/cosmos-sdk/baseapp"
@@ -16,11 +15,11 @@ func TestValidateBlockParams(t *testing.T) {
expectErr bool
}{
{nil, true},
{&abci.BlockParams{}, true},
{abci.BlockParams{}, true},
{abci.BlockParams{MaxBytes: -1, MaxGas: -1}, true},
{abci.BlockParams{MaxBytes: 2000000, MaxGas: -5}, true},
{abci.BlockParams{MaxBytes: 2000000, MaxGas: 300000}, false},
{&tmproto.BlockParams{}, true},
{tmproto.BlockParams{}, true},
{tmproto.BlockParams{MaxBytes: -1, MaxGas: -1}, true},
{tmproto.BlockParams{MaxBytes: 2000000, MaxGas: -5}, true},
{tmproto.BlockParams{MaxBytes: 2000000, MaxGas: 300000}, false},
}
for _, tc := range testCases {