Skip to content

Commit

Permalink
Version updated, update commit delay between nodes set to 5, updated …
Browse files Browse the repository at this point in the history
…error messages for transaction sending
  • Loading branch information
djordjekovac committed Jan 16, 2024
1 parent 824b2de commit c6b7234
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 17 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
10 changes: 4 additions & 6 deletions src/commands/protocols/common/submit-commit-command.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down Expand Up @@ -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,
);
}

Expand Down
8 changes: 4 additions & 4 deletions src/commands/protocols/common/submit-proofs-command.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down Expand Up @@ -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,
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/constants/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit c6b7234

Please sign in to comment.