-
Notifications
You must be signed in to change notification settings - Fork 725
Fix block-connection performance regression and mempool not copying tx performance improvement #1915
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
d1ffeb4 to
7976153
Compare
random-zebra
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Concept and code ACK with few minor nits.
Will do some testing.
1) mempool: CTxMemPoolEntry migrated to receive CTransationRef as constructor argument. 2) validation: ATMP and ATMPW migrated to receive CTransationRef. 3) net_processing: ProcessMessage migrated TX message processing to use CTransactionRef. 4) swiftx: ProcessMessage migrated IX message processing to use CTransactionRef. 5) migrated mapOrphanTransactions to use CTransactionRef.
Coming from btc@6fdd43b968f984ef92ca4576872dc65462ba7312
Coming from btc@2736c44c8edea5ce6a502a04269926fecda27301
Coming from btc@2d6e5619afa2d43a37a0a38daf33f58965ddfa80
7976153 to
0e59bad
Compare
|
Updated per feedback. |
random-zebra
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tested ACK 0e59bad
Fuzzbawls
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK 0e59bad
1403918 Add ZIP209 turnstile violation check. (furszy) 2b6f96b Signal ChainTip in ConnectTip and DisconnectTip methods (furszy) df71481 Implement ChainTip signal. (furszy) c605d98 Pass chainparams as argument in DisconnectTip, InvalidateBlock, ReprocessBlocks, DisconnectBlocks, DisconnectTip (furszy) 79dc604 Miner: sapling tree hash connection. (furszy) e43380d Block: header hashFinalSaplingRoot inclusion. (furszy) e56982b Track net value entering and exiting the Sapling circuit. (furszy) Pull request description: Another decoupling from #1798, built on top of #1903 and #1915. Containing three topics: 1) Sapling merkle tree root hash inclusion in the block header. * Block version bumped to v8. * Miner crafting the new merkle tree root hash and setting it into the block. 2) Track network total value entering and exiting the shielded pool. (*) * Similar to the previous, initial, zc failsafe flow. (this can be done much better, like we did with zerocoin supply) * Block negative shielded value pool balances. -- Network validation consensus rule -- 3) ChainTip signal implemented. * Signal to notify the listeners (wallet) about new blocks (or chain reorgs), broadcasting the new block and the current merkle tree so the listener can build upon it. -- Not connected to anything yet -- #### This PR is including the following commits decoupled from #1798. * Track net value entering and exiting the Sapling circuit.—> 8dd2045034b146d68eb6ef592433348852d54edd * Block: header hashFinalSaplingRoot inclusion.—> 5f55a76bd303e21ed31e1947eb12d44a999f667f * Sapling: missing nSaplingValue in LoadBlockIndexGuts added.—> fbe07613cf296ccc3f0a1b55f0015e86e2ff3d39 * Miner: sapling tree hash connection.—> cb88fae28eaa760c7feb00ab5ccd6f1cb8e6db15 * Implement ChainTip signal. —> 4e96e6c97d258c87910d2e9ab13cbb79c25ebda5 * Signal ChainTip in ConnectTip and DisconnectTip methods —> 85f4435b4076c8d4c8e222a0e0d7b8f76465be63 * Pass chainparams as argument in DisconnectTip, InvalidateBlock, ReprocessBlocks, DisconnectBlocks, DisconnectTip —> 1c809536b862e59554dc9ebee8651c56935a0f9a * Do not try to update tree anchor and witnesses if sapling is not active --> 1c64497d4f020d6c400c7aa836f75dce7d1517d4 * Validation: Adapted the cached incremental witnesses update flow to the syncTransaction changes. —> 6e6372df9270dba2f76836d5b964c2153e28bda6 ACKs for top commit: random-zebra: utACK 1403918 Fuzzbawls: utACK 1403918 Tree-SHA512: c90ef1f358fb7a6e5a87b7b39985d65859048bb023dc8fd66020ee1c3e6ab4635ff595262beeaee93b12f4d83e21fe0613eb490b4a63d7bc96c61e4726ac1720
Made my own way up to be able to back port bitcoin#9014. This will mean a performance regression fix over the block-connection process + less memory usage storing
CTransactionRefinstead of a plainCTransactioncopy in the mempool.The first three commits are essentially covering:
CTransationRefinstead of coping each transaction.CTransationRef.CTransactionRef.CTransactionRef.CTransactionRef.And from 085dc57 starts btc/9014 back porting work.