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

Increasing number of service agreements considered in command and command executor #3241

Merged
merged 5 commits into from
Jul 17, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,15 @@ class BlockchainEpochCheckCommand extends Command {
command.period,
);

const numberOfBlockchains = this.blockchainModuleManager.getImplementations().length();

// We don't expect to have this many transactions in one epoch check window.
// This is just to make sure we don't schedule too many commands and block the queue
// TODO: find general solution for all commands scheduling blockchain transactions
totalTransactions = Math.min(totalTransactions, COMMAND_QUEUE_PARALLELISM * 0.3);
totalTransactions = Math.min(
totalTransactions,
Math.floor(COMMAND_QUEUE_PARALLELISM / numberOfBlockchains),
);

const transactionQueueLength =
this.blockchainModuleManager.getTotalTransactionQueueLength(blockchain);
Expand Down
2 changes: 1 addition & 1 deletion src/constants/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,7 @@ export const ARCHIVE_UPDATE_RESPONSES_FOLDER = 'update_responses';
* How many commands will run in parallel
* @type {number}
*/
export const COMMAND_QUEUE_PARALLELISM = 100;
export const COMMAND_QUEUE_PARALLELISM = 150;

export const GET_LATEST_SERVICE_AGREEMENT_BATCH_SIZE = 50;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ class ServiceAgreementRepository {
['scoreFunctionId', 'DESC'],
[Sequelize.col('timeLeftInSubmitCommitWindow'), 'ASC'],
],
limit: 100,
limit: 500,
raw: true,
});
}
Expand Down Expand Up @@ -249,7 +249,7 @@ class ServiceAgreementRepository {
['scoreFunctionId', 'DESC'],
[Sequelize.col('timeLeftInSubmitProofWindow'), 'ASC'],
],
limit: 100,
limit: 500,
raw: true,
});
}
Expand Down
Loading