status-im / infra-nimbus

Infrastructure for Nimbus cluster
https://nimbus.team
9 stars 6 forks source link

Create a new role for nimbus-eth1 and use it on the nimbus.eth1 host. #72

Closed zah closed 3 years ago

zah commented 3 years ago

The new role should be deployed to the nimbus-eth1-metal hosts (there is just one at the moment) and it will be similar to the infra-role-beacon-node-linux, but it will manage an instance of nimbus-eth1:

In the name of the Ansible variables, aim for consistency with the beacon-node role. We'll rename the nimbus-eth1 options in the future to improve the consistency in the software itself.

There won't be any metrics collection initially, but a Prometheus-compatible metrics server will be soon added to nimbus-eth1.

jakubgs commented 3 years ago

Created a repo: https://github.com/status-im/infra-role-nimbus-eth1 (https://github.com/status-im/infra-repos/commit/195e231b)

jakubgs commented 3 years ago

The logs I'm getting look awful:

#033[96mINF#033[0m 2021-10-01 10:04:19.350+00:00 #033[1mRLPx listener up                          #033[0m #033[96mtid#033[0m=#033[94m486849#033[0m #033[96mfile#033[0m=#033[94mp2p.nim:91#033[0m #033[96mself#033[0m=#033[94menode://6d607f9f6599df50fdc7be991bc43c965437d152446c90644acedee43f2cf7214af27c53be2ec66769baf51707a2a9b8096796fde134940db3ba074252360ab2@0.0.0.0:30303#033[0m
#033[96mINF#033[0m 2021-10-01 10:04:57.299+00:00 #033[1mRLPx listener up                          #033[0m #033[96mtid#033[0m=#033[94m486912#033[0m #033[96mfile#033[0m=#033[94mp2p.nim:91#033[0m #033[96mself#033[0m=#033[94menode://38d073f28503f1a4f59a2cd64e0f4dca78bcd1092fbfa121fb9df3d9ddf5fc3631290e9c6e484fc717fec70a00dfaa93510519cc0103de197180717a7cbe57de@0.0.0.0:30303#033[0m
#033[96mINF#033[0m 2021-10-01 10:05:51.258+00:00 #033[1mStarting JSON-RPC HTTP server             #033[0m topics="#033[93mJSONRPC-HTTP-SERVER#033[0m" #033[96mtid#033[0m=#033[94m486912#033[0m #033[96mfile#033[0m=#033[94mhttpserver.nim:213#033[0m #033[96murl#033[0m=#033[94mhttp://127.0.0.1:8545#033[0m
#033[96mINF#033[0m 2021-10-01 10:05:51.263+00:00 #033[1mStarting metrics HTTP server              #033[0m #033[96mtid#033[0m=#033[94m486912#033[0m #033[96mfile#033[0m=#033[94mnimbus.nim:190#033[0m #033[96maddress#033[0m=#033[94m127.0.0.1#033[0m #033[96mport#033[0m=#033[94m9093#033[0m

And I see no flag to disable colors:

LOGGING AND DEBUGGING OPTIONS:
     --log-level               Sets the log level for process and topics (TRACE, DEBUG, INFO, NOTICE, WARN,
                               ERROR, FATAL) [=INFO].
     --log-file                Specifies a path for the written Json log file.
     --log-metrics             Enable metrics logging [=false].
     --log-metrics-interval    Interval at which to log metrics, in seconds [=10].

So I opened an issue: https://github.com/status-im/nimbus-eth1/issues/853

jakubgs commented 3 years ago

Also, how do I enable the admin API namespace?

admin@metal-01.he-eu-hel1.nimbus.eth1:/data % /data/nimbus-eth1-mainnet-master/rpc.sh admin_nodeInfo
{
  "jsonrpc": "2.0",
  "id": 1,
  "error": {
    "code": -32601,
    "message": "'admin_nodeInfo' is not a registered RPC method",
    "data": null
  }
}

Is that even implemented?

jakubgs commented 3 years ago

I see the eth namespace is implemented: https://github.com/status-im/nimbus-eth1/blob/master/fluffy/rpc/eth_api.nim

jakubgs commented 3 years ago

I guess that works too as a healthcheck:

admin@metal-01.he-eu-hel1.nimbus.eth1:/data % /data/nimbus-eth1-mainnet-master/rpc.sh eth_blockNumber  
{                                                                                                    
  "jsonrpc": "2.0",
  "id": 1,
  "result": "0xae6c0"
}
admin@metal-01.he-eu-hel1.nimbus.eth1:/data % /data/nimbus-eth1-mainnet-master/rpc.sh eth_syncing    
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "startingBlock": "0xad700",
    "currentBlock": "0xb0040",
    "highestBlock": "0xb0040"
  }
}
jakubgs commented 3 years ago

But it has the same issue as nimbus-eth2 had where it times out most of the time:

admin@metal-01.he-eu-hel1.nimbus.eth1:/data % /data/nimbus-eth1-mainnet-master/rpc.sh eth_syncing
curl: (28) Operation timed out after 10001 milliseconds with 0 bytes received
admin@metal-01.he-eu-hel1.nimbus.eth1:/data % /data/nimbus-eth1-mainnet-master/rpc.sh eth_blockNumber
curl: (28) Operation timed out after 10001 milliseconds with 0 bytes received
jakubgs commented 3 years ago

Port looks correctly open:

 > sudo nmap -Pn -p30303 metal-01.he-eu-hel1.nimbus.eth1  
Starting Nmap 7.80 ( https://nmap.org ) at 2021-10-01 12:40 CEST
Nmap scan report for metal-01.he-eu-hel1.nimbus.eth1 (65.21.230.244)
Host is up (0.046s latency).
rDNS record for 65.21.230.244: static.244.230.21.65.clients.your-server.de

PORT      STATE SERVICE
30303/tcp open  unknown

Nmap done: 1 IP address (1 host up) scanned in 0.21 seconds

And we

jakubgs commented 3 years ago

Nice, with -d:chronicles_colors=none build flag I get nicer logs:

INF 2021-10-01 10:54:53.764+00:00 RLPx listener up                           tid=538611 file=p2p.nim:91 self=enode://275f7c79eee49ca55ee7ae76bc86a63ebdc8053732f815d3088d53c9694bb681f05d54231de95295fa62ec0226786c8bddf30a5634117c8c3cf429a825afd668@65.21.230.244:30303
ERR 2021-10-01 10:54:55.724+00:00 Unexpected exception in rlpxAccept         topics="rlpx" tid=538611 file=rlpx.nim:1239 exc=ResultError err="Trying to access value with err: auth: ECIES encryption/decryption error"
ERR 2021-10-01 10:54:56.032+00:00 Unexpected exception in rlpxAccept         topics="rlpx" tid=538611 file=rlpx.nim:1239 exc=ResultError err="Trying to access value with err: auth: ECIES encryption/decryption error"
ERR 2021-10-01 10:54:56.439+00:00 Unexpected exception in rlpxAccept         topics="rlpx" tid=538611 file=rlpx.nim:1239 exc=ResultError err="Trying to access value with err: auth: ECIES encryption/decryption error"
DBG 2021-10-01 10:54:58.866+00:00 RlpError, ending dispatchMessages loop     topics="rlpx" tid=538611 file=rlpx.nim:602 peer=Node[76.103.129.161:50410] msg=newPooledTransactionHashes

But -d:chronicles_sinks=json is broken due to:

.../vendor/nim-json-serialization/json_serialization/writer.nim(228, 12) Error: Failed to convert to JSON an unsupported type: PublicKey
jakubgs commented 3 years ago

Although what this error is I have no idea:

Unexpected exception in rlpxAccept
  topics="rlpx" tid=538611 file=rlpx.nim:1239 exc=ResultError
  err="Trying to access value with err: auth: ECIES encryption/decryption error"
jakubgs commented 3 years ago

Configured scraping metrics by Prometheus: https://github.com/status-im/infra-hq/commit/07b52ca6

Appears to work, though there's not many:

image

jakubgs commented 3 years ago

Change: https://github.com/status-im/infra-nimbus/commit/e7e45739

I consider this done, but please take a look at the role and config on the node @zah .