Skip to content

proof file: optimize appending proof #427

Description

@guggero

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

Metadata

Metadata

Assignees

Type

No type

Fields

No fields configured for issues without a type.

Projects

Status
No status

Relationships

None yet

Development

No branches or pull requests

Issue actions