Bitcoin full node and query server

Feb 10, 2023

View in context in the libbitcoin Slack #general mirror.

evoskuil23:42
Looking at the per connection sizing, it's about 60kb per connection. Most connections receive a maximally-sized address message, which resizes the incoming buffer to 30kb, so half of the per channel memory is this. This could be scaled down during quiet periods, but it will eventually grow to max block weight (4,000,000 bytes). Currently I'm opting for avoiding dynamic allocation, with the expectation that peer counts are more traditional (on the order of 10-100). But with 1,000 peers pushing 1 max block, that's 4GB RAM. So with very high peer counts we want to provide for dynamic allocation. I'll place a config setting that shrinks the buffer after it exceeds the configured bytes, defaulting to 4,000,000.