Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: increase websocket payload default max size #795

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [[Unreleased]]

### Fixed
- Increase default maximum payload size for websocket client

## [4.0.0] - 2024-12-23

### Added
Expand Down
5 changes: 4 additions & 1 deletion xrpl/asyncio/clients/websocket_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
from xrpl.models.requests.request import Request
from xrpl.models.response import Response

_PAYLOAD_MAX_SIZE: Final[int] = 2**24
_REQ_ID_MAX: Final[int] = 1_000_000

# the types from asyncio are not implemented as generics in python 3.8 and
Expand Down Expand Up @@ -90,7 +91,9 @@ def is_open(self: Self) -> bool:
async def _do_open(self: Self) -> None:
"""Connects the client to the Web Socket API at its URL."""
# open the connection
self._websocket = await websocket_client.connect(self.url)
self._websocket = await websocket_client.connect(
self.url, max_size=_PAYLOAD_MAX_SIZE
)

# make a message queue
self._messages = asyncio.Queue()
Expand Down
Loading