75 Commits

Author SHA1 Message Date
Eric
428f6d68fb
switch to using chronos process handling
- chronos startProcess starts a process and uses an AsyncStream for output which allows us to consume when needed and not needed
2023-12-06 15:41:18 +11:00
Eric
8997573d60
force output to parent streams in windows 2023-12-06 15:41:18 +11:00
Eric
a7f33bf15f
debugging windows integration tests
- Use rest api check to determine when node started
- Use poInteractive and poStdErrToStdOut process start options in the hopes it may help with the small windows buffers
2023-12-06 15:41:18 +11:00
Eric
93c1b30a98
debugging in ci, *commit previous passed all but macos
reduce period advancement speed in windows
2023-12-06 15:41:18 +11:00
Eric
bb010791e3
debugging in ci
add .debug() to all validators
2023-12-06 15:41:18 +11:00
Eric
218b7849e3
debugging in ci
try commenting out first marketplacesuite test in testproofs so there's only one in that file
2023-12-06 15:41:18 +11:00
Eric
b6d2f0433e
debugging in ci
try extending expiry by 6 periods
2023-12-06 15:41:18 +11:00
Eric
836a4cc067
debugging in ci
- Add additional logging to purchasing
- remove chronicles logging from multinodes
- enable log topics in the integration test of interest
2023-12-06 15:41:18 +11:00
Eric
e6d025ca5b
cleanup after rebase 2023-12-06 15:41:17 +11:00
Eric
8df351d917
extra debug 2023-12-06 15:40:47 +11:00
Eric
f1f9d7a825
debugging in ci
enable writing to log file
2023-12-06 15:40:47 +11:00
Eric
d3c07cf1d4
debugging in ci
set all debug modes to true, to write to stdout, otherwise seems to "freeze"
2023-12-06 15:40:47 +11:00
Eric
c48e3d6d93
debugging in ci 2023-12-06 15:40:47 +11:00
Eric
43fc6bd7b8
debugging in ci 2023-12-06 15:40:47 +11:00
Eric
83d36c06fc
debugging in ci 2023-12-06 15:40:47 +11:00
Eric
18640e339b
debugging in ci 2023-12-06 15:40:47 +11:00
Eric
1cc5f21da0
debugging in ci 2023-12-06 15:40:47 +11:00
Eric
3d186dd0a5
debugging in ci 2023-12-06 15:40:47 +11:00
Eric
48ab78da3b
debugging in ci 2023-12-06 15:40:47 +11:00
Eric
4524a609a4
debugging on ci 2023-12-06 15:40:47 +11:00
Eric
6b1e0b0f38
attempt to fix windows ci not starting codex fast enough 2023-12-06 15:40:47 +11:00
Eric
30e8071681
clean up warnings 2023-12-06 15:40:47 +11:00
Eric
c19a94ddc1
move node config from suite-level to test-level 2023-12-06 15:40:47 +11:00
Eric
c9b6bfb2a7
clean up 2023-12-06 15:40:47 +11:00
Eric
f95fa0a97c
fix partial payout integration test
In proving.onCancelled, the `waitFor state.loop.cancelAndWait()` was never completing. Turns out this was not needed, because when changing states, the current state's run is cancelled, which automatically cancels the state prove loop, because it is a child of proving.run. Therefore, the logic to cancelAndWait the prove loop was removed as it was not needed.
2023-12-06 15:40:46 +11:00
Eric
e762860e6b
speed up tests
- advance to next period and mine every 500ms
- update eventually checks in tests to check for number of periods, not time
- change log file format to include test name
2023-12-06 15:39:08 +11:00
Eric
045f770128
All tests working, with no time advancement
- works with hardhat already running
- works with ethersuite to revert snapshot (ethProvider instead of provider)
- OnChainClock.now() gets latest block timestamp
2023-12-06 15:39:08 +11:00
Eric
3d9eb19855
All integration tests working 2023-12-06 15:39:08 +11:00
Eric
ca4181fe00
WIP proofs tests 2023-12-06 15:39:08 +11:00
Eric
93f9dbba08
WIP getting integration tests to work with marketplacesuite 2023-12-06 15:39:08 +11:00
Eric
eda4a85c3e
DRYing, renaming 2023-12-06 15:39:08 +11:00
Eric
935929461f
fix hardhat stop
- allow multiple multinode suites in one module
- remove need to rely on npmstart script, use eval command instead
- properly override stop method to shutdown hardhat node
2023-12-06 15:39:08 +11:00
Eric
3964f868f5
Remove cancelTransaction, add period cadence to testproofs 2023-12-06 15:39:08 +11:00
Eric
bc0652aeb6
Get balance for each provider, bump ethers 2023-12-06 15:39:08 +11:00
Eric
10decd2f28
allow integration tests to start hardhat locally so logs can be captured 2023-12-06 15:39:08 +11:00
Eric
40ee931d6d
remove cancellation of txs in market, handled by ethers now 2023-12-06 15:39:08 +11:00
Adam Uhlíř
3b520fc0c6
fix: unknown state goes to payout when slot state is finished (#555)
Support logging to file

Log the entire config and fix build error

Process slot queue on reservation callback onMarkUnused

Add Reservation object, rename reserve > create

refactor Reservations api to include Reservation CRUD

All tests that use the Reservation module updated

- add requestId and slotIndex to Reservation (hopefully these will prove to be useful when we persist Reservations until request are completed, to add back bytes to Availability)
- add querying of all reservations, with accompanying tests
- change from find to findAvailabilities
- move onCleanUp from SalesContext to SalesAgent as it was getting overwritten for each slot processed
- remove sales agent AFTER deleting reservation, as this was causing some SIGSEGVs
- retrofit testsales and testslotqueue to match updated Reservations module API

Add deletion of inactive reservations on sales load

clean up

add exception message detail util

Apply to onStore errors as we are seeing undetailed errors in the dist tests logs

add missing file

change slotsize to reflect current implemenation

Fix slotSize to reduce by one block

Revert change to slotSize that reduces it by one block

Add additional test check for querying reservations/availabilities

filter past requests based on availability

Because availability filtering on push was removed, when availability is added and past storage request events are queried, those requests need to be filtered by availability before being added to the queue.

Revert "filter past requests based on availability"

This reverts commit 0c2362658b523e0de425794b1fa30ebd53bd30ae.

Add debugging for dist tests

Add cancel on error during filling state

When calling fillSlot, any transaction errors that occur (possibly during estimate gas) will cause that tx to be replaced with a cancellation transaction (a 0-valued tx to ourselves).

more debug logging

fix build

wait for fillSlot to be mined (so that a revert error can be extracted)

fix confirmation of fillSlot

add more debugging

moar debugging

debugging: change echo to trace

bump ethers to add chronicles

fix contracts tests

switch to earlier nim-ethers commit

bump json-rpc and nim-ethers

bump nim-ethers to prevent parsing newHeads log from crashing sales state machine

moar debugging

moar debugging

moar debugging

bump ethers to fix "key not found: data" error

ethers debug logging

bump ethers - better Transaction object deserialization

bump ethers to replay tx with past tx format

bump ethers to add serialization for PastTransaction

ethers bump: better logging, separate logic for revert reason string

fix build

ethers: update revert reason retreival

remove unneeded confirm

ethers: try replay without decrementing blockNumber

ethers: include type and chainId in replayed txs

ethers: add gas into and remove type from replayed txs

ensure gas is being serialized in Transaction

ethers: fix build error

bump ethers: rebased on top of cancel tx due to estimateGas error PR

Fix proving with latest ethers bump (tested on master)

Update multinode suite for better simulateFailedProofs enabling, add proofs test

Improve multinode suite for better debug options, including logging to file

There is a 503 "sales unavailable" error

improve multinode test suite, add logging to file
2023-12-06 15:39:03 +11:00
Adam Uhlíř
b38146d3f7
fix: check expiration is before request end (#641) 2023-12-05 14:25:28 +01:00
Dmitriy Ryajov
22c31046a7
Dont dial self (#633)
* don't dial self

* revert style changes

* filter out self on dial

* add helpers to `peerId` and `isSelf`

* don't fire up discovery eaguerly

* allow excluding multiple peers in sendWantHave

* revert style changes

* move self check to discovery.find

* readd eaguer dht lookup is required in some cases

* revert style changes

* misc

* drop peer first, before queueing a dht lookup

* moar style changes

* use isSelf
2023-11-27 10:25:53 -08:00
Adam Uhlíř
79fce39dbf
fix: require expiry from api (#629)
Co-authored-by: markspanbroek <mark@spanbroek.net>
2023-11-22 11:35:26 +00:00
Dmitriy Ryajov
ec8d0c98b2
Fix REST endpoints semantics (#612)
* Fix REST endpoints semantics

* update endpoint description

* update, operation id

* Adding enum support

* make enum descerializer public

* add support for listing manifests

* test `/data` endpoint to list local manifests

* debug leftovers

* remove commented out line
2023-11-20 16:14:06 -08:00
Ben Bierens
bece1b88a1
Feat/bump questionable (#627)
* Bumps questionable version to 0.10.12

* removes unnecessary questionnable bindings.

* Fixes tests

* unnecessary whitespaces
2023-11-17 13:49:45 +01:00
Ben Bierens
cb02962231
Adds endpoint for listing files (manifests) in node. Useful for demo UI. (#599)
* Adds endpoint for listing files (manifests) in node. Useful for demo UI.

* Moves upload/download/files into content API calls.

* Cleans up json serialization for manifest

* Cleans up some more json serialization

* Moves block iteration and decoding to node.nim

* Moves api methods into their own init procs.

* Applies RestContent api object.

* Replaces format methods with Rest objects in json.nim

* Unused import

* Review comments by Adam

* Fixes issue where content/local endpoint clashes with content/cid.

* faulty merge resolution

* Renames content API to data.

* Fixes faulty rebase

* Adds test for data/local API

* Renames local and download api.
2023-11-09 08:47:09 +00:00
Adam Uhlíř
0014ffdef5
test: integration tests listen on localhost (#596) 2023-10-24 16:52:06 +02:00
Adam Uhlíř
2fc71cf81b
feat: partial payouts for cancelled requests (#561) 2023-10-24 10:12:54 +00:00
Dmitriy Ryajov
25ea7fd0b2
Erasure cleanup (#545)
* cleanup erasure coding

* moar cleanup

* fix off by 1 issues in tests

* style

* consolidate decoding data code

* simplify tuple unpacking

* fix retrieve purchase

We don't support single blocks for now

* Apply suggestions from code review

Co-authored-by: Eric <5089238+emizzle@users.noreply.github.com>
Signed-off-by: Dmitriy Ryajov <dryajov@gmail.com>

---------

Signed-off-by: Dmitriy Ryajov <dryajov@gmail.com>
Co-authored-by: Eric <5089238+emizzle@users.noreply.github.com>
2023-09-25 07:31:10 -07:00
markspanbroek
71cd35112b
Taiko L2 (#483)
* [docs] fix two client scenario: add missing collateral

* [integration] separate step to wait for node to be started

* [cli] add option to specify ethereum private key

* Remove unused imports

* Fix warnings

* [integration] move type definitions to correct place

* [integration] wait a bit longer for a node to start in debug mode

When e.g. running against Taiko test net rpc, the node start
takes longer

* [integration] simplify handling of codex node and client

* [integration] add Taiko integration test

* [contracts] await token approval confirmation before next tx

* [contracts] deployment address of marketplace on Taiko

* [cli] --eth-private-key now takes a file name

Instead of supplying the private key on the command line,
expect the private key to be in a file with the correct
permissions.

* [utils] Fixes undeclared `activeChroniclesStream` on Windows

* [build] update nim-ethers to include PR #52

Co-authored-by: Eric Mastro <eric.mastro@gmail.com>

* [cli] Better error messages when reading eth private key

Co-authored-by: Eric Mastro <eric.mastro@gmail.com>

* [integration] simplify reading of cmd line arguments

Co-authored-by: Eric Mastro <eric.mastro@gmail.com>

* [build] update to latest version of nim-ethers

* [contracts] updated contract address for Taiko L2

* [build] update codex contracts to latest version

---------

Co-authored-by: Eric Mastro <eric.mastro@gmail.com>
2023-09-13 16:17:56 +02:00
markspanbroek
d3a22a7b7b
Fix slot queue push (#542)
* [sales] remove availability check before adding to slot queue

* [sales] add missing return statement

* [tests] remove 'eventuallyCheck' helper

* [sales] remove reservations from slot queue

* [tests] rename module `eventually` -> `always`

* [sales] increase slot queue size

Because it will now also hold items for which we haven't
checked availability yet.
2023-09-04 16:42:09 +02:00
Ben Bierens
545e0d47e1
Slows down block maintenance iteration (#543)
* Slows down block maintenance iteration

* Fixes unstable integration test.
2023-09-04 11:12:14 +02:00
Eric
37b3d99c3d
Improve integration testing client (CodexClient) and json serialization (#514)
* Improve integration testing client (CodexClient) and json serialization

The current client used for integration testing against the REST endpoints for Codex accepts and passes primitive types. This caused a hard to diagnose bug where a `uint` was not being deserialized correctly.

In addition, the json de/serializing done between the CodexClient and REST client was not easy to read and was not tested.

These changes bring non-primitive types to most of the CodexClient functions, allowing us to lean on the compiler to ensure we're providing correct typings. More importantly, a json de/serialization util was created as a drop-in replacement for the std/json lib, with the main two differences being that field serialization is opt-in (instead of opt-out as in the case of json_serialization) and serialization errors are captured and logged, making debugging serialization issues much easier.

* Update integration test to use nodes=2 and tolerance=1

* clean up
2023-09-01 15:44:41 +10:00