Skip to content

Commit

Permalink
Revert "Added batching using DB. (#724)"
Browse files Browse the repository at this point in the history
This reverts commit f4fcc03.
  • Loading branch information
Dzejkop authored May 14, 2024
1 parent 6e99a96 commit 7a3a8d5
Show file tree
Hide file tree
Showing 11 changed files with 125 additions and 912 deletions.
24 changes: 0 additions & 24 deletions schemas/database/013_batches_and_transactions.sql

This file was deleted.

22 changes: 1 addition & 21 deletions src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use crate::database::{Database, DatabaseExt as _};
use crate::ethereum::Ethereum;
use crate::identity_tree::{
CanonicalTreeBuilder, Hash, InclusionProof, ProcessedStatus, RootItem, Status, TreeState,
TreeUpdate, TreeVersionReadOps, TreeWithNextVersion, UnprocessedStatus,
TreeUpdate, TreeVersionReadOps, UnprocessedStatus,
};
use crate::prover::map::initialize_prover_maps;
use crate::prover::{ProverConfig, ProverType};
Expand Down Expand Up @@ -261,9 +261,6 @@ impl App {

let (processed, batching_builder) = processed_builder.seal_and_continue();
let (batching, mut latest_builder) = batching_builder.seal_and_continue();

// We are duplicating updates here for some commitments that were batched but
// this is an idempotent operation
let pending_items = self
.database
.get_commitments_by_status(ProcessedStatus::Pending)
Expand All @@ -272,15 +269,6 @@ impl App {
latest_builder.update(&update);
}
let latest = latest_builder.seal();

let batch = self.database.get_latest_batch().await?;
if let Some(batch) = batch {
if batching.get_root() != batch.next_root {
batching.apply_updates_up_to(batch.next_root);
}
assert_eq!(batching.get_root(), batch.next_root);
}

Ok(Some(TreeState::new(mined, processed, batching, latest)))
}

Expand Down Expand Up @@ -367,14 +355,6 @@ impl App {

let latest = latest_builder.seal();

let batch = self.database.get_latest_batch().await?;
if let Some(batch) = batch {
if batching.get_root() != batch.next_root {
batching.apply_updates_up_to(batch.next_root);
}
assert_eq!(batching.get_root(), batch.next_root);
}

Ok(TreeState::new(mined, processed, batching, latest))
}

Expand Down
Loading

0 comments on commit 7a3a8d5

Please sign in to comment.