Archive of the libbitcoin Slack #general channel.
1>.../libbitcoin-system/test/intrinsics/haves.cpp(250): warning : in "intrinsics_haves_tests/intrinsics_haves__have_avx512__when_defined__true": condition have_avx512() is not satisfied 1>.../libbitcoin-system/test/intrinsics/haves.cpp(286): warning : in "intrinsics_haves_tests/intrinsics_haves__have_shani__when_defined__true": condition have_shani() is not satisfied(edited)



bitcoin_hash (double sha256) in debug (unoptimized) builds and 12% in optimized. Implementation of sha-ni should therefore reduce overall header time by 9.5%. Overall processing time looks very evenly distributed and as expected. Locking within the database templates is material, but not crazy. That is very isolated so that we might apply a more efficient technique such as memory fencing in the future. Otherwise I identified one unnecessary line of code that removed 8% of the total run cost during header synch.database::map the two member mutexes ended up waiting on each other. It was entirely isolated to the one class and easy to reproduce under load.memory_ptr map::get(size_t offset) const NOEXCEPT
{
const auto ptr = std::make_shared<access>(remap_mutex_);
if (!loaded_ || is_null(ptr))
return nullptr;
ptr->assign(memory_map_ + offset, memory_map_ + size());
return ptr;
}memory_ptr map::get(size_t offset) const NOEXCEPT
{
const auto logical = size();
const auto ptr = std::make_shared<access>(remap_mutex_);
if (!loaded_ || is_null(ptr))
return nullptr;
ptr->assign(memory_map_ + offset, memory_map_ + logical);
return ptr;
} (edited)access construction. That's because of the interaction of these two methods, and the fact that access() takes a shared lock until destruct.
size_t map::size() const NOEXCEPT
{
std::shared_lock field_lock(field_mutex_);
return logical_;
}
size_t map::allocate(size_t chunk) NOEXCEPT
{
std::unique_lock field_lock(field_mutex_);
if (!loaded_ || is_add_overflow(logical_, chunk))
return storage::eof;
auto end = logical_ + chunk;
if (end > capacity_)
{
const auto size = to_capacity(end);
std::unique_lock remap_lock(remap_mutex_);
if (!remap_(size))
return storage::eof;
}
std::swap(logical_, end);
return end;
} (edited)database::map implementation, including a change to remove the boost dependency, avoiding upgrade locks. The result is at least as performant as prior, possibly a little better.2024-03-16T04:10:49Z.0 Node backup started. 2024-03-16T04:10:49Z.0 backup::flush_table(header_body) 2024-03-16T04:10:49Z.0 backup::flush_table(point_body) 2024-03-16T04:10:54Z.0 backup::flush_table(input_body) 2024-03-16T04:10:59Z.0 backup::flush_table(output_body) 2024-03-16T04:11:07Z.0 backup::flush_table(puts_body) 2024-03-16T04:11:09Z.0 backup::flush_table(tx_body) 2024-03-16T04:11:15Z.0 backup::flush_table(txs_body) 2024-03-16T04:11:15Z.0 backup::flush_table(address_body) 2024-03-16T04:11:15Z.0 backup::flush_table(candidate_body) 2024-03-16T04:11:15Z.0 backup::flush_table(confirmed_body) 2024-03-16T04:11:15Z.0 backup::flush_table(spend_body) 2024-03-16T04:11:20Z.0 backup::flush_table(strong_tx_body) 2024-03-16T04:11:20Z.0 backup::flush_table(bootstrap_body) 2024-03-16T04:11:20Z.0 backup::flush_table(buffer_body) 2024-03-16T04:11:20Z.0 backup::flush_table(neutrino_body) 2024-03-16T04:11:20Z.0 backup::flush_table(validated_bk_body) 2024-03-16T04:11:20Z.0 backup::flush_table(validated_tx_body) 2024-03-16T04:11:20Z.0 backup::backup_table(header_table) 2024-03-16T04:11:20Z.0 backup::backup_table(point_table) 2024-03-16T04:11:20Z.0 backup::backup_table(input_table) 2024-03-16T04:11:20Z.0 backup::backup_table(output_table) 2024-03-16T04:11:20Z.0 backup::backup_table(puts_table) 2024-03-16T04:11:20Z.0 backup::backup_table(tx_table) 2024-03-16T04:11:20Z.0 backup::backup_table(txs_table) 2024-03-16T04:11:20Z.0 backup::backup_table(address_table) 2024-03-16T04:11:20Z.0 backup::backup_table(candidate_table) 2024-03-16T04:11:20Z.0 backup::backup_table(confirmed_table) 2024-03-16T04:11:20Z.0 backup::backup_table(spend_table) 2024-03-16T04:11:20Z.0 backup::backup_table(strong_tx_table) 2024-03-16T04:11:20Z.0 backup::backup_table(bootstrap_table) 2024-03-16T04:11:20Z.0 backup::backup_table(buffer_table) 2024-03-16T04:11:20Z.0 backup::backup_table(neutrino_table) 2024-03-16T04:11:20Z.0 backup::backup_table(validated_bk_table) 2024-03-16T04:11:20Z.0 backup::backup_table(validated_tx_table) 2024-03-16T04:11:23Z.0 backup::dump_table(header_head) 2024-03-16T04:11:23Z.0 backup::dump_table(point_head) 2024-03-16T04:11:29Z.0 backup::dump_table(input_head) 2024-03-16T04:11:29Z.0 backup::dump_table(output_head) 2024-03-16T04:11:29Z.0 backup::dump_table(puts_head) 2024-03-16T04:11:29Z.0 backup::dump_table(tx_head) 2024-03-16T04:11:36Z.0 backup::dump_table(txs_head) 2024-03-16T04:11:36Z.0 backup::dump_table(address_head) 2024-03-16T04:11:36Z.0 backup::dump_table(candidate_head) 2024-03-16T04:11:36Z.0 backup::dump_table(confirmed_head) 2024-03-16T04:11:36Z.0 backup::dump_table(spend_head) 2024-03-16T04:11:54Z.0 backup::dump_table(strong_tx_head) 2024-03-16T04:12:00Z.0 backup::dump_table(bootstrap_head) 2024-03-16T04:12:00Z.0 backup::dump_table(buffer_head) 2024-03-16T04:12:00Z.0 backup::dump_table(neutrino_head) 2024-03-16T04:12:00Z.0 backup::dump_table(validated_bk_head) 2024-03-16T04:12:00Z.0 backup::dump_table(validated_tx_head) 2024-03-16T04:12:09Z.0 Node backup complete.
2024-03-16T04:30:40Z.0 Node backup started. 2024-03-16T04:30:40Z.0 backup::flush_table(header_body) 2024-03-16T04:30:40Z.0 backup::flush_table(point_body) 2024-03-16T04:31:00Z.0 backup::flush_table(input_body) 2024-03-16T04:31:09Z.0 backup::flush_table(output_body) 2024-03-16T04:31:53Z.0 backup::flush_table(puts_body) 2024-03-16T04:32:04Z.0 backup::flush_table(tx_body) 2024-03-16T04:32:15Z.0 backup::flush_table(txs_body) 2024-03-16T04:32:15Z.0 backup::flush_table(address_body) 2024-03-16T04:32:15Z.0 backup::flush_table(candidate_body) 2024-03-16T04:32:15Z.0 backup::flush_table(confirmed_body) 2024-03-16T04:32:15Z.0 backup::flush_table(spend_body) 2024-03-16T04:32:18Z.0 backup::flush_table(strong_tx_body) 2024-03-16T04:32:18Z.0 backup::flush_table(bootstrap_body) 2024-03-16T04:32:18Z.0 backup::flush_table(buffer_body) 2024-03-16T04:32:18Z.0 backup::flush_table(neutrino_body) 2024-03-16T04:32:18Z.0 backup::flush_table(validated_bk_body) 2024-03-16T04:32:18Z.0 backup::flush_table(validated_tx_body) 2024-03-16T04:32:18Z.0 backup::backup_table(header_table) 2024-03-16T04:32:18Z.0 backup::backup_table(point_table) 2024-03-16T04:32:18Z.0 backup::backup_table(input_table) 2024-03-16T04:32:18Z.0 backup::backup_table(output_table) 2024-03-16T04:32:18Z.0 backup::backup_table(puts_table) 2024-03-16T04:32:18Z.0 backup::backup_table(tx_table) 2024-03-16T04:32:18Z.0 backup::backup_table(txs_table) 2024-03-16T04:32:18Z.0 backup::backup_table(address_table) 2024-03-16T04:32:18Z.0 backup::backup_table(candidate_table) 2024-03-16T04:32:18Z.0 backup::backup_table(confirmed_table) 2024-03-16T04:32:18Z.0 backup::backup_table(spend_table) 2024-03-16T04:32:18Z.0 backup::backup_table(strong_tx_table) 2024-03-16T04:32:18Z.0 backup::backup_table(bootstrap_table) 2024-03-16T04:32:18Z.0 backup::backup_table(buffer_table) 2024-03-16T04:32:18Z.0 backup::backup_table(neutrino_table) 2024-03-16T04:32:18Z.0 backup::backup_table(validated_bk_table) 2024-03-16T04:32:18Z.0 backup::backup_table(validated_tx_table) 2024-03-16T04:32:21Z.0 backup::dump_table(header_head) 2024-03-16T04:32:21Z.0 backup::dump_table(point_head) 2024-03-16T04:32:27Z.0 backup::dump_table(input_head) 2024-03-16T04:32:27Z.0 backup::dump_table(output_head) 2024-03-16T04:32:27Z.0 backup::dump_table(puts_head) 2024-03-16T04:32:27Z.0 backup::dump_table(tx_head) 2024-03-16T04:32:34Z.0 backup::dump_table(txs_head) 2024-03-16T04:32:34Z.0 backup::dump_table(address_head) 2024-03-16T04:32:34Z.0 backup::dump_table(candidate_head) 2024-03-16T04:32:34Z.0 backup::dump_table(confirmed_head) 2024-03-16T04:32:34Z.0 backup::dump_table(spend_head) 2024-03-16T04:32:51Z.0 backup::dump_table(strong_tx_head) 2024-03-16T04:32:58Z.0 backup::dump_table(bootstrap_head) 2024-03-16T04:32:58Z.0 backup::dump_table(buffer_head) 2024-03-16T04:32:58Z.0 backup::dump_table(neutrino_head) 2024-03-16T04:32:58Z.0 backup::dump_table(validated_bk_head) 2024-03-16T04:32:58Z.0 backup::dump_table(validated_tx_head) 2024-03-16T04:33:07Z.0 Node backup complete.
$ bn -c f:/bn.cfg --restore Using config file: "f:/bn.cfg" Please wait while restoring "F:/bitcoin/" from most recent snapshot... restore::recover_snapshot(store) restore::open_file(header_head) restore::open_file(header_body) restore::open_file(point_head) restore::open_file(point_body) restore::open_file(input_head) restore::open_file(input_body) restore::open_file(output_head) restore::open_file(output_body) restore::open_file(puts_head) restore::open_file(puts_body) restore::open_file(tx_head) restore::open_file(tx_body) restore::open_file(txs_head) restore::open_file(txs_body) restore::open_file(address_head) restore::open_file(address_body) restore::open_file(candidate_head) restore::open_file(candidate_body) restore::open_file(confirmed_head) restore::open_file(confirmed_body) restore::open_file(spend_head) restore::open_file(spend_body) restore::open_file(strong_tx_head) restore::open_file(strong_tx_body) restore::open_file(bootstrap_head) restore::open_file(bootstrap_body) restore::open_file(buffer_head) restore::open_file(buffer_body) restore::open_file(neutrino_head) restore::open_file(neutrino_body) restore::open_file(validated_bk_head) restore::open_file(validated_bk_body) restore::open_file(validated_tx_head) restore::open_file(validated_tx_body) restore::load_file(header_head) restore::load_file(header_body) restore::load_file(point_head) restore::load_file(point_body) restore::load_file(input_head) restore::load_file(input_body) restore::load_file(output_head) restore::load_file(output_body) restore::load_file(puts_head) restore::load_file(puts_body) restore::load_file(tx_head) restore::load_file(tx_body) restore::load_file(txs_head) restore::load_file(txs_body) restore::load_file(address_head) restore::load_file(address_body) restore::load_file(candidate_head) restore::load_file(candidate_body) restore::load_file(confirmed_head) restore::load_file(confirmed_body) restore::load_file(spend_head) restore::load_file(spend_body) restore::load_file(strong_tx_head) restore::load_file(strong_tx_body) restore::load_file(bootstrap_head) restore::load_file(bootstrap_body) restore::load_file(buffer_head) restore::load_file(buffer_body) restore::load_file(neutrino_head) restore::load_file(neutrino_body) restore::load_file(validated_bk_head) restore::load_file(validated_bk_body) restore::load_file(validated_tx_head) restore::load_file(validated_tx_body) restore::restore_table(header_table) restore::restore_table(point_table) restore::restore_table(input_table) restore::restore_table(output_table) restore::restore_table(puts_table) restore::restore_table(tx_table) restore::restore_table(txs_table) restore::restore_table(address_table) restore::restore_table(candidate_table) restore::restore_table(confirmed_table) restore::restore_table(spend_table) restore::restore_table(strong_tx_table) restore::restore_table(bootstrap_table) restore::restore_table(buffer_table) restore::restore_table(neutrino_table) restore::restore_table(validated_bk_table) restore::restore_table(validated_tx_table) restore::unload_file(header_head) restore::unload_file(header_body) restore::unload_file(point_head) restore::unload_file(point_body) restore::unload_file(input_head) restore::unload_file(input_body) restore::unload_file(output_head) restore::unload_file(output_body) restore::unload_file(puts_head) restore::unload_file(puts_body) restore::unload_file(tx_head) restore::unload_file(tx_body) restore::unload_file(txs_head) restore::unload_file(txs_body) restore::unload_file(address_head) restore::unload_file(address_body) restore::unload_file(candidate_head) restore::unload_file(candidate_body) restore::unload_file(confirmed_head) restore::unload_file(confirmed_body) restore::unload_file(spend_head) restore::unload_file(spend_body) restore::unload_file(strong_tx_head) restore::unload_file(strong_tx_body) restore::unload_file(bootstrap_head) restore::unload_file(bootstrap_body) restore::unload_file(buffer_head) restore::unload_file(buffer_body) restore::unload_file(neutrino_head) restore::unload_file(neutrino_body) restore::unload_file(validated_bk_head) restore::unload_file(validated_bk_body) restore::unload_file(validated_tx_head) restore::unload_file(validated_tx_body) restore::close_file(header_head) restore::close_file(header_body) restore::close_file(point_head) restore::close_file(point_body) restore::close_file(input_head) restore::close_file(input_body) restore::close_file(output_head) restore::close_file(output_body) restore::close_file(puts_head) restore::close_file(puts_body) restore::close_file(tx_head) restore::close_file(tx_body) restore::close_file(txs_head) restore::close_file(txs_body) restore::close_file(address_head) restore::close_file(address_body) restore::close_file(candidate_head) restore::close_file(candidate_body) restore::close_file(confirmed_head) restore::close_file(confirmed_body) restore::close_file(spend_head) restore::close_file(spend_body) restore::close_file(strong_tx_head) restore::close_file(strong_tx_body) restore::close_file(bootstrap_head) restore::close_file(bootstrap_body) restore::close_file(buffer_head) restore::close_file(buffer_body) restore::close_file(neutrino_head) restore::close_file(neutrino_body) restore::close_file(validated_bk_head) restore::close_file(validated_bk_body) restore::close_file(validated_tx_head) restore::close_file(validated_tx_body) Restored database in 13781 ms.
$ bn -c f:/bn.cfg --help Usage: bn [-bfhilmrsvwx] [--config value] Info: Runs a full bitcoin node. Options (named): -b [--buckets] Compute and display all bucket densities. -c [--config] Specify path to a configuration settings file. -f [--flags] Compute and display all flag transitions. -h [--help] Display command line options. -i [--initchain] Initialize store in configured directory. -l [--collisions] Compute and display hashmap collision stats. -m [--measure] Compute and display store measures. -r [--restore] Restore from most recent snapshot. -s [--settings] Display all configuration settings. -v [--version] Display version information.(edited)
$ bn -c f:/bn.cfg --version Version Information ---------------------------- libbitcoin-node: 4.0.0 libbitcoin-database: 4.0.0 libbitcoin-network: 4.0.0 libbitcoin-system: 4.0.0(edited)
$ bn -c f:/bn.cfg --flags Using config file: "f:/bn.cfg" Please wait while the database is starting... Press CTRL-C to cancel operation. Forked from [00000000000000000000000000000000] to [00000000000000100000000010001011] at [00000000839a8e6886ab5951d76f411475428afc90947ee320161bbf18eb6048:1] Forked from [00000000000000100000000010001011] to [00000000000000100000000010000011] at [00000000000a4d0a398161ffc163c503763b1f4360639393e0e4c8e300e0caec:91842] Forked from [00000000000000100000000010000011] to [00000000000000100000000010001011] at [0000000000016ca756e810d44aee6be7eabad75d2209d7f4542d1fd53bafc984:91843] Forked from [00000000000000100000000010001011] to [00000000000000100000000010000011] at [00000000000743f190a18c5577a3c2d2a1f610ae9601ac046a38084ccb7cd721:91880] Forked from [00000000000000100000000010000011] to [00000000000000100000000010001011] at [00000000000cf6204ce82deed75b050014dc57d7bb462d7214fcc4e59c48d66d:91881] Forked from [00000000000000100000000010001011] to [00000000000000100000000010001111] at [00000000000000ce80a7e057163a4db1d5ad7b20fb6f598c9597b9665c8fb0d4:173805] Forked from [00000000000000100000000010001111] to [00000000000000100000000010010111] at [000000000000024b89b42a942fe0d9fea3bb44ab7bd1b19115dd6a759c0808b8:227931] Forked from [00000000000000100000000010010111] to [00000000000000100000000010110111] at [00000000000000000379eaa19dce8c9b722d46ae6a57c2f1a988119488b50931:363725] Forked from [00000000000000100000000010110111] to [00000000000000100000000011110111] at [000000000000000004c2b624ed5d7756c508d90fd0da2c7c679febfa6c4735f0:388381] Forked from [00000000000000100000000011110111] to [00000000000000100000011111110111] at [000000000000000004a1b34462cb8aeebd5799177f7a29cf28f2d1961716b5b5:419328] Forked from [00000000000000100000011111110111] to [00000000000000100011111111110111] at [0000000000000000001c8018d9cb3b742ef25114f27563e3fc4a1902167f9893:481824]
boost::thread dependency. This was the result of using boost::thread_specific_ptr as a workaround for not having thread_static implemented in all platforms. This was precipitated from an exception thrown by boost:shared_mutex from database. I decided to test operation with 500 threads configured, and it crashed as soon as 128 blocked writers accumulated. This was the result of boost using a 7 bit struct bitfield to store that limit. After removing all boost thread and mutex code it's humming along no problem with a 500 thread pool. The main objective with the test was to determine how critical is thread pool sizing. Turns out too few can really slow down the network but too many doesn't really matter. This is also true of channel count.protocol_blocks_in_31800.sha-ni is still not integrated, and that's a 5x improvement in sha256 hashing - which is one of the most significant costs.