question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Initial migration hangs forever (parity POA)

See original GitHub issue

Issue

I’m trying to create a private chain using parity (PoA) and truffle but when I do truffle migrate it hangs forever with the following output:

   > [
   >   {
   >     "jsonrpc": "2.0",
   >     "id": 24,
   >     "method": "eth_getFilterChanges",
   >     "params": [
   >       "0x0"
   >     ]
   >   }
   > ]
 <   [
 <     {
 <       "jsonrpc": "2.0",
 <       "result": [],
 <       "id": 24
 <     }
 <   ]  

Steps to Reproduce

Create a chain with the following custom_chain.json:

{
    "name": "DemoPoA",
    "engine": {
        "authorityRound": {
            "params": {
                "stepDuration": "5",
                "validators" : {
                    "list": [
                    ]
                }
            }
        }
    },
    "params": {
        "gasLimitBoundDivisor": "0x400",
        "maximumExtraDataSize": "0x20",
        "minGasLimit": "0x1388",
        "networkID" : "0x2323"
    },
    "genesis": {
        "seal": {
            "authorityRound": {
                "step": "0x0",
                "signature": "0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
            }
        },
        "difficulty": "0x20000",
        "gasLimit": "0x5B8D80"
    },
    "accounts": {
        "0x0000000000000000000000000000000000000001": { "balance": "1", "builtin": { "name": "ecrecover", "pricing": { "linear": { "base": 3000, "word": 0 } } } },
        "0x0000000000000000000000000000000000000002": { "balance": "1", "builtin": { "name": "sha256", "pricing": { "linear": { "base": 60, "word": 12 } } } },
        "0x0000000000000000000000000000000000000003": { "balance": "1", "builtin": { "name": "ripemd160", "pricing": { "linear": { "base": 600, "word": 120 } } } },
        "0x0000000000000000000000000000000000000004": { "balance": "1", "builtin": { "name": "identity", "pricing": { "linear": { "base": 15, "word": 3 } } } }
    }
}

… config file note0.toml:

[parity]
chain = "custom_chain.json"
base_path = "./"
[network]
port = 30300
[rpc]
port = 8540
apis = ["web3", "eth", "net", "personal", "parity", "parity_set", "traces", "rpc", "parity_accounts"]
[ui]
port = 8180
[websockets]
port = 8450

… and command:

parity --config node0.toml

Then create two users:


curl --data '{"jsonrpc":"2.0","method":"parity_newAccountFromPhrase","params":["node0", "node0"],"id":0}' -H "Content-Typ e: application/json" -X POST localhost:8540

curl --data '{"jsonrpc":"2.0","method":"parity_newAccountFromPhrase","params":["user", "user"],"id":0}' -H "Content-Typ e: application/json" -X POST localhost:8540

… and restart node with the following custom_chain.json:

{
    "name": "DemoPoA",
    "engine": {
        "authorityRound": {
            "params": {
                "stepDuration": "5",
                "validators" : {
                    "list": [
                        "0x00Bd138aBD70e2F00903268F3Db08f2D25677C9e"
                    ]
                }
            }
        }
    },
    "params": {
        "gasLimitBoundDivisor": "0x400",
        "maximumExtraDataSize": "0x20",
        "minGasLimit": "0x1388",
        "networkID" : "0x2323"
    },
    "genesis": {
        "seal": {
            "authorityRound": {
                "step": "0x0",
                "signature": "0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
            }
        },
        "difficulty": "0x20000",
        "gasLimit": "0x5B8D80"
    },
    "accounts": {
        "0x0000000000000000000000000000000000000001": { "balance": "1", "builtin": { "name": "ecrecover", "pricing": { "linear": { "base": 3000, "word": 0 } } } },
        "0x0000000000000000000000000000000000000002": { "balance": "1", "builtin": { "name": "sha256", "pricing": { "linear": { "base": 60, "word": 12 } } } },
        "0x0000000000000000000000000000000000000003": { "balance": "1", "builtin": { "name": "ripemd160", "pricing": { "linear": { "base": 600, "word": 120 } } } },
        "0x0000000000000000000000000000000000000004": { "balance": "1", "builtin": { "name": "identity", "pricing": { "linear": { "base": 15, "word": 3 } } } },
        "0x004ec07d2329997267Ec62b4166639513386F32E": { "balance": "10000000000000000000000" }
    }
}

node0.toml:

[parity]
chain = "custom_chain.json"
base_path = "./"
[network]
port = 30300
[rpc]
port = 8540
apis = ["web3", "eth", "net", "personal", "parity", "parity_set", "traces", "rpc", "parity_accounts"]
[ui]
port = 8180
[websockets]
port = 8450
[account]
password = ["node.pwds"]
[mining]
engine_signer = "0x00Bd138aBD70e2F00903268F3Db08f2D25677C9e"
reseal_on_txs = "none"

node.pwds:

node0

… and command:

parity --config node0.toml

Then unlock user account:

curl --data '{"method":"personal_unlockAccount","params":["0x004ec07d2329997267Ec62b4166639513386F32E","user",null],"id": 1,"jsonrpc":"2.0"}' -H "Content-Type: application/json" -X POST localhost:8540

And try to connect with truffle compile && truffle migrate with the following truffle.js file:

module.exports = {
  networks: {
    development: {
      host: "localhost",
      port: 8540,
      network_id: "0x2323",
      from: "0x004ec07d2329997267Ec62b4166639513386F32E"
    }
  }
};

Expected Behavior

truffle does the initial migration

Actual Results

Hangs forever.

Environment

  • Operating System: Windows 10
  • Ethereum client: parity1.9.4
  • Truffle version (truffle version): 4.3.1
  • node version (node --version): 8.1.3
  • npm version (npm --version): 4.1.1

P.S. I had similar problem with geth but there I attached to IPC socket and called miner.start() - it helped. Here there is no miner object as there is no PoW (I’m trying to use and need PoA for my dapp).

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:2
  • Comments:12 (3 by maintainers)

github_iconTop GitHub Comments

7reactions
hickscorpcommented, Oct 22, 2018

I’d like to bump this - to this day, we’re not able to use Truffle with Parity in POA mode - it hangs forever at the migration step. (/cc @cgewecke)

3reactions
gustincommented, Mar 21, 2018

I was having the same issue with Parity on a dev chain, after going through a lot of different party configuration, setting the gas and gasPrice explicitly in the truffle.js to a high gas and low gasPrice worked for me.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Truffle hangs forever with parity with PoA
I'm trying to create a private chain using parity (PoA) and truffle but when I do truffle migrate it hangs forever with the...
Read more >
paritytech/parity - Gitter
trying to build parity from source code and encountered this error: error: failed to run custom build command for `parity-snappy-sys v0.1.2` Caused by: ......
Read more >
Followup announcement to our main network freezing and ...
Migrating from PoA to PoS requires a hard fork of the chain which will completely freeze the network for older nodes. Considering the...
Read more >
Frequently Asked Questions · OpenEthereum Documentation
Summary. Most asked questions; Backup, Restore and Files; Basic Operations, Configuration, and Synchronization; CLI, Mining, and Networks; Troubleshooting ...
Read more >
Geth v1.9.0 - Ethereum Foundation Blog
This caused Geth to be starved and stalled, exponentially getting worse ... Geth will automatically being migrating blocks and receipts from ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found