Archive of the libbitcoin Slack #general channel.
uint64_t primary key (not hash IDs). Just querying to obtain all of these takes almost 2 hours on a machine where the sync take 50 minutes. The big part of this cost is associating the prevouts, since they are pointed to by the inputs points, which are natural keys [hash:index]. This is necessary due (1) download concurrency, and (2) write-only tables - which are why the sync is fast.
We pay this cost once already, during validation, to obtain the prevouts for validation. Any implementation needs to do this - to search for the hashes to match up inputs to prevouts. But to perform confirmation we are doing it a second time (for the blocks that are not checkpoint/milestone, the ones we validate). So the idea of accumulation was that we could accumulate in the same (validation) stage, and roll up out of order. However that requires significant additional work for milestone/checkpoint runs in order to fully populate the accumulator. It also then requires total ordering, as described above...10.4 billion hashmap searches just to associate all of the previous outputs. It's very fast considering, but can be much better.10.4 billion prevout searches (there are a lot more queries, but I'm focused on these specifically). Validate only (no download, no confirm) takes 3.4 hours. So 2 hours is consumed in download and confirm (where download alone takes 50 minutes). This time compresses when each runs concurrently, given enough RAM. So I'm working to get this down to about 4.5 hours in the big machine by optimizing confirmation.prevout../bn -t Using default configuration settings. Database is started. Getting first [100] output address hashes. Segmentation fault
./bn 2025-01-03T16:18:31Z.0 ====================== startup ======================= 2025-01-03T16:18:31Z.0 Using default configuration settings. 2025-01-03T16:18:31Z.0 Database failed to start with error 'flush lock failure'. 2025-01-03T16:18:31Z.0 Please wait while restoring from most recent snapshot... 2025-01-03T16:18:31Z.0 restore::recover_snapshot(store) 2025-01-03T16:18:31Z.0 Database restore failed with error 'missing snapshot'. 2025-01-03T16:18:31Z.0 Node stopped successfully. 2025-01-03T16:18:31Z.0 ====================== shutdown ====================== 2025-01-03T16:18:31Z.0 Press <enter> to exit...
void executor::read_test(bool dump) const
{
using namespace database;
constexpr auto start_tx = 1'000'000_u32;
constexpr auto target_count = 100_size;
// Set ensures unique addresses.
std::set<hash_digest> keys{};
auto tx = start_tx;
logger(format("Getting first [%1%] output address hashes.") % target_count);
auto start = fine_clock::now();
while (!cancel_ && keys.size() < target_count)
{
const auto outputs = query_.get_outputs(tx++);
if (outputs->empty())
{
// fault, tx with no outputs.
return;
}
for (const auto& put: *outputs)
{
keys.emplace(put->script().hash());
if (cancel_ || keys.size() == target_count)
break;
}
}
auto span = duration_cast<milliseconds>(fine_clock::now() - start);
logger(format("Got first [%1%] unique addresses above tx [%2%] in [%3%] ms.") %
keys.size() % start_tx % span.count()); const auto outputs = query_.get_outputs(tx++);
if (is_null(outputs))..../bn 2025-01-03T16:57:47Z.0 ====================== startup ======================= 2025-01-03T16:57:47Z.0 Using default configuration settings. 2025-01-03T16:57:47Z.0 The "bitcoin" database directory does not exist. 2025-01-03T16:57:47Z.0 Using default configuration settings. 2025-01-03T16:57:47Z.0 Initializing "bitcoin" directory... 2025-01-03T16:57:47Z.0 Failed because the directory "bitcoin" already exists. 2025-01-03T16:57:47Z.0 Node stopped successfully. 2025-01-03T16:57:47Z.0 ====================== shutdown ====================== 2025-01-03T16:57:47Z.0 Press <enter> to exit...
./bn -n Using default configuration settings. Initializing "bitcoin" directory... Please wait while creating the database... create::create_file(header_head) create::create_file(header_body) create::create_file(input_head) create::create_file(input_body) create::create_file(output_head) create::create_file(output_body) create::create_file(point_head) create::create_file(point_body) create::create_file(puts_head) create::create_file(puts_body) create::create_file(spend_head) create::create_file(spend_body) create::create_file(tx_head) create::create_file(tx_body) create::create_file(txs_head) create::create_file(txs_body) create::create_file(candidate_head) create::create_file(candidate_body) create::create_file(confirmed_head) create::create_file(confirmed_body) create::create_file(strong_tx_head) create::create_file(strong_tx_body) create::create_file(validated_bk_head) create::create_file(validated_bk_body) create::create_file(validated_tx_head) create::create_file(validated_tx_body) create::create_file(address_head) create::create_file(address_body) create::create_file(neutrino_head) create::create_file(neutrino_body) create::open_file(header_head) create::open_file(header_body) create::open_file(input_head) create::open_file(input_body) create::open_file(output_head) create::open_file(output_body) create::open_file(point_head) create::open_file(point_body) create::open_file(puts_head) create::open_file(puts_body) create::open_file(spend_head) create::open_file(spend_body) create::open_file(tx_head) create::open_file(tx_body) create::open_file(txs_head) create::open_file(txs_body) create::open_file(candidate_head) create::open_file(candidate_body) create::open_file(confirmed_head) create::open_file(confirmed_body) create::open_file(strong_tx_head) create::open_file(strong_tx_body) create::open_file(validated_bk_head) create::open_file(validated_bk_body) create::open_file(validated_tx_head) create::open_file(validated_tx_body) create::open_file(address_head) create::open_file(address_body) create::open_file(neutrino_head) create::open_file(neutrino_body) create::load_file(header_head) create::load_file(header_body) create::load_file(input_head) create::load_file(input_body) create::load_file(output_head) create::load_file(output_body) create::load_file(point_head) create::load_file(point_body) create::load_file(puts_head) create::load_file(puts_body) create::load_file(spend_head) create::load_file(spend_body) create::load_file(tx_head) create::load_file(tx_body) create::load_file(txs_head) create::load_file(txs_body) create::load_file(candidate_head) create::load_file(candidate_body) create::load_file(confirmed_head) create::load_file(confirmed_body) create::load_file(strong_tx_head) create::load_file(strong_tx_body) create::load_file(validated_bk_head) create::load_file(validated_bk_body) create::load_file(validated_tx_head) create::load_file(validated_tx_body) create::load_file(address_head) create::load_file(address_body) create::load_file(neutrino_head) create::load_file(neutrino_body) create::create_table(header_table) create::create_table(input_table) create::create_table(output_table) create::create_table(point_table) create::create_table(puts_table) create::create_table(spend_table) create::create_table(tx_table) Bus error
Another cause of bus errors (on Linux anyway) is when the operating system can't back a virtual page with physical memory (e.g. low-memory conditions or out of huge pages when using huge page memory.)
It failed once and then it worked another time?
Return value true if a directory was newly created for the directory p resolves to, false otherwise.
Initializing "M:/bitcoin/" directory... Failed creating directory "M:/bitcoin/" with error 'is a directory'.
./bn 2025-01-05T16:58:12Z.0 ====================== startup ======================= 2025-01-05T16:58:12Z.0 Using default configuration settings. 2025-01-05T16:58:12Z.0 The "bitcoin" database directory does not exist. 2025-01-05T16:58:12Z.0 Using default configuration settings. 2025-01-05T16:58:12Z.0 Initializing "bitcoin" directory... 2025-01-05T16:58:12Z.0 Please wait while creating the database... 2025-01-05T16:58:12Z.0 create::create_file(header_head) 2025-01-05T16:58:12Z.0 create::create_file(header_body) 2025-01-05T16:58:12Z.0 create::create_file(input_head) 2025-01-05T16:58:12Z.0 create::create_file(input_body) 2025-01-05T16:58:12Z.0 create::create_file(output_head) 2025-01-05T16:58:12Z.0 create::create_file(output_body) 2025-01-05T16:58:12Z.0 create::create_file(point_head) 2025-01-05T16:58:12Z.0 create::create_file(point_body) 2025-01-05T16:58:12Z.0 create::create_file(puts_head) 2025-01-05T16:58:12Z.0 create::create_file(puts_body) 2025-01-05T16:58:12Z.0 create::create_file(spend_head) 2025-01-05T16:58:12Z.0 create::create_file(spend_body) 2025-01-05T16:58:12Z.0 create::create_file(tx_head) 2025-01-05T16:58:12Z.0 create::create_file(tx_body) 2025-01-05T16:58:12Z.0 create::create_file(txs_head) 2025-01-05T16:58:12Z.0 create::create_file(txs_body) 2025-01-05T16:58:12Z.0 create::create_file(candidate_head) 2025-01-05T16:58:12Z.0 create::create_file(candidate_body) 2025-01-05T16:58:12Z.0 create::create_file(confirmed_head) 2025-01-05T16:58:12Z.0 create::create_file(confirmed_body) 2025-01-05T16:58:12Z.0 create::create_file(strong_tx_head) 2025-01-05T16:58:12Z.0 create::create_file(strong_tx_body) 2025-01-05T16:58:12Z.0 create::create_file(validated_bk_head) 2025-01-05T16:58:12Z.0 create::create_file(validated_bk_body) 2025-01-05T16:58:12Z.0 create::create_file(validated_tx_head) 2025-01-05T16:58:12Z.0 create::create_file(validated_tx_body) 2025-01-05T16:58:12Z.0 create::create_file(address_head) 2025-01-05T16:58:12Z.0 create::create_file(address_body) 2025-01-05T16:58:12Z.0 create::create_file(neutrino_head) 2025-01-05T16:58:12Z.0 create::create_file(neutrino_body) 2025-01-05T16:58:12Z.0 create::open_file(header_head) 2025-01-05T16:58:12Z.0 create::open_file(header_body) 2025-01-05T16:58:12Z.0 create::open_file(input_head) 2025-01-05T16:58:12Z.0 create::open_file(input_body) 2025-01-05T16:58:12Z.0 create::open_file(output_head) 2025-01-05T16:58:12Z.0 create::open_file(output_body) 2025-01-05T16:58:12Z.0 create::open_file(point_head) 2025-01-05T16:58:12Z.0 create::open_file(point_body) 2025-01-05T16:58:12Z.0 create::open_file(puts_head) 2025-01-05T16:58:12Z.0 create::open_file(puts_body) 2025-01-05T16:58:12Z.0 create::open_file(spend_head) 2025-01-05T16:58:12Z.0 create::open_file(spend_body) 2025-01-05T16:58:12Z.0 create::open_file(tx_head) 2025-01-05T16:58:12Z.0 create::open_file(tx_body) 2025-01-05T16:58:12Z.0 create::open_file(txs_head) 2025-01-05T16:58:12Z.0 create::open_file(txs_body) 2025-01-05T16:58:12Z.0 create::open_file(candidate_head) 2025-01-05T16:58:12Z.0 create::open_file(candidate_body) 2025-01-05T16:58:12Z.0 create::open_file(confirmed_head) 2025-01-05T16:58:12Z.0 create::open_file(confirmed_body) 2025-01-05T16:58:12Z.0 create::open_file(strong_tx_head) 2025-01-05T16:58:12Z.0 create::open_file(strong_tx_body) 2025-01-05T16:58:12Z.0 create::open_file(validated_bk_head) 2025-01-05T16:58:12Z.0 create::open_file(validated_bk_body) 2025-01-05T16:58:12Z.0 create::open_file(validated_tx_head) 2025-01-05T16:58:12Z.0 create::open_file(validated_tx_body) 2025-01-05T16:58:12Z.0 create::open_file(address_head) 2025-01-05T16:58:12Z.0 create::open_file(address_body) 2025-01-05T16:58:12Z.0 create::open_file(neutrino_head) 2025-01-05T16:58:12Z.0 create::open_file(neutrino_body) 2025-01-05T16:58:12Z.0 create::load_file(header_head) 2025-01-05T16:58:12Z.0 create::load_file(header_body) 2025-01-05T16:58:12Z.0 create::load_file(input_head) 2025-01-05T16:58:12Z.0 create::load_file(input_body) 2025-01-05T16:58:12Z.0 create::load_file(output_head) 2025-01-05T16:58:12Z.0 create::load_file(output_body) 2025-01-05T16:58:12Z.0 create::load_file(point_head) 2025-01-05T16:58:12Z.0 create::load_file(point_body) 2025-01-05T16:58:12Z.0 create::load_file(puts_head) 2025-01-05T16:58:12Z.0 create::load_file(puts_body) 2025-01-05T16:58:12Z.0 create::load_file(spend_head) 2025-01-05T16:58:12Z.0 create::load_file(spend_body) 2025-01-05T16:58:12Z.0 create::load_file(tx_head) 2025-01-05T16:58:12Z.0 create::load_file(tx_body) 2025-01-05T16:58:12Z.0 create::load_file(txs_head) 2025-01-05T16:58:12Z.0 create::load_file(txs_body) 2025-01-05T16:58:12Z.0 create::load_file(candidate_head) 2025-01-05T16:58:12Z.0 create::load_file(candidate_body) 2025-01-05T16:58:12Z.0 create::load_file(confirmed_head) 2025-01-05T16:58:12Z.0 create::load_file(confirmed_body) 2025-01-05T16:58:12Z.0 create::load_file(strong_tx_head) 2025-01-05T16:58:12Z.0 create::load_file(strong_tx_body) 2025-01-05T16:58:12Z.0 create::load_file(validated_bk_head) 2025-01-05T16:58:12Z.0 create::load_file(validated_bk_body) 2025-01-05T16:58:12Z.0 create::load_file(validated_tx_head) 2025-01-05T16:58:12Z.0 create::load_file(validated_tx_body) 2025-01-05T16:58:12Z.0 create::load_file(address_head) 2025-01-05T16:58:12Z.0 create::load_file(address_body) 2025-01-05T16:58:12Z.0 create::load_file(neutrino_head) 2025-01-05T16:58:12Z.0 create::load_file(neutrino_body) 2025-01-05T16:58:12Z.0 create::create_table(header_table) 2025-01-05T16:58:12Z.0 create::create_table(input_table) 2025-01-05T16:58:12Z.0 create::create_table(output_table) 2025-01-05T16:58:12Z.0 create::create_table(point_table) 2025-01-05T16:58:15Z.0 create::create_table(puts_table) 2025-01-05T16:58:15Z.0 create::create_table(spend_table) 2025-01-05T16:58:24Z.0 create::create_table(tx_table) 2025-01-05T16:58:27Z.0 create::create_table(txs_table) 2025-01-05T16:58:27Z.0 create::create_table(candidate_table) 2025-01-05T16:58:27Z.0 create::create_table(confirmed_table) 2025-01-05T16:58:27Z.0 create::create_table(strong_tx_table) 2025-01-05T16:58:31Z.0 create::create_table(validated_bk_table) 2025-01-05T16:58:31Z.0 create::create_table(validated_tx_table) 2025-01-05T16:58:35Z.0 create::create_table(address_table) 2025-01-05T16:58:35Z.0 create::create_table(neutrino_table) 2025-01-05T16:58:35Z.0 Storing genesis block. 2025-01-05T16:58:35Z.0 Created the database in 23 secs. 2025-01-05T16:58:35Z.0 Body sizes... header :98 txs :18 tx :62 point :0 input :79 output :81 puts :9 candidate :3 confirmed :3 spend :24 strong_tx :12 valid_tx :0 valid_bk :0 address :0 neutrino :0 2025-01-05T16:58:35Z.0 Table records... header :1 tx :1 point :0 candidate :1 confirmed :1 spend :1 strong_tx :1 address :0 2025-01-05T16:58:35Z.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 2025-01-05T16:58:35Z.0 Version Information... libbitcoin-node: 4.0.0 libbitcoin-database: 4.0.0 libbitcoin-network: 4.0.0 libbitcoin-system: 4.0.0 2025-01-05T16:58:35Z.0 Hardware configuration... 2025-01-05T16:58:35Z.0 arm..... platform:0. 2025-01-05T16:58:35Z.0 intel... platform:1. 2025-01-05T16:58:35Z.0 avx512.. platform:0 compiled:0. 2025-01-05T16:58:35Z.0 avx2.... platform:1 compiled:0. 2025-01-05T16:58:35Z.0 sse41... platform:1 compiled:0. 2025-01-05T16:58:35Z.0 shani... platform:1 compiled:0. 2025-01-05T16:58:35Z.0 neon.... platform:0 compiled:0. 2025-01-05T16:58:35Z.0 Log system configuration... 2025-01-05T16:58:35Z.0 [a]pplication.. compiled:1 enabled:1. 2025-01-05T16:58:35Z.0 [n]ews......... compiled:1 enabled:1. 2025-01-05T16:58:35Z.0 [s]ession...... compiled:1 enabled:1. 2025-01-05T16:58:35Z.0 [p]rotocol..... compiled:1 enabled:0. 2025-01-05T16:58:35Z.0 [x]proxy....... compiled:1 enabled:0. 2025-01-05T16:58:35Z.0 [r]emote....... compiled:1 enabled:1. 2025-01-05T16:58:35Z.0 [f]ault........ compiled:1 enabled:1. 2025-01-05T16:58:35Z.0 [q]uitting..... compiled:1 enabled:0. 2025-01-05T16:58:35Z.0 [o]bjects...... compiled:1 enabled:0. 2025-01-05T16:58:35Z.0 [v]erbose...... compiled:1 enabled:0. 2025-01-05T16:58:35Z.0 Press CTRL-C to stop the node. Segmentation fault
2025-01-05T22:27:32Z.0 Press CTRL-C to stop the node. 2025-01-05T22:27:32Z.0 Please wait while network is starting... 2025-01-05T22:27:32Z.1 Candidate top [000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f:0]. 2025-01-05T22:27:32Z.1 Fork point (0) unassociated (0). 2025-01-05T22:27:33Z.1 Loaded (50000) addresses. 2025-01-05T22:27:33Z.1 Bypassed seeding because outbound connections disabled. 2025-01-05T22:27:33Z.0 Node is started. 2025-01-05T22:27:33Z.1 Not configured for inbound connections. 2025-01-05T22:27:33Z.1 Not configured for outbound connections. 2025-01-05T22:27:33Z.0 Node is running.
// These are thread safe.
const bool concurrent_;
const size_t maximum_backlog_;
const uint64_t initial_subsidy_;
const uint32_t subsidy_interval_;
network::asio::strand independent_strand_;
// These are protected by strand.
network::threadpool threadpool_;block txs % 000k 1 0.00% 050k 50,780 0.00% 100k 216,577 0.02% 150k 1,718,407 0.17% 200k 7,316,696 0.71% 250k 21,491,097 2.08% 300k 38,463,787 3.73% 350k 63,960,713 6.20% 400k 112,477,764 10.90% 450k 190,757,159 18.48% 500k 283,595,037 27.47% 550k 356,588,225 34.54% 600k 466,297,403 45.17% 650k 571,876,797 55.40% 700k 669,566,380 64.86% 750k 757,720,472 73.40% 800k 868,965,224 84.18% 850k 1,032,289,555 100.00%
One thing at a time. What happened with the directory question?
I'm also curious about your build process. Are you using the node repository install.sh or are you building manually and incrementally?
No issues with the path?
neutrino_head table (simple height-based array) and renaming the other to neutrino_filter. This will then be a complete/functional feature.void block.populate() and have it return bool if any input is locked.block.check(context)). We already perform is_forward_reference and is_internal_double_spend in block.check(), which are similar.block.check(). If usually feels like we should invalidate anything that we can as early as well can, but that doesn't always hold up. I've removed some early consensus checks because they are redundant with ones later on, because the early exit on the rare case isn't worth the performance hit on the billions of checks case.block.populate(), which makes it simple and basically free. If this isn't called then standard database checks would take over. I tested this last month (without this locktime aspect) and it was a nice little boost, but this will be a big boost, because it eliminates 9% of confirmation with no tradeoff. And I almost overlooked it. I was going to disable the block.populate() call so that we would get prevout.tx metadata necessary for caching!is_coinbase(prevout) check can be performed in store.populate(block) and set on the prevout metadata, along with the parent tx. This is easily derived from the tx, but by placing the call here it is performed in a normalized manner and during validation (concurrent) and the resulting bit can be set in the cache at no cost. Removing a call per prevout from every input in the chain (2.6B) during confirmation (sequentially). That cuts the cost by the number of cores. Another win.array_map to complement the existing hash_map and simple_array types. The new table is indexed by a positional array, which provides an insertion sort capability with O(1). There is no search to create or to retrieve from the sorted table, with elements being inserted out of order. This is because the insertion code has knowledge of the ordinal position (height) when inserting. As all tables it is append only with a random access head.
The main distinctions are that the head may expand, and there is no hash function or conflict lists (not a hashmap). The header indexes blobs of data by candidate block height, written out of order. This required the introduction of a second head type (hash_head and array_head) and a second map type (hashmap and arraymap) to produce a second table type (hash_map and array_map). The old array_map is renamed to array_simple as it was not actually a map.
Test are complete and moving on to the creation of the new table/header instance via config and the store.bn? I'm trying to add tracy to the build system, but the install.sh I've been using to build bn does not seem to respect the changes I've made to Makefile.am. The install script just clones 4 repos and puts them in build-libbitcoin-node. Do I need to manually alter these repos? Or is there some way to add a source file to the build process for all 4 at once?--performance-analysis or some such--tracer. I'm not sure what works yet, but might be nice to pull and build it and just have it integrated into vscode ux.--with-tracy just to follow our dependency pattern? wouldn't really matter but then in the code the flag would be pretty clear and consistent--with-tracy option were included
it claims to be "low overhead" fwiw, but yeah this is a debugging toolmain() or something? Hahainstall.sh with modifications to the the final project of the installer, github actions provides the environment defintion CI equal to true which the script uses to alter behavior there and can be done locally with the appropriate directory locations. problem is it's going to resync every other project you have if you're storing your sources/changes in the same location.developer_setup.sh (I really should shorten it to just dev.sh). it is generated by the libbitcoin-build project just like install.sh . All install scripts: install.sh, install-cmake.sh, install-cmakepresets.sh and developer_setup.sh share a common codebase with what I hope to be minor tweaks. developer_setup.sh allows for greater granularity of control, allowing you to execute a build against your local repositories.
If and when you have a build with tracy working, we'll then have to fold any changes you've made in the make and config systems into the generation of those artifacts and make sure appropriate mechanisms for cmake are supplied.gsl --script:template/gsl.developer_setup.sh generate4.xml chmod +x output/*/developer_setup.sh
$ sudo apt install libpcre3-dev [sudo] password for cguida: Package libpcre3-dev is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source Error: Package 'libpcre3-dev' has no installation candidate
$ gsl
GSL/4.1.5 Copyright (c) 1996-2016 iMatix Corporation
GSL Developers 2016-2017
syntax: gsl -<option> ... -<attr>[:<value>] ... <filename> ...
or: gsl -a -<option> ... -<attr>[:<value>] <filename> <arg> ...
Options:
-a argument: Pass arguments following filename to GSL script
-q quiet: suppress routine messages
-p parallel: process files in parallel
-c:m[:file] console: set console mode (optionally capture output to file)
(use capital case -C:... to disable the echo)
mode:
p - print as requested
d - prefix with date and time
t - prefix with time only
dbg - datetime, with full flush to disk
-s:n size:n set script cache size - default is 1000000
-h help: show command-line summary
-v version: show full version information2025-01-09 14:11:02 cguida@cg-carbon:~/code/libbitcoin-node$ gsl --script:template/gsl.developer_setup.sh generate4.xml
GSL/4.1.5 Copyright (c) 1996-2016 iMatix Corporation
GSL Developers 2016-2017
gsl/4 I: Processing generate4.xml...
gsl/4 E: Error processing generate4.xml...
Could not find XML file: generate4.xml2025-01-09 15:07:10 cguida@cg-carbon:~/code/libbitcoin-build$ gsl --script:template/gsl.developer_setup.sh generate4.xml
GSL/4.1.5 Copyright (c) 1996-2016 iMatix Corporation
GSL Developers 2016-2017
gsl/4 I: Processing generate4.xml...
No script specified. (edited)$ gsl --script:templates/gsl.developer_setup.sh generate4.xml
GSL/4.1.5 Copyright (c) 1996-2016 iMatix Corporation
GSL Developers 2016-2017
gsl/4 I: Processing generate4.xml...
No script specified.$ gsl templates/gsl.developer_setup.sh generate4.xml
GSL/4.1.5 Copyright (c) 1996-2016 iMatix Corporation
GSL Developers 2016-2017
gsl/4 I: Processing templates/gsl.developer_setup.sh...
(gsl.developer_setup.sh 522) Undefined expression: generate
GSL/4.1.5 Copyright (c) 1996-2016 iMatix Corporation
GSL Developers 2016-2017
gsl/4 I: Processing generate4.xml...
gsl/4 M: Generating output/libbitcoin-client/developer_setup.sh...
gsl/4 M: Generating output/libbitcoin-database/developer_setup.sh...
gsl/4 M: Generating output/libbitcoin-explorer/developer_setup.sh...
gsl/4 M: Generating output/libbitcoin-network/developer_setup.sh...
gsl/4 M: Generating output/libbitcoin-node/developer_setup.sh...
gsl/4 M: Generating output/libbitcoin-protocol/developer_setup.sh...
gsl/4 M: Generating output/libbitcoin-server/developer_setup.sh...
gsl/4 M: Generating output/libbitcoin-system/developer_setup.sh.../usr/include/c++/14/cstdlib:79:15: fatal error: stdlib.h: No such file or directory 79 | #include_next <stdlib.h>
developer_setup.sh 😕$ ./developer_setup.sh --enable-isystem --without-consensus --with-icu --build-icu --build-boost --build-zmq --build-mode=configure --build-target=all --build-src-dir=$PWD/src --build-obj-dir=$PWD/obj --prefix=$PWD/prefix --disable-shared --enable-static libbitcoin-node installer configuration. -------------------------------------------------------------------- OS : Linux PARALLEL : 14 CC : CXX : CPPFLAGS : CFLAGS : CXXFLAGS : LDFLAGS : LDLIBS : WITH_ICU : yes BUILD_ICU : yes BUILD_BOOST : yes BUILD_SECP256K1 : BOOST_ROOT : /home/cguida/code/libbitcoin/prefix BUILD_SRC_DIR : /home/cguida/code/libbitcoin/src BUILD_OBJ_DIR : /home/cguida/code/libbitcoin/obj BUILD_MODE : configure BUILD_TARGET : all SYNC_ONLY : PREFIX : /home/cguida/code/libbitcoin/prefix DISABLE_SHARED : yes DISABLE_STATIC : with_boost : --with-boost=/home/cguida/code/libbitcoin/prefix with_pkgconfigdir : --with-pkgconfigdir=/home/cguida/code/libbitcoin/prefix/lib/pkgconfig -------------------------------------------------------------------- ********************** Initialize git ********************** Reinitialized existing Git repository in /home/cguida/code/libbitcoin/src/.git/ ********************** Initialize object directory ********************** Reinitializing /home/cguida/code/libbitcoin/obj... Initializing directory /home/cguida/code/libbitcoin/obj... ********************** Create local copies of required libraries ********************** ********************** Preparing to acquire icu4c-55_2-src.tgz ********************** Reusing existing archive icu4c-55_2-src.tgz... ********************** Preparing to acquire boost_1_78_0.tar.bz2 ********************** Reusing existing archive boost_1_78_0.tar.bz2... ********************** Preparing to acquire libbitcoin/libbitcoin-system/master ********************** Reusing existing clone of libbitcoin/libbitcoin-system, Branch may not match master... ********************** Preparing to acquire libbitcoin/libbitcoin-network/master ********************** Reusing existing clone of libbitcoin/libbitcoin-network, Branch may not match master... ********************** Preparing to acquire libbitcoin/libbitcoin-database/master ********************** Reusing existing clone of libbitcoin/libbitcoin-database, Branch may not match master... ********************** Preparing to acquire libbitcoin/libbitcoin-node/master ********************** Reusing existing clone of libbitcoin/libbitcoin-node, Branch may not match master... ********************** Build local copies of required libraries ********************** ********************** Preparing to build icu4c-55_2-src.tgz **********************
$ ./developer_setup.sh --enable-isystem --without-consensus --with-icu --build-icu --build-boost --build-zmq --build-mode=configure --build-target=all --build-src-dir=$PWD/src --build-obj-dir=$PWD/obj --prefix=$PWD/prefix --disable-shared --enable-static libbitcoin-node installer configuration. -------------------------------------------------------------------- OS : Linux PARALLEL : 14 CC : CXX : CPPFLAGS : CFLAGS : CXXFLAGS : LDFLAGS : LDLIBS : WITH_ICU : yes BUILD_ICU : yes BUILD_BOOST : yes BUILD_SECP256K1 : BOOST_ROOT : /home/cguida/code/libbitcoin/prefix BUILD_SRC_DIR : /home/cguida/code/libbitcoin/src BUILD_OBJ_DIR : /home/cguida/code/libbitcoin/obj BUILD_MODE : configure BUILD_TARGET : all SYNC_ONLY : PREFIX : /home/cguida/code/libbitcoin/prefix DISABLE_SHARED : yes DISABLE_STATIC : with_boost : --with-boost=/home/cguida/code/libbitcoin/prefix with_pkgconfigdir : --with-pkgconfigdir=/home/cguida/code/libbitcoin/prefix/lib/pkgconfig -------------------------------------------------------------------- ********************** Initialize git ********************** Reinitialized existing Git repository in /home/cguida/code/libbitcoin/src/.git/ ********************** Initialize object directory ********************** Reinitializing /home/cguida/code/libbitcoin/obj... Initializing directory /home/cguida/code/libbitcoin/obj... ********************** Create local copies of required libraries ********************** ********************** Preparing to acquire icu4c-55_2-src.tgz ********************** Reusing existing archive icu4c-55_2-src.tgz...full file
$ ./developer_setup.sh --enable-isystem --without-consensus --with-icu --build-icu --build-boost --build-zmq --build-mode=configure --build-target=all --build-src-dir=$PWD/src --build-obj-dir=$PWD/obj --prefix=$PWD/prefix --disable-shared --enable-static libbitcoin-node installer configuration. -------------------------------------------------------------------- OS : Linux PARALLEL : 14 CC : CXX : CPPFLAGS : CFLAGS : CXXFLAGS : LDFLAGS : LDLIBS : WITH_ICU : yes BUILD_ICU : yes BUILD_BOOST : yes BUILD_SECP256K1 : BOOST_ROOT : /home/cguida/code/libbitcoin/prefix BUILD_SRC_DIR : /home/cguida/code/libbitcoin/src BUILD_OBJ_DIR : /home/cguida/code/libbitcoin/obj BUILD_MODE : configure BUILD_TARGET : all SYNC_ONLY : PREFIX : /home/cguida/code/libbitcoin/prefix DISABLE_SHARED : yes DISABLE_STATIC : with_boost : --with-boost=/home/cguida/code/libbitcoin/prefix with_pkgconfigdir : --with-pkgconfigdir=/home/cguida/code/libbitcoin/prefix/lib/pkgconfig -------------------------------------------------------------------- ********************** Initialize git ********************** Reinitialized existing Git repository in /home/cguida/code/libbitcoin/src/.git/ ********************** Initialize object directory ********************** Reinitializing /home/cguida/code/libbitcoin/obj... Initializing directory /home/cguida/code/libbitcoin/obj... ********************** Create local copies of required libraries ********************** ********************** Preparing to acquire icu4c-55_2-src.tgz ********************** Reusing existing archive icu4c-55_2-src.tgz...full file
$ ./developer_setup.sh --enable-isystem --without-consensus --with-icu --build-icu --build-boost --build-zmq --build-mode=configure --build-target=all --build-src-dir=$PWD/src --build-obj-dir=$PWD/obj --prefix=$PWD/prefix --disable-shared --enable-static libbitcoin-node installer configuration. -------------------------------------------------------------------- OS : Linux PARALLEL : 14 CC : CXX : CPPFLAGS : CFLAGS : CXXFLAGS : LDFLAGS : LDLIBS : WITH_ICU : yes BUILD_ICU : yes BUILD_BOOST : yes BUILD_SECP256K1 : BOOST_ROOT : /home/cguida/code/libbitcoin/prefix BUILD_SRC_DIR : /home/cguida/code/libbitcoin/src BUILD_OBJ_DIR : /home/cguida/code/libbitcoin/obj BUILD_MODE : configure BUILD_TARGET : all SYNC_ONLY : PREFIX : /home/cguida/code/libbitcoin/prefix DISABLE_SHARED : yes DISABLE_STATIC : with_boost : --with-boost=/home/cguida/code/libbitcoin/prefix with_pkgconfigdir : --with-pkgconfigdir=/home/cguida/code/libbitcoin/prefix/lib/pkgconfig -------------------------------------------------------------------- ********************** Initialize git ********************** Reinitialized existing Git repository in /home/cguida/code/libbitcoin/src/.git/ ********************** Initialize object directory ********************** Reinitializing /home/cguida/code/libbitcoin/obj... Initializing directory /home/cguida/code/libbitcoin/obj... ********************** Create local copies of required libraries ********************** ********************** Preparing to acquire icu4c-55_2-src.tgz ********************** Reusing existing archive icu4c-55_2-src.tgz...full file
$ ls -al /usr/include/stdlib.h -rw-r--r-- 1 root root 41032 Jan 3 04:56 /usr/include/stdlib.h
isystem?
https://libbitcoin.slack.com/archives/C6LH74ACQ/p1736798779263119?thread_ts=1736279513.687499&cid=C6LH74ACQbuild mode to go faster?
i have $ ./developer_setup.sh --without-consensus --with-icu --build-icu --build-boost --build-zmq --build-mode=build --build-target=all --build-src-dir=$PWD/src --build-obj-dir=$PWD/obj --prefix=$PWD/prefix --disable-shared --enable-static
and i built once and it took 14 minutes, then i built again without changing anything and it's still several minutes into the build. what's the option for "just rebuild the files I changed"?libbitcoin-node/console/executor_runner.cpp as a sanity check.
but then as I said, I ran the build again with no changes, and it still took a long time--enable-static --enable-static Reusing configuration for /home/cguida/code/libbitcoin/src/libbitcoin-node... Requested 'make clean'... rm -f console/bn rm -f test/libbitcoin-node-test test -z "src/libbitcoin-node.la" || rm -f src/libbitcoin-node.la rm -f src/so_locations rm -rf .libs _libs rm -rf console/.libs console/_libs rm -rf src/.libs src/_libs rm -rf src/chasers/.libs src/chasers/_libs rm -rf src/protocols/.libs src/protocols/_libs rm -rf src/sessions/.libs src/sessions/_libs rm -rf test/.libs test/_libs rm -rf tracy/public/.libs tracy/public/_libs rm -f *.o rm -f console/*.o rm -f src/*.o rm -f src/*.lo rm -f src/chasers/*.o rm -f src/chasers/*.lo rm -f src/protocols/*.o rm -f src/protocols/*.lo rm -f src/sessions/*.o rm -f src/sessions/*.lo rm -f test/*.o rm -f test/chasers/*.o rm -f test/protocols/*.o rm -f test/sessions/*.o rm -f tracy/public/*.o rm -f tracy/public/*.lo test -z "libbitcoin-node-test_runner.sh.log" || rm -f libbitcoin-node-test_runner.sh.log test -z "libbitcoin-node-test_runner.sh.trs" || rm -f libbitcoin-node-test_runner.sh.trs
make_jobs true in the make_project_directory function in developer_setup.sh
true sets "preclean" to true which runes the make cleanmake_jobs false, then i don't get a make cleanmake_jobs false might break something else when build with a different mode. it's more likely a condition has to be made about the mode, calculated and passed.--with-<foo> pattern enabling the presence and respecting those flags - which could be as little as modifying the generate4.xml or as large as editing templates for configure.ac, Makefile.am , CMakeLists.txt, and the pkg-config artifactsTest are complete and moving on to the creation of the new table/header instance via config and the store.
std::unordered_map using std::ref] which has at least offset the cost of writing the prevout cache. 678 secs vs 683 secs previously for the first 50k blocks validated (295k-345k) from disk.block.fee() write into the block validated record. The write has always been there but it didn't formerly compute the actual value (sum of tx fees). So this is also coming at no additional cost. It's not required for validation/confirmation, it's just a query optimization, such as for a block explorer. It's otherwise costly because all tx output values and prevout values are required for fee computation.tx.fee() on each tx validated record, so that we have that value for later validation of the block reward.developer_setup.sh 😕Next is to adapt the confirmable query by incorporating the prevout cache, and then measure the performance change on the maxi/mini machines.
Python 3.12.1 (main, Dec 13 2023, 14:03:38) [GCC 11.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>
>>>
>>> import zmq
>>> import struct
>>> from binascii import hexlify, unhexlify
>>>
>>>
>>> context = zmq.Context()
>>> socket = context.socket(zmq.REQ)
>>> socket.connect("tcp://mainnet.libbitcoin.net:9091")
<SocketContext(connect='tcp://mainnet.libbitcoin.net:9091')>
>>>
>>>
>>> socket
<zmq.Socket(zmq.REQ) at 0x7f5e51567540>
>>>
>>>
>>> socket.send(b'blockchain.fetch_transaction2', zmq.SNDMORE)
>>>
>>> socket.send(struct.pack('I', 42), zmq.SNDMORE)
>>>
>>>
>>> socket.send(unhexlify('60e030aba2f593caf913a7d96880ff227143bfc370d03dbaee37d582801ebd83')[::-1])
>>>
>>>
>>> response_command = socket.recv()
^CTraceback (most recent call last):
File "<stdin>", line 1, in <module>
File "_zmq.py", line 1156, in zmq.backend.cython._zmq.Socket.recv
File "_zmq.py", line 1191, in zmq.backend.cython._zmq.Socket.recv
File "_zmq.py", line 1278, in zmq.backend.cython._zmq._recv_copy
File "_zmq.py", line 160, in zmq.backend.cython._zmq._check_rc
KeyboardInterrupt
>>>
>>>
>>> $ telnet mainnet.libbitcoin.net 9091 Trying 72.65.246.83... Connected to mainnet.libbitcoin.net. Escape character is '^]'. ^] telnet> quit Connection closed.
bx, which always works for me, but sometimes when it works for me, I am told it's not externally available and I don't know why, but I'm chalking it up to my router being strange$ python libbitcoin.py 010000000181d06e4403b989d1e003def4944080e9537ef38e219f58a3856333050d72fe4a080000008b483045022100943e28772ef850587034b447a76c1eb918d63c82a4619a01a34cf32dee13807a02204cbe75c49f8ced0ebc373a6d8e7cb7ecab31369861d8997873b94bac13c379b3014104dbfb10dd8a498b3431f4c7041bbba82aa33146d40b7def4315e9e6df7424d527e762042f9fcc5450cbfc5f849bd3dace5cc9d9b3be8fadc3de92f96e303cf599ffffffff02a8101300000000001976a914b4dc57e35f93de9ec155872c1ad0136134fb08b188acbbe633000000000017a91461ec8bf07c6a3a04a08d1251d70178c1b3d273cc8700000000
$ cat libbitcoin.py
#!python3
import zmq
import struct
from binascii import hexlify, unhexlify
# Connect to the server.
context = zmq.Context()
socket = context.socket(zmq.REQ)
socket.connect("tcp://mainnet.libbitcoin.net:9091")
# Make the request in parts.
socket.send(b'blockchain.fetch_transaction2', zmq.SNDMORE)
socket.send(struct.pack('I', 42), zmq.SNDMORE)
socket.send(unhexlify('60e030aba2f593caf913a7d96880ff227143bfc370d03dbaee37d582801ebd83')[::-1])
# Collect the response in parts.
response_command = socket.recv()
response_id = socket.recv()
response_body = socket.recv()
# Decode and print transaction from message payload.
print(hexlify(response_body[4:]).decode('ascii'))775,526,871 elements in the table. Each element represents a unique block-associated spend (block.tx.input). This includes only spends that are validated, so excludes coinbases, 295k checkpointed blocks, and about 9% block-internal spends (which are statically checked). The total prevout table is 2.9GiB with a 3.2MiB header. The more accurate sizing can now be fed back into default config.std::string and std::vector constexpr support, and full std::ranges support).
There is still a lack of support in clang and gcc for parallel execution policy, and there is no projected timeframe for either. Support is present in gcc but requires an external library, is in progress for clang (experimental) and there is no information for xcode. So I've incorporated a single C++ file third party lib under its MIT license, which will give us std:: parallel execution policies for the functions that we use.
Apart from that our last current language workaround is lack of full consteval support (C++20) in clang16. It's supported in xcode16, and clang17 should have it. At that point we'll be clean except for execution policy.