{"version":3,"file":"constants.cjs","names":[],"sources":["../src/constants.ts"],"sourcesContent":["/**\n * Configuration constants for the Eclesia indexer\n * These values control performance, timeouts, and connection management\n */\n\n/**\n * Number of blocks to prefetch and keep in the processing queue\n * Higher values increase memory usage but improve throughput\n * Recommended range: 300-1000 depending on block size and available memory\n */\nexport const DEFAULT_BATCH_SIZE = 500;\n\n/**\n * Default start height for indexing when no previous height is found\n */\nexport const DEFAULT_START_HEIGHT = 1;\n\n/**\n * Default port for health check HTTP server\n */\nexport const DEFAULT_HEALTH_CHECK_PORT = 8888;\n\n/**\n * Default port for Prometheus metrics server\n */\nexport const DEFAULT_PROMETHEUS_PORT = 9090;\n\n/**\n * Default polling interval in milliseconds when using polling mode instead of WebSocket\n */\nexport const DEFAULT_POLLING_INTERVAL_MS = 5000;\n\n/**\n * Timeout for connecting to the Tendermint RPC in milliseconds\n * If connection is not established within this time, it will be aborted\n  */\nexport const CONNECT_TIMEOUT_MS = 10000;\n\n/**\n * Timeout for RPC calls in milliseconds\n * If a call takes longer than this, it will be rejected\n */\nexport const RPC_TIMEOUT_MS = 20000;\n\n/**\n * @deprecated Waiting for a block is no longer bounded by a timeout: an idle chain is not an\n * error. Kept as an export for compatibility; see IDLE_CHECK_INTERVAL_MS.\n */\nexport const QUEUE_DEQUEUE_TIMEOUT_MS = 30000;\n\n/**\n * How long the indexer waits without any block announcement before checking the chain height.\n * If the chain has moved on without us the subscription is dead and a recovery is triggered;\n * if the chain is simply idle (halt, upgrade) the indexer reports WAITING and checks again.\n */\nexport const IDLE_CHECK_INTERVAL_MS = 30000;\n\n/**\n * Delay before the first restart after a failure; doubles on every consecutive failure\n */\nexport const RETRY_BASE_DELAY_MS = 5000;\n\n/**\n * Upper bound for the restart delay\n */\nexport const RETRY_MAX_DELAY_MS = 300000;\n\n/**\n * Consecutive processing failures on the same block before the indexer gives up with a\n * fatal-error. A block that keeps failing after its data was fetched is a bug or bad data, not\n * an outage, and retrying it forever hides the problem.\n */\nexport const MAX_FAILURES_PER_BLOCK = 5;\n\n/**\n * Address the health check and metrics servers bind to unless configured otherwise\n */\nexport const DEFAULT_BIND_HOST = \"0.0.0.0\";\n\n/**\n * Number of successful transactions before recycling the database client\n * Prevents long-running connection issues and stale connections\n */\nexport const DB_CLIENT_RECYCLE_COUNT = 1500;\n\n/**\n * Block intervals for periodic event emission\n * Used for operations that should run at regular block intervals\n */\nexport const PERIODIC_INTERVALS = {\n  /** Emit periodic event every 50 blocks */\n  SMALL: 50,\n  /** Emit periodic event every 100 blocks */\n  MEDIUM: 100,\n  /** Emit periodic event every 1000 blocks - used for performance logging */\n  LARGE: 1000,\n} as const;\n\n/**\n * Pagination limits for blockchain queries\n */\nexport const PAGINATION_LIMITS = {\n  /** Default limit for validator queries */\n  VALIDATORS: 1000n,\n  /** Default limit for delegation queries */\n  DELEGATIONS: 250n,\n} as const;\n\n/**\n * Batch size for streaming genesis file processing\n * Number of entries to process at once from genesis JSON\n */\nexport const GENESIS_BATCH_SIZE = 1000;\n"],"mappings":";;;;;;;;;;;AAUA,MAAa,qBAAqB;;;;AAKlC,MAAa,uBAAuB;;;;AAKpC,MAAa,4BAA4B;;;;AAKzC,MAAa,0BAA0B;;;;AAKvC,MAAa,8BAA8B;;;;;AAM3C,MAAa,qBAAqB;;;;;AAMlC,MAAa,iBAAiB;;;;;AAM9B,MAAa,2BAA2B;;;;;;AAOxC,MAAa,yBAAyB;;;;AAKtC,MAAa,sBAAsB;;;;AAKnC,MAAa,qBAAqB;;;;;;AAOlC,MAAa,yBAAyB;;;;AAKtC,MAAa,oBAAoB;;;;;AAMjC,MAAa,0BAA0B;;;;;AAMvC,MAAa,qBAAqB;CAEhC,OAAO;CAEP,QAAQ;CAER,OAAO;CACR;;;;AAKD,MAAa,oBAAoB;CAE/B,YAAY;CAEZ,aAAa;CACd;;;;;AAMD,MAAa,qBAAqB"}