Skip to content

Conversation

@random-zebra
Copy link

Extracted from #2267.
This backports bitcoin#9208.
As highlighted by zcash/zcash#2951, this "performance improvement" actually includes a fix for the following bug:

Currently, AcceptToMemoryPool is called inside DisconnectTip after the block has been disconnected, but before chainActive has been updated. This means that height-dependent consensus rules are checked assuming the height is one greater than it actually is, which is a problem when disconnecting the last block before a network upgrade (e.g. during a reorg across the upgrade boundary).

This has additional consequences with special transactions (that's why it was discovered in #2267), as, during a reorg, ProUp* transactions, included in the block, might not be resurrected in the mempool, due to the inconsistent state of chainActive.

furszy
furszy previously approved these changes Mar 30, 2021
Copy link

@furszy furszy left a comment

Choose a reason for hiding this comment

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

nice finding, ACK b80ec44

@random-zebra random-zebra requested a review from Fuzzbawls April 1, 2021 20:45
>>> adapts bitcoin#9208

Rather than re-add disconnected block transactions back to the mempool
immediately, store them in a separate disconnectpool for later
processing,
because we expect most such transactions to reappear in the chain that
is
still to be connected (and thus we can avoid the work of reprocessing
those
transactions through the mempool altogether).
@random-zebra
Copy link
Author

Rebased, fixing conflict with #2290 just merged.

Copy link

@furszy furszy left a comment

Choose a reason for hiding this comment

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

re-ACK 2ae953a.
It will have small conflicts with #2295.

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 2ae953a

@random-zebra random-zebra merged commit af984e1 into PIVX-Project:master Apr 6, 2021
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.

3 participants