Skip to content

Add additional batch endpoints to LargeSmtForest #880

@iamrecursion

Description

@iamrecursion

What should be done?

While we currently have the ability to update the forest in an atomic batch (update_forest), we do not have the ability to either add lineages or perform openings or gets in a batch. add_lineages would add multiple lineages in a single atomic batch, while open_many and get_many would simply allow for more performant queries when lots of openings or gets need to be performed at once.

How should it be done?

Implement the following endpoints:

  • add_lineages(&mut self, version: VersionId, lineages: SmtForestUpdateBatch) -> Result<Vec<(LineageId, TreeWithRoot)>>: Adds multiple lineages to the forest atomically.
  • open_many(&mut self, version: VersionId, targets: Vec<LineageId, Key>) -> Result<Vec<(LineageId, SmtProof)>>: Performs openings for all of the provided targets in parallel.
  • get_many(&mut self, version: VersionId, targets: Vec<LineageId, Key>) -> Result<Vec<(LineageId, Option<Word>)>>: Performs gets for all of the provided targets in parallel.

When is this task done?

When the above endpoints have been implemented, tested for correctness using hand-written and property-based tests in both backends, as well as hand-written and property tests. They should also be benchmarked so we have a baseline against regressions.

Additional context

May want to be done after #879 for simplicity's sake.

Metadata

Metadata

Assignees

Labels

merkleRelated to Merkle trees or MMRs

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions