This repository has been archived by the owner on Nov 6, 2020. It is now read-only.
Error in Ethereum Classic difficulty calculation? #10118
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.
Milestone
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
The text was updated successfully, but these errors were encountered: