Bitcoin full node and query server

Oct 9, 2021

View in context in the libbitcoin Slack #general mirror.

evoskuil02:04
libbitcoin-network is also the threading engine for libbitcoin-node and libbitcoin-server. Node introduces additional thread pools for parallel validation, though these are isolated. Server introduces one thread per endpoint worker (well isolated within libbitcoin-protocol). This rework dramatically simplifies the threading model, so that we are operating on one dedicated thread per socket/channel. While the implementation remains entirely asynchronous, this will eliminate a lot of complexity and resolve certain issues in our use of boost::asio. It will also reduce our DOS attack surface to almost nothing. I expect it will also finally resolve the shutdown hang (deadlock). If it resurfaces, it will certainly be much easier to troubleshoot. We may possibly experience a performance hit, as we will not be queueing up arbitrary amounts of work when our processing speed is out of sync with network speed. However, this is the DOS vector. If there's a material hit I would create a managed work buffer, dropping outbound messages or blocking inbound messages as necessary (which is how we manage ZeroMQ buffering).
(edited)
👍 2
jungly18:00
The dos attack surface reduces because the number of connections is limited? so we have an upper bound on number of threads? I thought we had a threadpool in network for handling channels. I might be forgetting my incorrect understanding! :)