File tree Expand file tree Collapse file tree 2 files changed +10
-11
lines changed
packages/sequencer/src/protocol/production Expand file tree Collapse file tree 2 files changed +10
-11
lines changed Original file line number Diff line number Diff line change @@ -198,7 +198,7 @@ export class BatchProducerModule extends SequencerModule {
198
198
const toNetworkState = blocks . at ( - 1 ) ! . result . afterNetworkState ;
199
199
200
200
const changes = {
201
- commit : merkleTreeStore . commit ,
201
+ commit : async ( ) => await merkleTreeStore . mergeIntoParent ( ) ,
202
202
} ;
203
203
204
204
return {
Original file line number Diff line number Diff line change @@ -85,21 +85,20 @@ export class BatchTracingService {
85
85
86
86
public async traceBatch (
87
87
blocks : BlockWithResult [ ] ,
88
- merkleTreeStore : CachedMerkleTreeStore ,
89
- // TODO Implement and then also test
90
- parallel : boolean = false
88
+ merkleTreeStore : CachedMerkleTreeStore
91
89
) : Promise < BatchTrace > {
92
90
if ( blocks . length === 0 ) {
93
91
return { blocks : [ ] , stateTransitionTrace : [ ] } ;
94
92
}
95
93
96
- const blockTraces = await this . traceBlocks ( blocks ) ;
97
-
98
- // Trace STs
99
- const stateTransitionTrace = await this . traceStateTransitions (
100
- blocks ,
101
- merkleTreeStore
102
- ) ;
94
+ // Traces the STs and the blocks in parallel, however not in separate processes
95
+ // Therefore, we only optimize the idle time for async operations like DB reads
96
+ const [ blockTraces , stateTransitionTrace ] = await Promise . all ( [
97
+ // Trace blocks
98
+ this . traceBlocks ( blocks ) ,
99
+ // Trace STs
100
+ this . traceStateTransitions ( blocks , merkleTreeStore ) ,
101
+ ] ) ;
103
102
104
103
return {
105
104
blocks : blockTraces ,
You can’t perform that action at this time.
0 commit comments