At 99 peers, my node 7a877820 (2019-12-11 15:02:03 +0100) starts getting

Dec 17 06:48:30 - p2p.connection-pool: Swap to x.x.x.x.:9732 failed: Error:
Dec 17 06:48:30 - p2p.connection-pool:           Too many connections.

But config does not have a max of 100 specified:

{ "rpc": { "listen-addrs": [ "" ] },
    { "bootstrap-peers":
        [ "boot.tzbeta.net", "dubnodes.tzbeta.net:9732",
          "franodes.tzbeta.net:9732", "sinnodes.tzbeta.net:9732",
          "nrtnodes.tzbeta.net:9732", "pdxnodes.tzbeta.net:9732",
          "a.b.c.d:9732" ], "listen-addr": "",
        { "connection-timeout": 10, "min-connections": 15,
          "max_known_points": [ 240, 180 ],
          "max_known_peer_ids": [ 240, 180 ] } },
  "log": { "output": "/home/tezos/.tezos-node/tezos-node.log" },
    { "chain_validator": { "bootstrap_threshold": 2 },
      "history_mode": "archive" } }

I find 100 peers enough, but why does it consider too many peers at 100 if the config has no such limit? Is 100 the default max?

More importantly, it disconnects my private node, a.b.c.d:9732. The private node is set to run on cron tezos-admin-client trust peer id12345abcde, where id12345abcde is the id of public node with 100 connections. I don't think trust peer means stay connected to this peer, simply tells the private node to accept connections from node id id12345abcde, but the bottom line is: how do I ensure that the public node doesn't drop the connection to the private node when it reaches max connected nodes?

  • 1
    Please go upvote and comment on these P2P layer issues. Doesn't look like you are the only one. IMHO, a trusted peer should always be maintained by the node. gitlab.com/tezos/tezos/issues/367 gitlab.com/tezos/tezos/issues/278
    – utdrmac
    Commented Dec 17, 2019 at 16:48
  • Done for 367 and 278. I guess for now I have to schedule restarts for the public node when a script detects it is not connected to the private peer...
    – Gaia
    Commented Dec 17, 2019 at 16:53
  • @utdrmac i have a mitigation in place. oh well.
    – Gaia
    Commented Dec 17, 2019 at 19:00

2 Answers 2


If you started your private node with eg.

[...] --net-addr [...]

add the following peer to the public node so that it trusts the private node:

[...] --peer [...]

The function that kills some connections when there are too many does not kill connections that are both in private mode and trusted.


https://gitlab.com/tezos/tezos/blob/master/src/lib_p2p/p2p_maintenance.ml#L266 https://gitlab.com/tezos/tezos/blob/master/src/lib_p2p/p2p_maintenance.ml#L216


It seems that it is currently not possible to ensure the peer stays connected to your private node. See this and this.

So I created a mitigation script to trust and connect to the private node if it is not connected.

  • 1
    Why not just use the tezos-admin-client to add a connection to your private node? Much simpler than restarting the entire node.
    – utdrmac
    Commented Dec 17, 2019 at 19:47
  • it's a bit more complex than that, tac connect isn't behaving as expected gitlab.com/tezos/tezos/issues/547#note_202870810
    – Gaia
    Commented Dec 17, 2019 at 20:02
  • but done it with trust then connect
    – Gaia
    Commented Dec 17, 2019 at 20:36

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.