From c6b723421d4e13c991989a399e373f808043a8ee Mon Sep 17 00:00:00 2001 From: Djordje Kovacevic Date: Tue, 16 Jan 2024 12:04:50 +0100 Subject: [PATCH] Version updated, update commit delay between nodes set to 5, updated error messages for transaction sending --- package-lock.json | 4 ++-- package.json | 2 +- src/commands/protocols/common/submit-commit-command.js | 10 ++++------ src/commands/protocols/common/submit-proofs-command.js | 8 ++++---- .../update/receiver/submit-update-commit-command.js | 4 ++-- .../v1.0.0/v1-0-0-handle-update-request-command.js | 2 +- src/constants/constants.js | 2 +- 7 files changed, 15 insertions(+), 17 deletions(-) diff --git a/package-lock.json b/package-lock.json index 22def46834..8e19c69950 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "origintrail_node", - "version": "6.1.3+hotfix.1", + "version": "6.1.3", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "origintrail_node", - "version": "6.1.3+hotfix.1", + "version": "6.1.3", "license": "ISC", "dependencies": { "@comunica/query-sparql": "^2.4.3", diff --git a/package.json b/package.json index 8dcd03151d..a47456623b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "origintrail_node", - "version": "6.1.3+hotfix.1", + "version": "6.1.3", "description": "OTNode V6", "main": "index.js", "type": "module", diff --git a/src/commands/protocols/common/submit-commit-command.js b/src/commands/protocols/common/submit-commit-command.js index 61bdc85712..d7a703d95e 100644 --- a/src/commands/protocols/common/submit-commit-command.js +++ b/src/commands/protocols/common/submit-commit-command.js @@ -131,12 +131,11 @@ class SubmitCommitCommand extends Command { `Retry number: ${COMMAND_RETRIES.SUBMIT_COMMIT - command.retries + 1}.`, ); this.operationIdService.emitChangeEvent( - ERROR_TYPE.COMMIT_PROOF.SUBMIT_COMMIT_SEND_TX_ERROR, + OPERATION_ID_STATUS.FAILED, sendSubmitCommitTransactionOperationId, blockchain, error.message, - this.errorType, - operationId, + ERROR_TYPE.COMMIT_PROOF.SUBMIT_COMMIT_SEND_TX_ERROR, ); let newGasPrice; if ( @@ -178,12 +177,11 @@ class SubmitCommitCommand extends Command { } else { msgBase = 'Node has already submitted commit. Finishing'; this.operationIdService.emitChangeEvent( - ERROR_TYPE.COMMIT_PROOF.SUBMIT_COMMIT_SEND_TX_ERROR, + OPERATION_ID_STATUS.FAILED, sendSubmitCommitTransactionOperationId, blockchain, msgBase, - this.errorType, - operationId, + ERROR_TYPE.COMMIT_PROOF.SUBMIT_COMMIT_SEND_TX_ERROR, ); } diff --git a/src/commands/protocols/common/submit-proofs-command.js b/src/commands/protocols/common/submit-proofs-command.js index a6e30ae014..2f77239ff4 100644 --- a/src/commands/protocols/common/submit-proofs-command.js +++ b/src/commands/protocols/common/submit-proofs-command.js @@ -181,11 +181,11 @@ class SubmitProofsCommand extends Command { `Retry number: ${COMMAND_RETRIES.SUBMIT_PROOFS - command.retries + 1}.`, ); this.operationIdService.emitChangeEvent( - ERROR_TYPE.COMMIT_PROOF.SUBMIT_PROOFS_SEND_TX_ERROR, + OPERATION_ID_STATUS.FAILED, sendSubmitProofsTransactionOperationId, blockchain, error.message, - this.errorType, + ERROR_TYPE.COMMIT_PROOF.SUBMIT_PROOFS_SEND_TX_ERROR, ); let newGasPrice; if ( @@ -226,11 +226,11 @@ class SubmitProofsCommand extends Command { } else { msgBase = 'Node has already sent proof. Finishing'; this.operationIdService.emitChangeEvent( - ERROR_TYPE.COMMIT_PROOF.SUBMIT_PROOFS_SEND_TX_ERROR, + OPERATION_ID_STATUS.FAILED, sendSubmitProofsTransactionOperationId, blockchain, msgBase, - this.errorType, + ERROR_TYPE.COMMIT_PROOF.SUBMIT_COMMIT_SEND_TX_ERROR, ); } diff --git a/src/commands/protocols/update/receiver/submit-update-commit-command.js b/src/commands/protocols/update/receiver/submit-update-commit-command.js index 97fd7dd87f..64d81de6d2 100644 --- a/src/commands/protocols/update/receiver/submit-update-commit-command.js +++ b/src/commands/protocols/update/receiver/submit-update-commit-command.js @@ -116,11 +116,11 @@ class SubmitUpdateCommitCommand extends Command { }.`, ); this.operationIdService.emitChangeEvent( - ERROR_TYPE.COMMIT_PROOF.SUBMIT_UPDATE_COMMIT_SEND_TX_ERROR, + OPERATION_ID_STATUS.FAILED, sendSubmitUpdateCommitTransactionOperationId, blockchain, error.message, - this.errorType, + ERROR_TYPE.COMMIT_PROOF.SUBMIT_UPDATE_COMMIT_SEND_TX_ERROR, ); let newGasPrice; if ( diff --git a/src/commands/protocols/update/receiver/v1.0.0/v1-0-0-handle-update-request-command.js b/src/commands/protocols/update/receiver/v1.0.0/v1-0-0-handle-update-request-command.js index c02ae88649..3f82ad11df 100644 --- a/src/commands/protocols/update/receiver/v1.0.0/v1-0-0-handle-update-request-command.js +++ b/src/commands/protocols/update/receiver/v1.0.0/v1-0-0-handle-update-request-command.js @@ -131,7 +131,7 @@ class HandleUpdateRequestCommand extends HandleProtocolMessageCommand { // wait for 5 blocks for first batch to send commits const commitsBlockDuration = blockTime * COMMIT_BLOCK_DURATION_IN_BLOCKS; const commitBlock = Math.floor(rank / finalizationCommitsNumber); - // put 2 blocks delay between nodes if they are not in first batch + // put 5 blocks delay between nodes if they are not in first batch const nextNodeDelay = commitBlock === 0 ? 0 diff --git a/src/constants/constants.js b/src/constants/constants.js index da56d038a7..6a0d897a6c 100644 --- a/src/constants/constants.js +++ b/src/constants/constants.js @@ -29,7 +29,7 @@ export const PRIVATE_ASSERTION_PREDICATE = export const COMMIT_BLOCK_DURATION_IN_BLOCKS = 5; -export const COMMITS_DELAY_BETWEEN_NODES_IN_BLOCKS = 2; +export const COMMITS_DELAY_BETWEEN_NODES_IN_BLOCKS = 5; export const TRANSACTION_POLLING_TIMEOUT_MILLIS = 300 * 1000;