Commit graph

10 commits

Author SHA1 Message Date
Wilmer Paulino
d7d2f14d61
build+chain: reuse buffers when reading ZMQ messages from bitcoind
`bitcoind` notifies transactions once they're accepted into the mempool
and once they're confirmed in a block. Previously, reading a message
from ZMQ would allocate a buffer with the size of the message. This can
cause nodes to perform a large number of allocations within a small
amount periodically (3000 300B allocations every 10 mins on average),
which can cause a lot of GC pressure on lower resourced nodes. To remedy
this, we introduce two static buffers, one for blocks and another for
transactions, that will be reused for every message read. Each is
constrained by its maximum expected size.
2019-11-12 18:18:59 -08:00
Wilmer Paulino
58ac163d48
chain: trace log timed out ZMQ connections 2019-11-08 12:39:00 -08:00
Wilmer Paulino
36ca842905
chain: extract ZMQ command strings into constants 2019-11-08 12:38:28 -08:00
Wilmer Paulino
6c4dab5f7c
chain: remove extraneous rpcclient.Disconnect calls from BitcoindConn
These are not needed since they have no effect when the RPC client is
making HTTP POST requests.
2019-07-10 16:15:51 -07:00
Wilmer Paulino
f02166e5de
chain: explicitly close connections in BitcoindConn's Stop method
Since it's now possible for gozmq.Conn to block when calling Receive,
BitcoindConn hangs upon being stopped because its goroutines are waiting
for a message to be delivered. To address this, we modify it to close
its ZMQ connections driving the goroutines once it's been stopped. This
allows the goroutines to unblock by detecting the EOF error and exiting.
2019-07-10 16:15:50 -07:00
Wilmer Paulino
1ddb9f2c11
chain: allow setting the client's birthday after creation 2018-09-12 14:24:30 -07:00
Conner Fromknecht
042d409236
chain/bitcoind_conn: only print ASCII rawtx event types 2018-08-31 16:31:29 -07:00
Wilmer Paulino
850ad0959a
chain: ensure eventType from ZMQ response is human-readable
In this commit, we fix a small issue where it's possible that we read a
malformed message from the ZMQ connection to bitcoind due to it shutting
down. To fix this, we ensure that the event type is human readable
before attempting to log it.
2018-08-15 18:17:29 -07:00
Wilmer Paulino
5f7060dadf
chain: handle ZMQ timeout error correctly 2018-08-15 17:37:03 -07:00
Wilmer Paulino
00428d5828 chain: share the same bitcoind connection between multiple rescan clients 2018-07-30 17:54:08 -07:00