Commit Graph

226 Commits

Author SHA1 Message Date
wowario 917970cebf
change to debug level 2024-03-09 15:58:13 +03:00
wowario e224b4af93
support old BP 2024-03-09 15:58:12 +03:00
SChernykh b5b72ae05c Fixed mempool pruning
- Fixed undefined behavior after a call to `remove_tx_from_transient_lists` (it used an invalid iterator)
- Fixed `txCompare` (it wasn't strictly weak ordered)
2024-03-08 21:03:41 +01:00
luigi1111 5eb3fc29bb
Merge pull request #9223
36ee12b get_block_template_backlog: better sorting logic (SChernykh)
2024-03-08 13:46:09 -05:00
jeffro256 eeb7c7c546
tx_memory_pool: make double spends a no-drop offense
Nodes who see different txs in a double spend attack will drop each other, splitting the network.
Issue found by @boog900.
2024-03-08 08:14:06 -06:00
SChernykh 36ee12bd8d get_block_template_backlog: better sorting logic
std::sort is unstable, so it can return random sets of transactions when mempool has many transactions with the same fee/byte. It can result in p2pool mining empty blocks sometimes because it doesn't pick up "new" transactions immediately.
2024-03-08 14:51:33 +01:00
j-berman f137a35984 Enforce restricted # pool txs served via RPC + optimize chunked reqs [release-v0.18]
- `/getblocks.bin` respects the `RESTRICTED_TX_COUNT` (=100) when
returning pool txs via a restricted RPC daemon.
- A restricted RPC daemon includes a max of `RESTRICTED_TX_COUNT` txs
in the `added_pool_txs` field, and returns any remaining pool hashes
in the `remaining_added_pool_txids` field. The client then requests
the remaining txs via `/gettransactions` in chunks.
- `/gettransactions` no longer does expensive no-ops for ALL pool txs
if the client requests a subset of pool txs. Instead it searches for
the txs the client explicitly requests.
- Reset `m_pool_info_query_time` when a user:
  (1) rescans the chain (so the wallet re-requests the whole pool)
  (2) changes the daemon their wallets points to (a new daemon would
      have a different view of the pool)
- `/getblocks.bin` respects the `req.prune` field when returning
pool txs.
- Pool extension fields in response to `/getblocks.bin` are optional
with default 0'd values.
2023-07-09 08:38:18 +02:00
rbrunner7 23f782b211 wallet2, RPC: Optimize RPC calls for periodic refresh from 3 down to 1 call [release-v0.18] 2023-07-09 08:30:53 +02:00
jeffro256 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
tevador 5900ed3706
Add a size limit for tx_extra in tx pool 2023-03-18 20:01:58 +01:00
luigi1111 b9e8504cfb
Merge pull request #8467
fac7c43 continue pool pruning even if a tx can't be found (j-berman)
2022-08-09 17:43:32 -05:00
luigi1111 5c33f40cd8
Merge pull request #8455
099fc1f Fixed get_block_template_backlog performance (SChernykh)
2022-08-08 20:29:56 -05:00
j-berman fac7c43644 continue pool pruning even if a tx can't be found 2022-07-26 17:28:02 -07:00
SChernykh 099fc1f8a9 Fixed get_block_template_backlog performance
Before the fix, it processed all transactions in the mempool which could be very slow when mempool grows to several MBs in size. I observed `get_block_template_backlog` taking up to 15 seconds of CPU time under high mempool load.

After the fix, only transactions that can potentially be mined in the next block will be processed (a bit more than the current block median weight).
2022-07-22 13:50:21 +02:00
j-berman 8cc3c9af4d Publish submitted txs via zmq 2022-07-21 11:53:31 -07:00
j-berman b9d2c788bc fix backoff delay logic when re-relaying txs 2022-05-12 08:39:51 -07:00
mj-xmr da9aa1f7f8
Copyright: Update to 2022 2022-03-04 06:59:20 +01:00
selsta 82828bfcb6
cryptonote_core: fix unused lambda warning 2021-11-16 05:21:56 +01:00
moneromooo-monero bbe3b276b8
tx_pool: full tx revalidation on fork boundaries
avoids mining txes after a fork that are invalid by this fork's
rules, but were valid by the previous fork rules at the time
they were verified and added to the txpool.
2021-11-01 20:56:38 +00:00
SChernykh dfee15eee1 RPC and ZeroMQ APIs to support p2pool
Adds the following:

- "get_miner_data" to RPC API
- "json-miner-data" to ZeroMQ subscriber contexts

Both provide the necessary data to create a custom block template. They are used by p2pool.

Data provided:

- major fork version
- current height
- previous block id
- RandomX seed hash
- network difficulty
- median block weight
- coins mined by the network so far
- mineable mempool transactions
2021-09-11 15:15:07 +02: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
Alexander Blair 4f401f6fca
Merge pull request #7025
b10878f10 Change Dandelion++ fluff probability to 20%, and embargo timeout to 39s (Lee Clagett)
2020-12-01 14:23:49 -08:00
Lee Clagett b10878f108 Change Dandelion++ fluff probability to 20%, and embargo timeout to 39s
A 20% fluff probability increases the precision of a spy connected to
every node by 10% on average, compared to a network using 0% fluff
probability. The current value (10% fluff) should increase precision by
~5% compared to baseline.

This decreases the expected stem length from 10 to 5. The embargo
timeout was therefore lowered to 39s; the fifth node in a stem is
expected to have a 90% chance of being the first to timeout, which is
the same probability we currently have with an expected stem length of
10 nodes.
2020-11-17 21:45:37 -05:00
Lee Clagett d73cb95dfa Fix timeout checks for forwarded and Dandelion++ stem txes 2020-11-15 00:08:10 -05:00
moneromooo-monero 11b20229c9
tx_pool: silence spammy harmless warning till we fix the bug 2020-10-12 14:07:40 +00:00
moneromooo-monero 55363c5941
Avoid some temporary strings when reading off the database 2020-08-17 14:02:27 +00:00
Alexander Blair c108c5e2f0
Merge pull request #6354
67ade8005 Add randomized delay when forwarding txes from i2p/tor -> ipv4/6 (Lee Clagett)
2020-08-09 06:42:49 -07:00
Alexander Blair a0d179e528
Merge pull request #6512
5ef0607da Update copyright year to 2020 (SomaticFanatic)
2020-07-19 03:32:59 -07:00
moneromooo-monero 332d60719a
tx_pool: mine stem txes in fake chain mode
This fixes the functional tests, since txes would not be mined
after being sent to the daemon (they'd be waiting for the
dandelion timeout first)
2020-07-09 14:52:13 +00:00
Lee Clagett 4d8d121462 Fix D++ block template check 2020-06-12 22:05:52 -04:00
Lee Clagett 67ade80055 Add randomized delay when forwarding txes from i2p/tor -> ipv4/6 2020-05-15 07:57:35 +00:00
SomaticFanatic 5ef0607da6 Update copyright year to 2020
Update copyright year to 2020
2020-05-06 22:36:54 -04:00
luigi1111 0f233c6ad8
Merge pull request #6478
ee58362 Used legacy category to match insert_key_images behavior (vtnerd)
2020-05-06 00:27:13 -05:00
Sumo Gr dd807b8410 txpool.cpp: rename var to fix for old g++ version (xenial default) 2020-04-29 10:03:51 +00:00
Lee Clagett ee58362b1f Used legacy category to match insert_key_images behavior 2020-04-24 20:19:37 -04:00
Lee Clagett 571546067f Always reject duplicate key-images from second txid 2020-03-30 17:52:42 +00:00
Lee Clagett 02d887c2e5 Adding Dandelion++ support to public networks:
- New flag in NOTIFY_NEW_TRANSACTION to indicate stem mode
  - Stem loops detected in tx_pool.cpp
  - Embargo timeout for a blackhole attack during stem phase
2020-03-26 15:01:30 +00:00
luigi1111 228af683a7
Merge pull request #6403
5de2295 Correct key image check in tx_pool (vtnerd)
2020-04-10 16:10:33 -05:00
luigi1111 6c7d928f19
Merge pull request #6336
760ecf2 console_handler: do not let exception past the dor (moneromooo-monero)
09c8111 threadpool: lock mutex in create (moneromooo-monero)
e377977 tx_pool: catch theoretical error in get_block_reward (moneromooo-monero)
2020-03-31 15:14:12 -05:00
luigi1111 096e2135dd
Merge pull request #6214
054b4c7 protocol: request txpool contents when synced (moneromooo-monero)
2020-03-31 13:32:55 -05:00
moneromooo-monero 054b4c7f41
protocol: request txpool contents when synced
A newly synced Alice sends a (typically quite small) list of
txids in the local tpxool to a random peer Bob, who then uses
the existing tx relay system to send Alice any tx in his txpool
which is not in the list Alice sent
2020-03-22 16:03:31 +00:00
Lee Clagett 5de2295f3c Correct key image check in tx_pool 2020-03-14 19:17:15 +00:00
moneromooo-monero f8d76f395b
core: move the LockedTXN class out of txpool so it may be reused
for example, in the RPC server
2020-03-12 11:30:05 +00:00
moneromooo-monero e3779775d7
tx_pool: catch theoretical error in get_block_reward
Coverity 196626
2020-02-12 21:05:28 +00:00
luigi1111 fb64463c4c
Merge pull request #6052
c96b7ee tx_pool: fix error message assuming incorrectly (moneromooo-monero)
2019-12-12 13:44:50 -06:00
Lee Clagett 5d7ae2d279 Adding support for hidden (anonymity) txpool 2019-11-02 20:36:03 +00:00
moneromooo-monero c96b7ee619
tx_pool: fix error message assuming incorrectly 2019-10-29 10:43:59 +00:00
moneromooo-monero 174a6ac9c5
tx_pool: fix divide by 0 in log
Coverity 205394
2019-10-25 16:56:55 +00:00
luigi1111 426d2ac8ee
Merge pull request #5981
88c9d90 protocol: initialize block_weight in block_complete_entry ctor (moneromooo-monero)
fe443bb cryptonote: don't leave block_weight uninitialized (moneromooo-monero)
1ba9baf tx_pool: do not divide by 0 (moneromooo-monero)
2019-10-22 10:18:28 -05:00
luigi1111 6f202844b5
Merge pull request #5919
01f660f blockchain: fill in cumulative block weight for alt blocks (moneromooo-monero)
2019-10-22 10:06:10 -05:00