forked from Toffix17/xlayer-node
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
861 lines (725 loc) · 35.3 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
DOCKERCOMPOSE := docker-compose -f docker-compose.yml
DOCKERCOMPOSEAPPSEQ := xlayer-sequencer
DOCKERCOMPOSEAPPSEQSENDER := xlayer-sequence-sender
DOCKERCOMPOSEAPPSIGNER := xlayer-signer
DOCKERCOMPOSEAPPL2GASP := xlayer-l2gaspricer
DOCKERCOMPOSEAPPAGG := xlayer-aggregator
DOCKERCOMPOSEAPPRPC := xlayer-json-rpc
DOCKERCOMPOSEAPPSYNC := xlayer-sync
DOCKERCOMPOSEAPPETHTXMANAGER := xlayer-eth-tx-manager
DOCKERCOMPOSESTATEDB := xlayer-state-db
DOCKERCOMPOSEPOOLDB := xlayer-pool-db
DOCKERCOMPOSEEVENTDB := xlayer-event-db
DOCKERCOMPOSEDACDB := xlayer-data-availability-db
DOCKERCOMPOSENETWORK := xlayer-mock-l1-network
DOCKERCOMPOSEEXPLORERL1 := xlayer-explorer-l1
DOCKERCOMPOSEEXPLORERL1DB := xlayer-explorer-l1-db
DOCKERCOMPOSEEXPLORERL2 := xlayer-explorer-l2
DOCKERCOMPOSEEXPLORERL2DB := xlayer-explorer-l2-db
DOCKERCOMPOSEEXPLORERRPC := xlayer-explorer-json-rpc
DOCKERCOMPOSEDACNODE := xlayer-data-availability
DOCKERCOMPOSEZKPROVER := xlayer-prover
DOCKERCOMPOSEPERMISSIONLESSDB := xlayer-permissionless-db
DOCKERCOMPOSEPERMISSIONLESSNODE := xlayer-permissionless-node
DOCKERCOMPOSEPERMISSIONLESSNODEDAC := xlayer-permissionless-node-forced-DAC
DOCKERCOMPOSEPERMISSIONLESSZKPROVER := xlayer-permissionless-prover
DOCKERCOMPOSENODEAPPROVE := xlayer-approve
DOCKERCOMPOSEMETRICS := xlayer-metrics
DOCKERCOMPOSEAPPSEQV1TOV2 := xlayer-sequencer-v1tov2
DOCKERCOMPOSEAPPSEQSENDER := xlayer-sequence-sender
DOCKERCOMPOSEAPPSEQSENDERV1TOV2 := xlayer-sequence-sender-v1tov2
DOCKERCOMPOSEAPPL2GASP := xlayer-l2gaspricer
DOCKERCOMPOSEAPPL2GASPV1TOV2 := xlayer-l2gaspricer-v1tov2
DOCKERCOMPOSEAPPAGG := xlayer-aggregator
DOCKERCOMPOSEAPPAGGV1TOV2 := xlayer-aggregator-v1tov2
DOCKERCOMPOSEAPPRPC := xlayer-json-rpc
DOCKERCOMPOSEAPPRPCV1TOV2 := xlayer-json-rpc-v1tov2
DOCKERCOMPOSEAPPSYNC := xlayer-sync
DOCKERCOMPOSEAPPSYNCV1TOV2 := xlayer-sync-v1tov2
DOCKERCOMPOSEAPPETHTXMANAGER := xlayer-eth-tx-manager
DOCKERCOMPOSEAPPETHTXMANAGERV1TOV2 := xlayer-eth-tx-manager-v1tov2
DOCKERCOMPOSESTATEDB := xlayer-state-db
DOCKERCOMPOSEPOOLDB := xlayer-pool-db
DOCKERCOMPOSEEVENTDB := xlayer-event-db
DOCKERCOMPOSENETWORK := xlayer-mock-l1-network
DOCKERCOMPOSEV1TOV2NETWORK := xlayer-v1tov2-l1-network
DOCKERCOMPOSEEXPLORERL1 := xlayer-explorer-l1
DOCKERCOMPOSEEXPLORERL1DB := xlayer-explorer-l1-db
DOCKERCOMPOSEEXPLORERL2 := xlayer-explorer-l2
DOCKERCOMPOSEEXPLORERL2DB := xlayer-explorer-l2-db
DOCKERCOMPOSEEXPLORERRPC := xlayer-explorer-json-rpc
DOCKERCOMPOSEZKPROVER := xlayer-prover
DOCKERCOMPOSEPERMISSIONLESSDB := xlayer-permissionless-db
DOCKERCOMPOSEPERMISSIONLESSNODE := xlayer-permissionless-node
DOCKERCOMPOSEPERMISSIONLESSZKPROVER := xlayer-permissionless-prover
DOCKERCOMPOSENODEAPPROVE := xlayer-approve
DOCKERCOMPOSENODEAPPROVEV1TOV2 := xlayer-approve-v1tov2
DOCKERCOMPOSEMETRICS := xlayer-metrics
DOCKERCOMPOSEGRAFANA := grafana
RUNSTATEDB := $(DOCKERCOMPOSE) up -d $(DOCKERCOMPOSESTATEDB)
RUNPOOLDB := $(DOCKERCOMPOSE) up -d $(DOCKERCOMPOSEPOOLDB)
RUNEVENTDB := $(DOCKERCOMPOSE) up -d $(DOCKERCOMPOSEEVENTDB)
RUNDACDB := $(DOCKERCOMPOSE) up -d $(DOCKERCOMPOSEDACDB)
RUNDACNODE := $(DOCKERCOMPOSE) up -d $(DOCKERCOMPOSEDACNODE)
RUNSEQUENCER := $(DOCKERCOMPOSE) up -d $(DOCKERCOMPOSEAPPSEQ)
RUNV1TOV2SEQUENCER := $(DOCKERCOMPOSE) up -d $(DOCKERCOMPOSEAPPSEQV1TOV2)
RUNSEQUENCESENDER := $(DOCKERCOMPOSE) up -d $(DOCKERCOMPOSEAPPSEQSENDER)
RUNSIGNER := $(DOCKERCOMPOSE) up -d $(DOCKERCOMPOSEAPPSIGNER)
RUNV1TOV2SEQUENCESENDER := $(DOCKERCOMPOSE) up -d $(DOCKERCOMPOSEAPPSEQSENDERV1TOV2)
RUNL2GASPRICER := $(DOCKERCOMPOSE) up -d $(DOCKERCOMPOSEAPPL2GASP)
RUNV1TOV2L2GASPRICER := $(DOCKERCOMPOSE) up -d $(DOCKERCOMPOSEAPPL2GASPV1TOV2)
RUNAGGREGATOR := $(DOCKERCOMPOSE) up -d $(DOCKERCOMPOSEAPPAGG)
RUNV1TOV2AGGREGATOR := $(DOCKERCOMPOSE) up -d $(DOCKERCOMPOSEAPPAGGV1TOV2)
RUNJSONRPC := $(DOCKERCOMPOSE) up -d $(DOCKERCOMPOSEAPPRPC)
RUNV1TOV2JSONRPC := $(DOCKERCOMPOSE) up -d $(DOCKERCOMPOSEAPPRPCV1TOV2)
RUNSYNC := $(DOCKERCOMPOSE) up -d $(DOCKERCOMPOSEAPPSYNC)
RUNV1TOV2SYNC := $(DOCKERCOMPOSE) up -d $(DOCKERCOMPOSEAPPSYNCV1TOV2)
RUNETHTXMANAGER := $(DOCKERCOMPOSE) up -d $(DOCKERCOMPOSEAPPETHTXMANAGER)
RUNV1TOV2ETHTXMANAGER := $(DOCKERCOMPOSE) up -d $(DOCKERCOMPOSEAPPETHTXMANAGERV1TOV2)
RUNGRAFANA := DOCKERGID=`stat -c '%g' /var/run/docker.sock` $(DOCKERCOMPOSE) up -d $(DOCKERCOMPOSEGRAFANA)
RUNL1NETWORK := $(DOCKERCOMPOSE) up -d $(DOCKERCOMPOSENETWORK)
RUNV1TOV2L1NETWORK := $(DOCKERCOMPOSE) up -d $(DOCKERCOMPOSEV1TOV2NETWORK)
RUNEXPLORERL1 := $(DOCKERCOMPOSE) up -d $(DOCKERCOMPOSEEXPLORERL1)
RUNEXPLORERL1DB := $(DOCKERCOMPOSE) up -d $(DOCKERCOMPOSEEXPLORERL1DB)
RUNEXPLORERL2 := $(DOCKERCOMPOSE) up -d $(DOCKERCOMPOSEEXPLORERL2)
RUNEXPLORERL2DB := $(DOCKERCOMPOSE) up -d $(DOCKERCOMPOSEEXPLORERL2DB)
RUNEXPLORERJSONRPC := $(DOCKERCOMPOSE) up -d $(DOCKERCOMPOSEEXPLORERRPC)
RUNZKPROVER := $(DOCKERCOMPOSE) up -d $(DOCKERCOMPOSEZKPROVER)
RUNPERMISSIONLESSDB := $(DOCKERCOMPOSE) up -d $(DOCKERCOMPOSEPERMISSIONLESSDB)
RUNPERMISSIONLESSNODE := $(DOCKERCOMPOSE) up -d $(DOCKERCOMPOSEPERMISSIONLESSNODE)
RUNPERMISSIONLESSNODEDAC := $(DOCKERCOMPOSE) up -d $(DOCKERCOMPOSEPERMISSIONLESSNODEDAC)
RUNPERMISSIONLESSZKPROVER := $(DOCKERCOMPOSE) up -d $(DOCKERCOMPOSEPERMISSIONLESSZKPROVER)
RUNAPPROVE := $(DOCKERCOMPOSE) up -d $(DOCKERCOMPOSENODEAPPROVE)
RUNV1TOV2APPROVE := $(DOCKERCOMPOSE) up -d $(DOCKERCOMPOSENODEAPPROVEV1TOV2)
RUNMETRICS := $(DOCKERCOMPOSE) up -d $(DOCKERCOMPOSEMETRICS)
RUN := $(DOCKERCOMPOSE) up -d
STOPSTATEDB := $(DOCKERCOMPOSE) stop $(DOCKERCOMPOSESTATEDB) && $(DOCKERCOMPOSE) rm -f $(DOCKERCOMPOSESTATEDB)
STOPPOOLDB := $(DOCKERCOMPOSE) stop $(DOCKERCOMPOSEPOOLDB) && $(DOCKERCOMPOSE) rm -f $(DOCKERCOMPOSEPOOLDB)
STOPEVENTDB := $(DOCKERCOMPOSE) stop $(DOCKERCOMPOSEEVENTDB) && $(DOCKERCOMPOSE) rm -f $(DOCKERCOMPOSEEVENTDB)
STOPDACDB := $(DOCKERCOMPOSE) stop $(DOCKERCOMPOSEDACDB) && $(DOCKERCOMPOSE) rm -f $(DOCKERCOMPOSEDACDB)
STOPDACNODE := $(DOCKERCOMPOSE) stop $(DOCKERCOMPOSEDACNODE) && $(DOCKERCOMPOSE) rm -f $(DOCKERCOMPOSEDACNODE)
STOPSEQUENCER := $(DOCKERCOMPOSE) stop $(DOCKERCOMPOSEAPPSEQ) && $(DOCKERCOMPOSE) rm -f $(DOCKERCOMPOSEAPPSEQ)
STOPV1TOV2SEQUENCER := $(DOCKERCOMPOSE) stop $(DOCKERCOMPOSEAPPSEQV1TOV2) && $(DOCKERCOMPOSE) rm -f $(DOCKERCOMPOSEAPPSEQV1TOV2)
STOPSEQUENCESENDER := $(DOCKERCOMPOSE) stop $(DOCKERCOMPOSEAPPSEQSENDER) && $(DOCKERCOMPOSE) rm -f $(DOCKERCOMPOSEAPPSEQSENDER)
STOPSIGNER := $(DOCKERCOMPOSE) stop $(DOCKERCOMPOSEAPPSIGNER) && $(DOCKERCOMPOSE) rm -f $(DOCKERCOMPOSEAPPSIGNER)
STOPV1TOV2SEQUENCESENDER := $(DOCKERCOMPOSE) stop $(DOCKERCOMPOSEAPPSEQSENDERV1TOV2) && $(DOCKERCOMPOSE) rm -f $(DOCKERCOMPOSEAPPSEQSENDERV1TOV2)
STOPL2GASPRICER := $(DOCKERCOMPOSE) stop $(DOCKERCOMPOSEAPPL2GASP) && $(DOCKERCOMPOSE) rm -f $(DOCKERCOMPOSEAPPL2GASP)
STOPV1TOV2L2GASPRICER := $(DOCKERCOMPOSE) stop $(DOCKERCOMPOSEAPPL2GASPV1TOV2) && $(DOCKERCOMPOSE) rm -f $(DOCKERCOMPOSEAPPL2GASPV1TOV2)
STOPAGGREGATOR := $(DOCKERCOMPOSE) stop $(DOCKERCOMPOSEAPPAGG) && $(DOCKERCOMPOSE) rm -f $(DOCKERCOMPOSEAPPAGG)
STOPV1TOV2AGGREGATOR := $(DOCKERCOMPOSE) stop $(DOCKERCOMPOSEAPPAGGV1TOV2) && $(DOCKERCOMPOSE) rm -f $(DOCKERCOMPOSEAPPAGGV1TOV2)
STOPJSONRPC := $(DOCKERCOMPOSE) stop $(DOCKERCOMPOSEAPPRPC) && $(DOCKERCOMPOSE) rm -f $(DOCKERCOMPOSEAPPRPC)
STOPV1TOV2JSONRPC := $(DOCKERCOMPOSE) stop $(DOCKERCOMPOSEAPPRPCV1TOV2) && $(DOCKERCOMPOSE) rm -f $(DOCKERCOMPOSEAPPRPCV1TOV2)
STOPSYNC := $(DOCKERCOMPOSE) stop $(DOCKERCOMPOSEAPPSYNC) && $(DOCKERCOMPOSE) rm -f $(DOCKERCOMPOSEAPPSYNC)
STOPV1TOV2SYNC := $(DOCKERCOMPOSE) stop $(DOCKERCOMPOSEAPPSYNCV1TOV2) && $(DOCKERCOMPOSE) rm -f $(DOCKERCOMPOSEAPPSYNCV1TOV2)
STOPETHTXMANAGER := $(DOCKERCOMPOSE) stop $(DOCKERCOMPOSEAPPETHTXMANAGER) && $(DOCKERCOMPOSE) rm -f $(DOCKERCOMPOSEAPPETHTXMANAGER)
STOPV1TOV2ETHTXMANAGER := $(DOCKERCOMPOSE) stop $(DOCKERCOMPOSEAPPETHTXMANAGERV1TOV2) && $(DOCKERCOMPOSE) rm -f $(DOCKERCOMPOSEAPPETHTXMANAGERV1TOV2)
STOPGRAFANA := $(DOCKERCOMPOSE) stop $(DOCKERCOMPOSEGRAFANA) && $(DOCKERCOMPOSE) rm -f $(DOCKERCOMPOSEGRAFANA)
STOPNETWORK := $(DOCKERCOMPOSE) stop $(DOCKERCOMPOSENETWORK) && $(DOCKERCOMPOSE) rm -f $(DOCKERCOMPOSENETWORK)
STOPV1TOV2NETWORK := $(DOCKERCOMPOSE) stop $(DOCKERCOMPOSEV1TOV2NETWORK) && $(DOCKERCOMPOSE) rm -f $(DOCKERCOMPOSEV1TOV2NETWORK)
STOPEXPLORERL1 := $(DOCKERCOMPOSE) stop $(DOCKERCOMPOSEEXPLORERL1) && $(DOCKERCOMPOSE) rm -f $(DOCKERCOMPOSEEXPLORERL1)
STOPEXPLORERL1DB := $(DOCKERCOMPOSE) stop $(DOCKERCOMPOSEEXPLORERL1DB) && $(DOCKERCOMPOSE) rm -f $(DOCKERCOMPOSEEXPLORERL1DB)
STOPEXPLORERL2 := $(DOCKERCOMPOSE) stop $(DOCKERCOMPOSEEXPLORERL2) && $(DOCKERCOMPOSE) rm -f $(DOCKERCOMPOSEEXPLORERL2)
STOPEXPLORERL2DB := $(DOCKERCOMPOSE) stop $(DOCKERCOMPOSEEXPLORERL2DB) && $(DOCKERCOMPOSE) rm -f $(DOCKERCOMPOSEEXPLORERL2DB)
STOPEXPLORERJSONRPC := $(DOCKERCOMPOSE) stop $(DOCKERCOMPOSEEXPLORERRPC) && $(DOCKERCOMPOSE) rm -f $(DOCKERCOMPOSEEXPLORERRPC)
STOPZKPROVER := $(DOCKERCOMPOSE) stop $(DOCKERCOMPOSEZKPROVER) && $(DOCKERCOMPOSE) rm -f $(DOCKERCOMPOSEZKPROVER)
STOPPERMISSIONLESSDB := $(DOCKERCOMPOSE) stop $(DOCKERCOMPOSEPERMISSIONLESSDB) && $(DOCKERCOMPOSE) rm -f $(DOCKERCOMPOSEPERMISSIONLESSDB)
STOPPERMISSIONLESSNODE := $(DOCKERCOMPOSE) stop $(DOCKERCOMPOSEPERMISSIONLESSNODE) && $(DOCKERCOMPOSE) rm -f $(DOCKERCOMPOSEPERMISSIONLESSNODE)
STOPPERMISSIONLESSNODEDAC := $(DOCKERCOMPOSE) stop $(DOCKERCOMPOSEPERMISSIONLESSNODEDAC) && $(DOCKERCOMPOSE) rm -f $(DOCKERCOMPOSEPERMISSIONLESSNODEDAC)
STOPPERMISSIONLESSZKPROVER := $(DOCKERCOMPOSE) stop $(DOCKERCOMPOSEPERMISSIONLESSZKPROVER) && $(DOCKERCOMPOSE) rm -f $(DOCKERCOMPOSEPERMISSIONLESSZKPROVER)
STOPAPPROVE := $(DOCKERCOMPOSE) stop $(DOCKERCOMPOSENODEAPPROVE) && $(DOCKERCOMPOSE) rm -f $(DOCKERCOMPOSENODEAPPROVE)
STOPV1TOV2APPROVE := $(DOCKERCOMPOSE) stop $(DOCKERCOMPOSENODEAPPROVEV1TOV2) && $(DOCKERCOMPOSE) rm -f $(DOCKERCOMPOSENODEAPPROVEV1TOV2)
STOPMETRICS := $(DOCKERCOMPOSE) stop $(DOCKERCOMPOSEMETRICS) && $(DOCKERCOMPOSE) rm -f $(DOCKERCOMPOSEMETRICS)
STOP := $(DOCKERCOMPOSE) down --remove-orphans
.PHONY: test-full-non-e2e
test-full-non-e2e: stop ## Runs non-e2e tests checking race conditions
$(RUNSTATEDB)
$(RUNPOOLDB)
$(RUNEVENTDB)
$(RUNDACDB)
sleep 2
$(RUNZKPROVER)
sleep 7
$(RUNL1NETWORK)
sleep 15
docker ps -a
docker logs $(DOCKERCOMPOSEZKPROVER)
trap '$(STOP)' EXIT; MallocNanoZone=0 go test -count=1 -short -race -p 1 -covermode=atomic -coverprofile=../coverage.out -coverpkg ./... -timeout 70s ../...
.PHONY: test-e2e-group-1
test-e2e-group-1: stop ## Runs group 1 e2e tests checking race conditions
$(RUNSTATEDB)
$(RUNPOOLDB)
$(RUNEVENTDB)
$(RUNDACDB)
sleep 5
$(RUNZKPROVER)
docker ps -a
docker logs $(DOCKERCOMPOSEZKPROVER)
trap '$(STOP)' EXIT; MallocNanoZone=0 go test -count=1 -failfast -race -v -p 1 -timeout 600s ../ci/e2e-group1/...
.PHONY: test-e2e-group-2
test-e2e-group-2: stop ## Runs group 2 e2e tests checking race conditions
$(RUNSTATEDB)
$(RUNPOOLDB)
$(RUNEVENTDB)
$(RUNDACDB)
sleep 5
$(RUNZKPROVER)
docker ps -a
docker logs $(DOCKERCOMPOSEZKPROVER)
trap '$(STOP)' EXIT; MallocNanoZone=0 go test -count=1 -failfast -race -v -p 1 -timeout 600s ../ci/e2e-group2/...
.PHONY: test-e2e-group-3
test-e2e-group-3: stop ## Runs group 3 e2e tests checking race conditions
$(RUNSTATEDB)
$(RUNPOOLDB)
$(RUNEVENTDB)
$(RUNDACDB)
sleep 5
$(RUNZKPROVER)
docker ps -a
docker logs $(DOCKERCOMPOSEZKPROVER)
trap '$(STOP)' EXIT; MallocNanoZone=0 go test -count=1 -failfast -race -v -p 1 -timeout 600s ../ci/e2e-group3/...
.PHONY: test-e2e-group-4
test-e2e-group-4: stop ## Runs group 4 e2e tests checking race conditions
$(RUNSTATEDB)
$(RUNPOOLDB)
$(RUNEVENTDB)
$(RUNDACDB)
sleep 5
$(RUNZKPROVER)
docker ps -a
docker logs $(DOCKERCOMPOSEZKPROVER)
trap '$(STOP)' EXIT; MallocNanoZone=0 go test -count=1 -failfast -race -v -p 1 -timeout 600s ../ci/e2e-group4/...
.PHONY: test-e2e-group-5
test-e2e-group-5: stop ## Runs group 5 e2e tests checking race conditions
$(RUNSTATEDB)
$(RUNPOOLDB)
$(RUNEVENTDB)
$(RUNDACDB)
sleep 5
$(RUNZKPROVER)
docker ps -a
docker logs $(DOCKERCOMPOSEZKPROVER)
trap '$(STOP)' EXIT; MallocNanoZone=0 go test -count=1 -failfast -race -v -p 1 -timeout 1200s ../ci/e2e-group5/...
.PHONY: test-e2e-group-6
test-e2e-group-6: stop ## Runs group 6 e2e tests checking race conditions
$(RUNSTATEDB)
$(RUNPOOLDB)
$(RUNEVENTDB)
$(RUNDACDB)
sleep 5
$(RUNZKPROVER)
docker ps -a
docker logs $(DOCKERCOMPOSEZKPROVER)
trap '$(STOP)' EXIT; MallocNanoZone=0 go test -count=1 -failfast -race -v -p 1 -timeout 600s ../ci/e2e-group6/...
.PHONY: test-e2e-group-7
test-e2e-group-7: stop ## Runs group 7 e2e tests checking race conditions
$(RUNSTATEDB)
$(RUNPOOLDB)
$(RUNEVENTDB)
$(RUNDACDB)
sleep 5
$(RUNZKPROVER)
docker ps -a
docker logs $(DOCKERCOMPOSEZKPROVER)
trap '$(STOP)' EXIT; MallocNanoZone=0 go test -count=1 -failfast -race -v -p 1 -timeout 720s ../ci/e2e-group7/...
.PHONY: test-e2e-group-8
test-e2e-group-8: stop ## Runs group 8 e2e tests checking race conditions
$(RUNSTATEDB)
$(RUNPOOLDB)
$(RUNEVENTDB)
$(RUNDACDB)
sleep 5
$(RUNZKPROVER)
docker ps -a
docker logs $(DOCKERCOMPOSEZKPROVER)
trap '$(STOP)' EXIT; MallocNanoZone=0 go test -count=1 -failfast -race -v -p 1 -timeout 1200s ../ci/e2e-group8/...
.PHONY: test-e2e-group-9
test-e2e-group-9: stop ## Runs group 9 e2e tests checking race conditions
$(RUNSTATEDB)
$(RUNPOOLDB)
$(RUNEVENTDB)
$(RUNDACDB)
sleep 5
$(RUNZKPROVER)
docker ps -a
docker logs $(DOCKERCOMPOSEZKPROVER)
trap '$(STOP)' EXIT; MallocNanoZone=0 go test -count=1 -failfast -race -v -p 1 -timeout 2000s ../ci/e2e-group9/...
.PHONY: test-e2e-group-10
test-e2e-group-10: stop ## Runs group 10 e2e tests checking race conditions
$(RUNSTATEDB)
$(RUNPOOLDB)
$(RUNEVENTDB)
$(RUNDACDB)
sleep 5
$(RUNZKPROVER)
docker ps -a
docker logs $(DOCKERCOMPOSEZKPROVER)
trap '$(STOP)' EXIT; MallocNanoZone=0 go test -count=1 -failfast -race -v -p 1 -timeout 2000s ../ci/e2e-group10/...
.PHONY: test-e2e-group-11
test-e2e-group-11: stop ## Runs group 11 e2e tests checking race conditions
$(RUNSTATEDB)
$(RUNPOOLDB)
$(RUNEVENTDB)
$(RUNDACDB)
sleep 5
$(RUNZKPROVER)
docker ps -a
docker logs $(DOCKERCOMPOSEZKPROVER)
trap '$(STOP)' EXIT; MallocNanoZone=0 go test -count=1 -failfast -race -v -p 1 -timeout 2000s ../ci/e2e-group11/...
.PHONY: test-e2e-e2e-group-dac-1
test-e2e-group-dac-1: stop ## Runs xlayer-validium-1 e2e tests checking race conditions
$(RUNSTATEDB)
$(RUNPOOLDB)
$(RUNEVENTDB)
sleep 5
$(RUNZKPROVER)
docker ps -a
docker logs $(DOCKERCOMPOSEZKPROVER)
trap '$(STOP)' EXIT; MallocNanoZone=0 go test -count=1 -race -v -p 1 -timeout 2000s ../ci/e2e-group-dac-1/...
.PHONY: benchmark-sequencer-eth-transfers
benchmark-sequencer-eth-transfers: stop
$(RUNL1NETWORK)
$(RUNSTATEDB)
$(RUNPOOLDB)
$(RUNEVENTDB)
$(RUNDACDB)
sleep 5
$(RUNZKPROVER)
$(RUNSYNC)
sleep 2
$(RUNL2GASPRICER)
$(RUNJSONRPC)
docker ps -a
docker logs $(DOCKERCOMPOSEZKPROVER)
@ cd benchmarks/sequencer/e2e/eth-transfers ; \
mkdir -p results ; \
touch ./results/out.dat ; \
go test -bench=. -timeout=600m | tee ./results/out.dat ;
.PHONY: benchmark-sequencer-erc20-transfers
benchmark-sequencer-erc20-transfers: stop
$(RUNL1NETWORK)
$(RUNSTATEDB)
$(RUNPOOLDB)
$(RUNEVENTDB)
$(RUNDACDB)
sleep 5
$(RUNZKPROVER)
$(RUNSYNC)
sleep 2
$(RUNL2GASPRICER)
$(RUNJSONRPC)
docker ps -a
docker logs $(DOCKERCOMPOSEZKPROVER)
@ cd benchmarks/sequencer/e2e/erc20-transfers ; \
mkdir -p results ; \
touch ./results/out.dat ; \
go test -bench=. -timeout=600m | tee ./results/out.dat ;
.PHONY: benchmark-sequencer-uniswap-transfers
benchmark-sequencer-uniswap-transfers: stop
$(RUNL1NETWORK)
$(RUNSTATEDB)
$(RUNPOOLDB)
$(RUNEVENTDB)
sleep 5
$(RUNZKPROVER)
$(RUNSYNC)
sleep 2
$(RUNL2GASPRICER)
$(RUNJSONRPC)
docker ps -a
docker logs $(DOCKERCOMPOSEZKPROVER)
@ cd benchmarks/sequencer/e2e/uniswap-transfers ; \
mkdir -p results ; \
touch ./results/out.dat ; \
go test -bench=. -timeout=600m | tee ./results/out.dat ;
.PHONY: run-db
run-db: ## Runs the node database
$(RUNSTATEDB)
$(RUNPOOLDB)
$(RUNEVENTDB)
$(RUNDACDB)
.PHONY: stop-db
stop-db: ## Stops the node database
$(STOPEVENTDB)
$(STOPPOOLDB)
$(STOPSTATEDB)
$(STOPDACDB)
.PHONY: run-node
run-node: ## Runs the node
$(RUNETHTXMANAGER)
$(RUNSYNC)
sleep 2
$(RUNDACNODE)
$(RUNSEQUENCER)
#$(RUNSIGNER)
$(RUNSEQUENCESENDER)
$(RUNL2GASPRICER)
$(RUNAGGREGATOR)
$(RUNJSONRPC)
.PHONY: stop-node
stop-node: ## Stops the node
$(STOPDACNODE)
$(STOPSEQUENCER)
#$(STOPSIGNER)
$(STOPSEQUENCESENDER)
$(STOPJSONRPC)
$(STOPL2GASPRICER)
$(STOPAGGREGATOR)
$(STOPSYNC)
$(STOPETHTXMANAGER)
.PHONY: run-network
run-network: ## Runs the l1 network
$(RUNL1NETWORK)
.PHONY: run-network-v1tov2
run-network-v1tov2: ## Runs the v1tov2 l1 network
$(RUNV1TOV2L1NETWORK)
.PHONY: stop-network
stop-network: ## Stops the l1 network
$(STOPNETWORK)
.PHONY: stop-network-v1tov2
stop-network-v1tov2: ## Stops the l1 network
$(STOPV1TOV2NETWORK)
.PHONY: run-zkprover
run-zkprover: ## Runs zkprover
$(RUNZKPROVER)
.PHONY: stop-zkprover
stop-zkprover: ## Stops zkprover
$(STOPZKPROVER)
.PHONY: run-l1-explorer
run-l1-explorer: ## Runs L1 blockscan explorer
$(RUNEXPLORERL1DB)
$(RUNEXPLORERL1)
.PHONY: run-l2-explorer
run-l2-explorer: ## Runs L2 blockscan explorer
$(RUNEXPLORERL2DB)
$(RUNEXPLORERJSONRPC)
$(RUNEXPLORERL2)
.PHONY: run-l2-explorer-json-rpc
run-l2-explorer-json-rpc: ## Runs L2 explorer json rpc
$(RUNEXPLORERJSONRPC)
.PHONY: stop-l2-explorer-json-rpc
stop-l2-explorer-json-rpc: ## Stops L2 explorer json rpc
$(STOPEXPLORERJSONRPC)
.PHONY: run-explorer
run-explorer: run-l1-explorer run-l2-explorer ## Runs both L1 and L2 explorers
.PHONY: stop-explorer
stop-explorer: ## Stops the explorer
$(STOPEXPLORERL2)
$(STOPEXPLORERL1)
$(STOPEXPLORERJSONRPC)
$(STOPEXPLORERL2DB)
$(STOPEXPLORERL1DB)
.PHONY: run-explorer-db
run-explorer-db: ## Runs the explorer database
$(RUNEXPLORERL1DB)
$(RUNEXPLORERL2DB)
.PHONY: stop-explorer-db
stop-explorer-db: ## Stops the explorer database
$(STOPEXPLORERL2DB)
$(STOPEXPLORERL1DB)
.PHONY: run-seq
run-seq: ## runs the sequencer
$(RUNSEQUENCER)
.PHONY: run-seq-v1tov2
run-seq-v1tov2: ## runs the sequencer
$(RUNV1TOV2SEQUENCER)
.PHONY: stop-seq
stop-seq: ## stops the sequencer
$(STOPSEQUENCER)
.PHONY: stop-seq-v1tov2
stop-seq-v1tov2: ## stops the sequencer
$(STOPV1TOV2SEQUENCER)
.PHONY: run-seqsender
run-seqsender: ## runs the sequencer sender
$(RUNSEQUENCESENDER)
.PHONY: run-seqsender-v1tov2
run-seqsender-v1tov2: ## runs the sequencer sender
$(RUNV1TOV2SEQUENCESENDER)
.PHONY: stop-seqsender
stop-seqsender: ## stops the sequencer sender
$(STOPSEQUENCESENDER)
.PHONY: run-signer
run-signer: ## runs the signer
$(RUNSIGNER)
.PHONY: stop-signer
stop-signer: ## stops the signer
$(STOPSIGNER)
.PHONY: stop-seqsender-v1tov2
stop-seqsender-v1tov2: ## stops the sequencer sender
$(STOPV1TOV2SEQUENCESENDER)
.PHONY: run-sync
run-sync: ## runs the synchronizer
$(RUNSYNC)
.PHONY: run-sync-v1tov2
run-sync-v1tov2: ## runs the synchronizer
$(RUNV1TOV2SYNC)
.PHONY: stop-sync
stop-sync: ## stops the synchronizer
$(STOPSYNC)
.PHONY: stop-sync-v1tov2
stop-sync-v1tov2: ## stops the synchronizer
$(STOPV1TOV2SYNC)
.PHONY: run-json-rpc
run-json-rpc: ## runs the JSON-RPC
$(RUNJSONRPC)
.PHONY: run-json-rpc-v1tov2
run-json-rpc-v1tov2: ## runs the JSON-RPC
$(RUNV1TOV2JSONRPC)
.PHONY: stop-json-rpc
stop-json-rpc: ## stops the JSON-RPC
$(STOPJSONRPC)
.PHONY: stop-json-rpc-v1tov2
stop-json-rpc-v1tov2: ## stops the JSON-RPC
$(STOPV1TOV2JSONRPC)
.PHONY: run-l2gaspricer
run-l2gaspricer: ## runs the L2 Gas Price component
$(RUNL2GASPRICER)
.PHONY: run-l2gaspricer-v1tov2
run-l2gaspricer-v1tov2: ## runs the L2 Gas Price component
$(RUNV1TOV2L2GASPRICER)
.PHONY: stop-l2gaspricer
stop-l2gaspricer: ## stops the L2 Gas Price component
$(STOPL2GASPRICER)
.PHONY: stop-l2gaspricer-v1tov2
stop-l2gaspricer-v1tov2: ## stops the L2 Gas Price component
$(STOPV1TOV2L2GASPRICER)
.PHONY: run-eth-tx-manager
run-eth-tx-manager: ## Runs the eth tx manager service
$(RUNETHTXMANAGER)
.PHONY: run-eth-tx-manager-v1tov2
run-eth-tx-manager-v1tov2: ## Runs the eth tx manager service
$(RUNV1TOV2ETHTXMANAGER)
.PHONY: stop-eth-tx-manager
stop-eth-tx-manager: ## Stops the eth tx manager service
$(STOPETHTXMANAGER)
.PHONY: stop-eth-tx-manager-v1tov2
stop-eth-tx-manager-v1tov2: ## Stops the eth tx manager service
$(STOPV1TOV2ETHTXMANAGER)
.PHONY: run-agg
run-agg: ## Runs the aggregator service
$(RUNAGGREGATOR)
.PHONY: run-agg-v1tov2
run-agg-v1tov2: ## Runs the aggregator service
$(RUNV1TOV2AGGREGATOR)
.PHONY: stop-agg
stop-agg: ## Stops the aggregator service
$(STOPAGGREGATOR)
.PHONY: stop-agg-v1tov2
stop-agg-v1tov2: ## Stops the aggregator service
$(STOPV1TOV2AGGREGATOR)
.PHONY: run-grafana
run-grafana: ## Runs the grafana service
$(RUNGRAFANA)
.PHONY: stop-grafana
stop-grafana: ## Stops the grafana service
$(STOPGRAFANA)
.PHONY: run-permissionless
run-permissionless: run-node run-permissionless-dependencies ## Runs the trusted and permissionless node
$(RUNPERMISSIONLESSDB)
sleep 3
$(RUNPERMISSIONLESSZKPROVER)
$(RUNPERMISSIONLESSNODE)
.PHONY: stop-permissionless
stop-permissionless: stop-node stop-permissionless-dependencies ## Stops the permissionless node
$(STOPPERMISSIONLESSNODE)
PHONY: run-permissionless-dependencies
run-permissionless-dependencies: ## Runs the permissionless dependencies (db + prover) without the node
$(RUNPERMISSIONLESSDB)
sleep 3
$(RUNPERMISSIONLESSZKPROVER)
PHONY: stop-permissionless-dependencies
stop-permissionless-dependencies: ## Stop the permissionless dependencies (db + prover) without the node
$(STOPPERMISSIONLESSNODE)
$(STOPPERMISSIONLESSZKPROVER)
$(STOPPERMISSIONLESSDB)
.PHONY: run-permissionless-dac
run-permissionless-dac: ## Runs a permissionless node that is forced to sync through DAC
$(RUNPERMISSIONLESSDB)
sleep 1
$(RUNPERMISSIONLESSZKPROVER)
$(RUNPERMISSIONLESSNODEDAC)
.PHONY: stop-permissionless-dac
stop-permissionless-dac: ## Stops the permissionless node that is forced to sync through DAC
$(STOPPERMISSIONLESSNODEDAC)
$(STOPPERMISSIONLESSZKPROVER)
$(STOPPERMISSIONLESSDB)
.PHONY: run-approve-pol
run-approve-pol: ## Runs approve in node container
$(RUNAPPROVE)
.PHONY: run-approve-pol-v1tov2
run-approve-pol-v1tov2: ## Runs approve in node container
$(RUNV1TOV2APPROVE)
.PHONY: stop-approve-pol
stop-approve-pol: ## Stops approve in node container
$(STOPAPPROVE)
.PHONY: stop-approve-pol-v1tov2
stop-approve-pol-v1tov2: ## Stops approve in node container
$(STOPV1TOV2APPROVE)
.PHONY: run
run: ## Runs a full node
$(RUNSTATEDB)
$(RUNPOOLDB)
$(RUNEVENTDB)
$(RUNDACDB)
$(RUNL1NETWORK)
sleep 1
$(RUNZKPROVER)
$(RUNAPPROVE)
sleep 3
$(RUNSYNC)
sleep 4
$(RUNDACNODE)
$(RUNETHTXMANAGER)
$(RUNSEQUENCER)
#$(RUNSIGNER)
$(RUNSEQUENCESENDER)
$(RUNL2GASPRICER)
$(RUNAGGREGATOR)
$(RUNJSONRPC)
.PHONY: run-v1tov2
run-v1tov2: ## Runs a full node using v1tov2 network
$(RUNSTATEDB)
$(RUNPOOLDB)
$(RUNEVENTDB)
$(RUNV1TOV2L1NETWORK)
sleep 1
$(RUNZKPROVER)
$(RUNV1TOV2APPROVE)
sleep 3
$(RUNV1TOV2SYNC)
sleep 4
$(RUNV1TOV2ETHTXMANAGER)
$(RUNV1TOV2SEQUENCER)
$(RUNV1TOV2SEQUENCESENDER)
$(RUNV1TOV2L2GASPRICER)
$(RUNV1TOV2AGGREGATOR)
$(RUNV1TOV2JSONRPC)
.PHONY: stop
stop: ## Stops all services
$(STOP)
.PHONY: ship
ship: ## Builds docker images and run them
cd .. && make build-docker && cd ./test && make run
.PHONY: reship
reship: stop ship ## Executes `make stop` and `make sail` commands
.PHONY: restart
restart: stop run ## Executes `make stop` and `make run` commands
.PHONY: run-metrics
run-metrics: ## Runs the metrics container
$(RUNMETRICS)
.PHONY: stop-metrics
stop-metrics: ## Stops the metrics container
$(STOPMETRICS)
.PHONY: run-dac-db
run-dac-db: ## Suns the DAC DB
$(RUNDACDB)
.PHONY: stop-dac-db
stop-dac-db: ## Stops the DAC DB
$(STOPDACDB)
.PHONY: init-network
init-network: ## Initializes the network
go run ./scripts/init_network/main.go .
.PHONY: show-logs
show-logs: ## Show logs for running docker
$(DOCKERCOMPOSE) logs
.PHONY: deploy-sc
deploy-sc: ## deploys some examples of transactions and smart contracts
go run ./scripts/deploy_sc/main.go .
.PHONY: send-transfers
send-transfers: ## sends some ETH transfers txs to test the network
go run ./scripts/send_transfers/main.go .
.PHONY: deploy-uniswap
deploy-uniswap: ## deploy the uniswap environment to the network
go run ./scripts/uniswap/main.go .
.PHONY: run-db-scripts
run-db-scripts: ## Executes scripts on the db after it has been initialized, potentially using info from the environment
./scripts/postgres/run.sh
.PHONY: install-mockery
install-mockery: ## Installs mockery with the correct version to generate the mocks
go install github.com/vektra/mockery/[email protected]
.PHONY: generate-mocks
generate-mocks: generate-mocks-jsonrpc generate-mocks-sequencer generate-mocks-sequencesender generate-mocks-synchronizer generate-mocks-etherman generate-mocks-aggregator generate-mocks-state ## Generates mocks for the tests, using mockery tool
.PHONY: generate-mocks-jsonrpc
generate-mocks-jsonrpc: ## Generates mocks for jsonrpc , using mockery tool
export "GOROOT=$$(go env GOROOT)" && $$(go env GOPATH)/bin/mockery --name=storageInterface --dir=../jsonrpc --output=../jsonrpc --outpkg=jsonrpc --inpackage --structname=storageMock --filename=mock_storage.go
export "GOROOT=$$(go env GOROOT)" && $$(go env GOPATH)/bin/mockery --name=PoolInterface --dir=../jsonrpc/types --output=../jsonrpc/mocks --outpkg=mocks --structname=PoolMock --filename=mock_pool.go
export "GOROOT=$$(go env GOROOT)" && $$(go env GOPATH)/bin/mockery --name=StateInterface --dir=../jsonrpc/types --output=../jsonrpc/mocks --outpkg=mocks --structname=StateMock --filename=mock_state.go
export "GOROOT=$$(go env GOROOT)" && $$(go env GOPATH)/bin/mockery --name=EthermanInterface --dir=../jsonrpc/types --output=../jsonrpc/mocks --outpkg=mocks --structname=EthermanMock --filename=mock_etherman.go
export "GOROOT=$$(go env GOROOT)" && $$(go env GOPATH)/bin/mockery --name=Tx --srcpkg=github.com/jackc/pgx/v4 --output=../jsonrpc/mocks --outpkg=mocks --structname=DBTxMock --filename=mock_dbtx.go
.PHONY: generate-mocks-sequencer
generate-mocks-sequencer: ## Generates mocks for sequencer , using mockery tool
export "GOROOT=$$(go env GOROOT)" && $$(go env GOPATH)/bin/mockery --name=workerInterface --dir=../sequencer --output=../sequencer --outpkg=sequencer --inpackage --structname=WorkerMock --filename=mock_worker.go
export "GOROOT=$$(go env GOROOT)" && $$(go env GOPATH)/bin/mockery --name=stateInterface --dir=../sequencer --output=../sequencer --outpkg=sequencer --inpackage --structname=StateMock --filename=mock_state.go
export "GOROOT=$$(go env GOROOT)" && $$(go env GOPATH)/bin/mockery --name=txPool --dir=../sequencer --output=../sequencer --outpkg=sequencer --inpackage --structname=PoolMock --filename=mock_pool.go
export "GOROOT=$$(go env GOROOT)" && $$(go env GOPATH)/bin/mockery --name=Tx --srcpkg=github.com/jackc/pgx/v4 --output=../sequencer --outpkg=sequencer --structname=DbTxMock --filename=mock_dbtx.go
export "GOROOT=$$(go env GOROOT)" && $$(go env GOPATH)/bin/mockery --name=ethermanInterface --dir=../sequencer --output=../sequencer --outpkg=sequencer --inpackage --structname=EthermanMock --filename=mock_etherman.go
.PHONY: generate-mocks-sequencesender
generate-mocks-sequencesender: ## Generates mocks for sequencesender , using mockery tool
export "GOROOT=$$(go env GOROOT)" && $$(go env GOPATH)/bin/mockery --name=stateInterface --dir=../sequencesender --output=../sequencesender --outpkg=sequencesender --inpackage --structname=StateMock --filename=mock_state.go
export "GOROOT=$$(go env GOROOT)" && $$(go env GOPATH)/bin/mockery --name=etherman --dir=../sequencesender --output=../sequencesender --outpkg=sequencesender --inpackage --structname=EthermanMock --filename=mock_etherman.go
export "GOROOT=$$(go env GOROOT)" && $$(go env GOPATH)/bin/mockery --name=ethTxManager --dir=../sequencesender --output=../sequencesender --outpkg=sequencesender --inpackage --structname=EthTxManagerMock --filename=mock_ethtxmanager.go
SYNC_L1_PARALLEL_FOLDER="../synchronizer/l1_parallel_sync"
SYNC_L1_PARALLEL_MOCKS_FOLDER="../synchronizer/l1_parallel_sync/mocks"
SYNC_L1_PARALLEL_PARAMS=--inpackage --outpkg=l1_parallel_sync
COMMON_MOCKERY_PARAMS=--disable-version-string --with-expecter
.PHONY: generate-mocks-synchronizer
generate-mocks-synchronizer: ## Generates mocks for synchronizer , using mockery tool
## mocks for synchronizer
#export "GOROOT=$$(go env GOROOT)" && $$(go env GOPATH)/bin/mockery --name=EthermanInterface --dir=../synchronizer --output=../synchronizer --outpkg=synchronizer --structname=ethermanMock --filename=mock_etherman.go ${COMMON_MOCKERY_PARAMS}
#export "GOROOT=$$(go env GOROOT)" && $$(go env GOPATH)/bin/mockery --name=stateInterface --dir=../synchronizer --output=../synchronizer --outpkg=synchronizer --structname=StateMock --filename=mock_state.go ${COMMON_MOCKERY_PARAMS}
#export "GOROOT=$$(go env GOROOT)" && $$(go env GOPATH)/bin/mockery --name=ethTxManager --dir=../synchronizer --output=../synchronizer --outpkg=synchronizer --structname=ethTxManagerMock --filename=mock_ethtxmanager.go ${COMMON_MOCKERY_PARAMS}
#export "GOROOT=$$(go env GOROOT)" && $$(go env GOPATH)/bin/mockery --name=poolInterface --dir=../synchronizer --output=../synchronizer --outpkg=synchronizer --structname=poolMock --filename=mock_pool.go ${COMMON_MOCKERY_PARAMS}
for i in l1RollupProducerInterface l1RollupConsumerInterface worker synchronizerProcessBlockRangeInterface workersInterface L1ParallelEthermanInterface; do \
camelcase=$$(echo $$i | sed 's/\([a-z0-9]\)\([A-Z]\)/\1_\2/g' | tr '[:upper:]' '[:lower:]') ; \
echo $$camelcase ; \
export "GOROOT=$$(go env GOROOT)" && $$(go env GOPATH)/bin/mockery --name=$$i --dir=../synchronizer/l1_parallel_sync --output=../synchronizer/l1_parallel_sync/mocks --outpkg=l1_parallel_sync --structname=$$i"Mock" --filename=mock_$$camelcase.go --inpackage ${COMMON_MOCKERY_PARAMS} ; \
done
rm -Rf ../synchronizer/l2_sync/l2_sync_etrog/mocks
export "GOROOT=$$(go env GOROOT)" && $$(go env GOPATH)/bin/mockery --all --case snake --dir ../synchronizer/l2_sync/l2_sync_etrog --output ../synchronizer/l2_sync/l2_sync_etrog/mocks --outpkg mock_l2_sync_etrog ${COMMON_MOCKERY_PARAMS}
rm -Rf ../synchronizer/l2_sync/l2_shared/mocks
export "GOROOT=$$(go env GOROOT)" && $$(go env GOPATH)/bin/mockery --all --case snake --dir ../synchronizer/l2_sync/l2_shared --output ../synchronizer/l2_sync/l2_shared/mocks --outpkg mock_l2_shared ${COMMON_MOCKERY_PARAMS}
rm -Rf ../synchronizer/common/syncinterfaces/mocks
export "GOROOT=$$(go env GOROOT)" && $$(go env GOPATH)/bin/mockery --all --case snake --dir ../synchronizer/common/syncinterfaces --output ../synchronizer/common/syncinterfaces/mocks --outpkg mock_syncinterfaces ${COMMON_MOCKERY_PARAMS}
rm -Rf ../synchronizer/actions/elderberry/mocks
export "GOROOT=$$(go env GOROOT)" && $$(go env GOPATH)/bin/mockery --all --case snake --dir ../synchronizer/actions/elderberry --output ../synchronizer/actions/elderberry/mocks --outpkg mock_elderberry ${COMMON_MOCKERY_PARAMS}
rm -Rf ../synchronizer/l1_check_block/mocks
export "GOROOT=$$(go env GOROOT)" && $$(go env GOPATH)/bin/mockery --all --case snake --dir ../synchronizer/l1_check_block --output ../synchronizer/l1_check_block/mocks --outpkg mock_l1_check_block ${COMMON_MOCKERY_PARAMS}
export "GOROOT=$$(go env GOROOT)" && $$(go env GOPATH)/bin/mockery --name=Tx --srcpkg=github.com/jackc/pgx/v4 --output=../synchronizer/mocks --structname=DbTxMock --filename=mock_dbtx.go ${COMMON_MOCKERY_PARAMS}
.PHONY: generate-mocks-etherman
generate-mocks-etherman: ## Generates mocks for etherman , using mockery tool
## mocks for etherman
export "GOROOT=$$(go env GOROOT)" && $$(go env GOPATH)/bin/mockery --name=GasPricer --srcpkg=github.com/ethereum/go-ethereum --output=../etherman --outpkg=etherman --structname=etherscanMock --filename=mock_etherscan.go
export "GOROOT=$$(go env GOROOT)" && $$(go env GOPATH)/bin/mockery --name=GasPricer --srcpkg=github.com/ethereum/go-ethereum --output=../etherman --outpkg=etherman --structname=ethGasStationMock --filename=mock_ethgasstation.go
export "GOROOT=$$(go env GOROOT)" && $$(go env GOPATH)/bin/mockery --name=ethermanInterface --dir=../ethtxmanager --output=../ethtxmanager --outpkg=ethtxmanager --structname=ethermanMock --filename=mock_etherman_test.go
export "GOROOT=$$(go env GOROOT)" && $$(go env GOPATH)/bin/mockery --name=stateInterface --dir=../ethtxmanager --output=../ethtxmanager --outpkg=ethtxmanager --structname=stateMock --filename=mock_state_test.go
export "GOROOT=$$(go env GOROOT)" && $$(go env GOPATH)/bin/mockery --name=poolInterface --dir=../gasprice --output=../gasprice --outpkg=gasprice --structname=poolMock --filename=mock_pool.go
export "GOROOT=$$(go env GOROOT)" && $$(go env GOPATH)/bin/mockery --name=ethermanInterface --dir=../gasprice --output=../gasprice --outpkg=gasprice --structname=ethermanMock --filename=mock_etherman.go
.PHONY: generate-mocks-aggregator
generate-mocks-aggregator: ## Generates mocks for aggregator , using mockery tool
## mocks for the aggregator tests
export "GOROOT=$$(go env GOROOT)" && $$(go env GOPATH)/bin/mockery --name=stateInterface --dir=../aggregator --output=../aggregator/mocks --outpkg=mocks --structname=StateMock --filename=mock_state.go
export "GOROOT=$$(go env GOROOT)" && $$(go env GOPATH)/bin/mockery --name=proverInterface --dir=../aggregator --output=../aggregator/mocks --outpkg=mocks --structname=ProverMock --filename=mock_prover.go
export "GOROOT=$$(go env GOROOT)" && $$(go env GOPATH)/bin/mockery --name=etherman --dir=../aggregator --output=../aggregator/mocks --outpkg=mocks --structname=Etherman --filename=mock_etherman.go
export "GOROOT=$$(go env GOROOT)" && $$(go env GOPATH)/bin/mockery --name=ethTxManager --dir=../aggregator --output=../aggregator/mocks --outpkg=mocks --structname=EthTxManager --filename=mock_ethtxmanager.go
export "GOROOT=$$(go env GOROOT)" && $$(go env GOPATH)/bin/mockery --name=aggregatorTxProfitabilityChecker --dir=../aggregator --output=../aggregator/mocks --outpkg=mocks --structname=ProfitabilityCheckerMock --filename=mock_profitabilitychecker.go
export "GOROOT=$$(go env GOROOT)" && $$(go env GOPATH)/bin/mockery --name=Tx --srcpkg=github.com/jackc/pgx/v4 --output=../aggregator/mocks --outpkg=mocks --structname=DbTxMock --filename=mock_dbtx.go
.PHONY: generate-mocks-state
generate-mocks-state: ## Generates mocks for state , using mockery tool
## mocks for the aggregator tests
export "GOROOT=$$(go env GOROOT)" && $$(go env GOPATH)/bin/mockery --name=storage --dir=../state --output=../state/mocks --outpkg=mocks --structname=StorageMock --filename=mock_storage.go --disable-version-string --with-expecter
export "GOROOT=$$(go env GOROOT)" && $$(go env GOPATH)/bin/mockery --name=ExecutorServiceClient --dir=../state/runtime/executor/ --output=../state/mocks --outpkg=mocks --structname=ExecutorServiceClientMock --filename=mock_executor_service_client.go --disable-version-string --with-expecter
export "GOROOT=$$(go env GOROOT)" && $$(go env GOPATH)/bin/mockery --name=Tx --srcpkg=github.com/jackc/pgx/v4 --output=../state/mocks --outpkg=mocks --structname=DbTxMock --filename=mock_dbtx.go --disable-version-string --with-expecter
.PHONY: run-benchmarks
run-benchmarks: run-db ## Runs benchmars
go test -bench=. ./state/tree
.PHONY: compile-scs
compile-scs: ## Compiles smart contracts, configuration in test/contracts/index.yaml
go run ./scripts/cmd... compilesc --input ./contracts
## Help display.
## Pulls comments from beside commands and prints a nicely formatted
## display with the commands and their usage information.
.DEFAULT_GOAL := help
.PHONY: help
help: ## Prints this help
@grep -h -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) \
| sort \
| awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'