moving circom params under `prover` command
This commit is contained in:
parent
ee36414046
commit
5ec9269c05
|
@ -259,7 +259,7 @@ proc new*(
|
||||||
store = NetworkStore.new(engine, repoStore)
|
store = NetworkStore.new(engine, repoStore)
|
||||||
erasure = Erasure.new(store, leoEncoderProvider, leoDecoderProvider)
|
erasure = Erasure.new(store, leoEncoderProvider, leoDecoderProvider)
|
||||||
|
|
||||||
prover = if config.persistence:
|
prover = if config.prover:
|
||||||
if not fileAccessible($config.circomR1cs, {AccessFlags.Read}) and
|
if not fileAccessible($config.circomR1cs, {AccessFlags.Read}) and
|
||||||
endsWith($config.circomR1cs, ".r1cs"):
|
endsWith($config.circomR1cs, ".r1cs"):
|
||||||
error "Circom R1CS file not accessible"
|
error "Circom R1CS file not accessible"
|
||||||
|
|
|
@ -70,7 +70,7 @@ type
|
||||||
persistence
|
persistence
|
||||||
|
|
||||||
PersistenceCmd* {.pure.} = enum
|
PersistenceCmd* {.pure.} = enum
|
||||||
noCmd
|
prover
|
||||||
validator
|
validator
|
||||||
|
|
||||||
LogKind* {.pure.} = enum
|
LogKind* {.pure.} = enum
|
||||||
|
@ -267,6 +267,25 @@ type
|
||||||
name: "marketplace-address"
|
name: "marketplace-address"
|
||||||
.}: Option[EthAddress]
|
.}: Option[EthAddress]
|
||||||
|
|
||||||
|
# TODO: should go behind a feature flag
|
||||||
|
simulateProofFailures* {.
|
||||||
|
desc: "Simulates proof failures once every N proofs. 0 = disabled."
|
||||||
|
defaultValue: 0
|
||||||
|
name: "simulate-proof-failures"
|
||||||
|
hidden
|
||||||
|
.}: int
|
||||||
|
|
||||||
|
case persistenceCmd* {.
|
||||||
|
command }: PersistenceCmd
|
||||||
|
|
||||||
|
of PersistenceCmd.validator:
|
||||||
|
validatorMaxSlots* {.
|
||||||
|
desc: "Maximum number of slots that the validator monitors"
|
||||||
|
defaultValue: 1000
|
||||||
|
name: "validator-max-slots"
|
||||||
|
.}: int
|
||||||
|
|
||||||
|
of PersistenceCmd.prover:
|
||||||
circomR1cs* {.
|
circomR1cs* {.
|
||||||
desc: "The r1cs file for the storage circuit"
|
desc: "The r1cs file for the storage circuit"
|
||||||
defaultValue: $DefaultDataDir / "circuits" / "proof_main.r1cs"
|
defaultValue: $DefaultDataDir / "circuits" / "proof_main.r1cs"
|
||||||
|
@ -325,28 +344,6 @@ type
|
||||||
defaultValueDesc: $DefaultCellElms
|
defaultValueDesc: $DefaultCellElms
|
||||||
name: "max-cell-elements" }: int
|
name: "max-cell-elements" }: int
|
||||||
|
|
||||||
# TODO: should go behind a feature flag
|
|
||||||
simulateProofFailures* {.
|
|
||||||
desc: "Simulates proof failures once every N proofs. 0 = disabled."
|
|
||||||
defaultValue: 0
|
|
||||||
name: "simulate-proof-failures"
|
|
||||||
hidden
|
|
||||||
.}: int
|
|
||||||
|
|
||||||
case persistenceCmd* {.
|
|
||||||
defaultValue: noCmd
|
|
||||||
command }: PersistenceCmd
|
|
||||||
|
|
||||||
of validator:
|
|
||||||
validatorMaxSlots* {.
|
|
||||||
desc: "Maximum number of slots that the validator monitors"
|
|
||||||
defaultValue: 1000
|
|
||||||
name: "validator-max-slots"
|
|
||||||
.}: int
|
|
||||||
|
|
||||||
of PersistenceCmd.noCmd:
|
|
||||||
discard # end of validator
|
|
||||||
|
|
||||||
of StartUpCmd.noCmd:
|
of StartUpCmd.noCmd:
|
||||||
discard # end of persistence
|
discard # end of persistence
|
||||||
|
|
||||||
|
@ -361,6 +358,9 @@ func persistence*(self: CodexConf): bool =
|
||||||
func validator*(self: CodexConf): bool =
|
func validator*(self: CodexConf): bool =
|
||||||
self.persistence and self.persistenceCmd == PersistenceCmd.validator
|
self.persistence and self.persistenceCmd == PersistenceCmd.validator
|
||||||
|
|
||||||
|
func prover*(self: CodexConf): bool =
|
||||||
|
self.persistence and self.persistenceCmd == PersistenceCmd.prover
|
||||||
|
|
||||||
proc getCodexVersion(): string =
|
proc getCodexVersion(): string =
|
||||||
let tag = strip(staticExec("git tag"))
|
let tag = strip(staticExec("git tag"))
|
||||||
if tag.isEmptyOrWhitespace:
|
if tag.isEmptyOrWhitespace:
|
||||||
|
|
Loading…
Reference in New Issue