From 1f16e1fe7296246270c82e68bb89b0abca5aa220 Mon Sep 17 00:00:00 2001 From: Vardan Nadkarni Date: Thu, 7 Dec 2023 16:26:59 +0530 Subject: [PATCH 1/6] Updated node liveliness check mechanism --- services/blockchain-connector/app.js | 8 +++++++- .../blockchain-connector/shared/sdk/client.js | 20 +++++++++++++++---- .../blockchain-indexer/events/blockchain.js | 15 ++++++++++++-- .../shared/indexer/blockchainIndex.js | 4 ++++ 4 files changed, 40 insertions(+), 7 deletions(-) diff --git a/services/blockchain-connector/app.js b/services/blockchain-connector/app.js index f860ca7374..252fb8b2f7 100644 --- a/services/blockchain-connector/app.js +++ b/services/blockchain-connector/app.js @@ -14,7 +14,7 @@ * */ const path = require('path'); -const { Microservice, Logger, LoggerConfig } = require('lisk-service-framework'); +const { Signals, Microservice, Logger, LoggerConfig } = require('lisk-service-framework'); const config = require('./config'); @@ -31,6 +31,12 @@ const app = Microservice({ transporter: config.transporter, brokerTimeout: config.brokerTimeout, // in seconds logger: config.log, + events: { + genesisBlockIndexed: async () => { + logger.debug("Received a 'genesisBlockIndexed' event from indexer."); + Signals.get('genesisBlockIndexed').dispatch(); + }, + }, }); nodeStatus.waitForNode().then(async () => { diff --git a/services/blockchain-connector/shared/sdk/client.js b/services/blockchain-connector/shared/sdk/client.js index f504f0a028..6c9610c663 100644 --- a/services/blockchain-connector/shared/sdk/client.js +++ b/services/blockchain-connector/shared/sdk/client.js @@ -162,13 +162,25 @@ if (config.isUseLiskIPCClient) { const resetApiClientListener = async () => instantiateClient(true).catch(() => {}); Signals.get('resetApiClient').add(resetApiClientListener); } else { - const triggerRegularClientLivelinessChecks = () => - setInterval(async () => { + let intervalTimeout; + const triggerRegularClientLivelinessChecks = intervalMs => { + intervalTimeout = setInterval(async () => { const isAlive = await checkIsClientAlive(); if (!isAlive) instantiateClient(true).catch(() => {}); - }, CLIENT_ALIVE_ASSUMPTION_TIME); + }, intervalMs); + }; - Signals.get('genesisBlockDownloaded').add(triggerRegularClientLivelinessChecks); + const genesisBlockDownloadedListener = () => { + triggerRegularClientLivelinessChecks(30 * 1000); + }; + + const genesisBlockIndexedListener = () => { + clearInterval(intervalTimeout); + triggerRegularClientLivelinessChecks(CLIENT_ALIVE_ASSUMPTION_TIME); + }; + + Signals.get('genesisBlockDownloaded').add(genesisBlockDownloadedListener); + Signals.get('genesisBlockIndexed').add(genesisBlockIndexedListener); } module.exports = { diff --git a/services/blockchain-indexer/events/blockchain.js b/services/blockchain-indexer/events/blockchain.js index 06b3e45a9d..59668d844e 100644 --- a/services/blockchain-indexer/events/blockchain.js +++ b/services/blockchain-indexer/events/blockchain.js @@ -161,7 +161,7 @@ module.exports = [ description: 'Returns true when the index is ready', controller: callback => { const indexStatusListener = async payload => { - logger.debug("Dispatching 'index.ready' event over websocket"); + logger.debug("Dispatching 'index.ready' event over message broker"); callback(payload); }; Signals.get('blockIndexReady').add(indexStatusListener); @@ -172,10 +172,21 @@ module.exports = [ description: 'Emit index status updates.', controller: callback => { const indexStatusUpdateListener = async payload => { - logger.debug("Dispatching 'update.index.status' event over websocket"); + logger.debug("Dispatching 'update.index.status' event over message broker"); callback(payload); }; Signals.get('updateIndexStatus').add(indexStatusUpdateListener); }, }, + { + name: 'genesisBlockIndexed', + description: 'Emit event after genesis block is indexed.', + controller: callback => { + const genesisBlockIndexedListener = async () => { + logger.debug("Dispatching 'genesisBlockIndexed' event over message broker"); + callback(); + }; + Signals.get('genesisBlockIndexed').add(genesisBlockIndexedListener); + }, + }, ]; diff --git a/services/blockchain-indexer/shared/indexer/blockchainIndex.js b/services/blockchain-indexer/shared/indexer/blockchainIndex.js index 90426d405f..e8a813b228 100644 --- a/services/blockchain-indexer/shared/indexer/blockchainIndex.js +++ b/services/blockchain-indexer/shared/indexer/blockchainIndex.js @@ -378,6 +378,10 @@ const indexBlock = async job => { logger.info( `Successfully indexed block ${blockToIndexFromNode.id} at height ${blockToIndexFromNode.height}.`, ); + + if (blockToIndexFromNode.height === genesisHeight) { + Signals.get('genesisBlockIndexed').dispatch(); + } } catch (error) { // Stop genesisAsset index progress logging on errors if (blockToIndexFromNode.height === genesisHeight) { From 76b714147558016c972fb3dcadf1a02086f900b4 Mon Sep 17 00:00:00 2001 From: Vardan Nadkarni Date: Thu, 7 Dec 2023 19:01:44 +0530 Subject: [PATCH 2/6] Added failsafe in connector in case indexer events fail to ensure node connection liveness --- services/blockchain-connector/app.js | 2 +- services/blockchain-connector/shared/sdk/client.js | 3 +++ services/blockchain-coordinator/app.js | 8 ++++---- services/blockchain-indexer/app.js | 6 +++--- services/blockchain-indexer/events/blockchain.js | 10 +++++----- 5 files changed, 16 insertions(+), 13 deletions(-) diff --git a/services/blockchain-connector/app.js b/services/blockchain-connector/app.js index 252fb8b2f7..6f7f39b502 100644 --- a/services/blockchain-connector/app.js +++ b/services/blockchain-connector/app.js @@ -33,7 +33,7 @@ const app = Microservice({ logger: config.log, events: { genesisBlockIndexed: async () => { - logger.debug("Received a 'genesisBlockIndexed' event from indexer."); + logger.debug("Received a 'genesisBlockIndexed' moleculer event from indexer."); Signals.get('genesisBlockIndexed').dispatch(); }, }, diff --git a/services/blockchain-connector/shared/sdk/client.js b/services/blockchain-connector/shared/sdk/client.js index 6c9610c663..4c45123a99 100644 --- a/services/blockchain-connector/shared/sdk/client.js +++ b/services/blockchain-connector/shared/sdk/client.js @@ -172,6 +172,9 @@ if (config.isUseLiskIPCClient) { const genesisBlockDownloadedListener = () => { triggerRegularClientLivelinessChecks(30 * 1000); + + // Incase genesisBlockIndexed event is not triggered by indexer wait for max 15 mins for genesis block to get indexed + setTimeout(() => Signals.get('genesisBlockIndexed').dispatch(), 15 * 60 * 1000); }; const genesisBlockIndexedListener = () => { diff --git a/services/blockchain-coordinator/app.js b/services/blockchain-coordinator/app.js index 5b45e2b74d..c153e7a6a6 100644 --- a/services/blockchain-coordinator/app.js +++ b/services/blockchain-coordinator/app.js @@ -32,19 +32,19 @@ const app = Microservice({ logger: config.log, events: { chainNewBlock: async payload => { - logger.debug("Received a 'chainNewBlock' event from connecter."); + logger.debug("Received a 'chainNewBlock' moleculer event from connecter."); Signals.get('newBlock').dispatch(payload); }, chainDeleteBlock: async payload => { - logger.debug("Received a 'chainDeleteBlock' event from connecter."); + logger.debug("Received a 'chainDeleteBlock' moleculer event from connecter."); Signals.get('deleteBlock').dispatch(payload); }, chainValidatorsChange: async payload => { - logger.debug("Received a 'chainValidatorsChange' event from connecter."); + logger.debug("Received a 'chainValidatorsChange' moleculer event from connecter."); Signals.get('newRound').dispatch(payload); }, systemNodeInfo: async payload => { - logger.debug("Received a 'systemNodeInfo' event from connecter."); + logger.debug("Received a 'systemNodeInfo' moleculer event from connecter."); Signals.get('nodeInfo').dispatch(payload); }, }, diff --git a/services/blockchain-indexer/app.js b/services/blockchain-indexer/app.js index 469e7c557f..688390eeb7 100644 --- a/services/blockchain-indexer/app.js +++ b/services/blockchain-indexer/app.js @@ -50,15 +50,15 @@ const defaultBrokerConfig = { logger: config.log, events: { chainNewBlock: async () => { - logger.debug("Received a 'chainNewBlock' event from connecter."); + logger.debug("Received a 'chainNewBlock' moleculer event from connecter."); Signals.get('chainNewBlock').dispatch(); }, systemNodeInfo: async payload => { - logger.debug("Received a 'systemNodeInfo' event from connecter."); + logger.debug("Received a 'systemNodeInfo' moleculer event from connecter."); Signals.get('nodeInfo').dispatch(payload); }, 'update.fee_estimates': async payload => { - logger.debug("Received a 'update.fee_estimates' event from fee-estimator."); + logger.debug("Received a 'update.fee_estimates' moleculer event from fee-estimator."); await setFeeEstimates(payload); }, }, diff --git a/services/blockchain-indexer/events/blockchain.js b/services/blockchain-indexer/events/blockchain.js index 59668d844e..5c2ef4ffdd 100644 --- a/services/blockchain-indexer/events/blockchain.js +++ b/services/blockchain-indexer/events/blockchain.js @@ -39,7 +39,7 @@ module.exports = [ // Fork detection if (localPreviousBlockId) { if (localPreviousBlockId !== block.previousBlockId) { - logger.debug(`Fork detected at block height ${localPreviousBlockId}`); + logger.debug(`Fork detected at block height ${localPreviousBlockId}.`); } } localPreviousBlockId = block.id; @@ -68,7 +68,7 @@ module.exports = [ if (numberOfTransactions > 0) { logger.debug( - `Block (${block.id}) arrived containing ${block.numberOfTransactions} new transactions`, + `Block (${block.id}) arrived containing ${block.numberOfTransactions} new transactions.`, ); const formattedTransactions = await formatTransactionsInBlock(block); @@ -161,7 +161,7 @@ module.exports = [ description: 'Returns true when the index is ready', controller: callback => { const indexStatusListener = async payload => { - logger.debug("Dispatching 'index.ready' event over message broker"); + logger.debug("Dispatching 'index.ready' event over message broker."); callback(payload); }; Signals.get('blockIndexReady').add(indexStatusListener); @@ -172,7 +172,7 @@ module.exports = [ description: 'Emit index status updates.', controller: callback => { const indexStatusUpdateListener = async payload => { - logger.debug("Dispatching 'update.index.status' event over message broker"); + logger.debug("Dispatching 'update.index.status' event over message broker."); callback(payload); }; Signals.get('updateIndexStatus').add(indexStatusUpdateListener); @@ -183,7 +183,7 @@ module.exports = [ description: 'Emit event after genesis block is indexed.', controller: callback => { const genesisBlockIndexedListener = async () => { - logger.debug("Dispatching 'genesisBlockIndexed' event over message broker"); + logger.debug("Dispatching 'genesisBlockIndexed' event over message broker."); callback(); }; Signals.get('genesisBlockIndexed').add(genesisBlockIndexedListener); From df9251e10818460d638b62dcaed4c5b924f09b89 Mon Sep 17 00:00:00 2001 From: Vardan Nadkarni Date: Thu, 7 Dec 2023 19:45:49 +0530 Subject: [PATCH 3/6] Updated logs --- services/blockchain-app-registry/events/metadata.js | 2 +- services/blockchain-connector/shared/geolocation.js | 4 ++-- .../blockchain-connector/shared/sdk/blocksUtils.js | 12 ++++++------ services/blockchain-connector/shared/sdk/events.js | 2 +- .../blockchain-connector/shared/utils/download.js | 12 ++++++------ .../blockchain-indexer/shared/dataService/blocks.js | 8 ++++---- .../0_moduleName/commandName1.js | 4 ++-- .../0_moduleName/commandName2.js | 4 ++-- services/export/jobs/purge.js | 2 +- services/fee-estimator/shared/dynamicFees.js | 2 +- services/fee-estimator/shared/utils/dynamicFees.js | 2 +- services/gateway/app.js | 2 +- services/gateway/shared/ready.js | 2 +- services/market/jobs/binance.js | 6 +++--- services/market/jobs/bittrex.js | 4 ++-- services/market/jobs/exchangeratesapi.js | 4 ++-- services/market/jobs/kraken.js | 4 ++-- services/market/jobs/pricesUpdate.js | 4 ++-- services/template/jobs/job.js | 2 +- .../shared/buildTransactionStatistics.js | 4 ++-- 20 files changed, 43 insertions(+), 43 deletions(-) diff --git a/services/blockchain-app-registry/events/metadata.js b/services/blockchain-app-registry/events/metadata.js index 737dfc5fac..1e34ee8a06 100644 --- a/services/blockchain-app-registry/events/metadata.js +++ b/services/blockchain-app-registry/events/metadata.js @@ -23,7 +23,7 @@ module.exports = [ description: 'Emit event when the database is successfully synchronized', controller: async callback => { const updateMetadataListener = async data => { - logger.debug('Database has been successfully synchronized'); + logger.debug('Database has been successfully synchronized.'); callback(data); }; Signals.get('metadataUpdated').add(updateMetadataListener); diff --git a/services/blockchain-connector/shared/geolocation.js b/services/blockchain-connector/shared/geolocation.js index f07a4a33c8..ca5b29e6b5 100644 --- a/services/blockchain-connector/shared/geolocation.js +++ b/services/blockchain-connector/shared/geolocation.js @@ -60,7 +60,7 @@ const requestData = async requestedIp => { getFromHttp(ip) .then(data => { if (data) cacheRedis.set(key, data.data, GEOIP_TTL); - logger.debug(`Fetched geolocation data from online service for IP ${ip}`); + logger.debug(`Fetched geolocation data from online service for IP ${ip}.`); refreshSchedule.push( setTimeout( () => refreshData(ip), @@ -84,7 +84,7 @@ const autoCleanUp = () => const tooMuch = refreshSchedule.splice(0, refreshSchedule.length - SCHEDULE_MAX_LENGTH); tooMuch.forEach(item => clearInterval(item)); logger.debug( - `Cache queue: Removed ${tooMuch.length} items, ${refreshSchedule.length} last elements left`, + `Cache queue: Removed ${tooMuch.length} items, ${refreshSchedule.length} last elements left.`, ); }, SCHEDULE_CLEANUP_INTERVAL); diff --git a/services/blockchain-connector/shared/sdk/blocksUtils.js b/services/blockchain-connector/shared/sdk/blocksUtils.js index 482f478bde..b7ce076da2 100644 --- a/services/blockchain-connector/shared/sdk/blocksUtils.js +++ b/services/blockchain-connector/shared/sdk/blocksUtils.js @@ -52,24 +52,24 @@ const loadConfig = async () => { if (config.genesisBlockUrl !== config.constants.GENESIS_BLOCK_URL_DEFAULT) { genesisBlockUrl = config.genesisBlockUrl; - logger.info(`genesisBlockUrl set to ${genesisBlockUrl}`); + logger.info(`genesisBlockUrl set to ${genesisBlockUrl}.`); genesisBlockFilePath = `./data/${chainID}/genesis_block.json`; - logger.info(`genesisBlockFilePath set to ${genesisBlockFilePath}`); + logger.info(`genesisBlockFilePath set to ${genesisBlockFilePath}.`); } else { // Check if current node is running Lisk Core const [networkConfig] = config.networks.LISK.filter(c => chainID === c.chainID); if (networkConfig) { - logger.info(`Found config for ${networkConfig.name} (${chainID})`); + logger.info(`Found config for ${networkConfig.name} (${chainID}).`); genesisBlockUrl = networkConfig.genesisBlockUrl; - logger.info(`genesisBlockUrl set to ${genesisBlockUrl}`); + logger.info(`genesisBlockUrl set to ${genesisBlockUrl}.`); genesisBlockFilePath = `./data/${chainID}/genesis_block.json`; - logger.info(`genesisBlockFilePath set to ${genesisBlockFilePath}`); + logger.info(`genesisBlockFilePath set to ${genesisBlockFilePath}.`); } else { logger.info( - `Network is neither defined in the config, nor in the environment variable (${chainID})`, + `Network is neither defined in the config, nor in the environment variable (${chainID}).`, ); return; } diff --git a/services/blockchain-connector/shared/sdk/events.js b/services/blockchain-connector/shared/sdk/events.js index e2ceef1069..2b2f8f15a4 100644 --- a/services/blockchain-connector/shared/sdk/events.js +++ b/services/blockchain-connector/shared/sdk/events.js @@ -104,7 +104,7 @@ const ensureAPIClientLiveness = () => { }, config.clientConnVerifyInterval); } else { logger.info( - `Cannot start the events-based client liveness check yet. Either the node is not yet synced or the genesis block hasn't been downloaded yet.\nisNodeSynced: ${isNodeSynced}, isGenesisBlockDownloaded: ${isGenesisBlockDownloaded}`, + `Cannot start the events-based client liveness check yet. Either the node is not yet synced or the genesis block hasn't been downloaded yet.\nisNodeSynced: ${isNodeSynced}, isGenesisBlockDownloaded: ${isGenesisBlockDownloaded}.`, ); } }; diff --git a/services/blockchain-connector/shared/utils/download.js b/services/blockchain-connector/shared/utils/download.js index d9b0eb41ed..7ffb6dcc0a 100644 --- a/services/blockchain-connector/shared/utils/download.js +++ b/services/blockchain-connector/shared/utils/download.js @@ -54,12 +54,12 @@ const downloadAndExtractTarball = (url, directoryPath) => const downloadJSONFile = (fileUrl, filePath) => new Promise((resolve, reject) => { - logger.info(`Downloading JSON file from ${fileUrl} as ${filePath}`); + logger.info(`Downloading JSON file from ${fileUrl} as ${filePath}.`); request(fileUrl) .then(async response => { const block = typeof response === 'string' ? JSON.parse(response).data : response.data; fs.writeFile(filePath, JSON.stringify(block), () => { - logger.info('File downloaded successfully'); + logger.info('File downloaded successfully.'); resolve(); }); }) @@ -68,7 +68,7 @@ const downloadJSONFile = (fileUrl, filePath) => const downloadAndUnzipFile = (fileUrl, filePath) => new Promise((resolve, reject) => { - logger.info(`Downloading and extracting file from ${fileUrl} as ${filePath}`); + logger.info(`Downloading and extracting file from ${fileUrl} as ${filePath}.`); getHTTPProtocolByURL(fileUrl).get(fileUrl, response => { if (response.statusCode === 200) { const unzip = zlib.createUnzip(); @@ -76,7 +76,7 @@ const downloadAndUnzipFile = (fileUrl, filePath) => response.pipe(unzip).pipe(writeFile); response.on('error', async err => reject(new Error(err))); response.on('end', async () => { - logger.info('File downloaded successfully'); + logger.info('File downloaded successfully.'); resolve(); }); } else { @@ -90,7 +90,7 @@ const downloadAndUnzipFile = (fileUrl, filePath) => const downloadFile = (url, dirPath) => new Promise((resolve, reject) => { - logger.info(`Downloading file from ${url} to ${dirPath}`); + logger.info(`Downloading file from ${url} to ${dirPath}.`); getHTTPProtocolByURL(url).get(url, response => { if (response.statusCode === 200) { @@ -100,7 +100,7 @@ const downloadFile = (url, dirPath) => response.pipe(writeStream); response.on('error', async err => reject(new Error(err))); response.on('end', async () => { - logger.info('File downloaded successfully'); + logger.info('File downloaded successfully.'); resolve(); }); } else { diff --git a/services/blockchain-indexer/shared/dataService/blocks.js b/services/blockchain-indexer/shared/dataService/blocks.js index 2f66a939b7..9c07ea7362 100644 --- a/services/blockchain-indexer/shared/dataService/blocks.js +++ b/services/blockchain-indexer/shared/dataService/blocks.js @@ -44,10 +44,10 @@ const getBlocksFromServer = async params => { meta: {}, }; - if (params.blockID) logger.debug(`Retrieved block with ID ${params.blockID} from Lisk Core`); + if (params.blockID) logger.debug(`Retrieved block with ID ${params.blockID} from Lisk Core.`); else if (params.height) - logger.debug(`Retrieved block with height: ${params.height} from Lisk Core`); - else logger.debug(`Retrieved block with custom search: ${util.inspect(params)} from Lisk Core`); + logger.debug(`Retrieved block with height: ${params.height} from Lisk Core.`); + else logger.debug(`Retrieved block with custom search: ${util.inspect(params)} from Lisk Core.`); const response = await business.getBlocks(params); if (response.data) blocks.data = response.data; @@ -140,7 +140,7 @@ const getBlocksAssets = async params => { const performLastBlockUpdate = async newBlock => { try { - logger.debug(`Setting last block to height: ${newBlock.height} (id: ${newBlock.id})`); + logger.debug(`Setting last block to height: ${newBlock.height} (id: ${newBlock.id}).`); await setLastBlock(newBlock); } catch (err) { logger.error(`Error occurred when performing last block update:\n${err.stack}`); diff --git a/services/blockchain-indexer/shared/indexer/transactionProcessor/0_moduleName/commandName1.js b/services/blockchain-indexer/shared/indexer/transactionProcessor/0_moduleName/commandName1.js index 117d0323d5..402d4849f1 100644 --- a/services/blockchain-indexer/shared/indexer/transactionProcessor/0_moduleName/commandName1.js +++ b/services/blockchain-indexer/shared/indexer/transactionProcessor/0_moduleName/commandName1.js @@ -50,7 +50,7 @@ const applyTransaction = async (blockHeader, tx, events, dbTrx) => { // Process the transaction to create the entityTableEntry // And, finally, perform DB operations to update the index await entityTable.upsert(entityTableEntry, dbTrx); // it is important to pass dbTrx - logger.debug('Add custom logs'); + logger.debug('Add custom logs.'); Promise.resolve({ blockHeader, tx }); }; @@ -66,7 +66,7 @@ const revertTransaction = async (blockHeader, tx, events, dbTrx) => { // Process the transaction to create the entityTableEntry // And, finally, perform DB operations to update the index and revert the induced changes await entityTable.delete(entityTableEntry, dbTrx); // it is important to pass dbTrx - logger.debug('Add custom logs'); + logger.debug('Add custom logs.'); Promise.resolve({ blockHeader, tx }); }; diff --git a/services/blockchain-indexer/shared/indexer/transactionProcessor/0_moduleName/commandName2.js b/services/blockchain-indexer/shared/indexer/transactionProcessor/0_moduleName/commandName2.js index 3142ec2918..a4839c191e 100644 --- a/services/blockchain-indexer/shared/indexer/transactionProcessor/0_moduleName/commandName2.js +++ b/services/blockchain-indexer/shared/indexer/transactionProcessor/0_moduleName/commandName2.js @@ -50,7 +50,7 @@ export const applyTransaction = async (blockHeader, tx, events, dbTrx) => { // Process the transaction to create the entityTableEntry // And, finally, perform DB operations to update the index await entityTable.upsert(entityTableEntry, dbTrx); // it is important to pass dbTrx - logger.debug('Add custom logs'); + logger.debug('Add custom logs.'); Promise.resolve({ blockHeader, tx }); }; @@ -66,7 +66,7 @@ export const revertTransaction = async (blockHeader, tx, events, dbTrx) => { // Process the transaction to create the entityTableEntry // And, finally, perform DB operations to update the index and revert the induced changes await entityTable.delete(entityTableEntry, dbTrx); // it is important to pass dbTrx - logger.debug('Add custom logs'); + logger.debug('Add custom logs.'); Promise.resolve({ blockHeader, tx }); }; diff --git a/services/export/jobs/purge.js b/services/export/jobs/purge.js index 9d272a0d47..1ba862fb63 100644 --- a/services/export/jobs/purge.js +++ b/services/export/jobs/purge.js @@ -28,7 +28,7 @@ module.exports = [ interval: config.job.purgeCache.interval, schedule: config.job.purgeCache.schedule, controller: () => { - logger.info('Performing cache maintenance'); + logger.info('Performing cache maintenance.'); partials.purge(); staticFiles.purge(); }, diff --git a/services/fee-estimator/shared/dynamicFees.js b/services/fee-estimator/shared/dynamicFees.js index 249c09cdc0..1c85a7548e 100644 --- a/services/fee-estimator/shared/dynamicFees.js +++ b/services/fee-estimator/shared/dynamicFees.js @@ -58,7 +58,7 @@ const calculateEstimateFeePerByteQuick = async () => { const fromHeight = toHeight - batchSize; logger.debug( - `Computing quick fee estimate for block ${latestBlock.id} at height ${latestBlock.height}`, + `Computing quick fee estimate for block ${latestBlock.id} at height ${latestBlock.height}.`, ); const cachedFeeEstPerByteQuick = await checkAndProcessExecution( fromHeight, diff --git a/services/fee-estimator/shared/utils/dynamicFees.js b/services/fee-estimator/shared/utils/dynamicFees.js index f5911ea024..28fb85c25a 100644 --- a/services/fee-estimator/shared/utils/dynamicFees.js +++ b/services/fee-estimator/shared/utils/dynamicFees.js @@ -93,7 +93,7 @@ const getEstimateFeePerByteForBatch = async (fromHeight, toHeight, cacheKey) => await cacheRedisFees.set(cacheKey, feeEstPerByte); logger.info( - `Recalulated dynamic fees: L: ${feeEstPerByte.low} M: ${feeEstPerByte.med} H: ${feeEstPerByte.high}`, + `Recalulated dynamic fees: L: ${feeEstPerByte.low} M: ${feeEstPerByte.med} H: ${feeEstPerByte.high}.`, ); return feeEstPerByte; diff --git a/services/gateway/app.js b/services/gateway/app.js index 92b3d447f0..178acb6e9a 100644 --- a/services/gateway/app.js +++ b/services/gateway/app.js @@ -191,7 +191,7 @@ tempApp.run().then(async () => { if (config.rateLimit.enable) { logger.info( - `Enabling rate limiter, connLimit: ${config.rateLimit.connectionLimit}, window: ${config.rateLimit.window}`, + `Enabling rate limiter, connLimit: ${config.rateLimit.connectionLimit}, window: ${config.rateLimit.window}.`, ); gatewayConfig.settings.rateLimit = { diff --git a/services/gateway/shared/ready.js b/services/gateway/shared/ready.js index 7307b338e3..92e676b12b 100644 --- a/services/gateway/shared/ready.js +++ b/services/gateway/shared/ready.js @@ -60,7 +60,7 @@ const getReady = () => { }); return { services: includeSvcForReadiness }; } catch (_) { - logger.error(`Current service status: ${currentSvcStatus}`); + logger.error(`Current service status: ${currentSvcStatus}.`); throw new MoleculerError('Service Unavailable', 503, 'SERVICES_NOT_READY'); } }; diff --git a/services/market/jobs/binance.js b/services/market/jobs/binance.js index 21ce93910b..c04d73733d 100644 --- a/services/market/jobs/binance.js +++ b/services/market/jobs/binance.js @@ -35,15 +35,15 @@ const reloadMarketPrices = async () => module.exports = [ { name: 'prices.retrieve.binance', - description: 'Fetches up-to-date market prices from Binance', + description: 'Fetches up-to-date market prices from Binance.', interval: config.job.refreshPricesBinance.interval, schedule: config.job.refreshPricesBinance.schedule, init: async () => { - logger.debug('Initializing market prices from Binance'); + logger.debug('Initializing market prices from Binance.'); await reloadMarketPrices(); }, controller: async () => { - logger.debug('Job scheduled to update prices from Binance'); + logger.debug('Job scheduled to update prices from Binance.'); await reloadMarketPrices(); }, }, diff --git a/services/market/jobs/bittrex.js b/services/market/jobs/bittrex.js index 6d96f3cc90..0b6278c573 100644 --- a/services/market/jobs/bittrex.js +++ b/services/market/jobs/bittrex.js @@ -39,11 +39,11 @@ module.exports = [ interval: config.job.refreshPricesBittrex.interval, schedule: config.job.refreshPricesBittrex.schedule, init: async () => { - logger.debug('Initializing market prices from Bittrex'); + logger.debug('Initializing market prices from Bittrex.'); await reloadMarketPrices(); }, controller: async () => { - logger.debug('Job scheduled to update prices from Bittrex'); + logger.debug('Job scheduled to update prices from Bittrex.'); await reloadMarketPrices(); }, }, diff --git a/services/market/jobs/exchangeratesapi.js b/services/market/jobs/exchangeratesapi.js index 61a0b4e34f..72b8a352d7 100644 --- a/services/market/jobs/exchangeratesapi.js +++ b/services/market/jobs/exchangeratesapi.js @@ -25,11 +25,11 @@ module.exports = [ interval: config.job.refreshPricesExchangeratesapi.interval, schedule: config.job.refreshPricesExchangeratesapi.schedule, init: async () => { - logger.debug('Initializing market prices from exchangeratesapi'); + logger.debug('Initializing market prices from exchangeratesapi.'); await reload(); }, controller: async () => { - logger.debug('Job scheduled to update prices from exchangeratesapi'); + logger.debug('Job scheduled to update prices from exchangeratesapi.'); await reload(); }, }, diff --git a/services/market/jobs/kraken.js b/services/market/jobs/kraken.js index efdc8db935..aa387420bc 100644 --- a/services/market/jobs/kraken.js +++ b/services/market/jobs/kraken.js @@ -39,11 +39,11 @@ module.exports = [ interval: config.job.refreshPricesKraken.interval, schedule: config.job.refreshPricesKraken.schedule, init: async () => { - logger.debug('Initializing market prices from Kraken'); + logger.debug('Initializing market prices from Kraken.'); await reloadMarketPrices(); }, controller: async () => { - logger.debug('Job scheduled to update prices from Kraken'); + logger.debug('Job scheduled to update prices from Kraken.'); await reloadMarketPrices(); }, }, diff --git a/services/market/jobs/pricesUpdate.js b/services/market/jobs/pricesUpdate.js index 0141144fbf..4991e94730 100644 --- a/services/market/jobs/pricesUpdate.js +++ b/services/market/jobs/pricesUpdate.js @@ -25,11 +25,11 @@ module.exports = [ interval: config.job.updatePrices.interval, schedule: config.job.updatePrices.schedule, init: async () => { - logger.debug('Initializing market prices'); + logger.debug('Initializing market prices.'); await updatePrices(); }, controller: async () => { - logger.debug('Job scheduled to maintain updated market prices'); + logger.debug('Job scheduled to maintain updated market prices.'); await updatePrices(); }, }, diff --git a/services/template/jobs/job.js b/services/template/jobs/job.js index f5c19f6b02..007b4447dc 100644 --- a/services/template/jobs/job.js +++ b/services/template/jobs/job.js @@ -22,7 +22,7 @@ module.exports = [ schedule: '* * * * *', // Every 1 min controller: () => { const operationResult = (() => [1, 2, 3, 4, 5])(); - logger.info(`Dummy job is done, processed ${operationResult.length} items`); + logger.info(`Dummy job is done, processed ${operationResult.length} items.`); }, }, ]; diff --git a/services/transaction-statistics/shared/buildTransactionStatistics.js b/services/transaction-statistics/shared/buildTransactionStatistics.js index 80731a58ce..cfcb9ac624 100644 --- a/services/transaction-statistics/shared/buildTransactionStatistics.js +++ b/services/transaction-statistics/shared/buildTransactionStatistics.js @@ -128,9 +128,9 @@ const insertToDB = async (statsList, date) => { try { const [{ id }] = transactionStatisticsTable.find({ date, limit: 1 }, ['id']); await transactionStatisticsTable.deleteByPrimaryKey([id]); - logger.debug(`Removed the following date from the database: ${date}`); + logger.debug(`Removed the following date from the database: ${date}.`); } catch (err) { - logger.debug(`The database does not contain the entry with the following date: ${date}`); + logger.debug(`The database does not contain the entry with the following date: ${date}.`); } statsList.map(statistic => { From 1a95c33ebe486a9b270da551f414c333800d0a91 Mon Sep 17 00:00:00 2001 From: Vardan Nadkarni Date: Thu, 7 Dec 2023 20:45:42 +0530 Subject: [PATCH 4/6] Updated logs --- services/blockchain-connector/app.js | 6 ++-- services/blockchain-connector/config.js | 1 + .../blockchain-connector/shared/sdk/client.js | 29 ++++++++++++++----- .../blockchain-connector/shared/sdk/events.js | 2 +- .../blockchain-indexer/events/blockchain.js | 19 +++--------- .../shared/dataService/blocks.js | 6 ++-- .../shared/indexer/blockchainIndex.js | 4 --- services/export/jobs/purge.js | 2 +- .../fee-estimator/shared/utils/dynamicFees.js | 2 +- services/gateway/shared/ready.js | 2 +- services/market/jobs/pricesUpdate.js | 2 +- .../shared/buildTransactionStatistics.js | 2 +- 12 files changed, 38 insertions(+), 39 deletions(-) diff --git a/services/blockchain-connector/app.js b/services/blockchain-connector/app.js index 6f7f39b502..332201f41d 100644 --- a/services/blockchain-connector/app.js +++ b/services/blockchain-connector/app.js @@ -32,9 +32,9 @@ const app = Microservice({ brokerTimeout: config.brokerTimeout, // in seconds logger: config.log, events: { - genesisBlockIndexed: async () => { - logger.debug("Received a 'genesisBlockIndexed' moleculer event from indexer."); - Signals.get('genesisBlockIndexed').dispatch(); + 'update.index.status': async payload => { + logger.debug("Received a 'update.index.status' moleculer event from indexer."); + Signals.get('updateIndexStatus').dispatch(payload); }, }, }); diff --git a/services/blockchain-connector/config.js b/services/blockchain-connector/config.js index bb886cdcef..c741e547f1 100644 --- a/services/blockchain-connector/config.js +++ b/services/blockchain-connector/config.js @@ -115,6 +115,7 @@ config.job = { config.apiClient = { heartbeatAckMaxWaitTime: Number(process.env.HEARTBEAT_ACK_MAX_WAIT_TIME) || 1000, // in millisecs aliveAssumptionTime: Number(process.env.CLIENT_ALIVE_ASSUMPTION_TIME) || 5 * 1000, // in millisecs + aliveAssumptionTimeBeforeGenesis: Number(30 * 1000), instantiation: { maxWaitTime: Number(process.env.CLIENT_INSTANTIATION_MAX_WAIT_TIME) || 5 * 1000, // in millisecs retryInterval: Number(process.env.CLIENT_INSTANTIATION_RETRY_INTERVAL) || 1, // in millisecs diff --git a/services/blockchain-connector/shared/sdk/client.js b/services/blockchain-connector/shared/sdk/client.js index 4c45123a99..523a2df4cf 100644 --- a/services/blockchain-connector/shared/sdk/client.js +++ b/services/blockchain-connector/shared/sdk/client.js @@ -33,6 +33,8 @@ const MAX_INSTANTIATION_WAIT_TIME = config.apiClient.instantiation.maxWaitTime; const NUM_REQUEST_RETRIES = config.apiClient.request.maxRetries; const ENDPOINT_INVOKE_RETRY_DELAY = config.apiClient.request.retryDelay; const CLIENT_ALIVE_ASSUMPTION_TIME = config.apiClient.aliveAssumptionTime; +const CLIENT_ALIVE_ASSUMPTION_TIME_BEFORE_GENESIS = + config.apiClient.aliveAssumptionTimeBeforeGenesis; const HEARTBEAT_ACK_MAX_WAIT_TIME = config.apiClient.heartbeatAckMaxWaitTime; // Caching and flags @@ -42,6 +44,7 @@ let lastClientAliveTime; let heartbeatCheckBeginTime; let isInstantiating = false; let isClientAlive = false; +let isGenesisBlockIndexed = false; const pongListener = res => { isClientAlive = true; @@ -171,19 +174,29 @@ if (config.isUseLiskIPCClient) { }; const genesisBlockDownloadedListener = () => { - triggerRegularClientLivelinessChecks(30 * 1000); - - // Incase genesisBlockIndexed event is not triggered by indexer wait for max 15 mins for genesis block to get indexed - setTimeout(() => Signals.get('genesisBlockIndexed').dispatch(), 15 * 60 * 1000); + triggerRegularClientLivelinessChecks(CLIENT_ALIVE_ASSUMPTION_TIME_BEFORE_GENESIS); + logger.info( + `Updated node liveliness check to occur to every ${CLIENT_ALIVE_ASSUMPTION_TIME_BEFORE_GENESIS} seconds. Will update again after checking of genesis block is indexed.`, + ); }; - const genesisBlockIndexedListener = () => { - clearInterval(intervalTimeout); - triggerRegularClientLivelinessChecks(CLIENT_ALIVE_ASSUMPTION_TIME); + const genesisBlockIndexedListener = indexStatus => { + if ( + !isGenesisBlockIndexed && + indexStatus.data && + indexStatus.data.genesisHeight < indexStatus.data.lastIndexedBlockHeight + ) { + clearInterval(intervalTimeout); + triggerRegularClientLivelinessChecks(CLIENT_ALIVE_ASSUMPTION_TIME); + isGenesisBlockIndexed = true; + logger.info( + `Updated node liveliness check to occur to every ${CLIENT_ALIVE_ASSUMPTION_TIME} seconds since genesis block is indexed.`, + ); + } }; Signals.get('genesisBlockDownloaded').add(genesisBlockDownloadedListener); - Signals.get('genesisBlockIndexed').add(genesisBlockIndexedListener); + Signals.get('updateIndexStatus').add(genesisBlockIndexedListener); } module.exports = { diff --git a/services/blockchain-connector/shared/sdk/events.js b/services/blockchain-connector/shared/sdk/events.js index 2b2f8f15a4..e2ceef1069 100644 --- a/services/blockchain-connector/shared/sdk/events.js +++ b/services/blockchain-connector/shared/sdk/events.js @@ -104,7 +104,7 @@ const ensureAPIClientLiveness = () => { }, config.clientConnVerifyInterval); } else { logger.info( - `Cannot start the events-based client liveness check yet. Either the node is not yet synced or the genesis block hasn't been downloaded yet.\nisNodeSynced: ${isNodeSynced}, isGenesisBlockDownloaded: ${isGenesisBlockDownloaded}.`, + `Cannot start the events-based client liveness check yet. Either the node is not yet synced or the genesis block hasn't been downloaded yet.\nisNodeSynced: ${isNodeSynced}, isGenesisBlockDownloaded: ${isGenesisBlockDownloaded}`, ); } }; diff --git a/services/blockchain-indexer/events/blockchain.js b/services/blockchain-indexer/events/blockchain.js index 5c2ef4ffdd..8fec171341 100644 --- a/services/blockchain-indexer/events/blockchain.js +++ b/services/blockchain-indexer/events/blockchain.js @@ -35,7 +35,7 @@ module.exports = [ try { if (payload && Array.isArray(payload.data)) { const [block] = payload.data; - logger.debug(`New block arrived (${block.id})...`); + logger.debug(`Received new block (${block.id})...`); // Fork detection if (localPreviousBlockId) { if (localPreviousBlockId !== block.previousBlockId) { @@ -68,7 +68,7 @@ module.exports = [ if (numberOfTransactions > 0) { logger.debug( - `Block (${block.id}) arrived containing ${block.numberOfTransactions} new transactions.`, + `Received block (${block.id}) containing ${block.numberOfTransactions} new transactions.`, ); const formattedTransactions = await formatTransactionsInBlock(block); @@ -161,7 +161,7 @@ module.exports = [ description: 'Returns true when the index is ready', controller: callback => { const indexStatusListener = async payload => { - logger.debug("Dispatching 'index.ready' event over message broker."); + logger.debug("Dispatching 'index.ready' event to message broker."); callback(payload); }; Signals.get('blockIndexReady').add(indexStatusListener); @@ -172,21 +172,10 @@ module.exports = [ description: 'Emit index status updates.', controller: callback => { const indexStatusUpdateListener = async payload => { - logger.debug("Dispatching 'update.index.status' event over message broker."); + logger.debug("Dispatching 'update.index.status' event to message broker."); callback(payload); }; Signals.get('updateIndexStatus').add(indexStatusUpdateListener); }, }, - { - name: 'genesisBlockIndexed', - description: 'Emit event after genesis block is indexed.', - controller: callback => { - const genesisBlockIndexedListener = async () => { - logger.debug("Dispatching 'genesisBlockIndexed' event over message broker."); - callback(); - }; - Signals.get('genesisBlockIndexed').add(genesisBlockIndexedListener); - }, - }, ]; diff --git a/services/blockchain-indexer/shared/dataService/blocks.js b/services/blockchain-indexer/shared/dataService/blocks.js index 9c07ea7362..56687d3051 100644 --- a/services/blockchain-indexer/shared/dataService/blocks.js +++ b/services/blockchain-indexer/shared/dataService/blocks.js @@ -44,10 +44,10 @@ const getBlocksFromServer = async params => { meta: {}, }; - if (params.blockID) logger.debug(`Retrieved block with ID ${params.blockID} from Lisk Core.`); + if (params.blockID) logger.debug(`Retrieved block with ID ${params.blockID} from the node.`); else if (params.height) - logger.debug(`Retrieved block with height: ${params.height} from Lisk Core.`); - else logger.debug(`Retrieved block with custom search: ${util.inspect(params)} from Lisk Core.`); + logger.debug(`Retrieved block with height: ${params.height} from the node.`); + else logger.debug(`Retrieved block with custom search: ${util.inspect(params)} from the node.`); const response = await business.getBlocks(params); if (response.data) blocks.data = response.data; diff --git a/services/blockchain-indexer/shared/indexer/blockchainIndex.js b/services/blockchain-indexer/shared/indexer/blockchainIndex.js index e8a813b228..90426d405f 100644 --- a/services/blockchain-indexer/shared/indexer/blockchainIndex.js +++ b/services/blockchain-indexer/shared/indexer/blockchainIndex.js @@ -378,10 +378,6 @@ const indexBlock = async job => { logger.info( `Successfully indexed block ${blockToIndexFromNode.id} at height ${blockToIndexFromNode.height}.`, ); - - if (blockToIndexFromNode.height === genesisHeight) { - Signals.get('genesisBlockIndexed').dispatch(); - } } catch (error) { // Stop genesisAsset index progress logging on errors if (blockToIndexFromNode.height === genesisHeight) { diff --git a/services/export/jobs/purge.js b/services/export/jobs/purge.js index 1ba862fb63..d74291c3d0 100644 --- a/services/export/jobs/purge.js +++ b/services/export/jobs/purge.js @@ -28,7 +28,7 @@ module.exports = [ interval: config.job.purgeCache.interval, schedule: config.job.purgeCache.schedule, controller: () => { - logger.info('Performing cache maintenance.'); + logger.info('Running cache maintenance.'); partials.purge(); staticFiles.purge(); }, diff --git a/services/fee-estimator/shared/utils/dynamicFees.js b/services/fee-estimator/shared/utils/dynamicFees.js index 28fb85c25a..9bab3c9030 100644 --- a/services/fee-estimator/shared/utils/dynamicFees.js +++ b/services/fee-estimator/shared/utils/dynamicFees.js @@ -93,7 +93,7 @@ const getEstimateFeePerByteForBatch = async (fromHeight, toHeight, cacheKey) => await cacheRedisFees.set(cacheKey, feeEstPerByte); logger.info( - `Recalulated dynamic fees: L: ${feeEstPerByte.low} M: ${feeEstPerByte.med} H: ${feeEstPerByte.high}.`, + `Re-calulated dynamic fees: L: ${feeEstPerByte.low} M: ${feeEstPerByte.med} H: ${feeEstPerByte.high}.`, ); return feeEstPerByte; diff --git a/services/gateway/shared/ready.js b/services/gateway/shared/ready.js index 92e676b12b..687b8ec2eb 100644 --- a/services/gateway/shared/ready.js +++ b/services/gateway/shared/ready.js @@ -60,7 +60,7 @@ const getReady = () => { }); return { services: includeSvcForReadiness }; } catch (_) { - logger.error(`Current service status: ${currentSvcStatus}.`); + logger.error(`Current service status: ${JSON.stringify(currentSvcStatus, null, '\t')}`); throw new MoleculerError('Service Unavailable', 503, 'SERVICES_NOT_READY'); } }; diff --git a/services/market/jobs/pricesUpdate.js b/services/market/jobs/pricesUpdate.js index 4991e94730..a9b172b5ae 100644 --- a/services/market/jobs/pricesUpdate.js +++ b/services/market/jobs/pricesUpdate.js @@ -29,7 +29,7 @@ module.exports = [ await updatePrices(); }, controller: async () => { - logger.debug('Job scheduled to maintain updated market prices.'); + logger.debug('Job scheduled to update market prices.'); await updatePrices(); }, }, diff --git a/services/transaction-statistics/shared/buildTransactionStatistics.js b/services/transaction-statistics/shared/buildTransactionStatistics.js index cfcb9ac624..fb2523793b 100644 --- a/services/transaction-statistics/shared/buildTransactionStatistics.js +++ b/services/transaction-statistics/shared/buildTransactionStatistics.js @@ -130,7 +130,7 @@ const insertToDB = async (statsList, date) => { await transactionStatisticsTable.deleteByPrimaryKey([id]); logger.debug(`Removed the following date from the database: ${date}.`); } catch (err) { - logger.debug(`The database does not contain the entry with the following date: ${date}.`); + logger.debug(`The database does not contain an entry with the following date: ${date}.`); } statsList.map(statistic => { From 6d97ad00b3e3e6414f33358dc0510a504e729f47 Mon Sep 17 00:00:00 2001 From: Vardan Nadkarni Date: Thu, 7 Dec 2023 21:38:53 +0530 Subject: [PATCH 5/6] Updated logs --- services/blockchain-connector/shared/sdk/client.js | 6 +++--- services/fee-estimator/shared/utils/dynamicFees.js | 2 +- services/gateway/shared/ready.js | 2 +- .../shared/buildTransactionStatistics.js | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/services/blockchain-connector/shared/sdk/client.js b/services/blockchain-connector/shared/sdk/client.js index 523a2df4cf..6e3323f928 100644 --- a/services/blockchain-connector/shared/sdk/client.js +++ b/services/blockchain-connector/shared/sdk/client.js @@ -176,7 +176,7 @@ if (config.isUseLiskIPCClient) { const genesisBlockDownloadedListener = () => { triggerRegularClientLivelinessChecks(CLIENT_ALIVE_ASSUMPTION_TIME_BEFORE_GENESIS); logger.info( - `Updated node liveliness check to occur to every ${CLIENT_ALIVE_ASSUMPTION_TIME_BEFORE_GENESIS} seconds. Will update again after checking of genesis block is indexed.`, + `API client heartbeat checks scheduled every ${CLIENT_ALIVE_ASSUMPTION_TIME_BEFORE_GENESIS}ms. The frequency will be set to ${CLIENT_ALIVE_ASSUMPTION_TIME}ms after successful indexing of the genesis block.`, ); }; @@ -184,13 +184,13 @@ if (config.isUseLiskIPCClient) { if ( !isGenesisBlockIndexed && indexStatus.data && - indexStatus.data.genesisHeight < indexStatus.data.lastIndexedBlockHeight + indexStatus.data.genesisHeight <= indexStatus.data.lastIndexedBlockHeight ) { clearInterval(intervalTimeout); triggerRegularClientLivelinessChecks(CLIENT_ALIVE_ASSUMPTION_TIME); isGenesisBlockIndexed = true; logger.info( - `Updated node liveliness check to occur to every ${CLIENT_ALIVE_ASSUMPTION_TIME} seconds since genesis block is indexed.`, + `API client heartbeat checks re-scheduled to run every ${CLIENT_ALIVE_ASSUMPTION_TIME_BEFORE_GENESIS}ms.`, ); } }; diff --git a/services/fee-estimator/shared/utils/dynamicFees.js b/services/fee-estimator/shared/utils/dynamicFees.js index 9bab3c9030..827490d024 100644 --- a/services/fee-estimator/shared/utils/dynamicFees.js +++ b/services/fee-estimator/shared/utils/dynamicFees.js @@ -93,7 +93,7 @@ const getEstimateFeePerByteForBatch = async (fromHeight, toHeight, cacheKey) => await cacheRedisFees.set(cacheKey, feeEstPerByte); logger.info( - `Re-calulated dynamic fees: L: ${feeEstPerByte.low} M: ${feeEstPerByte.med} H: ${feeEstPerByte.high}.`, + `Re-calculated dynamic fees: L: ${feeEstPerByte.low} M: ${feeEstPerByte.med} H: ${feeEstPerByte.high}.`, ); return feeEstPerByte; diff --git a/services/gateway/shared/ready.js b/services/gateway/shared/ready.js index 687b8ec2eb..8b19d5fcfb 100644 --- a/services/gateway/shared/ready.js +++ b/services/gateway/shared/ready.js @@ -60,7 +60,7 @@ const getReady = () => { }); return { services: includeSvcForReadiness }; } catch (_) { - logger.error(`Current service status: ${JSON.stringify(currentSvcStatus, null, '\t')}`); + logger.error(`Current service status:\n${JSON.stringify(currentSvcStatus, null, '\t')}`); throw new MoleculerError('Service Unavailable', 503, 'SERVICES_NOT_READY'); } }; diff --git a/services/transaction-statistics/shared/buildTransactionStatistics.js b/services/transaction-statistics/shared/buildTransactionStatistics.js index fb2523793b..b42e84a3d2 100644 --- a/services/transaction-statistics/shared/buildTransactionStatistics.js +++ b/services/transaction-statistics/shared/buildTransactionStatistics.js @@ -130,7 +130,7 @@ const insertToDB = async (statsList, date) => { await transactionStatisticsTable.deleteByPrimaryKey([id]); logger.debug(`Removed the following date from the database: ${date}.`); } catch (err) { - logger.debug(`The database does not contain an entry with the following date: ${date}.`); + logger.debug(`The database does not contain an entry for the following date: ${date}.`); } statsList.map(statistic => { From b617395d91ff38e15efced6d3455b3e8f106db59 Mon Sep 17 00:00:00 2001 From: Sameer Date: Thu, 7 Dec 2023 21:41:16 +0530 Subject: [PATCH 6/6] Update services/blockchain-connector/shared/sdk/client.js --- services/blockchain-connector/shared/sdk/client.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/blockchain-connector/shared/sdk/client.js b/services/blockchain-connector/shared/sdk/client.js index 6e3323f928..8e69c8ebe7 100644 --- a/services/blockchain-connector/shared/sdk/client.js +++ b/services/blockchain-connector/shared/sdk/client.js @@ -190,7 +190,7 @@ if (config.isUseLiskIPCClient) { triggerRegularClientLivelinessChecks(CLIENT_ALIVE_ASSUMPTION_TIME); isGenesisBlockIndexed = true; logger.info( - `API client heartbeat checks re-scheduled to run every ${CLIENT_ALIVE_ASSUMPTION_TIME_BEFORE_GENESIS}ms.`, + `API client heartbeat checks re-scheduled to run every ${CLIENT_ALIVE_ASSUMPTION_TIME}ms.`, ); } };