nim-codex/codex/slots/proofs/backends/asynccircoms.nim

41 lines
898 B
Nim
Raw Normal View History

import std/sequtils
import pkg/taskpools
import pkg/taskpools/flowvars
import pkg/chronos
import pkg/chronos/threadsync
import pkg/questionable/results
2024-05-16 21:41:24 +03:00
import ./circomcompat
const
CompletitionTimeout = 1.seconds # Maximum await time for completition after receiving a signal
CompletitionRetryDelay = 10.millis
type
AsyncCircomCompat* = object
params*: CircomCompatParams
# Args objects are missing seq[seq[byte]] field, to avoid unnecessary data copy
2024-05-16 21:41:24 +03:00
ProveTaskArgs = object
signal: ThreadSignalPtr
2024-05-16 21:41:24 +03:00
params: CircomCompatParams
proc prove*[H](
2024-05-16 21:41:24 +03:00
self: AsyncCircomCompat,
input: ProofInputs[H]
): Future[?!CircomProof] {.async.} =
## Generates proof using circom-compat asynchronously
##
discard
proc verify*[H](
self: AsyncCircomCompat,
proof: CircomProof,
inputs: ProofInputs[H]
): Future[?!bool] {.async.} =
## Verify a proof using a ctx
##
discard