Skip to content

cryptonote_core: multi-threaded incoming pool tx handling [FCMP++ beta] - #440

Draft
jeffro256 wants to merge 3 commits into
seraphis-migration:fcmp++-beta-stressnetfrom
jeffro256:multithreaded_handle_incoming_tx_beta
Draft

cryptonote_core: multi-threaded incoming pool tx handling [FCMP++ beta]#440
jeffro256 wants to merge 3 commits into
seraphis-migration:fcmp++-beta-stressnetfrom
jeffro256:multithreaded_handle_incoming_tx_beta

Conversation

@jeffro256

Copy link
Copy Markdown
Collaborator

FCMP++-reworked version of monero-project#10924

Addresses several issues with miner block template:

1. Fixes key image conflict issue due to lazy transaction prefix
  - This line checks whether the next tx candiates has conflicting key images with the rest of the block template:
    https://github.com/monero-project/monero/blob/0f84863feda75574788e15c9691abecf57bc3f8f/src/cryptonote_core/tx_pool.cpp#L1744
  - The function takes in a transaction prefix and parses the key images from it
  - However, the transaction may or may not actually ever be deserialized, depending on the state of `m_input_cache`:
    https://github.com/monero-project/monero/blob/0f84863feda75574788e15c9691abecf57bc3f8f/src/cryptonote_core/tx_pool.cpp#L1455-L1466
2. Deduplicates code between `tx_memory_pool::fill_block_template()` and `tx_memory_pool::get_block_template_backlog()`,
   and thus converging the backlog lists between the 2 functions
3. Saves time creating block templates by skipping transaction blob readings and deserializations for some txs
4. Stops template candidate search after block is reasonably full and we are iterating through txs which lower coinbase reward
   or exceed size limit by a "smallish" amount. Prevents us from unnecessarily reading thousands of useless tx metadatas under load.
   May help seraphis-migration#293
5. Fixes block templates when coinbase transactions are > 600 bytes
6. Fills closer to block weight limit for small coinbase transactions
7. Fixes "Invalidating block template cache" spam while popping blocks / during reorgs
8. More accurate "expected block reward" field in RPC

Re-support overpicking in RPC
Stores a 1 byte field in the mempool meta, `nic_verified_hf_version` which
specifies for which HF version this tx has passed `ver_non_input_consensus()`.
This is checked while handling both alt chains and main chains, and thus allows
us to skip the expensive full mempool revalidation on fork change.

Resolves monero-project#10142
@j-berman

j-berman commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator

Depends on #450 to remove the lock in handle_notify_new_transactions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants