Skip to content

Commit

Permalink
Merge pull request #4557 from oasisprotocol/kostko/feature/checktx-co…
Browse files Browse the repository at this point in the history
…mmit

runtime: Commit check transaction results for subsequent batches
  • Loading branch information
kostko authored Mar 10, 2022
2 parents 8c72fa6 + 0b33d89 commit 4f27925
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions .changelog/4557.bugfix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
runtime: Commit check transaction results for subsequent batches
6 changes: 5 additions & 1 deletion runtime/src/dispatcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,7 @@ impl Dispatcher {
let mut overlay = OverlayTree::new(cache.tree_mut());

let txn_ctx = TxnContext::new(
ctx,
ctx.clone(),
protocol,
consensus_state,
&mut overlay,
Expand All @@ -531,6 +531,10 @@ impl Dispatcher {
);
let results = txn_dispatcher.check_batch(txn_ctx, &inputs);

// Commit results to in-memory tree so they persist for subsequent batches that are based on
// the same block.
let _ = overlay.commit(Context::create_child(&ctx)).unwrap();

debug!(self.logger, "Transaction batch check complete");

results.map(|results| Body::RuntimeCheckTxBatchResponse { results })
Expand Down

0 comments on commit 4f27925

Please sign in to comment.