Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@furszy
Copy link

@furszy furszy commented Oct 12, 2020

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 CTransactionRef instead of a plain CTransaction copy in the mempool.

The first three commits are essentially covering:

  1. mempool: using CTransationRef instead of coping each transaction.
  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.

And from 085dc57 starts btc/9014 back porting work.

@furszy furszy self-assigned this Oct 12, 2020
@furszy furszy force-pushed the 2020_mempool_migrated_to_CTransactionRed_and_fix_block_connection_performance branch from d1ffeb4 to 7976153 Compare October 13, 2020 14:27
@furszy furszy added this to the 5.0.0 milestone Oct 15, 2020
@furszy furszy requested review from Fuzzbawls and removed request for Fuzzbawls October 16, 2020 07:15
Copy link

@random-zebra random-zebra left a 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.

furszy and others added 8 commits October 16, 2020 12:39
 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
@furszy furszy force-pushed the 2020_mempool_migrated_to_CTransactionRed_and_fix_block_connection_performance branch from 7976153 to 0e59bad Compare October 16, 2020 15:41
@furszy
Copy link
Author

furszy commented Oct 16, 2020

Updated per feedback.

Copy link

@random-zebra random-zebra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tested ACK 0e59bad

Copy link
Collaborator

@Fuzzbawls Fuzzbawls left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK 0e59bad

@furszy furszy merged commit 8a9b92c into PIVX-Project:master Oct 17, 2020
Fuzzbawls added a commit that referenced this pull request Oct 23, 2020
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
@furszy furszy deleted the 2020_mempool_migrated_to_CTransactionRed_and_fix_block_connection_performance branch November 29, 2022 14:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants