informalsystems / tendermint-rs

Client libraries for Tendermint/CometBFT in Rust!
Apache License 2.0
587 stars 213 forks source link

light-client-verifier: reuse sign_bytes buffer #1413

Closed mina86 closed 2 months ago

mina86 commented 2 months ago

Rather than allocating a new vector each time canonical vote is encoded, allocate a vector in NonAbsentCommitVotes once and then reuse it each time sign_bytes are needed. This saves on doing multiple allocations and deallocations.

For overly verbose description of the length calculation:


romac commented 2 months ago

I will release all this in v0.36 later this week.