[Draft] PING and ENR rpc protocol#1673
Conversation
|
I would love to see some consideration of #1531 here. Seems like the forkID from eth1 could be a good candidate for inclusion, and please could we have a peer name/version included before we head in to the multiclient testnet? |
It would make sense for this to be epoch based rather than slots, we do use epoch as a base value whenever specifying params such as |
This is why I think it depends on implementations. If a validator joins halfway through an epoch, do you join the random subnet then, and then wait EPOCHS_PER_RANDOM_SUBNET_SUSCRIPTION before ending the subscription on a particular slot half-way through the epoch. Or do you end the subscription on an epoch boundary rounding up/down, or do you always start the subscription on the next epoch and end on epoch boundaries? I personally think it's easier to just subscribe instantly when a validator connects and have a fixed timeout (which means we end on random slots) rather than adding another timeout to wait until the next epoch boundary and subscribe then. But if everyone is subscribing/unsubscribing on epoch boundaries, that could also be potentially cleaner. |
|
closing in favor of #1684 |
This is an initial draft aimed for discussion for adding a PING and ENR protocol to the RPC
Overview
For client's to adopt dynamic subnets efficiently, a mechanism is required to obtain the ENR (or subnet bitfields) from peers that connect to clients via libp2p rather than discovery (see #1637). Furthermore, we currently have not specified a PING-like protocol to check for peer liveness on the libp2p stack.
Although we could use periodic STATUS messages to check for peer liveness, it may be beneficial to decouple the liveness check from STATUS messages, as we will also need a mechanism to update ENRs/subnet fields periodically.
Proposed Solution
This PR provides a DRAFT version of adding a PING and ENR RPC method to our RPC.
The PING protocol, is lightweight and is designed to send a small amount of information which indicates the current state of the node to other peers as well as checking their liveness. In it's current form, the PING protocol sends the ENR sequence number, however we may want to change this to something more general.
Given knowledge of our peers current ENR sequence numbers (via the PING protocol) a client may then request an updated ENR from it's peers if its local record of the peers ENR is out-dated (ENR sequence is lower). This method also allows clients to request ENR's for newly connected peers if their ENR's are unknown.
Obvious points of modification
This is a draft aimed for discussion. Some obvious points we may want to consider changing are: