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 = {
3434 transaction : PendingTransaction ;
3535 paths : Field [ ] ;
3636} ;
37+ interface PrivateMempoolConfig {
38+ validationEnabled ?: boolean ;
39+ }
3740@sequencerModule ( )
38- export class PrivateMempool extends SequencerModule implements Mempool {
41+ export class PrivateMempool
42+ extends SequencerModule < PrivateMempoolConfig >
43+ implements Mempool
44+ {
3945 public readonly events = new EventEmitter < MempoolEvents > ( ) ;
4046
4147 private readonly accountStateHook : AccountStateHook ;
@@ -102,14 +108,16 @@ export class PrivateMempool extends SequencerModule implements Mempool {
102108
103109 const networkState =
104110 ( 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 ;
113121 this . protocol . stateServiceProvider . popCurrentStateService ( ) ;
114122 return sortedTxs ;
115123 }
You can’t perform that action at this time.
0 commit comments