Comments (11)
Thank you very much.
from dcrd.
Great, thanks for confirming. I'm glad the workaround is working for now. I'll leave this open until the wallet devs are able to address it properly.
from dcrd.
Are you able to tell which RPC it is on the wallet side?
@jrick Looks like wallet is likely sending a message that exceeds 16MiB which it shouldn't be.
from dcrd.
Sorry, I don't know which RPC call it is, but I can be sure that it happens in the dcrwallet startup phase, and the CPU usage is 100%. At this time dcrwallet has not received external rpc request
from dcrd.
If you run dcrd
with --debuglevel RPCS=debug
(or use dcrctl debuglevel RPCS=debug
to set it without needing to restart dcrd), then connect the wallet, you should see some Received command <FOO> from 127.0.0.1:xxxxx
debug messages that will reveal which command is causing it.
from dcrd.
Thanks for your help, here is the log
2022-05-19 05:13:54.535 [INF] RPCS: New websocket client 127.0.0.1:43912
2022-05-19 05:13:54.536 [DBG] RPCS: Received command <getcurrentnet> from 127.0.0.1:43912
2022-05-19 05:13:54.536 [DBG] RPCS: Received command <version> from 127.0.0.1:43912
2022-05-19 05:13:54.537 [DBG] RPCS: Received command <notifyblocks> from 127.0.0.1:43912
2022-05-19 05:13:54.537 [DBG] RPCS: Received command <getrawmempool> from 127.0.0.1:43912
2022-05-19 05:13:54.537 [DBG] RPCS: Received command <notifytspend> from 127.0.0.1:43912
2022-05-19 05:13:54.538 [DBG] RPCS: Received command <getheaders> from 127.0.0.1:43912
2022-05-19 05:13:54.539 [DBG] RPCS: Received command <getcfilterv2> from 127.0.0.1:43912
2022-05-19 05:13:54.539 [DBG] RPCS: Received command <getcfilterv2> from 127.0.0.1:43912
2022-05-19 05:13:54.539 [DBG] RPCS: Received command <getcfilterv2> from 127.0.0.1:43912
2022-05-19 05:13:54.539 [DBG] RPCS: Received command <getcfilterv2> from 127.0.0.1:43912
2022-05-19 05:13:54.539 [DBG] RPCS: Received command <getcfilterv2> from 127.0.0.1:43912
2022-05-19 05:13:54.539 [DBG] RPCS: Received command <getcfilterv2> from 127.0.0.1:43912
2022-05-19 05:13:54.539 [DBG] RPCS: Received command <getcfilterv2> from 127.0.0.1:43912
2022-05-19 05:13:54.539 [DBG] RPCS: Received command <getcfilterv2> from 127.0.0.1:43912
2022-05-19 05:13:54.539 [DBG] RPCS: Received command <getcfilterv2> from 127.0.0.1:43912
2022-05-19 05:13:54.539 [DBG] RPCS: Received command <getcfilterv2> from 127.0.0.1:43912
2022-05-19 05:13:54.557 [DBG] RPCS: Received command <getheaders> from 127.0.0.1:43912
2022-05-19 05:14:54.540 [DBG] RPCS: ping received: len 0
2022-05-19 05:15:06.997 [INF] SYNC: New valid peer 51.81.186.122:9108 (outbound) (/dcrwire:1.0.0/dcrd:1.7.1/)
2022-05-19 05:15:54.551 [DBG] RPCS: ping received: len 0
2022-05-19 05:16:54.539 [DBG] RPCS: ping received: len 0
2022-05-19 05:17:23.014 [ERR] RPCS: Websocket receive error from 127.0.0.1:43912: websocket: read limit exceeded
2022-05-19 05:17:23.014 [INF] RPCS: Disconnected websocket client 127.0.0.1:43912
from dcrd.
Thanks for posting. It looks like it's on existsaddresses
from tracing the wallet code. I wouldn't think it should be hitting anywhere near 16MiB though given each address is about 40 bytes with accompanying JSON, so 60k addresses * 40 ~= 2.29 MiB
.
This is going to require some digging by the wallet devs to figure out why it's sending messages over the limit for a proper fix.
However, in the mean time, if you're able to build from source on the release-v1.7
branch, the following diff will increase the read limit for (what should be) a quick and dirty workaround for now:
diff --git a/internal/rpcserver/rpcwebsocket.go b/internal/rpcserver/rpcwebsocket.go
index 121e34ea..277632be 100644
--- a/internal/rpcserver/rpcwebsocket.go
+++ b/internal/rpcserver/rpcwebsocket.go
@@ -48,7 +48,7 @@ const (
// websocketReadLimitAuthenticated is the maximum number of bytes allowed
// for an authenticated JSON-RPC message read from a websocket client.
- websocketReadLimitAuthenticated = 1 << 24 // 16 MiB
+ websocketReadLimitAuthenticated = 1 << 26 // 64 MiB
// websocketPongTimeout is the maximum amount of time attempts to respond to
// websocket ping messages with a pong will wait before giving up.
from dcrd.
Thank you very much, it seems to be working fine
2022-05-19 07:02:23.510 [INF] RPCS: New websocket client 127.0.0.1:44756
2022-05-19 07:02:23.511 [DBG] RPCS: Received command <getcurrentnet> from 127.0.0.1:44756
2022-05-19 07:02:23.511 [DBG] RPCS: Received command <version> from 127.0.0.1:44756
2022-05-19 07:02:23.512 [DBG] RPCS: Received command <notifyblocks> from 127.0.0.1:44756
2022-05-19 07:02:23.512 [DBG] RPCS: Received command <getrawmempool> from 127.0.0.1:44756
2022-05-19 07:02:23.512 [DBG] RPCS: Received command <notifytspend> from 127.0.0.1:44756
2022-05-19 07:02:23.513 [DBG] RPCS: Received command <getheaders> from 127.0.0.1:44756
2022-05-19 07:02:23.514 [DBG] RPCS: Received command <getcfilterv2> from 127.0.0.1:44756
2022-05-19 07:02:23.514 [DBG] RPCS: Received command <getcfilterv2> from 127.0.0.1:44756
2022-05-19 07:02:23.514 [DBG] RPCS: Received command <getcfilterv2> from 127.0.0.1:44756
2022-05-19 07:02:23.514 [DBG] RPCS: Received command <getcfilterv2> from 127.0.0.1:44756
2022-05-19 07:02:23.514 [DBG] RPCS: Received command <getcfilterv2> from 127.0.0.1:44756
2022-05-19 07:02:23.515 [DBG] RPCS: Received command <getcfilterv2> from 127.0.0.1:44756
2022-05-19 07:02:23.515 [DBG] RPCS: Received command <getcfilterv2> from 127.0.0.1:44756
2022-05-19 07:02:23.515 [DBG] RPCS: Received command <getcfilterv2> from 127.0.0.1:44756
2022-05-19 07:02:23.515 [DBG] RPCS: Received command <getcfilterv2> from 127.0.0.1:44756
2022-05-19 07:02:23.515 [DBG] RPCS: Received command <getcfilterv2> from 127.0.0.1:44756
2022-05-19 07:02:23.515 [DBG] RPCS: Received command <getcfilterv2> from 127.0.0.1:44756
2022-05-19 07:02:23.515 [DBG] RPCS: Received command <getcfilterv2> from 127.0.0.1:44756
2022-05-19 07:02:23.515 [DBG] RPCS: Received command <getcfilterv2> from 127.0.0.1:44756
2022-05-19 07:02:23.515 [DBG] RPCS: Received command <getcfilterv2> from 127.0.0.1:44756
2022-05-19 07:02:23.515 [DBG] RPCS: Received command <getcfilterv2> from 127.0.0.1:44756
2022-05-19 07:02:23.515 [DBG] RPCS: Received command <getcfilterv2> from 127.0.0.1:44756
2022-05-19 07:02:23.515 [DBG] RPCS: Received command <getcfilterv2> from 127.0.0.1:44756
2022-05-19 07:02:23.515 [DBG] RPCS: Received command <getcfilterv2> from 127.0.0.1:44756
2022-05-19 07:02:23.515 [DBG] RPCS: Received command <getcfilterv2> from 127.0.0.1:44756
2022-05-19 07:02:23.515 [DBG] RPCS: Received command <getcfilterv2> from 127.0.0.1:44756
2022-05-19 07:02:23.515 [DBG] RPCS: Received command <getcfilterv2> from 127.0.0.1:44756
2022-05-19 07:02:23.515 [DBG] RPCS: Received command <getcfilterv2> from 127.0.0.1:44756
2022-05-19 07:02:23.516 [DBG] RPCS: Received command <getcfilterv2> from 127.0.0.1:44756
2022-05-19 07:02:23.516 [DBG] RPCS: Received command <getcfilterv2> from 127.0.0.1:44756
2022-05-19 07:02:23.516 [DBG] RPCS: Received command <getcfilterv2> from 127.0.0.1:44756
2022-05-19 07:02:23.517 [DBG] RPCS: Received command <getcfilterv2> from 127.0.0.1:44756
2022-05-19 07:02:23.559 [DBG] RPCS: Received command <getheaders> from 127.0.0.1:44756
2022-05-19 07:02:36.576 [INF] SYNC: New valid peer 178.238.227.132:9108 (outbound) (/dcrwire:0.3.0/dcrd:1.4.0/)
2022-05-19 07:02:36.895 [INF] SYNC: New valid peer 104.199.112.136:9108 (outbound) (/dcrwire:1.0.0/dcrd:1.7.1/)
2022-05-19 07:03:06.570 [INF] SYNC: New valid peer 88.198.75.244:9108 (outbound) (/dcrwire:1.0.0/dcrd:1.7.2/)
2022-05-19 07:03:06.590 [INF] SYNC: New valid peer 195.49.75.206:9108 (outbound) (/dcrwire:1.0.0/dcrd:1.8.0(pre)/)
2022-05-19 07:03:06.680 [INF] SYNC: New valid peer 142.93.61.153:9108 (outbound) (/dcrwire:1.0.0/dcrd:1.7.1/)
2022-05-19 07:03:23.528 [DBG] RPCS: ping received: len 0
2022-05-19 07:03:37.515 [INF] SYNC: New valid peer 8.135.103.125:9108 (outbound) (/dcrwire:0.4.0/dcrd:1.6.0/)
2022-05-19 07:04:23.522 [DBG] RPCS: ping received: len 0
2022-05-19 07:04:27.691 [INF] SYNC: New block 00000000000000007a49425a9db346975049a2fca81616b5bdaf3e8c33aef648 (7 transactions, 12 tickets, 5 votes, 0 revocations, height 660306, interval 3m43s)
2022-05-19 07:04:27.716 [DBG] RPCS: Received command <getcfilterv2> from 127.0.0.1:44756
2022-05-19 07:05:23.519 [DBG] RPCS: ping received: len 0
2022-05-19 07:05:53.833 [DBG] RPCS: Received command <existsaddresses> from 127.0.0.1:44756
2022-05-19 07:05:55.479 [DBG] RPCS: Received command <existsaddresses> from 127.0.0.1:44756
2022-05-19 07:05:57.606 [DBG] RPCS: Received command <existsaddresses> from 127.0.0.1:44756
2022-05-19 07:06:00.228 [DBG] RPCS: Received command <existsaddresses> from 127.0.0.1:44756
2022-05-19 07:06:03.383 [DBG] RPCS: Received command <existsaddresses> from 127.0.0.1:44756
2022-05-19 07:06:06.354 [DBG] RPCS: Received command <existsaddresses> from 127.0.0.1:44756
2022-05-19 07:06:23.525 [DBG] RPCS: ping received: len 0
2022-05-19 07:07:23.561 [DBG] RPCS: ping received: len 0
2022-05-19 07:08:23.513 [DBG] RPCS: ping received: len 0
2022-05-19 07:08:56.085 [INF] SYNC: New block 00000000000000007a3e91bc285384c86495344054ad678213dfbcb1f9b8d814 (7 transactions, 1 ticket, 5 votes, 0 revocations, height 660307, interval 3m26s)
2022-05-19 07:08:56.106 [DBG] RPCS: Received command <getcfilterv2> from 127.0.0.1:44756
2022-05-19 07:09:23.529 [DBG] RPCS: ping received: len 0
2022-05-19 07:10:23.526 [DBG] RPCS: ping received: len 0
2022-05-19 07:11:23.524 [DBG] RPCS: ping received: len 0
2022-05-19 07:12:20.385 [DBG] RPCS: Received command <existsaddresses> from 127.0.0.1:44756
2022-05-19 07:12:23.161 [DBG] RPCS: Received command <existsaddresses> from 127.0.0.1:44756
2022-05-19 07:12:25.794 [DBG] RPCS: Received command <existsaddresses> from 127.0.0.1:44756
2022-05-19 07:12:25.804 [DBG] RPCS: ping received: len 0
2022-05-19 07:12:30.119 [DBG] RPCS: Received command <existsaddresses> from 127.0.0.1:44756
2022-05-19 07:12:33.187 [DBG] RPCS: Received command <existsaddresses> from 127.0.0.1:44756
2022-05-19 07:12:35.955 [DBG] RPCS: Received command <existsaddresses> from 127.0.0.1:44756
2022-05-19 07:13:23.550 [DBG] RPCS: ping received: len 0
2022-05-19 07:14:23.511 [DBG] RPCS: ping received: len 0
2022-05-19 07:15:20.298 [INF] SYNC: New block 000000000000000017ae3ad8dd3fa250b9ca619a9832692ef89a2dceb4bb46e4 (5 transactions, 8 tickets, 5 votes, 0 revocations, height 660308, interval 6m11s)
2022-05-19 07:15:20.327 [DBG] RPCS: Received command <getcfilterv2> from 127.0.0.1:44756
2022-05-19 07:15:23.516 [DBG] RPCS: ping received: len 0
2022-05-19 07:16:23.529 [DBG] RPCS: ping received: len 0
2022-05-19 07:17:23.523 [DBG] RPCS: ping received: len 0
2022-05-19 07:18:23.519 [DBG] RPCS: ping received: len 0
2022-05-19 07:18:43.199 [DBG] RPCS: Received command <existsaddresses> from 127.0.0.1:44756
2022-05-19 07:18:48.287 [DBG] RPCS: Received command <existsaddresses> from 127.0.0.1:44756
2022-05-19 07:18:52.463 [DBG] RPCS: Received command <existsaddresses> from 127.0.0.1:44756
2022-05-19 07:18:54.600 [DBG] RPCS: Received command <existsaddresses> from 127.0.0.1:44756
2022-05-19 07:18:56.992 [DBG] RPCS: Received command <existsaddresses> from 127.0.0.1:44756
from dcrd.
Are you by chance running a very large --gaplimit option in dcrwallet? and if so, why?
from dcrd.
Yes, what we are doing is a wallet service, we do not implement address management ourselves, but use the node's wallet service.
In order to distinguish the attribution of transactions, we assign each user an address
from dcrd.
OK.. well just so are aware, even with a large gap limit, there is still the possibility that none of the addresses will be used and eventually wraparround will occur after returning too many addresses. The proper solution would be to generate address while ignoring the gap limit (use "ignore"
as the gappolicy option when doing a getnewaddress
).
Large gap limits are only really useful when restoring a wallet, or if you must keep a watching wallet up to date with another wallet that runs with a custom gap.
from dcrd.
Related Issues (20)
- Panic on notifying index subscribers (release 1.7.1) HOT 6
- testnet: Panic when running with address index on. HOT 4
- Is there an error in the secp256k1 example? HOT 12
- Remove planetdecred seeders from dcrd HOT 1
- dcrec/secp256k1: new release to fix boringcrypto issue HOT 2
- Add IPC (pipetx) events to report listening ports HOT 5
- The main dcrd module needs new tag with 1.8.0 release.
- Feature Request: Allow forcing a vote result in network parameters.
- Remove need for invalid choice index sentinal form threshold state tuple.
- Re-enable RPC integration tests one #3092 is merged.
- Serializing Signature not compatible with other lib HOT 10
- [rpcserver] getcoinsupply RPC is not reporting treasurybases
- Given a private key as a string, how will I generate a public key? HOT 1
- Unable to override home directory HOT 19
- DCR explorer and my dcr nodes do not produce new block from Aug 30th till now HOT 2
- Template generator includes tspend that overspends treasury
- Request to change r and s in secp256k1 ecdsa signature to exported variable R and S HOT 6
- Add GetMultipleCFiltersV2 P2P message HOT 1
- Panic during block sync HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dcrd.