Browse Source

consensus/types: fix BenchmarkRoundStateDeepCopy panics (#4244)

Fixes #4243
pull/4251/head
Cuong Manh Le 5 years ago
committed by Marko
parent
commit
c9708105f0
2 changed files with 5 additions and 2 deletions
  1. +1
    -0
      CHANGELOG_PENDING.md
  2. +4
    -2
      consensus/types/round_state_test.go

+ 1
- 0
CHANGELOG_PENDING.md View File

@ -132,3 +132,4 @@ program](https://hackerone.com/tendermint).
- [types] \#4164 Prevent temporary power overflows on validator updates (joint - [types] \#4164 Prevent temporary power overflows on validator updates (joint
efforts of @gchaincl and @ancazamfir) efforts of @gchaincl and @ancazamfir)
- [p2p] \#4140 `SecretConnection`: use the transcript solely for authentication (i.e. MAC) - [p2p] \#4140 `SecretConnection`: use the transcript solely for authentication (i.e. MAC)
- [consensus/types] \#4243 fix BenchmarkRoundStateDeepCopy panics (@cuonglm)

+ 4
- 2
consensus/types/round_state_test.go View File

@ -5,6 +5,7 @@ import (
amino "github.com/tendermint/go-amino" amino "github.com/tendermint/go-amino"
"github.com/tendermint/tendermint/crypto/ed25519" "github.com/tendermint/tendermint/crypto/ed25519"
"github.com/tendermint/tendermint/crypto/tmhash"
"github.com/tendermint/tendermint/libs/rand" "github.com/tendermint/tendermint/libs/rand"
"github.com/tendermint/tendermint/types" "github.com/tendermint/tendermint/types"
tmtime "github.com/tendermint/tendermint/types/time" tmtime "github.com/tendermint/tendermint/types/time"
@ -18,9 +19,10 @@ func BenchmarkRoundStateDeepCopy(b *testing.B) {
vset, _ := types.RandValidatorSet(nval, 1) vset, _ := types.RandValidatorSet(nval, 1)
commitSigs := make([]types.CommitSig, nval) commitSigs := make([]types.CommitSig, nval)
blockID := types.BlockID{ blockID := types.BlockID{
Hash: rand.RandBytes(20),
Hash: rand.RandBytes(tmhash.Size),
PartsHeader: types.PartSetHeader{ PartsHeader: types.PartSetHeader{
Hash: rand.RandBytes(20),
Hash: rand.RandBytes(tmhash.Size),
Total: 1000,
}, },
} }
sig := make([]byte, ed25519.SignatureSize) sig := make([]byte, ed25519.SignatureSize)


Loading…
Cancel
Save