forked from erigontech/erigon
-
Notifications
You must be signed in to change notification settings - Fork 53
/
Copy pathflags.go
2413 lines (2275 loc) · 79.7 KB
/
flags.go
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
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// Copyright 2015 The go-ethereum Authors
// This file is part of go-ethereum.
//
// go-ethereum is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// go-ethereum is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with go-ethereum. If not, see <http://www.gnu.org/licenses/>.
// Package utils contains internal helper functions for go-ethereum commands.
package utils
import (
"crypto/ecdsa"
"encoding/json"
"fmt"
"math/big"
"os"
"path"
"path/filepath"
"runtime"
"strconv"
"strings"
"time"
"github.com/c2h5oh/datasize"
"github.com/ledgerwatch/log/v3"
"github.com/spf13/cobra"
"github.com/spf13/pflag"
"github.com/urfave/cli/v2"
"github.com/ledgerwatch/erigon-lib/chain/snapcfg"
libcommon "github.com/ledgerwatch/erigon-lib/common"
"github.com/ledgerwatch/erigon-lib/common/cmp"
"github.com/ledgerwatch/erigon-lib/common/datadir"
"github.com/ledgerwatch/erigon-lib/common/metrics"
libkzg "github.com/ledgerwatch/erigon-lib/crypto/kzg"
"github.com/ledgerwatch/erigon-lib/direct"
downloadercfg2 "github.com/ledgerwatch/erigon-lib/downloader/downloadercfg"
"github.com/ledgerwatch/erigon-lib/txpool/txpoolcfg"
"github.com/ledgerwatch/erigon-lib/chain/networkname"
"github.com/ledgerwatch/erigon/cl/clparams"
"github.com/ledgerwatch/erigon/cmd/downloader/downloadernat"
"github.com/ledgerwatch/erigon/cmd/utils/flags"
common2 "github.com/ledgerwatch/erigon/common"
"github.com/ledgerwatch/erigon/common/paths"
"github.com/ledgerwatch/erigon/consensus/ethash/ethashcfg"
"github.com/ledgerwatch/erigon/core"
"github.com/ledgerwatch/erigon/crypto"
"github.com/ledgerwatch/erigon/eth/ethconfig"
"github.com/ledgerwatch/erigon/eth/gasprice/gaspricecfg"
"github.com/ledgerwatch/erigon/node/nodecfg"
"github.com/ledgerwatch/erigon/p2p"
"github.com/ledgerwatch/erigon/p2p/enode"
"github.com/ledgerwatch/erigon/p2p/nat"
"github.com/ledgerwatch/erigon/p2p/netutil"
"github.com/ledgerwatch/erigon/params"
borsnaptype "github.com/ledgerwatch/erigon/polygon/bor/snaptype"
"github.com/ledgerwatch/erigon/rpc/rpccfg"
"github.com/ledgerwatch/erigon/turbo/logging"
)
// These are all the command line flags we support.
// If you add to this list, please remember to include the
// flag in the appropriate command definition.
//
// The flags are defined here so their names and help texts
// are the same for all commands.
var (
// General settings
DataDirFlag = flags.DirectoryFlag{
Name: "datadir",
Usage: "Data directory for the databases",
Value: flags.DirectoryString(paths.DefaultDataDir()),
}
AncientFlag = flags.DirectoryFlag{
Name: "datadir.ancient",
Usage: "Data directory for ancient chain segments (default = inside chaindata)",
}
MinFreeDiskSpaceFlag = flags.DirectoryFlag{
Name: "datadir.minfreedisk",
Usage: "Minimum free disk space in MB, once reached triggers auto shut down (default = --cache.gc converted to MB, 0 = disabled)",
}
NetworkIdFlag = cli.Uint64Flag{
Name: "networkid",
Usage: "Explicitly set network id (integer)(For testnets: use --chain <testnet_name> instead)",
Value: ethconfig.Defaults.NetworkID,
}
DeveloperPeriodFlag = cli.IntFlag{
Name: "dev.period",
Usage: "Block period to use in developer mode (0 = mine only if transaction pending)",
}
ChainFlag = cli.StringFlag{
Name: "chain",
Usage: "name of the network to join",
Value: networkname.MainnetChainName,
}
IdentityFlag = cli.StringFlag{
Name: "identity",
Usage: "Custom node name",
}
WhitelistFlag = cli.StringFlag{
Name: "whitelist",
Usage: "Comma separated block number-to-hash mappings to enforce (<number>=<hash>)",
}
OverridePragueFlag = flags.BigFlag{
Name: "override.prague",
Usage: "Manually specify the Prague fork time, overriding the bundled setting",
}
TrustedSetupFile = cli.StringFlag{
Name: "trusted-setup-file",
Usage: "Absolute path to trusted_setup.json file",
}
// Ethash settings
EthashCachesInMemoryFlag = cli.IntFlag{
Name: "ethash.cachesinmem",
Usage: "Number of recent ethash caches to keep in memory (16MB each)",
Value: ethconfig.Defaults.Ethash.CachesInMem,
}
EthashCachesLockMmapFlag = cli.BoolFlag{
Name: "ethash.cacheslockmmap",
Usage: "Lock memory maps of recent ethash caches",
}
EthashDatasetDirFlag = flags.DirectoryFlag{
Name: "ethash.dagdir",
Usage: "Directory to store the ethash mining DAGs",
Value: flags.DirectoryString(ethconfig.Defaults.Ethash.DatasetDir),
}
EthashDatasetsLockMmapFlag = cli.BoolFlag{
Name: "ethash.dagslockmmap",
Usage: "Lock memory maps for recent ethash mining DAGs",
}
SnapshotFlag = cli.BoolFlag{
Name: "snapshots",
Usage: `Default: use snapshots "true" for Mainnet, Goerli, Gnosis Chain and Chiado. use snapshots "false" in all other cases`,
Value: true,
}
ExternalConsensusFlag = cli.BoolFlag{
Name: "externalcl",
Usage: "enables external consensus",
}
InternalConsensusFlag = cli.BoolFlag{
Name: "internalcl",
Usage: "Enables internal consensus",
}
// Transaction pool settings
TxPoolDisableFlag = cli.BoolFlag{
Name: "txpool.disable",
Usage: "Experimental external pool and block producer, see ./cmd/txpool/readme.md for more info. Disabling internal txpool and block producer.",
Value: false,
}
TxPoolGossipDisableFlag = cli.BoolFlag{
Name: "txpool.gossip.disable",
Usage: "Disabling p2p gossip of txs. Any txs received by p2p - will be dropped. Some networks like 'Optimism execution engine'/'Optimistic Rollup' - using it to protect against MEV attacks",
Value: txpoolcfg.DefaultConfig.NoGossip,
}
TxPoolLocalsFlag = cli.StringFlag{
Name: "txpool.locals",
Usage: "Comma separated accounts to treat as locals (no flush, priority inclusion)",
}
TxPoolNoLocalsFlag = cli.BoolFlag{
Name: "txpool.nolocals",
Usage: "Disables price exemptions for locally submitted transactions",
}
TxPoolPriceLimitFlag = cli.Uint64Flag{
Name: "txpool.pricelimit",
Usage: "Minimum gas price (fee cap) limit to enforce for acceptance into the pool",
Value: ethconfig.Defaults.DeprecatedTxPool.PriceLimit,
}
TxPoolPriceBumpFlag = cli.Uint64Flag{
Name: "txpool.pricebump",
Usage: "Price bump percentage to replace an already existing transaction",
Value: txpoolcfg.DefaultConfig.PriceBump,
}
TxPoolBlobPriceBumpFlag = cli.Uint64Flag{
Name: "txpool.blobpricebump",
Usage: "Price bump percentage to replace existing (type-3) blob transaction",
Value: txpoolcfg.DefaultConfig.BlobPriceBump,
}
TxPoolAccountSlotsFlag = cli.Uint64Flag{
Name: "txpool.accountslots",
Usage: "Minimum number of executable transaction slots guaranteed per account",
Value: ethconfig.Defaults.DeprecatedTxPool.AccountSlots,
}
TxPoolBlobSlotsFlag = cli.Uint64Flag{
Name: "txpool.blobslots",
Usage: "Max allowed total number of blobs (within type-3 txs) per account",
Value: txpoolcfg.DefaultConfig.BlobSlots,
}
TxPoolTotalBlobPoolLimit = cli.Uint64Flag{
Name: "txpool.totalblobpoollimit",
Usage: "Total limit of number of all blobs in txs within the txpool",
Value: txpoolcfg.DefaultConfig.TotalBlobPoolLimit,
}
TxPoolGlobalSlotsFlag = cli.Uint64Flag{
Name: "txpool.globalslots",
Usage: "Maximum number of executable transaction slots for all accounts",
Value: ethconfig.Defaults.DeprecatedTxPool.GlobalSlots,
}
TxPoolGlobalBaseFeeSlotsFlag = cli.Uint64Flag{
Name: "txpool.globalbasefeeslots",
Usage: "Maximum number of non-executable transactions where only not enough baseFee",
Value: ethconfig.Defaults.DeprecatedTxPool.GlobalQueue,
}
TxPoolAccountQueueFlag = cli.Uint64Flag{
Name: "txpool.accountqueue",
Usage: "Maximum number of non-executable transaction slots permitted per account",
Value: ethconfig.Defaults.DeprecatedTxPool.AccountQueue,
}
TxPoolGlobalQueueFlag = cli.Uint64Flag{
Name: "txpool.globalqueue",
Usage: "Maximum number of non-executable transaction slots for all accounts",
Value: ethconfig.Defaults.DeprecatedTxPool.GlobalQueue,
}
TxPoolLifetimeFlag = cli.DurationFlag{
Name: "txpool.lifetime",
Usage: "Maximum amount of time non-executable transaction are queued",
Value: ethconfig.Defaults.DeprecatedTxPool.Lifetime,
}
TxPoolTraceSendersFlag = cli.StringFlag{
Name: "txpool.trace.senders",
Usage: "Comma separated list of addresses, whose transactions will traced in transaction pool with debug printing",
Value: "",
}
TxPoolCommitEveryFlag = cli.DurationFlag{
Name: "txpool.commit.every",
Usage: "How often transactions should be committed to the storage",
Value: txpoolcfg.DefaultConfig.CommitEvery,
}
// Miner settings
MiningEnabledFlag = cli.BoolFlag{
Name: "mine",
Usage: "Enable mining",
}
ProposingDisableFlag = cli.BoolFlag{
Name: "proposer.disable",
Usage: "Disables PoS proposer",
}
MinerNotifyFlag = cli.StringFlag{
Name: "miner.notify",
Usage: "Comma separated HTTP URL list to notify of new work packages",
}
MinerGasLimitFlag = cli.Uint64Flag{
Name: "miner.gaslimit",
Usage: "Target gas limit for mined blocks",
Value: ethconfig.Defaults.Miner.GasLimit,
}
MinerGasPriceFlag = flags.BigFlag{
Name: "miner.gasprice",
Usage: "Minimum gas price for mining a transaction",
Value: ethconfig.Defaults.Miner.GasPrice,
}
MinerEtherbaseFlag = cli.StringFlag{
Name: "miner.etherbase",
Usage: "Public address for block mining rewards",
Value: "0",
}
MinerSigningKeyFileFlag = cli.StringFlag{
Name: "miner.sigfile",
Usage: "Private key to sign blocks with",
Value: "",
}
MinerExtraDataFlag = cli.StringFlag{
Name: "miner.extradata",
Usage: "Block extra data set by the miner (default = client version)",
}
MinerRecommitIntervalFlag = cli.DurationFlag{
Name: "miner.recommit",
Usage: "Time interval to recreate the block being mined",
Value: ethconfig.Defaults.Miner.Recommit,
}
MinerNoVerfiyFlag = cli.BoolFlag{
Name: "miner.noverify",
Usage: "Disable remote sealing verification",
}
VMEnableDebugFlag = cli.BoolFlag{
Name: "vmdebug",
Usage: "Record information useful for VM and contract debugging",
}
InsecureUnlockAllowedFlag = cli.BoolFlag{
Name: "allow-insecure-unlock",
Usage: "Allow insecure account unlocking when account-related RPCs are exposed by http",
}
RPCGlobalGasCapFlag = cli.Uint64Flag{
Name: "rpc.gascap",
Usage: "Sets a cap on gas that can be used in eth_call/estimateGas (0=infinite)",
Value: ethconfig.Defaults.RPCGasCap,
}
RPCGlobalTxFeeCapFlag = cli.Float64Flag{
Name: "rpc.txfeecap",
Usage: "Sets a cap on transaction fee (in ether) that can be sent via the RPC APIs (0 = no cap)",
Value: ethconfig.Defaults.RPCTxFeeCap,
}
// Logging and debug settings
EthStatsURLFlag = cli.StringFlag{
Name: "ethstats",
Usage: "Reporting URL of a ethstats service (nodename:secret@host:port)",
Value: "",
}
FakePoWFlag = cli.BoolFlag{
Name: "fakepow",
Usage: "Disables proof-of-work verification",
}
// RPC settings
IPCDisabledFlag = cli.BoolFlag{
Name: "ipcdisable",
Usage: "Disable the IPC-RPC server",
}
IPCPathFlag = flags.DirectoryFlag{
Name: "ipcpath",
Usage: "Filename for IPC socket/pipe within the datadir (explicit paths escape it)",
}
GraphQLEnabledFlag = cli.BoolFlag{
Name: "graphql",
Usage: "Enable the graphql endpoint",
Value: nodecfg.DefaultConfig.GraphQLEnabled,
}
HTTPEnabledFlag = cli.BoolFlag{
Name: "http",
Usage: "JSON-RPC server (enabled by default). Use --http=false to disable it",
Value: true,
}
HTTPServerEnabledFlag = cli.BoolFlag{
Name: "http.enabled",
Usage: "JSON-RPC HTTP server (enabled by default). Use --http.enabled=false to disable it",
Value: true,
}
HTTPListenAddrFlag = cli.StringFlag{
Name: "http.addr",
Usage: "HTTP-RPC server listening interface",
Value: nodecfg.DefaultHTTPHost,
}
HTTPPortFlag = cli.IntFlag{
Name: "http.port",
Usage: "HTTP-RPC server listening port",
Value: nodecfg.DefaultHTTPPort,
}
AuthRpcAddr = cli.StringFlag{
Name: "authrpc.addr",
Usage: "HTTP-RPC server listening interface for the Engine API",
Value: nodecfg.DefaultHTTPHost,
}
AuthRpcPort = cli.UintFlag{
Name: "authrpc.port",
Usage: "HTTP-RPC server listening port for the Engine API",
Value: nodecfg.DefaultAuthRpcPort,
}
JWTSecretPath = cli.StringFlag{
Name: "authrpc.jwtsecret",
Usage: "Path to the token that ensures safe connection between CL and EL",
Value: "",
}
HttpCompressionFlag = cli.BoolFlag{
Name: "http.compression",
Usage: "Enable compression over HTTP-RPC",
}
WsCompressionFlag = cli.BoolFlag{
Name: "ws.compression",
Usage: "Enable compression over WebSocket",
}
HTTPCORSDomainFlag = cli.StringFlag{
Name: "http.corsdomain",
Usage: "Comma separated list of domains from which to accept cross origin requests (browser enforced)",
Value: "*",
}
HTTPVirtualHostsFlag = cli.StringFlag{
Name: "http.vhosts",
Usage: "Comma separated list of virtual hostnames from which to accept requests (server enforced). Accepts 'any' or '*' as wildcard.",
Value: strings.Join(nodecfg.DefaultConfig.HTTPVirtualHosts, ","),
}
AuthRpcVirtualHostsFlag = cli.StringFlag{
Name: "authrpc.vhosts",
Usage: "Comma separated list of virtual hostnames from which to accept Engine API requests (server enforced). Accepts 'any' or '*' as wildcard.",
Value: strings.Join(nodecfg.DefaultConfig.HTTPVirtualHosts, ","),
}
HTTPApiFlag = cli.StringFlag{
Name: "http.api",
Usage: "API's offered over the HTTP-RPC interface",
Value: "eth,erigon,engine",
}
L2ChainIdFlag = cli.Uint64Flag{
Name: "zkevm.l2-chain-id",
Usage: "L2 chain ID",
Value: 0,
}
L2RpcUrlFlag = cli.StringFlag{
Name: "zkevm.l2-sequencer-rpc-url",
Usage: "Upstream L2 node RPC endpoint",
Value: "",
}
L2DataStreamerUrlFlag = cli.StringFlag{
Name: "zkevm.l2-datastreamer-url",
Usage: "L2 datastreamer endpoint",
Value: "",
}
L2DataStreamerUseTLSFlag = cli.BoolFlag{
Name: "zkevm.l2-datastreamer-use-tls",
Usage: "Use TLS connection to L2 datastreamer endpoint",
Value: false,
}
L2DataStreamerTimeout = cli.StringFlag{
Name: "zkevm.l2-datastreamer-timeout",
Usage: "The time to wait for data to arrive from the stream before reporting an error (0s doesn't check)",
Value: "3s",
}
L2ShortCircuitToVerifiedBatchFlag = cli.BoolFlag{
Name: "zkevm.l2-short-circuit-to-verified-batch",
Usage: "Short circuit block execution up to the batch after the latest verified batch (default: true). When disabled, the sequencer will execute all downloaded batches",
Value: true,
}
L1SyncStartBlock = cli.Uint64Flag{
Name: "zkevm.l1-sync-start-block",
Usage: "Designed for recovery of the network from the L1 batch data, slower mode of operation than the datastream. If set the datastream will not be used",
Value: 0,
}
L1SyncStopBatch = cli.Uint64Flag{
Name: "zkevm.l1-sync-stop-batch",
Usage: "Designed mainly for debugging, this will stop the L1 sync going on for too long when you only want to pull a handful of batches from the L1 during recovery",
Value: 0,
}
L1ChainIdFlag = cli.Uint64Flag{
Name: "zkevm.l1-chain-id",
Usage: "Ethereum L1 chain ID",
Value: 0,
}
L1RpcUrlFlag = cli.StringFlag{
Name: "zkevm.l1-rpc-url",
Usage: "Ethereum L1 RPC endpoint",
Value: "",
}
L1CacheEnabledFlag = cli.BoolFlag{
Name: "zkevm.l1-cache-enabled",
Usage: "Enable the L1 cache",
Value: false,
}
L1CachePortFlag = cli.UintFlag{
Name: "zkevm.l1-cache-port",
Usage: "The port used for the L1 cache",
Value: 6969,
}
AddressSequencerFlag = cli.StringFlag{
Name: "zkevm.address-sequencer",
Usage: "Sequencer address",
Value: "",
}
AddressAdminFlag = cli.StringFlag{
Name: "zkevm.address-admin",
Usage: "Admin address (Deprecated)",
Value: "",
}
AddressRollupFlag = cli.StringFlag{
Name: "zkevm.address-rollup",
Usage: "Rollup address",
Value: "",
}
AddressZkevmFlag = cli.StringFlag{
Name: "zkevm.address-zkevm",
Usage: "Zkevm address",
Value: "",
}
AddressGerManagerFlag = cli.StringFlag{
Name: "zkevm.address-ger-manager",
Usage: "Ger Manager address",
Value: "",
}
L1RollupIdFlag = cli.Uint64Flag{
Name: "zkevm.l1-rollup-id",
Usage: "Ethereum L1 Rollup ID",
Value: 1,
}
L1BlockRangeFlag = cli.Uint64Flag{
Name: "zkevm.l1-block-range",
Usage: "Ethereum L1 block range used to filter verifications and sequences",
Value: 20000,
}
L1QueryDelayFlag = cli.Uint64Flag{
Name: "zkevm.l1-query-delay",
Required: false,
Usage: "Ethereum L1 delay between queries for verifications and sequences - in milliseconds",
Value: 6000,
}
L1HighestBlockTypeFlag = cli.StringFlag{
Name: "zkevm.l1-highest-block-type",
Usage: "The type of the highest block in the L1 chain. latest, safe, or finalized",
Value: "finalized",
}
L1MaticContractAddressFlag = cli.StringFlag{
Name: "zkevm.l1-matic-contract-address",
Usage: "Ethereum L1 Matic contract address",
Value: "0x0",
}
L1FirstBlockFlag = cli.Uint64Flag{
Name: "zkevm.l1-first-block",
Usage: "First block to start syncing from on the L1",
Value: 0,
}
L1FinalizedBlockRequirementFlag = cli.Uint64Flag{
Name: "zkevm.l1-finalized-block-requirement",
Usage: "The given block must be finalized before sequencer L1 sync continues",
Value: 0,
}
L1ContractAddressCheckFlag = cli.BoolFlag{
Name: "zkevm.l1-contract-address-check",
Usage: "Check the contract address on the L1",
Value: true,
}
L1ContractAddressRetrieveFlag = cli.BoolFlag{
Name: "zkevm.l1-contract-address-retrieve",
Usage: "Retrieve the contracts addresses from the L1",
Value: true,
}
RebuildTreeAfterFlag = cli.Uint64Flag{
Name: "zkevm.rebuild-tree-after",
Usage: "Rebuild the state tree after this many blocks behind",
Value: 10000,
}
IncrementTreeAlways = cli.BoolFlag{
Name: "zkevm.increment-tree-always",
Usage: "Increment the state tree, never rebuild",
Value: false,
}
SmtRegenerateInMemory = cli.BoolFlag{
Name: "zkevm.smt-regenerate-in-memory",
Usage: "Regenerate the SMT in memory (requires a lot of RAM for most chains)",
Value: false,
}
SequencerBlockSealTime = cli.StringFlag{
Name: "zkevm.sequencer-block-seal-time",
Usage: "Block seal time. Defaults to 6s",
Value: "6s",
}
SequencerBatchSealTime = cli.StringFlag{
Name: "zkevm.sequencer-batch-seal-time",
Usage: "Batch seal time. Defaults to 12s",
Value: "12s",
}
SequencerBatchVerificationTimeout = cli.StringFlag{
Name: "zkevm.sequencer-batch-verification-timeout",
Usage: "This is a maximum time that a batch verification could take in terms of executors' errors. Including retries. This could be interpreted as `maximum that that the sequencer can run without executor`. Setting it to 0s will mean infinite timeout. Defaults to 30min",
Value: "30m",
}
SequencerBatchVerificationRetries = cli.StringFlag{
Name: "zkevm.sequencer-batch-verification-retries",
Usage: "Number of attempts that a batch will re-run in case of an internal (not executors') error. This could be interpreted as `maximum attempts to send a batch for verification`. Setting it to -1 will mean unlimited attempts. Defaults to 3",
Value: "3",
}
SequencerTimeoutOnEmptyTxPool = cli.StringFlag{
Name: "zkevm.sequencer-timeout-on-empty-tx-pool",
Usage: "Timeout before requesting txs from the txpool if none were found before. Defaults to 250ms",
Value: "250ms",
}
SequencerHaltOnBatchNumber = cli.Uint64Flag{
Name: "zkevm.sequencer-halt-on-batch-number",
Usage: "Halt the sequencer on this batch number",
Value: 0,
}
SequencerResequence = cli.BoolFlag{
Name: "zkevm.sequencer-resequence",
Usage: "When enabled, the sequencer will automatically resequence unseen batches stored in data stream",
Value: false,
}
SequencerResequenceStrict = cli.BoolFlag{
Name: "zkevm.sequencer-resequence-strict",
Usage: "Strictly resequence the rolledback batches",
Value: true,
}
SequencerResequenceReuseL1InfoIndex = cli.BoolFlag{
Name: "zkevm.sequencer-resequence-reuse-l1-info-index",
Usage: "Reuse the L1 info index for resequencing",
Value: true,
}
ExecutorUrls = cli.StringFlag{
Name: "zkevm.executor-urls",
Usage: "A comma separated list of grpc addresses that host executors",
Value: "",
}
ExecutorStrictMode = cli.BoolFlag{
Name: "zkevm.executor-strict",
Usage: "Defaulted to true to ensure you must set some executor URLs, bypass this restriction by setting to false",
Value: true,
}
ExecutorRequestTimeout = cli.DurationFlag{
Name: "zkevm.executor-request-timeout",
Usage: "The timeout for the executor request",
Value: 60 * time.Second,
}
DatastreamNewBlockTimeout = cli.DurationFlag{
Name: "zkevm.datastream-new-block-timeout",
Usage: "The timeout for the executor request",
Value: 500 * time.Millisecond,
}
WitnessMemdbSize = DatasizeFlag{
Name: "zkevm.witness-memdb-size",
Usage: "A size of the memdb used on witness generation in format \"2GB\". Might fail generation for older batches if not enough for the unwind.",
Value: datasizeFlagValue(2 * datasize.GB),
}
WitnessUnwindLimit = cli.Uint64Flag{
Name: "zkevm.witness-unwind-limit",
Usage: "The maximum number of blocks the witness generation can unwind",
Value: 500_000,
}
ExecutorMaxConcurrentRequests = cli.IntFlag{
Name: "zkevm.executor-max-concurrent-requests",
Usage: "The maximum number of concurrent requests to the executor",
Value: 1,
}
RpcRateLimitsFlag = cli.IntFlag{
Name: "zkevm.rpc-ratelimit",
Usage: "RPC rate limit in requests per second.",
Value: 0,
}
RpcGetBatchWitnessConcurrencyLimitFlag = cli.IntFlag{
Name: "zkevm.rpc-get-batch-witness-concurrency-limit",
Usage: "The maximum number of concurrent requests to the executor for getBatchWitness.",
Value: 1,
}
DatastreamVersionFlag = cli.IntFlag{
Name: "zkevm.datastream-version",
Usage: "Stream version indicator 1: PreBigEndian, 2: BigEndian.",
Value: 2,
}
DataStreamPort = cli.UintFlag{
Name: "zkevm.data-stream-port",
Usage: "Define the port used for the zkevm data stream",
Value: 0,
}
DataStreamHost = cli.StringFlag{
Name: "zkevm.data-stream-host",
Usage: "Define the host used for the zkevm data stream",
Value: "",
}
DataStreamWriteTimeout = cli.DurationFlag{
Name: "zkevm.data-stream-writeTimeout",
Usage: "Define the TCP write timeout when sending data to a datastream client",
Value: 20 * time.Second,
}
DataStreamInactivityTimeout = cli.DurationFlag{
Name: "zkevm.data-stream-inactivity-timeout",
Usage: "Define the inactivity timeout when interacting with a data stream server",
Value: 10 * time.Minute,
}
DataStreamInactivityCheckInterval = cli.DurationFlag{
Name: "zkevm.data-stream-inactivity-check-interval",
Usage: "Define the inactivity check interval timeout when interacting with a data stream server",
Value: 5 * time.Minute,
}
Limbo = cli.BoolFlag{
Name: "zkevm.limbo",
Usage: "Enable limbo processing on batches that failed verification",
Value: false,
}
AllowFreeTransactions = cli.BoolFlag{
Name: "zkevm.allow-free-transactions",
Usage: "Allow the sequencer to proceed transactions with 0 gas price",
Value: false,
}
RejectLowGasPriceTransactions = cli.BoolFlag{
Name: "zkevm.reject-low-gas-price-transactions",
Usage: "Reject the sequencer to proceed transactions with low gas price",
Value: false,
}
AllowPreEIP155Transactions = cli.BoolFlag{
Name: "zkevm.allow-pre-eip155-transactions",
Usage: "Allow the sequencer to proceed pre-EIP155 transactions",
Value: false,
}
EffectiveGasPriceForEthTransfer = cli.Float64Flag{
Name: "zkevm.effective-gas-price-eth-transfer",
Usage: "Set the effective gas price in percentage for transfers",
Value: 1,
}
EffectiveGasPriceForErc20Transfer = cli.Float64Flag{
Name: "zkevm.effective-gas-price-erc20-transfer",
Usage: "Set the effective gas price in percentage for transfers",
Value: 1,
}
EffectiveGasPriceForContractInvocation = cli.Float64Flag{
Name: "zkevm.effective-gas-price-contract-invocation",
Usage: "Set the effective gas price in percentage for contract invocation",
Value: 1,
}
EffectiveGasPriceForContractDeployment = cli.Float64Flag{
Name: "zkevm.effective-gas-price-contract-deployment",
Usage: "Set the effective gas price in percentage for contract deployment",
Value: 1,
}
DefaultGasPrice = cli.Uint64Flag{
Name: "zkevm.default-gas-price",
Usage: "Set the default/min gas price",
// 0.01 gwei
Value: 10000000,
}
MaxGasPrice = cli.Uint64Flag{
Name: "zkevm.max-gas-price",
Usage: "Set the max gas price",
Value: 0,
}
GasPriceFactor = cli.Float64Flag{
Name: "zkevm.gas-price-factor",
Usage: "Apply factor to L1 gas price to calculate l2 gasPrice",
Value: 1,
}
WitnessFullFlag = cli.BoolFlag{
Name: "zkevm.witness-full",
Usage: "Enable/Diable witness full",
Value: false,
}
SyncLimit = cli.UintFlag{
Name: "zkevm.sync-limit",
Usage: "Limit the number of blocks to sync, this will halt batches and execution to this number but keep the node active",
Value: 0,
}
PoolManagerUrl = cli.StringFlag{
Name: "zkevm.pool-manager-url",
Usage: "The URL of the pool manager. If set, eth_sendRawTransaction will be redirected there.",
Value: "",
}
TxPoolRejectSmartContractDeployments = cli.BoolFlag{
Name: "zkevm.reject-smart-contract-deployments",
Usage: "Reject smart contract deployments",
Value: false,
}
DisableVirtualCounters = cli.BoolFlag{
Name: "zkevm.disable-virtual-counters",
Usage: "Disable the virtual counters. This has an effect on on sequencer node and when external executor is not enabled.",
Value: false,
}
ExecutorPayloadOutput = cli.StringFlag{
Name: "zkevm.executor-payload-output",
Usage: "Output the payload of the executor, serialised requests stored to disk by batch number",
Value: "",
}
DAUrl = cli.StringFlag{
Name: "zkevm.da-url",
Usage: "The URL of the data availability service",
Value: "",
}
VirtualCountersSmtReduction = cli.Float64Flag{
Name: "zkevm.virtual-counters-smt-reduction",
Usage: "The multiplier to reduce the SMT depth by when calculating virtual counters",
Value: 0.6,
}
BadBatches = cli.StringFlag{
Name: "zkevm.bad-batches",
Usage: "A comma separated list of batch numbers that are known bad on the L1. These will automatically be marked as bad during L1 recovery",
Value: "",
}
InitialBatchCfgFile = cli.StringFlag{
Name: "zkevm.initial-batch.config",
Usage: "The file that contains the initial (injected) batch data.",
Value: "",
}
InfoTreeUpdateInterval = cli.DurationFlag{
Name: "zkevm.info-tree-update-interval",
Usage: "The interval at which the sequencer checks the L1 for new GER information",
Value: 1 * time.Minute,
}
SealBatchImmediatelyOnOverflow = cli.BoolFlag{
Name: "zkevm.seal-batch-immediately-on-overflow",
Usage: "Seal the batch immediately when detecting a counter overflow",
Value: false,
}
MockWitnessGeneration = cli.BoolFlag{
Name: "zkevm.mock-witness-generation",
Usage: "Mock the witness generation",
Value: false,
}
WitnessContractInclusion = cli.StringFlag{
Name: "zkevm.witness-contract-inclusion",
Usage: "Contracts that will have all of their storage added to the witness every time",
Value: "",
}
ACLPrintHistory = cli.IntFlag{
Name: "acl.print-history",
Usage: "Number of entries to print from the ACL history on node start up",
Value: 10,
}
DebugTimers = cli.BoolFlag{
Name: "debug.timers",
Usage: "Enable debug timers",
Value: false,
}
DebugNoSync = cli.BoolFlag{
Name: "debug.no-sync",
Usage: "Disable syncing",
Value: false,
}
DebugLimit = cli.UintFlag{
Name: "debug.limit",
Usage: "Limit the number of blocks to sync",
Value: 0,
}
DebugStep = cli.UintFlag{
Name: "debug.step",
Usage: "Number of blocks to process each run of the stage loop",
}
DebugStepAfter = cli.UintFlag{
Name: "debug.step-after",
Usage: "Start incrementing by debug.step after this block",
}
RpcBatchConcurrencyFlag = cli.UintFlag{
Name: "rpc.batch.concurrency",
Usage: "Does limit amount of goroutines to process 1 batch request. Means 1 bach request can't overload server. 1 batch still can have unlimited amount of request",
Value: 2,
}
RpcStreamingDisableFlag = cli.BoolFlag{
Name: "rpc.streaming.disable",
Usage: "Erigon has enabled json streaming for some heavy endpoints (like trace_*). It's a trade-off: greatly reduce amount of RAM (in some cases from 30GB to 30mb), but it produce invalid json format if error happened in the middle of streaming (because json is not streaming-friendly format)",
}
RpcBatchLimit = cli.IntFlag{
Name: "rpc.batch.limit",
Usage: "Maximum number of requests in a batch",
Value: 100,
}
RpcReturnDataLimit = cli.IntFlag{
Name: "rpc.returndata.limit",
Usage: "Maximum number of bytes returned from eth_call or similar invocations",
Value: 100_000,
}
HTTPTraceFlag = cli.BoolFlag{
Name: "http.trace",
Usage: "Print all HTTP requests to logs with INFO level",
}
HTTPDebugSingleFlag = cli.BoolFlag{
Name: "http.dbg.single",
Usage: "Allow pass HTTP header 'dbg: true' to printt more detailed logs - how this request was executed",
}
DBReadConcurrencyFlag = cli.IntFlag{
Name: "db.read.concurrency",
Usage: "Does limit amount of parallel db reads. Default: equal to GOMAXPROCS (or number of CPU)",
Value: cmp.Min(cmp.Max(10, runtime.GOMAXPROCS(-1)*64), 9_000),
}
RpcAccessListFlag = cli.StringFlag{
Name: "rpc.accessList",
Usage: "Specify granular (method-by-method) API allowlist",
}
RpcGasCapFlag = cli.UintFlag{
Name: "rpc.gascap",
Usage: "Sets a cap on gas that can be used in eth_call/estimateGas",
Value: 50000000,
}
RpcTraceCompatFlag = cli.BoolFlag{
Name: "trace.compat",
Usage: "Bug for bug compatibility with OE for trace_ routines",
}
TxpoolApiAddrFlag = cli.StringFlag{
Name: "txpool.api.addr",
Usage: "TxPool api network address, for example: 127.0.0.1:9090 (default: use value of --private.api.addr)",
}
TraceMaxtracesFlag = cli.UintFlag{
Name: "trace.maxtraces",
Usage: "Sets a limit on traces that can be returned in trace_filter",
Value: 200,
}
HTTPPathPrefixFlag = cli.StringFlag{
Name: "http.rpcprefix",
Usage: "HTTP path prefix on which JSON-RPC is served. Use '/' to serve on all paths.",
Value: "",
}
TLSFlag = cli.BoolFlag{
Name: "tls",
Usage: "Enable TLS handshake",
}
TLSCertFlag = cli.StringFlag{
Name: "tls.cert",
Usage: "Specify certificate",
Value: "",
}
TLSKeyFlag = cli.StringFlag{
Name: "tls.key",
Usage: "Specify key file",
Value: "",
}
TLSCACertFlag = cli.StringFlag{
Name: "tls.cacert",
Usage: "Specify certificate authority",
Value: "",
}
WSEnabledFlag = cli.BoolFlag{
Name: "ws",
Usage: "Enable the WS-RPC server",
}
WSListenAddrFlag = cli.StringFlag{
Name: "ws.addr",
Usage: "WS-RPC server listening interface",
Value: nodecfg.DefaultWSHost,
}
WSPortFlag = cli.IntFlag{
Name: "ws.port",
Usage: "WS-RPC server listening port",
Value: nodecfg.DefaultWSPort,
}
WSApiFlag = cli.StringFlag{
Name: "ws.api",
Usage: "API's offered over the WS-RPC interface",
Value: "",
}
WSAllowedOriginsFlag = cli.StringFlag{
Name: "ws.origins",
Usage: "Origins from which to accept websockets requests",
Value: "",
}
WSPathPrefixFlag = cli.StringFlag{
Name: "ws.rpcprefix",
Usage: "HTTP path prefix on which JSON-RPC is served. Use '/' to serve on all paths.",
Value: "",
}
WSSubscribeLogsChannelSize = cli.IntFlag{
Name: "ws.api.subscribelogs.channelsize",
Usage: "Size of the channel used for websocket logs subscriptions",
Value: 8192,
}
ExecFlag = cli.StringFlag{
Name: "exec",
Usage: "Execute JavaScript statement",
}
PreloadJSFlag = cli.StringFlag{
Name: "preload",
Usage: "Comma separated list of JavaScript files to preload into the console",
}
AllowUnprotectedTxs = cli.BoolFlag{
Name: "rpc.allow-unprotected-txs",
Usage: "Allow for unprotected (non-EIP155 signed) transactions to be submitted via RPC",
}
// Careful! Because we must rewind the hash state
// and re-compute the state trie, the further back in time the request, the more
// computationally intensive the operation becomes.
// The current default has been chosen arbitrarily as 'useful' without likely being overly computationally intense.
RpcMaxGetProofRewindBlockCount = cli.IntFlag{
Name: "rpc.maxgetproofrewindblockcount.limit",
Usage: "Max GetProof rewind block count",
Value: 100_000,
}
StateCacheFlag = cli.StringFlag{
Name: "state.cache",
Value: "0MB",
Usage: "Amount of data to store in StateCache (enabled if no --datadir set). Set 0 to disable StateCache. Defaults to 0MB",
}
// Network Settings
MaxPeersFlag = cli.IntFlag{
Name: "maxpeers",
Usage: "Maximum number of network peers (network disabled if set to 0)",
Value: nodecfg.DefaultConfig.P2P.MaxPeers,
}
MaxPendingPeersFlag = cli.IntFlag{
Name: "maxpendpeers",
Usage: "Maximum number of TCP connections pending to become connected peers",
Value: nodecfg.DefaultConfig.P2P.MaxPendingPeers,
}
ListenPortFlag = cli.IntFlag{
Name: "port",
Usage: "Network listening port",
Value: 30303,
}
P2pProtocolVersionFlag = cli.UintSliceFlag{
Name: "p2p.protocol",
Usage: "Version of eth p2p protocol",
Value: cli.NewUintSlice(nodecfg.DefaultConfig.P2P.ProtocolVersion...),
}
P2pProtocolAllowedPorts = cli.UintSliceFlag{
Name: "p2p.allowed-ports",
Usage: "Allowed ports to pick for different eth p2p protocol versions as follows <porta>,<portb>,..,<porti>",
Value: cli.NewUintSlice(uint(ListenPortFlag.Value), 30304, 30305, 30306, 30307),
}
SentryAddrFlag = cli.StringFlag{
Name: "sentry.api.addr",
Usage: "Comma separated sentry addresses '<host>:<port>,<host>:<port>'",
}
SentryLogPeerInfoFlag = cli.BoolFlag{
Name: "sentry.log-peer-info",
Usage: "Log detailed peer info when a peer connects or disconnects. Enable to integrate with observer.",
}
DownloaderAddrFlag = cli.StringFlag{
Name: "downloader.api.addr",
Usage: "downloader address '<host>:<port>'",
}
BootnodesFlag = cli.StringFlag{
Name: "bootnodes",
Usage: "Comma separated enode URLs for P2P discovery bootstrap",
Value: "",
}