366 Commits

Author SHA1 Message Date
Mark Spanbroek
42f8d65c89
sales: stop cancellation loop when request started, finished or failed 2024-02-28 15:45:42 +01:00
Mark Spanbroek
b3d115bda5
sales: fix sales agent tests 2024-02-28 15:45:42 +01:00
Mark Spanbroek
70412ce283
integration: fix proof parameters for test 2024-02-28 15:45:42 +01:00
Mark Spanbroek
8ce55aaa9d
integration: use correct circom artifacts for creating proofs 2024-02-27 12:00:45 +01:00
Mark Spanbroek
b4662b0b69
integration: remove origDatasetSizeInBlocks 2024-02-27 11:54:14 +01:00
Mark Spanbroek
59a4f648de
integration: update use of nodeconfigs in testproofs 2024-02-27 11:32:55 +01:00
Mark Spanbroek
489ef2360c
integration: revert testproofs 2024-02-27 11:24:15 +01:00
Mark Spanbroek
100bd43de6
integration: do not log test output by default 2024-02-27 10:46:28 +01:00
Mark Spanbroek
78fb165b12
integration: fix parameters of marketplace payouts test 2024-02-27 10:36:11 +01:00
Mark Spanbroek
da2e3b73d0
sales: cleanup proving tests 2024-02-27 10:35:04 +01:00
Mark Spanbroek
fb1de95a3c
sales: do not raise in proving loop when slot is cancelled
Allow the onCancelled callback to handle cancellation, and
the onFailed callback to handle failed requests.
2024-02-27 10:34:47 +01:00
Eric
e1fea57950
Update third proofs test 2024-02-26 19:30:21 +11:00
Eric
e2cb91ef8f
Proofs tests updates
Contains changes to get the proving tests working reliably.
2024-02-26 18:59:52 +11:00
Mark Spanbroek
b8dd2543dc
sales: wait for stable proof challenge
When the block pointer is nearing the
wrap-around point, we wait another period
before calculating a proof.
2024-02-22 16:37:48 +01:00
Eric
f8f57d8dba
marketplacesuite: set correct circuit files, interval mining 2024-02-22 22:29:39 +11:00
Mark Spanbroek
1afa201049
integration: fix proof parameters for tests
Increased times due to waiting on next period.
Fixed data to be of right size.
Updated expected payout due to hosting 5 slots.
2024-02-22 10:23:03 +01:00
Mark Spanbroek
0aa7590c96
sales: calculate initial proof at start of period
reason: this ensures that the period (and therefore
the challenge) doesn't change while we're calculating
the proof
2024-02-22 10:07:11 +01:00
Mark Spanbroek
d442cc80d7
clock: add 1 second leeway before acting on timeouts 2024-02-22 09:30:48 +01:00
Mark Spanbroek
3a6db45e14
integration: fix proof parameters for a test
Increased times due to ZK proof generation.
Increased storage requirement because we're now hosting
5 slots instead of 1.
2024-02-21 14:24:17 +01:00
Mark Spanbroek
1c04c4d1ff
contracts: update G2Point definition 2024-02-21 14:23:26 +01:00
Eric
27b7aca63d
update testmarketplace to new api, with valid EC params 2024-02-21 18:52:08 +11:00
Eric
2860f8a041
graceful shutdowns
Where possible, do not raise assert, as other nodes in the test may already be running. Instead, raise exceptions, catch them in multinodes.nim, and attempt to do a teardown before failing the test.

`abortOnError` is set to true so that `fail()` will quit immediately, after teardown has been run.
2024-02-21 18:27:07 +11:00
Eric
621e8cf4f6
remove unneeded gcsafes 2024-02-21 16:43:25 +11:00
Eric
796040e1f2
remove parsedCli from CodexConfig
Instead, parse the cli args on the fly when needed
2024-02-21 16:19:59 +11:00
Eric
8dd0a420c6
Update integration tests to use cli commands
Integration tests have been updated to use the new cli commands. The api for usage in the integration tests has also changed a bit.

Proofs tests have been updated to use 5 nodes and 8 blocks of data. The remaining integration tests also need to be updated.
2024-02-21 16:09:43 +11:00
Dmitriy Ryajov
d159af763f
merge master 2024-02-19 13:34:46 -06:00
Dmitriy Ryajov
f4af9ebd9f
fix cli tests 2024-02-19 13:34:46 -06:00
Dmitriy Ryajov
aac27d0fe7
update circuit artifacts path 2024-02-19 13:34:46 -06:00
Dmitriy Ryajov
95b249c083
fix to match constructor arguments 2024-02-19 13:34:43 -06:00
Dmitriy Ryajov
90acd52d1d
use correct dataset geometry in erasure 2024-02-19 13:33:36 -06:00
Dmitriy Ryajov
6a0a5326a7
bump time to give nodes time to load with all circom artifacts 2024-02-19 13:33:36 -06:00
Dmitriy Ryajov
a001b69633
update 2024-02-19 13:33:36 -06:00
Mark Spanbroek
5f1c1bb3df
Add "prover" cli command to tests 2024-02-19 13:33:35 -06:00
Mark Spanbroek
ed8bc7bd29
Use circuit assets from codex-contract-eth in tests 2024-02-19 13:33:35 -06:00
Dmitriy Ryajov
afe97514d4
update tests 2024-02-19 13:33:35 -06:00
Dmitriy Ryajov
e211b66305
fix nodes and tolerance to match expected params 2024-02-19 13:33:24 -06:00
Eric
24affef5e6
Update cli integration tests 2024-02-19 13:33:08 -06:00
Dmitriy Ryajov
bb5c9d8bc0
misc 2024-02-19 13:33:08 -06:00
Dmitriy Ryajov
20b156d0ff
persistence is a command now 2024-02-19 13:33:07 -06:00
Dmitriy Ryajov
9250b44afd
adding new required cli changes 2024-02-19 13:32:42 -06:00
Dmitriy Ryajov
e271875f6a
wire prover into node 2024-02-19 13:31:03 -06:00
Dmitriy Ryajov
9e13d2251a
Prover works with zkey (#711)
* rework backend to instantiate key at initialization

* add groth16 convertes for solidity

* prover taks num samples on construction

* add zkey file

* rework helpers

* rename types

* update tests

* reworked test helpers

* rename types

* rework test

* test all slots artifacts

* bump to latest version
2024-02-19 18:58:39 +00:00
Dmitriy Ryajov
3e884430c1
Node use correct stores (#710)
* don't pass erasure

* use correct stores and construct erasure inside the node

* fix tests to match new constructor

* remove prover argument

* review commets

* revert failing on no-prover for now

* small cleanup

* comment out invalid proofs broken test
2024-02-19 10:12:10 -08:00
Eric
d70ab59004
refactor: multinode integration test refactor (#662)
* refactor multi node test suite

Refactor the multinode test suite into the marketplace test suite.

- Arbitrary number of nodes can be started with each test: clients, providers, validators
- Hardhat can also be started locally with each test, usually for the purpose of saving and inspecting its log file.
- Log files for all nodes can be persisted on disk, with configuration at the test-level
- Log files, if persisted (as specified in the test), will be persisted to a CI artifact
- Node config is specified at the test-level instead of the suite-level
- Node/Hardhat process starting/stopping is now async, and runs much faster
- Per-node config includes:
  - simulating proof failures
  - logging to file
  - log level
  - log topics
  - storage quota
  - debug (print logs to stdout)
- Tests find next available ports when starting nodes, as closing ports on Windows can lag
- Hardhat is no longer required to be running prior to starting the integration tests (as long as Hardhat is configured to run in the tests).
  - If Hardhat is already running, a snapshot will be taken and reverted before and after each test, respectively.
  - If Hardhat is not already running and configured to run at the test-level, a Hardhat process will be spawned and torn down before and after each test, respectively.

* additional logging for debug purposes

* address PR feedback

- fix spelling
- revert change from catching ProviderError to SignerError -- this should be handled more consistently in the Market abstraction, and will be handled in another PR.
- remove method label from raiseAssert
- remove unused import

* Use API instead of command exec to test for free port

Use chronos `createStreamServer` API to test for free port by binding localhost address and port. Use `ServerFlags.ReuseAddr` to enable reuse of same IP/Port on multiple test runs.

* clean up

* remove upraises annotations from tests

* Update tests to work with updated erasure coding slot sizes

* update dataset size, nodes, tolerance to match valid ec params

Integration tests now have valid dataset sizes (blocks), tolerances, and number of nodes, to work with valid ec params. These values are validated when requested storage.

Print the rest api failure message (via doAssert) when a rest api call fails (eg the rest api may validate some ec params).

All integration tests pass when the async `clock.now` changes are reverted.

* dont use async clock for now

* fix workflow

* move integration logs uplod to reusable

---------

Co-authored-by: Dmitriy Ryajov <dryajov@gmail.com>
2024-02-19 04:55:39 +00:00
Dmitriy Ryajov
0497114e44
Use correct blocks count in builder (#709) 2024-02-19 02:19:59 +00:00
Dmitriy Ryajov
3fce267352
Block and manifest as objects (#708)
* make block and manifest objects

* use unsafeAddr since block is an object type now

* make object var
2024-02-19 02:10:16 +00:00
Eric
61ec4275c8
Revert "remove call to waitFor from clock.now and make it async (#691)" (#707)
This reverts commit 591be9446a5cee1ce559c87e496fa4d7dab92924.
2024-02-16 22:12:16 +00:00
Dmitriy Ryajov
e23159b065
wire in circom backend (#698)
* wire in circom backend

* should contain leafs

* adding circom compad and circuits deps

* update windows build

* fix windows build

* improve test names

* move proving defaults to codextypes

* remove unnedded inmports and move defaults to codextypes

* capture error code on backend failure
2024-02-09 21:40:30 +00:00
Dmitriy Ryajov
825766eea0
Rework builder & sampler (#697)
* add proof initializer for poseidon2 and `$`

* fix padding and block selection

* fix sample selection and input construction

* fix sample selection & more descriptive names

* add concrete types for sampler & builder

* add missing digest calls

* use concrete types

* add sample test fixtures

* use concrete types and don't fetch dummy blocks
2024-02-08 02:27:11 +00:00
Dmitriy Ryajov
afec86b3cf
cleanup manifest and wire in strategy (#696) 2024-02-07 20:54:57 +00:00