Commit Graph
448 Commits
Author SHA1 Message Date
tobtoht 68e3b19661 Merge pull request #10933
c2dc8a5 cryptonote_protocol: remove dead code (Thomas)

ACKs: selsta, jpk68
2026-07-26 20:34:41 +00:00
Thomas c2dc8a5bc6 cryptonote_protocol: remove dead code
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.
2026-07-20 12:59:04 +02:00
jeffro256 edea8505db general: replace auto_scope_leave_caller with scope_guard
And replace unused inclusions of misc_language.h
2026-07-15 19:54:58 -05:00
tobtoht 381fce8dde Merge pull request #10828
fecef76 Fix spelling typos in comments and string literals (Thomas)

ACKs: tobtoht, selsta
2026-07-02 13:18:56 +00:00
tobtoht d6a90937c8 Merge pull request #10835
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
2026-06-30 09:59:55 +00:00
tobtoht 6f09e39866 Merge pull request #10597
d8f3b81 p2p: restore safe sync mode when target height drops (selsta)

ACKs: SChernykh, j-berman
2026-06-30 09:54:19 +00:00
SChernykh 330062a004 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)
2026-06-29 08:06:31 +02:00
Thomas fecef767c9 Fix spelling typos in comments and string literals 2026-06-27 09:53:48 +02:00
selsta d8f3b81f79 p2p: restore safe sync mode when target height drops 2026-06-24 21:58:51 +02:00
Thomas 02db831d01 Fix spelling typos 2026-06-18 09:30:42 +02:00
SChernykh 196078ea0c Refactored tx verification NIC logic
Encapsulated `nic_verified_hf_version` and `txs_by_txid` to make it impossible for callers to skip updating it.
2026-06-04 09:55:38 +02:00
tobtoht 272a8d71fe Merge pull request #10600
6fc7aa8 cryptonote_protocol: fix peer overview logging (selsta)
2026-05-20 15:50:24 +00:00
tobtoht 892a136faf Merge pull request #10599
f4795a0 Remove obsolete test-drop-download debug options (selsta)
2026-05-20 15:49:47 +00:00
selsta 6fc7aa8398 cryptonote_protocol: fix peer overview logging 2026-05-14 18:09:48 +02:00
selsta f4795a0001 Remove obsolete test-drop-download debug options
These options were introduced in 2015 as manual debug helpers for
network-limit testing. They are not used by the current test suite.
2026-05-14 17:56:54 +02:00
Thomas 2c327aa325 fix spelling in comments and docs 2026-05-13 21:20:05 +02:00
tobtoht fb5b06bd3b Merge pull request #10520
a5ab8e5 net: replace deprecated boost::asio::strand::wrap with bind_executor (ryurt46)
2026-05-13 11:08:59 +00:00
tobtoht 49ea802139 Merge pull request #9899
05ab316 epee: better scope leaver (jeffro256)
2026-05-06 19:34:39 +00:00
jeffro256 05ab316853 epee: better scope leaver
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
2026-05-06 11:59:00 -05:00
ryurt46 a5ab8e5709 net: replace deprecated boost::asio::strand::wrap with bind_executor 2026-05-04 19:10:06 +02:00
selsta 13b42258b2 p2p: check p2p state before parsing in handle_notify_new_transactions 2026-04-28 18:21:51 +02:00
tobtoht d4732d6fdb Merge pull request #10440
b4ba1ec cryptonote_protocol: cleanup_handle_incoming_blocks on scope exit (j-berman)
2026-04-22 18:07:38 +00:00
tobtoht 519b26375c Merge pull request #10438
94089a8 cryptonote_basic: pruned hash return bool (j-berman)
2026-04-22 18:05:34 +00:00
j-berman b4ba1ec69c cryptonote_protocol: cleanup_handle_incoming_blocks on scope exit 2026-04-21 12:07:59 -07:00
j-berman 94089a8788 cryptonote_basic: pruned hash return bool 2026-04-21 12:04:31 -07:00
j-berman 0150d45e39 connection: try-catch handles 2026-04-21 12:00:56 -07:00
tobtoht 50da8bf8a5 Merge pull request #10186
0673c95 tx_memory_pool: speedup get_complement() for large requests (jeffro256)
2026-03-28 19:45:05 +00:00
tobtoht 55abb977b2 Merge pull request #10312
c93c4fc Misc clang 21 fixes (jeffro256)
2026-02-18 22:18:09 +00:00
jeffro256 c93c4fc829 Misc clang 21 fixes
* Use -O3 and other flags instead of -Ofast
  - https://discourse.llvm.org/t/rfc-deprecate-ofast/78687
  - https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html
* Find libunwind library based on C++ compiler type, not C compiler type
* In stack_trace.cpp, pass stream modifiers to `std::stringstream` first, then send string to log
* In stack_trace.cpp, remove dead code related to `stack_trace_log` path
* Remove `virtual` method attributues from `final` class `cryptonote::core`
* Remove unused `this` capture in cryptonote protocol handler
* Remove unused variable `bad` in net node
* Use `std::make_unsigned` instead of `boost::make_unsigned`
  - https://github.com/boostorg/type_traits/issues/171
  - https://github.com/boostorg/type_traits/issues/202
  - https://github.com/boostorg/type_traits/pull/199
* Cleanup `include`s in pair serialization
* Test convergence b/t `std::make_unsigned` and `boost::make_unsigned`

Fixes compilation and silences warnings on:
clang version 21.1.6
Linux 6.18.8-3-cachyos
2026-02-09 09:42:32 -07:00
Navid Rahimiandnahuhh 508b6ee8fb src: dynamic span, to calculate span limit dynamically
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
2026-02-04 08:54:23 +00:00
tobtoht 20ef991839 Merge pull request #9494
2a1a489 src: dynamic block sync size Co-authored-by: nahuhh (0xFFFC0000)
2026-02-03 21:25:04 +00:00
j-berman d7c5f95704 p2p: fix race causing dropped connections during sync
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.
2025-12-11 21:36:42 -08:00
jeffro256 0673c957af tx_memory_pool: speedup get_complement() for large requests
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.
2025-11-26 13:40:33 -06:00
tobtoht cdaca019fc Merge pull request #10201
52b4c73 cryptonote_protocol: accurate next_needed_height when there is an overlap (0xFFFC0000)
2025-11-11 22:41:41 +00:00
j-berman c01e1fa288 Fix logging deadlock 2025-11-11 10:43:39 -08:00
0xFFFC0000 52b4c73ab4 cryptonote_protocol: accurate next_needed_height when there is an overlap 2025-11-11 00:29:23 +03:30
tobtoht c7046302d4 cmake: don't redefine project 2025-06-24 08:01:37 +02:00
0xFFFC0000andnahuhh 2a1a4897cb src: dynamic block sync size
Co-authored-by: nahuhh
2025-05-13 13:51:42 +00:00
0xFFFC0000 d106e21b74 src: fix clangd warnings 2025-05-01 05:27:35 +00:00
jeffro256 8af33c71cf epee: syncobj: replace shims with Boost classes
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
2025-04-01 11:09:26 -05:00
jeffro256 528664b1c8 cryptonote_protocol: fix handling of pruned blocks during sync 2025-03-17 09:09:25 -05:00
tobtoht 44523cafff Merge pull request #9135
c069c04ed blockchain sync: reduce disk writes from 2 to 1 per tx (jeffro256)
2025-03-10 16:16:18 +00:00
jeffro256 c069c04ede blockchain sync: reduce disk writes from 2 to 1 per tx 2025-03-10 01:02:37 -05:00
tobtoht e87c16dd3e Merge pull request #9582
16b5c11f7 Some cleanup in span/connection_context + few more checks (Lee *!* Clagett)
2025-02-13 17:36:19 +00:00
Lee *!* Clagett 4344f97255 Fix build with boost ASIO 1.87. Support boost 1.66+ 2025-01-06 18:05:25 -05:00
Lee *!* Clagett 16b5c11f74 Some cleanup in span/connection_context + few more checks 2024-11-19 18:30:34 -05:00
jeffro256 ed955bf751 build: fix build with Boost 1.85 and remove instances of viewkey logging
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
2024-09-06 11:46:22 -05:00
luigi1111 66c5917876 Merge pull request #9353
32f3245 cryptonote_protocol: prevent duplicate txs in fluff queue (0xFFFC0000)
2024-07-16 18:51:30 -04:00
0xFFFC0000andBoog900 32f32453f1 cryptonote_protocol: prevent duplicate txs in fluff queue
1. Fix duplicate transaction #9335
2. Add test for cases where there are duplicate transaction in fluff

Co-authored-by: Boog900 <boog900@tutanota.com>
2024-06-05 16:33:15 +00:00
copyCat 341771ac3e copyright: bump to 2024 2024-05-21 16:29:33 +00:00