wip wire in prover and circom config

This commit is contained in:
Dmitriy Ryajov 2024-02-01 19:00:20 -06:00
parent bf8e27317a
commit 29d4ff5556
No known key found for this signature in database
GPG Key ID: DA8C680CE7C657A4
2 changed files with 32 additions and 8 deletions

View File

@ -39,6 +39,7 @@ import ./contracts/clock
import ./contracts/deployment
import ./utils/addrutils
import ./namespaces
import ./codextypes
import ./logutils
logScope:
@ -131,6 +132,7 @@ proc bootstrapInteractions(
let sales = Sales.new(market, clock, repo, proofFailures)
client = some ClientInteractions.new(clock, purchasing)
host = some HostInteractions.new(clock, sales)
if config.validator:
let validation = Validation.new(clock, market, config.validatorMaxSlots)
validator = some ValidatorInteractions.new(clock, validation)
@ -264,12 +266,21 @@ proc new*(
store = NetworkStore.new(engine, repoStore)
erasure = Erasure.new(store, leoEncoderProvider, leoDecoderProvider)
prover = if config.persistence:
circomBackend = CircomCompat.init(config.circomR1cs, config.circomWasm, config.circomZkey)
some Prover.new(store, circomBackend)
let
zkey = if config.circomNoZkey: "" else: config.circomZkey
some Prover.new(
store,
CircomCompat.init(config.circomR1cs, config.circomWasm, zkey))
else:
none Prover
codexNode = CodexNodeRef.new(switch, store, engine, erasure, prover, discovery)
codexNode = CodexNodeRef.new(
switch = switch,
store = store,
engine = engine,
erasure = erasure,
prover = prover,
discovery = discovery)
restServer = RestServerRef.new(
codexNode.initRestApi(config, repoStore),

View File

@ -33,14 +33,15 @@ import pkg/ethers
import pkg/questionable
import pkg/questionable/results
import ./codextypes
import ./discovery
import ./logutils
import ./stores
import ./units
import ./utils
export units
export net
export units, net, codextypes
export
DefaultQuotaBytes,
DefaultBlockTtl,
@ -229,21 +230,33 @@ type
circomR1cs* {.
desc: "The r1cs file for the storage circuit"
defaultValue: defaultDataDir() / "circuits" / "proof_main.r1cs"
name: "circuit-r1cs"
name: "circom-r1cs"
.}: string
circomWasm* {.
desc: "The wasm file for the storage circuit"
defaultValue: defaultDataDir() / "circuits" / "proof_main.wasm"
name: "circuit-wasm"
name: "circom-wasm"
.}: string
circomZkey* {.
desc: "The zkey file for the storage circuit"
defaultValue: defaultDataDir() / "circuits" / "proof_main.zkey"
name: "circuit-zkey"
name: "circom-zkey"
.}: string
circomNoZkey* {.
desc: "Ignore the zkey file - use only for testing!"
defaultValue: false
name: "circom-no-zkey"
.}: bool
numProofSamples* {.
desc: "Number of samples to prove"
defaultValue: DefaultSamplesNum
defaultValueDesc: $DefaultSamplesNum
name: "proof-samples" }: int
ethProvider* {.
desc: "The URL of the JSON-RPC API of the Ethereum node"
defaultValue: "ws://localhost:8545"