Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions nomt/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -580,11 +580,6 @@ impl<T: HashAlgorithm> Session<T> {
);
}
}
let rollback_delta = self
.rollback_delta
.take()
.map(|delta_builder| delta_builder.finalize(&actuals));

let mut compact_actuals = Vec::with_capacity(actuals.len());
for (path, read_write) in &actuals {
compact_actuals.push((path.clone(), read_write.to_compact::<T>()));
Expand All @@ -594,6 +589,13 @@ impl<T: HashAlgorithm> Session<T> {
.merkle_updater
.update_and_prove::<T>(compact_actuals, self.witness_mode.0)?;

// Built while the merkle update runs: both only read the store, which is not modified
// until the finished session is committed.
let rollback_delta = self
.rollback_delta
.take()
.map(|delta_builder| delta_builder.finalize(&actuals));

let mut tx = self.store.new_value_tx();
for (path, read_write) in actuals {
if let KeyReadWrite::Write(value) | KeyReadWrite::ReadThenWrite(_, value) = read_write {
Expand Down
Loading