File tree Expand file tree Collapse file tree 1 file changed +17
-9
lines changed
packages/sequencer/src/mempool/private Expand file tree Collapse file tree 1 file changed +17
-9
lines changed Original file line number Diff line number Diff line change @@ -32,8 +32,14 @@ type MempoolTransactionPaths = {
32
32
transaction : PendingTransaction ;
33
33
paths : Field [ ] ;
34
34
} ;
35
+ interface PrivateMempoolConfig {
36
+ validationEnabled ?: boolean ;
37
+ }
35
38
@sequencerModule ( )
36
- export class PrivateMempool extends SequencerModule implements Mempool {
39
+ export class PrivateMempool
40
+ extends SequencerModule < PrivateMempoolConfig >
41
+ implements Mempool
42
+ {
37
43
public readonly events = new EventEmitter < MempoolEvents > ( ) ;
38
44
39
45
private readonly accountStateHook : AccountStateHook ;
@@ -100,14 +106,16 @@ export class PrivateMempool extends SequencerModule implements Mempool {
100
106
101
107
const networkState =
102
108
( await this . getStagedNetworkState ( ) ) ?? NetworkState . empty ( ) ;
103
-
104
- const sortedTxs = await this . checkTxValid (
105
- txs ,
106
- baseCachedStateService ,
107
- this . protocol . stateServiceProvider ,
108
- networkState ,
109
- limit
110
- ) ;
109
+ const validationEnabled = this . config . validationEnabled ?? true ;
110
+ const sortedTxs = validationEnabled
111
+ ? await this . checkTxValid (
112
+ txs ,
113
+ baseCachedStateService ,
114
+ this . protocol . stateServiceProvider ,
115
+ networkState ,
116
+ limit
117
+ )
118
+ : txs ;
111
119
this . protocol . stateServiceProvider . popCurrentStateService ( ) ;
112
120
return sortedTxs ;
113
121
}
You can’t perform that action at this time.
0 commit comments