Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ on:
- 'test/**'
- 'tools/initchain/**'
push:
branches:
- "**"
tags-ignore:
- "**"
paths:
Expand Down
4 changes: 2 additions & 2 deletions builds/gnu/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ include_bitcoin_database_tables_indexes_HEADERS = \
${srcdir}/../../include/bitcoin/database/tables/indexes/height.hpp \
${srcdir}/../../include/bitcoin/database/tables/indexes/scan.hpp \
${srcdir}/../../include/bitcoin/database/tables/indexes/state.hpp \
${srcdir}/../../include/bitcoin/database/tables/indexes/strong_tx.hpp \
${srcdir}/../../include/bitcoin/database/tables/indexes/strong.hpp \
${srcdir}/../../include/bitcoin/database/tables/indexes/wtxid.hpp

include_bitcoin_database_tables_optionalsdir = \
Expand Down Expand Up @@ -503,7 +503,7 @@ test_libbitcoin_database_test_SOURCES = \
${srcdir}/../../test/tables/indexes/height.cpp \
${srcdir}/../../test/tables/indexes/scan.cpp \
${srcdir}/../../test/tables/indexes/state.cpp \
${srcdir}/../../test/tables/indexes/strong_tx.cpp \
${srcdir}/../../test/tables/indexes/strong.cpp \
${srcdir}/../../test/tables/indexes/wtxid.cpp \
${srcdir}/../../test/tables/optional/address.cpp \
${srcdir}/../../test/tables/optional/filter_bk.cpp \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@
</ClCompile>
<ClCompile Include="..\..\..\..\test\tables\indexes\scan.cpp" />
<ClCompile Include="..\..\..\..\test\tables\indexes\state.cpp" />
<ClCompile Include="..\..\..\..\test\tables\indexes\strong_tx.cpp" />
<ClCompile Include="..\..\..\..\test\tables\indexes\strong.cpp" />
<ClCompile Include="..\..\..\..\test\tables\indexes\wtxid.cpp" />
<ClCompile Include="..\..\..\..\test\tables\optional\address.cpp" />
<ClCompile Include="..\..\..\..\test\tables\optional\filter_bk.cpp" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@
<ClCompile Include="..\..\..\..\test\tables\indexes\state.cpp">
<Filter>src\tables\indexes</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\test\tables\indexes\strong_tx.cpp">
<ClCompile Include="..\..\..\..\test\tables\indexes\strong.cpp">
<Filter>src\tables\indexes</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\test\tables\indexes\wtxid.cpp">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@
<ClInclude Include="..\..\..\..\include\bitcoin\database\tables\indexes\height.hpp" />
<ClInclude Include="..\..\..\..\include\bitcoin\database\tables\indexes\scan.hpp" />
<ClInclude Include="..\..\..\..\include\bitcoin\database\tables\indexes\state.hpp" />
<ClInclude Include="..\..\..\..\include\bitcoin\database\tables\indexes\strong_tx.hpp" />
<ClInclude Include="..\..\..\..\include\bitcoin\database\tables\indexes\strong.hpp" />
<ClInclude Include="..\..\..\..\include\bitcoin\database\tables\indexes\wtxid.hpp" />
<ClInclude Include="..\..\..\..\include\bitcoin\database\tables\names.hpp" />
<ClInclude Include="..\..\..\..\include\bitcoin\database\tables\optionals\address.hpp" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@
<ClInclude Include="..\..\..\..\include\bitcoin\database\tables\indexes\state.hpp">
<Filter>include\bitcoin\database\tables\indexes</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\bitcoin\database\tables\indexes\strong_tx.hpp">
<ClInclude Include="..\..\..\..\include\bitcoin\database\tables\indexes\strong.hpp">
<Filter>include\bitcoin\database\tables\indexes</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\include\bitcoin\database\tables\indexes\wtxid.hpp">
Expand Down
2 changes: 1 addition & 1 deletion include/bitcoin/database.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
#include <bitcoin/database/tables/indexes/height.hpp>
#include <bitcoin/database/tables/indexes/scan.hpp>
#include <bitcoin/database/tables/indexes/state.hpp>
#include <bitcoin/database/tables/indexes/strong_tx.hpp>
#include <bitcoin/database/tables/indexes/strong.hpp>
#include <bitcoin/database/tables/indexes/wtxid.hpp>
#include <bitcoin/database/tables/optionals/address.hpp>
#include <bitcoin/database/tables/optionals/filter_bk.hpp>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,19 +110,19 @@ bool CLASS::set_strong(const header_link& link, const tx_links& fks,
bool positive) NOEXCEPT
{
using namespace system;
using link_t = table::strong_tx::link;
using element_t = table::strong_tx::record;
using link_t = table::strong::link;
using element_t = table::strong::record;

// Preallocate all strong_tx records for the block and reuse memory ptr.
// Preallocate all strong records for the block and reuse memory ptr.
const auto records = possible_narrow_cast<link_t::integer>(fks.size());
auto record = store_.strong_tx.allocate(records);
const auto ptr = store_.strong_tx.get_memory();
auto record = store_.strong.allocate(records);
const auto ptr = store_.strong.get_memory();

for (const auto& fk: fks)
if (!store_.strong_tx.put(ptr, record++, tx_link{ fk }, element_t
if (!store_.strong.put(ptr, record++, tx_link{ fk }, element_t
{
{},
table::strong_tx::merge(positive, link)
table::strong::merge(positive, link)
})) return false;

return true;
Expand Down
10 changes: 5 additions & 5 deletions include/bitcoin/database/impl/query/extent.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ size_t CLASS::store_body_size() const NOEXCEPT
return archive_body_size()
+ candidate_body_size()
+ confirmed_body_size()
+ strong_tx_body_size()
+ strong_body_size()
+ scan_body_size()
+ scan_prefix_body_size()
+ ecdsa0_body_size()
Expand Down Expand Up @@ -132,7 +132,7 @@ size_t CLASS::store_head_size() const NOEXCEPT
return archive_head_size()
+ candidate_head_size()
+ confirmed_head_size()
+ strong_tx_head_size()
+ strong_head_size()
+ scan_head_size()
+ scan_prefix_head_size()
+ ecdsa0_head_size()
Expand Down Expand Up @@ -170,7 +170,7 @@ DEFINE_SIZES(tx)

DEFINE_SIZES(candidate)
DEFINE_SIZES(confirmed)
DEFINE_SIZES(strong_tx)
DEFINE_SIZES(strong)
DEFINE_SIZES(scan)
DEFINE_SIZES(scan_prefix)
DEFINE_SIZES(ecdsa0)
Expand Down Expand Up @@ -203,7 +203,7 @@ DEFINE_BUCKETS(outs)
DEFINE_BUCKETS(txs)
DEFINE_BUCKETS(tx)

DEFINE_BUCKETS(strong_tx)
DEFINE_BUCKETS(strong)
DEFINE_BUCKETS(scan)
DEFINE_BUCKETS(duplicate)
DEFINE_BUCKETS(prevout)
Expand All @@ -222,7 +222,7 @@ DEFINE_RECORDS(tx)

DEFINE_RECORDS(candidate)
DEFINE_RECORDS(confirmed)
DEFINE_RECORDS(strong_tx)
DEFINE_RECORDS(strong)
DEFINE_RECORDS(scan)
DEFINE_RECORDS(scan_prefix)
DEFINE_RECORDS(ecdsa0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -284,8 +284,8 @@ tx_links CLASS::to_duplicates(const hash_digest& tx_hash) const NOEXCEPT
TEMPLATE
header_link CLASS::to_block(const tx_link& link) const NOEXCEPT
{
table::strong_tx::record strong{};
if (!store_.strong_tx.find(link, strong) || !strong.positive())
table::strong::record strong{};
if (!store_.strong.find(link, strong) || !strong.positive())
return {};

return strong.header_fk();
Expand Down
17 changes: 9 additions & 8 deletions include/bitcoin/database/impl/store/store.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ CLASS::store(const settings& config) NOEXCEPT
candidate_head_(head(config.path / schema::dir::heads, schema::indexes::candidate), head_settings<schema::height::cell>(config.candidate), sequential),
confirmed_head_(head(config.path / schema::dir::heads, schema::indexes::confirmed), head_settings<schema::height::cell>(config.confirmed), sequential),

strong_tx_head_(head(config.path / schema::dir::heads, schema::indexes::strong_tx), head_settings(config.strong_tx), random),
strong_tx_body_(body(config.path, schema::indexes::strong_tx), config.strong_tx, sequential, staged),
strong_head_(head(config.path / schema::dir::heads, schema::indexes::strong), head_settings(config.strong), random),
strong_body_(body(config.path, schema::indexes::strong), config.strong, sequential, staged),
scan_head_(head(config.path / schema::dir::heads, schema::indexes::scan), head_settings(config.scan), random),
scan_body_(body(config.path, schema::indexes::scan), config.scan, sequential, staged),
scan_prefix_head_(head(config.path / schema::dir::heads, schema::indexes::scan_prefix), head_settings(config.scan), sequential),
Expand Down Expand Up @@ -126,8 +126,8 @@ CLASS::store(const settings& config) NOEXCEPT
pool_body_(body(config.path, schema::caches::pool), config.pool, sequential, staged),
spends_head_(head(config.path / schema::dir::heads, schema::caches::spends), head_settings(config.spends), sequential),
spends_body_(body(config.path, schema::caches::spends), config.spends, sequential, staged),
wtxid_head_(head(config.path / schema::dir::heads, schema::indexes::wtxid), head_settings(config.pool), random),
wtxid_body_(body(config.path, schema::indexes::wtxid), config.pool, sequential, staged),
wtxid_head_(head(config.path / schema::dir::heads, schema::indexes::wtxid), head_settings(config.wtxid), random),
wtxid_body_(body(config.path, schema::indexes::wtxid), config.wtxid, sequential, staged),

// Optionals.
// ------------------------------------------------------------------------
Expand Down Expand Up @@ -157,7 +157,7 @@ CLASS::store(const settings& config) NOEXCEPT

candidate(candidate_head_),
confirmed(confirmed_head_),
strong_tx(strong_tx_head_, strong_tx_body_, config.strong_tx.buckets, config.strong_tx.expected),
strong(strong_head_, strong_body_, config.strong.buckets, config.strong.expected),
scan(scan_head_, scan_body_, config.scan.buckets),
scan_prefix(scan_prefix_head_, scan_prefix_body_),

Expand All @@ -179,7 +179,7 @@ CLASS::store(const settings& config) NOEXCEPT
state(state_head_),
pool(pool_head_, pool_body_, config.pool.buckets, config.pool.expected),
spends(spends_head_, spends_body_),
wtxid(wtxid_head_, wtxid_body_, config.pool.buckets, config.pool.expected),
wtxid(wtxid_head_, wtxid_body_, config.wtxid.buckets, config.wtxid.expected),

filter_bk(filter_bk_head_, filter_bk_body_, config.filter_bk.buckets),
filter_tx(filter_tx_head_, filter_tx_body_, config.filter_tx.buckets)
Expand All @@ -193,9 +193,10 @@ CLASS::store(const settings& config) NOEXCEPT
envelope_.ins_k = possible_narrow_cast<uint8_t>(ins.filter_k());
envelope_.outs_k = possible_narrow_cast<uint8_t>(outs.filter_k());
envelope_.tx_k = possible_narrow_cast<uint8_t>(tx.filter_k());
envelope_.strong_tx_k = possible_narrow_cast<uint8_t>(strong_tx.filter_k());
envelope_.strong_k = possible_narrow_cast<uint8_t>(strong.filter_k());
envelope_.duplicate_k = possible_narrow_cast<uint8_t>(duplicate.filter_k());
envelope_.pool_k = possible_narrow_cast<uint8_t>(pool.filter_k());
envelope_.wtxid_k = possible_narrow_cast<uint8_t>(wtxid.filter_k());
}

TEMPLATE
Expand Down Expand Up @@ -354,7 +355,7 @@ void CLASS::set_current(bool current) NOEXCEPT
txs_head_.current(current);
candidate_head_.current(current);
confirmed_head_.current(current);
strong_tx_head_.current(current);
strong_head_.current(current);
scan_head_.current(current);
scan_prefix_head_.current(current);
ecdsa0_head_.current(current);
Expand Down
2 changes: 1 addition & 1 deletion include/bitcoin/database/impl/store/store_backup.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ code CLASS::backup(const event_handler& handler, bool prune) NOEXCEPT

backup(ec, candidate, table_t::candidate_table);
backup(ec, confirmed, table_t::confirmed_table);
backup(ec, strong_tx, table_t::strong_tx_table);
backup(ec, strong, table_t::strong_table);
backup(ec, scan, table_t::scan_table);
backup(ec, scan_prefix, table_t::scan_prefix_table);

Expand Down
2 changes: 1 addition & 1 deletion include/bitcoin/database/impl/store/store_close.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ code CLASS::close(const event_handler& handler) NOEXCEPT

close(ec, candidate, table_t::candidate_table);
close(ec, confirmed, table_t::confirmed_table);
close(ec, strong_tx, table_t::strong_tx_table);
close(ec, strong, table_t::strong_table);
close(ec, scan, table_t::scan_table);
close(ec, scan_prefix, table_t::scan_prefix_table);

Expand Down
6 changes: 3 additions & 3 deletions include/bitcoin/database/impl/store/store_create.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ code CLASS::create_load(const event_handler& handler) NOEXCEPT

create(ec, candidate_head_, table_t::candidate_head);
create(ec, confirmed_head_, table_t::confirmed_head);
create(ec, strong_tx_head_, table_t::strong_tx_head);
create(ec, strong_tx_body_, table_t::strong_tx_body);
create(ec, strong_head_, table_t::strong_head);
create(ec, strong_body_, table_t::strong_body);
create(ec, scan_head_, table_t::scan_head);
create(ec, scan_body_, table_t::scan_body);
create(ec, scan_prefix_head_, table_t::scan_prefix_head);
Expand Down Expand Up @@ -169,7 +169,7 @@ code CLASS::create_load(const event_handler& handler) NOEXCEPT

populate(ec, candidate, table_t::candidate_table);
populate(ec, confirmed, table_t::confirmed_table);
populate(ec, strong_tx, table_t::strong_tx_table);
populate(ec, strong, table_t::strong_table);
populate(ec, scan, table_t::scan_table);
populate(ec, scan_prefix, table_t::scan_prefix_table);

Expand Down
2 changes: 1 addition & 1 deletion include/bitcoin/database/impl/store/store_dump.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ code CLASS::dump(const path& folder,

dump(ec, candidate_head_, schema::indexes::candidate, table_t::candidate_head);
dump(ec, confirmed_head_, schema::indexes::confirmed, table_t::confirmed_head);
dump(ec, strong_tx_head_, schema::indexes::strong_tx, table_t::strong_tx_head);
dump(ec, strong_head_, schema::indexes::strong, table_t::strong_head);
dump(ec, scan_head_, schema::indexes::scan, table_t::scan_head);
dump(ec, scan_prefix_head_, schema::indexes::scan_prefix, table_t::scan_prefix_head);

Expand Down
10 changes: 5 additions & 5 deletions include/bitcoin/database/impl/store/store_open.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ code CLASS::open(const event_handler& handler) NOEXCEPT

verify(ec, candidate, table_t::candidate_table);
verify(ec, confirmed, table_t::confirmed_table);
verify(ec, strong_tx, table_t::strong_tx_table);
verify(ec, strong, table_t::strong_table);
verify(ec, scan, table_t::scan_table);
verify(ec, scan_prefix, table_t::scan_prefix_table);

Expand Down Expand Up @@ -210,10 +210,10 @@ code CLASS::load_envelope() NOEXCEPT
!ins.set_buckets(envelope_.ins_buckets) ||
!outs.set_buckets(envelope_.outs_buckets) ||
!tx.set_buckets(envelope_.tx_buckets) ||
!strong_tx.set_buckets(envelope_.strong_tx_buckets) ||
!strong.set_buckets(envelope_.strong_buckets) ||
!duplicate.set_buckets(envelope_.duplicate_buckets) ||
!pool.set_buckets(envelope_.pool_buckets) ||
!wtxid.set_buckets(envelope_.pool_buckets))
!wtxid.set_buckets(envelope_.wtxid_buckets))
{
return error::verify_table;
}
Expand All @@ -223,10 +223,10 @@ code CLASS::load_envelope() NOEXCEPT
!ins.set_filter_k(envelope_.ins_k) ||
!outs.set_filter_k(envelope_.outs_k) ||
!tx.set_filter_k(envelope_.tx_k) ||
!strong_tx.set_filter_k(envelope_.strong_tx_k) ||
!strong.set_filter_k(envelope_.strong_k) ||
!duplicate.set_filter_k(envelope_.duplicate_k) ||
!pool.set_filter_k(envelope_.pool_k) ||
!wtxid.set_filter_k(envelope_.pool_k))
!wtxid.set_filter_k(envelope_.wtxid_k))
{
return error::verify_table;
}
Expand Down
8 changes: 4 additions & 4 deletions include/bitcoin/database/impl/store/store_open_load.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ code CLASS::open_load(const event_handler& handler) NOEXCEPT

open(ec, candidate_head_, table_t::candidate_head);
open(ec, confirmed_head_, table_t::confirmed_head);
open(ec, strong_tx_head_, table_t::strong_tx_head);
open(ec, strong_tx_body_, table_t::strong_tx_body);
open(ec, strong_head_, table_t::strong_head);
open(ec, strong_body_, table_t::strong_body);
open(ec, scan_head_, table_t::scan_head);
open(ec, scan_body_, table_t::scan_body);
open(ec, scan_prefix_head_, table_t::scan_prefix_head);
Expand Down Expand Up @@ -145,8 +145,8 @@ code CLASS::open_load(const event_handler& handler) NOEXCEPT

load(ec, candidate_head_, table_t::candidate_head);
load(ec, confirmed_head_, table_t::confirmed_head);
load(ec, strong_tx_head_, table_t::strong_tx_head);
load(ec, strong_tx_body_, table_t::strong_tx_body);
load(ec, strong_head_, table_t::strong_head);
load(ec, strong_body_, table_t::strong_body);
load(ec, scan_head_, table_t::scan_head);
load(ec, scan_body_, table_t::scan_body);
load(ec, scan_prefix_head_, table_t::scan_prefix_head);
Expand Down
4 changes: 2 additions & 2 deletions include/bitcoin/database/impl/store/store_reload.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ code CLASS::reload(const event_handler& handler) NOEXCEPT

reload(ec, candidate_head_, table_t::candidate_head);
reload(ec, confirmed_head_, table_t::confirmed_head);
reload(ec, strong_tx_head_, table_t::strong_tx_head);
reload(ec, strong_tx_body_, table_t::strong_tx_body);
reload(ec, strong_head_, table_t::strong_head);
reload(ec, strong_body_, table_t::strong_body);
reload(ec, scan_head_, table_t::scan_head);
reload(ec, scan_body_, table_t::scan_body);
reload(ec, scan_prefix_head_, table_t::scan_prefix_head);
Expand Down
10 changes: 5 additions & 5 deletions include/bitcoin/database/impl/store/store_report.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ void CLASS::report(const error_handler& handler) const NOEXCEPT
report(*outs_body_, table_t::outs_body);
report(tx_body_, table_t::tx_body);
report(txs_body_, table_t::txs_body);
report(strong_tx_body_, table_t::strong_tx_body);
report(strong_body_, table_t::strong_body);
report(scan_body_, table_t::scan_body);
report(scan_prefix_body_, table_t::scan_prefix_body);
report(ecdsa0_body_, table_t::ecdsa0_body);
Expand Down Expand Up @@ -93,8 +93,8 @@ code CLASS::get_fault() const NOEXCEPT
if ((ec = txs_body_.get_fault())) return ec;
if ((ec = candidate_head_.get_fault())) return ec;
if ((ec = confirmed_head_.get_fault())) return ec;
if ((ec = strong_tx_head_.get_fault())) return ec;
if ((ec = strong_tx_body_.get_fault())) return ec;
if ((ec = strong_head_.get_fault())) return ec;
if ((ec = strong_body_.get_fault())) return ec;
if ((ec = scan_head_.get_fault())) return ec;
if ((ec = scan_body_.get_fault())) return ec;
if ((ec = scan_prefix_head_.get_fault())) return ec;
Expand Down Expand Up @@ -168,8 +168,8 @@ size_t CLASS::get_space() const NOEXCEPT
space(txs_body_);
space(candidate_head_);
space(confirmed_head_);
space(strong_tx_head_);
space(strong_tx_body_);
space(strong_head_);
space(strong_body_);
space(scan_head_);
space(scan_body_);
space(scan_prefix_head_);
Expand Down
2 changes: 1 addition & 1 deletion include/bitcoin/database/impl/store/store_restore.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ code CLASS::restore(const event_handler& handler) NOEXCEPT

restore(ec, candidate, table_t::candidate_table);
restore(ec, confirmed, table_t::confirmed_table);
restore(ec, strong_tx, table_t::strong_tx_table);
restore(ec, strong, table_t::strong_table);
restore(ec, scan, table_t::scan_table);
restore(ec, scan_prefix, table_t::scan_prefix_table);

Expand Down
2 changes: 1 addition & 1 deletion include/bitcoin/database/impl/store/store_snapshot.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ code CLASS::snapshot(const event_handler& handler, bool prune) NOEXCEPT
flush(ec, tx_body_, table_t::tx_body);
flush(ec, txs_body_, table_t::txs_body);

flush(ec, strong_tx_body_, table_t::strong_tx_body);
flush(ec, strong_body_, table_t::strong_body);
flush(ec, scan_body_, table_t::scan_body);
flush(ec, scan_prefix_body_, table_t::scan_prefix_body);

Expand Down
Loading
Loading