We should return an error when ALL seed slots have failed, not ANY.
Otherwise this would print a deceptive error message ("Network reseed failed") if
we have e.g. 2 seed slots and one seeds successfully and the other fails.
We introduce a new method called refresh() which deletes hosts older
than a specified period. This is applied to the darklist when we load it
on start(), and when we store hosts onto our darklist that are received by
other peers.
We do this to avoid the risk of passing faulty nodes around the network,
and assume that one day is sufficient for valid hosts to propagate to
hosts that support that transport.
This helps reduce the tradeoff space between a) ensuring all transports
are propagated, even those we do not support b) ensuring hosts shared
around the network are valid.
We assume that a one day period is sufficient for valid hosts to
propagate and enter into non-dark hostlists of a peer that does support
this transport.
The following messages are now only broadcast to peers (inbound/ manual/
outbound session) and not seed or refinery connections:
* EventGraph DAG sync
* OutboundSession `GetAddrs`
The following changes have been made to the p2p API:
* p2p.broadcast() now only sends to peers, not seeds or refine connections.
* p2p.is_connected() only reports peer connections, not all (seed, refinery) connections.
This fixes a bug where IPv6 addresses could be truncated in different
ways during the comparison due to the `host_str()` conversion and potentially be treated as different addresses.
Previously we would return Error::ChannelStopped which triggers
handle_error but doesn't actually explicitly stop the channel. This was
leading inbound session to hang forever on `stop_sub.receive().await`.
Also add some useful debug info to inbound_session.rs.
We create a new net Setting called BanPolicy that can be Strict or
Relaxed. If it's set to Strict, we ban peers that send messages without
us having a corresponding Dispatcher. If it's set to Relaxed we simply
close the connection.
Lilith is set to Relaxed by default while other peers are set to Strict.
This helps us avoid Lilith blacklisting peers that send messages for
protocols it is not subscribed to.
Storing manual peers on the hostlist creates redundancy since we can
never connect to them in Outbound Session or refine them in Refine
Session, so they just pointlessly sit on our greylist forever.