418 Commits
Author SHA1 Message Date
j-bermanandsuch-gitea 1d5bf8cc8e cryptonote_basic: parse_and_validate_tx param to check max size
Simple API to check max blob size before parsing. This is useful
when reading blobs from untrusted sources.

@selsta pointed out that coinbase txs can technically be larger
than get_max_tx_size(), otherwise we could enforce it on all txs.

(cherry picked from commit b66e2227c2f937a3e09dd62ed770b0667bff0779)
2026-10-04 18:50:24 -04:00
selstaandsuch-gitea cb893bf197 cryptonote_protocol: tighten pruned transaction blob validation
(cherry picked from commit 71e3be0e48d0939dfd2500f703b69234967d254a)
2026-10-04 18:50:24 -04:00
j-bermanandsuch-gitea 1a4dd0f212 p2p: update peer's height on new block & widen window for relay
- We select peers to relay to based on their latest known sync height.
- This change:
A) makes sure to update the peer's latest known sync height upon
validating the peer's newly relayed blocks.
B) Allows for a wider window so that if we haven't yet received the
peer's block or finished validating it, then the peer can still be
a valid candidate to receive our new txs.

(cherry picked from commit 437c45bebd621b1fdbcf0b19a4437d002b51ef8e)
2026-10-04 18:50:23 -04:00
selstaandsuch-gitea 741d3ec47b protocol: flush rejected block spans from disconnected peers
(cherry picked from commit dfa2d3020be5cc6dcd4a525bc1b7a315b9e83f57)
2026-10-04 18:50:22 -04:00
selstaandsuch-gitea af216147b0 p2p: stop buffered dispatch after fatal notifications
(cherry picked from commit f397f3920998aa8f57f86c9539fd720d288c7e18)
2026-10-04 18:50:22 -04:00
SChernykhandsuch-gitea c407af83bd 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)

(cherry picked from commit fc6e4af01c5fde4d232d16e61ae4b26d51f82987)
2026-10-04 18:50:21 -04:00
selstaandsuch-gitea ed8fc0a8fd p2p: restore safe sync mode when target height drops
(cherry picked from commit 12098ff5d66d86d73360d28c548c350f6e7b64c8)
2026-10-04 18:50:21 -04:00
Guillaume Le Vaillantandsuch-gitea 83793218ce Show IPv6 addresses in connection list
(cherry picked from commit 528cbac17a6c372d1698c82e30df0fdfc78a5ccc)
2026-10-04 18:50:19 -04:00
j-bermanandjwinterm 22818719d4 cryptonote_protocol: cleanup_handle_incoming_blocks on scope exit
(cherry picked from commit ac96d8ad3709dee5c375642c3cd8f3b8348bb0cc)
2026-05-05 18:20:53 -04:00
j-bermanandjwinterm da44d4ea4c cryptonote_basic: pruned hash return bool
(cherry picked from commit 874c771975257c82e275c17af72899b301a63d5f)
2026-05-05 18:20:53 -04:00
j-bermanandjwinterm ef41a9677c connection: try-catch handles
(cherry picked from commit 14e333217e968416a521568ed2ef4868bb162b26)
2026-05-05 18:20:53 -04:00
jeffro256andjwinterm 32f0faf2e6 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.

(cherry picked from commit 0761024b349048ebf79dbfe71caab11826833464)
2026-05-05 18:19:54 -04:00
j-bermanandjwinterm 06fed93f74 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.

(cherry picked from commit d8d3cf97300480b9d3942c667978dd4860b76feb)
2026-05-05 18:19:53 -04:00
j-bermanandjwinterm 7551a0dc04 Fix logging deadlock
(cherry picked from commit a83a46d60059a063ec953ba15f4cdcc2b3874440)
2026-05-05 18:19:53 -04:00
0xFFFC0000andjwinterm 68a1c63c73 cryptonote_protocol: accurate next_needed_height when there is an overlap
(cherry picked from commit dafecd0addb171751efd31fea417d36da84e5efe)
2026-05-05 18:19:53 -04:00
wowario 5049ad3d6f v0.11 ASCII art 2025-09-19 21:01:45 +03:00
wowario 9f429cfc89 wownero skin pack 2025-09-19 21:01:45 +03:00
wowario de22caa968 cleanup old bp 2025-09-19 21:01:43 +03:00
wowario 72cf07bba0 set last v1 block 2025-09-19 21:01:37 +03:00
tobtoht 02b29af682 cmake: don't redefine project 2025-06-24 07:12:59 +02:00
jeffro256 ce1c864b4d cryptonote_protocol: fix handling of pruned blocks during sync 2025-03-19 17:37:53 -05:00
tobtoht 3da68db978 Merge pull request #9740
008ba966d blockchain sync: reduce disk writes from 2 to 1 per tx (jeffro256)
2025-03-10 16:20:00 +00:00
jeffro256 008ba966da blockchain sync: reduce disk writes from 2 to 1 per tx 2025-03-10 01:32:08 -05:00
Lee *!* Clagett 01bcd52924 Fix build with boost ASIO 0.87. Support boost 1.66+ 2025-02-14 13:29:57 -05:00
Lee *!* Clagett ed70c16224 Some cleanup in span/connection_context + few more checks 2025-02-03 12:04:45 -05:00
jeffro256 65568d3a88 build: fix build with Boost 1.85 and remove instances of viewkey logging [RELEASE]
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. Removed reimplementation of std::hash for boost::uuids::uuid
3. Removed << operator overload for crypto::secret_key
4. Removed instances in code where private view key was dumped to the log in plaintext

Release version of #9450, containing C++14 modified assertions
2024-09-10 16:07:36 -05:00
0xFFFC0000andBoog900 8dbc361e98 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-06 17:33:17 +03:30
Lee *!* Clagett 7686af7acf Skip privacy networks (on tx sends) that don't have outgoing connections 2024-03-29 15:30:14 -04:00
moneromooo-monero 1924c170d4 protocol: drop peers sending duplicate txes 2023-06-27 11:06:14 +00:00
jeffro256andSChernykh 059b975388 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:07:15 -05:00
Lee Clagett 1bb5d25e31 Fix dandelion++ fluff/stem bug with local txes 2022-10-25 16:01:09 -04:00
SChernykh 802c4bb0e4 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:06:39 +02:00
j-berman 2dab31f62f Don't exclusively drop tor/i2p outgoing cxns in idle loop 2022-05-18 09:54:21 -07:00
Jeffrey 12b1b74d32 Trimming Fat
Remove unused include statements or unused definitions.
2022-04-18 09:55:20 -05: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
anon 9154883f3e node_server: fix race condition 2021-09-20 20:58:23 +00:00
moneromooo-monero d689b946f9 protocol: fix delayed "you are now synchronized..." message 2021-06-21 15:37:40 +00:00
luigi1111 b7ee587ddb Merge pull request #7691
cbd54ea cmake: set 3.5 as minimum version (selsta)
2021-05-12 16:59:17 -05:00
selsta cbd54ea524 cmake: set 3.5 as minimum version 2021-04-27 11:02:05 +02: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