Commit Graph

258 Commits

Author SHA1 Message Date
Dmitriy Ryajov 6bea069ed2
Merge branch 'master' into wire-circuits 2024-02-12 20:52:53 -06:00
Dmitriy Ryajov 6fab252bf1
safer backend release (#701) 2024-02-10 23:17:11 +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 e64ac2e877
wire in circom backend 2024-02-09 15:13:10 -06:00
Dmitriy Ryajov e9390f52bf
remove unnedded inmports and move defaults to codextypes 2024-02-09 14:57:46 -06:00
Dmitriy Ryajov a0aba789d4
move proving defaults to codextypes 2024-02-09 14:51:22 -06:00
Dmitriy Ryajov 4648c863f5
wip 2024-02-09 14:48:44 -06:00
Dmitriy Ryajov b88e7c6b40
wire in circom backend 2024-02-09 14:45:17 -06:00
Dmitriy Ryajov d1a48605e3
rework sampler & builder to support correct padding and block selection 2024-02-07 21:05:46 -06:00
Dmitriy Ryajov d95b4a7941
merge master 2024-02-07 21:05:45 -06:00
Dmitriy Ryajov dc2672cdd6
removed useless property 2024-02-07 21:05:45 -06:00
Dmitriy Ryajov 1cecb51087
cleanup 2024-02-07 21:05:45 -06:00
Dmitriy Ryajov 8a3bb9602d
cleanup 2024-02-07 21:05:44 -06:00
Dmitriy Ryajov 12a9a73df8
fix tests 2024-02-07 21:04:27 -06:00
Dmitriy Ryajov 48faccb833
misc 2024-02-07 21:03:59 -06:00
Dmitriy Ryajov da7a6a6712
use `Proof.init` 2024-02-07 21:03:59 -06:00
Dmitriy Ryajov 96811ca86f
cleanup and proper inputs structure 2024-02-07 21:03:57 -06:00
Dmitriy Ryajov d75bffede0
add circuit static params and adjust input sizes (wip) 2024-02-07 21:03:34 -06:00
Dmitriy Ryajov c5c60ba9ff
misc 2024-02-07 21:02:45 -06:00
Dmitriy Ryajov af7dcbc422
wip: wire in prover 2024-02-07 21:02:45 -06:00
Dmitriy Ryajov 045224bb13
add default samples number 2024-02-07 21:02:45 -06:00
Dmitriy Ryajov cfd6e7f863
wip wire in prover and circom config 2024-02-07 21:02:45 -06:00
Dmitriy Ryajov 0a9af5ceff
misc 2024-02-07 21:02:44 -06:00
Dmitriy Ryajov ff59c45a51
pass number of samples to prover 2024-02-07 21:02:25 -06:00
Dmitriy Ryajov 10af9dcda6
wip merge master 2024-02-07 21:01:38 -06:00
Dmitriy Ryajov 4fad61955e
add circom file config options 2024-02-07 21:00:04 -06:00
Dmitriy Ryajov c058a4e06f
remove generic types 2024-02-07 21:00:03 -06:00
Dmitriy Ryajov 5e234e7604
add prover 2024-02-07 21:00:03 -06:00
Dmitriy Ryajov 23c170ce46
init node 2024-02-07 21:00:03 -06:00
Dmitriy Ryajov 6d514df503
expose circom backend 2024-02-07 21:00:03 -06:00
Dmitriy Ryajov 9e78970b21
move prover logic from node 2024-02-07 21:00:03 -06:00
Dmitriy Ryajov 79088c2383
rework circom compat 2024-02-07 21:00:02 -06:00
Dmitriy Ryajov f20218d92a
make more egonomic 2024-02-07 20:59:23 -06:00
Dmitriy Ryajov 9f1ec4b02f
pass proper input 2024-02-07 20:59:23 -06:00
Dmitriy Ryajov b0e5058d45
wip rework backend 2024-02-07 20:59:22 -06:00
Dmitriy Ryajov 0d3b18cb5e
wip 2024-02-07 20:59:18 -06:00
Dmitriy Ryajov a2052a2052
don't export types 2024-02-07 20:58:07 -06:00
Dmitriy Ryajov 4fd07eb151
moving prover around 2024-02-07 20:57:32 -06:00
Dmitriy Ryajov aba8abed0c
wip 2024-02-07 20:57:32 -06:00
Dmitriy Ryajov 653afb78c1
generify sampler and builder 2024-02-07 20:57:30 -06: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
Dmitriy Ryajov 2fc538337b
rework indexing strategy to use an enum (#694) 2024-02-07 11:13:27 -08:00
markspanbroek 2cf892c467
Smart contracts update: Groth16Proof instead of bytes (#683)
* Smart contracts update: Groth16Proof instead of bytes

* Use dummy verifier for now, until we can create ZK proofs

* Fix tests: submit proof only when slot is filled

* Submit dummy proofs for now

* More detailed log when proof submission failed

* Use dummy verifier for integration tests

For now at least

* Fix mistake in blanket renaming to ethProvider

* Update to latest codex-contracts-eth

* feat: zkey-hash from chain

* Fix zkeyHash

---------

Co-authored-by: Adam Uhlíř <adam@uhlir.dev>
2024-02-07 07:50:35 +01:00
Giuliano Mega 591be9446a
remove call to `waitFor` from clock.now and make it async (#691) 2024-02-05 08:36:28 -03:00
Slava ca0660b07e
Use default short commit length for Codex revision (#690) 2024-01-30 19:58:55 +02:00
Slava 95a4484de0
fix: update codex help output (#687) 2024-01-29 19:31:29 +00:00
Ben Bierens 0b8811c98d
Debug/sampling (#681)
* Extra logging in sampler

* wip: Fixing sampling issue in padded slot cells

* Cleanup

* Restores tests
2024-01-25 15:34:38 -08:00
Eric de88fd2c53
feat: create logging proxy (#663)
* implement a logging proxy

The logging proxy:
- prevents the need to import chronicles (as well as export except toJson),
- prevents the need to override `writeValue` or use or import nim-json-seralization elsewhere in the codebase, allowing for sole use of utils/json for de/serialization,
- and handles json formatting correctly in chronicles json sinks

* Rename logging -> logutils to avoid ambiguity with common names

* clean up

* add setProperty for JsonRecord, remove nim-json-serialization conflict

* Allow specifying textlines and json format separately

Not specifying a LogFormat will apply the formatting to both textlines and json sinks.

Specifying a LogFormat will apply the formatting to only that sink.

* remove unneeded usages of std/json

We only need to import utils/json instead of std/json

* move serialization from rest/json to utils/json so it can be shared

* fix NoColors ambiguity

Was causing unit tests to fail on Windows.

* Remove nre usage to fix Windows error

Windows was erroring with `could not load: pcre64.dll`. Instead of fixing that error, remove the pcre usage :)

* Add logutils module doc

* Shorten logutils.formatIt for `NBytes`

Both json and textlines formatIt were not needed, and could be combined into one formatIt

* remove debug integration test config

debug output and logformat of json for integration test logs

* Use ## module doc to support docgen

* bump nim-poseidon2 to export fromBytes

Before the changes in this branch, fromBytes was likely being resolved by nim-stew, or other dependency. With the changes in this branch, that dependency was removed and fromBytes could no longer be resolved. By exporting fromBytes from nim-poseidon, the correct resolution is now happening.

* fixes to get compiling after rebasing master

* Add support for Result types being logged using formatIt
2024-01-22 23:35:03 -08:00
Dmitriy Ryajov 72da534856
Wire sampler (#676)
* Setting up testfixture for proof datasampler

* Sets up calculating number of cells in a slot

* Sets up tests for bitwise modulo

* Implements cell index collection

* setting up slot blocks module

* Implements getting treeCID from slot

* implements getting slot blocks by index

* Implements out-of-range check for slot index

* cleanup

* Sets up getting sample from block

* Implements selecting a cell sample from a block

* Implements building a minitree for block cells

* Adds method to get dataset block index from slot block index

* It's running

* splits up indexing

* almost there

* Fixes test. Implementation is now functional

* Refactoring to object-oriented

* Cleanup

* Lining up output type with updated reference code.

* setting up

* Updates expected samples

* Updates proof checking test to match new format

* move builder to own dir

* move sampler to own dir

* fix paths

* various changes to add support for the sampler

* wip sampler implementation

* don't use upraises

* wip sampler integration

* misc

* move tests around

* Various fixes to select correct slot and block index

* removing old tests

* cleanup

* misc

fix tests that work with correct cell indices

* remove unused file

* fixup logging

* add logscope

* truncate entropy to 31 bytes, otherwise it might be > than mod

* forwar getCidAndProof to local store

* misc

* Adds missing test for initial-proving state

* reverting back to correct slot/block indexing

* fix tests for revert

* misc

* misc

---------

Co-authored-by: benbierens <thatbenbierens@gmail.com>
2024-01-17 11:24:34 -08:00