Skip to content
This repository was archived by the owner on Nov 6, 2020. It is now read-only.
This repository was archived by the owner on Nov 6, 2020. It is now read-only.

Error in Ethereum Classic difficulty calculation? #10118

@cseberino

Description

@cseberino

Parity version: 1.11.8 installed from Linux Ubuntu 18.04 package
Linux Ubuntu 18.04.1
fully synchonized on Ethereum Classic network

Parity 1.11.8 gives a difficulty of 0x7048c3a85d98 for ETC block 7116609
but I'm thinking if it should be 0x7048c3a85d95.

I've discussed with leader of ETCDEV and get the 0x7048c3a85d95 value in both Java and Python code.

Here is how we calculated 0x7048c3a85d95.....


import java.math.BigInteger;

public class Diff {

public static BigInteger calc(BigInteger dp, long sec) {
return dp
.add(dp.multiply(BigInteger.valueOf(1 - sec / 10))
.divide(BigInteger.valueOf(2048)));
}

public static final void main(String[] args) {
System.out.println(calc(new BigInteger("709d39938c3e", 16), 72).toString(16));
System.out.println(calc(new BigInteger("709d39938c3e", 16), 71).toString(16));
System.out.println(calc(new BigInteger("709d39938c3e", 16), 73).toString(16));
}

}


% javac Diff.java
% java Diff
7048c3a85d95
7048c3a85d95
7048c3a85d95

Metadata

Metadata

Assignees

No one assigned

    Labels

    Z3-stale 🍃Issue is in principle valid, but it is not relevant anymore or can not reproduced.Z7-duplicate 🖨Issue is a duplicate. Closer should comment with a link to the duplicate.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions