UNOMP / node-merged-pool

High performance Stratum poolserver in Node.js
GNU General Public License v2.0
77 stars 119 forks source link

Add SegWit support #4

Closed jameshilliard closed 7 years ago

jameshilliard commented 7 years ago

This is an initial attempt at adding SegWit support, it appears to mine valid blocks on testnet. I mined these two blocks which contain SegWit transactions: https://www.blocktrail.com/tBTC/block/0000000000001117c46477e777a76c77857187d97aca5d0f621b29ed7dd45625 https://www.blocktrail.com/tBTC/block/00000000000017db788821b7e36f89c670b14888c3a946d8efdc72963115d755

ahmedbodi commented 7 years ago

NACK! This is going to break POS coin support. There needs to be a config option which specifies something like segWitEnabled: true. if so then use this code, otherwise the old stuff

jameshilliard commented 7 years ago

@ahmedbodi how would this affect POS coins? the witness commitment does not get inserted unless the node specifically requests it in the GBT response

ahmedbodi commented 7 years ago

the GBT call, Old POS coins (even new ones really) expect the gbt call to pass nothing as params. This passes the whole rules and other stuff

jameshilliard commented 7 years ago

@ahmedbodi what about "capabilities"?

btcdrak commented 7 years ago

@jameshilliard Please rebase.

This patch is working on mainnet, the following blocks were mined using this PR

http://explorer.litecoin.net/block/92f1efabbac74a0362a900aaf85b9419b8ef7daa2f7a347d5b917caf402a5ac7 http://explorer.litecoin.net/block/e2ce3731d61cc4c918fb76a1f46755a3ea05298e93f69b80ac96b85e03be04a4

jameshilliard commented 7 years ago

rebased

Infernoman commented 7 years ago

Going to make a slight change to this, cleaning up the second getblocktemplate for peercoin, and segwit. keep an eye out on the next commit.

Infernoman commented 7 years ago

https://github.com/UNOMP/node-merged-pool/commit/c79e829d151fc90dfb2cff0399b995d76e2ce036

jstefanop commented 7 years ago

@Infernoman Just to confirm, this patch will signal segwit blocks if I mine them? Thinking about setting up a pool to help Litecoin activate segwit. Any issues with merge mining segwit blocks with other coins?