Commit Graph

671 Commits

Author SHA1 Message Date
Jaremy Creechley 420382b44c
fix gc issue on isolated data args 2024-06-01 22:02:57 +01:00
Jaremy Creechley ad9d1c39d5
it runs now? 2024-05-31 12:38:37 +01:00
Jaremy Creechley caaeba8781
fix import 2024-05-29 14:46:08 +01:00
Jaremy Creechley a527034c27
Merge remote-tracking branch 'origin/master' into 808-scheduling-prover-on-another-thread-exper-v2 2024-05-29 14:23:12 +01: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
Jaremy Creechley d774d588c4
more expers 2024-05-23 21:39:07 +03:00
Jaremy Creechley efd46148b0
Pr add prover benchmark tool (#790)
* initial setup

* reorg

* figuring out basic shell commands

* benchmarks

* benchmarks

* Sets up environment for running benchmarks

* updates

* integrate setup and proving

* updates

* adding outputs

* cleanup

* check failure

* benchmarks

* benchmarks

* benchmarks

* benchmarks

* benchmarks

* benchmarks

* formatting

* fix running larger sizes

* use larger ceremony file size

* use larger ceremony file size

* use larger ceremony file size

* restore benchmarks

* cleanup

* cleanup

* cleanup

* cleanup

* cleanup

* cleanup

* cleanup

* cleanup

* cleanup

* cleanup

* refactor env

* refactor env

* refactor env

* refactor env

* refactor env

* rename

* cleanup

* cleanup

* cleanup

* cleanup

* cleanup

* cleanup

* readme

* readme

* merge

* initial splitout of codex ark prover cli

* opts

* copying nimcli opts

* copying nimcli opts

* copying nimcli opts

* updating ark cli

* updating ark cli

* updating ark cli

* updating ark cli

* updating ark cli

* updating ark cli

* updating ark cli

* updating ark cli

* docs

* remove file

* add param

* add benchmarkLoops param

* update benchmark formatting

* update benchmark formatting

* update benchmark formatting

* update benchmark formatting

* fix naming

* fix serde version

* Apply suggestions from code review

cleanup wording

Signed-off-by: Dmitriy Ryajov <dryajov@gmail.com>

---------

Signed-off-by: Dmitriy Ryajov <dryajov@gmail.com>
Co-authored-by: Dmitriy Ryajov <dryajov@gmail.com>
2024-05-23 09:28:17 -07: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
Giuliano Mega 97b538961c
Updates tutorial with entry on how to run Codex with its Markeplace (#765)
* update help info

* Marketplace guide WiP

* add API requests

* reword titles

* reword Guides section

* simplify geth startup instruction

* make instructions more clear

* clarify expiry trial-and-error

* minor rewording

* Update docs/Marketplace.md

Signed-off-by: Jaremy Creechley <creechley@gmail.com>

* Update docs/Marketplace.md

Signed-off-by: Jaremy Creechley <creechley@gmail.com>

* Update docs/Marketplace.md

Signed-off-by: Jaremy Creechley <creechley@gmail.com>

* Update docs/Marketplace.md

Signed-off-by: Jaremy Creechley <creechley@gmail.com>

* Feat/updated guide jc tweaks (#769)

* more tweaks
* fix network json
* fix commands
* fix datetime
* fix purchase tolerance

* Apply suggestions from code review

Signed-off-by: Jaremy Creechley <creechley@gmail.com>

* Update docs/Marketplace.md

It's data not data1 and need the "@"

Signed-off-by: Jaremy Creechley <creechley@gmail.com>

* use debug/info by default for guide

* add slashing high level at footnote

* rephrase meaning of --data

---------

Signed-off-by: Jaremy Creechley <creechley@gmail.com>
Co-authored-by: Jaremy Creechley <creechley@gmail.com>
Co-authored-by: Dmitriy Ryajov <dryajov@gmail.com>
2024-05-22 16:43:33 +00:00
Jaremy Creechley 02542076f2
circom not threadsafe 2024-05-21 16:02:15 +03:00
Jaremy Creechley 325292325d
add async proofs 2024-05-21 16:00:41 +03: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 6b161a1716
fixup prover test setup 2024-05-20 19:33:57 +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