bnb-chain / op-geth

GNU Lesser General Public License v3.0
59 stars 45 forks source link

Always 1 peer connected #42

Closed m-e-m-f-i-s-19 closed 9 months ago

m-e-m-f-i-s-19 commented 10 months ago

Node info:

op-geth: v0.2.1 op-node: v0.2.2

Start components

op-geth:

export CHAIN_ID=204
export L2_RPC=https://opbnb-mainnet-rpc.bnbchain.org
export P2P_BOOTNODES="enr:-KO4QHs5qh_kPFcjMgqkuN9dbxXT4C5Cjad4SAheaUxveCbJQ3XdeMMDHeHilHyqisyYQAByfdhzyKAdUp2SvyzWeBqGAYvRDf80g2V0aMfGhHFtSjqAgmlkgnY0gmlwhDaykUmJc2VjcDI1NmsxoQJUevTL3hJwj21IT2GC6VaNqVQEsJFPtNtO-ld5QTNCfIRzbmFwwIN0Y3CCdl-DdWRwgnZf,enr:-KO4QKIByq-YMjs6IL2YCNZEmlo3dKWNOy4B6sdqE3gjOrXeKdNbwZZGK_JzT1epqCFs3mujjg2vO1lrZLzLy4Rl7PyGAYvRA8bEg2V0aMfGhHFtSjqAgmlkgnY0gmlwhDbjSM6Jc2VjcDI1NmsxoQNQhJ5pqCPnTbK92gEc2F98y-u1OgZVAI1Msx-UiHezY4RzbmFwwIN0Y3CCdl-DdWRwgnZf"

./op-geth \
  --datadir="./datadir" \
  --verbosity=3 \
  --http \
  --http.corsdomain="*" \
  --http.vhosts="*" \
  --http.addr=0.0.0.0 \
  --http.port=8545 \
  --http.api=net,eth,engine \
  --ws \
  --ws.addr=0.0.0.0 \
  --ws.port=8545 \
  --ws.origins="*" \
  --ws.api=eth,engine \
  --syncmode=full \
  --maxpeers=10 \
  --networkid=$CHAIN_ID \
  --miner.gaslimit=150000000 \
  --triesInMemory=32 \
  --txpool.globalslots=10000 \
  --txpool.globalqueue=5000 \
  --txpool.accountqueue=200 \
  --txpool.accountslots=200 \
  --cache 32000 \
  --cache.preimages \
  --allow-insecure-unlock \
  --authrpc.addr="0.0.0.0" \
  --authrpc.port="8551" \
  --authrpc.vhosts="*" \
  --authrpc.jwtsecret=./jwt.txt \
  --gcmode=archive \
  --metrics \
  --metrics.port 6060 \
  --metrics.addr 0.0.0.0 \
  --rollup.sequencerhttp=$L2_RPC \
  --bootnodes=$P2P_BOOTNODES

op-node:

export L2_RPC=http://localhost:8551

# replace the p2p private key with yours
# you can generate a new one with `openssl rand -hex 32`
export P2P_PRIV_KEY=<my_key>

export L1_RPC=https://bsc-dataseed.bnbchain.org
export P2P_BOOTNODES="enr:-J24QA9sgVxbZ0KoJ7-1gx_szfc7Oexzz7xL2iHS7VMHGj2QQaLc_IQZmFthywENgJWXbApj7tw7BiouKDOZD4noWEWGAYppffmvgmlkgnY0gmlwhDbjSM6Hb3BzdGFja4PMAQCJc2VjcDI1NmsxoQKetGQX7sXd4u8hZr6uayTZgHRDvGm36YaryqZkgnidS4N0Y3CCIyuDdWRwgiMs"

./op-node \
  --l1.trustrpc \
  --sequencer.l1-confs=15 \
  --verifier.l1-confs=15 \
  --l1.http-poll-interval 3s \
  --l1.epoch-poll-interval 45s \
  --l1.rpc-max-batch-size 20 \
  --network=opBNBMainnet \
  --rpc.addr=0.0.0.0 \
  --rpc.port=8546 \
  --p2p.sync.req-resp \
  --p2p.listen.ip=0.0.0.0 \
  --p2p.listen.tcp=9003 \
  --p2p.listen.udp=9003 \
  --snapshotlog.file=./snapshot.log \
  --p2p.bootnodes=$P2P_BOOTNODES \
  --metrics.enabled \
  --metrics.addr=0.0.0.0 \
  --metrics.port=7300 \
  --pprof.enabled \
  --rpc.enable-admin \
  --l1=${L1_RPC} \
  --l2=${L2_RPC} \
  --l2.jwt-secret=./jwt.txt \
  --l2.engine-sync=true \
  --l2.skip-sync-start-check=true \
  --log.level=debug

Problem:

Always 1 peer connected.

7|opbnb-geth  | INFO [12-20|17:33:23.703] Looking for peers                        peercount=1 tried=40  static=0
7|opbnb-geth  | INFO [12-20|17:33:34.412] Looking for peers                        peercount=1 tried=0   static=0
7|opbnb-geth  | INFO [12-20|17:33:45.584] Looking for peers                        peercount=1 tried=8   static=0
7|opbnb-geth  | INFO [12-20|17:33:55.649] Looking for peers                        peercount=1 tried=7   static=0
7|opbnb-geth  | INFO [12-20|17:34:06.813] Looking for peers                        peercount=1 tried=1   static=0

Question:

Is this expected behavior? If not could the team explain how to fix that?

bnoieh commented 10 months ago

hi @m-e-m-f-i-s-19, this's not expected, we are checking it and will give feedback soon

zekchan commented 10 months ago

+1

krish-nr commented 9 months ago

Hi @m-e-m-f-i-s-19 @zekchan We have noticed that one of the nodes is indeed behaving abnormally. Our current expectation is to have two peers operational. Previously, due to certain reasons, one of the bootnodes was unable to provide its services, but it has now been restored. Therefore, you should now be able to connect to two peers. However, this is not our intended final state. Due to some issues with the internal mechanisms of the bootnode, we are in the process of updating its node discovery logic. We expect to roll out this optimization soon, which will improve its ability to discover more p2p nodes. (As a result, the ENR address of our bootnode will also be updated) We apologize for any inconvenience this may have caused and are working diligently to complete these updates...

krish-nr commented 9 months ago

@m-e-m-f-i-s-19 @zekchan we've updated our geth bootnode version, including several static peers deployed in different regions. You can get at least 9 peers connected as expected, pls try it again. Sorry for the inconvenience...

m-e-m-f-i-s-19 commented 9 months ago

@krish-nr thank you. so far everything works great 🚀