state-sync uses a simple and reliable pattern:
- Invalidation event indicates that the state “may have changed” and carries:
topicrevision
- The receiver does a pull:
provider.getSnapshot() - The engine applies the snapshot only if it is newer (revision gate).
Why:
- events can arrive out of order
- events can be lost
- the snapshot remains the source of truth
InvalidationEvent
Minimal contract:
topic: stringrevision: Revision(canonical decimalu64string)
SnapshotEnvelope
Minimal contract:
revision: Revisiondata: T
What is a protocol error
The engine reports phase='protocol' when:
topicis empty / not a stringrevisionis not canonical ("01","abc", etc.)
See Troubleshooting and Lifecycle.