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 @@ -34,8 +34,14 @@ type MempoolTransactionPaths = {
34
34
transaction : PendingTransaction ;
35
35
paths : Field [ ] ;
36
36
} ;
37
+ interface PrivateMempoolConfig {
38
+ validationEnabled ?: boolean ;
39
+ }
37
40
@sequencerModule ( )
38
- export class PrivateMempool extends SequencerModule implements Mempool {
41
+ export class PrivateMempool
42
+ extends SequencerModule < PrivateMempoolConfig >
43
+ implements Mempool
44
+ {
39
45
public readonly events = new EventEmitter < MempoolEvents > ( ) ;
40
46
41
47
private readonly accountStateHook : AccountStateHook ;
@@ -102,14 +108,16 @@ export class PrivateMempool extends SequencerModule implements Mempool {
102
108
103
109
const networkState =
104
110
( await this . getStagedNetworkState ( ) ) ?? NetworkState . empty ( ) ;
105
-
106
- const sortedTxs = await this . checkTxValid (
107
- txs ,
108
- baseCachedStateService ,
109
- this . protocol . stateServiceProvider ,
110
- networkState ,
111
- limit
112
- ) ;
111
+ const validationEnabled = this . config . validationEnabled ?? true ;
112
+ const sortedTxs = validationEnabled
113
+ ? await this . checkTxValid (
114
+ txs ,
115
+ baseCachedStateService ,
116
+ this . protocol . stateServiceProvider ,
117
+ networkState ,
118
+ limit
119
+ )
120
+ : txs ;
113
121
this . protocol . stateServiceProvider . popCurrentStateService ( ) ;
114
122
return sortedTxs ;
115
123
}
You can’t perform that action at this time.
0 commit comments