"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const shardus_types_1 = require("../shardus/shardus-types");
const SERVER_CONFIG = {
    heartbeatInterval: 5,
    baseDir: '.',
    transactionExpireTime: 5,
    globalAccount: '0'.repeat(64),
    /**
     * [TODO] Introduced on 2024-04-15 and needs to be checked through out the code
     */
    nonceMode: true,
    crypto: {
        hashKey: '69fa4195670576c0160d660c3be36556ff8d504725be8a59b5a96509e0c994bc',
        keyPairConfig: {
            useKeyPairFromFile: true,
            keyPairJsonFile: 'secrets.json',
        },
    },
    p2p: {
        ipServers: [
            'https://ipapi.co/json',
            'https://ifconfig.co/json',
            'https://ipinfo.io/json',
            'api.ipify.org/?format=json',
        ],
        timeServers: ['0.pool.ntp.org', '1.pool.ntp.org', '2.pool.ntp.org', '3.pool.ntp.org'],
        existingArchivers: [
            {
                ip: '127.0.0.1',
                port: 4000,
                publicKey: '758b1c119412298802cd28dbfa394cdfeecc4074492d60844cc192d632d84de3',
            },
            {
                ip: '127.0.0.1',
                port: 4001,
                publicKey: 'e4b5e3d51e727f897786a1bb176a028ecfe1941bfa5beefd3c6209c3dbc07cf7',
            },
        ],
        syncLimit: 180,
        useNTPOffsets: true,
        useFakeTimeOffsets: true,
        cycleDuration: 30,
        maxRejoinTime: 20,
        difficulty: 2,
        dynamicBogonFiltering: true,
        forceBogonFilteringOn: true,
        rejectBogonOutboundJoin: true,
        queryDelay: 1,
        gossipRecipients: 8,
        gossipFactor: 4,
        dynamicGossipFactor: false,
        gossipStartSeed: 15,
        gossipSeedFallof: 15,
        gossipTimeout: 180,
        maxSeedNodes: 10,
        minNodesToAllowTxs: 1,
        continueOnException: false,
        minNodesPerctToAllowExitOnException: 0.66,
        baselineNodes: 15,
        minNodes: 15,
        enableMaxStandbyCount: true,
        maxStandbyCount: 30000,
        maxNodes: 30,
        seedNodeOffset: 4,
        nodeExpiryAge: 30,
        maxJoinedPerCycle: 1,
        maxSyncingPerCycle: 5,
        syncBoostEnabled: true,
        maxSyncTimeFloor: 1200,
        maxNodeForSyncTime: 9,
        maxRotatedPerCycle: 1,
        flexibleRotationDelta: 1,
        flexibleRotationEnabled: false,
        enableDangerousProblematicNodeRemoval: false,
        enableProblematicNodeRemoval: false,
        enableProblematicNodeRemovalOnCycle: 20000,
        maxProblematicNodeRemovalsPerCycle: 1,
        problematicNodeConsecutiveRefuteThreshold: 6,
        problematicNodeRefutePercentageThreshold: 0.1,
        problematicNodeHistoryLength: 100,
        problematicNodeRemovalCycleFrequency: 5,
        firstCycleJoin: 10,
        maxPercentOfDelta: 40,
        minScaleReqsNeeded: 5,
        maxScaleReqs: 200,
        scaleConsensusRequired: 0.25,
        amountToGrow: 1,
        amountToShrink: 1,
        maxShrinkMultiplier: 0.02,
        scaleInfluenceForShrink: 0.2,
        maxDesiredMultiplier: 1.2,
        startInWitnessMode: false,
        experimentalSnapshot: true,
        detectLostSyncing: true,
        scaleGroupLimit: 25,
        useSignaturesForAuth: false,
        checkVersion: false,
        extraCyclesToKeep: 33,
        extraCyclesToKeepMultiplier: 1,
        checkNetworkStopped: false,
        validateActiveRequests: false,
        hackForceCycleSyncComplete: false,
        uniqueRemovedIds: false,
        uniqueRemovedIdsUpdate: false,
        uniqueLostIdsUpdate: false,
        useLruCacheForSocketMgmt: false,
        lruCacheSizeForSocketMgmt: 1000,
        payloadSizeLimitInBytes: 2 * 1024 * 1024,
        headerSizeLimitInBytes: 2 * 1024,
        delayLostReportByNumOfCycles: 1,
        aggregateLostReportsTillQ1: true,
        isDownCachePruneCycles: 10,
        isDownCacheEnabled: true,
        stopReportingLostPruneCycles: 10,
        lostMapPruneCycles: 10,
        instantForwardReceipts: false,
        maxArchiversSubscriptionPerNode: 2,
        writeSyncProtocolV2: false,
        useSyncProtocolV2: true,
        validateArchiverAppData: false,
        useNetworkModes: true,
        useJoinProtocolV2: true,
        randomJoinRequestWait: 2000,
        standbyListCyclesTTL: 10,
        standbyListMaxRemoveTTL: 100,
        standbyListMaxRemoveApp: 100,
        standbyAgeScrub: true,
        standbyVersionScrub: true,
        standbyAgeCheck: true,
        q1DelayPercent: 0.125,
        goldenTicketEnabled: true,
        preGossipNodeCheck: true,
        preGossipDownCheck: true,
        preGossipLostCheck: true,
        preGossipRecentCheck: true,
        initShutdown: false,
        enableLostArchiversCycles: false,
        lostArchiversCyclesToWait: 3,
        standbyListFastHash: false,
        networkBaselineEnabled: false,
        useCombinedTellBinary: true,
        rotationCountMultiply: 1,
        rotationCountAdd: 0,
        rotationPercentActive: 0.001,
        rotationMaxAddPercent: 0.1,
        rotationMaxRemovePercent: 0.05,
        syncFloorEnabled: false,
        syncingMaxAddPercent: 0.2,
        syncingDesiredMinCount: 50,
        allowActivePerCycle: 7,
        allowActivePerCycleRecover: 4,
        activeRecoveryEnabled: false,
        useProxyForDownCheck: false,
        numCheckerNodes: 1,
        minChecksForDown: 1,
        minChecksForUp: 1,
        attemptJoiningWaitMultiplier: 2,
        cyclesToWaitForSyncStarted: 3,
        cyclesToRefreshEarly: 4,
        extraNodesToAddInRestart: 5,
        secondsToCheckForQ1: 1000,
        hardenNewSyncingProtocol: true,
        removeLostSyncingNodeFromList: true,
        rotationEdgeToAvoid: 3,
        forcedMode: '',
        delayZombieRestartSec: 180,
        resumbitStandbyRefreshWaitDuration: 1000,
        formingNodesPerCycle: 7,
        downNodeFilteringEnabled: false,
        useFactCorrespondingTell: true,
        resubmitStandbyAddWaitDuration: 1000,
        requiredVotesPercentage: 2 / 3.0,
        timestampCacheFix: true,
        useAjvCycleRecordValidation: true,
        networkTransactionsToProcessPerCycle: 20,
        getTxTimestampTimeoutOffset: 0,
        dropNGTByGossipEnabled: false,
        timestampCacheFixSize: 10000,
        removedNodeIDCacheSize: 1000,
        stuckNGTInQueueFix: false,
        nerfNonFoundationCertScores: true,
        addFoundationNodeAttribute: true,
        preferFoundationNodesForTimestamp: false,
        foundationNodeThreshold: 50,
        patchNetworkAccountSyncFixes: true,
        enableShardKeyChanges: true,
        maxResponseSize: 1024 * 1024 * 15,
        allowEndUserTxnInjections: true,
        newCycleCertScoring: true,
    },
    ip: {
        externalIp: '0.0.0.0',
        externalPort: 9001,
        internalIp: '0.0.0.0',
        internalPort: 10001,
    },
    network: { timeout: 5 },
    reporting: {
        report: true,
        recipient: 'http://127.0.0.1:3000/api',
        interval: 2,
        console: false,
        logSocketReports: true,
    },
    debug: {
        ignoreScaleGossipSelfCheck: false,
        loseReceiptChance: 0,
        loseTxChance: 0,
        canDataRepair: false,
        startInFatalsLogMode: true,
        startInErrorLogMode: false,
        verboseNestedCounters: false,
        fakeNetworkDelay: 0,
        disableSnapshots: true,
        disableTxCoverageReport: true,
        disableLostNodeReports: false,
        haltOnDataOOS: false,
        countEndpointStart: -1,
        countEndpointStop: -1,
        hashedDevAuth: '',
        devPublicKeys: {},
        multisigKeys: {},
        debugNoTxVoting: false,
        ignoreRecieptChance: 0,
        ignoreVoteChance: 0,
        failReceiptChance: 0,
        voteFlipChance: 0,
        skipPatcherRepair: false,
        failNoRepairTxChance: 0,
        useNewParitionReport: false,
        oldPartitionSystem: false,
        dumpAccountReportFromSQL: false,
        profiler: false,
        minMultiSigRequiredForEndpoints: 3,
        minMultiSigRequiredForGlobalTxs: 3,
        minSigRequiredForArchiverWhitelist: 2,
        robustQueryDebug: false,
        forwardTXToSyncingNeighbors: false,
        recordAcceptedTx: false,
        recordAccountStates: false,
        useShardusMemoryPatterns: true,
        sanitizeInput: false,
        checkTxGroupChanges: true,
        ignoreTimeCheck: false,
        checkAddressFormat: false,
        produceBadVote: false,
        produceBadChallenge: false,
        debugNTPErrorWindowMs: 200,
        enableScopedProfiling: false,
        enableBasicProfiling: true,
        enableCycleRecordDebugTool: false,
        forcedExpiration: false,
        ignoreStandbyRefreshChance: 0,
        localEnableCycleRecordDebugTool: false,
        enableTestMode: false,
        highResolutionProfiling: true,
        randomCycleData: false,
        debugStatListMaxSize: 1000,
        ignoreDataTellChance: 0,
        debugNTPBogusDecrements: false,
        startedSyncingDelay: 0,
        finishedSyncingDelay: 0,
        readyNodeDelay: 0,
        qaTestBoolean: false,
        qaTestNumber: 0,
        qaTestString: '',
        beforeStateFailChance: 0,
        logCSVPerfEvents: false,
        numOfPerfEventsNeededForLogging: 10,
        enableDebugFlags: false,
    },
    statistics: { save: true, interval: 1 },
    loadDetection: {
        queueLimit: 1000,
        executeQueueLimit: 1000.0,
        desiredTxTime: 15,
        highThreshold: 0.5,
        lowThreshold: 0.2,
    },
    rateLimiting: {
        limitRate: true,
        loadLimit: {
            internal: 0.5,
            external: 0.4,
            txTimeInQueue: 0.2,
            queueLength: 0.2,
            executeQueueLength: 0.2,
        },
    },
    stateManager: {
        maxNonceQueueSize: 100000,
        stateTableBucketSize: 500,
        accountBucketSize: 200,
        patcherAccountsPerRequest: 250,
        patcherAccountsPerUpdate: 2500,
        patcherMaxHashesPerRequest: 300,
        patcherMaxLeafHashesPerRequest: 300,
        patcherMaxChildHashResponses: 2000,
        patcherRepairByReceiptPerUpdate: 100,
        maxDataSyncRestarts: 5,
        maxTrackerRestarts: 5,
        syncWithAccountOffset: true,
        useAccountCopiesTable: false,
        stuckProcessingLimit: 300,
        autoUnstickProcessing: false,
        apopFromStuckProcessing: false,
        discardVeryOldPendingTX: false,
        transactionApplyTimeout: -1,
        includeBeforeStatesInReceipts: false,
        fifoUnlockFix: true,
        fifoUnlockFix2: false,
        fifoUnlockFix3: false,
        enableAccountFetchForQueueCounts: false,
        configChangeMaxCyclesToKeep: 5,
        configChangeMaxChangesToKeep: 1000,
        waitTimeBeforeConfirm: 200,
        waitTimeBeforeReceipt: 200,
        waitLimitAfterFirstVote: 2000,
        waitLimitAfterFirstMessage: 2000,
        minRequiredChallenges: 1,
        useNewPOQ: false,
        nonExWaitForData: 5000,
        usePOQo: true,
        poqoloopTime: 2000,
        poqobatchCount: 1,
        forwardToLuckyNodes: false,
        forwardToLuckyNodesNonceQueue: true,
        forwardToLuckyNodesCheckRotation: true,
        forwardToLuckyMulti: false,
        forwardToLuckyNodesNonceQueueLimitFix: true,
        integrityCheckBeforeChallenge: true,
        checkPrecrackStatus: true,
        noVoteSeenExpirationTime: 10000,
        voteSeenExpirationTime: 20000,
        confirmationSeenExpirationTime: 30000,
        voterPercentage: 0.1,
        waitUpstreamTx: false,
        gossipCompleteData: false,
        shareCompleteData: false,
        txStateMachineChanges: true,
        canRequestFinalData: true,
        numberOfReInjectNodes: 5,
        maxPendingNonceTxs: 10,
        attachDataToReceipt: true,
        nodesToGossipAppliedReceipt: 10,
        useCopiedWrappedStateForApply: true,
        disableTxExpiration: true,
        removeStuckTxsFromQueue: false,
        stuckTxRemoveTime: 1000 * 60 * 2,
        removeStuckTxsFromQueue2: false,
        stuckTxRemoveTime2: 1000 * 60 * 2,
        removeStuckTxsFromQueue3: false,
        stuckTxRemoveTime3: 1000 * 60 * 3,
        removeStuckChallengedTXs: true,
        receiptRemoveFix: true,
        stuckTxQueueFix: true,
        singleAccountStuckFix: true,
        stuckTxMoveTime: 60000,
        forceVoteForFailedPreApply: true,
        collectedDataFix: true,
        noRepairIfDataAttached: false,
        rejectSharedDataIfCovered: false,
        requestAwaitedDataAllowed: false,
        awaitingDataCanBailOnReceipt: true,
        filterReceivingNodesForTXData: false,
        correspondingTellUseUnwrapped: true,
        concatCorrespondingTellUseUnwrapped: true,
        deterministicTXCycleEnabled: true,
        reduceTimeFromTxTimestamp: 60000,
        fallbackToCurrentCycleFortxGroup: false,
        maxCyclesShardDataToKeep: 20,
        avoidOurIndexInFactTell: false, //initial testing shows this may cause issues so leaving it off for now
    },
    sharding: { nodesPerConsensusGroup: 5, nodesPerEdge: 2, executeInOneShard: false },
    mode: shardus_types_1.ServerMode.Release,
    features: {
        dappFeature1enabled: false,
        fixHomeNodeCheckForTXGroupChanges: false,
        archiverDataSubscriptionsUpdate: false,
        startInServiceMode: false,
        enableRIAccountsCache: true,
        tickets: {
            updateTicketListTimeInMs: 60000 * 10,
            ticketTypes: [{ type: 'silver', enabled: false }],
        },
    },
};
exports.default = SERVER_CONFIG;
//# sourceMappingURL=server.js.map