Commit Graph
350 Commits
Author SHA1 Message Date
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 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
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
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
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
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
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
j-berman c01e1fa288 Fix logging deadlock 2025-11-11 10:43:39 -08: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 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
Lee *!* Clagett 16b5c11f74 Some cleanup in span/connection_context + few more checks 2024-11-19 18:30:34 -05:00
copyCat 341771ac3e copyright: bump to 2024 2024-05-21 16:29:33 +00:00
jeffro256 192d87cd24 remove more 'using namespace' statements from headers 2023-07-18 22:46:43 -05:00
luigi1111 0fbe21e9e9 Merge pull request #8862
9f80797 protocol: drop peers sending duplicate txes (moneromooo-monero)
2023-06-27 11:44:58 -05:00
luigi1111 57c58fd5bd Merge pull request #8703
c90c1c3 Show IPv6 addresses in connection list (Guillaume Le Vaillant)
2023-06-27 11:28:24 -05:00
moneromooo-monero 9f80797086 protocol: drop peers sending duplicate txes 2023-06-07 06:56:21 +00:00
luigi1111 9bf06ea75d Merge pull request #8698
5b4fea7 Copyright: Update to 2023 (mj-xmr)
2023-04-25 11:12:56 -04:00
Guillaume Le Vaillant c90c1c3fe1 Show IPv6 addresses in connection list 2023-04-14 13:34:30 +02:00
jeffro256andSChernykh caa7561705 cryptonote core/protocol: don't drop peers for soft offenses
Also: txs with tx_extra which is too large will not get published to ZMQ

Co-authored-by: SChernykh <sergey.v.chernykh@gmail.com>
2023-03-29 02:05:43 -05:00
mj-xmrandmj-xmr 5b4fea72cf Copyright: Update to 2023
Co-authored-by: plowsof <plowsof@protonmail.com>
extra files
2023-01-16 13:00:18 +01:00
SChernykh 8e7c7af05f Move update_checkpoints() to a later stage
update_checkpoints() makes a few DNS requests and can take up to 20-30 seconds to complete (3-6 seconds on average). It is currently called from core::handle_incoming_block() which holds m_incoming_tx_lock, so it blocks all incoming transactions and blocks processing while update_checkpoints() is running. This PR moves it to until after a new block has been processed and relayed, to avoid full monerod locking.
2022-09-22 13:04:50 +02:00
j-berman 2dab31f62f Don't exclusively drop tor/i2p outgoing cxns in idle loop 2022-05-18 09:54:21 -07:00
luigi1111 bb093ec9a8 Merge pull request #8223
17772ef Eliminate dependence on boost::interprocess #8223 (Jeffrey)
2022-04-06 00:19:59 -04:00
Jeffrey 17772ef53e Eliminate dependence on boost::interprocess #8223
In this repo, `boost::interprocess` was being used soley to make `uint32_t` operations atomic. So I replaced each instance of
`boost::interprocess::ipcdetail::atomic(...)32` with `std::atomic` methods. I replaced member declarations as applicable. For example,
when I needed to change a `volatile uint32_t` into a `std::atomic<uint32_t>`. Sometimes, a member was being used a boolean flag, so
I replaced it with `std::atomic<bool>`.

You may notice that I didn't touch `levin_client_async.h`. That is because this file is entirely unused and will be deleted in PR monero-project#8211.

Additional changes from review:
* Make some local variables const
* Change postfix operators to prefix operators where value was not need
2022-03-30 13:18:32 -05:00
mj-xmr da9aa1f7f8 Copyright: Update to 2022 2022-03-04 06:59:20 +01:00
moneromooo-monero 1f81f5f5c1 protocol: fix spurious rejection of downloaded blocks
when kicking a peer for inactivity, clear the set of requested blocks,
or next time we requests blocks from it, we'll probably reject the
incoming blocks due to missing the previous requested blocks
2021-10-21 20:34:06 +00:00
moneromooo-monero d689b946f9 protocol: fix delayed "you are now synchronized..." message 2021-06-21 15:37:40 +00:00
moneromooo-monero 2b918068cc protocol: remove unreachable code 2021-04-17 15:22:26 +00:00
luigi1111 63c7ca07fb Merge pull request #7136
23aae55 Remove payload copy in all outgoing p2p messages (Lee Clagett)
2021-04-16 12:45:30 -05:00
luigi1111 b12e195fba Merge pull request #7620
fe63256 cryptonote_protocol_handler: fix race condition (anon)
ded2f3a cryptonote_protocol_handler: add race condition demo (anon)
2021-03-29 21:55:11 -04:00
luigi1111 8c8197463f Merge pull request #7310
76fe73b Revert 'fix accessing an network address in a deleted context' (selsta)
2021-03-29 21:08:03 -04:00
anon fe632560f4 cryptonote_protocol_handler: fix race condition 2021-03-22 19:42:46 +00:00
luigi1111 ce5800a225 Merge pull request #7346
85db173 Remove unused variables in monero codebase (Kevin Barbour)
2021-02-18 14:03:31 -05:00
luigi1111 2222d90491 Merge pull request #7294
f10c9a1 remove obsolete pruning debug code (moneromooo-monero)
2021-02-15 21:51:12 -05:00
Kevin Barbour 85db1734e7 Remove unused variables in monero codebase
There are quite a few variables in the code that are no longer
(or perhaps never were) in use. These were discovered by enabling
compiler warnings for unused variables and cleaning them up.

In most cases where the unused variables were the result
of a function call the call was left but the variable
assignment removed, unless it was obvious that it was
a simple getter with no side effects.
2021-02-09 08:05:05 +01:00