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

Error in Ethereum Classic difficulty calculation? #10118

Closed
cseberino opened this issue Dec 31, 2018 · 5 comments
Closed

Error in Ethereum Classic difficulty calculation? #10118

cseberino opened this issue Dec 31, 2018 · 5 comments
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

Comments

@cseberino
Copy link

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

@jam10o-new
Copy link
Contributor

Is this still an issue on a recent (supported) release of parity? This has very likely already been addressed since 1.11.8, which has been EOL for a long while now. I'd imagine #9328, has already addressed this.

Please reopen if this is still an issue with a recent version of parity.

@jam10o-new jam10o-new added Z7-duplicate 🖨 Issue is a duplicate. Closer should comment with a link to the duplicate. Z3-stale 🍃 Issue is in principle valid, but it is not relevant anymore or can not reproduced. labels Dec 31, 2018
@jam10o-new
Copy link
Contributor

Likely duplicate #8397 (comment)

@5chdn
Copy link
Contributor

5chdn commented Jan 2, 2019

@cseberino please upgrade to 2.1.10 or 2.2.5!

@cseberino
Copy link
Author

cseberino commented Jan 2, 2019 via email

@jam10o-new
Copy link
Contributor

jam10o-new commented Jan 2, 2019

2.1.10 is stable @cseberino, you've already updated as per the other issue you made, dw

@5chdn 5chdn added this to the 2.3 milestone Jan 2, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
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.
Projects
None yet
Development

No branches or pull requests

3 participants