Skip to content
Draft
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
21 changes: 18 additions & 3 deletions crates/apollo_committer/src/committer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ where
impl<S, ForestDB> Committer<S, ForestDB>
where
S: StorageConstructor,
ForestDB: ForestStorageWithEmptyReadContext<Storage = S>,
ForestDB: ForestStorageWithEmptyReadContext<Storage = S> + ForestWriterWithMetadataAndWitnesses,
{
pub async fn new(config: CommitterConfig<S::Config>) -> Self {
let storage = S::create_storage(config.db_path.clone(), config.storage_config.clone());
Expand Down Expand Up @@ -382,10 +382,25 @@ where
to {last_committed_block}"
);
block_measurements.start_measurement(Action::Write);
let n_write_entries = self
.forest_storage
let n_write_entries = {
#[cfg(not(feature = "os_input"))]
{
self.forest_storage
.write_with_metadata(&filled_forest, metadata, deleted_nodes)
.await
}
#[cfg(feature = "os_input")]
{
self.forest_storage
.write_with_metadata_and_witnesses(
&filled_forest,
metadata,
deleted_nodes,
PatriciaProofsUpdates::Delete(height),
)
.await
}
}
.map_err(|err| self.map_internal_error(err))?;
block_measurements.attempt_to_stop_measurement(Action::Write, n_write_entries).ok();
block_measurements.attempt_to_stop_measurement(Action::EndToEnd, 0).ok();
Expand Down
Loading