PR feedback updates

1. Change `seen` to be the highest priority invariant
2. Add condition for clearing seen flags and unpausing queue
3. Fix typo
This commit is contained in:
Eric 2024-03-20 13:20:41 +11:00
parent 36ed175c81
commit 046b0cd417
No known key found for this signature in database

View File

@ -170,11 +170,11 @@ state is validated.
### Sort order
Slots in the queue should be sorted in the following order:
1. Profit (descending)<sup>1</sup>
2. Collateral required (ascending)
3. Time before expiry (descending)
4. Dataset size (ascending)
5. Seen flag
1. Seen flag
2. Profit (descending)<sup>1</sup>
3. Collateral required (ascending)
4. Time before expiry (descending)
5. Dataset size (ascending)
<sup>1</sup> While profit cannot yet be calculated correctly as this calculation will
involve bandwidth incentives, profit can be estimated as `duration * reward`
@ -216,7 +216,7 @@ cause the slot to be ordered lower in the heap queue. If, upon processing
a slot, the slot item already has a `seen` flag set, the queue should be
paused.
This serves to prevent availabilities that are small (in avaialble bytes) from
This serves to prevent availabilities that are small (in available bytes) from
emptying the queue.
#### Pausing the queue
@ -227,8 +227,10 @@ A paused queue will wait until it is unpaused before continuing to process items
in the queue. This prevents unnecessarily popping items off the queue.
#### Unpausing the queue
When availabilities are modified or added, the queue should be unpaused if it
was paused and any slots in the queue should have their `seen` flag cleared.
The queue should be unpaused if it was paused and any slots in the queue should
have their `seen` flag cleared, when:
1. availabilities are modified or added
2. slots are pushed to the queue
#### Queue workers
Each time an item in the queue is processed, it is assigned to a workers. The