-
Notifications
You must be signed in to change notification settings - Fork 38.8k
BIP9 versionbits softfork for BIP68, BIP112 and BIP113 #7648
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
Conversation
dc0f10a to
e99ce43
Compare
c9b879c to
89acee3
Compare
This commit introduces a way to gracefully bump the default transaction version in a two step process.
This RPC test will test both the activation mechanism of the first versionbits soft fork as well as testing many code branches of the consensus logic for BIP's 68, 112, and 113.
89acee3 to
19d73d5
Compare
|
Rebase now that #7575 has been merged. |
|
ACK 19d73d5 |
|
Can you add my commit, btcdrak#8 the current test does not cover exactly the activation part, I'm not comfortable with it. My test can be used for testing segwit activation later also in few lines. |
|
tACK 71527a0 |
|
utACK 71527a0 |
|
tACK 71527a0 |
|
Concept ACK, utACK code changes; I only glanced over the test code |
|
nit: The new RPC test is very noisy. Printing lines for passing tests is not necessary, at least by default, could be behind some verbose flag: |
|
@laanwj yeah, I noticed that too. Unfortunately, that's the underlying behavior of the ComparisonTestFramework that the RPC test is built off of. I agree it would be nice to make optional. EDIT: I suppose it would be easy to just always surpress the |
|
ACK |
|
ACK code changes, ran tests but did not review test code. |
|
|
||
| #Tests | ||
| testScripts = [ | ||
| 'bip68-112-113-p2p.py', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be an "extended test"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no, this is a softfork and certainly until there is activation, I want to test for regressions as a standard part of the CI process.
|
ACK 71527a0 |
|
|
||
| enum DeploymentPos | ||
| { | ||
| DEPLOYMENT_TESTDUMMY, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: probably to late now and kinda-unrelated to this PR, but instead of TESTDUMMY we could have used something like DEFAULT or DEFAULTVOID.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not added in PR though. That was #7575. I think the name is sufficient though, to indicate it's not a real softfork, but for testing purposes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair enough.
|
Tested ACK 71527a0 |
|
utACK (although I didn't look at the rpc tests in depth ). |
|
I saw there was some discussion of this already (btcdrak#8), but I don't really see the point of the Also perhaps we should remove the code in bitcoin/qa/rpc-tests/bip68-sequence.py Line 337 in 5131005
bip68-112-113-p2p.py is comprehensively testing that BIP68 activates in the right way.
|
| return row | ||
| raise IndexError ('key:"%s" not found' % key) | ||
|
|
||
| def create_bip68txs(self, bip68inputs, txversion, locktime_delta = 0): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: locktime_delta appears to be unused in this function
|
@sdaftuar as explained in btcdrak#8 the test has a different purpose than bip68-112-113-p2p.py. All bip are generally tested in their own PR, bip68-112-113-p2p.py is doing test that are already done but also testing the sf activation logic. This expand way more than the subject of this PR. softforks.py has a different purpose, it is here to test ONLY the sf activation logic. This basically mean that in future softfork, you can test the activation correctly by adding a single line at https://github.com/bitcoin/bitcoin/pull/7648/files#diff-98a8abf7f80dbe5eda93bbbbb4348e80R190 . For example, testing any new segwit sf activation will only be a matter of adding a function which change the scriptPubKey to be push. The test is meant to make testing sf soft fork logic activation of future sf a breeze. |
|
|
| assert_equal(self.get_bip9_status(bipName)['status'], 'locked_in') | ||
|
|
||
| # Test 5 | ||
| # Check that the new rule is enforced |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: I think this comment should say # Check that the new rule is not enforced ?
|
I left some comment nits in the RPC test, I also manually tested the case that is mentioned as being missing from ACK 71527a0 @btcdrak To be clear, I'm not talking about removing the entire |
|
tACK 71527a0 |
Issues with the tests, unless they pinpoint issues in the code, or break Travis, should not hold up this pull. They can be fixed later. |
|
@petertodd You said in #7184 (comment) that you wanted some nits addressed before this (the BIP68 part) would be acceptable as a softfork to you. Could you take a look whether this is the case now? |
|
utACK 71527a0 |
71527a0 Test of BIP9 fork activation of mtp, csv, sequence_lock (NicolasDorier) 19d73d5 Add RPC test for BIP 68/112/113 soft fork. (Alex Morcos) 12c89c9 Policy: allow transaction version 2 relay policy. (BtcDrak) 02c2435 Soft fork logic for BIP68 (BtcDrak) 478fba6 Soft fork logic for BIP113 (BtcDrak) 65751a3 Add CHECKSEQUENCEVERIFY softfork through BIP9 (Pieter Wuille)
…ftfork for BIP68, BIP112 and BIP113'
General
This PR softforks 3 lock-time related BIPs which are all implemented in
masteras mempool-only logic at the moment.Dependencies
Relay policy for BIP113
BIP113 mempool-only policy was deployed with Bitcoin Core 0.11.2 at the same time as the BIP65 CLTV softfork so the policy is in wide use (at least 70% of nodes) as well as all the miners who upgraded to 0.11.2.
Relay policy for v2 transactions
BIP68/112 rely on v2 transactions. Currently only v1 transactions are relayed, so it is necessary to change the relay policy to allow v2. This will be done at the same time as softfork deployment and will have the net effect that once the softfork enforces, we can be pretty sure miners will mine v2 transactions.
At a later date once enough nodes upgrade and we're sure v2 transaction will be relayed efficiently, we can bump the default transaction version in core see #7562.