aboutsummaryrefslogtreecommitdiffstats
path: root/packages/meshbay-cli/src/meshbay_cli/client/session.py
diff options
context:
space:
mode:
authorChristophe Besson <cbesson@gmail.com>2026-10-16 10:41:17 +0200
committerChristophe Besson <cbesson@gmail.com>2026-10-16 10:41:17 +0200
commitd74d371bd7c0ed25f60754e475a78975bf2dc4ee (patch)
tree88f732b318ebe7fef1e684eb28ae780baec4233b /packages/meshbay-cli/src/meshbay_cli/client/session.py
parent2167b7cd7ec006ba3f736bc18970f86f15d88a2a (diff)
downloadmeshbay-d74d371bd7c0ed25f60754e475a78975bf2dc4ee.tar.gz
perf: linear SCTP reassembly, one SACK every second packet, 4 MB buffer in the CLI
aiortc walked a message's fragments after each one arrived (n^2/2 steps for a 1 MiB chunk) and acknowledged every packet. Measured on loopback, 400 MB to the CLI: 19 MB/s before, 39 after (49 by the node's count); uploads from the CLI 25 -> 29 MB/s. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'packages/meshbay-cli/src/meshbay_cli/client/session.py')
-rw-r--r--packages/meshbay-cli/src/meshbay_cli/client/session.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/packages/meshbay-cli/src/meshbay_cli/client/session.py b/packages/meshbay-cli/src/meshbay_cli/client/session.py
index d10acc8..b6fc9e2 100644
--- a/packages/meshbay-cli/src/meshbay_cli/client/session.py
+++ b/packages/meshbay-cli/src/meshbay_cli/client/session.py
@@ -63,6 +63,7 @@ from meshbay_common.handshake import (
from meshbay_common.join import join_transcript
from ..errors import NODE, NODE_KEY, VERSION, CliError
+from . import sctp_fix, udp_buffer # noqa: F401 (patch aiortc and aioice on import)
from .account import Account
from .keys import (
LEGACY_MAGIC,
@@ -250,6 +251,13 @@ class GroupSession:
raise CliError(NODE, "The group's index does not open under the group key; "
"the session is ended.") from e
+ def open_delta(self, msg: dict) -> dict:
+ """A pushed `index_delta`, opened under the group key."""
+ try:
+ return unseal(self.gek, PURPOSE_INDEX, "index_delta", self.group_id, msg)
+ except Exception as e:
+ raise CliError(NODE, "An index update does not open under the group key.") from e
+
async def close(self) -> None:
with contextlib.suppress(Exception):
await self.pc.close()