Skip to content

Commit

Permalink
comments on redundant main store reset and apply
Browse files Browse the repository at this point in the history
  • Loading branch information
rnbguy committed Apr 26, 2024
1 parent e9d9aa5 commit 57d7e8c
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions basecoin/app/src/abci/v0_37/impls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,10 @@ pub fn deliver_tx<S: Default + Debug + ProvableStore>(
for IdentifiedModule { module, .. } in modules.iter_mut() {
module.store_mut().reset();
}

// probably the main store doesn't need to be reset.
// currently the only time it is written while committing a block.
// but doing it nonetheless, just in case.
app.store.write_access().reset();
return ResponseDeliverTx::from_error(2, format!("deliver failed with error: {e}"));
}
Expand All @@ -223,6 +227,10 @@ pub fn deliver_tx<S: Default + Debug + ProvableStore>(
.apply()
.expect("failed to apply to module state");
}

// probably the main store doesn't need to be applied.
// currently the only time it is written while committing a block.
// but doing it nonetheless, just in case.
app.store
.write_access()
.apply()
Expand Down

0 comments on commit 57d7e8c

Please sign in to comment.