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

segwit support #16

Merged
merged 3 commits into from Dec 13, 2016

Conversation

Projects
None yet
5 participants
@theuni
Contributor

theuni commented Nov 29, 2016

Adds support for requesting segwit support in gbt calls, as well as the necessary commitment insertion.

Commitments will be inserted even before segwit activation, so it's possible to verify that the insertion works far in advance.

Compares the calculated commitment to the one provided by bitcoind, if present, as an extra sanity check.

theuni added some commits Apr 2, 2016

Drop getwork call
This has been removed for a while.
segwit: add support for commitment insertion
Rather than trying to de-serialize and re-serialize the transactions coming
from GBT, simply store them as binary and use them directly to form the block.

Also, override CBlock's checks that assume the merkle root represents the full
transaction hashes.
@zsulocal

This comment has been minimized.

Show comment
Hide comment
@zsulocal

zsulocal Dec 1, 2016

BTCC Pool has already tested this PR and submit valid blocks on testnet. Block #1035755 only contains coinbase transaction and #1035760 contains segwit transactions. Apart from these two blocks, all coinbase transaction contain the tag '/BTCC/' , meaning mined by BTCC Pool.

zsulocal commented Dec 1, 2016

BTCC Pool has already tested this PR and submit valid blocks on testnet. Block #1035755 only contains coinbase transaction and #1035760 contains segwit transactions. Apart from these two blocks, all coinbase transaction contain the tag '/BTCC/' , meaning mined by BTCC Pool.

@slush0

This comment has been minimized.

Show comment
Hide comment
@slush0

slush0 Dec 8, 2016

Owner

Thank you for this PR! I'm watching segwit.co closely and if adoption rise near 50% (I hope so), I'll merge this.

Owner

slush0 commented Dec 8, 2016

Thank you for this PR! I'm watching segwit.co closely and if adoption rise near 50% (I hope so), I'll merge this.

@wuhuaping

This comment has been minimized.

Show comment
Hide comment
@wuhuaping

wuhuaping Dec 9, 2016

wuhuaping commented Dec 9, 2016

@jameshilliard

This comment has been minimized.

Show comment
Hide comment
@jameshilliard

jameshilliard Dec 11, 2016

@slush0 FYI bitcoin 0.13.1 won't actually signal for SegWit activation without this patch so it would probably be a good idea to merge before hand.

jameshilliard commented Dec 11, 2016

@slush0 FYI bitcoin 0.13.1 won't actually signal for SegWit activation without this patch so it would probably be a good idea to merge before hand.

@theuni

This comment has been minimized.

Show comment
Hide comment
@theuni

theuni Dec 12, 2016

Contributor

What @jameshilliard said. Pools can't (or shouldn't be) signaling for segwit until they advertise that they can actually produce valid blocks with witnesses.

To be clear, this should have no negative effects on current mainnet mining, even before segwit activates. The commitment insertion is not harmful in either case.

In fact, this PR currently required for using this software on testnet, where segwit is already active. Otherwise, gbt simply refuses to give it a template.

Contributor

theuni commented Dec 12, 2016

What @jameshilliard said. Pools can't (or shouldn't be) signaling for segwit until they advertise that they can actually produce valid blocks with witnesses.

To be clear, this should have no negative effects on current mainnet mining, even before segwit activates. The commitment insertion is not harmful in either case.

In fact, this PR currently required for using this software on testnet, where segwit is already active. Otherwise, gbt simply refuses to give it a template.

@slush0 slush0 merged commit b2a24d7 into slush0:master Dec 13, 2016

@slush0

This comment has been minimized.

Show comment
Hide comment
@slush0

slush0 Dec 13, 2016

Owner

Okay, done. Thanks!

Owner

slush0 commented Dec 13, 2016

Okay, done. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment