Skip to content

Commit 92738db

Browse files
rikublockLimpidCrypto
authored andcommitted
fix: increase websocket payload default max size (XRPLF#795)
1 parent c731c16 commit 92738db

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1010
### Fixed
1111
- add `MPTCurrency` support in `Issue` (rippled internal type)
1212
- Fixed the implementation error in get_latest_open_ledger_sequence method. The change uses the "current" ledger for extracting sequence number.
13+
- Increase default maximum payload size for websocket client
1314

1415
### Added
1516
- Improved validation for models to also check param types

xrpl/asyncio/clients/websocket_base.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
from xrpl.models.requests.request import Request
1717
from xrpl.models.response import Response
1818

19+
_PAYLOAD_MAX_SIZE: Final[int] = 2**24
1920
_REQ_ID_MAX: Final[int] = 1_000_000
2021

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

9598
# make a message queue
9699
self._messages = asyncio.Queue()

0 commit comments

Comments
 (0)