Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added batching using DB. #731

Merged
merged 4 commits into from
May 28, 2024
Merged

Conversation

piohei
Copy link
Contributor

@piohei piohei commented May 15, 2024

This is a first step to introduce batches and transactions table. This is not HA solution yet - just the first step towards it.

Motivation

Make small changes instead of one big.

Solution

Now processing batches is changed into 2 steps. First one is to create a batch (select identities, leaf indexes, etc.). Then the batch is saved in database. Second step is reading data from database (batch) and executes it. Proper batch execution includes storing transaction id in database.

As an alternative solution we could save in database a batch with a proves (no need to calculate it later). It will allow second step (transaction creation/execution) to not use any tree at all. It will require more memory used in database (it can be cleared from time to time as we don't need all the batches forever) but will make HA solution much easier.

This version is also removing batches/transactions when identities are again marked as pending.

PR Checklist

  • Added Tests
  • Added Documentation

@piohei piohei marked this pull request as ready for review May 15, 2024 12:32
@piohei piohei requested a review from a team as a code owner May 15, 2024 12:32
src/app.rs Outdated Show resolved Hide resolved
@piohei piohei force-pushed the piohei/batches_in_db branch from 32e0b61 to 2c6b9f9 Compare May 27, 2024 09:13
@Dzejkop Dzejkop merged commit 471f4a7 into worldcoin:main May 28, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants