Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/transactions timeout #2741

Merged
merged 3 commits into from
Nov 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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