diff --git a/.gitignore b/.gitignore index 179deaff..16a87cb7 100644 --- a/.gitignore +++ b/.gitignore @@ -17,6 +17,7 @@ # gnu .deps +.dirstamp Makefile Makefile.in .libs @@ -28,7 +29,10 @@ builds/gnu/build-aux builds/gnu/config.* builds/gnu/configure builds/gnu/libtool -builds/gnu/.dirstamp +builds/gnu/console +builds/gnu/test +builds/gnu/*.log +builds/gnu/*.trs # pkg-config pc file from .pc.in builds/gnu/*.pc diff --git a/include/bitcoin/node/chasers/chaser_transaction.hpp b/include/bitcoin/node/chasers/chaser_transaction.hpp index a5918cd0..ab03ecd9 100644 --- a/include/bitcoin/node/chasers/chaser_transaction.hpp +++ b/include/bitcoin/node/chasers/chaser_transaction.hpp @@ -137,6 +137,9 @@ class BCN_API chaser_transaction /// archived before latch is organized. virtual void do_bump() NOEXCEPT; + /// Bump, then reorganize blocks popped since pool top, top that of store. + virtual void do_start() NOEXCEPT; + /// Retain the pool subscription. virtual void do_subscribe_pool(const pool_notifier& handler) NOEXCEPT; @@ -266,6 +269,12 @@ class BCN_API chaser_transaction /// A validation under the context holds at a later block. bool reusable(const system::chain::context& ctx) const NOEXCEPT; + /// Set pooled spenders of block's txs not validated, parent pool top. + bool unvalidate(header_t link) NOEXCEPT; + + /// Pool block's unpooled txs under its context, false if faulted. + bool repool(header_t link) NOEXCEPT; + /// A validation under the context holds under the pool context. bool is_sufficient(const system::chain::context& ctx) const NOEXCEPT; diff --git a/include/bitcoin/node/protocols/protocol_transaction_in_106.hpp b/include/bitcoin/node/protocols/protocol_transaction_in_106.hpp index 4e4145e3..e8ae9227 100644 --- a/include/bitcoin/node/protocols/protocol_transaction_in_106.hpp +++ b/include/bitcoin/node/protocols/protocol_transaction_in_106.hpp @@ -39,7 +39,11 @@ class BCN_API protocol_transaction_in_106 : node::protocol_peer(session, channel), network::tracker(session->log), tx_type_(session->node_settings().require_witness ? - type_id::witness_tx : type_id::transaction) + type_id::witness_tx : type_id::transaction), + maximum_requests_(system::possible_wide_cast( + session->node_settings().pool.maximum_requests)), + request_timer_(system::emplace_shared(session->log, + channel->strand(), session->node_settings().pool.request_timeout())) { } @@ -96,8 +100,17 @@ class BCN_API protocol_transaction_in_106 { size_t set{}; size_t slot{}; + size_t id{}; }; + /// Requested tx, in order of request. + struct pending + { + system::hash_digest hash{}; + size_t id{}; + }; + + using duration = network::deadline::duration; using requests = std::unordered_map; network::messages::peer::get_data create_get_data( @@ -109,13 +122,24 @@ class BCN_API protocol_transaction_in_106 /// Submit the first set as it stands. void flush() NOEXCEPT; - // This is thread safe. + /// Drop answered requests from order, timing oldest from when it is so. + void settle() NOEXCEPT; + bool is_answered(const pending& entry) const NOEXCEPT; + void start_request_timer(const duration& span) NOEXCEPT; + void handle_request_timer(const code& ec) NOEXCEPT; + + // These are thread safe. const type_id tx_type_; + const size_t maximum_requests_; // These are protected by strand. requests requested_{}; std::deque sets_{}; + std::deque order_{}; + network::steady_clock::time_point oldest_{}; size_t first_{}; + size_t next_{}; + network::deadline::ptr request_timer_; }; } // namespace node diff --git a/include/bitcoin/node/settings.hpp b/include/bitcoin/node/settings.hpp index 3561a1a9..54d25a61 100644 --- a/include/bitcoin/node/settings.hpp +++ b/include/bitcoin/node/settings.hpp @@ -49,12 +49,15 @@ class BCN_API settings uint32_t maximum_chunk_depth; uint16_t estimate_cache_seconds; uint32_t estimate_room; + uint32_t maximum_requests; + uint16_t request_timeout_seconds; bool thread_priority; /// Helpers. virtual uint64_t minimum_fee_rate_() const NOEXCEPT; virtual uint64_t cutoff_rate_() const NOEXCEPT; virtual network::steady_clock::duration estimate_cache() const NOEXCEPT; + virtual network::steady_clock::duration request_timeout() const NOEXCEPT; virtual network::processing_priority thread_priority_() const NOEXCEPT; }; diff --git a/src/chasers/chaser_transaction.cpp b/src/chasers/chaser_transaction.cpp index f2ea761c..e09c6753 100644 --- a/src/chasers/chaser_transaction.cpp +++ b/src/chasers/chaser_transaction.cpp @@ -55,10 +55,45 @@ chaser_transaction::chaser_transaction(full_node& node) NOEXCEPT code chaser_transaction::start() NOEXCEPT { SUBSCRIBE_CHASE(handle_chase, _1, _2); - POST(do_bump); + POST(do_start); return error::success; } +// Index is rebuilt at open, so only blocks popped since pool top reorganize. +void chaser_transaction::do_start() NOEXCEPT +{ + BC_ASSERT(stranded()); + do_bump(); + if (closed() || !is_indexing()) + return; + + auto& query = archive(); + auto link = query.get_pool_top(); + while (!link.is_terminal() && !query.is_confirmed_block(link)) + { + if (!unvalidate(link)) + { + fault(error::transaction10); + return; + } + + if (pooling_ && !repool(link)) + return; + + link = query.to_parent(link); + } + + const auto top = query.to_top_confirmed(); + if (query.get_pool_top() != top && !query.set_pool_top(top)) + { + fault(error::transaction10); + return; + } + + if (!sweep()) + fault(error::transaction11); +} + void chaser_transaction::stopping(const code& ec) NOEXCEPT { stopping_.store(true); @@ -457,8 +492,6 @@ void chaser_transaction::do_block(header_t link) NOEXCEPT notify(error::success, chases::block_settled{ link }); } -// Pooled in block order under block context, -// excluding any confirmed (by another block). void chaser_transaction::do_reorganized(header_t link) NOEXCEPT { BC_ASSERT(stranded()); @@ -468,10 +501,9 @@ void chaser_transaction::do_reorganized(header_t link) NOEXCEPT auto& query = archive(); if (is_indexing()) { - size_t count{}; const auto start = now(); const auto applied = query.set_pool_block(link, false) && - query.set_pool_unvalidated(count, link); + unvalidate(link); report(pool_scan::block_out, start); if (!applied) @@ -479,26 +511,43 @@ void chaser_transaction::do_reorganized(header_t link) NOEXCEPT fault(error::transaction10); return; } - - unvalidated_ = unvalidated_ || is_nonzero(count); - due_ = due_ || is_nonzero(count); } top_ = query.to_parent(link); do_bump(); - if (!pooling_) - return; + if (pooling_ && repool(link) && !sweep()) + fault(error::transaction11); +} + +// Block's parent becomes pool top with spenders set. +bool chaser_transaction::unvalidate(header_t link) NOEXCEPT +{ + BC_ASSERT(stranded()); + size_t count{}; + if (!archive().set_pool_unvalidated(count, link)) + return false; + + unvalidated_ = unvalidated_ || is_nonzero(count); + due_ = due_ || is_nonzero(count); + return true; +} +// Pooled in block order under block context, +// excluding any confirmed (by another block). +bool chaser_transaction::repool(header_t link) NOEXCEPT +{ + BC_ASSERT(stranded()); + auto& query = archive(); chain::context ctx{}; const auto txs = query.to_transactions(link); if (txs.empty() || !query.get_context(ctx, link)) { fault(error::transaction7); - return; + return false; } if (!reusable(ctx)) - return; + return true; // The coinbase is never pooled. for (auto it = std::next(txs.cbegin()); it != txs.cend(); ++it) @@ -511,22 +560,21 @@ void chaser_transaction::do_reorganized(header_t link) NOEXCEPT if (!tx || !query.populate_with_metadata(*tx)) { fault(error::transaction7); - return; + return false; } // Block txs are already silent indexed. if (!set_pooled(fk, *tx, ctx)) { fault(error::transaction2); - return; + return false; } notify(error::success, chases::transaction{ fk }); broadcast(*tx); } - if (!sweep()) - fault(error::transaction11); + return true; } // Rows confirmed by the pruned block are not retained by the prune. diff --git a/src/protocols/protocol_transaction_in_106.cpp b/src/protocols/protocol_transaction_in_106.cpp index 66f8df68..5aeee84b 100644 --- a/src/protocols/protocol_transaction_in_106.cpp +++ b/src/protocols/protocol_transaction_in_106.cpp @@ -58,6 +58,7 @@ void protocol_transaction_in_106::stopping(const code& ec) NOEXCEPT if (!requested_.empty()) fire(events::tx_unserved, requested_.size()); + request_timer_->stop(); protocol_peer::stopping(ec); } @@ -113,10 +114,25 @@ bool protocol_transaction_in_106::handle_receive_inventory(const code& ec, if (silenced()) return true; + const auto idle = order_.empty(); const auto getter = create_get_data(*message); if (getter.items.empty()) return true; + if (requested_.size() > maximum_requests_) + { + LOGR("Excess tx requests (" << requested_.size() << ") of [" + << opposite() << "]."); + stop(error::stalled_channel); + return false; + } + + if (idle) + { + oldest_ = network::steady_clock::now(); + start_request_timer(request_timer_->timeout()); + } + LOGP("Requested (" << getter.items.size() << ") txs from [" << opposite() << "]."); @@ -143,7 +159,7 @@ get_data protocol_transaction_in_106::create_get_data( set_announced(item.hash); // Known tx is held by peer (pooled marked once), tx requested once. - const request slot{ sequence, set.hashes.size() }; + const request slot{ sequence, set.hashes.size(), next_ }; if (const auto link = to_known(item.hash); !link.is_terminal()) { if (!repeated && archive().is_pooled(link)) @@ -155,6 +171,7 @@ get_data protocol_transaction_in_106::create_get_data( if (!requested_.emplace(item.hash, slot).second) continue; + order_.push_back({ item.hash, next_++ }); getter.items.emplace_back(get_data_type(), item.hash); set.hashes.push_back(item.hash); } @@ -173,6 +190,73 @@ get_data protocol_transaction_in_106::create_get_data( return getter; } +// request timeout +// ---------------------------------------------------------------------------- + +// private +bool protocol_transaction_in_106::is_answered( + const pending& entry) const NOEXCEPT +{ + const auto it = requested_.find(entry.hash); + return it == requested_.end() || it->second.id != entry.id; +} + +// private +void protocol_transaction_in_106::settle() NOEXCEPT +{ + BC_ASSERT(stranded()); + + const auto size = order_.size(); + while (!order_.empty() && is_answered(order_.front())) + order_.pop_front(); + + if (order_.size() != size) + oldest_ = network::steady_clock::now(); +} + +// private +void protocol_transaction_in_106::start_request_timer( + const duration& span) NOEXCEPT +{ + BC_ASSERT(stranded()); + + if (is_nonzero(request_timer_->timeout().count())) + request_timer_->start(BIND(handle_request_timer, _1), span); +} + +// private +// Timer is not reset by an answer, so expiry is tested against oldest. +void protocol_transaction_in_106::handle_request_timer( + const code& ec) NOEXCEPT +{ + BC_ASSERT(stranded()); + + if (stopped() || ec == network::error::operation_canceled || + ec == network::error::service_stopped) + return; + + if (ec) + { + LOGF("Tx request timer failure, " << ec.message()); + stop(ec); + return; + } + + if (order_.empty()) + return; + + const auto timeout = request_timer_->timeout(); + const auto elapsed = network::steady_clock::now() - oldest_; + if (elapsed < timeout) + { + start_request_timer(timeout - elapsed); + return; + } + + LOGR("Tx request timeout of [" << opposite() << "]."); + stop(error::stalled_channel); +} + // accept transaction // ---------------------------------------------------------------------------- @@ -232,6 +316,7 @@ bool protocol_transaction_in_106::set_not_found( const auto at = it->second; requested_.erase(it); + settle(); if (at.set == late) return true; @@ -264,6 +349,7 @@ bool protocol_transaction_in_106::handle_receive_transaction(const code& ec, const auto at = it->second; requested_.erase(it); + settle(); if (at.set == late) { submit_announced(to_shared(chain::transaction_cptrs{ tx }), diff --git a/src/settings.cpp b/src/settings.cpp index 6f141602..76baef07 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -37,6 +37,8 @@ settings::transaction_pool::transaction_pool() NOEXCEPT maximum_chunk_depth{ 25 }, estimate_cache_seconds{ 7 }, estimate_room{ 1'000 }, + maximum_requests{ 500'000 }, + request_timeout_seconds{ 60 }, thread_priority{ true } { } @@ -62,6 +64,12 @@ settings::transaction_pool::estimate_cache() const NOEXCEPT return network::seconds(estimate_cache_seconds); } +network::steady_clock::duration +settings::transaction_pool::request_timeout() const NOEXCEPT +{ + return network::seconds(request_timeout_seconds); +} + network::processing_priority settings::transaction_pool::thread_priority_() const NOEXCEPT { diff --git a/test/chasers/chaser_transaction.cpp b/test/chasers/chaser_transaction.cpp index 4cca8500..9addafaa 100644 --- a/test/chasers/chaser_transaction.cpp +++ b/test/chasers/chaser_transaction.cpp @@ -211,6 +211,53 @@ BC_FIXTURE_TEST_CASE(chaser_transaction__organized__relay_off__pool_rows_not_fir BC_REQUIRE(rows.empty()); } +// do_start + +BC_FIXTURE_TEST_CASE(chaser_transaction__start__pool_top_terminal__store_top, chaser_transaction_single_setup_fixture) +{ + BC_REQUIRE(topped(query_.to_top_confirmed())); +} + +BC_FIXTURE_TEST_CASE(chaser_transaction__start__pool_top_popped__block_tx_pooled, chaser_transaction_unapplied_setup_fixture) +{ + const auto& txs = *reorganized_block().transactions_ptr(); + BC_REQUIRE(pooled(query_.to_tx(txs.at(1)->hash(false)))); + BC_REQUIRE(topped(query_.to_top_confirmed())); + BC_REQUIRE(!query_.is_pooled(query_.to_tx(txs.front()->hash(false)))); +} + +BC_FIXTURE_TEST_CASE(chaser_transaction__start__pool_top_popped__relative_spender_not_validated, chaser_transaction_unapplied_relative_setup_fixture) +{ + const auto& txs = *reorganized_block().transactions_ptr(); + BC_REQUIRE(pooled(query_.to_tx(txs.at(1)->hash(false)))); + BC_REQUIRE(topped(query_.to_top_confirmed())); + + database::table::pool_scalar height{}; + BC_REQUIRE(store_.pool.heights.get(store_.pool.first(query_.to_tx(unapplied_spender()->hash(false))), height)); + BC_REQUIRE_EQUAL(height.value, max_uint32); +} + +BC_FIXTURE_TEST_CASE(chaser_transaction__organized__block__pool_top, chaser_transaction_single_setup_fixture) +{ + const auto block = confirm(); + BC_REQUIRE(!block.is_terminal()); + BC_REQUIRE(topped(block)); +} + +BC_FIXTURE_TEST_CASE(chaser_transaction__reorganized__block__pool_top_parent, chaser_transaction_single_setup_fixture) +{ + const auto block = confirm(); + const auto applied = topped(block); + const auto parent = query_.to_parent(block); + const auto popped = query_.pop_confirmed(); + node_.notify(node::error::success, chases::reorganized{ block }); + + BC_REQUIRE(!block.is_terminal()); + BC_REQUIRE(applied); + BC_REQUIRE(popped); + BC_REQUIRE(topped(parent)); +} + // do_reorganized BC_FIXTURE_TEST_CASE(chaser_transaction__reorganized__pooled_block_tx__present, chaser_transaction_single_setup_fixture) @@ -355,9 +402,9 @@ BC_FIXTURE_TEST_CASE(chaser_transaction__reorganized__parent_submitted__spender_ BC_REQUIRE(popped); BC_REQUIRE_EQUAL(out.size(), 3u); BC_REQUIRE_EQUAL(again.size(), 4u); - BC_REQUIRE(again.at(0).scan == node::pool_scan::coverage); - BC_REQUIRE(again.at(1).scan == node::pool_scan::admission); - BC_REQUIRE(again.at(2).scan == node::pool_scan::context); + BC_REQUIRE(again.at(0).scan == node::pool_scan::coverage || again.at(0).scan == node::pool_scan::context); + BC_REQUIRE(again.at(1).scan == node::pool_scan::admission || again.at(1).scan == node::pool_scan::coverage); + BC_REQUIRE(again.at(2).scan == node::pool_scan::context || again.at(2).scan == node::pool_scan::admission); BC_REQUIRE(again.at(3).scan == node::pool_scan::context); BC_REQUIRE(restored); } diff --git a/test/chasers/chaser_transaction_setup_fixture.hpp b/test/chasers/chaser_transaction_setup_fixture.hpp index f7e694ef..56f1528c 100644 --- a/test/chasers/chaser_transaction_setup_fixture.hpp +++ b/test/chasers/chaser_transaction_setup_fixture.hpp @@ -237,6 +237,45 @@ inline bool stored_reorganized(node::query& query) NOEXCEPT query.pop_confirmed(); } +// As stored_reorganized, block 1 the pool top when popped. +inline bool stored_unapplied(node::query& query) NOEXCEPT +{ + const auto& block = reorganized_block(); + if (!query.set(parent()) || + !query.set(block, database::context{ deployed, 1, 0 }, {}, false, true)) + return false; + + query.set_pooling(); + const auto link = query.to_header(block.hash()); + return query.push_confirmed(link, true) && query.set_pool_top(link) && + query.pop_confirmed(); +} + +// A relative spender of the tx of the reorganized block. +inline chain::transaction::cptr unapplied_spender() NOEXCEPT +{ + const auto& txs = *reorganized_block().transactions_ptr(); + return spend_relative(txs.at(1)->hash(false), parent_value - 1'000, 2); +} + +// As stored_unapplied, the relative spender pooled before the pop. +inline bool stored_unapplied_relative(node::query& query) NOEXCEPT +{ + database::tx_link link{}; + const auto& block = reorganized_block(); + const database::context context{ deployed, 1, 0 }; + if (!query.set(parent()) || + !query.set(block, context, {}, false, true) || + query.set_code(link, *unapplied_spender())) + return false; + + query.set_pooling(); + const auto top = query.to_header(block.hash()); + return query.push_confirmed(top, true) && + query.set_pooled(link, *unapplied_spender(), context, 0) && + query.set_pool_top(top) && query.pop_confirmed(); +} + BC_PUSH_WARNING(NO_THROW_IN_NOEXCEPT) // A session to observe wire broadcasts. @@ -596,6 +635,22 @@ struct chaser_transaction_setup_fixture return false; } + // True once the pool top is the block. + bool topped(const database::header_link& link) + { + using namespace std::chrono; + const auto deadline = steady_clock::now() + seconds(10); + while (steady_clock::now() < deadline) + { + if (query_.get_pool_top() == link) + return true; + + std::this_thread::sleep_for(milliseconds(10)); + } + + return false; + } + // The first count of pool scans reported from the act, empty if fewer. using pool_events = std::vector; pool_events reported(size_t count, const std::function& act) @@ -826,6 +881,35 @@ struct chaser_transaction_pooling_setup_fixture } }; +struct chaser_transaction_requests_setup_fixture + : chaser_transaction_setup_fixture +{ + inline chaser_transaction_requests_setup_fixture() + : chaser_transaction_setup_fixture([](configuration& config) + { + config.network.enable_relay = true; + config.node.currency_window_minutes = 0; + config.node.pool.maximum_requests = 2; + config.node.pool.request_timeout_seconds = 0; + }) + { + } +}; + +struct chaser_transaction_request_timeout_setup_fixture + : chaser_transaction_setup_fixture +{ + inline chaser_transaction_request_timeout_setup_fixture() + : chaser_transaction_setup_fixture([](configuration& config) + { + config.network.enable_relay = true; + config.node.currency_window_minutes = 0; + config.node.pool.request_timeout_seconds = 1; + }) + { + } +}; + struct chaser_transaction_reserves_setup_fixture : chaser_transaction_setup_fixture { @@ -1048,6 +1132,32 @@ struct chaser_transaction_closed_header_setup_fixture } }; +struct chaser_transaction_unapplied_setup_fixture + : chaser_transaction_setup_fixture +{ + inline chaser_transaction_unapplied_setup_fixture() + : chaser_transaction_setup_fixture([](configuration& config) + { + config.network.enable_relay = true; + config.node.currency_window_minutes = 0; + }, stored_unapplied) + { + } +}; + +struct chaser_transaction_unapplied_relative_setup_fixture + : chaser_transaction_setup_fixture +{ + inline chaser_transaction_unapplied_relative_setup_fixture() + : chaser_transaction_setup_fixture([](configuration& config) + { + config.network.enable_relay = true; + config.node.currency_window_minutes = 0; + }, stored_unapplied_relative) + { + } +}; + struct chaser_transaction_relay_off_setup_fixture : chaser_transaction_setup_fixture { diff --git a/test/protocols/protocol_transaction.cpp b/test/protocols/protocol_transaction.cpp index cf1dfa38..c7000097 100644 --- a/test/protocols/protocol_transaction.cpp +++ b/test/protocols/protocol_transaction.cpp @@ -177,6 +177,69 @@ BC_FIXTURE_TEST_CASE(protocol_transaction_in__inventory__over_maximum_inventory_ BC_REQUIRE(received_before_pong(peer::pong::command)); } +BC_FIXTURE_TEST_CASE(protocol_transaction_in__inventory__maximum_requests__get_data, chaser_transaction_requests_setup_fixture) +{ + BC_REQUIRE(handshake(0, peer::level::maximum_protocol, true)); + + send(announcement(2, 1), node_version->value); + BC_REQUIRE(!receive(peer::get_data::command).empty()); +} + +BC_FIXTURE_TEST_CASE(protocol_transaction_in__inventory__over_maximum_requests__stopped, chaser_transaction_requests_setup_fixture) +{ + BC_REQUIRE(handshake(0, peer::level::maximum_protocol, true)); + + send(announcement(3, 1), node_version->value); + BC_REQUIRE(dropped(peer::get_data::command)); +} + +BC_FIXTURE_TEST_CASE(protocol_transaction_in__inventory__over_maximum_requests_unanswered__stopped, chaser_transaction_requests_setup_fixture) +{ + BC_REQUIRE(handshake(0, peer::level::maximum_protocol, true)); + + send(announcement(2, 1), node_version->value); + BC_REQUIRE(!receive(peer::get_data::command).empty()); + + send(announcement(1, 2), node_version->value); + BC_REQUIRE(dropped(peer::get_data::command)); +} + +BC_FIXTURE_TEST_CASE(protocol_transaction_in__inventory__maximum_requests_answered__get_data, chaser_transaction_requests_setup_fixture) +{ + BC_REQUIRE(handshake(0, peer::level::maximum_protocol, true)); + + send(announcement(2, 1), node_version->value); + BC_REQUIRE(!receive(peer::get_data::command).empty()); + + send(peer::not_found{ announcement(2, 1).items }, node_version->value); + send(announcement(2, 2), node_version->value); + BC_REQUIRE(!receive(peer::get_data::command).empty()); +} + +BC_FIXTURE_TEST_CASE(protocol_transaction_in__request__unanswered__stopped, chaser_transaction_request_timeout_setup_fixture) +{ + BC_REQUIRE(handshake(0, peer::level::maximum_protocol, true)); + + send(peer::inventory{ { { type_id::transaction, one_hash } } }, node_version->value); + BC_REQUIRE(!receive(peer::get_data::command).empty()); + BC_REQUIRE(dropped(peer::not_found::command)); +} + +BC_FIXTURE_TEST_CASE(protocol_transaction_in__request__later_answered_oldest_unanswered__stopped, chaser_transaction_request_timeout_setup_fixture) +{ + BC_REQUIRE(handshake(0, peer::level::maximum_protocol, true)); + + const auto tx = spend(parent_value); + send(peer::inventory{ { { type_id::transaction, one_hash } } }, node_version->value); + BC_REQUIRE(!receive(peer::get_data::command).empty()); + + send(peer::inventory{ { { type_id::transaction, tx->hash(false) } } }, node_version->value); + BC_REQUIRE(!receive(peer::get_data::command).empty()); + + send(peer::transaction{ tx }, node_version->value); + BC_REQUIRE(dropped(peer::not_found::command)); +} + BC_FIXTURE_TEST_CASE(protocol_transaction_in__not_found__block_only__not_stopped, chaser_transaction_pooling_setup_fixture) { BC_REQUIRE(handshake(0, peer::level::maximum_protocol, true)); diff --git a/test/settings.cpp b/test/settings.cpp index 5768f6e4..8fe55d55 100644 --- a/test/settings.cpp +++ b/test/settings.cpp @@ -220,6 +220,9 @@ BC_AUTO_TEST_CASE(settings__pool__default__expected) BC_REQUIRE_EQUAL(pool.estimate_cache_seconds, 7_u16); BC_REQUIRE_EQUAL(pool.estimate_room, 1'000_u32); BC_REQUIRE(pool.estimate_cache() == steady_clock::duration(seconds(7))); + BC_REQUIRE_EQUAL(pool.maximum_requests, 500'000_u32); + BC_REQUIRE_EQUAL(pool.request_timeout_seconds, 60_u16); + BC_REQUIRE(pool.request_timeout() == steady_clock::duration(seconds(60))); BC_REQUIRE(pool.thread_priority); BC_REQUIRE(pool.thread_priority_() == network::processing_priority::high); }