aboutsummaryrefslogtreecommitdiff
path: root/src/cryptonote_core/tx_pool.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #10543tobtoht2026-06-091-4/+6
|\ | | | | | | 878c781 zmq: apply restricted-mode privacy filtering to get_transaction_pool (greatjourney589)
| * zmq: apply restricted-mode privacy filtering to get_transaction_poolgreatjourney5892026-05-081-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add an include_sensitive parameter to tx_memory_pool::get_pool_for_rpc (and its core passthrough), mirroring the include_sensitive_data parameter on the HTTP analog get_transactions_and_spent_keys_info. When false, receive_time and last_relayed_time are zeroed using the same masking already applied on the HTTP path. The ZMQ handler in daemon_handler.cpp passes !m_restricted, so --restricted-zmq-rpc callers now receive the same privacy-filtered view as restricted HTTP callers instead of the unfiltered timing metadata they previously got. Stem-phase txs continue to be excluded regardless (relay_category::broadcasted filter unchanged). Refs #10529.
* | tx_pool: fix use-after-free in prune()SChernykh2026-06-031-1/+1
|/ | | | - txid was a reference to an item which was later deleted in remove_tx_from_transient_lists(), and txid was used after that
* tx_pool: notify txpool event when stem bumps to fluffj-berman2026-04-241-4/+4
|
* tx_memory_pool: speedup get_complement() for large requestsjeffro2562026-03-211-3/+10
| | | | | | | 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.
* tx pool: only increment m_txpool_weight for newly added pool txsj-berman2025-11-111-1/+2
| | | | | | | | | | | | | Otherwise we can end up double counting txs towards the weight, which can over-state the pool weight. E.g. relay tx to node in stem phase, add its weight to pool weight, then receive tx from another node, then bump the pool weight again. That double counts the tx towards the pool weight. If the weight exceeds the max, the node will "prune" txs from the pool. Thus, over-counting is probably a cause of, but perhaps not the only cause of: https://github.com/seraphis-migration/monero/issues/148
* blockchain sync: reduce disk writes from 2 to 1 per txjeffro2562025-03-101-110/+40
|
* Enforce Tx unlock_time is Zero by Relay Rule [RELEASE]jeffro2562024-04-291-0/+9
| | | | | | | | | | | | | | | | Related to https://github.com/monero-project/research-lab/issues/78 Added a relay rule that enforces the `unlock_time` field is equal to 0 for non-coinbase transactions. UIs changed: * Removed `locked_transfer` and `locked_sweep_all` commands from `monero-wallet-cli` APIs changed: * Removed `unlock_time` parameters from `wallet2` transfer methods * Wallet RPC transfer endpoints send error codes when requested unlock time is not 0 * Removed `unlock_time` parameters from `construct_tx*` cryptonote core functions @tobtoht: undo rebase changes tx.dsts -> tx_dsts
* Fixed mempool pruningSChernykh2024-03-081-2/+13
| | | | | - 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)
* Merge pull request #9223luigi11112024-03-081-1/+1
|\ | | | | | | 36ee12b get_block_template_backlog: better sorting logic (SChernykh)
| * get_block_template_backlog: better sorting logicSChernykh2024-03-081-1/+1
| | | | | | | | 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.
* | tx_memory_pool: make double spends a no-drop offensejeffro2562024-03-081-0/+1
|/ | | | | Nodes who see different txs in a double spend attack will drop each other, splitting the network. Issue found by @boog900.
* Enforce restricted # pool txs served via RPC + optimize chunked reqs ↵j-berman2023-07-091-30/+48
| | | | | | | | | | | | | | | | | | | | | | [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.
* wallet2, RPC: Optimize RPC calls for periodic refresh from 3 down to 1 call ↵rbrunner72023-07-091-19/+213
| | | | [release-v0.18]
* cryptonote core/protocol: don't drop peers for soft offensesjeffro2562023-03-291-0/+2
| | | | | | Also: txs with tx_extra which is too large will not get published to ZMQ Co-authored-by: SChernykh <sergey.v.chernykh@gmail.com>
* Add a size limit for tx_extra in tx pooltevador2023-03-181-0/+9
|
* Merge pull request #8467luigi11112022-08-091-5/+24
|\ | | | | | | fac7c43 continue pool pruning even if a tx can't be found (j-berman)
| * continue pool pruning even if a tx can't be foundj-berman2022-07-261-5/+24
| |
* | Merge pull request #8455luigi11112022-08-081-16/+51
|\ \ | | | | | | | | | 099fc1f Fixed get_block_template_backlog performance (SChernykh)
| * | Fixed get_block_template_backlog performanceSChernykh2022-07-221-16/+51
| |/ | | | | | | | | | | 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).
* / Publish submitted txs via zmqj-berman2022-07-211-1/+9
|/
* fix backoff delay logic when re-relaying txsj-berman2022-05-121-4/+4
|
* Copyright: Update to 2022mj-xmr2022-03-041-1/+1
|
* cryptonote_core: fix unused lambda warningselsta2021-11-161-1/+1
|
* tx_pool: full tx revalidation on fork boundariesmoneromooo-monero2021-11-011-45/+43
| | | | | | 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.
* RPC and ZeroMQ APIs to support p2poolSChernykh2021-09-111-4/+35
| | | | | | | | | | | | | | | | | | | | 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
* Remove unused variables in monero codebaseKevin Barbour2021-02-091-2/+0
| | | | | | | | | | | 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.
* Merge pull request #7025Alexander Blair2020-12-011-2/+2
|\ | | | | | | b10878f10 Change Dandelion++ fluff probability to 20%, and embargo timeout to 39s (Lee Clagett)
| * Change Dandelion++ fluff probability to 20%, and embargo timeout to 39sLee Clagett2020-11-171-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | Fix timeout checks for forwarded and Dandelion++ stem txesLee Clagett2020-11-151-5/+36
|/
* tx_pool: silence spammy harmless warning till we fix the bugmoneromooo-monero2020-10-121-1/+4
|
* Avoid some temporary strings when reading off the databasemoneromooo-monero2020-08-171-13/+13
|
* Merge pull request #6354Alexander Blair2020-08-091-10/+48
|\ | | | | | | 67ade8005 Add randomized delay when forwarding txes from i2p/tor -> ipv4/6 (Lee Clagett)
| * Add randomized delay when forwarding txes from i2p/tor -> ipv4/6Lee Clagett2020-05-151-10/+48
| |
* | Merge pull request #6512Alexander Blair2020-07-191-1/+1
|\ \ | | | | | | | | | 5ef0607da Update copyright year to 2020 (SomaticFanatic)
| * | Update copyright year to 2020SomaticFanatic2020-05-061-1/+1
| | | | | | | | | | | | Update copyright year to 2020
* | | tx_pool: mine stem txes in fake chain modemoneromooo-monero2020-07-091-4/+10
| | | | | | | | | | | | | | | | | | 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)
* | | Fix D++ block template checkLee Clagett2020-06-121-1/+1
|/ /
* | Merge pull request #6478luigi11112020-05-061-1/+1
|\ \ | | | | | | | | | ee58362 Used legacy category to match insert_key_images behavior (vtnerd)
| * | Used legacy category to match insert_key_images behaviorLee Clagett2020-04-241-1/+1
| |/
* / txpool.cpp: rename var to fix for old g++ version (xenial default)Sumo Gr2020-04-291-2/+2
|/
* Always reject duplicate key-images from second txidLee Clagett2020-03-301-10/+12
|
* Adding Dandelion++ support to public networks:Lee Clagett2020-03-261-30/+85
| | | | | | - 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
* Merge pull request #6403luigi11112020-04-101-16/+7
|\ | | | | | | 5de2295 Correct key image check in tx_pool (vtnerd)
| * Correct key image check in tx_poolLee Clagett2020-03-141-16/+7
| |
* | Merge pull request #6336luigi11112020-03-311-1/+5
|\ \ | | | | | | | | | | | | | | | 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)
| * | tx_pool: catch theoretical error in get_block_rewardmoneromooo-monero2020-02-121-1/+5
| |/ | | | | | | Coverity 196626
* | Merge pull request #6214luigi11112020-03-311-0/+33
|\ \ | | | | | | | | | 054b4c7 protocol: request txpool contents when synced (moneromooo-monero)
| * | protocol: request txpool contents when syncedmoneromooo-monero2020-03-221-0/+33
| |/ | | | | | | | | | | | | 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
* / core: move the LockedTXN class out of txpool so it may be reusedmoneromooo-monero2020-03-121-30/+12
|/ | | | for example, in the RPC server