Skip to content

Commit

Permalink
Merge pull request #2741 from OriginTrail/fix/transactions-timeout
Browse files Browse the repository at this point in the history
Fix/transactions timeout
  • Loading branch information
u-hubar authored Nov 3, 2023
2 parents 386b109 + d556a6d commit a4d80c7
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 30 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.0.16",
"version": "6.0.17",
"description": "OTNode V6",
"main": "index.js",
"type": "module",
Expand Down
7 changes: 4 additions & 3 deletions src/commands/protocols/common/submit-commit-command.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,10 @@ class SubmitCommitCommand extends Command {
stateIndex,
);
if (alreadySubmitted) {
this.logger.trace(
`Commit already submitted for blockchain: ${blockchain} agreement id: ${agreementId}, epoch: ${epoch}, state index: ${stateIndex}`,
);
const errorMessage = `Commit already submitted for blockchain: ${blockchain} agreement id: ${agreementId}, epoch: ${epoch}, state index: ${stateIndex}`;
this.logger.trace(errorMessage);

await this.handleError(operationId, errorMessage, this.errorType, true);
return Command.empty();
}

Expand Down
20 changes: 16 additions & 4 deletions src/commands/protocols/common/submit-proofs-command.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,10 @@ class SubmitProofsCommand extends Command {
);

if (!assertion.length) {
this.logger.trace(`Assertion with id: ${assertionId} not found in triple store.`);
const errorMessage = `Assertion with id: ${assertionId} not found in triple store.`;
this.logger.trace(errorMessage);

await this.handleError(operationId, errorMessage, this.errorType, true);
return Command.empty();
}

Expand Down Expand Up @@ -97,9 +100,18 @@ class SubmitProofsCommand extends Command {
stateIndex,
);
if (alreadySubmitted) {
this.logger.trace(
`Proofs already submitted for blockchain: ${blockchain} agreement id: ${agreementId}, epoch: ${epoch}, state index: ${stateIndex}`,
);
const errorMessage = `Proofs already submitted for blockchain: ${blockchain} agreement id: ${agreementId}, epoch: ${epoch}, state index: ${stateIndex}`;
this.logger.trace(errorMessage);

await this.handleError(operationId, errorMessage, this.errorType, true);
return Command.empty();
}

if (proof.length === 0) {
const errorMessage = `Error during Merkle Proof calculation for blockchain: ${blockchain} agreement id: ${agreementId}, epoch: ${epoch}, state index: ${stateIndex}, proof cannot be empty`;
this.logger.trace(errorMessage);

await this.handleError(operationId, errorMessage, this.errorType, true);
return Command.empty();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,22 +83,6 @@ class HandleStoreRequestCommand extends HandleProtocolMessageCommand {
stateIndex,
);

await this.repositoryModuleManager.updateServiceAgreementRecord(
blockchain,
contract,
tokenId,
agreementId,
agreementData.startTime,
agreementData.epochsNumber,
agreementData.epochLength,
agreementData.scoreFunctionId,
agreementData.proofWindowOffsetPerc,
hashFunctionId,
keyword,
assertionId,
stateIndex,
);

await this.operationIdService.updateOperationIdStatus(
operationId,
OPERATION_ID_STATUS.PUBLISH.PUBLISH_LOCAL_STORE_END,
Expand Down
8 changes: 4 additions & 4 deletions src/constants/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export const COMMIT_BLOCK_DURATION_IN_BLOCKS = 5;

export const COMMITS_DELAY_BETWEEN_NODES_IN_BLOCKS = 2;

export const TRANSACTION_POLLING_TIMEOUT_MILLIS = 50 * 1000;
export const TRANSACTION_POLLING_TIMEOUT_MILLIS = 120 * 1000;

export const SOLIDITY_ERROR_STRING_PREFIX = '0x08c379a0';

Expand Down Expand Up @@ -167,9 +167,9 @@ export const DEFAULT_COMMAND_REPEAT_INTERVAL_IN_MILLS = 5000; // 5 seconds
export const DEFAULT_COMMAND_DELAY_IN_MILLS = 60 * 1000; // 60 seconds

export const COMMAND_RETRIES = {
SUBMIT_COMMIT: 3,
SUBMIT_UPDATE_COMMIT: 3,
SUBMIT_PROOFS: 3,
SUBMIT_COMMIT: 0,
SUBMIT_UPDATE_COMMIT: 0,
SUBMIT_PROOFS: 0,
};

export const WEBSOCKET_PROVIDER_OPTIONS = {
Expand Down

0 comments on commit a4d80c7

Please sign in to comment.