File tree Expand file tree Collapse file tree 3 files changed +10
-4
lines changed
Expand file tree Collapse file tree 3 files changed +10
-4
lines changed Original file line number Diff line number Diff line change 1+ runtime: Make persistent transaction check state configurable
Original file line number Diff line number Diff line change @@ -12,6 +12,9 @@ pub struct Config {
1212 pub storage : Storage ,
1313 /// Advertised runtime features.
1414 pub features : Option < Features > ,
15+ /// Whether storage state should be persisted between transaction check invocations. The state
16+ /// is invalidated on the next round.
17+ pub persist_check_tx_state : bool ,
1518}
1619
1720/// Storage-related configuration.
Original file line number Diff line number Diff line change @@ -520,7 +520,7 @@ impl Dispatcher {
520520
521521 let txn_ctx = TxnContext :: new (
522522 ctx. clone ( ) ,
523- protocol,
523+ protocol. clone ( ) ,
524524 consensus_state,
525525 & mut overlay,
526526 & state. header ,
@@ -531,9 +531,11 @@ impl Dispatcher {
531531 ) ;
532532 let results = txn_dispatcher. check_batch ( txn_ctx, & inputs) ;
533533
534- // Commit results to in-memory tree so they persist for subsequent batches that are based on
535- // the same block.
536- let _ = overlay. commit ( Context :: create_child ( & ctx) ) . unwrap ( ) ;
534+ if protocol. get_config ( ) . persist_check_tx_state {
535+ // Commit results to in-memory tree so they persist for subsequent batches that are
536+ // based on the same block.
537+ let _ = overlay. commit ( Context :: create_child ( & ctx) ) . unwrap ( ) ;
538+ }
537539
538540 debug ! ( self . logger, "Transaction batch check complete" ) ;
539541
You can’t perform that action at this time.
0 commit comments