Skip to content

Conversation

@sipa
Copy link
Member

@sipa sipa commented Nov 18, 2016

As a consistency check, it is useful to see whether GBT clients are ready for segwit deployment before segwit is actually used on the network (and even before it activates).

The earlier behaviour only inserted a default_witness_commitment field in the GBT response whenever actual witness transactions were present. This PR changes it to do whenever 1) the GBT client claims to support segwit and 2) a segwit softfork is defined (which is effectively always in the current codebase, but may not be true for backports).

@sipa sipa force-pushed the alwayscommit branch 2 times, most recently from 04a1ba9 to 26af85c Compare November 18, 2016 20:36
@theuni
Copy link
Member

theuni commented Nov 18, 2016

Concept ACK. Will test this on some live pools using #9000.

txCoinbase.vin[0].scriptSig = CScript();
txCoinbase.vin[0].scriptSig.push_back(blockinfo[i].extranonce);
txCoinbase.vin[0].scriptSig.push_back(chainActive.Height());
txCoinbase.vout.resize(1);
Copy link
Member

Choose a reason for hiding this comment

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

I'd forgotten how this test worked and it took me a little while to track down why this is needed. In case other reviewers are wondering: the blocks generated here won't have valid proof-of-work if we change the contents, because of the hardcoded nonces up above.

@sdaftuar
Copy link
Member

ACK. Tested with some hacks to p2p-segwit.py to verify that the default_witness_commitment is correct (afaik there was no explicit test for this before(?)), and that it is only produced if the segwit softfork is defined and the client specifies the segwit rule in the gbt call.

@sipa
Copy link
Member Author

sipa commented Nov 18, 2016 via email

@gmaxwell
Copy link
Contributor

Concept ACK, looking forward to hearing back poolserver test results. It would be good to try a mutation test with that harness Suhas mentioned.

@gmaxwell
Copy link
Contributor

This should be tagged for backport.

@maflcko maflcko added this to the 0.13.2 milestone Nov 19, 2016
@sdaftuar
Copy link
Member

@sipa I tried to clean up my hacks but this is still on the quick&dirty side of things, but maybe useful for others to continue testing: sdaftuar@cdafaad

@gmaxwell
Copy link
Contributor

@sipa needs rebase

@sipa
Copy link
Member Author

sipa commented Nov 21, 2016

Rebased.

@theuni
Copy link
Member

theuni commented Nov 22, 2016

Tested ACK, works as intended.

Unfortunately though, several pool implementations only check for default_witness_commitment if they receive the segwit rule. I'll work on upstreaming patches for insertion any time default_witness_commitment is present.

@gmaxwell
Copy link
Contributor

ACK.

@laanwj laanwj merged commit 95f4a03 into bitcoin:master Nov 25, 2016
laanwj added a commit that referenced this pull request Nov 25, 2016
…pport

95f4a03 [qa] Test getblocktemplate default_witness_commitment (Suhas Daftuar)
ad04d1c Always add default_witness_commitment with GBT client support (Pieter Wuille)
@laanwj laanwj mentioned this pull request Dec 2, 2016
@laanwj
Copy link
Member

laanwj commented Dec 2, 2016

Backported in #9264, removing tag.

laanwj pushed a commit to laanwj/bitcoin that referenced this pull request Dec 2, 2016
laanwj pushed a commit to laanwj/bitcoin that referenced this pull request Dec 2, 2016
@laanwj laanwj added the P2P label Dec 19, 2016
@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