Background
Additional context: #419 (comment)
The current implementation of the proof file is not very efficient when it comes to appending a new proof: The whole file is read into memory, the new proof is encoded and then the whole file is written again.
This can be optimized in the following way:
- read the number of proofs from the beginning of the file
- skip to the current last proof in the file, only read that proof and hash it
- append the new proof and update the incremental hash, using the previous proof's hash
- seek back to the beginning of the file (depends on what type of io.Reader we actually have) to update the count of the number of proofs
Background
Additional context: #419 (comment)
The current implementation of the proof file is not very efficient when it comes to appending a new proof: The whole file is read into memory, the new proof is encoded and then the whole file is written again.
This can be optimized in the following way: