From c9708105f02f20afddd3970767d2be4e760779a0 Mon Sep 17 00:00:00 2001 From: Cuong Manh Le Date: Thu, 12 Dec 2019 23:32:33 +0700 Subject: [PATCH] consensus/types: fix BenchmarkRoundStateDeepCopy panics (#4244) Fixes #4243 --- CHANGELOG_PENDING.md | 1 + consensus/types/round_state_test.go | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG_PENDING.md b/CHANGELOG_PENDING.md index acc10379a..2e5dfc2cc 100644 --- a/CHANGELOG_PENDING.md +++ b/CHANGELOG_PENDING.md @@ -132,3 +132,4 @@ program](https://hackerone.com/tendermint). - [types] \#4164 Prevent temporary power overflows on validator updates (joint efforts of @gchaincl and @ancazamfir) - [p2p] \#4140 `SecretConnection`: use the transcript solely for authentication (i.e. MAC) +- [consensus/types] \#4243 fix BenchmarkRoundStateDeepCopy panics (@cuonglm) diff --git a/consensus/types/round_state_test.go b/consensus/types/round_state_test.go index d0cd6b937..c461e6bd2 100644 --- a/consensus/types/round_state_test.go +++ b/consensus/types/round_state_test.go @@ -5,6 +5,7 @@ import ( amino "github.com/tendermint/go-amino" "github.com/tendermint/tendermint/crypto/ed25519" + "github.com/tendermint/tendermint/crypto/tmhash" "github.com/tendermint/tendermint/libs/rand" "github.com/tendermint/tendermint/types" tmtime "github.com/tendermint/tendermint/types/time" @@ -18,9 +19,10 @@ func BenchmarkRoundStateDeepCopy(b *testing.B) { vset, _ := types.RandValidatorSet(nval, 1) commitSigs := make([]types.CommitSig, nval) blockID := types.BlockID{ - Hash: rand.RandBytes(20), + Hash: rand.RandBytes(tmhash.Size), PartsHeader: types.PartSetHeader{ - Hash: rand.RandBytes(20), + Hash: rand.RandBytes(tmhash.Size), + Total: 1000, }, } sig := make([]byte, ed25519.SignatureSize)