mirror of
https://github.com/tendermint/tendermint.git
synced 2026-09-06 16:17:11 +00:00
abci++: add proto fields for enabling vote extensions (#8587)
This pull requests adds the protocol buffer field for the `ABCI.VoteExtensionsEnableHeight` parameter. This proto field is threaded throughout all of the relevant places where consensus params are used and referenced. This PR also adds validation of the consensus param updates. Previous consensus param changes didn't depend on _previous_ versions of the params, so this change adds a method for validating against the old params as well. closes: #8453
This commit is contained in:
@@ -3,6 +3,7 @@ package e2e_test
|
||||
import (
|
||||
"bytes"
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"math/rand"
|
||||
"strconv"
|
||||
@@ -190,16 +191,25 @@ func TestApp_Tx(t *testing.T) {
|
||||
|
||||
func TestApp_VoteExtensions(t *testing.T) {
|
||||
testNode(t, func(ctx context.Context, t *testing.T, node e2e.Node) {
|
||||
t.Skip()
|
||||
client, err := node.Client()
|
||||
require.NoError(t, err)
|
||||
info, err := client.ABCIInfo(ctx)
|
||||
require.NoError(t, err)
|
||||
|
||||
// This special value should have been created by way of vote extensions
|
||||
resp, err := client.ABCIQuery(ctx, "", []byte("extensionSum"))
|
||||
require.NoError(t, err)
|
||||
|
||||
extSum, err := strconv.Atoi(string(resp.Response.Value))
|
||||
require.NoError(t, err)
|
||||
require.GreaterOrEqual(t, extSum, 0)
|
||||
// if extensions are not enabled on the network, we should not expect
|
||||
// the app to have any extension value set.
|
||||
if node.Testnet.VoteExtensionsEnableHeight == 0 ||
|
||||
info.Response.LastBlockHeight < node.Testnet.VoteExtensionsEnableHeight+1 {
|
||||
target := &strconv.NumError{}
|
||||
require.True(t, errors.As(err, &target))
|
||||
} else {
|
||||
require.NoError(t, err)
|
||||
require.GreaterOrEqual(t, extSum, 0)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user