Zebra/zebra-network/src
Janito Vaqueiro Ferreira Filho aaef94c2bf
Prevent burst of reconnection attempts (#2251)
* Rate-limit new outbound peer connections

Set the rate-limiting sleep timer to use a delay added to the maximum
between the next peer connection instant and now. This ensures that the
timer always sleeps at least the time used for the delay.

This change fixes rate-limiting new outbound peer connections, since
before there could be a burst of attempts until the deadline progressed
to the current instant.

Fixes #2216

* Create `MetaAddr::alternate_node_strategy` helper

Creates arbitrary `MetaAddr`s as if they were network nodes that sent
their listening address.

* Test outbound peer connection rate limiting

Tests if connections are rate limited to 10 per second, and also tests
that sleeping before continuing with the attempts still respets the rate
limit and does not result in a burst of reconnection attempts.
2021-06-07 14:13:46 +10:00
..
config Use the default port for configured listen addresses with no port (#2043) 2021-04-21 23:14:29 +00:00
meta_addr Prevent burst of reconnection attempts (#2251) 2021-06-07 14:13:46 +10:00
peer Fix a typo: BIP11 -> BIP111 (#2223) 2021-05-28 14:50:43 +02:00
peer_set Prevent burst of reconnection attempts (#2251) 2021-06-07 14:13:46 +10:00
protocol Derive Arbitrary impls for a bunch of chain and network types (#2179) 2021-05-24 11:10:07 -04:00
address_book.rs Add a DateTime32 type for 32-bit serialized times (#2210) 2021-05-31 12:52:34 +10:00
config.rs Stop trying to resolve empty initial peer lists 2021-05-18 07:54:03 +10:00
constants.rs Add a DateTime32 type for 32-bit serialized times (#2210) 2021-05-31 12:52:34 +10:00
isolated.rs Security: stop gossiping temporary inbound remote addresses to peers 2021-05-14 23:45:42 +10:00
lib.rs Standardise clippy lints and require docs (#2238) 2021-06-04 08:48:40 +10:00
meta_addr.rs Implement `MetaAddr::set_last_seen` setter method 2021-06-01 03:42:08 -03:00
peer.rs Security: stop gossiping temporary inbound remote addresses to peers 2021-05-14 23:45:42 +10:00
peer_set.rs Implement Inventory Tracking RFC (#963) 2020-09-01 14:28:54 -07:00
policies.rs Fix sync algorithm. (#887) 2020-08-12 16:48:01 -07:00
protocol.rs Refactor protocol into internal, external modules. 2019-11-27 05:06:01 -05:00
timestamp_collector.rs Reliability: send local listener address to peers 2021-05-18 14:02:19 +10:00