Skip to content

cryptonote_core: improve block template backlog handling [BETA] - #439

Draft
jeffro256 wants to merge 1 commit into
seraphis-migration:fcmp++-beta-stressnetfrom
jeffro256:tx_ready_to_go_kis_beta
Draft

cryptonote_core: improve block template backlog handling [BETA]#439
jeffro256 wants to merge 1 commit into
seraphis-migration:fcmp++-beta-stressnetfrom
jeffro256:tx_ready_to_go_kis_beta

Conversation

@jeffro256

Copy link
Copy Markdown
Collaborator

monero-project#10915

Making this PR to check whether the upstream PR performs well under high mempool load.

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
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.

1 participant