// Copyright 2024 The Erigon Authors
// This file is part of Erigon.
//
// Erigon is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Erigon 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 Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with Erigon. If not, see <http://www.gnu.org/licenses/>.

package cli

import (
	"github.com/urfave/cli/v2"

	"github.com/erigontech/erigon/cmd/utils"
)

// DefaultFlags contains all flags that are used and supported by Erigon binary.
var DefaultFlags = []cli.Flag{
	&utils.DataDirFlag,
	&utils.EthashDatasetDirFlag,
	&utils.ExternalConsensusFlag,
	&utils.TxPoolDisableFlag,
	&utils.TxPoolPriceLimitFlag,
	&utils.TxPoolPriceBumpFlag,
	&utils.TxPoolBlobPriceBumpFlag,
	&utils.TxPoolAccountSlotsFlag,
	&utils.TxPoolBlobSlotsFlag,
	&utils.TxPoolTotalBlobPoolLimit,
	&utils.TxPoolGlobalSlotsFlag,
	&utils.TxPoolGlobalBaseFeeSlotsFlag,
	&utils.TxPoolGlobalQueueFlag,
	&utils.TxPoolTraceSendersFlag,
	&utils.TxPoolCommitEveryFlag,
	&PruneDistanceFlag,
	&PruneBlocksDistanceFlag,
	&PruneModeFlag,
	&utils.KeepExecutionProofsFlag,
	&utils.FcuTimeoutFlag,
	&utils.FcuBackgroundPruneFlag,
	&utils.FcuBackgroundCommitFlag,
	&BatchSizeFlag,
	&BodyCacheLimitFlag,
	&DatabaseVerbosityFlag,
	&PrivateApiAddr,
	&PrivateApiRateLimit,
	&EtlBufferSizeFlag,
	&TLSFlag,
	&TLSCertFlag,
	&TLSKeyFlag,
	&TLSCACertFlag,
	&StateStreamDisableFlag,
	&ExperimentalBALFlag,
	&SyncLoopThrottleFlag,
	&BadBlockFlag,

	&utils.HTTPEnabledFlag,
	&utils.HTTPServerEnabledFlag,
	&utils.GraphQLEnabledFlag,
	&utils.HTTPListenAddrFlag,
	&utils.HTTPPortFlag,
	&utils.AuthRpcAddr,
	&utils.AuthRpcPort,
	&utils.JWTSecretPath,
	&utils.HttpCompressionFlag,
	&utils.HTTPCORSDomainFlag,
	&utils.HTTPVirtualHostsFlag,
	&utils.AuthRpcVirtualHostsFlag,
	&utils.HTTPApiFlag,
	&utils.WSPortFlag,
	&utils.WSEnabledFlag,
	&utils.WsCompressionFlag,
	&utils.HTTPTraceFlag,
	&utils.HTTPDebugSingleFlag,
	&utils.StateCacheFlag,
	&utils.RpcBatchConcurrencyFlag,
	&utils.RpcStreamingDisableFlag,
	&utils.DBReadConcurrencyFlag,
	&utils.RpcMaxConcurrentRequestsFlag,
	&utils.RpcAccessListFlag,
	&utils.RpcTraceCompatFlag,
	&utils.RpcGethCompatFlag,
	&utils.RpcGasCapFlag,
	&utils.RpcBlockRangeLimit,
	&utils.RpcBatchLimit,
	&utils.RpcReturnDataLimit,
	&utils.AllowUnprotectedTxs,
	&utils.RPCGlobalTxFeeCapFlag,
	&utils.TxpoolApiAddrFlag,
	&utils.TraceMaxtracesFlag,
	&utils.AlwaysGenerateChangesetsFlag,

	&HTTPReadTimeoutFlag,
	&HTTPWriteTimeoutFlag,
	&HTTPIdleTimeoutFlag,
	&AuthRpcReadTimeoutFlag,
	&AuthRpcWriteTimeoutFlag,
	&AuthRpcIdleTimeoutFlag,
	&EvmCallTimeoutFlag,
	&OverlayGetLogsFlag,
	&OverlayReplayBlockFlag,

	&RpcSubscriptionFiltersMaxLogsFlag,
	&RpcSubscriptionFiltersMaxHeadersFlag,
	&RpcSubscriptionFiltersMaxTxsFlag,
	&RpcSubscriptionFiltersMaxAddressesFlag,
	&RpcSubscriptionFiltersMaxTopicsFlag,

	&utils.SnapKeepBlocksFlag,
	&utils.SnapStopFlag,
	&utils.SnapStateStopFlag,
	&utils.SnapSkipStateSnapshotDownloadFlag,
	&utils.SnapDownloadToBlockFlag,
	&utils.DbPageSizeFlag,
	&utils.DbSizeLimitFlag,
	&utils.DbWriteMapFlag,
	&utils.TorrentPortFlag,
	&utils.TorrentMaxPeersFlag,
	&utils.TorrentConnsPerFileFlag,
	&utils.TorrentDownloadSlotsFlag, // Deprecated (v3.0) - kept for backward compatibility, no effect
	&utils.TorrentStaticPeersFlag,
	&utils.TorrentDisableTrackers,
	&utils.TorrentUploadRateFlag,
	&utils.TorrentDownloadRateFlag,
	&utils.TorrentWebseedDownloadRateFlag,
	&utils.TorrentVerbosityFlag,
	&utils.ListenPortFlag,
	&utils.P2pProtocolVersionFlag,
	&utils.P2pProtocolAllowedPorts,
	&utils.NATFlag,
	&utils.NoDiscoverFlag,
	&utils.DiscoveryV4Flag,
	&utils.DiscoveryV5Flag,
	&utils.NetrestrictFlag,
	&utils.NodeKeyFileFlag,
	&utils.NodeKeyHexFlag,
	&utils.DNSDiscoveryFlag,
	&utils.BootnodesFlag,
	&utils.StaticPeersFlag,
	&utils.TrustedPeersFlag,
	&utils.MaxPeersFlag,
	&utils.MaxPendingPeersFlag,
	&utils.ChainFlag,
	&utils.DeveloperPeriodFlag,
	&utils.VMEnableDebugFlag,
	&utils.NetworkIdFlag,
	&utils.PersistReceiptsV2Flag,
	&utils.FakePoWFlag,
	&utils.GpoBlocksFlag,
	&utils.GpoPercentileFlag,
	&utils.InsecureUnlockAllowedFlag,
	&utils.IdentityFlag,
	&utils.CliqueSnapshotCheckpointIntervalFlag,
	&utils.CliqueSnapshotInmemorySnapshotsFlag,
	&utils.CliqueSnapshotInmemorySignaturesFlag,
	&utils.CliqueDataDirFlag,
	&utils.ProposingDisableFlag,
	&utils.MinerGasLimitFlag,
	&utils.MinerEtherbaseFlag,
	&utils.MinerExtraDataFlag,
	&utils.BuilderMaxBlobsFlag,
	&utils.SentryAddrFlag,
	&utils.SentryLogPeerInfoFlag,
	&utils.DownloaderAddrFlag,
	&utils.DisableIPV4,
	&utils.DisableIPV6,
	&utils.NoDownloaderFlag,
	&utils.DownloaderVerifyFlag,
	&HealthCheckFlag,
	&utils.HeimdallURLFlag,
	&utils.WebSeedsFlag,
	&utils.WithoutHeimdallFlag,
	&utils.BorBlockPeriodFlag,
	&utils.BorBlockSizeFlag,
	&utils.AAFlag,
	&utils.EthStatsURLFlag,
	&utils.OverrideOsakaFlag,
	&utils.OverrideAmsterdamFlag,
	&utils.KeepStoredChainConfigFlag,

	&utils.CaplinDiscoveryAddrFlag,
	&utils.CaplinDiscoveryPortFlag,
	&utils.CaplinDiscoveryTCPPortFlag,
	&utils.CaplinCheckpointSyncUrlFlag,
	&utils.CaplinSubscribeAllTopicsFlag,
	&utils.CaplinMaxPeerCount,
	&utils.CaplinEnableUPNPlag,
	&utils.CaplinNATFlag,
	&utils.CaplinMaxInboundTrafficPerPeerFlag,
	&utils.CaplinMaxOutboundTrafficPerPeerFlag,
	&utils.CaplinAdaptableTrafficRequirementsFlag,
	&utils.SentinelAddrFlag,
	&utils.SentinelPortFlag,
	&utils.SentinelBootnodes,
	&utils.SentinelStaticPeers,

	&utils.OtsSearchMaxCapFlag,

	&utils.SilkwormExecutionFlag,
	&utils.SilkwormRpcDaemonFlag,
	&utils.SilkwormSentryFlag,
	&utils.SilkwormVerbosityFlag,
	&utils.SilkwormNumContextsFlag,
	&utils.SilkwormRpcLogEnabledFlag,
	&utils.SilkwormRpcLogMaxFileSizeFlag,
	&utils.SilkwormRpcLogMaxFilesFlag,
	&utils.SilkwormRpcLogDumpResponseFlag,
	&utils.SilkwormRpcNumWorkersFlag,
	&utils.SilkwormRpcJsonCompatibilityFlag,

	&utils.BeaconAPIFlag,
	&utils.BeaconApiAddrFlag,
	&utils.BeaconApiAllowMethodsFlag,
	&utils.BeaconApiAllowOriginsFlag,
	&utils.BeaconApiAllowCredentialsFlag,
	&utils.BeaconApiPortFlag,
	&utils.BeaconApiReadTimeoutFlag,
	&utils.BeaconApiWriteTimeoutFlag,
	&utils.BeaconApiProtocolFlag,
	&utils.BeaconApiIdleTimeoutFlag,

	&utils.CaplinArchiveBlocksFlag,
	&utils.CaplinArchiveBlobsFlag,
	&utils.CaplinArchiveStatesFlag,
	&utils.CaplinImmediateBlobBackfillFlag,

	&utils.CaplinDisableBlobPruningFlag,
	&utils.CaplinColumnKeepSlotsFlag,
	&utils.CaplinDisableCheckpointSyncFlag,
	&utils.CaplinEnableSnapshotGeneration,
	&utils.CaplinMevRelayUrl,
	&utils.CaplinValidatorMonitorFlag,
	&utils.CaplinCustomConfigFlag,
	&utils.CaplinCustomGenesisFlag,
	&utils.CaplinUseEngineApiFlag,

	&utils.TrustedSetupFile,
	&utils.RPCSlowFlag,
	&utils.RpcTxSyncDefaultTimeoutFlag,
	&utils.RpcTxSyncMaxTimeoutFlag,

	&utils.TxPoolGossipDisableFlag,
	&SyncLoopBlockLimitFlag,
	&SyncLoopBreakAfterFlag,
	&SyncParallelStateFlushing,

	&utils.ChaosMonkeyFlag,

	&utils.ShutterEnabledFlag,
	&utils.ShutterP2pBootstrapNodesFlag,
	&utils.ShutterP2pListenPortFlag,

	&utils.PolygonPosSingleSlotFinalityFlag,
	&utils.PolygonPosSingleSlotFinalityBlockAtFlag,
	&utils.PolygonPosWitProtocolFlag,

	&utils.GDBMeFlag,

	&utils.ExperimentalConcurrentCommitmentFlag,

	&utils.MCPDisableFlag,
	&utils.MCPAddrFlag,
	&utils.MCPPortFlag,
}
