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

mempool: add additional test case for inherited RBF replacement #1719

Merged
merged 1 commit into from May 13, 2021

Conversation

Roasbeef
Copy link
Member

@Roasbeef Roasbeef commented May 13, 2021

In this commit, we add an additional test case for inherited RBF
replacement. This test case asserts that if a parent is marked as being
replaceable, but the child isn't, then the child can still be replaced
as according to BIP 125 it shoudl inhreit the replaceability of its
parent.

The addition of this test case was prompted by the recently discovered
Bitcoin Core "CVE" 1. It turns out that bitcoind doesn't properly
implement BIP 125. Namely it fails to allow a child to "inherit"
replaceability if its parent is also replaceable. Our implementation
makes this trait rather explicit due to its recursive implementation.
Kudos to the original implementer @wpaulino for getting this correct.

In this commit, we add an additional test case for inherited RBF
replacement. This test case asserts that if a parent is marked as being
replaceable, but the child isn't, then the child can still be replaced
as according to BIP 125 it shoudl _inhreit_ the replaceability of its
parent.

The addition of this test case was prompted by the recently discovered
Bitcoin Core "CVE" [1]. It turns out that bitcoind doesn't properly
implement BIP 125. Namely it fails to allow a child to "inherit"
replaceability if its parent is also replaceable. Our implementation
makes this trait rather explicit due to its recursive implementation.
Kudos to the original implementer @wpaulino for getting this correct.

[1]: https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2021-May/018893.html.
@Roasbeef Roasbeef force-pushed the bip125-inherited-replacement branch from 24c3bf0 to 8719039 Compare May 13, 2021 00:55
@coveralls
Copy link

coveralls commented May 13, 2021

Pull Request Test Coverage Report for Build 837379354

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 5 unchanged lines in 2 files lost coverage.
  • Overall coverage increased (+17.7%) to 70.569%

Files with Coverage Reduction New Missed Lines %
integration/rpctest/blockgen.go 2 83.67%
peer/peer.go 3 76.18%
Totals Coverage Status
Change from base Build 832959433: 17.7%
Covered Lines: 14749
Relevant Lines: 20900

💛 - Coveralls

Copy link
Member

@jcvernaleo jcvernaleo left a comment

Choose a reason for hiding this comment

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

Looks great!
OK

@onyb
Copy link
Collaborator

onyb commented May 13, 2021

Doesn't need any addition to the release notes (#1706) I suppose.

@jcvernaleo jcvernaleo added this to the 0.22.0 milestone May 13, 2021
@jcvernaleo jcvernaleo added this to In progress / Awaiting changes in btcd-dev via automation May 13, 2021
@jcvernaleo jcvernaleo merged commit ee5896b into btcsuite:master May 13, 2021
btcd-dev automation moved this from In progress / Awaiting changes to Done May 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
btcd-dev
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

5 participants