crypto/consensus: sign hashes and cache them for consensus payloads

Avoid serializing payload again and again for various purposes. To sign it, we
only need a hash.

Some 2.4% gain in TPS could be achieved with this.
This commit is contained in:
Roman Khimov 2020-08-29 18:44:45 +03:00
parent 49e9c1aa0f
commit 53c014a0bb
11 changed files with 119 additions and 42 deletions

View file

@ -216,7 +216,7 @@ func TestECDSAVerify(t *testing.T) {
t.Run("invalid message", func(t *testing.T) {
sign := priv.Sign(msg)
runCase(t, false, false, sign, priv.PublicKey().Bytes(),
runCase(t, true, false, sign, priv.PublicKey().Bytes(),
stackitem.NewArray([]stackitem.Item{stackitem.NewByteArray(msg)}))
})
}