mvs-org / metaverse

The Metaverse individual chain service ETP coin and immutable data space for Hyperspace.
https://mvs.org
GNU Affero General Public License v3.0
307 stars 115 forks source link

[request]Mining difficulty adjustment #325

Open luozhaohui opened 6 years ago

luozhaohui commented 6 years ago

Once the difficulty goes up, it takes months to go go down.

Report from kali: screenshot from metaverse.farm some one put 800GH (yes giga hash) solo for 1 hour difficulty jumped from 31 to 35T really quickly (as it should) now look at the difficulty when he is gone, 800GH of extra hashpower gone, and it takes ages to get back to original levels. 8 hours passed since that "1 hour 800GH burst mining" and difficulty is nowhere near the original level.

difficulty_adjustment

baaa commented 6 years ago

This bug is crippling the network... This is a list of block times from today, columns: Block Height - Block Time - Difficulty - Miner

 1571042  97 48.842 Dodopool
 1571043 138 48.794           Unknown(MToecQJZ4ku55yJYAU62ZghExgRWq3phEu)
 1571044  24 48.746           Unknown(MToecQJZ4ku55yJYAU62ZghExgRWq3phEu)
 1571045 818 48.699 Dodopool
 1571046  13 48.746 Dodopool
 1571047  67 48.699           Unknown(MToecQJZ4ku55yJYAU62ZghExgRWq3phEu)
 1571048 131 48.651           Unknown(MToecQJZ4ku55yJYAU62ZghExgRWq3phEu)
 1571049  20 48.699           Unknown(MToecQJZ4ku55yJYAU62ZghExgRWq3phEu)
 1571050  76 48.651 Dodopool
 1571051 158 48.604           Unknown(MToecQJZ4ku55yJYAU62ZghExgRWq3phEu)
 1571052  37 48.556           Unknown(MToecQJZ4ku55yJYAU62ZghExgRWq3phEu)
 1571053  42 48.509 Dodopool
 1571054  69 48.461 Dodopool
 1571055 237 48.414 Dodopool
 1571056  17 48.461           Unknown(MToecQJZ4ku55yJYAU62ZghExgRWq3phEu)
 1571057 337 48.414 Dodopool
 1571058   2 48.461           sandpool.org
 1571059  15 48.509 Dodopool
 1571060 403 48.461           sandpool.org
 1571061  90 48.414           sandpool.org
 1571062   3 48.461 Dodopool
 1571063   9 48.508 Dodopool
 1571064 166 48.461           sandpool.org
 1571065  19 48.508 Dodopool
 1571066  11 48.556 Dodopool
 1571067 117 48.508           sandpool.org
 1571068  19 48.556           sandpool.org
 1571069  38 48.508 Dodopool
 1571070 123 48.461 Dodopool
 1571071  48 48.414 Dodopool
 1571072   4 48.461 Dodopool
 1571073  22 48.508 Dodopool
 1571074  31 48.461 Dodopool
 1571075 189 48.414 Dodopool
 1571076  68 48.366           sandpool.org
 1571077  67 48.319 Dodopool
 1571078  11 48.366 Dodopool
 1571079   5 48.413 Dodopool
 1571080 111 48.366 Dodopool
 1571081 301 48.319 Dodopool
 1571082  81 48.272           sandpool.org
 1571083 103 48.225 Dodopool
betachen commented 5 years ago

Change as:

if(_bi.number < FORKBLOCK)                                                 
    {                                                                          
        if(_bi.timestamp >= _parent.timestamp + time_config)                   
        {                                                                      
            target = _parent.bits - (_parent.bits/1024);                       
        } else {                                                               
            target = _parent.bits + (_parent.bits/1024);                               }                                                                      
    } else  { 
        bigint const interval = (bigint)(_bi.timestamp-_parent.timestamp);     
        bigint const adjustvalue= max<bigint>(2 - interval /10 ,-99);          
        target = _parent.bits + _parent.bits/2048*adjustvalue;                 
    }
codrush commented 5 years ago

Refers to https://github.com/ethereum/aleth/blob/master/libethcore/SealEngine.cpp#L177

canguruhh commented 4 years ago

Whats the status of this issue?