Archive of the libbitcoin Slack #general channel.
bitcoin-cli getblockchaininfobs and bx instead... but maybe i can tweak my logging settings to see what % of the chain is currently synced?bn.cfg and passing it in via -c but i get
$ ~/libbitcoin/bin/bn -c bitcoin/bn.cfg Error: unrecognised option 'verbose'
bitcoin-cli getblockchaininfoprotocol log context, but this will slow down sync, which is much faster than the console. The console does not block the node, but it does consume resources.Bitcoin (node) does not provide for high volume (but can of course accommodate high cost small payments). Lightning is in some ways problematic, but under its assumption of infrequent on-chain transaction, I don’t see any conflict with the above observations.
FWIW, I haven’t seen the passive LN thing working, and not because nodes are expensive.
And keep in mind that libbitcoin is just one project. We have specific objectives. We don’t stop anyone else from making nodes that optimize for a pi with 4MB. But there is no reason a modest PC should take forever to sync.
Again, there is no need for outputs to persist in RAM. We are talking about sync times that are absurdly high without even performing script validation. There is no reason for scripts to be consuming RAM. Query over existence and spentness is sufficient.
When your store is slow and non-concurrent, and your processing is unduly ordered, RAM feels like the only solution.
bnevents.log. I believe current build emits only the block_archived event (with block height and time in seconds from startup). This will show the individual blocks archived since the node started up. You can also type i <enter> while the node is running and it will dump store stats to the console. Finally, you can type p <enter> and see individual blocks being archived at the console. This is a toggle, type again to disable.2024-10-15T17:45:38Z.0 Body sizes... header :84847420 txs :192929304 tx :2921586630 point :4068475272 input :14381059167 output :4461494048 puts :1088675541 candidate :2597370 confirmed :3 spend :2719974744 strong_tx :565389996 valid_tx :0 valid_bk :0 address :0 neutrino :0 2024-10-15T17:45:38Z.0 Table records... header :865790 tx :47122365 point :113013202 candidate :865790 confirmed :1 spend :113332281 strong_tx :47115833 address :0 2024-10-15T17:45:38Z.0 Head buckets... header :565129 txs :565129 tx :681968291 point :638910752 spend :1739749749 strong_tx :681968291 valid_tx :681968291 valid_bk :565129 address :1 neutrino :1 2024-10-15T17:45:38Z.0 Collision rates... header :1.53202 txs :1.53202 tx :0.0690976 point :0.176884 spend :0.0651429 strong_tx :0.069088 valid_tx :0.0690976 valid_bk :1.53202 address :0 neutrino :0
block_archived event would show a much lower number?
2024-10-15T17:44:33Z.0 Body sizes... header :84847420 txs :189308 tx :655464 point :28296 input :162756 output :856072 puts :98121 candidate :2597370 confirmed :3 spend :270960 strong_tx :126840 valid_tx :0 valid_bk :0 address :0 neutrino :0 2024-10-15T17:44:33Z.0 Table records... header :865790 tx :10572 point :786 candidate :865790 confirmed :1 spend :11290 strong_tx :10571 address :0 2024-10-15T17:44:33Z.0 Head buckets... header :524493 txs :524493 tx :551320125 point :546188501 spend :1459791875 strong_tx :551320125 valid_tx :551320125 valid_bk :524493 address :1 neutrino :1 2024-10-15T17:44:33Z.0 Collision rates... header :1.65072 txs :1.65072 tx :1.91758e-05 point :1.43906e-06 spend :7.73398e-06 strong_tx :1.91758e-05 valid_tx :1.91758e-05 valid_bk :1.65072 address :0 neutrino :0
$ tail -f events.log block_archived...... 768617 17 block_archived...... 757842 19
2024-10-15T18:18:55Z.0 Body sizes... header :84847910 txs :3127058952 tx :48304299758 point :73453346676 input :181148659338 output :75376308520 puts :19056712575 candidate :2597385 confirmed :3 spend :48987159240 strong_tx :9349219308 valid_tx :0 valid_bk :0 address :0 neutrino :0 2024-10-15T18:18:55Z.0 Table records... header :865795 tx :779101609 point :2040370741 candidate :865795 confirmed :1 spend :2041131635 strong_tx :779101609 address :0 2024-10-15T18:18:55Z.0 Head buckets... header :524493 txs :524493 tx :551320125 point :546188501 spend :1459791875 strong_tx :551320125 valid_tx :551320125 valid_bk :524493 address :1 neutrino :1 2024-10-15T18:18:55Z.0 Version Information... libbitcoin-node: 4.0.0 libbitcoin-database: 4.0.0 libbitcoin-network: 4.0.0 libbitcoin-system: 4.0.0 2024-10-15T18:18:55Z.0 Press CTRL-C to stop the node.
[log] path = X:/ application = true news = true session = true protocol = false quitting = false proxy = false remote = true fault = true verbose = false #objects = false # debug builds only [database] path = X:/bitcoin/ minimize = false [bitcoin] # defaults to all checkpoints. #checkpoint = 000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f:0 minimum_work = 000000000000000000000000000000000000000052b2559353df4117b7348b64 milestone = 0000000000000000000320283a032748cef8227873ff4872689bf23f1cda83a5:840000 [forks] [node] headers_first = true allowed_deviation = 1.5 sample_period_seconds = 10 currency_window_minutes = 60 maximum_concurrency = 50,000 maximum_height = 840,000 # stops block sync (not header sync) snapshot_bytes = 0 snapshot_valid = 0 allocation_multiple = 20 [network] threads = 16 outbound_connections = 200 connect_batch_size = 5 host_pool_capacity = 10,000 enable_loopback = false self = xxx.xxx.xxx.xxx:8333 # advertised addresses inbound_connections = 0 # Use 1 for loopback user_agent = "/libbitcoin /" enable_ipv6 = false enable_alert = false # log alert messages enable_reject = false # send reject messages enable_address = true # in/out address messages enable_transaction = false # peer should not relay txs validate_checksum = false # validate inbound message checksum invalid_services = 176 # shitcoins services_minimum = 9 # witness node services_maximum = 9 # witness node protocol_maximum = 70012 # current default (send_headers). protocol_minimum = 31800 # Satoshi:22.0.0 minimum (headers). minimum_buffer = 1,000,000 # network payload buffer (per channel) retry_timeout_seconds = 5 # 1s, 2s, 7s f/m/s loopback, 5s for large connect_timeout_seconds = 5 # 1s, 3s, 5s f/m/s loopback, 10s for large handshake_timeout_seconds = 5 # time to complete handshake. channel_heartbeat_minutes = 5 # ping channel_inactivity_minutes = 10 # receive channel_expiration_minutes = 60 # unconditional [database] # TODO: These require tuning for low RAM machines. header_buckets = 565,129 header_size = 21,000,000 header_rate = 5 txs_buckets = 565,129 txs_size = 1,000,000,000 txs_rate = 5 tx_buckets = 681,968,291 tx_size = 16,000,000,000 tx_rate = 5 # compressed size point_buckets = 638,910,752 point_size = 9,000,000,000 point_rate = 5 spend_buckets = 1,739,749,749 spend_size = 16,000,000,000 spend_rate = 5 puts_size = 7,000,000,000 puts_rate = 5 input_size = 92,000,000,000 input_rate = 5 output_size = 25,000,000,000 output_rate = 5 candidate_size = 2,568,513 candidate_rate = 5 confirmed_size = 2,568,513 confirmed_rate = 5 strong_tx_buckets = 681,968,291 strong_tx_size = 3,000,000,000 strong_tx_rate = 5 validated_tx_buckets = 681,968,291 validated_tx_size = 1 validated_tx_rate = 5 validated_bk_buckets = 565,129 validated_bk_size = 2,000,000 validated_bk_rate = 5 address_buckets = 0 address_size = 1 address_rate = 0 neutrino_buckets = 0 neutrino_size = 1 neutrino_rate = 0
_size values down to 1/4 to 1/10 of above for lower RAM. This is required to prevent mmap thrashing. Also the growth _rate values must be small. I run at 15, but these are probably okay for low RAM at 5.--settings or -s.m <enter> at runtime to see the runtime options and --help or -h at the command line to see the CL options (there's some overlap).


/usr/bin/ld: /home/ava/bitcoin/libbitcoin/install/lib/libbitcoin-system.so: undefined reference to `tbb::detail::r1::spawn(tbb::detail::d1::task&, tbb::detail::d1::task_group_context&)' /usr/bin/ld: /home/ava/bitcoin/libbitcoin/install/lib/libbitcoin-system.so: undefined reference to `tbb::detail::r1::allocate(tbb::detail::d1::small_object_pool*&, unsigned long)' /usr/bin/ld: /home/ava/bitcoin/libbitcoin/install/lib/libbitcoin-system.so: undefined reference to `tbb::detail::r1::deallocate(tbb::detail::d1::small_object_pool&, void*, unsigned long, tbb::detail::d1::execution_data const&)' /usr/bin/ld: /home/ava/bitcoin/libbitcoin/install/lib/libbitcoin-system.so: undefined reference to `tbb::detail::r1::destroy(tbb::detail::d1::task_group_context&)' /usr/bin/ld: /home/ava/bitcoin/libbitcoin/install/lib/libbitcoin-system.so: undefined reference to `tbb::detail::r1::allocate(tbb::detail::d1::small_object_pool*&, unsigned long, tbb::detail::d1::execution_data const&)' /usr/bin/ld: /home/ava/bitcoin/libbitcoin/install/lib/libbitcoin-system.so: undefined reference to `tbb::detail::r1::execute_and_wait(tbb::detail::d1::task&, tbb::detail::d1::task_group_context&, tbb::detail::d1::wait_context&, tbb::detail::d1::task_group_context&)' /usr/bin/ld: /home/ava/bitcoin/libbitcoin/install/lib/libbitcoin-system.so: undefined reference to `tbb::detail::r1::initialize(tbb::detail::d1::task_group_context&)' /usr/bin/ld: /home/ava/bitcoin/libbitcoin/install/lib/libbitcoin-system.so: undefined reference to `tbb::detail::r1::is_group_execution_cancelled(tbb::detail::d1::task_group_context&)' /usr/bin/ld: /home/ava/bitcoin/libbitcoin/install/lib/libbitcoin-system.so: undefined reference to `tbb::detail::r1::execution_slot(tbb::detail::d1::execution_data const*)' /usr/bin/ld: /home/ava/bitcoin/libbitcoin/install/lib/libbitcoin-system.so: undefined reference to `tbb::detail::r1::max_concurrency(tbb::detail::d1::task_arena_base const*)' /usr/bin/ld: /home/ava/bitcoin/libbitcoin/install/lib/libbitcoin-system.so: undefined reference to `tbb::detail::r1::isolate_within_arena(tbb::detail::d1::delegate_base&, long)' /usr/bin/ld: /home/ava/bitcoin/libbitcoin/install/lib/libbitcoin-system.so: undefined reference to `tbb::detail::r1::notify_waiters(unsigned long)' collect2: error: ld returned 1 exit status make: *** [Makefile:1228: console/bn] Error 1
tbb in libbitcoin-system which is confusing me./install.sh --build-boost --build-dir=/home/ava/bitcoin/libbitcoin/build --prefix=/home/ava/bitcoin/libbitcoin/install-dev package for itservices_minimum = 9 # witness node services_maximum = 9 # witness node
p2p class, and implement a way to suspend the main thread until it completes (p2p starts its own thread pool). There are examples of this in the p2p class test cases.services_minimum = 9 # witness node services_maximum = 9 # witness node
p2p class, and implement a way to suspend the main thread until it completes (p2p starts its own thread pool). There are examples of this in the p2p class test cases.validated_bk.data], and one for tx [validated_tx.data], as well as a table for tx confirmedness [strong_tx.data] - which provides the reverse navigation from tx to block (only for confirmed txs). validated_tx is really only an optimization for pool/compact block processing. It records distinct validation states for potentially incompatible contexts (such as validated for the pool, but needed to be validated again because the pool context was no longer consistent with a block context).prob not the same as Core
strong_tx indicates txs associated to confirmed branch blocks. We call then strong vs. confirmed, because they aren't actually confirmed until in the confirmed height index.validated_bk.data], and one for tx [validated_tx.data], as well as a table for tx confirmedness [strong_tx.data] - which provides the reverse navigation from tx to block (only for confirmed txs). validated_tx is really only an optimization for pool/compact block processing. It records distinct validation states for potentially incompatible contexts (such as validated for the pool, but needed to be validated again because the pool context was no longer consistent with a block context).checking --enable-avx2 option... yes checking --enable-avx512 option... no checking --enable-sse41 option... yes checking --enable-shani option... no checking --enable-ndebug option... yes checking --enable-isystem option... yes
$ ./bn --hardware Intrinsics... arm..... platform:0. intel... platform:1. avx512.. platform:0 compiled:0. avx2.... platform:1 compiled:0. sse41... platform:1 compiled:0. shani... platform:1 compiled:0. neon.... platform:0 compiled:0.
bn --hardware--enable-avx2 --enable-sse41 and
$ ./bn --hardware Intrinsics... arm..... platform:0. intel... platform:1. avx512.. platform:0 compiled:0. avx2.... platform:1 compiled:1. sse41... platform:1 compiled:1. shani... platform:0 compiled:0. neon.... platform:0 compiled:0.
--enable-avx2 --enable-sse41 --enable-isystem-m arguments are making it into each/any lib, given that they don't show in any of the pc files?--build-boost --disable-shared --enable-avx2 --enable-sse41 --enable-isystem CFLAGS=-O3 CXXFLAGS=-O3
CFLAGS=-O3 CXXFLAGS=-O3 ./install.sh --build-boost --disable-shared --enable-avx2 --enable-sse41 --enable-isystemconfigure options: --with-boost=/home/nixmini/Prefix --with-pkgconfigdir=/home/nixmini/Prefix/lib/pkgconfig --prefix=/home/nixmini/Prefix --disable-shared --enable-avx2 --enable-sse41 --enable-isystem CFLAGS=-O3 CXXFLAGS=-O3 --enable-static
onfigure: WARNING: unrecognized options: --enable-avx2, --enable-sse41, --enable-isystem Build Options: with external callbacks = no with benchmarks = yes with tests = no with ctime tests = no with coverage = no with examples = no module ecdh = yes module recovery = yes module extrakeys = yes module schnorrsig = yes module ellswift = yes asm = x86_64 ecmult window size = 15 ecmult gen table size = 86 KiB valgrind = no CC = gcc CPPFLAGS = -w SECP_CFLAGS = -O2 -std=c89 -pedantic -Wno-long-long -Wnested-externs -Wshadow -Wstrict-prototypes -Wundef -Wno-overlength-strings -Wall -Wno-unused-function -Wextra -Wcast-align -Wcast-align=strict -fvisibility=hidden CFLAGS = -O3 LDFLAGS =
Build Options: with external callbacks = no with benchmarks = yes with tests = no with ctime tests = no with coverage = no with examples = no module ecdh = yes module recovery = yes module extrakeys = yes module schnorrsig = yes module ellswift = yes asm = x86_64 ecmult window size = 15 ecmult gen table size = 86 KiB valgrind = no CC = gcc CPPFLAGS = -w SECP_CFLAGS = -O2 -std=c89 -pedantic -Wno-long-long -Wnested-externs -Wshadow -Wstrict-prototypes -Wundef -Wno-overlength-strings -Wall -Wno-unused-function -Wextra -Wcast-align -Wcast-align=strict -fvisibility=hidden CFLAGS = -g -O2 LDFLAGS =
Libbitcoin boost configuration. -------------------------------------------------------------------- variant : release threading : multi toolset : boost cxxflags : cxxflags=-Wno-enum-constexpr-conversion boost linkflags : link : static boost.locale.iconv : on boost.locale.posix : on -sNO_BZIP2 : 1 -sNO_ZSTD : 1 -sICU_PATH : -j : 16 -d0 : [supress informational messages] -q : [stop at the first error] --reconfigure : [ignore cached configuration] --prefix : /home/nixmini/Prefix BOOST_OPTIONS : --with-chrono --with-iostreams --with-json --with-locale --with-program_options --with-regex --with-system --with-thread --with-test cxxflags (ignored) : --------------------------------------------------------------------
libbitcoin-node installer configuration. -------------------------------------------------------------------- OS : Linux PARALLEL : 16 CC : CXX : CPPFLAGS : CFLAGS : CXXFLAGS : LDFLAGS : LDLIBS : WITH_ICU : BUILD_ICU : BUILD_BOOST : yes BOOST_ROOT : /home/nixmini/Prefix BUILD_DIR : build-libbitcoin-node PREFIX : /home/nixmini/Prefix DISABLE_SHARED : yes DISABLE_STATIC : with_boost : --with-boost=/home/nixmini/Prefix with_pkgconfigdir : --with-pkgconfigdir=/home/nixmini/Prefix/lib/pkgconfig --------------------------------------------------------------------
# If coverage is enabled, and the user has not overridden CFLAGS, # override Autoconf's value "-g -O2" with "-g". Otherwise we'd end up # with "-O0 --coverage -g -O2".
--enable-avx512 --enable-avx2 --enable-sse41
There is also one for --enable-shani, but that is not yet implemented. These are implemented and incorporated into the test matrix for libbitcoin-system. These significantly reduce Merkle hashing time, which materially affects milestone runs (as well as full validation). My mini boxes don't have avx512. To determine what level of support is on a platform, and what level is compiled into bn, you can run bn -d and it will tell you. But it you attempt to run for hardware you do not have, the process will fail on startup.-O3) are performance critical. Also --enable-isystem cleans up some boost warnings.
$ CFLAGS=-O3 CXXFLAGS=-O3 ./install.sh --build-boost --disable-shared --enable-avx512 --enable-avx2 --enable-sse41 --enable-isystem(edited)
--enable-isystem may cause failure. This is due to a directory precedence issue in compilers.maximum_concurrency = 0 (full download concurrency) the run does not appear to stall. Hard to tell speed without the events, but I'll at least get a ballpark completion time.Wstringop-overflow warnings:
https://github.com/libbitcoin/libbitcoin-system/issues/1539
https://github.com/libbitcoin/libbitcoin-system/issues/1540
https://github.com/libbitcoin/libbitcoin-system/issues/1539
And one new bogus gcc 13.2 copy warning:
https://github.com/libbitcoin/libbitcoin-system/issues/1538
and closed the previous ones from gcc12 which have disappeared on their own:
https://github.com/libbitcoin/libbitcoin-system/issues/1461
Never impressed with the gcc static bounds checker.
maximum_concurrency = 0. But the stall and lack of events are resolved. I don't have any tools set up for concurrency and performance analysis on Linux, so I've probably gotta work that out. Setting up my monster mac now also.
In the mean time I pulled down Bitcoin Core latest Linux binary to get a benchmark. It's doing significantly better than it did on the same box for a Windows build (15 hours). After 30 minutes it's completed about 10% of the chain (by txs), and projecting 6 hours (and falling). So will probably hit 5 hrs. Interesting how it can be 3x longer on the same box for Windows vs. Linux.10:31 <laanwj> and it makes sense, bitcoind is optimized for various POSIX platforms, not windows, which is different in many aspects; for example leveldb, doesn't even really support windows by itself; the win32 API backend it uses is something i worked on. also the P2P networking doesn't use any i/o polling primitives optimized for windows. Disk i/o is also slower on a lot of windows machines due to windows defender etc getting in the way. To get any level of 10:31 <laanwj> performance there would need a lot of work. Still, it shouldn't be that slow... 10:34 <laanwj> compiling with MSVC instead of mingw also used to be an improvement in speed, but this was 2013, no idea about now, and we can't use that in deterministic builds anyhow 10:36 <hebasto> MSVC builds lack HW-acceleration for SHA256 -- https://github.com/bitcoin/bitcoin/pull/24773 10:36 <darosior> He did mention MSVC vs mingw and i quickly got out of my depth. :) 10:36 <darosior> What do we use for release builds? 10:36 <hebasto> mingw 10:36 <laanwj> mingw, because that's the only thing we can use in side guix 10:36 <laanwj> well we could use clang that would be something to investigate, many seem to prefer that for windows nowadays 10:37 <hebasto> right
maximum_concurrency = 0. But the stall and lack of events are resolved. I don't have any tools set up for concurrency and performance analysis on Linux, so I've probably gotta work that out. Setting up my monster mac now also.
In the mean time I pulled down Bitcoin Core latest Linux binary to get a benchmark. It's doing significantly better than it did on the same box for a Windows build (15 hours). After 30 minutes it's completed about 10% of the chain (by txs), and projecting 6 hours (and falling). So w…10:31 <laanwj> and it makes sense, bitcoind is optimized for various POSIX platforms, not windows, which is different in many aspects; for example leveldb, doesn't even really support windows by itself; the win32 API backend it uses is something i worked on. also the P2P networking doesn't use any i/o polling primitives optimized for windows. Disk i/o is also slower on a lot of windows machines due to windows defender etc getting in the way. To get any level of 10:31 <laanwj> performance there would need a lot of work. Still, it shouldn't be that slow... 10:34 <laanwj> compiling with MSVC instead of mingw also used to be an improvement in speed, but this was 2013, no idea about now, and we can't use that in deterministic builds anyhow 10:36 <hebasto> MSVC builds lack HW-acceleration for SHA256 -- https://github.com/bitcoin/bitcoin/pull/24773 10:36 <darosior> He did mention MSVC vs mingw and i quickly got out of my depth. :) 10:36 <darosior> What do we use for release builds? 10:36 <hebasto> mingw 10:36 <laanwj> mingw, because that's the only thing we can use in side guix 10:36 <laanwj> well we could use clang that would be something to investigate, many seem to prefer that for windows nowadays 10:37 <hebasto> right




This implies that if a tx creates a conflict with a stored tx, the net mineable fee must be a min increase for it to be accepted, strictly for DoS protect.
The tx DoS protection is a min fee rate (sats/byte), and for conflicts is the same idea, but must “pay for” both itself and the graph it conflicts with.
There is an inherent rough patch there at the limit, due the the variable nature of coinbases, which could be exploited if misconfigured, but that's really only an issue for miners, who have the coinbase under their control.
At startup there are also seed connections, dropped after seeding.
There are no redundant block requests.
So: (highly) redundant but not-monitored header requests, and non-redundant but monitored block requests?
Slow channels are defined by a configurable negative deviation from the SD and dropped.
This implies that if a tx creates a conflict with a stored tx, the net mineable fee must be a min increase for it to be accepted, strictly for DoS protect.
The tx DoS protection is a min fee rate (sats/byte), and for conflicts is the same idea, but must “pay for” both itself and the graph it conflicts with.
At startup there are also seed connections, dropped after seeding.
There are no redundant block requests.
So: (highly) redundant but not-monitored header requests, and non-redundant but monitored block requests?
skips all validation
once the best headers chain tip is current
When received, all checks which don't require strict ordering are performed and transactions are stored in a global transaction index.
// Header state is checked by organize.
code protocol_block_in_31800::check(const chain::block& block,
const chain::context& ctx, bool bypass) const NOEXCEPT
{
code ec{};
if (bypass)
{
// Only identity is required under bypass.
if (((ec = block.identify())) || ((ec = block.identify(ctx))))
return ec;
}
else
{
// Identity is not correct if error::invalid_transaction_commitment.
if ((ec = block.check()))
{
if ((ec != system::error::invalid_transaction_commitment) &&
block.is_malleated())
return system::error::block_malleated;
return ec;
}
if ((ec = block.check(ctx)))
return ec;
}
return system::error::block_success;
} (edited)The fully validated chain is then persisted
There is a "spender" relation between an output and its spending transaction(s).
There is a "confirmed" relation between a transaction and its confirmation height
When checking a block for confirmability it will for every transaction fetch its prevout transaction(s) (which must have confirmed state, otherwise the block confirmability check fails) and for each prevout it will mark the spender corresponding to the transaction being checked for confirmability as "confirmed" (if there exists any other spender whose related transaction is "confirmed", this is a double spend, the block confirmability check fails).
wouldn't be able to reorg past the pruning point.
The transaction table is also used to persist unconfirmed transactions.
by default the node requires a transaction has at least 1sat/vb.
For conflicts the node requires the transaction pays at least the minimum feerate for itself plus for the whole graph it conflicts with, plus an incremental feerate (1sat/vb too by default).
timelocks
There is a "confirmed" relation between a transaction and its confirmation height
confirmation header (edited)
validated_tx table with the tx state and validation context. We don't do this during block download because blocks are validated as a whole, so there is no need to relay the transaction state, block state is sufficient for the next (confirmation) checks, which are necessarily block-based. We considered (and designed for) individual transaction-based validation stage fan-out, which could either use this table or synchronize on the block. However, performance testing showed that as long as there are as many blocks as threads it is much faster to validate whole blocks. The same fan-out was tested for confirmability (within a block) and was also found to be not worth the fan-out cost (although was much closer because it's a single block at a time, and there may be configurations where it makes sense). And the tx validation entries are not necessary apart from validating the chain (the plan was to purge the file periodically). So this will probably end up being used only for transactions that enter via the pool. However validated_bk is written with current state (no context required, as block context is inherent and stored with the header), which allows the confirmation chaser to proceed across validated blocks (changing them to confirmable or unconfirmable. A confirmable block may cycle between confirmed and unconfirmed, but the confirmability state is final.validated_bk data is also designed so that it may be purged (it would just have to be regenerated if the block returned via a re-reorg, which would happen automatically. But there are so few blocks and these entries are small (no context) that it's not really worth automating it.validated_tx table with the tx state and validation context. We don't do this during block download because blocks are validated as a whole, so there is no need to relay the transaction state, block state is sufficient for the next (confirmation) checks, which are necessarily block-based. We considered (and designed for) individual transaction-based validation stage fan-out, which could either use this table or synchronize on the block. However, performance testing showed that as long as there are as many blocks as threads it is much faster to validate whole blocks. The same fan-out was tested for confirmability (within a block) and was also found to be not worth the fan-out cost (although was much closer because it's a single block at a time, and there may be configurations where it makes sense). And the tx validation entries are not necessary apart from validating the chain (the plan was to purge the file periodically). So this will probably end up being used only for transactions that enter via the pool. However validated_bk is written with current state (no context required, as block context is inherent and stored with the header), which allows the confirmation chaser to proceed across validated blocks (changing them to confirmable or unconfirmable. A confirmable block may cycle between confirmed and unconfirmed, but the confirmability state is final.validated_bk data is also designed so that it may be purged (it would just have to be regenerated if the block returned via a re-reorg, which would happen automatically. But there are so few blocks and these entries are small (no context) that it's not really worth automating it.txindex turned on (we always index).txindex enabled the BC store is about 25GB larger than BN. I'll add a line to the graph(s) when I get a chance.txindex enabled...
block.accept() and block.connect()), disk reading at 100% (block read and prevout population) and writing almost nothing (block state entry). [first image]
As block size increases (in order), memory will fill up with table pages but will not thrash (reading only) and disk reads will vary to maintain the read-ahead block/prevout cache. [second image]
All that work we did up to this point is to get here so we can validate at 100%, because it doesn't get any faster than that.

i <enter>.block.connect, which executes all script and is 85.6% of the entire run, 98.7% of it is in op_check_sig_verify and op_check_multisig_verify , which is pretty extraordinary. All other opcodes fit into that remaining 1.3%. These two ops are of course dominated by libsecp and sha256, as well as a small amount for tx serialization for signature hashing.
op_check_sig_verify and op_check_multisig_verify . This machine can sync and validate the full chain in about 5 hours with the current build, but running after sync is better for smaller machines that already have CPU maxed out and/or are subject to thrashing in this heavy read/write scenario due to low/slow RAM/SSD.
So I'm going to make that choice a boolean config option, and while I'm at it will add the same for enabling confirmability checks. Since I've per-analyzed the variations on fan out, and a lot of tuning on both of these aspects, automating that choice is really the last big item in sync.
boost::asio::post(threadpool_.service(), BIND(validate_block, link));
void chaser_validate::validate_block(const header_link& link) NOEXCEPT
{
if (closed())
return;
...
} (edited)
-r) and using a build that changes backlog measurement to blocks vs. tx count, the visible CPU valleys are gone. This makes sense because the query to obtain a block's tx count, as it is queued and again dequeued (the deque could have been passed via closure as an optimization), is a hashmap search, and has a material cost. This also changes the buffer limit from a hardwired tx-based value of about 5M to a simple block window, and uses the concurrency_window setting for that purpose (since the values reasonably related to perf, and this use isn't too significant).
[6h - 1.7h = 4.3h] gets accelerated by 40% [1.7h + 4.3 * 60% = 4.3h]