ethereum / go-ethereum

Go implementation of the Ethereum protocol
https://geth.ethereum.org
GNU Lesser General Public License v3.0
47.79k stars 20.23k forks source link

Puppeth created 'bootnode' docker image restarting always #22409

Closed rymuff closed 3 years ago

rymuff commented 3 years ago

System information

Geth version: 1.9.25-stable & in docker: 1.10.0-unstable-19d7a37a-20210301 OS & Version: Linux

Actual behaviour

When run 1. Show netork stats in puppeth:

+----------------+-----------+----------+------------------------------+--------------------------------------------+
|     SERVER     |  ADDRESS  | SERVICE  |            CONFIG            |                   VALUE                    |
+----------------+-----------+----------+------------------------------+--------------------------------------------+
| root@127.0.0.1 | 127.0.0.1 | bootnode | offline                      | service unreachable                        |
|                |           |          | ---------------------------- | ------------------------------------------ |

So I tried to figure out whats going on with $ docker ps:

CONTAINER ID   IMAGE              COMMAND             CREATED          STATUS                          PORTS                                                                                     NAMES
efadef09fb12   example/sealnode   "/bin/sh geth.sh"   26 minutes ago   Up 26 minutes                   8545-8546/tcp, 30303/tcp, 30303/udp, 0.0.0.0:30305->30305/tcp, 0.0.0.0:30305->30305/udp   example_sealnode_1
18a5a5c7c8c3   example/bootnode   "/bin/sh geth.sh"   27 minutes ago   Restarting (1) 33 seconds ago                                                                                             example_bootnode_1
3bd60ae61f05   example/ethstats   "npm start"         28 minutes ago   Up 28 minutes                   0.0.0.0:8080->3000/tcp                                                                    example_ethstats_1

STATUS said example_bootnode_1 is restarting, therefore, I print logs with $ docker logs 18a:

INFO [03-02|08:31:47.701] Maximum peer count                       ETH=50 LES=0 total=50
INFO [03-02|08:31:47.701] Smartcard socket not found, disabling    err="stat /run/pcscd/pcscd.comm: no such file or directory"
INFO [03-02|08:31:47.702] Set global gas cap                       cap=25000000
INFO [03-02|08:31:47.702] Allocated cache and file handles         database=/root/.ethereum/geth/chaindata cache=16.00MiB handles=16
INFO [03-02|08:31:47.719] Persisted trie from memory database      nodes=356 size=50.51KiB time=1.050842ms gcnodes=0 gcsize=0.00B gctime=0s livenodes=1 livesize=0.00B
INFO [03-02|08:31:47.720] Successfully wrote genesis state         database=chaindata                      hash="bbf279…9f2477"
INFO [03-02|08:31:47.720] Allocated cache and file handles         database=/root/.ethereum/geth/lightchaindata cache=16.00MiB handles=16
INFO [03-02|08:31:47.733] Persisted trie from memory database      nodes=356 size=50.51KiB time="854.052µs" gcnodes=0 gcsize=0.00B gctime=0s livenodes=1 livesize=0.00B
INFO [03-02|08:31:47.734] Successfully wrote genesis state         database=lightchaindata                      hash="bbf279…9f2477"
Incorrect Usage. flag provided but not defined: -lightpeers

NAME:
   geth - the go-ethereum command line interface

   Copyright 2013-2021 The go-ethereum Authors

USAGE:
   geth [options] [command] [command options] [arguments...]

VERSION:
   1.10.0-unstable-19d7a37a-20210301

...

flag provided but not defined: -lightpeers

COPYRIGHT:
   Copyright 2013-2021 The go-ethereum Authors

From the messages in logs, flag provided but not defined: -lightpeers, I can guess flag --lightpeers is removed in 1.10.0-unstable-19d7a37a-20210301 which is the version of geth in docker.

And also, the release note in https://blog.ethereum.org/2019/07/10/geth-v1-9-0/,

The --lightserv and --lightpeers flags were renamed to --light.serve and --light.maxpeers respectively. The old versions are deprecated, but will continue to work for the next year or so.

--lightpeers is deprecated.

Expected Solutions

  1. Change the flag --lightpeers to --light.maxpeers in puppeth
  2. Downgrade the version of geth in docker to stable
rymuff commented 3 years ago

This bug is solved in #22263

karalabe commented 3 years ago

Apologies, puppeth uses the latest docker images (i.e. master branch) which already have the flags dropped and switched to the new format, but only puppeth on master or in the next release will use the correctly updated flags.

rymuff commented 3 years ago

@karalabe Thanks for explanations. Is there any command to make puppeth uses the stable or its geth version of docker images?

olegabr commented 3 years ago

@karalabe, Thank you for explanation. However, we need a workaround. This issue should not be considered as resolved until a workaround or a new puppeth version is published. Do you have a timeline for it?

karalabe commented 3 years ago

It was already published yesterday

On Thu, Mar 4, 2021, 07:58 Oleg Abrosimov notifications@github.com wrote:

@karalabe https://github.com/karalabe, Thank you for explanation. However, we need a workaround. This issue should not be considered as resolved until a workaround or a new puppeth version is published. Do you have a timeline for it?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ethereum/go-ethereum/issues/22409#issuecomment-790317888, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAA7UGOWQ5YDRPGD2PVHOELTB4OQFANCNFSM4YOPLG3A .

olegabr commented 3 years ago
  1. The only way to use puppeth now is to install the ethereum-unstable package. Does it mean that there are no way to build a stable private chain now?
geth version
Geth
Version: 1.10.1-unstable
Git Commit: dab90e4d42b5ed76b5a2422f87249ebfede2a06c
Architecture: amd64
Go Version: go1.16
Operating System: linux
GOPATH=
GOROOT=go
  1. Following any puppeth PoA private network guide like https://medium.com/@achintadas13/setup-private-ethereum-network-poa-on-degital-ocean-using-puppeth-164b869567a2 for example, I've deployed ethstats, boot and sealer nodes:
INFO [03-05|07:55:03.418] Starting remote server health-check      server=user@127.0.0.1
+-----------------------+-----------+----------+------------------------------+--------------------------------------------+
|        SERVER         |  ADDRESS  | SERVICE  |            CONFIG            |                   VALUE                    |
+-----------------------+-----------+----------+------------------------------+--------------------------------------------+
| user@127.0.0.1        | 127.0.0.1 | bootnode | Data directory               | /var/lib/sync-chain/bootnode               |
|                       |           |          | Ethstats username            | boot                                       |
|                       |           |          | Listener port                | 30303                                      |
|                       |           |          | Peer count (all total)       | 512                                        |
|                       |           |          | Peer count (light nodes)     | 256                                        |
|                       |           |          | ---------------------------- | ------------------------------------------ |
|                       |           | ethstats | Banned addresses             |                                            |
|                       |           |          | Login secret                 | secret_here                                |
|                       |           |          | Website address              | 127.0.0.1                                  |
|                       |           |          | Website listener port        | 8081                                       |
|                       |           |          | ---------------------------- | ------------------------------------------ |
|                       |           | sealnode | Data directory               | /var/lib/sync-chain/sealernode1            |
|                       |           |          | Ethstats username            | sealer1                                    |
|                       |           |          | Gas ceil  (target maximum)   | 12.500 MGas                                |
|                       |           |          | Gas floor (baseline target)  | 7.500 MGas                                 |
|                       |           |          | Gas price (minimum accepted) | 1.000 GWei                                 |
|                       |           |          | Listener port                | 30304                                      |
|                       |           |          | Peer count (all total)       | 50                                         |
|                       |           |          | Peer count (light nodes)     | 0                                          |
|                       |           |          | Signer account               | 0xF405816672720B9827fBbEeEE4cBa6C52316cF55 |
+-----------------------+-----------+----------+------------------------------+--------------------------------------------+

Results:

  1. No nodes are shown on the ethstats page;
  2. No connectivity can be established between boot and sealer nodes:
$ docker ps
CONTAINER ID        IMAGE                COMMAND             CREATED             STATUS              PORTS                                                                                     NAMES
4549b7b05eca        syncchain/sealnode   "/bin/sh geth.sh"   10 minutes ago      Up 10 minutes       8545-8546/tcp, 30303/tcp, 30303/udp, 0.0.0.0:30304->30304/tcp, 0.0.0.0:30304->30304/udp   syncchain_sealnode_1
ed06676d4eab        syncchain/bootnode   "/bin/sh geth.sh"   13 minutes ago      Up 13 minutes       8545-8546/tcp, 0.0.0.0:30303->30303/tcp, 0.0.0.0:30303->30303/udp                         syncchain_bootnode_1
56be5e4320fa        syncchain/ethstats   "npm start"         14 minutes ago      Up 14 minutes       0.0.0.0:8081->3000/tcp                                                                    syncchain_ethstats_1

$ docker network inspect syncchain_default
[
    {
        "Name": "syncchain_default",
        "Id": "0ca571bc9115e534c45bc02ac7fdd2f1e9d42dd6bf1ce7e63d34c8cecc2f2ed4",
        "Created": "2021-03-05T04:08:43.945730466Z",
        "Scope": "local",
        "Driver": "bridge",
        "EnableIPv6": false,
        "IPAM": {
            "Driver": "default",
            "Options": null,
            "Config": [
                {
                    "Subnet": "172.18.0.0/16",
                    "Gateway": "172.18.0.1"
                }
            ]
        },
        "Internal": false,
        "Attachable": false,
        "Ingress": false,
        "ConfigFrom": {
            "Network": ""
        },
        "ConfigOnly": false,
        "Containers": {
            "4549b7b05ecab3dae3434387286fcabd9e10e9115ebf8052adcf79192cebc186": {
                "Name": "syncchain_sealnode_1",
                "EndpointID": "a3cbe4b2c4af646ad943d3920c83b6bf0692f1c6c27bc6e23d05e41cdb50bc57",
                "MacAddress": "02:42:ac:12:00:04",
                "IPv4Address": "172.18.0.4/16",
                "IPv6Address": ""
            },
            "56be5e4320fa95c8feaf7dc116620f06b2c84f6bdfb289c3fe5e0cd6f0380fdf": {
                "Name": "syncchain_ethstats_1",
                "EndpointID": "b71f402cc4a81a4cdf39964b13b3653404636fc7981ff3276e5d8722d93dc93a",
                "MacAddress": "02:42:ac:12:00:02",
                "IPv4Address": "172.18.0.2/16",
                "IPv6Address": ""
            },
            "ed06676d4eab7ecf51ad88aff42bcb2ed685acd82c65098e2a11dcd33a093bfd": {
                "Name": "syncchain_bootnode_1",
                "EndpointID": "7eb249d3845c1608ef028331684f79707fcea8a07014e55debc6c83c83911cff",
                "MacAddress": "02:42:ac:12:00:03",
                "IPv4Address": "172.18.0.3/16",
                "IPv6Address": ""
            }
        },
        "Options": {},
        "Labels": {}
    }
]

$ docker exec -it syncchain_sealnode_1 geth attach ipc:/root/.ethereum/geth.ipc
Welcome to the Geth JavaScript console!

instance: Geth/v1.10.1-unstable-dab90e4d-20210304/linux-amd64/go1.16
coinbase: 0xf405816672720b9827fbbeeee4cba6c52316cf55
at block: 1 (Fri Mar 05 2021 04:31:53 GMT+0000 (UTC))
 datadir: /root/.ethereum
 modules: admin:1.0 clique:1.0 debug:1.0 eth:1.0 miner:1.0 net:1.0 personal:1.0 rpc:1.0 txpool:1.0 web3:1.0

To exit, press ctrl-d
> admin.nodeInfo.enode
"enode://eea7052b5b60d8c0d94d02c98103c6edeab6d00b0f7b5a8170d28a58c7e0c2a90e9bba2aee40ad02ee27c62ae8cd4502177b0e4ef62440e37e7a1a993a4f363b@127.0.0.1:30304"

$ docker exec -it syncchain_bootnode_1 geth attach ipc:/root/.ethereum/geth.ipc
Welcome to the Geth JavaScript console!

instance: Geth/v1.10.1-unstable-dab90e4d-20210304/linux-amd64/go1.16
coinbase: 0x7271da5790f6035e7cf60380ef5d1b3455722787
at block: 0 (Fri Mar 05 2021 04:05:12 GMT+0000 (UTC))
 datadir: /root/.ethereum
 modules: admin:1.0 clique:1.0 debug:1.0 eth:1.0 les:1.0 miner:1.0 net:1.0 personal:1.0 rpc:1.0 txpool:1.0 web3:1.0

To exit, press ctrl-d
> admin.nodeInfo.enode
"enode://21523cc58569e634ce72de427baa81bc90d20b41dfe8b8c6bd6468f2deca41f26621961912317028e97919c36c65133b2bf32d60885daf112c1fc8e0853b5a09@127.0.0.1:30303"
> admin.peers
[]
> admin.addPeer("enode://eea7052b5b60d8c0d94d02c98103c6edeab6d00b0f7b5a8170d28a58c7e0c2a90e9bba2aee40ad02ee27c62ae8cd4502177b0e4ef62440e37e7a1a993a4f363b@127.0.0.1:30304")
true
> admin.peers
[]
> admin.addPeer("enode://eea7052b5b60d8c0d94d02c98103c6edeab6d00b0f7b5a8170d28a58c7e0c2a90e9bba2aee40ad02ee27c62ae8cd4502177b0e4ef62440e37e7a1a993a4f363b@172.18.0.4:30304")
true
> admin.peers
[]
> admin.addPeer("enode://eea7052b5b60d8c0d94d02c98103c6edeab6d00b0f7b5a8170d28a58c7e0c2a90e9bba2aee40ad02ee27c62ae8cd4502177b0e4ef62440e37e7a1a993a4f363b@172.18.0.4:30303")
true
> admin.peers
[]

$ dockeexec -it syncchain_sealnode_1 geth attach ipc:/root/.ethereum/geth.ipc
Welcome to the Geth JavaScript console!

instance: Geth/v1.10.1-unstable-dab90e4d-20210304/linux-amd64/go1.16
coinbase: 0xf405816672720b9827fbbeeee4cba6c52316cf55
at block: 1 (Fri Mar 05 2021 04:31:53 GMT+0000 (UTC))
 datadir: /root/.ethereum
 modules: admin:1.0 clique:1.0 debug:1.0 eth:1.0 miner:1.0 net:1.0 personal:1.0 rpc:1.0 txpool:1.0 web3:1.0

To exit, press ctrl-d
> admin.peers
[]
> admin.addPeer("enode://21523cc58569e634ce72de427baa81bc90d20b41dfe8b8c6bd6468f2deca41f26621961912317028e97919c36c65133b2bf32d60885daf112c1fc8e0853b5a09@127.0.0.1:30303")
true
> admin.peers
[]
> admin.addPeer("enode://21523cc58569e634ce72de427baa81bc90d20b41dfe8b8c6bd6468f2deca41f26621961912317028e97919c36c65133b2bf32d60885daf112c1fc8e0853b5a09@172.18.0.3:30303")
true
> admin.peers
[]

How to establish connection between v1.10.1 puppeth deployed ethstats, boot and seal nodes?

rymuff commented 3 years ago

@olegabr That problem raised only if you deploy all your components on the localhost.

olegabr commented 3 years ago

@rymuff Thank you for your answer!

ethstats, boot and one sealer node deployed on the same machine: https://miro.medium.com/max/2400/1*bHRPA-syO0Ez7hXq0HjrKQ.png boot and all sealer nodes are shown on ethstats: https://miro.medium.com/max/2400/1*3GUrqePjHKY443MW0JbaOA.png

These images are from this tutorial: https://collincusce.medium.com/using-puppeth-to-manually-create-an-ethereum-proof-of-authority-clique-network-on-aws-ae0d7c906cce

Does it mean that tutorial author lies, or the puppeth could do it previously and can not do it now? What do you suggest? Deploy each component on it's own machine?

rymuff commented 3 years ago

@olegabr I don't wanna argue with you about who is the lier because It is not proper.

The answer above came from my experience, and it means that I had a same problem with yours.

And also, the images that you linked show the author of reference post used at least three machines.

Lastly, my suggestion is deploy components on different machines, and if you have still problem, please make a new issue. Original issue is about puppeth's new format, which is not related to your issue.

sdelvalle57 commented 3 years ago

It was already published yesterday On Thu, Mar 4, 2021, 07:58 Oleg Abrosimov @.***> wrote: @karalabe https://github.com/karalabe, Thank you for explanation. However, we need a workaround. This issue should not be considered as resolved until a workaround or a new puppeth version is published. Do you have a timeline for it? — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub <#22409 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAA7UGOWQ5YDRPGD2PVHOELTB4OQFANCNFSM4YOPLG3A .

Theres still no workaround for this issue, ive tried to deploy a bootnode and still getting the flag issue. How can this be solved?

franzos commented 1 year ago

Dealing with issues related to puppeth and the latest ethereum/client-go:latest image (as of today):

  1. Check container name with docker ps. For ex. sealnode_1.
  2. Copy the startup script from container: docker cp sealnode_1:/geth.sh .
  3. Edit the script geth.sh:
    • Remove -miner.gastarget
    • Add --miner.etherbase YOUR_WALLET_ADDRESS
  4. Copy the script back into the container docker cp geth.sh sealnode_1:/geth.sh

Wait for the container to restart. That should do it.