Commit graph

4 commits

Author SHA1 Message Date
Daniel Liu
c75623ace7
rpc: add limit for batch request and response size #26681 (#998) 2025-04-28 17:00:30 +08:00
Daniel Liu
02eb1d5375
rpc: improve error codes for internal server errors #25678 (#974)
This changes the error code returned by the RPC server in certain situations:

- handler panic: code -32603
- result marshaling error: code -32603
- attempt to subscribe via HTTP: code -32001

In all of the above cases, the server previously returned the default error
code -32000.

Co-authored-by: Nicholas <nicholas.zhaoyu@gmail.com>
Co-authored-by: Nicholas Zhao <nicholas.zhao@gmail.com>
Co-authored-by: Felix Lange <fjl@twurst.com>
2025-04-24 19:03:29 +08:00
Daniel Liu
1d6b09394b
rpc: check that version is 2.0 in request objects #25570 (#973)
The JSON-RPC spec requires the "version" field to be exactly "2.0",
so we should verify that. This change is not backwards-compatible with
sloppy client implementations, but I decided to go ahead with it anyway
because the failure will be caught via the returned error.

Co-authored-by: Seungbae Yu <dbadoy4874@gmail.com>
2025-04-24 19:02:33 +08:00
Banana-J
39f6e6ee56
upgrade the websocket in xdpos (#349) 2023-11-06 15:37:14 +11:00