keorn/parity-spec

parity genesis block works along with geth but only after some blocks

Closed this issue · 5 comments

I have converted my private network's geth genesis block configuration into a parity genesis block configuration using parity-spec.
The parity node seemed to be working along the small fleet of geth nodes but at some point it gives an error.
2017-08-18 22:20:03 UTC Stage 5 block verification failed for #59296 (aa44…81bf) Error: Block(InvalidReceiptsRoot(Mismatch { expected: 9da49d789c4c3c6a5d0071f260b79cf45cfba27b08cad981df2e38f95fb35a23, found: 3a227e30062770b5c8b0dbf07fd6db82b9e423eceea35a7548fc3acbaf073f05 }))
There is something weird going on with block 59296 (0xE7A0) on parity so parity stays at block 59295 (0xE79F)

Below are the exact files used:

geth-genesis-block-config.json

{
  "parentHash":"0x0000000000000000000000000000000000000000000000000000000000000000",
  "alloc":{
    "80d73197afb1728b3abf32bdf53336d28638a1d5":{
      "balance":"0x200000000000000000000000000000000000000000000000000000000000000"
    },
    "b57de3f25ee2c910b749c2f3549214245bbd6fb6":{
      "balance":"0x200000000000000000000000000000000000000000000000000000000000000"
    },
    "79813b8542c6dc2e9c5ef5c8a466cdbaad7a59e2":{
      "balance":"0x200000000000000000000000000000000000000000000000000000000000000"
    },
    "378897a91d497a8bf0c05a5cd6de188dca99159e":{
      "balance":"0x200000000000000000000000000000000000000000000000000000000000000"
    },
    "3ab6d2f6a384c9b0152074099b267da57d837ab3":{
      "balance":"0x200000000000000000000000000000000000000000000000000000000000000"
    },
    "fc268ce28f3389f453c19f0326d64e95f35e0455":{
      "balance":"0x200000000000000000000000000000000000000000000000000000000000000"
    },
    "3b3bda829bdd5d57b4f4e6e289ff7b103f66941f":{
      "balance":"0x200000000000000000000000000000000000000000000000000000000000000"
    },
    "8faf9acda0f178130df49a0efcde6170a228f9d8":{
      "balance":"0x200000000000000000000000000000000000000000000000000000000000000"
    }
  },
  "gasLimit":"0x8000000",
  "coinbase":"0x0000000000000000000000000000000000000000",
  "difficulty":"0x400",
  "extraData":"0x57656c636f6d6520746f20736d6172742d73686172657320646576206e657400",
  "mixhash":"0x0000000000000000000000000000000000000000000000000000000000000000",
  "config":{
    "eip155Block":3,
    "homesteadBlock":1,
    "eip150Block":2,
    "chainId":10789,
    "eip158Block":3,
    "eip160Block":4,
    "ethash":{
    },
    "eip150Hash":"0x0000000000000000000000000000000000000000000000000000000000000000"
  },
  "nonce":"0x55d000000000055d",
  "timestamp":"0x59886E51"
}

parity-spec.json

{
  "name": "private test net",
  "engine": {
    "Ethash": {
      "params": {
        "gasLimitBoundDivisor": "0x400",
        "minimumDifficulty": "0x20000",
        "difficultyBoundDivisor": "0x800",
        "durationLimit": "0xd",
        "blockReward": "0x4563918244F40000",
        "registrar": "0x81a4b044831c4f12ba601adb9274516939e9b8a2",
        "homesteadTransition": 1,
        "eip150Transition": 2,
        "eip155Transition": 3,
        "eip160Transition": 4,
        "eip161abcTransition": 4,
        "eip161dTransition": 4
      }
    }
  },
  "params": {
    "accountStartNonce": "0x0",
    "maximumExtraDataSize": "0x20",
    "minGasLimit": "0x1388",
    "networkID": 10789
  },
  "genesis": {
    "seal": {
      "ethereum": {
        "nonce": "0x55d000000000055d",
        "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000"
      }
    },
    "difficulty": "0x400",
    "author": "0x0000000000000000000000000000000000000000",
    "timestamp": "0x59886E51",
    "parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
    "extraData": "0x57656c636f6d6520746f20736d6172742d73686172657320646576206e657400",
    "gasLimit": "0x8000000"
  },
  "accounts": {
    "378897a91d497a8bf0c05a5cd6de188dca99159e": {
      "balance": "0x200000000000000000000000000000000000000000000000000000000000000"
    },
    "3ab6d2f6a384c9b0152074099b267da57d837ab3": {
      "balance": "0x200000000000000000000000000000000000000000000000000000000000000"
    },
    "3b3bda829bdd5d57b4f4e6e289ff7b103f66941f": {
      "balance": "0x200000000000000000000000000000000000000000000000000000000000000"
    },
    "79813b8542c6dc2e9c5ef5c8a466cdbaad7a59e2": {
      "balance": "0x200000000000000000000000000000000000000000000000000000000000000"
    },
    "80d73197afb1728b3abf32bdf53336d28638a1d5": {
      "balance": "0x200000000000000000000000000000000000000000000000000000000000000"
    },
    "8faf9acda0f178130df49a0efcde6170a228f9d8": {
      "balance": "0x200000000000000000000000000000000000000000000000000000000000000"
    },
    "b57de3f25ee2c910b749c2f3549214245bbd6fb6": {
      "balance": "0x200000000000000000000000000000000000000000000000000000000000000"
    },
    "fc268ce28f3389f453c19f0326d64e95f35e0455": {
      "balance": "0x200000000000000000000000000000000000000000000000000000000000000"
    }
  }
}

@5chdn you might be able to shine some light

I was having the same problem, parity-spec unfortunately didn't generate configuration for identical blocks, it is probably. I will let you know here if I'll find solution.

I made sure to include nonce in geth alloc configuration and genesis block is the same.

Unfortunately the same error prevails:

2017-11-24 06:29:48  Stage 5 block verification failed for #1 (eb68…1cce)
Error: Block(InvalidStateRoot(Mismatch { expected: 27d1ee64df00e20b41cdfd7df8fdc07b1f058b92f3cbc9f746c531711d420bea, found: bbc3aaa55e58dd5854e7f759067d2b085e9017b53e0ef03ff84937e95d089ad9 }))

Parity is on block 0.

Okay, I got it working.

I changed following values in parity genesis:

  • gasLimitBoundDivisor to 0x0400
  • difficultyBoundDivisor to 0x0800

In addition I set transition blocks explicitly in both geth and parity.

geth:

{
  "config": {
    "homesteadBlock": 0,
    "eip150Block": 0,
    "eip155Block": 10,
    "eip158Block": 10,
    "eip160Block": 10
  }
}

parity:

{
  "engine": {
    "Ethash": {
      "params": {
        "homesteadTransition": 0,
        "eip150Transition": 0,
        "eip160Transition": 10,
        "eip161abcTransition": 10,
        "eip161dTransition": 10
      }
    }
  },
  "params": {
    "eip155Transition": 10
  }
}

Here is a gist with both.

EDIT:

Transactions are not possible yet, gas limits need to be configured and possibly something else

2017-11-24 07:01:11  Stage 5 block verification failed for #236 (d989…d2da)
Error: Block(InvalidReceiptsRoot(Mismatch { expected: 149136f8826a87282786768d6382f088f00aee0b6aa30a9bddc552e6cc4494db, found: 45bef3c8f45af0174311babea84ed659c7380a7249e2fe1ac5d7749f2918a383 }))
2017-11-24 07:01:12  Error importing transaction: Transaction(Old)
2017-11-24 07:01:12  Error importing transaction: Transaction(AlreadyImported)

Including eip98Transition in parity params seems to fix the problem: source.

keorn commented

Closed by #22