erigon-pulse/p2p
gary rong 0a48344dfe les, p2p/simulations/adapters: fix issues found while simulating les (#21761)
This adds a few tiny fixes for les and the p2p simulation framework:

LES Parts

- Keep the LES-SERVER connection even it's non-synced

  We had this idea to reject the connections in LES protocol if the les-server itself is
  not synced. However, in LES protocol we will also receive the connection from another
  les-server. In this case even the local node is not synced yet, we should keep the tcp
  connection for other protocols(e.g. eth protocol).

- Don't count "invalid message" for non-existing GetBlockHeadersMsg request

  In the eth syncing mechanism (full sync, fast sync, light sync), it will try to fetch
  some non-existent blocks or headers(to ensure we indeed download all the missing chain).
  In this case, it's possible that the les-server will receive the request for
  non-existent headers. So don't count it as the "invalid message" for scheduling
  dropping.

- Copy the announce object in the closure

  Before the les-server pushes the latest headers to all connected clients, it will create
  a closure and queue it in the underlying request scheduler. In some scenarios it's
  problematic. E.g, in private networks, the block can be mined very fast. So before the
  first closure is executed, we may already update the latest_announce object. So actually
  the "announce" object we want to send is replaced.

  The downsize is the client will receive two announces with the same td and then drop the
  server.

P2P Simulation Framework

- Don't double register the protocol services in p2p-simulation "Start".

  The protocols upon the devp2p are registered in the "New node stage". So don't reigster
  them again when starting a node in the p2p simulation framework

- Add one more new config field "ExternalSigner", in order to use clef service in the
  framework.

# Conflicts:
#	les/server_handler.go
2020-12-03 18:59:17 +01:00
..
discover geth-1.9.23: post-rebase fixups 2020-10-26 17:16:00 +01:00
discv5 ChangeSets dupsort (#1342) 2020-11-16 12:08:28 +00:00
dnsdisc all: fix typos in comments (#21118) 2020-06-15 19:38:13 +03:00
enode ChangeSets dupsort (#1342) 2020-11-16 12:08:28 +00:00
enr Apply Turbo-Geth modifications to go-ethereum codebase 2019-11-01 21:52:03 +01:00
nat linters 2020-08-15 22:29:04 +02:00
netutil p2p/discover: implement v5.1 wire protocol (#21647) 2020-10-26 17:16:00 +01:00
rlpx post-rebase fixes 2020-10-06 14:12:09 +02:00
simulations les, p2p/simulations/adapters: fix issues found while simulating les (#21761) 2020-12-03 18:59:17 +01:00
dial_test.go p2p: new dial scheduler (#20592) 2020-02-27 17:21:20 +03:00
dial.go Stop dial scheduler asap (#1334) 2020-11-02 21:07:26 +00:00
message_test.go p2p: move rlpx into separate package (#21464) 2020-10-06 14:12:09 +02:00
message.go Apply Turbo-Geth modifications to go-ethereum codebase 2019-11-01 21:52:03 +01:00
metrics.go post-merge fixups 2020-02-27 17:22:25 +03:00
peer_error.go p2p: fix some golint warnings (#16577) 2018-05-08 13:08:43 +02:00
peer_test.go p2p: move rlpx into separate package (#21464) 2020-10-06 14:12:09 +02:00
peer.go eth, p2p: use truncated names (#21698) 2020-10-26 17:16:00 +01:00
protocol.go cmd/devp2p, p2p: dial using node iterator, discovery crawler (#20132) 2019-12-03 13:08:33 +01:00
server_test.go post-rebase fixes 2020-10-06 14:12:09 +02:00
server.go eth, p2p: use truncated names (#21698) 2020-10-26 17:16:00 +01:00
transport_test.go post-rebase fixes 2020-10-06 14:12:09 +02:00
transport.go post-rebase fixes 2020-10-06 14:12:09 +02:00
util_test.go post-merge fixups 2020-02-27 17:22:25 +03:00
util.go post-merge fixups 2020-02-27 17:22:25 +03:00