Commit graph

13154 commits

Author SHA1 Message Date
Daniel Liu
1472f3b1eb
docs: add document for JSONRPC API (#1027)
* docs: add document for module XDPoS

* docs: add document for module admin

* docs: add document for module debug

* docs: add document for module eth

* docs: add document for module miner

* docs: add document for module net

* docs: add document for module personal

* docs: add document for module rpc

* docs: remove module shh

* docs: add document for module txpool
2025-05-19 15:30:52 +08:00
JukLee0ira
47dae16a40
node: add JWT secret log line #25095 (#1036) 2025-05-16 12:03:11 +08:00
JukLee0ira
c145287e87
node: allow JWT pass by file only #24579 (#1035) 2025-05-16 12:01:36 +08:00
JukLee0ira
d81a5b6be1
docs: fix document for contract XDCValidator (#1034) 2025-05-15 19:15:50 +08:00
Daniel Liu
4fabc43a01
core/vm: fix invalid merkle root caused by PR #627 (#1033) 2025-05-14 16:47:53 +08:00
JukLee0ira
96c23408a5
docs: add document for contract XDCValidator (#1032) 2025-05-13 12:45:26 +08:00
JukLee0ira
7a659c9e7d
node: change JWT error status to 401 Unauthorized #25629 (#1029) 2025-05-08 16:24:41 +08:00
Daniel Liu
fbd4364fc3
cmd, debug: fix debug_verbosity (#1030) 2025-05-08 16:10:53 +08:00
Daniel Liu
c70186be18
internal/web3ext: remove deprecated debug api (#1031)
* internal/web3ext: remove debug api backtraceAt

* internal/web3ext: remove debug api setMutexProfileRate
2025-05-08 15:58:44 +08:00
JukLee0ira
fe422720f3
cmd, node: implement --authrpc-vhosts flag #24506 (#1028) 2025-05-08 11:13:44 +08:00
Wanwiset Peerapatanapokin
d21406c43e
Merge pull request #917 from XinFinOrg/update-reward-api
add new api XDPoS_getRewardByAccount
2025-05-07 15:29:32 +04:00
Wanwiset Peerapatanapokin
a9199d4140
Merge pull request #944 from nghiangovan/dev-upgrade
add-epoch-number-for-XDPoS_getMasternodesByNumber
2025-05-07 15:28:59 +04:00
Daniel Liu
266cf85510
rpc: remove deprecated method Notifier.Closed #29162 (#1022)
Co-authored-by: Undefinedor <wanghao@imwh.net>
2025-05-06 09:44:20 +08:00
Daniel Liu
f19813e3ee
rpc: run tests in parallel #30384 (#1021)
Continuation of https://github.com/ethereum/go-ethereum/pull/30381

Co-authored-by: Håvard Anda Estensen <haavard.ae@gmail.com>
2025-05-06 09:41:42 +08:00
wanwiset25
576bdfff79 change method and handle case with no reward 2025-05-05 18:09:29 +04:00
benjamin202410
3cea40cf9d
fix: owner and foundation same address for reward (#1024)
Co-authored-by: liam.lai <liam.lai@us>
2025-05-01 08:46:09 -07:00
Daniel Liu
d25c6f02a7
all: not copy loop var for golang v1.22 (#1020) 2025-04-29 17:27:36 +08:00
Daniel Liu
d955e17cd6
rpc: add timeout to rpc client Unsubscribe #30318 (#1019)
Fixes #30156

This adds a repro of the linked issue. I fixed it by adding a timeout
when issuing the call to unsubscribe.

Co-authored-by: lightclient <14004106+lightclient@users.noreply.github.com>
2025-04-29 17:26:34 +08:00
Daniel Liu
4c805e5968
rpc: show more error detail for invalidMessageError #30191 (#1018)
Here we add distinct error messages for network timeouts and JSON parsing errors.
Note this specifically applies to HTTP connections serving a single RPC request.

Co-authored-by: zhiqiangxu <652732310@qq.com>
Co-authored-by: Felix Lange <fjl@twurst.com>
2025-04-29 17:25:43 +08:00
Daniel Liu
445d9b37d3
rpc: truncate call error data logs #30028 (#1017)
Co-authored-by: Ceyhun Onur <ceyhun.onur@avalabs.org>
Co-authored-by: Felix Lange <fjl@twurst.com>
2025-04-29 17:14:14 +08:00
Daniel Liu
84b731fc23
rpc: close Clients in tests #29512 (#1016)
Co-authored-by: Darioush Jalali <darioush.jalali@avalabs.org>
2025-04-29 17:13:29 +08:00
Daniel Liu
fd42d8b292
rpc: implement Unwrap() for wsHandshakeError #29522 (#1015)
Co-authored-by: Marcus Baldassarre <baldassarremarcus@gmail.com>
2025-04-29 17:12:33 +08:00
Daniel Liu
c0747977e2
rpc: fix ipc max path size #29385 (#1014)
Co-authored-by: Miles Chen <fearlesschenc@gmail.com>
2025-04-29 17:11:33 +08:00
Daniel Liu
fa39dac391
rpc: fix leak by close http body #29223 (#1013) 2025-04-29 17:10:12 +08:00
Daniel Liu
656419ba14
rpc: add more test cases for arg types #29006 (#1012)
* rpc: add more test cases for arg types #29006

* rpc: add more test cases for arg types #29006

---------

Co-authored-by: Andrei Kostakov <bps@dzen.ws>
2025-04-29 17:08:05 +08:00
Daniel Liu
a4aebd5d88
rpc: fix typos (#1011) 2025-04-29 17:07:10 +08:00
Daniel Liu
35a202675d
node, rpc: add configurable HTTP request limit #28948 (#1010)
Adds a configurable HTTP request limit, and bumps the engine default

Co-authored-by: Felix Lange <fjl@twurst.com>
2025-04-29 17:06:06 +08:00
lightclient
9373c71211 rpc: use stable object in notifier test #30193
This makes the test resilient to changes of types.Header -- otherwise the test needs to be
updated each time the header structure is modified.
2025-04-29 17:04:50 +08:00
Delweng
7bf5517cda rpc: improve performance of subscription notification encoding #28328
It turns out that encoding json.RawMessage is slow because
package json basically parses the message again to ensure it is valid.
We can avoid the slowdown by encoding the entire RPC notification once,
which yields a 30% speedup.
2025-04-29 17:04:50 +08:00
Daniel Liu
26a9ea539f
core, rpc: speed up tests #28461 (#1008) 2025-04-29 16:57:58 +08:00
benjamin202410
e1772ce08a
fix: improve timeout message log (#996)
* fix: improve timeout message log

* Update bft_handler.go

---------

Co-authored-by: liam.lai <liam.lai@us>
2025-04-29 01:48:56 -07:00
Daniel Liu
80abc58f25
all: replace some cases of strings.SplitN with strings.Cut #28446 (#1007)
Co-authored-by: Håvard Anda Estensen <haavard.ae@gmail.com>
2025-04-28 18:07:59 +08:00
Daniel Liu
7422a13f24
rpc: use correct stringer-method for serializing BlockNumberOrHash #28358 (#1006)
The String() version of BlockNumberOrHash uses decimal for all block numbers, including negative ones used to indicate labels. Switch to using BlockNumber.String() which encodes it correctly for use in the JSON-RPC API.

Co-authored-by: Adrian Sutton <adrian@oplabs.co>
2025-04-28 18:06:35 +08:00
Daniel Liu
aa75ed2f6b
rpc: increase timeout in TestClientWebsocketPing #28371 (#1005)
Co-authored-by: Brandon Liu <lzqcn2000@126.com>
2025-04-28 18:05:48 +08:00
Daniel Liu
1dd15812f3
rpc: fix erroneous error-message in test #28227 (#1004)
Co-authored-by: hyunchel <3271191+hyunchel@users.noreply.github.com>
2025-04-28 18:04:49 +08:00
Daniel Liu
c16b1b5217
eth, rpc: add configurable option for wsMessageSizeLimit #27801 (#1003)
This change adds a configurable limit to websocket message.
---------

Co-authored-by: tylerni7 <tylerni7@gmail.com>
Co-authored-by: Martin Holst Swende <martin@swende.se>
2025-04-28 18:02:12 +08:00
Daniel Liu
f6a5d42285
rpc: use go-winio for named pipes #27972 (#1002)
We're trying a new named pipe library, which should hopefully fix some occasional failures in CI.

---------

Co-authored-by: Martin Holst Swende <martin@swende.se>
Co-authored-by: Felix Lange <fjl@twurst.com>
2025-04-28 17:50:26 +08:00
Daniel Liu
027b69a372
rpc: attempt to fix ping/pong logic race #27733 (#1001)
This should fix #27726. With enough load, it might happen that the SetPongHandler
callback gets invoked before the call to SetReadDeadline is made in pingLoop. When
this occurs, the socket will end up with a 30s read deadline even though it got the pong,
which will lead to a timeout.

The fix here is processing the pong on pingLoop, synchronizing with the code that
sends the ping.

Co-authored-by: Felix Lange <fjl@twurst.com>
2025-04-28 17:49:37 +08:00
Daniel Liu
9d4a26d552
rpc: avoid use of cgo by hard-coding maxPathSize #27447 (#1000)
Package rpc uses cgo to find the maximum UNIX domain socket path
length. If exceeded, a warning is printed. This is the only use of cgo in this
package. It seems excessive to depend on cgo just for this warning, so
we now hard-code the usual limit for Linux instead.

---------

Co-authored-by: Koichi Shiraishi <zchee.io@gmail.com>
Co-authored-by: Felix Lange <fjl@twurst.com>
2025-04-28 17:48:07 +08:00
Daniel Liu
5e4c2cb821
rpc: add method to test for subscription support #25942 (#999)
This adds two ways to check for subscription support. First, one can now check
whether the transport method (HTTP/WS/etc.) is capable of subscriptions using
the new Client.SupportsSubscriptions method.

Second, the error returned by Subscribe can now reliably be tested using this
pattern:

    sub, err := client.Subscribe(...)
    if errors.Is(err, rpc.ErrNotificationsUnsupported) {
        // no subscription support
    }

---------

Co-authored-by: zhiqiangxu <652732310@qq.com>
Co-authored-by: Felix Lange <fjl@twurst.com>
2025-04-28 17:46:24 +08:00
Daniel Liu
c75623ace7
rpc: add limit for batch request and response size #26681 (#998) 2025-04-28 17:00:30 +08:00
Daniel Liu
57c40154be core: use atomic type #27011 2025-04-28 16:57:56 +08:00
Daniel Liu
9a06e129b8 core: simplify atomic store after writeBlockWithState #20798 2025-04-28 16:57:56 +08:00
Daniel Liu
1d3e5cb455 core: prefetch next block state concurrently #19328 2025-04-28 16:57:56 +08:00
Daniel Liu
b628212d8e
rpc: change BlockNumber constant values to match ethclient #27219 (#992) 2025-04-28 10:59:34 +08:00
Daniel Liu
3ae8b8a99d
rpc, internal/cmdtest: increase timeout in tests #27083 (#991)
This change gives the cmd-tests have a bit more time to finish before getting forcibly torn down.

Co-authored-by: Delweng <delweng@gmail.com>
2025-04-28 10:47:39 +08:00
Daniel Liu
5af41b62a7
rpc: more accurate checking of handler method signatures #27287 (#990)
This changes the RPC server to ignore methods using *context.Context as parameter
and *error as return value type. Methods with such types would crash the server when
called.

Co-authored-by: Stephen Guo <stephen.fire@gmail.com>
2025-04-28 10:45:50 +08:00
Daniel Liu
e6b7ae906b
rpc: websocket should respect the HTTP_PROXY by default #27264 (#989) 2025-04-28 10:44:31 +08:00
JukLee0ira
16969b1569 rpc: fix setting client in DialHTTPWithClient #26470 2025-04-28 10:25:07 +08:00
JukLee0ira
b899363d17 node: set JWT expiry to 60 seconds #25416 2025-04-28 10:25:07 +08:00