Tendermint: Temporal Overflows when Updating validator set

Created on 19 Nov 2019  路  3Comments  路  Source: tendermint/tendermint

Tendermint version: 97222eb90fc4b2882fe1859a665f2c84764c4b58

What happened: When adding a new validator that temporarily exceedes the TotalMaxVotingPower limit, Tendermint crashes

What you expected to happen: The validator should be added to the set

Have you tried the latest version: yes

How to reproduce it (as minimally and precisely as possible):
Say we have the following:
validator_1 with power = TotalMaxVotingPower - 1 and
validator_2 with power = 1

If you want to update the powers so that:
validator_2 with power = TotalMaxVotingPower - 1 and
validator_1 with power = 1

Tendermint might end up panicking due to Power Overflow

consensus bug

Most helpful comment

@gchaincl @tessr @melekes
Just committed 3 tests at:
https://github.com/tendermint/tendermint/blob/5e4cbd2ca5716bf11bd7777f080b85c128bb3130/types/validator_set_test.go#L1264

  • 1 - no false overflow error messages for updates
  • 2 - no false overflow error messages for deletes
  • 3 - check panic on overflow is prevented: update 8 validators with power int64(math.MaxInt64)/8

tests 1 and 2 fail before fix https://github.com/tendermint/tendermint/pull/4165, they return an error when they shouldn't
tests 2 and 3 fail after fix https://github.com/tendermint/tendermint/pull/4165, with 3 causing a panic.

Will work on a fix next.

All 3 comments

Could you clarify if you saw a panic or an error message? I believe the solution in https://github.com/tendermint/tendermint/pull/4165 is not correct and in fact we will see crashes here.

@gchaincl @tessr @melekes
Just committed 3 tests at:
https://github.com/tendermint/tendermint/blob/5e4cbd2ca5716bf11bd7777f080b85c128bb3130/types/validator_set_test.go#L1264

  • 1 - no false overflow error messages for updates
  • 2 - no false overflow error messages for deletes
  • 3 - check panic on overflow is prevented: update 8 validators with power int64(math.MaxInt64)/8

tests 1 and 2 fail before fix https://github.com/tendermint/tendermint/pull/4165, they return an error when they shouldn't
tests 2 and 3 fail after fix https://github.com/tendermint/tendermint/pull/4165, with 3 causing a panic.

Will work on a fix next.

Should be fixed now with https://github.com/tendermint/tendermint/pull/4183. Thanks all!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

zramsay picture zramsay  路  4Comments

ddsvetlov picture ddsvetlov  路  3Comments

melekes picture melekes  路  4Comments

dshulyak picture dshulyak  路  3Comments

erikgrinaker picture erikgrinaker  路  3Comments