Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
c831483
lean: replay per-node consensus streams with a group scheduler
cjen1-msft Nov 10, 2026
1a41b4d
lean: check consensus replay verdicts do not depend on order
cjen1-msft Nov 10, 2026
a24ddeb
lean: order consensus replay by lock order and wall-clock time
cjen1-msft Nov 16, 2026
a60f815
lean: run the consensus reduction rules from a separate driver
cjen1-msft Nov 16, 2026
521a757
lean: check snapshot hooks without reduction state
cjen1-msft Nov 16, 2026
89b0581
lean: keep the consensus reduction rules as they are on main
cjen1-msft Nov 16, 2026
b188551
lean: build a waiting group's diagnostic only when replay is stuck
cjen1-msft Nov 17, 2026
ffa3fa0
lean: start the initialization group at init_as_backup
cjen1-msft Nov 17, 2026
0197e30
lean: drop the consensus replay stream unit test
cjen1-msft Nov 17, 2026
4d09c95
Name the trace envelope's process identifier pid
cjen1-msft Nov 17, 2026
411ddce
Say which releases emit process_id in the pid change note
cjen1-msft Nov 17, 2026
c2ccc91
Name the trace envelope's sequence number m_ts
cjen1-msft Nov 18, 2026
15d0145
lean: make consensus bootstrap one of the reduction rules
cjen1-msft Nov 18, 2026
76a5738
lean: name the replay event fields after the trace fields
cjen1-msft Nov 18, 2026
bc4ba0c
lean: drop the consensus replay order-independence check
cjen1-msft Nov 18, 2026
c799d4e
lean: schedule consensus replay groups per node
cjen1-msft Nov 18, 2026
c066b9f
Tests: per-network ccf.cft trace capture
cjen1-msft Nov 10, 2026
8185424
Recorder: do not stop before queued connections are read
cjen1-msft Nov 10, 2026
19945af
CI: upload ccf.cft trace captures with e2e logs
cjen1-msft Nov 10, 2026
c8f2d5f
Simplify trace capture and guard against an unapplied sink
cjen1-msft Nov 13, 2026
8bf7730
Require records from every node process for a complete capture
cjen1-msft Nov 13, 2026
411c4ee
Say how many nodes were expected in the capture reason
cjen1-msft Nov 13, 2026
3bdccb3
Trace capture: clear stale captures, IPv6 and recovered networks
cjen1-msft Nov 16, 2026
d1dfe9a
Capture the consensus trace of every e2e test
cjen1-msft Nov 16, 2026
76b2c2d
CI: replay e2e consensus traces against the Lean model
cjen1-msft Nov 16, 2026
120260e
Declare NO_CFT_TRACE to the CMake formatter
cjen1-msft Nov 16, 2026
52ae010
Trace capture: read pid and m_ts, and record each event time
cjen1-msft Nov 18, 2026
9b8bba7
CI: build the consensus replayer while the e2e tests run
cjen1-msft Nov 18, 2026
d325e9c
Address review of e2e trace validation
cjen1-msft Nov 18, 2026
d130be8
Share one socket loop between the Fluentd collectors
cjen1-msft Nov 18, 2026
6e40ac8
Write the capture manifest by rename
cjen1-msft Nov 18, 2026
9f3ba1c
Write only complete captures, without a manifest
cjen1-msft Nov 18, 2026
911f384
Tests: per-network ccf.cft trace capture
cjen1-msft Nov 10, 2026
115ec54
Recorder: do not stop before queued connections are read
cjen1-msft Nov 10, 2026
901dfc0
CI: upload ccf.cft trace captures with e2e logs
cjen1-msft Nov 10, 2026
bf9a0ca
Simplify trace capture and guard against an unapplied sink
cjen1-msft Nov 13, 2026
6fee705
Require records from every node process for a complete capture
cjen1-msft Nov 13, 2026
06c2d5d
Say how many nodes were expected in the capture reason
cjen1-msft Nov 13, 2026
5612b7c
Trace capture: clear stale captures, IPv6 and recovered networks
cjen1-msft Nov 16, 2026
8c5f5ee
Capture the consensus trace of every e2e test
cjen1-msft Nov 16, 2026
fc3e915
CI: replay e2e consensus traces against the Lean model
cjen1-msft Nov 16, 2026
70eef38
Declare NO_CFT_TRACE to the CMake formatter
cjen1-msft Nov 16, 2026
fe074ec
Trace capture: read pid and m_ts, and record each event time
cjen1-msft Nov 18, 2026
bfe2e08
CI: build the consensus replayer while the e2e tests run
cjen1-msft Nov 18, 2026
e3c6aa0
Address review of e2e trace validation
cjen1-msft Nov 18, 2026
3841809
Share one socket loop between the Fluentd collectors
cjen1-msft Nov 18, 2026
60717cb
Write the capture manifest by rename
cjen1-msft Nov 18, 2026
1feddaa
Write only complete captures, without a manifest
cjen1-msft Nov 18, 2026
b931022
Merge commit '1feddaa0e1f44f9d75263b3f8c898e894d5a3718' into cjen1-ms…
cjen1-msft Nov 19, 2026
1b08d44
Merge branch 'main' into cjen1-msft-laughing-memory
cjen1-msft Nov 24, 2026
92ac73e
Add non-strict consensus replay reporting a watermark
cjen1-msft Nov 24, 2026
b8a569d
Stream e2e trace captures to disk and gate on the replay watermark
cjen1-msft Nov 24, 2026
64c70aa
Format Parsec.lean
cjen1-msft Nov 24, 2026
b6c1946
Drop the duplicate node id check on trace captures
cjen1-msft Nov 24, 2026
4663640
Record e2e traces with the existing Fluentd collector
cjen1-msft Nov 24, 2026
449cda8
Capture trace events of every tag in e2e tests
cjen1-msft Nov 24, 2026
18991a2
Rename non-strict consensus replay to --lenient
cjen1-msft Nov 24, 2026
bc62ec8
Use job needs instead of polling in cft_replay
achamayou Nov 24, 2026
4fb00c2
Optimize consensus-replay execution and cache binary in CI
achamayou Nov 24, 2026
aca3082
Merge branch 'main' into cjen1-msft-laughing-memory
achamayou Nov 25, 2026
f6d7d21
Move the consensus replay optimisations to a follow-up PR
cjen1-msft Nov 25, 2026
477a536
Merge branch 'main' into cjen1-msft-laughing-memory
cjen1-msft Nov 26, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/workflows/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,11 @@ Upgrades from 7.x, which is only built for Azure Linux 3, are covered by [Cross-

The Virtual A, B, and C jobs target `gha-vmss-d16av7-ci`, `gha-vmss-d16av7-ci-b`, and `gha-vmss-d16av7-ci-c`, respectively, to distribute demand across the regional pools.

End to end tests record each network's trace events, of every tag, and upload the capture with their logs.
The `Replay e2e consensus traces` job runs after the Virtual jobs complete (unless the workflow is cancelled), builds the Lean replayer, and replays the `ccf.cft` events of every capture from their logs against the Lean model with `tests/cft_trace_validation.py`.
A capture may be incomplete, for example if a test killed a node, so the job replays with `--lenient`.
It fails if the model disagrees with a capture, if replay consumes less than 90% of the events of one of a capture's nodes, or if there is no capture.

File: `ci.yml`
3rd party dependencies: elan

Expand Down
51 changes: 51 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ jobs:
build/workspace/*/*.ledger/*
build/workspace/*/*.ledger.*/*
build/workspace/*/stack_trace
build/workspace/*_trace/*.ndjson
build/workspace/**/openapi_coverage.json
if-no-files-found: ignore
if: success() || failure()
Expand Down Expand Up @@ -178,6 +179,7 @@ jobs:
build/workspace/*/*.ledger/*
build/workspace/*/*.ledger.*/*
build/workspace/*/stack_trace
build/workspace/*_trace/*.ndjson
build/workspace/**/openapi_coverage.json
if-no-files-found: ignore
if: success() || failure()
Expand Down Expand Up @@ -258,6 +260,7 @@ jobs:
build/workspace/*/*.ledger/*
build/workspace/*/*.ledger.*/*
build/workspace/*/stack_trace
build/workspace/*_trace/*.ndjson
build/workspace/**/openapi_coverage.json
build/workspace/*_consistency_trace.ndjson
if-no-files-found: ignore
Expand Down Expand Up @@ -357,6 +360,54 @@ jobs:
build/workspace/*/*.ledger/*
build/workspace/*/*.ledger.*/*
build/workspace/*/stack_trace
build/workspace/*_trace/*.ndjson
build/workspace/**/openapi_coverage.json
if-no-files-found: ignore
if: success() || failure()

cft_replay:
name: "Replay e2e consensus traces"
needs: [vmss-virtual-a, vmss-virtual-b, vmss-virtual-c]
Comment thread
achamayou marked this conversation as resolved.
Resolved
# Replay uploaded logs even if a Virtual job fails, but skip if cancelled.
if: ${{ !cancelled() }}
runs-on: ubuntu-26.04
timeout-minutes: 30
defaults:
run:
shell: bash

steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1

- name: Cache CCF consensus replay
id: replay_cache
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: lean/consensus/.lake/build/bin/consensus-replay
key: >-
consensus-replay-${{ runner.os }}-${{ runner.arch }}-${{
hashFiles('lean/lean-toolchain', 'lean/common/**', 'lean/consensus/**')
}}

- name: Install Lean
if: steps.replay_cache.outputs.cache-hit != 'true'
uses: ./.github/actions/install-lean

- name: Build CCF consensus replay
if: steps.replay_cache.outputs.cache-hit != 'true'
working-directory: lean/consensus
run: |
set -euo pipefail
lake build --wfail consensus-replay

- name: Download e2e logs
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
with:
pattern: logs-azurelinux-virtual-*
path: ${{ runner.temp }}/e2e-logs

- name: Validate e2e consensus traces
run: |
set -euo pipefail
python3 tests/cft_trace_validation.py \
lean/consensus/.lake/build/bin/consensus-replay "$RUNNER_TEMP/e2e-logs"
2 changes: 2 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ jobs:
build/workspace/*/*.ledger/*
build/workspace/*/*.ledger.*/*
build/workspace/*/stack_trace
build/workspace/*_trace/*.ndjson
build/workspace/**/openapi_coverage.json
if-no-files-found: ignore
if: success() || failure()
Expand Down Expand Up @@ -302,6 +303,7 @@ jobs:
build/workspace/*/*.ledger/*
build/workspace/*/*.ledger.*/*
build/workspace/*/stack_trace
build/workspace/*_trace/*.ndjson
build/workspace/**/openapi_coverage.json
if-no-files-found: ignore
if: success() || failure()
10 changes: 10 additions & 0 deletions .github/workflows/lean-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,16 @@ jobs:
echo "::endgroup::"
done

- name: Replay an incomplete CCF consensus trace
if: inputs.package == 'consensus'
run: |
set -euo pipefail
cd lean/consensus
replay() { ./.lake/build/bin/consensus-replay --lenient "replay/fixtures/$1"; }
[ "$(replay valid/replication.ndjson | jq .watermark)" = 1 ]
[ "$(replay invalid/missing-packet.ndjson | jq '.watermark < 1')" = true ]
if replay invalid/snapshot-mismatch.ndjson; then exit 1; fi

- name: Check recovery trace fixtures against their schema
if: inputs.package == 'disaster-recovery'
run: |
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/long-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ jobs:
build/workspace/*/*.ledger/*
build/workspace/*/*.ledger.*/*
build/workspace/*/stack_trace
build/workspace/*_trace/*.ndjson
build/workspace/**/openapi_coverage.json
if-no-files-found: ignore

Expand Down Expand Up @@ -131,6 +132,7 @@ jobs:
build/workspace/*/*.ledger/*
build/workspace/*/*.ledger.*/*
build/workspace/*/stack_trace
build/workspace/*_trace/*.ndjson
build/workspace/**/openapi_coverage.json
if-no-files-found: ignore

Expand Down Expand Up @@ -211,6 +213,7 @@ jobs:
build/workspace/*/*.ledger/*
build/workspace/*/*.ledger.*/*
build/workspace/*/stack_trace
build/workspace/*_trace/*.ndjson
build/workspace/**/openapi_coverage.json
build_fuzz/fuzz-artifacts/**
if-no-files-found: ignore
Expand Down Expand Up @@ -270,6 +273,7 @@ jobs:
build/workspace/*/*.ledger/*
build/workspace/*/*.ledger.*/*
build/workspace/*/stack_trace
build/workspace/*_trace/*.ndjson
build/workspace/**/openapi_coverage.json
if-no-files-found: ignore

Expand Down Expand Up @@ -350,5 +354,6 @@ jobs:
build/workspace/*/*.ledger/*
build/workspace/*/*.ledger.*/*
build/workspace/*/stack_trace
build/workspace/*_trace/*.ndjson
build/workspace/**/openapi_coverage.json
if-no-files-found: ignore
1 change: 1 addition & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ jobs:
build/workspace/*/*.ledger/*
build/workspace/*/*.ledger.*/*
build/workspace/*/stack_trace
build/workspace/*_trace/*.ndjson
build/workspace/**/openapi_coverage.json
if-no-files-found: ignore

Expand Down
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1654,6 +1654,8 @@ if(BUILD_TESTS)
PYTHON_SCRIPT ${CMAKE_SOURCE_DIR}/tests/cft_trace_e2e.py
BUCKET bucket_c
BUILD_DEPENDS logging
# Tests exact sink configurations, including none
NO_TRACE_CAPTURE
ADDITIONAL_ARGS --package samples/apps/logging/logging ${FLUENTD_TEST_ARGS}
)

Expand Down Expand Up @@ -1799,6 +1801,8 @@ if(BUILD_TESTS)
LABEL e2e
BUCKET bucket_a
BUILD_DEPENDS js_generic
# Released nodes do not support the trace capture sink
NO_TRACE_CAPTURE
ADDITIONAL_ARGS
${LTS_TEST_ARGS}
--constitution
Expand Down
12 changes: 10 additions & 2 deletions cmake/common.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ function(add_e2e_test)
cmake_parse_arguments(
PARSE_ARGV 0
PARSED_ARGS
"DETECT_DEADLOCKS"
"DETECT_DEADLOCKS;NO_TRACE_CAPTURE"
"NAME;PYTHON_SCRIPT;LABEL;CURL_CLIENT;BUCKET;TSAN_SUPPRESSIONS"
"CONSTITUTION;ADDITIONAL_ARGS;BUILD_DEPENDS;CONFIGURATIONS"
)
Expand All @@ -228,12 +228,20 @@ function(add_e2e_test)
set(PARSED_ARGS_PERF_LABEL ${PARSED_ARGS_NAME})
endif()

# Record each network's trace events for validation.
# Benchmarks expect their own collector to be the nodes' only sink.
set(TRACE_CAPTURE_ARGS --capture-trace)
if(PARSED_ARGS_NO_TRACE_CAPTURE OR "${PARSED_ARGS_LABEL}" STREQUAL "perf")
set(TRACE_CAPTURE_ARGS)
endif()

add_test(
NAME ${PARSED_ARGS_NAME}
COMMAND
${PYTHON_WRAPPER} ${PARSED_ARGS_PYTHON_SCRIPT} -b . --label
${PARSED_ARGS_NAME} ${CCF_NETWORK_TEST_ARGS} ${PARSED_ARGS_CONSTITUTION}
${PARSED_ARGS_ADDITIONAL_ARGS} --tick-ms ${NODE_TICK_MS}
${PARSED_ARGS_ADDITIONAL_ARGS} ${TRACE_CAPTURE_ARGS} --tick-ms
${NODE_TICK_MS}
CONFIGURATIONS ${PARSED_ARGS_CONFIGURATIONS}
)
if(NOT PARSED_ARGS_BUILD_DEPENDS)
Expand Down
2 changes: 1 addition & 1 deletion cmake/gersemi_definitions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ function(add_e2e_test)
cmake_parse_arguments(
PARSE_ARGV 0
PARSED_ARGS
"DETECT_DEADLOCKS"
"DETECT_DEADLOCKS;NO_TRACE_CAPTURE"
"NAME;PYTHON_SCRIPT;LABEL;CURL_CLIENT;BUCKET;TSAN_SUPPRESSIONS"
"CONSTITUTION;ADDITIONAL_ARGS;BUILD_DEPENDS;CONFIGURATIONS"
)
Expand Down
5 changes: 5 additions & 0 deletions lean/common/CCF/Parsec.lean
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,11 @@ def peek : ParserT Event State (Option Event) :=
| .error remaining error => .error remaining error)
: Parser Event (Option Event))

/-- The number of events consumed so far. -/
def position : ParserT Event State Nat :=
liftM (m := Parser Event)
((fun input => .success input input.position) : Parser Event Nat)

/-- Consume one event, or fail with the supplied diagnostic at end of input. -/
def take (message : String := "unexpected end of input") : ParserT Event State Event := do
let some event ← peek | failure message
Expand Down
40 changes: 31 additions & 9 deletions lean/consensus/Consensus/Replay/Groups.lean
Original file line number Diff line number Diff line change
Expand Up @@ -22,43 +22,64 @@ open Reducer
/-- One rule's instructions as a group; bootstrap, a drop or a snapshot hook emits none. -/
private def group : Reduction (Option Group) := do
let some head ← CCF.Parsec.peek | CCF.Parsec.failure "unexpected end of input"
let start ← CCF.Parsec.position
ruleStep
let state ← get
set { state with instructions := #[] }
if state.instructions.isEmpty then return none
return some
{
node := head.node,
start,
m_ts := head.m_ts,
ts := head.ts,
instructions := state.instructions
}

/-- One node's events. Every event is consumed; an ungrouped event is never a stutter. -/
private def node : Reduction (Array Group) := do
/--
One node's groups and the number of its events they consume: all of them unless `lenient`, as
an ungrouped event is never a stutter.
-/
private def node (lenient : Bool) : Reduction (Array Group × Nat) := do
let groups ← CCF.Parsec.many group
if let some event ← CCF.Parsec.peek then
CCF.Parsec.failure s!"{event.record.location}: ungrouped event {event.function}"
return (groups.filterMap id).toArray
unless lenient do
if let some event ← CCF.Parsec.peek then
CCF.Parsec.failure s!"{event.record.location}: ungrouped event {event.function}"
return ((groups.filterMap id).toArray, ← CCF.Parsec.position)

/-- Prepared initialization and each node's groups for direct model replay. -/
structure Reduced where
header : Header
queues : Array (Array Group)
/-- Each node's events, and how many of them its groups consume. -/
events : Array (Nat × Nat)

/--
The least fraction of a node's events that replay consumed, having run `ran` groups of
each node: 1 unless replay is lenient.
-/
def Reduced.watermark (reduced : Reduced) (ran : Array Nat) : Float :=
((reduced.queues.zip reduced.events).zip ran).foldl
(fun low ((groups, total, consumed), ran) =>
let consumed := (groups[ran]?.map (·.start)).getD consumed
min low (consumed.toFloat / total.toFloat))
1

/--
Prepare replay identities and reduce each node's events into its queue of groups.
Request IDs continue across nodes, so they are unique in the trace.
If `lenient`, a node's groups end before its first event that no rule consumes.
-/
def reduce (streams : Array (Array Event)) (declared : List String)
def reduce (streams : Array (Array Event)) (declared : List String) (lenient := false)
: Except String Reduced := do
let header : Header := { bootstrap := ∅, declared }
let mut bootstrap := none
let mut queues := #[]
let mut counts := #[]
let mut nextRequestId := 1
for events in streams do
let (found, state) ←
(CCF.Parsec.run events (node.run { header, nextRequestId })).mapError
let ((found, consumed), state) ←
(CCF.Parsec.run events ((node lenient).run { header, nextRequestId })).mapError
fun error =>
match events.back? with
| some last =>
Expand All @@ -72,9 +93,10 @@ def reduce (streams : Array (Array Event)) (declared : List String)
throw s!"nodes '{other}' and '{leader}' both bootstrap the network"
bootstrap := some leader
queues := queues.push found
counts := counts.push (events.size, consumed)
nextRequestId := state.nextRequestId
let some leader := bootstrap | throw "no node bootstraps the network"
let header := { header with bootstrap := {← header.nodeId leader} }
return { header, queues }
return { header, queues, events := counts }

end Consensus.Replay
8 changes: 6 additions & 2 deletions lean/consensus/Consensus/Replay/Input.lean
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,15 @@ def Event.origin (event : Event) (rule : String) : Origin :=
{ file := event.record.file, line := event.record.line, rule }

/--
Order each process's records by `m_ts`, skip driver command records, split events into
per-node streams sorted by node, and collect node identities.
Order each process's records by `m_ts`, skip driver command records and records with a
`tag` other than `ccf.cft`, split events into per-node streams sorted by node, and collect
node identities.
-/
def prepareEvents (records : Array Record)
: Except String (Array (Array Event) × List String) := do
let records :=
records.filter
fun record => (optional record.value "tag").all (· == Json.str "ccf.cft")
let keyed ←
records.mapM
fun record =>
Expand Down
16 changes: 12 additions & 4 deletions lean/consensus/Consensus/Replay/Interpreter.lean
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ lock.
structure Group where
/-- The node whose lock hold this is. -/
node : String
/-- Index of the head event among its node's events. -/
start : Nat
/-- `m_ts` of the head event: where the group starts in its process's order. -/
m_ts : Nat
/-- `ts` of the head event, when the trace records it. -/
Expand Down Expand Up @@ -421,7 +423,8 @@ private def runGroup (header : Header) (replay : ReplayState) (group : Group)
replay

structure Result where
groups : Nat
/-- Groups run of each node, fewer than it has only if replay is lenient. -/
ran : Array Nat
actions : Nat
observations : Nat
deriving Repr, BEq
Expand Down Expand Up @@ -469,8 +472,9 @@ makes diagnostics reproducible, as counters of different processes are not compa
A group's node changes only through its own groups, other nodes only add packets it may
receive, and a committed prefix stays committed, so the verdict does not depend on which
enabled group runs.
If `lenient`, replay ends without failing once no group may run.
-/
def schedule (header : Header) (queues : Array (Array Group))
def schedule (header : Header) (queues : Array (Array Group)) (lenient := false)
: ExceptT String (StateM (Array Group)) Result := do
unless !header.declared.isEmpty
&& header.declared.all (!·.isEmpty)
Expand Down Expand Up @@ -503,13 +507,17 @@ def schedule (header : Header) (queues : Array (Array Group))
| some reason => blocked := blocked.push (group, reason)
let some (group, queue) := chosen
|
if lenient then
break
let rest := queues.zipIdx.flatMap fun (groups, queue) => groups.extract next[queue]!
throw (stuck rest blocked)
modify (·.push group)
state ← ofExcept (runGroup header state group)
next := next.modify queue (· + 1)
let instructions := queues.flatMap (·.flatMap (·.instructions))
let instructions :=
queues.zipIdx.flatMap
fun (groups, queue) => (groups.extract 0 next[queue]!).flatMap (·.instructions)
let actions := (instructions.filter (· matches .action ..)).size
return { groups := total, actions, observations := instructions.size - actions }
return { ran := next, actions, observations := instructions.size - actions }

end Consensus.Replay
Loading