@@ -216,11 +216,12 @@ respondEither cfg@ProxyConfig{statsVar, boosterState} booster kore req = case re
216
216
SimplifyResult
217
217
{ state = koreRes. state
218
218
, logs =
219
- combineLogs
220
- [ timing
221
- , boosterRes. logs
222
- , map RPCLog. logEntryEraseTerms <$> koreRes. logs
223
- ]
219
+ postProcessLogs
220
+ <$> combineLogs
221
+ [ timing
222
+ , boosterRes. logs
223
+ , koreRes. logs
224
+ ]
224
225
}
225
226
koreError ->
226
227
-- can only be an error
@@ -287,6 +288,9 @@ respondEither cfg@ProxyConfig{statsVar, boosterState} booster kore req = case re
287
288
in Execute result'
288
289
other -> other
289
290
291
+ postProcessLogs :: [RPCLog. LogEntry ] -> [RPCLog. LogEntry ]
292
+ postProcessLogs ! logs = map RPCLog. logEntryEraseTerms . filter (not . isSimplificationLogEntry) $ logs
293
+
290
294
executionLoop ::
291
295
LogSettings ->
292
296
KoreDefinition ->
@@ -319,7 +323,12 @@ respondEither cfg@ProxyConfig{statsVar, boosterState} booster kore req = case re
319
323
Left logsOnly -> do
320
324
-- state was simplified to \bottom, return vacuous
321
325
Log. logInfoNS " proxy" " Vacuous state after simplification"
322
- pure . Right . Execute $ makeVacuous logsOnly boosterResult
326
+ pure . Right . Execute $
327
+ makeVacuous
328
+ ( postProcessLogs
329
+ <$> logsOnly
330
+ )
331
+ boosterResult
323
332
Right (simplifiedBoosterState, boosterStateSimplificationLogs) -> do
324
333
let accumulatedLogs =
325
334
combineLogs
@@ -333,7 +342,8 @@ respondEither cfg@ProxyConfig{statsVar, boosterState} booster kore req = case re
333
342
( currentDepth + boosterResult. depth
334
343
, time + bTime
335
344
, koreTime
336
- , accumulatedLogs
345
+ , postProcessLogs
346
+ <$> accumulatedLogs
337
347
)
338
348
r{ExecuteRequest. state = execStateToKoreJson simplifiedBoosterState}
339
349
-- if we stop for a reason in fallbackReasons (default [Aborted, Stuck, Branching],
@@ -348,7 +358,7 @@ respondEither cfg@ProxyConfig{statsVar, boosterState} booster kore req = case re
348
358
Left logsOnly -> do
349
359
-- state was simplified to \bottom, return vacuous
350
360
Log. logInfoNS " proxy" " Vacuous state after simplification"
351
- pure . Right . Execute $ makeVacuous logsOnly boosterResult
361
+ pure . Right . Execute $ makeVacuous (postProcessLogs <$> logsOnly) boosterResult
352
362
Right (simplifiedBoosterState, boosterStateSimplificationLogs) -> do
353
363
-- attempt to do one step in the old backend
354
364
(kResult, kTime) <-
@@ -378,14 +388,15 @@ respondEither cfg@ProxyConfig{statsVar, boosterState} booster kore req = case re
378
388
[ rpcLogs
379
389
, boosterResult. logs
380
390
, boosterStateSimplificationLogs
381
- , map RPCLog. logEntryEraseTerms . filter ( not . isSimplificationLogEntry) <$> koreResult. logs
391
+ , koreResult. logs
382
392
, fallbackLog
383
393
]
384
394
loopState newLogs =
385
395
( currentDepth + boosterResult. depth + koreResult. depth
386
396
, time + bTime + kTime
387
397
, koreTime + kTime
388
- , combineLogs $ accumulatedLogs : newLogs
398
+ , postProcessLogs
399
+ <$> combineLogs (accumulatedLogs : newLogs)
389
400
)
390
401
continueWith newLogs nextState =
391
402
executionLoop
@@ -451,12 +462,13 @@ respondEither cfg@ProxyConfig{statsVar, boosterState} booster kore req = case re
451
462
result
452
463
{ depth = currentDepth + boosterResult. depth + koreResult. depth
453
464
, logs =
454
- combineLogs
455
- [ rpcLogs
456
- , boosterResult. logs
457
- , map RPCLog. logEntryEraseTerms <$> result. logs
458
- , fallbackLog
459
- ]
465
+ postProcessLogs
466
+ <$> combineLogs
467
+ [ rpcLogs
468
+ , boosterResult. logs
469
+ , map RPCLog. logEntryEraseTerms <$> result. logs
470
+ , fallbackLog
471
+ ]
460
472
}
461
473
-- can only be an error at this point
462
474
res -> pure res
@@ -477,7 +489,7 @@ respondEither cfg@ProxyConfig{statsVar, boosterState} booster kore req = case re
477
489
( currentDepth + boosterResult. depth
478
490
, time + bTime
479
491
, koreTime
480
- , combineLogs $ rpcLogs : boosterResult. logs : newLogs
492
+ , postProcessLogs <$> combineLogs ( rpcLogs : boosterResult. logs : newLogs)
481
493
)
482
494
r{ExecuteRequest. state = nextState}
483
495
Right result -> do
@@ -486,7 +498,7 @@ respondEither cfg@ProxyConfig{statsVar, boosterState} booster kore req = case re
486
498
Execute
487
499
result
488
500
{ depth = currentDepth + boosterResult. depth
489
- , logs = combineLogs [rpcLogs, result. logs]
501
+ , logs = postProcessLogs <$> combineLogs [rpcLogs, result. logs]
490
502
}
491
503
-- can only be an error at this point
492
504
res -> pure res
0 commit comments