aboutsummaryrefslogtreecommitdiffstats
path: root/packages/meshbay-common/src
diff options
context:
space:
mode:
Diffstat (limited to 'packages/meshbay-common/src')
-rw-r--r--packages/meshbay-common/src/meshbay_common/__init__.py7
-rw-r--r--packages/meshbay-common/src/meshbay_common/protocol.py10
2 files changed, 14 insertions, 3 deletions
diff --git a/packages/meshbay-common/src/meshbay_common/__init__.py b/packages/meshbay-common/src/meshbay_common/__init__.py
index ef0f1f6..60a9dc7 100644
--- a/packages/meshbay-common/src/meshbay_common/__init__.py
+++ b/packages/meshbay-common/src/meshbay_common/__init__.py
@@ -1,5 +1,8 @@
"""MeshBay common — shared crypto primitives and protocol types."""
-__version__ = "0.4.0"
-MNP_VERSION = "0.1"
+__version__ = "0.5.0"
+# 0.2: added PING/PONG, and `before`/`has_more` on chat history. Both are
+# additive — an 0.1 peer sends no `before` and gets the newest page, which is
+# what it wanted — so this is a MINOR bump, not a MAJOR one.
+MNP_VERSION = "0.2"
MHP_VERSION = "0.1"
diff --git a/packages/meshbay-common/src/meshbay_common/protocol.py b/packages/meshbay-common/src/meshbay_common/protocol.py
index b5a54ff..1aadafe 100644
--- a/packages/meshbay-common/src/meshbay_common/protocol.py
+++ b/packages/meshbay-common/src/meshbay_common/protocol.py
@@ -27,8 +27,16 @@ class MNP:
STREAM_SEGMENT = "stream_seg" # HLS/DASH segment
CHAT_MESSAGE = "chat_msg" # Double Ratchet message
CHAT_ATTACHMENT = "chat_attach" # attachment metadata
- CHAT_HISTORY = "chat_hist" # request message history
+ CHAT_HISTORY = "chat_hist" # request message history (newest, or before a cursor)
CHAT_HISTORY_RESPONSE = "chat_hist_resp" # history response with messages
+ # Liveness on an *already open* channel. A peer that goes away without
+ # closing leaves a DataChannel that still reads as connected until the next
+ # real request hangs, and there was no way to ask. This is not a discovery
+ # mechanism: opening a connection in order to ping costs a full ICE/DTLS
+ # handshake (measured at 0.6-7 s across two ISPs), so presence in the group
+ # list comes from the hub's socket registry instead.
+ PING = "ping"
+ PONG = "pong"
# GEK_REQUEST / GEK_RESPONSE were removed (NS3, and finding L1): the node must
# never serve the GEK in plaintext. Members obtain it by unwrapping their own
# ECIES bundle. The constants lingered after the handlers were deleted, leaving