Skip to content
This repository has been archived by the owner on Jun 11, 2024. It is now read-only.

Commit

Permalink
📦 Update Lisk SDK to v6.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
sameersubudhi committed Nov 25, 2023
2 parents c9b15ec + 264b4b6 commit 1bf2276
Show file tree
Hide file tree
Showing 37 changed files with 116 additions and 104 deletions.
2 changes: 2 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,8 @@ services:
- SERVICE_LOG_GELF=${SERVICE_LOG_GELF}
- SERVICE_LOG_FILE=${SERVICE_LOG_FILE}
- DOCKER_HOST=${DOCKER_HOST}
- INDEX_MISSING_BLOCKS_SKIP_THRESHOLD=${INDEX_MISSING_BLOCKS_SKIP_THRESHOLD}
- INDEX_MISSING_BLOCKS_MAX_SCHEDULE=${INDEX_MISSING_BLOCKS_MAX_SCHEDULE}
- JOB_INTERVAL_INDEX_MISSING_BLOCKS=${JOB_INTERVAL_INDEX_MISSING_BLOCKS}
- JOB_SCHEDULE_INDEX_MISSING_BLOCKS=${JOB_SCHEDULE_INDEX_MISSING_BLOCKS}
restart: always
Expand Down
4 changes: 3 additions & 1 deletion docker/example.env
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,9 @@ ENABLE_PERSIST_EVENTS=false
# JOB_INTERVAL_TRIGGER_ACCOUNT_UPDATES=0
# JOB_SCHEDULE_TRIGGER_ACCOUNT_UPDATES='*/15 * * * *'

## Lisk Service Blockchain Connector
## Lisk Service Blockchain Coordinator
# INDEX_MISSING_BLOCKS_SKIP_THRESHOLD=1000
# INDEX_MISSING_BLOCKS_MAX_SCHEDULE=25000
# JOB_INTERVAL_INDEX_MISSING_BLOCKS=0
# JOB_SCHEDULE_INDEX_MISSING_BLOCKS='*/15 * * * *'

Expand Down
2 changes: 2 additions & 0 deletions ecosystem.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,8 @@ module.exports = {
// SERVICE_LOG_GELF: false,
// SERVICE_LOG_FILE: false,
// DOCKER_HOST: 'local',
// INDEX_MISSING_BLOCKS_SKIP_THRESHOLD: 1000,
// INDEX_MISSING_BLOCKS_MAX_SCHEDULE: 25000,
// JOB_INTERVAL_INDEX_MISSING_BLOCKS: 0,
// JOB_SCHEDULE_INDEX_MISSING_BLOCKS: '*/15 * * * *',
},
Expand Down
Binary file added framework/dist/lisk-service-framework-1.6.8.tgz
Binary file not shown.
2 changes: 1 addition & 1 deletion framework/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "lisk-service-framework",
"version": "1.6.7",
"version": "1.6.8",
"description": "Lisk Service Framework",
"keywords": [
"lisk",
Expand Down
1 change: 0 additions & 1 deletion framework/src/database/mysql/mysql.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ const createTableIfNotExists = async (tableConfig, connEndpoint = CONN_ENDPOINT_
const connPoolKeyTable = `${connPoolKey}/${tableName}`;

if (!tablePool[connPoolKeyTable]) {
logger.info(`Creating schema for ${tableName}.`);
const knex = await getDBConnection(connEndpoint);
await util.loadSchema(knex, tableName, tableConfig);
tablePool[connPoolKeyTable] = true;
Expand Down
1 change: 0 additions & 1 deletion framework/src/database/sqlite3.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ const createTableIfNotExists = async tableConfig => {
const { tableName } = tableConfig;

if (!tablePool[tableName]) {
logger.info(`Creating schema for ${tableName}`);
const knex = await getDBConnection(tableName);
await util.loadSchema(knex, tableName, tableConfig);
tablePool[tableName] = true;
Expand Down
1 change: 1 addition & 0 deletions framework/src/database/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ const loadSchema = async (knex, tableName, tableConfig) => {
});
table.primary(primaryKey);
})
.then(() => logger.info(`Successfully created table: ${tableName}.`))
.catch(err => {
if (err.message.includes(`Table '${tableName}' already exists`)) return;
throw err;
Expand Down
6 changes: 3 additions & 3 deletions framework/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1323,9 +1323,9 @@ ee-first@1.1.1:
integrity sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==

electron-to-chromium@^1.4.535:
version "1.4.590"
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.590.tgz#85a428fbabb77265a4804040837ed4f2538e3300"
integrity sha512-hohItzsQcG7/FBsviCYMtQwUSWvVF7NVqPOnJCErWsAshsP/CR2LAXdmq276RbESNdhxiAq5/vRo1g2pxGXVww==
version "1.4.592"
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.592.tgz#1ffd49ba3da3da3077ea20014b066c910d50c913"
integrity sha512-D3NOkROIlF+d5ixnz7pAf3Lu/AuWpd6AYgI9O67GQXMXTcCP1gJQRotOq35eQy5Sb4hez33XH1YdTtILA7Udww==

emittery@^0.13.1:
version "0.13.1"
Expand Down
2 changes: 1 addition & 1 deletion services/blockchain-app-registry/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
},
"dependencies": {
"bluebird": "^3.7.2",
"lisk-service-framework": "https://github.com/LiskHQ/lisk-service/raw/d9441f2f57276ae153e47f838c4de698a26fa1d4/framework/dist/lisk-service-framework-1.6.7.tgz",
"lisk-service-framework": "https://github.com/LiskHQ/lisk-service/raw/165726cfb41bd13c7815c767d9915a45c054a85d/framework/dist/lisk-service-framework-1.6.8.tgz",
"lodash": "^4.17.21",
"octokit": "^2.0.4",
"tar": "^6.1.11"
Expand Down
18 changes: 9 additions & 9 deletions services/blockchain-app-registry/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -821,9 +821,9 @@
integrity sha512-+9jVqKhRSpsc591z5vX+X5Yyw+he/HCB4iQ/RYxw35CEPaY1gnsNE43nf9n9AaYjAQrTiI/mOwKUKdUs9vf7Xg==

"@types/aws-lambda@^8.10.83":
version "8.10.128"
resolved "https://registry.yarnpkg.com/@types/aws-lambda/-/aws-lambda-8.10.128.tgz#1c26e3e062e33961b250355cb4c9b6b3544b74a9"
integrity sha512-bw4+ORfyywsj9Tq3WJA9j6HG4EbYy+dz+k8LN73ApmwjTdf82ZCSELz3b7BJQzeG5HE8IaTy9SXTHmruIK5ZlQ==
version "8.10.129"
resolved "https://registry.yarnpkg.com/@types/aws-lambda/-/aws-lambda-8.10.129.tgz#c4e040778a13b70a9cdf8ad54c1b853c94e2a44d"
integrity sha512-0Rl7CpTPVws5cp0Ui1gZh4Q+TXC65bXVwTOGoI2RKW45dxWzyZGbjIX0uFjFYdIJ8vnD45y584rIIqvD2vBBfQ==

"@types/babel__core@^7.1.14":
version "7.20.5"
Expand Down Expand Up @@ -1601,9 +1601,9 @@ ee-first@1.1.1:
integrity sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==

electron-to-chromium@^1.4.535:
version "1.4.590"
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.590.tgz#85a428fbabb77265a4804040837ed4f2538e3300"
integrity sha512-hohItzsQcG7/FBsviCYMtQwUSWvVF7NVqPOnJCErWsAshsP/CR2LAXdmq276RbESNdhxiAq5/vRo1g2pxGXVww==
version "1.4.592"
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.592.tgz#1ffd49ba3da3da3077ea20014b066c910d50c913"
integrity sha512-D3NOkROIlF+d5ixnz7pAf3Lu/AuWpd6AYgI9O67GQXMXTcCP1gJQRotOq35eQy5Sb4hez33XH1YdTtILA7Udww==

emittery@^0.13.1:
version "0.13.1"
Expand Down Expand Up @@ -2920,9 +2920,9 @@ lines-and-columns@^1.1.6:
resolved "https://registry.yarnpkg.com/lines-and-columns/-/lines-and-columns-1.2.4.tgz#eca284f75d2965079309dc0ad9255abb2ebc1632"
integrity sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==

"lisk-service-framework@https://github.com/LiskHQ/lisk-service/raw/d9441f2f57276ae153e47f838c4de698a26fa1d4/framework/dist/lisk-service-framework-1.6.7.tgz":
version "1.6.7"
resolved "https://github.com/LiskHQ/lisk-service/raw/d9441f2f57276ae153e47f838c4de698a26fa1d4/framework/dist/lisk-service-framework-1.6.7.tgz#6e1437b3532f89d3a81a28fc1baabe497d04a601"
"lisk-service-framework@https://github.com/LiskHQ/lisk-service/raw/165726cfb41bd13c7815c767d9915a45c054a85d/framework/dist/lisk-service-framework-1.6.8.tgz":
version "1.6.8"
resolved "https://github.com/LiskHQ/lisk-service/raw/165726cfb41bd13c7815c767d9915a45c054a85d/framework/dist/lisk-service-framework-1.6.8.tgz#01a912cd445e5206fab4a6a960f344efffc965d9"
dependencies:
"@keyv/redis" "^2.1.2"
"@log4js-node/gelf" "github:MichalTuleja/log4js-node-gelf#89d9933"
Expand Down
2 changes: 1 addition & 1 deletion services/blockchain-connector/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"big-json": "^3.1.0",
"bluebird": "^3.7.2",
"knex": "^2.4.0",
"lisk-service-framework": "https://github.com/LiskHQ/lisk-service/raw/d9441f2f57276ae153e47f838c4de698a26fa1d4/framework/dist/lisk-service-framework-1.6.7.tgz",
"lisk-service-framework": "https://github.com/LiskHQ/lisk-service/raw/165726cfb41bd13c7815c767d9915a45c054a85d/framework/dist/lisk-service-framework-1.6.8.tgz",
"moment": "^2.29.4",
"signals": "^1.0.0",
"tar": "^6.1.11"
Expand Down
12 changes: 6 additions & 6 deletions services/blockchain-connector/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2383,9 +2383,9 @@ ee-first@1.1.1:
integrity sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=

electron-to-chromium@^1.4.535:
version "1.4.590"
resolved "https://npm.lisk.com/electron-to-chromium/-/electron-to-chromium-1.4.590.tgz#85a428fbabb77265a4804040837ed4f2538e3300"
integrity sha512-hohItzsQcG7/FBsviCYMtQwUSWvVF7NVqPOnJCErWsAshsP/CR2LAXdmq276RbESNdhxiAq5/vRo1g2pxGXVww==
version "1.4.592"
resolved "https://npm.lisk.com/electron-to-chromium/-/electron-to-chromium-1.4.592.tgz#1ffd49ba3da3da3077ea20014b066c910d50c913"
integrity sha512-D3NOkROIlF+d5ixnz7pAf3Lu/AuWpd6AYgI9O67GQXMXTcCP1gJQRotOq35eQy5Sb4hez33XH1YdTtILA7Udww==

emittery@^0.13.1:
version "0.13.1"
Expand Down Expand Up @@ -3889,9 +3889,9 @@ lines-and-columns@^1.1.6:
resolved "https://npm.lisk.com/lines-and-columns/-/lines-and-columns-1.2.4.tgz#eca284f75d2965079309dc0ad9255abb2ebc1632"
integrity sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==

"lisk-service-framework@https://github.com/LiskHQ/lisk-service/raw/d9441f2f57276ae153e47f838c4de698a26fa1d4/framework/dist/lisk-service-framework-1.6.7.tgz":
version "1.6.7"
resolved "https://github.com/LiskHQ/lisk-service/raw/d9441f2f57276ae153e47f838c4de698a26fa1d4/framework/dist/lisk-service-framework-1.6.7.tgz#6e1437b3532f89d3a81a28fc1baabe497d04a601"
"lisk-service-framework@https://github.com/LiskHQ/lisk-service/raw/165726cfb41bd13c7815c767d9915a45c054a85d/framework/dist/lisk-service-framework-1.6.8.tgz":
version "1.6.8"
resolved "https://github.com/LiskHQ/lisk-service/raw/165726cfb41bd13c7815c767d9915a45c054a85d/framework/dist/lisk-service-framework-1.6.8.tgz#01a912cd445e5206fab4a6a960f344efffc965d9"
dependencies:
"@keyv/redis" "^2.1.2"
"@log4js-node/gelf" "github:MichalTuleja/log4js-node-gelf#89d9933"
Expand Down
1 change: 1 addition & 0 deletions services/blockchain-coordinator/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ config.job = {
interval: process.env.JOB_INTERVAL_INDEX_MISSING_BLOCKS || 0,
schedule: process.env.JOB_SCHEDULE_INDEX_MISSING_BLOCKS || '*/15 * * * *',
skipThreshold: process.env.INDEX_MISSING_BLOCKS_SKIP_THRESHOLD || 1000,
maxBlocksToSchedule: process.env.INDEX_MISSING_BLOCKS_MAX_SCHEDULE || 25000,
},
};

Expand Down
2 changes: 1 addition & 1 deletion services/blockchain-coordinator/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"dependencies": {
"bluebird": "^3.7.2",
"bull": "^4.8.1",
"lisk-service-framework": "https://github.com/LiskHQ/lisk-service/raw/d9441f2f57276ae153e47f838c4de698a26fa1d4/framework/dist/lisk-service-framework-1.6.7.tgz"
"lisk-service-framework": "https://github.com/LiskHQ/lisk-service/raw/165726cfb41bd13c7815c767d9915a45c054a85d/framework/dist/lisk-service-framework-1.6.8.tgz"
},
"devDependencies": {
"@babel/preset-env": "^7.14.0",
Expand Down
5 changes: 3 additions & 2 deletions services/blockchain-coordinator/shared/eventsScheduler.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,10 @@ const eventMessageQueue = new MessageQueue(config.queue.event.name, config.endpo
});

const scheduleUpdatesOnNewBlock = async block => {
logger.debug(`Scheduling indexing new block at height: ${block.height}.`);
const { header } = block;
logger.debug(`Scheduling indexing new block at height: ${header.height}.`);
await eventMessageQueue.add({ block, isNewBlock: true });
logger.info(`Finished scheduling indexing new block at height: ${block.height}.`);
logger.info(`Finished scheduling indexing new block at height: ${header.height}.`);
};

const scheduleDeleteBlock = async payload => {
Expand Down
13 changes: 7 additions & 6 deletions services/blockchain-coordinator/shared/scheduler.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ const accountMessageQueue = new MessageQueue(

let intervalID;
const REFRESH_INTERVAL = 30000;
const MAX_BLOCKS_TO_SCHEDULE = 10000;

const getInProgressJobCount = async queue => {
const jobCount = await queue.getJobCounts();
Expand Down Expand Up @@ -245,13 +244,13 @@ const scheduleMissingBlocksIndexing = async () => {
// Lowest and highest block heights expected to be indexed
const blockIndexLowerRange = lastVerifiedHeight;
const blockIndexHigherRange = Math.min(
blockIndexLowerRange + MAX_BLOCKS_TO_SCHEDULE,
blockIndexLowerRange + config.job.indexMissingBlocks.maxBlocksToSchedule,
currentHeight,
);

try {
const missingBlocksByHeight = [];
const MAX_QUERY_RANGE = 25000;
const MAX_QUERY_RANGE = 10000;
const NUM_BATCHES = Math.ceil((blockIndexHigherRange - blockIndexLowerRange) / MAX_QUERY_RANGE);

// Batch into smaller ranges to avoid microservice/DB query timeouts
Expand All @@ -267,9 +266,11 @@ const scheduleMissingBlocksIndexing = async () => {
const lastIndexVerifiedHeight = await getIndexVerifiedHeight();
if (batchEndHeight <= lastIndexVerifiedHeight + MAX_QUERY_RANGE) {
await setIndexVerifiedHeight(batchEndHeight);
logger.info(
`No missing blocks found in range ${batchStartHeight} - ${batchEndHeight}. Setting index verified height to ${batchEndHeight}.`,
);
if (NUM_BATCHES > 1 && i < NUM_BATCHES - 1) {
logger.info(
`No missing blocks found in range ${batchStartHeight} - ${batchEndHeight}. Setting index verified height to ${batchEndHeight}.`,
);
}
}
}
}
Expand Down
12 changes: 6 additions & 6 deletions services/blockchain-coordinator/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2128,9 +2128,9 @@ ee-first@1.1.1:
integrity sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==

electron-to-chromium@^1.4.535:
version "1.4.590"
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.590.tgz#85a428fbabb77265a4804040837ed4f2538e3300"
integrity sha512-hohItzsQcG7/FBsviCYMtQwUSWvVF7NVqPOnJCErWsAshsP/CR2LAXdmq276RbESNdhxiAq5/vRo1g2pxGXVww==
version "1.4.592"
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.592.tgz#1ffd49ba3da3da3077ea20014b066c910d50c913"
integrity sha512-D3NOkROIlF+d5ixnz7pAf3Lu/AuWpd6AYgI9O67GQXMXTcCP1gJQRotOq35eQy5Sb4hez33XH1YdTtILA7Udww==

emittery@^0.13.1:
version "0.13.1"
Expand Down Expand Up @@ -3466,9 +3466,9 @@ lines-and-columns@^1.1.6:
resolved "https://registry.yarnpkg.com/lines-and-columns/-/lines-and-columns-1.2.4.tgz#eca284f75d2965079309dc0ad9255abb2ebc1632"
integrity sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==

"lisk-service-framework@https://github.com/LiskHQ/lisk-service/raw/d9441f2f57276ae153e47f838c4de698a26fa1d4/framework/dist/lisk-service-framework-1.6.7.tgz":
version "1.6.7"
resolved "https://github.com/LiskHQ/lisk-service/raw/d9441f2f57276ae153e47f838c4de698a26fa1d4/framework/dist/lisk-service-framework-1.6.7.tgz#6e1437b3532f89d3a81a28fc1baabe497d04a601"
"lisk-service-framework@https://github.com/LiskHQ/lisk-service/raw/165726cfb41bd13c7815c767d9915a45c054a85d/framework/dist/lisk-service-framework-1.6.8.tgz":
version "1.6.8"
resolved "https://github.com/LiskHQ/lisk-service/raw/165726cfb41bd13c7815c767d9915a45c054a85d/framework/dist/lisk-service-framework-1.6.8.tgz#01a912cd445e5206fab4a6a960f344efffc965d9"
dependencies:
"@keyv/redis" "^2.1.2"
"@log4js-node/gelf" "github:MichalTuleja/log4js-node-gelf#89d9933"
Expand Down
2 changes: 1 addition & 1 deletion services/blockchain-indexer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"bull": "^4.8.1",
"camelcase": "^6.3.0",
"ioredis": "^4.28.5",
"lisk-service-framework": "https://github.com/LiskHQ/lisk-service/raw/d9441f2f57276ae153e47f838c4de698a26fa1d4/framework/dist/lisk-service-framework-1.6.7.tgz",
"lisk-service-framework": "https://github.com/LiskHQ/lisk-service/raw/165726cfb41bd13c7815c767d9915a45c054a85d/framework/dist/lisk-service-framework-1.6.8.tgz",
"lodash": "^4.17.21",
"require-all": "^3.0.0"
},
Expand Down
2 changes: 1 addition & 1 deletion services/blockchain-indexer/shared/dataService/blocks.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ const formatBlock = async (blockInfo, isDeletedBlock = false) => {

const response = await business.formatBlock(
{
header: {},
header: blockInfo.header || {},
assets: blockInfo.assets || [],
transactions: blockInfo.transactions || [],
},
Expand Down
18 changes: 11 additions & 7 deletions services/blockchain-indexer/shared/indexer/blockchainIndex.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,11 +153,9 @@ const indexBlock = async job => {

const { height: lastIndexedHeight } = lastIndexedBlock;

// Index last indexed block height + 1 and schedule the next block if there is a gap
// Index last indexed blockHeight + 1
if (lastIndexedHeight && lastIndexedHeight < blockHeightFromJobData - 1) {
blockHeightToIndex = lastIndexedHeight + 1;
// eslint-disable-next-line no-use-before-define
await addHeightToIndexBlocksQueue(blockHeightToIndex + 1);
}

const [currentBlockInDB = {}] = await blocksTable.find(
Expand Down Expand Up @@ -398,7 +396,9 @@ const indexBlock = async job => {
if (dbTrx) {
await rollbackDBTransaction(dbTrx);
logger.debug(
`Rolled back MySQL transaction to index block ${failedBlockInfo.id} at height ${failedBlockInfo.height}.`,
failedBlockInfo.id
? `Rolled back MySQL transaction to index block ${failedBlockInfo.id} at height ${failedBlockInfo.height}.`
: `Rolled back MySQL transaction to index block at height ${failedBlockInfo.height}.`,
);

// Add safety check to ensure that the DB transaction is rolled back successfully
Expand All @@ -413,15 +413,19 @@ const indexBlock = async job => {
error.message.includes(e),
)
) {
const errMessage = `Deadlock encountered while indexing block ${failedBlockInfo.id} at height ${failedBlockInfo.height}. Will retry.`;
const errMessage = failedBlockInfo.id
? `Deadlock encountered while indexing block ${failedBlockInfo.id} at height ${failedBlockInfo.height}. Will retry.`
: `Deadlock encountered while indexing block at height ${failedBlockInfo.height}. Will retry.`;
logger.warn(errMessage);
logger.debug(`SQL query: ${error.sql}`);

throw new Error(errMessage);
}

logger.warn(
`Error occurred while indexing block ${failedBlockInfo.id} at height ${failedBlockInfo.height}. Will retry.`,
failedBlockInfo.id
? `Error occurred while indexing block ${failedBlockInfo.id} at height ${failedBlockInfo.height}. Will retry.`
: `Error occurred while indexing block at height ${failedBlockInfo.height}. Will retry.`,
);
logger.debug(error.stack);
throw error;
Expand Down Expand Up @@ -789,7 +793,7 @@ const findMissingBlocksInRange = async (fromHeight, toHeight) => {

const missingBlocksQueryStatement = `
SELECT
(SELECT COALESCE(MAX(b0.height), ${batchStartHeight}) FROM blocks b0 WHERE b0.height < b1.height) AS 'from',
(SELECT COALESCE(MAX(b0.height + 1), ${batchStartHeight}) FROM blocks b0 WHERE b0.height < b1.height) AS 'from',
(b1.height - 1) AS 'to'
FROM blocks b1
WHERE b1.height BETWEEN ${batchStartHeight} + 1 AND ${batchEndHeight}
Expand Down
4 changes: 2 additions & 2 deletions services/blockchain-indexer/shared/messageProcessor.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,15 +76,15 @@ const initQueueStatus = async () => {
};

const newBlockProcessor = async block => {
logger.debug(`New block (${block.id}) received at height ${block.height}.`);
logger.debug(`New block (${block.header.id}) received at height ${block.header.height}.`);
const response = await formatBlock(block);
const [newBlock] = response.data;

await indexNewBlock(newBlock);
await performLastBlockUpdate(newBlock);
Signals.get('newBlock').dispatch(response);
logger.info(
`Finished scheduling new block (${block.id}) event for the block at height ${block.height}.`,
`Finished scheduling new block (${block.header.id}) event for the block at height ${block.header.height}.`,
);
};

Expand Down
12 changes: 6 additions & 6 deletions services/blockchain-indexer/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2260,9 +2260,9 @@ ee-first@1.1.1:
integrity sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==

electron-to-chromium@^1.4.535:
version "1.4.590"
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.590.tgz#85a428fbabb77265a4804040837ed4f2538e3300"
integrity sha512-hohItzsQcG7/FBsviCYMtQwUSWvVF7NVqPOnJCErWsAshsP/CR2LAXdmq276RbESNdhxiAq5/vRo1g2pxGXVww==
version "1.4.592"
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.592.tgz#1ffd49ba3da3da3077ea20014b066c910d50c913"
integrity sha512-D3NOkROIlF+d5ixnz7pAf3Lu/AuWpd6AYgI9O67GQXMXTcCP1gJQRotOq35eQy5Sb4hez33XH1YdTtILA7Udww==

emittery@^0.13.1:
version "0.13.1"
Expand Down Expand Up @@ -3622,9 +3622,9 @@ lines-and-columns@^1.1.6:
resolved "https://registry.yarnpkg.com/lines-and-columns/-/lines-and-columns-1.2.4.tgz#eca284f75d2965079309dc0ad9255abb2ebc1632"
integrity sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==

"lisk-service-framework@https://github.com/LiskHQ/lisk-service/raw/d9441f2f57276ae153e47f838c4de698a26fa1d4/framework/dist/lisk-service-framework-1.6.7.tgz":
version "1.6.7"
resolved "https://github.com/LiskHQ/lisk-service/raw/d9441f2f57276ae153e47f838c4de698a26fa1d4/framework/dist/lisk-service-framework-1.6.7.tgz#6e1437b3532f89d3a81a28fc1baabe497d04a601"
"lisk-service-framework@https://github.com/LiskHQ/lisk-service/raw/165726cfb41bd13c7815c767d9915a45c054a85d/framework/dist/lisk-service-framework-1.6.8.tgz":
version "1.6.8"
resolved "https://github.com/LiskHQ/lisk-service/raw/165726cfb41bd13c7815c767d9915a45c054a85d/framework/dist/lisk-service-framework-1.6.8.tgz#01a912cd445e5206fab4a6a960f344efffc965d9"
dependencies:
"@keyv/redis" "^2.1.2"
"@log4js-node/gelf" "github:MichalTuleja/log4js-node-gelf#89d9933"
Expand Down
2 changes: 1 addition & 1 deletion services/export/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"bull": "^3.29.2",
"exceljs": "^4.3.0",
"json2csv": "^5.0.6",
"lisk-service-framework": "https://github.com/LiskHQ/lisk-service/raw/d9441f2f57276ae153e47f838c4de698a26fa1d4/framework/dist/lisk-service-framework-1.6.7.tgz",
"lisk-service-framework": "https://github.com/LiskHQ/lisk-service/raw/165726cfb41bd13c7815c767d9915a45c054a85d/framework/dist/lisk-service-framework-1.6.8.tgz",
"minio": "^7.0.21",
"moment": "^2.29.4",
"moment-range": "^4.0.2",
Expand Down
Loading

0 comments on commit 1bf2276

Please sign in to comment.