Skip to content
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

Critical vulnerability in difficulty retarget algo #274

Closed
xiphon opened this issue Mar 16, 2018 · 3 comments
Closed

Critical vulnerability in difficulty retarget algo #274

xiphon opened this issue Mar 16, 2018 · 3 comments

Comments

@xiphon
Copy link

xiphon commented Mar 16, 2018

Hello, i'm running FairPool ETP mining pool https://etp.fairpool.xyz.
15 Mar 2018 i've noticed some strange activity on the blockchain.

This looks like a critical flaw in the ETP difficulty retarget algo:

Is possible to lower the diff below the real expected value, supplying the blockchain with the blocks with altered timestamp set to
previous block timestamp + 24 sec

https://github.com/mvs-org/metaverse/blob/master/src/lib/blockchain/validate_block.cpp#L301

bool validate_block::is_valid_time_stamp(uint32_t timestamp) const
{ 
    // Use system clock because we require accurate time of day.
    typedef std::chrono::system_clock wall_clock;
    const auto block_time = wall_clock::from_time_t(timestamp);
    const auto two_hour_future = wall_clock::now() + time_stamp_window;
    return block_time <= two_hour_future;
}

https://github.com/mvs-org/metaverse/blob/master/src/lib/consensus/common/libdevcore/BasicType.cpp#L148

    static uint32_t time_config{24};
...
    if(_bi.timestamp >= _parent.timestamp + time_config)
    {
		target = _parent.bits - (_parent.bits/1024);
@aleqx
Copy link

aleqx commented Mar 16, 2018

Are blocks then being orphaned? What's up with the diff dropping 4x in a matter of hours - or is that unrelated?

@betachen
Copy link
Member

5c10ed0

@betachen
Copy link
Member

see https://docs.mvs.org/news/

@betachen betachen closed this as completed Jun 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants