Parity Substrate - blocks are not being finalized

Viewed 680

Problem

I am running a private chain with 2 local nodes using custom accounts and keys.

Peer discovery works, but blocks are not being finalized.

Idle (1 peers), best: #0 (0xb166…8ad2), finalized #0 (0xb166…8ad2),
Idle (1 peers), best: #0 (0xb166…8ad2), finalized #0 (0xb166…8ad2),
...

Description

In chain_spec.rs:

  • Create a new set of accounts from Armstrong, Armstrong//stash, Aldrin, Aldrin//stash seeds the way it is done in the bin/node :

    AccountPublic::from(sp_core::Public::Pair::from_string(seed)).into_account()

  • Set the initial authorities to the controller accounts Armstrong and Aldrin.

  • Create the SessionKeys for the initial authorities.

  • BalancesConfig: endow some balances for each account.

  • SessionConfig: use the SessionKeys I just created.

  • StakingConfig: set the stakers as a 4-tuple containing (stash, controlller, amount, StakerStatus::Validator)

This results in a build-spec like:

palletSession

{
    "keys": [
        [
        "<STASH_ID>",
        {
            "grandpa": "...",
            "babe": "<CONTROLLER_ID>",
            "im_online": "<CONTROLLER_ID>",
            "authority_discovery": "<CONTROLLER_ID>"
        }
        ],
        [
        "<STASH_ID>",
        {
            "grandpa": "...",
            "babe": "<CONTROLLER_ID>",
            "im_online": "<CONTROLLER_ID>",
            "authority_discovery": "<CONTROLLER_ID>"
        }
        ]
    ]
}

palletStaking

"stakers": [
    [
        "<STASH_ID>",
        "<CONTROLLER_ID>",
        <STASH_AMOUNT>,
        "Validator"
    ],
    [
        "<STASH_ID>",
        "<CONTROLLER_ID>",
        <STASH_AMOUNT>,
        "Validator"
    ]
]

Polkadot.js UI

  • Peer is shown in the Explorer -> Node info:

enter image description here

  • I can add the created accounts to the Address Book, but they are not showing in Accounts:

enter image description here enter image description here

  • Stash accounts show up in the Stacking screen as validators, but Account actions shows a No funds staked yet. Bond funds to validate or nominate a validator message:

enter image description here enter image description here

1 Answers
  1. check, that you've added grandpa private keys to the node's storage (author_insertKey, or rotate). When you start alice/bob chain private keys are already in storage
  2. there is an issue that node is checking that private keys are in storage at start (spawning grandpa thread), so if you insert grandpa private keys you need to restart the node.
Related