2

I've created a network of 2 nodes on cloud servers for testing, using Substrate contract node. They have been running for about 3 months now and producing almost 1M blocks. But today they are in an idle state and stop producing blocks. What are the possible causes of this and how to fix it? Thanks.

Node #1:

2022-04-04 19:12:28 💤 Idle (0 peers), best: #978694 (0xa8dd…8e3e), finalized #978667 (0xde39…9655), ⬇ 0 ⬆ 0
2022-04-04 19:12:33 💤 Idle (0 peers), best: #978694 (0xa8dd…8e3e), finalized #978667 (0xde39…9655), ⬇ 0.3kiB/s ⬆ 0.3kiB/s
2022-04-04 19:12:38 💤 Idle (0 peers), best: #978694 (0xa8dd…8e3e), finalized #978667 (0xde39…9655), ⬇ 0 ⬆ 0
2022-04-04 19:12:43 💤 Idle (0 peers), best: #978694 (0xa8dd…8e3e), finalized #978667 (0xde39…9655), ⬇ 0.2kiB/s ⬆ 0.2kiB/s
2022-04-04 19:12:48 💤 Idle (0 peers), best: #978694 (0xa8dd…8e3e), finalized #978667 (0xde39…9655), ⬇ 55 B/s ⬆ 49 B/s

Node #2:

2022-04-04 19:12:37 💤 Idle (0 peers), best: #978690 (0x9cdf…3d7a), finalized #978667 (0xde39…9655), ⬇ 0 ⬆ 0
2022-04-04 19:12:42 💤 Idle (0 peers), best: #978690 (0x9cdf…3d7a), finalized #978667 (0xde39…9655), ⬇ 0.2kiB/s ⬆ 0.2kiB/s
2022-04-04 19:12:47 💤 Idle (0 peers), best: #978690 (0x9cdf…3d7a), finalized #978667 (0xde39…9655), ⬇ 49 B/s ⬆ 55 B/s
2022-04-04 19:12:52 💤 Idle (0 peers), best: #978690 (0x9cdf…3d7a), finalized #978667 (0xde39…9655), ⬇ 0.2kiB/s ⬆ 0.2kiB/s
2022-04-04 19:12:57 💤 Idle (0 peers), best: #978690 (0x9cdf…3d7a), finalized #978667 (0xde39…9655), ⬇ 0 ⬆ 0
3
  • Could you please expand on what pallets are you using? Most important would be, which consensus pallets and some relevant configuration of them. Were there any errors logged before the nodes got idle?
    – wigy
    Commented Apr 4, 2022 at 13:10
  • @wigy I'm using Substrate contracts node from github.com/paritytech/substrate-contracts-node and following Substrate's tutorial on creating a private network: docs.substrate.io/tutorials/v3/private-network. Only change the basic node template to use the contracts node instead, without any other changes. I didn't see the logs when the nodes got idle. I've run the node in tmux and I'm not sure if the logs are being written to the file somewhere. Commented Apr 4, 2022 at 14:29
  • I have a hunch that it's because the peers are 0. You can stop producing blocks and have non-zero peers. Maybe if you're using staking, some eras went without any validators, due to peer loss, and the network stalled. Can you start the command with --log sub-libp2p=trace Commented Apr 4, 2022 at 15:11

3 Answers 3

8

The node has 0 peers and as such it refrains from authoring to avoid creating unnecessary forks. You can force a node to author while still having no peers with --force-authoring. Obviously you should investigate why the node has 0 peers but that's outside the scope of this question.

4

If the two nodes are not on the same local network I suggest you to restart the first node and grab its p2p PeerId.

It should print it during startup phase:

2022-04-06 14:47:07 🏷  Local node identity is: 12D3KooWLWcgKzEUsdPewa7mppXv8u3ZypqwgiQzRYLA93JAz52C                                              

Restart the second node using the first node peer id, ipv4 address and tcp port for discovery

./substrate [some options] --bootnodes /ip4/<ipv4-addr>/tcp/<p2p-tcp-port>/p2p/12D3KooWLWcgKzEUsdPewa7mppXv8u3ZypqwgiQzRYLA93JAz52C

(Default p2p-tcp-port is 30333)

If the two nodes are on the same local network then you should not require to do this since mDNS discovery is enabled by default. In this case the cause could be the firewall blocking mdns port (udp 5353).

0

your node connectivity is disconnected that's why you are getting this issue

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.