Commit Graph

315 Commits

Author SHA1 Message Date
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
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
Lee Clagett 23aae5571b Remove payload copy in all outgoing p2p messages 2021-01-16 22:53:28 +00:00
luigi1111 d259ed0740
Merge pull request #7119
dd5e689 protocol: add calls to reserve where appropriate (moneromooo-monero)
2021-01-15 23:45:25 -05:00
selsta 76fe73b8bd
Revert "fix accessing an network address in a deleted context"
This reverts commit 4e74385a1a.
2021-01-12 12:18:23 +01:00
moneromooo-monero f10c9a16c4
remove obsolete pruning debug code 2021-01-08 15:41:59 +00:00
Alexander Blair 747699541e
Merge pull request #7285
927141bcc Command max_bytes moved from dynamic map to static switch (Lee Clagett)
2021-01-07 17:54:02 -08:00
luigi1111 69e4a2c62d
Merge pull request #7266
38a6e6e protocol: handle receiving a block hash we've not added yet (moneromooo-monero)
2021-01-06 21:09:03 -05:00
Alexander Blair dbaf95ac77
Merge pull request #7271
4e74385a1 fix accessing an network address in a deleted context (moneromooo-monero)
2021-01-03 18:24:50 -08:00
moneromooo-monero b652d598d1
add a max levin packet size by command type 2021-01-03 14:07:45 +00:00
moneromooo-monero 4e74385a1a
fix accessing an network address in a deleted context
Both drop_connection and add_host_fail can drop the connection,
which invalidates the context, and thus the address it contains.

Thanks to wfaressuissia[m] for lots of help and prodding when
debugging this
2021-01-03 13:04:55 +00:00
moneromooo-monero 38a6e6eb26
protocol: handle receiving a block hash we've not added yet 2021-01-02 22:10:31 +00:00
Alexander Blair 16c780d568
Merge pull request #7250
61b6e4cc6 Add aggressive restrictions to pre-handshake p2p buffer limit (Lee Clagett)
2021-01-01 22:35:59 -08:00
Alexander Blair 3bf0721ae6
Merge pull request #7246
0aa541b36 protocol: more sanity checks in new chain block hashes (moneromooo-monero)
2021-01-01 22:33:27 -08:00
moneromooo-monero 0aa541b361
protocol: more sanity checks in new chain block hashes 2020-12-31 23:33:18 +00:00
moneromooo-monero 31c69923ba
protocol: don't reset last request time on an idle timer
this prevents losing time of "idle time" for a peer, which could
otherwise be reset by another timed sync command from the peer
2020-12-30 14:22:10 +00:00
moneromooo-monero bcdc6c62b7
protocol: fix false positives dropping peers
it'd trigger on reorgs
2020-12-27 14:41:19 +00:00
luigi1111 025db3d2b4
Revert "Reject existing claimed blocks in sync mode" 2020-12-27 00:18:05 -05:00
Alexander Blair d61fdebaac
Merge pull request #7188
efe83982d protocol: drop nodes if they claim new data but only give stale data (moneromooo-monero)
2020-12-26 13:43:13 -08:00
Alexander Blair 609dbe6b92
Merge pull request #7154
cf7e1571d protocol: reject claimed block hashes that already are in the chain (moneromooo-monero)
af0a25544 protocol: drop peers we can't download anything from in sync mode (moneromooo-monero)
2020-12-26 13:40:36 -08:00
moneromooo-monero efe83982d3
protocol: drop nodes if they claim new data but only give stale data
Some joker is spending time actually doing this
2020-12-25 20:30:39 +00:00
Lee Clagett 927141bcc4 Command max_bytes moved from dynamic map to static switch 2020-12-22 20:54:16 +00:00
moneromooo-monero 5a1ac9c0ef
rpc: add a busy_syncing field to get_info
true if and pretty much only if new blocks are being added
2020-12-17 18:03:11 +00:00
moneromooo-monero cf7e1571d3
protocol: reject claimed block hashes that already are in the chain 2020-12-17 02:54:02 +00:00
Lee Clagett 61b6e4cc67 Add aggressive restrictions to pre-handshake p2p buffer limit 2020-12-17 00:36:10 +00:00
moneromooo-monero af0a25544e
protocol: drop peers we can't download anything from in sync mode
instead of the (incorrect) check for whether we think we might have
a user for it at some point in the near future. We can reconnect.
2020-12-16 20:19:52 +00:00
luigi1111 e5decd0cde
Merge pull request #7130
543733d protocol: include first new block in chain entry response (moneromooo-monero)
2020-12-12 22:05:02 -06:00
luigi1111 a57c95b2f1
Merge pull request #7127
5d1849a protocol: stricter checks on received chain hash list (moneromooo)
2020-12-12 22:03:12 -06:00
moneromooo-monero 543733d42c
protocol: include first new block in chain entry response 2020-12-12 01:36:35 +00:00
moneromooo 5d1849a9eb
protocol: stricter checks on received chain hash list 2020-12-11 18:47:40 +00:00
moneromooo-monero 62e8ca5eaf
protocol: revert incoming chain height check against local chain
We can actually request a chain that's further away from what we
have as we buffer more and more
2020-12-11 02:37:15 +00:00
Alexander Blair 0f67569279
Merge pull request #7121
cd7e9769d protocol: one more sanity check on usable data from a peer (moneromooo-monero)
2020-12-10 17:44:54 -08:00
Alexander Blair bdaadf85dc
Merge pull request #7117
5dee031b2 protocol: add a sanity check to the number of block hashes sent (moneromooo-monero)
2020-12-10 17:43:41 -08:00
Alexander Blair bb6d2d4b05
Merge pull request #7114
eb77790df protocol: fix asking for pruned blocks for v10 (moneromooo-monero)
2020-12-10 17:42:48 -08:00
Alexander Blair 28e5e42986
Merge pull request #7110
d660f22ed protocol: drop origin IP if a block fails to verify in sync mode (moneromooo-monero)
2020-12-10 17:41:59 -08:00
Alexander Blair 5b62a6f316
Merge pull request #7106
0f34cabb9 protocol: more restrictive checks on chain entry response (moneromooo-monero)
2020-12-10 17:40:46 -08:00
Alexander Blair 1e9483a2d5
Merge pull request #7009
7414e2bac Change epee binary output from std::stringstream to byte_stream (Lee Clagett)
2020-12-10 17:34:50 -08:00