block_queue:
- print(): added with two debug call sites in the sync-speedup rewrite
(5be43fcdb, 2017-07-02); 08abb670e (2017-08-12) removed one call and
Pruning (b750fb27b, 2018-04-29) removed the last; dead since.
- get_num_filled_spans_prefix(): added in 5be43fcdb (2017-07-02)
without any caller; dead on arrival.
- get_last_known_hash(): added in 5be43fcdb with one caller in the
protocol handler; 08abb670e (2017-08-12) removed that caller while
reworking reorg handling; dead since.
- has_spans(): added in 7b7476075 (2017-08-16, kick idle synchronizing
peers) without any caller; dead on arrival.
- get_download_rate(): added by Pruning (b750fb27b, 2018-04-29)
without any caller; dead on arrival.
- has_unpruned_height(): declaration added by Pruning (b750fb27b); a
definition never existed, so it was never callable.
cryptonote_protocol_handler:
- get_synchronizing_connections_count(): from the original 2014 import
(296ae46ed, 2014-03-03); its only reference was already commented
out in the import, and 8efa1313f (2014-03-20) deleted that comment.
Never had a live caller in the repo's history.
- PASSIVE_PEER_KICK_TIME: added in 1ff638e92 (2017-10-19) with one use
in the idle-peer kick threshold; Pruning (b750fb27b) removed the
use, orphaning the macro.
- LOCALHOST_INT: added in ae2a50659 (2015-02-20) for numeric localhost
comparisons, second use added in c511abf00; 072102cfd (2017-05-27,
abstracted network addresses) removed both uses.
330062a Optimized handle_notify_new_transactions's duplicate tx check - Check sha256 digests instead of full blobs (much less memory used) - Replace `find->insert` sequence with a single `insert` - 2x fewer hashset accesses - Preallocate the required size for the hashset (no full-table rehashes) (SChernykh)
ACKs: selsta, j-berman
- Check sha256 digests instead of full blobs (much less memory used)
- Replace `find->insert` sequence with a single `insert` - 2x fewer hashset accesses
- Preallocate the required size for the hashset (no full-table rehashes)
1. Doesn't allocate a `boost::shared_ptr`
2. Doesn't use a vtable
3. Doesn't use `std::function` wrapper
4. Doesn't necessarily copy functional object
5. Doesn't need a factory function for simple declaration (yay CTAD)
6. Isolated to its own header
7. Name doesn't suck as much
Co-authored-by: nahuhh
- jberman review
- cryptonote_protocol: don't arbitrarily download 1000 blocks ahead
- further restrict `proceed` to require `queue_proceed` in all cases.
ensure queue_proceed is true if we need the next block, even if we
already exceed the span and size limits
cryptonote_protocol: improved logging + const usage in span downloader
Without this commit:
1) read height from DB
2) add block to chain in separate thread
3) read chain for block id's and request them from peer
4) ERR in handle_response_chain_entry, peer's first block is the
one that was added to the chain, which has block idx=height from
step 1.
This commit reads the chain for height and highest block id's
in one go while holding the m_blockchain_lock to avoid the race.
Changes complexity from M*N to (2*N+M)*log2(M). The FCMP++ stressnet recently hit mempool sizes of ~55k txs.
If the requesting node's mempool is populated, this results in an average of (55000*55000)/2
(about 1.5 billion) comparisons for the responding node. Under this commit, this would be reduced to
(55000+55000)*log2(55000) comparisons (about 2.6 million), a 99.83% reduction.
a. `critical_section` is functionally identical to a `boost::recursive_mutex`
b. `critical_region_t` is functionally identical to a `boost::unique_lock`
c. remove some vestigial definitons `g_test_dbg_lock_sleep` as a variable
1. Use `std::is_standard_layout` and `std::is_trivially_copyable` instead of `std::is_pod` for KV byte-wise serialization, which fixes compile issue for Boost UUIDs
2. Use `std::has_unique_object_representations` instead of `alignof(T) == 1` for epee byte spans and epee hex functions
3. Removed reimplementation of `std::hash` for `boost::uuids::uuid
4. Removed `<<` operator overload for `crypto::secret_key`
5. Removed instances in code where private view key was dumped to the log in plaintext