Commit Graph

324 Commits

Author SHA1 Message Date
Jaremy Creechley 45e760a7a3
it verifies! 2024-06-03 18:18:37 +01:00
Jaremy Creechley d2eb91b4e3
it verifies! 2024-06-03 17:59:36 +01:00
Jaremy Creechley 935133df8c
fix verifier 2024-06-03 14:58:35 +01:00
Jaremy Creechley 7972b5df5f
verifier failing now but works locally 2024-06-03 14:38:48 +01:00
Jaremy Creechley 59300059b4
verifier failing now 2024-06-03 14:34:21 +01:00
Jaremy Creechley 76e0e77cb7
fix verifier 2024-06-03 14:30:17 +01:00
Jaremy Creechley a695688faf
fix gc args issue 2024-06-03 14:14:12 +01:00
Jaremy Creechley 486f4f0aac
Merge remote-tracking branch 'origin/master' into 808-scheduling-prover-on-another-thread 2024-06-03 13:49:45 +01:00
Ben Bierens bd8fedaf28
Metadata in LevelDB (#806)
* pulls in datastore-leveldb update

* bump

* Applies LevelDb as metadata store. Adds option for repostore.

* Sets submodule to main branch

* I can do syntax, me

* Removes wildcard from metadata query key

* Applies leveldb instead of sqlite-in-memory for tests

* Restores query key wildcard.

* Pins nim-datastore to latest master

* bumps leveldb to 0.1.4

---------

Co-authored-by: Dmitriy Ryajov <dryajov@gmail.com>
2024-05-30 06:57:10 +00:00
Eric e6a387e8e8
feat[marketplace]: add slot queue pausing (#752)
* add seen flag

* Add MockSlotQueueItem and better prioritisation tests

* Update seen priority, and include in SlotQueueItem.init

* Re-add processed slots to queue

Re-add processed slots to queue if the sale was ignored or errored

* add pausing of queue

- when processing slots in queue, pause queue if item was marked seen
- if availability size is increased, trigger onAvailabilityAdded callback
- in sales, on availability added, clear 'seen' flags, then unpause the queue
- when items pushed to the queue, unpause the queue

* remove unused NoMatchingAvailabilityError from slotqueue

The slot queue should also have nothing to do with availabilities

* when all availabilities are empty, pause the queue

An empty availability is defined as size < DefaultBlockSize as this means even the smallest possible request could not be served. However, this is up for discussion.

* remove availability from onAvailabilitiesEmptied callback

* refactor onAvailabilityAdded and onAvailabilitiesEmptied

onAvailabilityAdded and onAvailabilitiesEmptied are now only called from reservations.update (and eventually reservations.delete once implemented).

- Add empty routine for Availability and Reservation
- Add allEmpty routine for Availability and Reservation, which returns true when all all Availability or Reservation objects in the datastore are empty.

* SlotQueue test support updates

* Sales module test support updates

* Reservations module tests for queue pausing

* Sales module tests for queue pausing

Includes tests for sales states cancelled, errored, ignored to ensure onCleanUp is called with correct parameters

* SlotQueue module tests for queue pausing

* fix existing sales test

* PR feedback

- indent `self.unpause`
- update comment for `clearSeenFlags`

* reprocessSlot in SaleErrored only when coming from downloading

* remove pausing of queue when availabilities are "emptied"

Queue pausing when all availiabilies are "emptied" is not necessary, given that the node would not be able to service slots once all its availabilities' freeSize are too small for the slots in the queue, and would then be paused anyway.

Add test that asserts the queue is paused once the freeSpace of availabilities drops too low to fill slots in the queue.

* Update clearing of seen flags

The asyncheapqueue update overload would need to check index bounds and ultimately a different solution was found using the mitems iterator.

* fix test

request.id was different before updating request.ask.slots, and that id was used to set the state in mockmarket.

* Change filled/cleanup future to nil, so no await is needed

* add wait to allow items to be added to queue

* do not unpause queue when seen items are pushed

* re-add seen item back to queue once paused

Previously, when a seen item was processed, it was first popped off the queue, then the queue was paused waiting to process that item once the queue was unpaused. Now, when a seen item is processed, it is popped off the queue, the queue is paused, then the item is re-added to the queue and the queue will wait until unpaused before it will continue popping items off the queue. If the item was not re-added to the queue, it would have been processed immediately once unpaused, however there may have been other items with higher priority pushed to the queue in the meantime. The queue would not be unpaused if those added items were already seen. In particular, this may happen when ignored items due to lack of availability are re-added to a paused queue. Those ignored items will likely have a higher priority than the item that was just seen (due to it having been processed first), causing the queue to the be paused.

* address PR comments
2024-05-26 00:38:38 +00:00
markspanbroek 3046b7636c
Cleanup integration tests (#757)
* integration: move REST API tests into their own module

* integration: move upload and download tests into their own module

* integration: move purchasing tests into their own module

* integration: move marketplace tests to the right module

* integration: mine a block *after* starting nodes

To ensure that tests involving multiple nodes do
not start with out-of-sync clocks

* Fix: do not swallow CancellationErrors

* integration: avoid underflow in UInt256

* network: remove unnecessary error handling

No Exceptions can occur, only Defects, because everything
is asyncSpawned.

Co-authored-by: Dmitriy Ryajov <dryajov@gmail.com>

* network: do not raise in asyncSpawned proc

Co-authored-by: Dmitriy Ryajov <dryajov@gmail.com>

---------

Co-authored-by: Dmitriy Ryajov <dryajov@gmail.com>
2024-05-23 15:29:30 +00:00
Jaremy Creechley c220136ea3
tweak threads 2024-05-21 15:33:52 +03:00
Jaremy Creechley 6f0032ef91
fix codex 2024-05-20 22:45:01 +03:00
Jaremy Creechley b2f7e417f3
work around windows - renames 2024-05-20 22:39:26 +03:00
Jaremy Creechley d96ca3f146
work around windows - renames 2024-05-20 22:22:14 +03:00
Jaremy Creechley b96328cbee
work around windows - no without 2024-05-20 22:06:43 +03:00
Jaremy Creechley 1c969278d7
work around windows - no without 2024-05-20 21:46:50 +03:00
Jaremy Creechley c4313ab5e0
Merge branch '808-scheduling-prover-on-another-thread' of github.com:codex-storage/nim-codex into 808-scheduling-prover-on-another-thread 2024-05-20 21:45:41 +03:00
Jaremy Creechley b2b8a0ce84
work around windows - no without 2024-05-20 21:45:03 +03:00
Jaremy Creechley 7e6c3a31e7
Merge branch 'master' into 808-scheduling-prover-on-another-thread 2024-05-20 21:24:03 +03:00
Jaremy Creechley 9dcf56b5f5
work around windows - no without 2024-05-20 21:15:34 +03:00
Jaremy Creechley 26809823ed
work around windows 2024-05-20 21:10:29 +03:00
Jaremy Creechley 56f8ff6bf3
work around windows 2024-05-20 21:02:45 +03:00
Jaremy Creechley 774b662bbe
work around windows 2024-05-20 20:58:19 +03:00
Jaremy Creechley 36a9766c40
work around windows 2024-05-20 20:54:52 +03:00
Jaremy Creechley ca8e938836
work around windows 2024-05-20 20:25:00 +03:00
Jaremy Creechley ce12d0f3f9
work around windows 2024-05-20 20:23:43 +03:00
Jaremy Creechley b4fbe25284
work around windows 2024-05-20 20:06:52 +03:00
Jaremy Creechley f5725a8505
work around windows 2024-05-20 19:51:11 +03:00
Jaremy Creechley 9986d22c71
fix nim c -r /Users/elcritch/projs/status/nim-codex/tests/codex/slots/testprover.nim 2024-05-20 19:23:53 +03:00
Jaremy Creechley 695686ad2c
fixup prover test setup 2024-05-20 19:16:33 +03:00
Jaremy Creechley a414e29a99
revert back erasure code 2024-05-20 19:04:58 +03:00
Jaremy Creechley 1e2c40d86d
revert back erasure code 2024-05-20 19:00:21 +03:00
Jaremy Creechley eb22397ca7
implement async verify 2024-05-20 18:58:29 +03:00
Jaremy Creechley 77dfa466a2
implement async verify 2024-05-20 18:57:42 +03:00
Jaremy Creechley 2beb5ab2aa
try queue setup 2024-05-20 18:32:14 +03:00
Jaremy Creechley f90c4cdb66
try queue setup 2024-05-20 18:13:34 +03:00
Jaremy Creechley 9e2820944d
try queue setup 2024-05-20 18:04:05 +03:00
Jaremy Creechley 899a0f6f95
try queue setup 2024-05-20 17:54:06 +03:00
Jaremy Creechley b6180881ea
try queue setup 2024-05-20 17:45:43 +03:00
Jaremy Creechley 683d2186b0
try queue setup 2024-05-20 17:45:13 +03:00
Jaremy Creechley 5fbf2abcb0
try queue setup 2024-05-20 17:43:27 +03:00
Jaremy Creechley 0c2d2d9c8a
try queue setup 2024-05-20 17:34:27 +03:00
Jaremy Creechley f603b642a2
try queue setup 2024-05-20 17:33:41 +03:00
Jaremy Creechley 13c59ca575
try queue setup 2024-05-20 17:31:34 +03:00
Jaremy Creechley 98abf47a23
try queue setup 2024-05-20 17:15:51 +03:00
Jaremy Creechley 30e087efb2
cleanup 2024-05-20 15:51:21 +03:00
Jaremy Creechley a96ea80148
fix awaitThreadResult 2024-05-18 18:12:50 +03:00
Ben Bierens 8bf44e24ee
inlines copying of hashset (#809) 2024-05-17 00:57:30 +00:00
Jaremy Creechley 54edcb1ce7
fix spwan 2024-05-17 01:41:19 +03:00