make BlockTimeIota a consensus parameter, not a locally configurable … (#3048)

* make BlockTimeIota a consensus parameter, not a locally configurable option

Refs #2920

* make TimeIota int64 ms

Refs #2920

* update Gopkg.toml

* fixes after Ethan's review

* fix TestRemoteSignerProposalSigningFailed

* update changelog
This commit is contained in:
Anton Kaliaev
2019-03-04 13:24:44 +04:00
committed by GitHub
parent f39138aa2e
commit 52771e1287
24 changed files with 471 additions and 391 deletions

View File

@ -908,7 +908,7 @@ func TestConsensusParamsChangesSaveLoad(t *testing.T) {
params[0] = state.ConsensusParams
for i := 1; i < N+1; i++ {
params[i] = *types.DefaultConsensusParams()
params[i].BlockSize.MaxBytes += int64(i)
params[i].Block.MaxBytes += int64(i)
}
// Build the params history by running updateState
@ -956,11 +956,16 @@ func TestConsensusParamsChangesSaveLoad(t *testing.T) {
}
}
func makeParams(blockBytes, blockGas, evidenceAge int64) types.ConsensusParams {
func makeParams(
blockBytes, blockGas int64,
blockTimeIotaMs int64,
evidenceAge int64,
) types.ConsensusParams {
return types.ConsensusParams{
BlockSize: types.BlockSizeParams{
MaxBytes: blockBytes,
MaxGas: blockGas,
Block: types.BlockParams{
MaxBytes: blockBytes,
MaxGas: blockGas,
TimeIotaMs: blockTimeIotaMs,
},
Evidence: types.EvidenceParams{
MaxAge: evidenceAge,
@ -969,7 +974,7 @@ func makeParams(blockBytes, blockGas, evidenceAge int64) types.ConsensusParams {
}
func TestApplyUpdates(t *testing.T) {
initParams := makeParams(1, 2, 3)
initParams := makeParams(1, 2, 3, 4)
cases := [...]struct {
init types.ConsensusParams
@ -980,19 +985,20 @@ func TestApplyUpdates(t *testing.T) {
1: {initParams, abci.ConsensusParams{}, initParams},
2: {initParams,
abci.ConsensusParams{
BlockSize: &abci.BlockSizeParams{
MaxBytes: 44,
MaxGas: 55,
Block: &abci.BlockParams{
MaxBytes: 44,
MaxGas: 55,
TimeIotaMs: 66,
},
},
makeParams(44, 55, 3)},
makeParams(44, 55, 66, 4)},
3: {initParams,
abci.ConsensusParams{
Evidence: &abci.EvidenceParams{
MaxAge: 66,
},
},
makeParams(1, 2, 66)},
makeParams(1, 2, 3, 66)},
}
for i, tc := range cases {