monero/utils
jeffro256 40eb82873e
cryptonote_core: cache input verification results directly in mempool
This replaces `ver_rct_non_semantics_simple_cached()` with an API that offloads
the responsibility of tracking input verification successes to the caller. The
main caller of this function in the codebase, `cryptonote::Blockchain()` instead
keeps track of the verification results for transaction in the mempool by
storing a "verification ID" in the mempool metadata table (with `txpool_tx_meta_t`).
This has several benefits, including:

* When the mempool is large (>8192 txs), we no longer experience cache misses and unnecessarily re-verify ring signatures. This greatly improves block propagation time for FCMP++ blocks under load
* For the same reason, reorg handling can be sped up by storing verification IDs of transactions popped from the chain
* Speeds up re-validating every mempool transaction on fork change (monerod revalidates the whole tx-pool on HFs #10142)
* Caches results for every single type of Monero transaction, not just latest RCT type
* Cache persists over a node restart
* Uses 512KiB less RAM (8192*2*32B)
* No additional storage or DB migration required since `txpool_tx_meta_t` already had padding allocated
* Moves more verification logic out of `cryptonote::Blockchain`

Furthermore, this opens the door to future multi-threaded block verification
speed-ups. Right now, transactions' input proof verification is limited to one
transaction at a time. However, one can imagine a scenario with verification IDs
where input proofs are optimistically multi-threaded in advance of block
processing. Then, even though ring member fetching and verification is
single-threaded inside of `cryptonote::Blockchain::check_tx_inputs()`, the
single thread can skip the CPU-intensive cryptographic code if the verification
ID allows it.

Also changes the default log category in `tx_verification_utils.cpp` from "blockchain" to "verify".
2026-01-02 15:47:19 -06:00
..
conf Clarification of boolean options in config file 2018-07-18 20:07:05 +02:00
fish src: bump network speed 4x 2025-02-05 17:30:58 +00:00
gpg_keys Merge pull request #9922 2025-05-16 11:59:05 +00:00
health copyright: bump to 2024 2024-05-21 16:29:33 +00:00
logs network: log traffic and add a simple traffic analysis script 2020-01-26 00:33:41 +00:00
python-rpc cryptonote_core: cache input verification results directly in mempool 2026-01-02 15:47:19 -06:00
systemd monerod.service: use network-online.target 2024-08-04 05:52:59 -05:00
translations translations: fix "monero_" prefix when taking languages from file 2019-11-15 13:21:46 +00:00
.gitignore year updated in license 2015-01-02 18:52:46 +02:00
doxygen-publish.sh cleaning up, removing redundant files, renaming, fixing incorrect licenses 2015-05-31 13:40:18 +02:00