nimbus-eth2/beacon_chain/networking
Jacek Sieka d839b9d07e
State-only checkpoint state startup (#4251)
Currently, we require genesis and a checkpoint block and state to start
from an arbitrary slot - this PR relaxes this requirement so that we can
start with a state alone.

The current trusted-node-sync algorithm works by first downloading
blocks until we find an epoch aligned non-empty slot, then downloads the
state via slot.

However, current
[proposals](https://github.com/ethereum/beacon-APIs/pull/226) for
checkpointing prefer finalized state as
the main reference - this allows more simple access control and caching
on the server side - in particular, this should help checkpoint-syncing
from sources that have a fast `finalized` state download (like infura
and teku) but are slow when accessing state via slot.

Earlier versions of Nimbus will not be able to read databases created
without a checkpoint block and genesis. In most cases, backfilling makes
the database compatible except where genesis is also missing (custom
networks).

* backfill checkpoint block from libp2p instead of checkpoint source,
when doing trusted node sync
* allow starting the client without genesis / checkpoint block
* perform epoch start slot lookahead when loading tail state, so as to
deal with the case where the epoch start slot does not have a block
* replace `--blockId` with `--state-id` in TNS command line
* when replaying, also look at the parent of the last-known-block (even
if we don't have the parent block data, we can still replay from a
"parent" state) - in particular, this clears the way for implementing
state pruning
* deprecate `--finalized-checkpoint-block` option (no longer needed)
2022-11-02 10:02:38 +00:00
..
README.md
eth2_discovery.nim compatibility with Nim 1.4+ (#3888) 2022-07-29 10:53:42 +00:00
eth2_network.nim Tighten chunk decoding limits (#4264) 2022-10-27 18:51:43 +02:00
libp2p_json_serialization.nim compatibility with Nim 1.4+ (#3888) 2022-07-29 10:53:42 +00:00
network_metadata.nim State-only checkpoint state startup (#4251) 2022-11-02 10:02:38 +00:00
peer_pool.nim compatibility with Nim 1.4+ (#3888) 2022-07-29 10:53:42 +00:00
peer_scores.nim update `PeerScore` comments for non-blocks (#4191) 2022-09-28 18:56:04 +00:00
topic_params.nim reduce LC optsync latency (#4002) 2022-08-25 03:53:59 +00:00

README.md

Networking

This folders hold a collection of modules to:

  • configure the Eth2 P2P network
  • discover, connect, and maintain quality Eth2 peers

Data received is handed other to the ../gossip_processing modules for validation.

Security concerns

  • Collusion: part of the peer selection must be kept random. This avoids peers bringing all their friends and colluding against a beacon node.
  • Denial-of-service: The beacon node must provide ways to handle burst of data that may come:
    • from malicious nodes trying to DOS us
    • from long periods of non-finality, creating lots of forks, attestations, forks