Skip to content
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

Fix mempool packages #6715

Merged
merged 2 commits into from Sep 24, 2015
Merged

Fix mempool packages #6715

merged 2 commits into from Sep 24, 2015

Conversation

@sdaftuar
Copy link
Member

sdaftuar commented Sep 23, 2015

This fixes an edge case (introduced by #6654 and reported by @sipa here: #6654 (comment)) in removing an entry from the mempool during the middle of a reorg, where the entry has an in-block ancestor which has not yet had its descendant state updated for the transaction being removed.

The first commit updates the mempool_packages.py rpc-test to include a test that demonstrates the bug; the second commit provides a fix.

@laanwj laanwj added the Bug label Sep 23, 2015
@sdaftuar sdaftuar force-pushed the sdaftuar:fix-mempool-packages branch Sep 23, 2015
CalculateMemPoolAncestors was always looping over a transaction's inputs
to find in-mempool parents.  When adding a new transaction, this is the
correct behavior, but when removing a transaction, we want to use the
ancestor set that would be calculated by walking mapLinks (which should
in general be the same set, except during a reorg when the mempool is
in an inconsistent state, and the mapLinks-based calculation would be the
correct one).
@sdaftuar sdaftuar force-pushed the sdaftuar:fix-mempool-packages branch to 60de0d5 Sep 23, 2015
@morcos
Copy link
Member

morcos commented Sep 23, 2015

ACK

@btcdrak
Copy link
Contributor

btcdrak commented Sep 23, 2015

utACK

@0x9F
Copy link

0x9F commented Sep 24, 2015

Tested. Passes in a previously crashing situation.

@laanwj laanwj merged commit 60de0d5 into bitcoin:master Sep 24, 2015
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
laanwj added a commit that referenced this pull request Sep 24, 2015
60de0d5 Fix mempool package tracking edge case (Suhas Daftuar)
598b25d Add test showing bug in mempool packages (Suhas Daftuar)
@laanwj
Copy link
Member

laanwj commented Sep 24, 2015

utACK

random-zebra added a commit to PIVX-Project/PIVX that referenced this pull request Jul 6, 2020
830eadf Solving rpc_fundrawtransaction.py amount rounding issue. (furszy)
6cf9778 ATMP: Do not try to get the inputs in zc tx. (furszy)
38efbb9 sync_blocks: Increase debugging to hunt down mempool_reorg intermittent failure (furszy)
dd7855c sync_blocks: check that peer is connected when calling sync_*. (furszy)
bc7d542 functional tests, sync_blocks only cleanup. (furszy)
1ae04e7 Fix mempool package tracking edge case (Suhas Daftuar)
f4052aa Add test showing bug in mempool packages (furszy)
691749f rpc: Accept scientific notation for monetary amounts in JSON (furszy)
b0f9051 Fix removeForReorg to use MedianTimePast (Suhas Daftuar)
92583c6 Don't call removeForReorg if DisconnectTip fails (Suhas Daftuar)
bb77808 Track coinbase spends in CTxMemPoolEntry (furszy)
f607f18 Change GetPriority calculation. (furszy)
ac3c0f1 Remove default arguments for CTxMemPoolEntry() (furszy)
07eae9f Modify variable names for entry height and priority (furszy)
4356b31 Fix bug in mempool_tests unit test (Alex Morcos)
f35ebe3 removeForReorg calls once-per-disconnect-> once-per-reorg (furszy)
7f5737f Fix comment in removeForReorg (furszy)
8ad82ca Fix removal of time-locked transactions during reorg (furszy)
de74ab3 Move ProcessBlockFound reserveKey to optional. (furszy)

Pull request description:

  More back ports and adaptations over the RPC values parsing and mempool. We need to get closer in this area :) .

  * bitcoin#6379
  * bitcoin#6715
  * bitcoin#6915
  * bitcoin#7007
  * bitcoin#7008
  * bitcoin#12643
  * bitcoin#18474
  * bitcoin#18704

ACKs for top commit:
  Fuzzbawls:
    ACK 830eadf
  random-zebra:
    ACK 830eadf and merging...

Tree-SHA512: 014b31008aaf09ebf838e21da59379a45565df440a77d66a0cd53e824a6d69673d6975d08243a43fb5a7ebd1a35c07d1d07412a87216b42e9d6f17a1c0bc5708
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

5 participants
You can’t perform that action at this time.