Skip to content

Commit

Permalink
feat: bump TASKS_PER_ROUND to 200 (#125)
Browse files Browse the repository at this point in the history
Now that we have over 1900 retrieval templates, we can increase the
number of tasks per round to the desired level.

SPARK nodes wait for 10 seconds between checks. With 30-minute round
length, node can perform at most 30*60/10 = 180 tasks per round.

In practice, we will always get some nodes that don't perform all tasks,
e.g. because retrieval takes longer or the node is not online for the
entire duration of the round.

To make it easier to observe how our system handles such situations, I
am intentionally choosing TASKS_PER_ROUND value higher than the maximum
theoretical limit, to ensure we encounter this edge case very often.

Signed-off-by: Miroslav Bajtoš <[email protected]>
  • Loading branch information
bajtos authored Nov 6, 2023
1 parent e8ed685 commit d15e073
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
4 changes: 1 addition & 3 deletions lib/round-tracker.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@ import { createMeridianContract } from './ie-contract.js'
// for more details, this constant represents TC (tasks per committee).
//
// We will need to tweak this value based on measurements; that's why I put it here as a constant.
// I think this value will need to be much, much higher, like the low hundreds. However, we can't do
// that now because we have only 200 retrieval templates to sample from.
export const TASKS_PER_ROUND = 30
export const TASKS_PER_ROUND = 200

export async function createRoundGetter (pgClient) {
const contract = await createMeridianContract()
Expand Down
4 changes: 2 additions & 2 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -602,7 +602,7 @@ describe('Routes', () => {
assert.deepStrictEqual(details, {
roundId: '2'
})
assert.strictEqual(retrievalTasks.length, 30)
assert.strictEqual(retrievalTasks.length, 200)
})

it('returns details of a SPARK round managed by older contract version', async () => {
Expand All @@ -613,7 +613,7 @@ describe('Routes', () => {
assert.deepStrictEqual(details, {
roundId: '1'
})
assert.strictEqual(retrievalTasks.length, 30)
assert.strictEqual(retrievalTasks.length, 200)
})

it('returns 404 for unknown round index', async () => {
Expand Down

0 comments on commit d15e073

Please sign in to comment.