fixed blocks coming in too fast on testnet #253

Merged
BrannonKing merged 2 commits from fix_testnet_too_fast into master 2019-02-11 21:25:36 +01:00
BrannonKing commented 2019-02-09 00:13:21 +01:00 (Migrated from github.com)

When we get a delayed block, we thereafter knock the difficulty so low that it takes multiple (up to a 100) blocks to get back up to sufficient difficulty. It doesn't make sense for us to do this as we already adjust difficulty every block.

When we get a delayed block, we thereafter knock the difficulty so low that it takes multiple (up to a 100) blocks to get back up to sufficient difficulty. It doesn't make sense for us to do this as we already adjust difficulty every block.
bvbfan (Migrated from github.com) reviewed 2019-02-09 00:13:21 +01:00
lbrynaut (Migrated from github.com) reviewed 2019-02-09 01:10:55 +01:00
lbrynaut (Migrated from github.com) commented 2019-02-09 01:10:55 +01:00

Move both fork heights to chainparams

Move both fork heights to chainparams
lbrynaut (Migrated from github.com) reviewed 2019-02-09 01:14:16 +01:00
lbrynaut (Migrated from github.com) commented 2019-02-09 01:14:16 +01:00

I agree it hasn't worked properly, but I think returning the difficulty back to something sane is better than letting testnet potentially get stuck. The entire point of the testnet is to make testing easier/possible, so the extra headache if ever stuck is just an added barrier. Doing nothing arguably allows easy testing (and mining) to continue as well.

I agree it hasn't worked properly, but I think returning the difficulty back to something sane is better than letting testnet potentially get stuck. The entire point of the testnet is to make testing easier/possible, so the extra headache if ever stuck is just an added barrier. Doing nothing arguably allows easy testing (and mining) to continue as well.
lbrynaut (Migrated from github.com) reviewed 2019-02-09 01:17:41 +01:00
lbrynaut (Migrated from github.com) commented 2019-02-09 01:17:41 +01:00

What's the point here? I'd actually think that all of this could probably be removed since we re-target every block and our full period is constant.

What's the point here? I'd actually think that all of this could probably be removed since we re-target every block and our full period is constant.
BrannonKing (Migrated from github.com) reviewed 2019-02-09 05:14:19 +01:00
BrannonKing (Migrated from github.com) commented 2019-02-09 05:14:19 +01:00

They only apply to testnet (because that's the only one with fPowAllowMinDifficultyBlocks enabled). Still think it's worth it?

They only apply to testnet (because that's the only one with fPowAllowMinDifficultyBlocks enabled). Still think it's worth it?
BrannonKing (Migrated from github.com) reviewed 2019-02-09 05:18:37 +01:00
BrannonKing (Migrated from github.com) commented 2019-02-09 05:18:37 +01:00

It's allowed to move by an eighth (12.5%) every block. You can travel a long way in half an hour -- something most people could tolerate. Something sane might be the median of the past 50 blocks; it could get complicated.

Judging form the numbers I was seeing, though, there are miners going in and out of this often. I don't know why that is. I know that our testnet servers are on shared machines; maybe their resources fluctuate significantly. Or maybe the addition of a third person is sporadic but not uncommon.

It's allowed to move by an eighth (12.5%) every block. You can travel a long way in half an hour -- something most people could tolerate. Something sane might be the median of the past 50 blocks; it could get complicated. Judging form the numbers I was seeing, though, there are miners going in and out of this often. I don't know why that is. I know that our testnet servers are on shared machines; maybe their resources fluctuate significantly. Or maybe the addition of a third person is sporadic but not uncommon.
BrannonKing (Migrated from github.com) reviewed 2019-02-09 05:21:41 +01:00
BrannonKing (Migrated from github.com) commented 2019-02-09 05:21:41 +01:00

Yes, it's only effective the very first time its hit (on the block right after genesis). We could special-case that block, but that would be making an assumption that DifficultyAdjustmentInterval returns 1. It does return 1 with our current settings, but if we're going to go down that road we might want to eliminate the parameters. And after working on this, I think that adjusting difficulty every block is unwise. It's too noisy, too prone to simple CPU fluctuations.

Yes, it's only effective the very first time its hit (on the block right after genesis). We could special-case that block, but that would be making an assumption that DifficultyAdjustmentInterval returns 1. It does return 1 with our current settings, but if we're going to go down that road we might want to eliminate the parameters. And after working on this, I think that adjusting difficulty every block is unwise. It's too noisy, too prone to simple CPU fluctuations.
lbrynaut (Migrated from github.com) reviewed 2019-02-10 20:17:17 +01:00
lbrynaut (Migrated from github.com) commented 2019-02-10 20:17:17 +01:00

Yes, all forks should be documented/handled there. The params in the other networks could be anything (i.e. 0 or 1 or whatever) since it should never apply.

Yes, all forks should be documented/handled there. The params in the other networks could be anything (i.e. 0 or 1 or whatever) since it should never apply.
lbrynaut (Migrated from github.com) reviewed 2019-02-10 20:19:56 +01:00
lbrynaut (Migrated from github.com) commented 2019-02-10 20:19:56 +01:00

Unwise or not, that's how the network operates. I don't think it's any wiser to fork for a modification here, especially since mainnet has been running more or less sanely (i.e. nothing is broken at the moment). And it's even less sane to do different retarget periods for testnet than for mainnet.

Unwise or not, that's how the network operates. I don't think it's any wiser to fork for a modification here, especially since mainnet has been running more or less sanely (i.e. nothing is broken at the moment). And it's even less sane to do different retarget periods for testnet than for mainnet.
BrannonKing (Migrated from github.com) reviewed 2019-02-11 16:48:50 +01:00
BrannonKing (Migrated from github.com) commented 2019-02-11 16:48:49 +01:00

Yes, the cap on the block height should make testnet and mainnet the same again. And I agree that a fork to make us not readjust difficulty every block is likely not worth it.

Yes, the cap on the block height should make testnet and mainnet the same again. And I agree that a fork to make us not readjust difficulty every block is likely not worth it.
BrannonKing (Migrated from github.com) reviewed 2019-02-11 19:59:33 +01:00
BrannonKing (Migrated from github.com) commented 2019-02-11 19:59:33 +01:00

Fixed.

Fixed.
BrannonKing (Migrated from github.com) reviewed 2019-02-11 20:00:07 +01:00
BrannonKing (Migrated from github.com) commented 2019-02-11 20:00:07 +01:00

I left my min call in as I think it's much more clear than what was there before, but feel free to revisit this in the upstream merge.

I left my `min` call in as I think it's much more clear than what was there before, but feel free to revisit this in the upstream merge.
bvbfan commented 2019-02-11 20:20:57 +01:00 (Migrated from github.com)

I'm OK with changes, let's @lbrynaut makes final review.

I'm OK with changes, let's @lbrynaut makes final review.
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: LBRYCommunity/lbrycrd#253
No description provided.