dashpay / dash

Dash - Reinventing Cryptocurrency
https://www.dash.org
MIT License
1.49k stars 1.2k forks source link

Implement watchdog-compatible solution for migration period #1160

Closed UdjinM6 closed 6 years ago

UdjinM6 commented 7 years ago

My attempt in #1156 was not very good, need to find a better way to fix it either using existing sporks or introducing a new one or maybe even smth else.

tgflynn commented 7 years ago

Just to be sure I fully understand the issue, this problem is only for masternode payments, right ?

I mean that's the only effect of watchdog's that can lead to a fork during migration, as far as I know.

UdjinM6 commented 7 years ago

Yes, to keep the winners list consistent during migration we need to make sure that watchdogs do not break it (which looks like a possible outcome now). But maybe I'm trying to fix what is not broken :) IsBlockPayeeValid should accept any payee when SPORK_8_MASTERNODE_PAYMENT_ENFORCEMENT is off so simply turning it off for migration period should fix it - one part of network will chose one list of winners, the other will chose some different one and this situation will continue until majority of masternodes are updated. Then we can switch SPORK_8_MASTERNODE_PAYMENT_ENFORCEMENT back on and... done. This sounds like the safest solution (from fork probability perspective) but usually this means a period of instability in mn payments because of list inconsistency (+rogue miners can collect masternode payments not paying masternodes at all) so leaving this spork off for a long time is not a good idea in general.

tgflynn commented 7 years ago

Aside from the watchdog issue do we need to turn spork 8 off during the migration ?

My impression from looking at IsBlockPayeeValid is that this should not be necessary.

If so it would probably be better to add a new spork to allow WATCHDOG_EXPIRED masternodes to be paid.

Otherwise if we must turn off spork 8 during the transition anyway then there is probably no advantage to adding a new spork.

UdjinM6 commented 6 years ago

Fixed by #1163