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

feat(pbts): Moving VoteExtensionsEnableHeight from ABCIParams to FeatureParams. #2335

Merged
merged 15 commits into from
Feb 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
378 changes: 62 additions & 316 deletions api/cometbft/types/v1/params.pb.go

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions internal/blocksync/reactor.go
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ func (bcR *Reactor) respondToPeer(msg *bcproto.BlockRequest, src p2p.Peer) (queu
return false
}
var extCommit *types.ExtendedCommit
if state.ConsensusParams.ABCI.VoteExtensionsEnabled(msg.Height) {
if state.ConsensusParams.Feature.VoteExtensionsEnabled(msg.Height) {
extCommit = bcR.store.LoadBlockExtendedCommit(msg.Height)
if extCommit == nil {
bcR.Logger.Error("found block in store with no extended commit", "block", block)
Expand Down Expand Up @@ -384,7 +384,7 @@ FOR_LOOP:
//
missingExtension := true
if state.LastBlockHeight == 0 ||
!state.ConsensusParams.ABCI.VoteExtensionsEnabled(state.LastBlockHeight) ||
!state.ConsensusParams.Feature.VoteExtensionsEnabled(state.LastBlockHeight) ||
blocksSynced > 0 ||
initialCommitHasExtensions {
missingExtension = false
Expand Down Expand Up @@ -450,7 +450,7 @@ FOR_LOOP:
// Panicking because this is an obvious bug in the block pool, which is totally under our control
panic(fmt.Errorf("heights of first and second block are not consecutive; expected %d, got %d", state.LastBlockHeight, first.Height))
}
if extCommit == nil && state.ConsensusParams.ABCI.VoteExtensionsEnabled(first.Height) {
if extCommit == nil && state.ConsensusParams.Feature.VoteExtensionsEnabled(first.Height) {
// See https://github.com/tendermint/tendermint/pull/8433#discussion_r866790631
panic(fmt.Errorf("peeked first block without extended commit at height %d - possible node store corruption", first.Height))
}
Expand Down Expand Up @@ -488,7 +488,7 @@ FOR_LOOP:
}
if err == nil {
// if vote extensions were required at this height, ensure they exist.
if state.ConsensusParams.ABCI.VoteExtensionsEnabled(first.Height) {
if state.ConsensusParams.Feature.VoteExtensionsEnabled(first.Height) {
err = extCommit.EnsureExtensions(true)
} else if extCommit != nil {
err = fmt.Errorf("received non-nil extCommit for height %d (extensions disabled)", first.Height)
Expand Down Expand Up @@ -516,7 +516,7 @@ FOR_LOOP:
bcR.pool.PopRequest()

// TODO: batch saves so we dont persist to disk every block
if state.ConsensusParams.ABCI.VoteExtensionsEnabled(first.Height) {
if state.ConsensusParams.Feature.VoteExtensionsEnabled(first.Height) {
bcR.store.SaveBlockWithExtendedCommit(first, firstParts, extCommit)
} else {
// We use LastCommit here instead of extCommit. extCommit is not
Expand Down
2 changes: 1 addition & 1 deletion internal/blocksync/reactor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func randGenesisDoc() (*types.GenesisDoc, []types.PrivValidator) {
sort.Sort(types.PrivValidatorsByAddress(privValidators))

consPar := types.DefaultConsensusParams()
consPar.ABCI.VoteExtensionsEnableHeight = 1
consPar.Feature.VoteExtensionsEnableHeight = 1
return &types.GenesisDoc{
GenesisTime: cmttime.Now(),
ChainID: test.DefaultTestChainID,
Expand Down
3 changes: 2 additions & 1 deletion internal/consensus/byzantine_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,8 @@ func TestByzantinePrevoteEquivocation(t *testing.T) {
extCommit = &types.ExtendedCommit{}
case lazyProposer.LastCommit.HasTwoThirdsMajority():
// Make the commit from LastCommit
veHeightParam := types.ABCIParams{VoteExtensionsEnableHeight: height}
veHeightParam := types.DefaultFeatureParams()
veHeightParam.VoteExtensionsEnableHeight = height
extCommit = lazyProposer.LastCommit.MakeExtendedCommit(veHeightParam)
default: // This shouldn't happen.
lazyProposer.Logger.Error("enterPropose: Cannot propose anything: No commit for the previous block")
Expand Down
5 changes: 2 additions & 3 deletions internal/consensus/common_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@ func randStateWithAppWithHeight(
height int64,
) (*State, []*validatorStub) {
c := test.ConsensusParams()
c.ABCI.VoteExtensionsEnableHeight = height
c.Feature.VoteExtensionsEnableHeight = height
return randStateWithAppImpl(nValidators, app, c)
}

Expand All @@ -498,8 +498,7 @@ func randStateWithAppWithBFTTime(nValidators int) (*State, []*validatorStub) {

func randStateWithApp(nValidators int, app abci.Application) (*State, []*validatorStub) {
c := test.ConsensusParams()
enableHeight := int64(1)
c.Feature.PbtsEnableHeight = &enableHeight
c.Feature.PbtsEnableHeight = 1
return randStateWithAppImpl(nValidators, app, c)
}

Expand Down
6 changes: 3 additions & 3 deletions internal/consensus/pbts_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,7 @@ func TestPBTSTooFarInTheFutureProposal(t *testing.T) {
}

func pbtsFromHeightParams(height int64) types.FeatureParams {
return types.FeatureParams{
PbtsEnableHeight: &height,
}
p := types.DefaultFeatureParams()
p.PbtsEnableHeight = height
return p
}
2 changes: 1 addition & 1 deletion internal/consensus/reactor.go
Original file line number Diff line number Diff line change
Expand Up @@ -794,7 +794,7 @@ OUTER_LOOP:
func() {
conR.conS.mtx.RLock()
defer conR.conS.mtx.RUnlock()
veEnabled = conR.conS.state.ConsensusParams.ABCI.VoteExtensionsEnabled(prs.Height)
veEnabled = conR.conS.state.ConsensusParams.Feature.VoteExtensionsEnabled(prs.Height)
}()
if veEnabled {
ec = conR.conS.blockStore.LoadBlockExtendedCommit(prs.Height)
Expand Down
5 changes: 3 additions & 2 deletions internal/consensus/reactor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ func TestSwitchToConsensusVoteExtensions(t *testing.T) {

cs.state.LastBlockHeight = testCase.storedHeight
cs.state.LastValidators = cs.state.Validators.Copy()
cs.state.ConsensusParams.ABCI.VoteExtensionsEnableHeight = testCase.initialRequiredHeight
cs.state.ConsensusParams.Feature.VoteExtensionsEnableHeight = testCase.initialRequiredHeight

propBlock, err := cs.createProposalBlock(ctx)
require.NoError(t, err)
Expand Down Expand Up @@ -395,7 +395,8 @@ func TestSwitchToConsensusVoteExtensions(t *testing.T) {
require.NoError(t, err)
require.True(t, added)

veHeightParam := types.ABCIParams{VoteExtensionsEnableHeight: veHeight}
veHeightParam := types.DefaultFeatureParams()
veHeightParam.VoteExtensionsEnableHeight = veHeight
if testCase.includeExtensions {
cs.blockStore.SaveBlockWithExtendedCommit(propBlock, blockParts, voteSet.MakeExtendedCommit(veHeightParam))
} else {
Expand Down
16 changes: 8 additions & 8 deletions internal/consensus/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,7 @@ func (cs *State) reconstructSeenCommit(state sm.State) {
// the method will panic on an absent ExtendedCommit or an ExtendedCommit without
// extension data.
func (cs *State) reconstructLastCommit(state sm.State) {
extensionsEnabled := state.ConsensusParams.ABCI.VoteExtensionsEnabled(state.LastBlockHeight)
extensionsEnabled := state.ConsensusParams.Feature.VoteExtensionsEnabled(state.LastBlockHeight)
if !extensionsEnabled {
cs.reconstructSeenCommit(state)
return
Expand Down Expand Up @@ -735,7 +735,7 @@ func (cs *State) updateToState(state sm.State) {
cs.ValidRound = -1
cs.ValidBlock = nil
cs.ValidBlockParts = nil
if state.ConsensusParams.ABCI.VoteExtensionsEnabled(height) {
if state.ConsensusParams.Feature.VoteExtensionsEnabled(height) {
cs.Votes = cstypes.NewExtendedHeightVoteSet(state.ChainID, height, validators)
} else {
cs.Votes = cstypes.NewHeightVoteSet(state.ChainID, height, validators)
Expand Down Expand Up @@ -1297,7 +1297,7 @@ func (cs *State) createProposalBlock(ctx context.Context) (*types.Block, error)

case cs.LastCommit.HasTwoThirdsMajority():
// Make the commit from LastCommit
lastExtCommit = cs.LastCommit.MakeExtendedCommit(cs.state.ConsensusParams.ABCI)
lastExtCommit = cs.LastCommit.MakeExtendedCommit(cs.state.ConsensusParams.Feature)

default: // This shouldn't happen.
return nil, ErrProposalWithoutPreviousCommit
Expand Down Expand Up @@ -1842,8 +1842,8 @@ func (cs *State) finalizeCommit(height int64) {
if cs.blockStore.Height() < block.Height {
// NOTE: the seenCommit is local justification to commit this block,
// but may differ from the LastCommit included in the next block
seenExtendedCommit := cs.Votes.Precommits(cs.CommitRound).MakeExtendedCommit(cs.state.ConsensusParams.ABCI)
if cs.state.ConsensusParams.ABCI.VoteExtensionsEnabled(block.Height) {
seenExtendedCommit := cs.Votes.Precommits(cs.CommitRound).MakeExtendedCommit(cs.state.ConsensusParams.Feature)
if cs.state.ConsensusParams.Feature.VoteExtensionsEnabled(block.Height) {
cs.blockStore.SaveBlockWithExtendedCommit(block, blockParts, seenExtendedCommit)
} else {
cs.blockStore.SaveBlock(block, blockParts, seenExtendedCommit.ToCommit())
Expand Down Expand Up @@ -2289,7 +2289,7 @@ func (cs *State) addVote(vote *types.Vote, peerID p2p.ID) (added bool, err error
}

// Check to see if the chain is configured to extend votes.
extEnabled := cs.state.ConsensusParams.ABCI.VoteExtensionsEnabled(vote.Height)
extEnabled := cs.state.ConsensusParams.Feature.VoteExtensionsEnabled(vote.Height)
if extEnabled {
// The chain is configured to extend votes, check that the vote is
// not for a nil block and verify the extensions signature against the
Expand Down Expand Up @@ -2476,7 +2476,7 @@ func (cs *State) signVote(
BlockID: types.BlockID{Hash: hash, PartSetHeader: header},
}

extEnabled := cs.state.ConsensusParams.ABCI.VoteExtensionsEnabled(vote.Height)
extEnabled := cs.state.ConsensusParams.Feature.VoteExtensionsEnabled(vote.Height)
if msgType == types.PrecommitType && !vote.BlockID.IsNil() {
// if the signedMessage type is for a non-nil precommit, add
// VoteExtension
Expand Down Expand Up @@ -2552,7 +2552,7 @@ func (cs *State) signAddVote(
return
}
hasExt := len(vote.ExtensionSignature) > 0
extEnabled := cs.state.ConsensusParams.ABCI.VoteExtensionsEnabled(vote.Height)
extEnabled := cs.state.ConsensusParams.Feature.VoteExtensionsEnabled(vote.Height)
if vote.Type == types.PrecommitType && !vote.BlockID.IsNil() && hasExt != extEnabled {
panic(fmt.Errorf("vote extension absence/presence does not match extensions enabled %t!=%t, height %d, type %v",
hasExt, extEnabled, vote.Height, vote.Type))
Expand Down
12 changes: 10 additions & 2 deletions internal/consensus/state_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"bytes"
"context"
"fmt"
"strconv"
"strings"
"testing"
"time"
Expand Down Expand Up @@ -1621,11 +1622,18 @@ func TestStateLock_POLSafety2(t *testing.T) {
prevotes := signVotes(types.PrevoteType, chainID, propBlockID0, false, vs2, vs3, vs4)

// the block for round 1
reqRes, err := assertMempool(tc.state.txNotifier).CheckTx(kvstore.NewTx(strconv.Itoa(10), "true"))
require.NoError(t, err)
require.False(t, reqRes.Response.GetCheckTx().IsErr())

prop1, propBlock1 := decideProposal(ctx, t, tc.state, vs2, vs2.Height, vs2.Round+1)
propBlockParts1, err := propBlock1.MakePartSet(partSize)
require.NoError(t, err)
propBlockID1 := types.BlockID{Hash: propBlock1.Hash(), PartSetHeader: propBlockParts1.Header()}

// Blocks must be different, which in BFT time case requires a transaction being added.
assert.NotEqual(t, propBlockID1, propBlockID0)

incrementRound(vs2, vs3, vs4)

round++ // moving to the next round
Expand Down Expand Up @@ -2218,7 +2226,7 @@ func TestVerifyVoteExtensionNotCalledOnAbsentPrecommit(t *testing.T) {
m.On("Commit", mock.Anything, mock.Anything).Return(&abci.CommitResponse{}, nil).Maybe()
cs1, vss := randStateWithApp(4, m)
height, round, chainID := cs1.Height, cs1.Round, cs1.state.ChainID
cs1.state.ConsensusParams.ABCI.VoteExtensionsEnableHeight = cs1.Height
cs1.state.ConsensusParams.Feature.VoteExtensionsEnableHeight = cs1.Height

proposalCh := subscribe(cs1.eventBus, types.EventQueryCompleteProposal)
newRoundCh := subscribe(cs1.eventBus, types.EventQueryNewRound)
Expand Down Expand Up @@ -2521,7 +2529,7 @@ func TestVoteExtensionEnableHeight(t *testing.T) {
m.On("Commit", mock.Anything, mock.Anything).Return(&abci.CommitResponse{}, nil).Maybe()
cs1, vss := randStateWithAppWithHeight(numValidators, m, testCase.enableHeight)
height, round, chainID := cs1.Height, cs1.Round, cs1.state.ChainID
cs1.state.ConsensusParams.ABCI.VoteExtensionsEnableHeight = testCase.enableHeight
cs1.state.ConsensusParams.Feature.VoteExtensionsEnableHeight = testCase.enableHeight

timeoutCh := subscribe(cs1.eventBus, types.EventQueryTimeoutPropose)
proposalCh := subscribe(cs1.eventBus, types.EventQueryCompleteProposal)
Expand Down
10 changes: 5 additions & 5 deletions internal/state/execution.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ func (blockExec *BlockExecutor) CreateProposalBlock(
&abci.PrepareProposalRequest{
MaxTxBytes: maxDataBytes,
Txs: block.Txs.ToSliceOfBytes(),
LocalLastCommit: buildExtendedCommitInfoFromStore(lastExtCommit, blockExec.store, state.InitialHeight, state.ConsensusParams.ABCI),
LocalLastCommit: buildExtendedCommitInfoFromStore(lastExtCommit, blockExec.store, state.InitialHeight, state.ConsensusParams.Feature),
Misbehavior: block.Evidence.Evidence.ToABCI(),
Height: block.Height,
Time: block.Time,
Expand Down Expand Up @@ -495,7 +495,7 @@ func BuildLastCommitInfo(block *types.Block, lastValSet *types.ValidatorSet, ini
// data, it returns an empty record.
//
// Assumes that the commit signatures are sorted according to validator index.
func buildExtendedCommitInfoFromStore(ec *types.ExtendedCommit, store Store, initialHeight int64, ap types.ABCIParams) abci.ExtendedCommitInfo {
func buildExtendedCommitInfoFromStore(ec *types.ExtendedCommit, store Store, initialHeight int64, fp types.FeatureParams) abci.ExtendedCommitInfo {
if ec.Height < initialHeight {
// There are no extended commits for heights below the initial height.
return abci.ExtendedCommitInfo{}
Expand All @@ -506,13 +506,13 @@ func buildExtendedCommitInfoFromStore(ec *types.ExtendedCommit, store Store, ini
panic(fmt.Errorf("failed to load validator set at height %d, initial height %d: %w", ec.Height, initialHeight, err))
}

return BuildExtendedCommitInfo(ec, valSet, initialHeight, ap)
return BuildExtendedCommitInfo(ec, valSet, initialHeight, fp)
}

// BuildExtendedCommitInfo builds an ExtendedCommitInfo from the given block and validator set.
// If you want to load the validator set from the store instead of providing it,
// use buildExtendedCommitInfoFromStore.
func BuildExtendedCommitInfo(ec *types.ExtendedCommit, valSet *types.ValidatorSet, initialHeight int64, ap types.ABCIParams) abci.ExtendedCommitInfo {
func BuildExtendedCommitInfo(ec *types.ExtendedCommit, valSet *types.ValidatorSet, initialHeight int64, fp types.FeatureParams) abci.ExtendedCommitInfo {
if ec.Height < initialHeight {
// There are no extended commits for heights below the initial height.
return abci.ExtendedCommitInfo{}
Expand Down Expand Up @@ -549,7 +549,7 @@ func BuildExtendedCommitInfo(ec *types.ExtendedCommit, valSet *types.ValidatorSe
// during that height, we ensure they are present and deliver the data to
// the proposer. If they were not enabled during this previous height, we
// will not deliver extension data.
if err := ecs.EnsureExtension(ap.VoteExtensionsEnabled(ec.Height)); err != nil {
if err := ecs.EnsureExtension(fp.VoteExtensionsEnabled(ec.Height)); err != nil {
panic(fmt.Errorf("commit at height %d has problems with vote extension data; err %w", ec.Height, err))
}

Expand Down
2 changes: 1 addition & 1 deletion internal/state/execution_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1073,7 +1073,7 @@ func TestCreateProposalAbsentVoteExtensions(t *testing.T) {
stateStore := sm.NewStore(stateDB, sm.StoreOptions{
DiscardABCIResponses: false,
})
state.ConsensusParams.ABCI.VoteExtensionsEnableHeight = testCase.extensionEnableHeight
state.ConsensusParams.Feature.VoteExtensionsEnableHeight = testCase.extensionEnableHeight
mp := &mpmocks.Mempool{}
mp.On("Lock").Return()
mp.On("Unlock").Return()
Expand Down
2 changes: 1 addition & 1 deletion internal/test/commit.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func MakeCommitFromVoteSet(blockID types.BlockID, voteSet *types.VoteSet, valida
}
}

return voteSet.MakeExtendedCommit(types.ABCIParams{VoteExtensionsEnableHeight: 0}).ToCommit(), nil
return voteSet.MakeExtendedCommit(types.DefaultFeatureParams()).ToCommit(), nil
}

func MakeCommit(blockID types.BlockID, height int64, round int32, valSet *types.ValidatorSet, privVals []types.PrivValidator, chainID string, now time.Time) (*types.Commit, error) {
Expand Down
2 changes: 1 addition & 1 deletion internal/test/params.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ import (
func ConsensusParams() *types.ConsensusParams {
c := types.DefaultConsensusParams()
// enable vote extensions
c.ABCI.VoteExtensionsEnableHeight = 1
c.Feature.VoteExtensionsEnableHeight = 1
return c
}
18 changes: 1 addition & 17 deletions proto/cometbft/types/v1/params.proto
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,12 @@ option (gogoproto.equal_all) = true;

// ConsensusParams contains consensus critical parameters that determine the
// validity of blocks.
// TODO: move ABCI to FeatureParams
message ConsensusParams {
BlockParams block = 1;
EvidenceParams evidence = 2;
ValidatorParams validator = 3;
VersionParams version = 4;
// TODO: move ABCI to FeatureParams
ABCIParams abci = 5;
//TODO: handle backwards compatibility
SynchronyParams synchrony = 6;
FeatureParams feature = 7;
}
Expand Down Expand Up @@ -83,20 +81,6 @@ message HashedParams {
int64 block_max_gas = 2;
}

// ABCIParams configure functionality specific to the Application Blockchain Interface.
message ABCIParams {
// vote_extensions_enable_height configures the first height during which
// vote extensions will be enabled. During this specified height, and for all
// subsequent heights, precommit messages that do not contain valid extension data
// will be considered invalid. Prior to this height, vote extensions will not
// be used or accepted by validators on the network.
//
// Once enabled, vote extensions will be created by the application in ExtendVote,
// passed to the application for validation in VerifyVoteExtension and given
// to the application to use when proposing a block during PrepareProposal.
int64 vote_extensions_enable_height = 1;
}

// SynchronyParams configure the bounds under which a proposed block's timestamp is considered valid.
// These parameters are part of the proposer-based timestamps algorithm. For more information,
// see the specification of proposer-based timestamps:
Expand Down
9 changes: 5 additions & 4 deletions test/e2e/app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import (
"github.com/cometbft/cometbft/libs/log"
cmttypes "github.com/cometbft/cometbft/types"
"github.com/cometbft/cometbft/version"
gogo "github.com/cosmos/gogoproto/types" //nolint:allz
)

const (
Expand Down Expand Up @@ -170,8 +171,8 @@ func (app *Application) updateVoteExtensionEnableHeight(currentHeight int64) *cm
"current_height", currentHeight,
"enable_height", app.cfg.VoteExtensionsEnableHeight)
params = &cmtproto.ConsensusParams{
Abci: &cmtproto.ABCIParams{
VoteExtensionsEnableHeight: app.cfg.VoteExtensionsEnableHeight,
Feature: &cmtproto.FeatureParams{
VoteExtensionsEnableHeight: &gogo.Int64Value{Value: app.cfg.VoteExtensionsEnableHeight},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we use int64 here instead?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also below.

Copy link
Contributor

@mzabaluev mzabaluev Feb 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use 0 to mean "no height specified" and turn the proto fields to int64 like in all other places where it is so?
This nullable JS integer field is clunky, it will be tedious to work with in Rust and probably other languages.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We had infinite discussions on that respect.

The problem is that 0 is value with meaning for these parameters. It means disabled.

The fact that 0 is also the nil value for an integer, if the user does not set one of the values here, it would implicitly set it to 0. And the validation rules will fail, because once enabled (from height H > 0), these features cannot be disabled.

Copy link
Contributor

@mzabaluev mzabaluev Feb 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let me throw in some less (or equally) cumbersome alternatives just in case they were not considered:

  • Enable features with bit flags set in a separate field, so that a height field is only considered if the corresponding feature flag is set.

  • Introduce a ConsensusParamUpdate message which has a oneof for all parameters that can be updated. This is to be used as a repeated field in places where ConsensusParams is currently used as a delta value with nils meaning no update. ConsensusParams then cleanly describes the current state with all field values being meaningful.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added as a point to be reviewed in #2063

},
}
app.logger.Info("updating VoteExtensionsHeight in app_state", "height", app.cfg.VoteExtensionsEnableHeight)
Expand All @@ -197,8 +198,8 @@ func (app *Application) InitChain(_ context.Context, req *abci.InitChainRequest)
}
app.logger.Info("setting ChainID in app_state", "chainId", req.ChainId)
app.state.Set(prefixReservedKey+suffixChainID, req.ChainId)
app.logger.Info("setting VoteExtensionsHeight in app_state", "height", req.ConsensusParams.Abci.VoteExtensionsEnableHeight)
app.state.Set(prefixReservedKey+suffixVoteExtHeight, strconv.FormatInt(req.ConsensusParams.Abci.VoteExtensionsEnableHeight, 10))
app.logger.Info("setting VoteExtensionsHeight in app_state", "height", req.ConsensusParams.Feature.VoteExtensionsEnableHeight.Value)
app.state.Set(prefixReservedKey+suffixVoteExtHeight, strconv.FormatInt(req.ConsensusParams.Feature.VoteExtensionsEnableHeight.Value, 10))
app.logger.Info("setting initial height in app_state", "initial_height", req.InitialHeight)
app.state.Set(prefixReservedKey+suffixInitialHeight, strconv.FormatInt(req.InitialHeight, 10))
// Get validators from genesis
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/runner/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ func MakeGenesis(testnet *e2e.Testnet) (types.GenesisDoc, error) {
genesis.ConsensusParams.Evidence.MaxAgeNumBlocks = e2e.EvidenceAgeHeight
genesis.ConsensusParams.Evidence.MaxAgeDuration = e2e.EvidenceAgeTime
if testnet.VoteExtensionsUpdateHeight == -1 {
genesis.ConsensusParams.ABCI.VoteExtensionsEnableHeight = testnet.VoteExtensionsEnableHeight
genesis.ConsensusParams.Feature.VoteExtensionsEnableHeight = testnet.VoteExtensionsEnableHeight
}
for validator, power := range testnet.Validators {
genesis.Validators = append(genesis.Validators, types.GenesisValidator{
Expand Down
Loading
Loading