Skip to content

Commit

Permalink
removed validators length sanity check for replays
Browse files Browse the repository at this point in the history
  • Loading branch information
johannbarbie committed Jul 16, 2018
1 parent 7679621 commit 18e7f87
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions state/execution.go
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ func getBeginBlockValidatorInfo(block *types.Block, lastValSet *types.ValidatorS
if block.Height > 1 {
precommitLen := len(block.LastCommit.Precommits)
valSetLen := len(lastValSet.Validators)
if precommitLen != valSetLen {
if valSetLen > 0 && precommitLen != valSetLen {
// sanity check
panic(fmt.Sprintf("precommit length (%d) doesn't match valset length (%d) at height %d\n\n%v\n\n%v",
precommitLen, valSetLen, block.Height, block.LastCommit.Precommits, lastValSet.Validators))
Expand Down Expand Up @@ -386,7 +386,11 @@ func fireEvents(logger log.Logger, eventBus types.BlockEventPublisher, block *ty
// It returns the application root hash (result of abci.Commit).
func ExecCommitBlock(appConnConsensus proxy.AppConnConsensus, block *types.Block,
logger log.Logger, lastValSet *types.ValidatorSet, stateDB dbm.DB) ([]byte, error) {
_, err := execBlockOnProxyApp(logger, appConnConsensus, block, lastValSet, stateDB)

vs := &types.ValidatorSet{
Validators: []*types.Validator{},
}
_, err := execBlockOnProxyApp(logger, appConnConsensus, block, vs, stateDB)
if err != nil {
logger.Error("Error executing block on proxy app", "height", block.Height, "err", err)
return nil, err
Expand Down

0 comments on commit 18e7f87

Please sign in to comment.