-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Stage 1 block verification failed for c913…53da: Block(InvalidProofOfWork(OutOfBounds { min: Some(307293), max: None, found: 307292 })) #8397
Comments
That's clearly a consensus issue between Geth and Parity. How did you configure the chains? |
Thanks @5chdn , I used pretty much standard Puppeth setup. I believe if you try to setup it and leave it for prolonged periods sooner or later you should get the same problem. BTW, only one Geth node was mining in the entire network. |
I'm having this same issue as well. Using geth genesis.json
parity genesis file
After I get the following message:
It'll keep trying to sync block #129258 and then drop peers. |
Please follow the instructions here: https://dev.to/5chdn/solving-the-problem-with-ethereum-cross-client-private-networks |
@5chdn could you tell why is it closed? The problem is not with the setup (chains runs correctly for hundreds of thousands of blocks), but it stops at some point with the error described above. |
It's a problem with the setup but it's only triggered with some transaction in a certain block. It's really hard to tell from my chair what can cause this. The best would be to cleanly setup a new network based on the learnings I shared in the article linked above. |
Thanks @5chdn. It's interesting as the configs were generated with Puppeth. So it means we should open a ticket at |
Sounds reasonable. |
Parity's PoW validation is wrong. /// Convert an Ethash boundary to its original difficulty. Basically just `f(x) = 2^256 / x`.
pub fn boundary_to_difficulty(boundary: &H256) -> U256 {
let d = U256::from(*boundary);
if d <= U256::one() {
U256::max_value()
} else {
((U256::one() << 255) / d) << 1
}
}
/// Convert an Ethash difficulty to the target boundary. Basically just `f(x) = 2^256 / x`.
pub fn difficulty_to_boundary(difficulty: &U256) -> H256 {
if *difficulty <= U256::one() {
U256::max_value().into()
} else {
(((U256::one() << 255) / *difficulty) << 1).into()
}
} Both these calculations truncate the last bit. This means, that blocks with odd difficulty values get validated by Parity as if the difficulty was one less. This is the reason why the blocks are rejected. Go repro: package main
import (
"fmt"
"math/big"
)
func main() {
difficulty := int64(307293)
fmt.Printf("Source difficulty: %v\n", difficulty)
// Geth
two256 := new(big.Int).Exp(big.NewInt(2), big.NewInt(256), big.NewInt(0))
fmt.Printf("Geth diff->boundary->diff: %v\n", new(big.Int).Div(two256, new(big.Int).Div(two256, big.NewInt(difficulty))))
// Parity
boundary := big.NewInt(1)
boundary.Lsh(boundary, 255)
boundary.Div(boundary, big.NewInt(difficulty))
boundary.Lsh(boundary, 1)
diff := big.NewInt(1)
diff.Lsh(diff, 255)
diff.Div(diff, boundary)
diff.Lsh(diff, 1)
fmt.Printf("Parity diff->boundary->diff: %v\n", diff)
}
|
Thanks for finding this @karalabe 👍. |
joshua-mir Opened issue similar to #10118 since couldn't respond to the closed ticket. Hope that was |
Parity node stops syncing with block verification error:
I got this issue two times with brand new local chains. First time it happened around 100000 block. Then I simply started new chain and it happend again on block 307711. Network runs a few latest stable version Geth nodes and a single latest stable Parity node (various stable versions of both Geth and Parity nodes as chains runs for a few months and I upgrade once new is released).
I don't know any easy way to reproduce it.
The text was updated successfully, but these errors were encountered: