Skip to content

Conversation

@sdaftuar
Copy link
Member

@sdaftuar sdaftuar commented Oct 20, 2017

I think #11407 broke replace-by-fee by introducing a race condition. I was observing frequent failures of replace-by-fee locally, always with a mempool sync failure (the sync call was added in #11407).

It appeared to me like there were two causes: sometimes the node would be in IBD and not request the transaction that was relayed; other times the blocks generated in make_utxo wouldn't have relayed quickly enough for the spend of the transaction to be accepted. I believe I've fixed both potential errors.

ping @instagibbs

Edit: I found a race condition in the sendheaders.py test, where if the verack from the python node wasn't processed before the first block in the test was generated, then no block announcement would go out to that peer, breaking the test. Fixed by adding a sync_with_ping after waiting for verack.

@sdaftuar sdaftuar changed the title qa: Fix replace-by-fee race condition failures qa: Fix race condition failures in replace-by-fee.py, sendheaders.py Oct 20, 2017
@sdaftuar
Copy link
Member Author

@fanquake fanquake added the Tests label Oct 20, 2017
Copy link
Member

@instagibbs instagibbs left a comment

Choose a reason for hiding this comment

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

utACK

def run_test(self):
# Leave IBD and ensure nodes are synced
self.nodes[0].generate(1)
self.sync_all()
Copy link
Member

Choose a reason for hiding this comment

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

maybe stick the sync_call after the first make_utxo on line 79, just to be sure in the future?

Copy link
Member Author

Choose a reason for hiding this comment

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

Sounds good, done.

@maflcko
Copy link
Member

maflcko commented Oct 21, 2017

utACK eb0064be6f33c3d0015d84be38eee4f7256d943b

@maflcko maflcko added this to the 0.15.1 milestone Oct 21, 2017
@jonasschnelli
Copy link
Contributor

utACK eb0064be6f33c3d0015d84be38eee4f7256d943b

@sdaftuar sdaftuar force-pushed the 2017-10-fix-rbf-test branch from eb0064b to 6d51eae Compare October 23, 2017 12:55
@jnewbery
Copy link
Contributor

tested ACK 6d51eae

maflcko pushed a commit to maflcko/bitcoin-core that referenced this pull request Oct 23, 2017
maflcko pushed a commit to maflcko/bitcoin-core that referenced this pull request Oct 23, 2017
@maflcko maflcko merged commit 6d51eae into bitcoin:master Oct 23, 2017
maflcko pushed a commit that referenced this pull request Oct 23, 2017
…endheaders.py

6d51eae qa: Fix race condition in sendheaders.py (Suhas Daftuar)
c96b2e4 qa: Fix replace-by-fee race condition failures (Suhas Daftuar)

Pull request description:

  I think #11407 broke replace-by-fee by introducing a race condition.  I was observing frequent failures of replace-by-fee locally, always with a mempool sync failure (the sync call was added in #11407).

  It appeared to me like there were two causes: sometimes the node would be in IBD and not request the transaction that was relayed; other times the blocks generated in make_utxo wouldn't have relayed quickly enough for the spend of the transaction to be accepted.  I believe I've fixed both potential errors.

  ping @instagibbs

  Edit: I found a race condition in the sendheaders.py test, where if the verack from the python node wasn't processed before the first block in the test was generated, then no block announcement would go out to that peer, breaking the test.  Fixed by adding a sync_with_ping after waiting for verack.

Tree-SHA512: 6ad160966e432c151c1ce6e88ae67e60e47123523bda3755cf7697a00e1a5ba38de8561751826e3d7cf0e492f8c2aec298e1b4de8424ebbaf497f099a1ef1d07
@fanquake
Copy link
Member

fanquake commented Nov 1, 2017

Backported in #11550

codablock added a commit to codablock/dash that referenced this pull request Sep 30, 2019
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants