Commit Graph
443 Commits
Author SHA1 Message Date
selsta 85b38a52a6 rpc: replace get_blocks.bin Levin pool budget
/get_blocks.bin is HTTP binary RPC serialized with portable storage, not a
P2P Levin message. The previously added pool limiter used
LEVIN_DEFAULT_MAX_PACKET_SIZE as a response budget, but that constant does
not apply to the RPC path.
2026-07-15 01:58:59 +02:00
akildemirandselsta 1bd4dfe43a rpc: return prunable hashes in pruned getblocks
Co-authored-by: selsta <selsta@sent.at>
2026-06-11 20:37:13 +02:00
tobtoht c113dee523 Merge pull request #10716
196078e Refactored tx verification NIC logic (SChernykh)
2026-06-10 17:10:21 +00:00
tobtoht a8478d21b2 Merge pull request #10531
7af9009 zmq: apply restricted-mode privacy filtering to get_transaction_pool (greatjourney589)
2026-06-08 08:34:50 +00: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 c982fe1e51 Merge pull request #9473
1aea9cc tx_pool: track sensitive flag per-tx in added_txs_by_id (j-berman)
8cecfc8 src: fix rpc limit (Navid Rahimi)
2026-05-21 19:58:24 +00:00
Navid Rahimiandjeffro256 8cecfc8d1b src: fix rpc limit
Co-authored-by: jeffro256 <jeffro256@tutanota.com>
2026-05-21 20:37:53 +01: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
greatjourney589 7af90094da zmq: apply restricted-mode privacy filtering to get_transaction_pool
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.
2026-05-08 11:33:34 -04:00
tobtoht b84aee62a4 Merge pull request #10143
4a2d6eb Daemon RPC: getblocks.bin block_ids_exclusive req param (j-berman)
2026-04-29 12:35:26 +00:00
selsta 2009084cc4 cryptonote_core: restore separate fakechain data dir for core_tests 2026-04-29 02:02:13 +02:00
j-berman d29ffb9616 tx_pool: notify txpool event when stem bumps to fluff 2026-04-24 09:02:45 -07:00
tobtoht 474657ad49 Merge pull request #10352
05eb7a2 Fix ZMQ-PUB reporting of mempool txes that were initially in stem phase (Lee Clagett)
2026-04-24 15:34:29 +00:00
Lee Clagett 05eb7a212e Fix ZMQ-PUB reporting of mempool txes that were initially in stem phase 2026-04-24 09:17:44 -04:00
jeffro256 def9420da1 blockchain_utilities: fix --data-dir option 2026-04-22 00:27:53 -05:00
Jeetraj 50b259d449 p2p: isolate regtest from mainnet bootstrap state 2026-04-09 11:05:47 +05:30
tobtoht a00cb24cbb Merge pull request #10372
247af5e cryptonote_core: try-catch in prepare same as cleanup (j-berman)
2026-03-28 19:48:28 +00: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
j-berman 247af5e8a3 cryptonote_core: try-catch in prepare same as cleanup 2026-03-18 23:02:33 -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
jeffro256 3f964fcdb5 blockchain_db/rpc: faster is_key_image_spent
Does the following to speedup the `/is_key_image_spent` RPC endpoint:
  - Reads all on-chain key images in one LMDB read transacion
  - Uses `cryptonote_core::are_key_images_spent_in_pool()` instead of `cryptonote_core::get_pool_transactions_and_spent_keys_info()` for pool querying. This only does a LMDB read per key image if in the pool.
  - Filters known on-chain spent key images before querying for key images spent in pool

This RPC endpoint was causing major daemon slowdowns in the Carrot/FCMP++ Alpha Stressnet when using the `rescan_spent` command, especially for large wallets.
The effect was much worse if the mempool was full.
2026-01-07 00:49:44 -06: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 1fd6f275da Daemon: relay empty fluffy block on found block 2025-11-11 16:37:36 -08:00
j-berman 4a2d6eb3da Daemon RPC: getblocks.bin block_ids_exclusive req param
When the request includes block_ids, the daemon uses
find_blockchain_supplement to identify the highest block hash
passed in block_ids that the daemon also knows about, and then
serves subsequent blocks contiguous to that block.

When block_ids_skip_exclusive is false (default current
behavior), the daemon includes the highest block requested in the
response, in addition to contiguous blocks after it.

When block_ids_skip_exclusive is true (new param), the daemon
serves blocks starting from the block 1 higher than the highest
known block included in block_ids. Thus, the daemon skips the
common block known to the client and daemon. Clients can make sure
the daemon is serving expected contiguous blocks to its highest
known block by checking the first block's prev_id included in the
response, and making sure it is equivalent to the block the client
already knows about that was included in block_ids. This avoids
the daemon serving 1 extra block it does not need to serve to the
client, since the client should already know about that block.

bl
2025-10-10 01:21:52 -07:00
j-berman 292c053280 Cleaner validation (faster and saner) 2025-10-06 12:51:16 -07:00
nahuhh 935f2d20ec cryptonote_core: --dns-versions-check is deprecated 2025-09-21 18:52:25 +00:00
0xFFFC0000andnahuhh 2a1a4897cb src: dynamic block sync size
Co-authored-by: nahuhh
2025-05-13 13:51:42 +00:00
tobtoht d2d976ca5a Merge pull request #9404
f4672c259 cryptonote_core: only verify txpool when the hardfork value has changed. (0xFFFC0000)
2025-04-24 16:13:01 +00:00
jeffro256 c069c04ede blockchain sync: reduce disk writes from 2 to 1 per tx 2025-03-10 01:02:37 -05:00
0xFFFC0000andBoog900 f4672c2595 cryptonote_core: only verify txpool when the hardfork value has changed.
Co-authored-by: Boog900 <boog900@tutanota.com>
2025-02-24 17:25:27 +00:00
jeffro256 ac0af73222 rpc: add cumul weight field to block template resp
Resolves #9415
2024-08-01 01:03:41 -05:00
luigi1111 330212888a Merge pull request #9383
9f83e74 Daemon RPC: /getblocks.bin return chain's top_block_hash in resp (j-berman)
2024-07-16 19:00:39 -04:00
j-berman 9f83e7434d Daemon RPC: /getblocks.bin return chain's top_block_hash in resp 2024-06-24 17:58:20 -07:00
copyCat 341771ac3e copyright: bump to 2024 2024-05-21 16:29:33 +00:00
luigi1111 6fc67869a1 Merge pull request #8924
ffbf9f4 blockchain_and_pool: move to crytonote_core and enforce its usage (jeffro256)
d6f86e5 Avoid nullptr dereference when constructing Blockchain and tx_memory_pool (lukas)
2023-08-17 10:21:40 -05:00
luigi1111 c490e38f56 Merge pull request #8840
503c3e0 core: do not force sync the db when finding a block in regtest mode (Crypto City)
2023-08-17 10:10:14 -05:00
jeffro256 ffbf9f4766 blockchain_and_pool: move to crytonote_core and enforce its usage 2023-07-01 07:12:53 -05:00
luigi1111 b86a620b4d Merge pull request #8855
bb83eb1 daemon: remove --fluffy-blocks (tobtoht)
2023-06-27 11:41:57 -05:00
tobtoht bb83eb151a daemon: remove --fluffy-blocks 2023-05-12 17:39:38 +02:00
Crypto Cityandmoneromooo-monero 503c3e06df core: do not force sync the db when finding a block in regtest mode
for a slight performance boost in functional tests
2023-05-05 18:11:57 +00:00
moneromooo-monero 24d56c5975 bump lmdb sync threshold for performance
Force sync every 100k blocks instead of every 1k blocks. Bumping this
value is reported to make a big difference in sync performance, eg:
https://github.com/monero-project/monero/issues/8189
2023-05-05 18:07:44 +00:00
luigi1111 9bf06ea75d Merge pull request #8698
5b4fea7 Copyright: Update to 2023 (mj-xmr)
2023-04-25 11:12:56 -04: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
j-bermanandrbrunner7 c4af33eded Enforce restricted # pool txs served via RPC + optimize chunked reqs
- `/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-03-07 20:35:45 +01: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
rbrunner7 9752116ed3 wallet2, RPC: Optimize RPC calls for periodic refresh from 3 down to 1 call 2022-12-30 13:50:22 +01:00
luigi1111 fc907a9570 Merge pull request #8587
8e7c7af Move update_checkpoints() to a later stage (SChernykh)
2022-09-26 15:00:35 -05: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