hide —simulate-proof-failures behind compile flag

The `--simulate-proof-failures` cli param is now only available when codex is compile using the `-d:codex_enable_proof_failures` flag.
This commit is contained in:
Eric Mastro 2023-04-24 19:38:32 +10:00
parent 04d223ba71
commit 477d4891d8
No known key found for this signature in database
3 changed files with 19 additions and 10 deletions

View File

@ -66,7 +66,7 @@ task testContracts, "Build & run Codex Contract tests":
test "testContracts" test "testContracts"
task testIntegration, "Run integration tests": task testIntegration, "Run integration tests":
codexTask() buildBinary "codex", params = "-d:chronicles_runtime_filtering -d:chronicles_log_level=TRACE -d:codex_enable_proof_failures=true"
test "testIntegration" test "testIntegration"
task test, "Run tests": task test, "Run tests":

View File

@ -138,10 +138,15 @@ proc new(_: type Contracts,
var validator: ?ValidatorInteractions var validator: ?ValidatorInteractions
if config.persistence: if config.persistence:
let purchasing = Purchasing.new(market, clock) let purchasing = Purchasing.new(market, clock)
let proving = if config.simulateProofFailures > 0:
SimulatedProving.new(market, clock, when codex_enable_proof_failures:
config.simulateProofFailures) let proving = if config.simulateProofFailures > 0:
else: Proving.new(market, clock) SimulatedProving.new(market, clock,
config.simulateProofFailures)
else: Proving.new(market, clock)
else:
let proving = Proving.new(market, clock)
let sales = Sales.new(market, clock, proving, repo) let sales = Sales.new(market, clock, proving, repo)
client = some ClientInteractions.new(clock, purchasing) client = some ClientInteractions.new(clock, purchasing)
host = some HostInteractions.new(clock, sales, proving) host = some HostInteractions.new(clock, sales, proving)

View File

@ -34,6 +34,9 @@ import ./stores
export DefaultCacheSizeMiB, net, DefaultQuotaBytes, DefaultBlockTtl, DefaultBlockMaintenanceInterval, DefaultNumberOfBlocksToMaintainPerInterval export DefaultCacheSizeMiB, net, DefaultQuotaBytes, DefaultBlockTtl, DefaultBlockMaintenanceInterval, DefaultNumberOfBlocksToMaintainPerInterval
const
codex_enable_proof_failures* {.booldefine.} = false
type type
StartUpCommand* {.pure.} = enum StartUpCommand* {.pure.} = enum
noCommand, noCommand,
@ -229,12 +232,13 @@ type
defaultValue: 1000 defaultValue: 1000
name: "validator-max-slots" name: "validator-max-slots"
.}: int .}: int
simulateProofFailures* {. simulateProofFailures* {.
desc: "Simulates proof failures once every N proofs. 0 = disabled." desc: "Simulates proof failures once every N proofs. 0 = disabled."
defaultValue: 0 defaultValue: 0
name: "simulate-proof-failures" name: "simulate-proof-failures"
.}: uint hidden
.}: uint
of initNode: of initNode:
discard discard