You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: EPAXOS.MD
+4-2Lines changed: 4 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -78,9 +78,11 @@ User commands are emitted to the embedding application through `Ready.Committed`
78
78
79
79
## Ready contract
80
80
81
-
`Ready.Records` are durable consensus state. `Ready.Messages` are transport work. `Ready.Committed` contains user commands that have passed dependency execution and must be applied by the embedding application before they are acknowledged. The embedding application must persist records before sending messages from the same `Ready`. `MustSync` is true when durable records are present.
81
+
`Ready.Records` are durable consensus state. `Ready.Messages` are transport work. `Ready.Committed` contains user commands that have passed dependency execution and must be applied by the embedding application before they are acknowledged. The embedding application must persist every record in a returned `Ready`before sending messages or acknowledging committed commands from that same batch. `MustSync` is true when durable records are present.
82
82
83
-
`Advance` acknowledges the obligations in the previously returned `Ready`. For user commands, `Advance` queues the corresponding `StatusExecuted` records only after the application has observed `Ready.Committed`; those executed markers appear in a later `Ready.Records` batch and make replay after restart idempotent. Configuration changes and no-op commands do not appear in `Ready.Committed`; their executed records are queued internally when they execute.
83
+
`Advance` returns an error and acknowledges only an exact prefix of the outstanding `Ready`. The acknowledged values must match the records, messages, committed commands, and `MustSync` bit returned by `Ready`; otherwise `Advance` returns `ErrInvalidReady` and leaves the outstanding batch unchanged for retry. A record-only prefix is valid, which lets storage persist part of a batch without marking application commands executed. `Messages` or `Committed` acknowledgements are accepted only after all earlier `Records` from that outstanding batch are acknowledged. When `MaxReadyMessages` caps `Ready.Messages`, records and committed commands still appear in full; after their successful acknowledgement the remaining message tail appears in later `Ready` batches with `MustSync` false.
84
+
85
+
For user commands, `Advance` queues the corresponding `StatusExecuted` records only after the application has observed and acknowledged `Ready.Committed`; those executed markers appear in a later `Ready.Records` batch and make replay after restart idempotent. Configuration changes and no-op commands do not appear in `Ready.Committed`; their executed records are queued internally when they execute.
Copy file name to clipboardExpand all lines: MODEL_EQ_REPORT.MD
+19-18Lines changed: 19 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,19 +6,19 @@ This report maps the current finite TLA+ safety model to the current Go implemen
6
6
7
7
| Model anchor | Implementation anchor | Evidence |
8
8
| --- | --- | --- |
9
-
|`tla/EPaxos.tla:32` TLA Init |`epaxos/node.go:98` Go node construction | Initialization sets empty instance state before transport steps; Go also restores durable state and configuration history before accepting input. |
9
+
|`tla/EPaxos.tla:32` TLA Init |`epaxos/node.go:99` Go node construction | Initialization sets empty instance state before transport steps; Go also restores durable state and configuration history before accepting input. |
10
10
|`tla/EPaxos.tla:9` TLA Conflicts |`epaxos/types.go:150` Go command conflict predicate and `examples/kv/kv.go:368` KV transaction command construction | The model configures command membership in conflict-key sets; Go conflicts commands by shared conflict-key bytes, and KV transactions deduplicate EPAXOS conflict keys while preserving every payload operation in order. |
11
-
|`tla/EPaxos.tla:18` TLA SafeDeps |`epaxos/node.go:729` Go attribute computation | Both model and implementation require known conflicting commands to appear in dependency attributes. |
12
-
|`tla/EPaxos.tla:42` TLA PreAccept |`epaxos/node.go:257` Go proposal path | Local proposal computes attributes, persists pre-accepted records, indexes conflicts, and emits pre-accept messages. |
13
-
|`tla/EPaxos.tla:42` TLA PreAccept receive |`epaxos/node.go:422` Go pre-accept handler | Remote pre-accept merges local conflicts with proposer attributes and stores the pre-accepted value. |
14
-
|`tla/EPaxos.tla:54` TLA Accept |`epaxos/node.go:478` Go accept handler | Accept stores slow-path attributes unless the instance is already committed or promised higher. |
15
-
|`tla/EPaxos.tla:63` TLA Commit |`epaxos/node.go:522` Go commit handler | Commit stores final value/attributes and invokes dependency-closed execution. |
16
-
|`tla/EPaxos.tla:69` TLA Prepare |`epaxos/node.go:535` Go prepare handler | Prepare persists higher promises and returns local accepted/committed state for recovery; TLA abstracts this as the ballot-raising recovery step. |
17
-
| Not represented in current TLA safety model |`epaxos/node.go:561` Go prepare response handler | Recovery response quorum handling is verified by Go tests, but the current TLA model abstracts away recovery quorum collection. |
18
-
|`tla/EPaxos.tla:76` TLA Execute |`epaxos/node.go:836` Go executor and `epaxos/node.go:367` Ready acknowledgement | Execution collapses committed dependency SCCs; user commands are emitted through `Ready.Committed`, and durable `StatusExecuted` records are emitted only after `Advance` acknowledges application. |
19
-
|`tla/EPaxos.tla:96` TLA DependencyClosure |`epaxos/node.go:936` Go component readiness | Component readiness requires outside committed dependencies to be executed before application emission. |
20
-
|`tla/EPaxos.tla:98` TLA ConflictOrder |`epaxos/types.go:150` Go command conflict predicate and `epaxos/node.go:985` Go dependency references | Both require conflicting executed commands to be ordered by dependencies; Go interprets dependency vectors as known per-replica prefixes through configuration history. |
21
-
|`tla/EPaxos.tla:83` TLA Tick |`epaxos/node.go:237` Go logical tick | Tick advances logical time and dispatches logical timers; no wall-clock API is used in the core. |
11
+
|`tla/EPaxos.tla:18` TLA SafeDeps |`epaxos/node.go:828` Go attribute computation | Both model and implementation require known conflicting commands to appear in dependency attributes. |
12
+
|`tla/EPaxos.tla:42` TLA PreAccept |`epaxos/node.go:258` Go proposal path | Local proposal computes attributes, persists pre-accepted records, indexes conflicts, and emits pre-accept messages. |
13
+
|`tla/EPaxos.tla:42` TLA PreAccept receive |`epaxos/node.go:521` Go pre-accept handler | Remote pre-accept merges local conflicts with proposer attributes and stores the pre-accepted value. |
14
+
|`tla/EPaxos.tla:54` TLA Accept |`epaxos/node.go:577` Go accept handler | Accept stores slow-path attributes unless the instance is already committed or promised higher. |
15
+
|`tla/EPaxos.tla:63` TLA Commit |`epaxos/node.go:621` Go commit handler | Commit stores final value/attributes and invokes dependency-closed execution. |
16
+
|`tla/EPaxos.tla:69` TLA Prepare |`epaxos/node.go:634` Go prepare handler | Prepare persists higher promises and returns local accepted/committed state for recovery; TLA abstracts this as the ballot-raising recovery step. |
17
+
| Not represented in current TLA safety model |`epaxos/node.go:660` Go prepare response handler | Recovery response quorum handling is verified by Go tests, but the current TLA model abstracts away recovery quorum collection. |
18
+
|`tla/EPaxos.tla:76` TLA Execute |`epaxos/node.go:935` Go executor and `epaxos/node.go:368` Ready acknowledgement | Execution collapses committed dependency SCCs; user commands are emitted through `Ready.Committed`, and durable `StatusExecuted` records are emitted only after `Advance` validates the acknowledged Ready prefix and acknowledges application. |
19
+
|`tla/EPaxos.tla:96` TLA DependencyClosure |`epaxos/node.go:1035` Go component readiness | Component readiness requires outside committed dependencies to be executed before application emission. |
20
+
|`tla/EPaxos.tla:98` TLA ConflictOrder |`epaxos/types.go:150` Go command conflict predicate and `epaxos/node.go:1084` Go dependency references | Both require conflicting executed commands to be ordered by dependencies; Go interprets dependency vectors as known per-replica prefixes through configuration history. |
21
+
|`tla/EPaxos.tla:83` TLA Tick |`epaxos/node.go:238` Go logical tick | Tick advances logical time and dispatches logical timers; no wall-clock API is used in the core. |
22
22
| Not represented in current TLA safety model |`epaxos/checksum.go:65` Go record checksum | Durable record checksum coverage is implementation validation rather than modeled state. |
23
23
| Not represented in current TLA safety model |`epaxos/checksum.go:84` Go message checksum | Transport checksum coverage is implementation validation rather than modeled state. |
24
24
| Not represented in current TLA safety model |`epaxos/codec.go:41` Go decoder | Wire-decoder input tolerance and error-path destination cleanup are implementation validation rather than modeled state. |
@@ -30,15 +30,16 @@ This report maps the current finite TLA+ safety model to the current Go implemen
30
30
31
31
## Current verification evidence
32
32
33
-
- Observed `tests/ci.sh` passing after the storage-fault hardening changes. The gate ran root Go tests, root coverage at 100.0%, example Go tests, example coverage at 100.0%, tagged kvnode tests, root/example/kvnode race checks, TLC model checks, local Jepsen restart, transport, and storage profiles, and the repository text audit.
34
-
- Observed `go test ./epaxos` passing with deterministic randomized simulation coverage for three- and five-node clusters, duplicate/drop/reorder delivery, logical ticks, restarts, dependency-vector prefix execution ordering, Ready/Advance durability, allocation/pool ownership assertions, decoder fuzz seeds, and decoder error cleanup.
35
-
- Observed `go test ./examples/kv` and `go test -tags kvnode ./examples/kv/cmd/kvnode` passing with KV duplicate-key transaction payload-order semantics, deduplicated EPAXOS conflict keys, post-Advance executed-record persistence, negative scan-limit rejection, transport fault-route coverage, and storage fault-route coverage that rejects work before RawNode progress.
36
-
- Observed `go test ./epaxos -coverprofile=coverage.out -count=1` reporting 100.0% statement coverage and `go tool cover -func=coverage.out` reporting `Advance` at 100.0% after the executed-record acknowledgement cap test.
33
+
- Observed `tests/ci.sh` passing after the strict Ready acknowledgement and durable in-process cluster changes. The gate ran root Go tests, root coverage at 100.0%, example Go tests, example coverage at 100.0%, tagged kvnode tests, root/example/kvnode race checks, TLC model checks, local Jepsen restart, transport, and storage profiles, and the repository text audit.
34
+
- Observed `go test ./epaxos` passing with deterministic randomized simulation coverage for three- and five-node clusters, duplicate/drop/reorder delivery, logical ticks, restarts, dependency-vector prefix execution ordering, Ready/Advance durability, strict Ready acknowledgement validation, allocation/pool ownership assertions, decoder fuzz seeds, and decoder error cleanup.
35
+
- Observed `go test ./examples/kv` and `go test -tags kvnode ./examples/kv/cmd/kvnode` passing with KV duplicate-key transaction payload-order semantics, deduplicated EPAXOS conflict keys, durable in-process cluster restart through Pebble-backed EPaxOS storage, post-Advance executed-record persistence, negative scan-limit rejection, transport fault-route coverage, and storage fault-route coverage that rejects work before RawNode progress.
36
+
- Observed `go test ./epaxos -coverprofile=coverage.out -count=1` reporting 100.0% statement coverage and `go tool cover -func=coverage.out` reporting `Advance`, `validateReadyAck`, `commandEqual`, and `instanceNumsEqual` at 100.0% after strict acknowledgement mismatch tests.
37
+
- Observed `go test ./examples/kv -coverprofile=coverage.out -count=1` reporting 100.0% statement coverage and `go tool cover -func=coverage.out` reporting `drainWithLimit` at 100.0% after the durable-applier acknowledgement-error test.
37
38
- Observed `tests/tla_model_check.sh` running TLC for `tla/EPaxos.cfg` with 11162 generated states and 2002 distinct states, `tla/EPaxosKVConflict.cfg` with 3042650 generated states and 166034 distinct states, `tla/EPaxosThreeReplica.cfg` with 1104121 generated states and 123821 distinct states, and `tla/Quorum.cfg` with 2 generated states and 1 distinct state; all completed with no invariant violation.
38
39
- Observed targeted `lein test moreconsensus.epaxos-test-test` from `jepsen` passing 26 tests with 67 assertions for register delete normalization, indeterminate mutation response classification, transaction body encoding, grouped reads, scan shape checking, restart fault selection, transport fault selection, storage fault selection, client/nemesis routing, restart nemesis behavior, transport nemesis control requests, and storage nemesis control requests.
Copy file name to clipboardExpand all lines: README.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# moreconsensus
2
2
3
-
`moreconsensus` is a Go library for building replicated services with Egalitarian Paxos (EPaxos). The public API follows the shape of etcd raft: applications drive a deterministic `RawNode`, persist `Ready` records, send `Ready` messages, apply committed commands, and then call `Advance`.
3
+
`moreconsensus` is a Go library for building replicated services with Egalitarian Paxos (EPaxos). The public API follows the shape of etcd raft: applications drive a deterministic `RawNode`, persist `Ready` records, send `Ready` messages, apply committed commands, and then call `Advance` with the acknowledged `Ready` prefix.
0 commit comments