Skip to content

Commit

Permalink
fix: always propose with current app version (#697)
Browse files Browse the repository at this point in the history
* fix: always propose with current app version

* fmt

* fix: remove check about block proposed app version
  • Loading branch information
QuantumExplorer authored Oct 16, 2023
1 parent aae7376 commit 5735d57
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 13 deletions.
5 changes: 0 additions & 5 deletions internal/state/execution.go
Original file line number Diff line number Diff line change
Expand Up @@ -204,11 +204,6 @@ func (blockExec *BlockExecutor) CreateProposalBlock(
return nil, CurrentRoundState{}, fmt.Errorf("create proposal block: %w", err)
}

// Pass proposed app version only if it's higher than current network app version
if proposedAppVersion <= state.Version.Consensus.App {
proposedAppVersion = 0
}

txs := blockExec.mempool.ReapMaxBytesMaxGas(maxDataBytes, maxGas)
block := state.MakeBlock(height, txs, commit, evidence, proposerProTxHash, proposedAppVersion)

Expand Down
8 changes: 0 additions & 8 deletions internal/state/validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,6 @@ func validateBlock(state State, block *types.Block) error {
)
}

// Validate proposed app version
if block.Header.ProposedAppVersion > 0 && block.Header.ProposedAppVersion <= state.Version.Consensus.App {
return fmt.Errorf("wrong block.Header.ProposedAppVersion must be higher than %v, is %d",
state.Version.Consensus.App,
block.Header.ProposedAppVersion,
)
}

// Validate prev block info.
if !block.LastBlockID.Equals(state.LastBlockID) {
return fmt.Errorf("wrong Block.Header.LastBlockID. Expected %v, got %v",
Expand Down

0 comments on commit 5735d57

Please sign in to comment.