mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-06 10:11:44 +00:00
Merge branch 'release-v7.0.0' into v7-backmerge
This commit is contained in:
@@ -991,23 +991,23 @@ impl<E: EthSpec> PeerManager<E> {
|
||||
/// - Do not prune outbound peers to exceed our outbound target.
|
||||
/// - Do not prune more peers than our target peer count.
|
||||
/// - If we have an option to remove a number of peers, remove ones that have the least
|
||||
/// long-lived subnets.
|
||||
/// long-lived subnets.
|
||||
/// - When pruning peers based on subnet count. If multiple peers can be chosen, choose a peer
|
||||
/// that is not subscribed to a long-lived sync committee subnet.
|
||||
/// that is not subscribed to a long-lived sync committee subnet.
|
||||
/// - When pruning peers based on subnet count, do not prune a peer that would lower us below the
|
||||
/// MIN_SYNC_COMMITTEE_PEERS peer count. To keep it simple, we favour a minimum number of sync-committee-peers over
|
||||
/// uniformity subnet peers. NOTE: We could apply more sophisticated logic, but the code is
|
||||
/// simpler and easier to maintain if we take this approach. If we are pruning subnet peers
|
||||
/// below the MIN_SYNC_COMMITTEE_PEERS and maintaining the sync committee peers, this should be
|
||||
/// fine as subnet peers are more likely to be found than sync-committee-peers. Also, we're
|
||||
/// in a bit of trouble anyway if we have so few peers on subnets. The
|
||||
/// MIN_SYNC_COMMITTEE_PEERS
|
||||
/// number should be set low as an absolute lower bound to maintain peers on the sync
|
||||
/// committees.
|
||||
/// MIN_SYNC_COMMITTEE_PEERS peer count. To keep it simple, we favour a minimum number of sync-committee-peers over
|
||||
/// uniformity subnet peers. NOTE: We could apply more sophisticated logic, but the code is
|
||||
/// simpler and easier to maintain if we take this approach. If we are pruning subnet peers
|
||||
/// below the MIN_SYNC_COMMITTEE_PEERS and maintaining the sync committee peers, this should be
|
||||
/// fine as subnet peers are more likely to be found than sync-committee-peers. Also, we're
|
||||
/// in a bit of trouble anyway if we have so few peers on subnets. The
|
||||
/// MIN_SYNC_COMMITTEE_PEERS
|
||||
/// number should be set low as an absolute lower bound to maintain peers on the sync
|
||||
/// committees.
|
||||
/// - Do not prune trusted peers. NOTE: This means if a user has more trusted peers than the
|
||||
/// excess peer limit, all of the following logic is subverted as we will not prune any peers.
|
||||
/// Also, the more trusted peers a user has, the less room Lighthouse has to efficiently manage
|
||||
/// its peers across the subnets.
|
||||
/// excess peer limit, all of the following logic is subverted as we will not prune any peers.
|
||||
/// Also, the more trusted peers a user has, the less room Lighthouse has to efficiently manage
|
||||
/// its peers across the subnets.
|
||||
///
|
||||
/// Prune peers in the following order:
|
||||
/// 1. Remove worst scoring peers
|
||||
|
||||
@@ -153,7 +153,7 @@ impl<E: EthSpec> PeerDB<E> {
|
||||
matches!(
|
||||
self.connection_status(peer_id),
|
||||
Some(PeerConnectionStatus::Disconnected { .. })
|
||||
| Some(PeerConnectionStatus::Unknown { .. })
|
||||
| Some(PeerConnectionStatus::Unknown)
|
||||
| None
|
||||
) && !self.score_state_banned_or_disconnected(peer_id)
|
||||
}
|
||||
@@ -771,8 +771,8 @@ impl<E: EthSpec> PeerDB<E> {
|
||||
NewConnectionState::Connected { .. } // We have established a new connection (peer may not have been seen before)
|
||||
| NewConnectionState::Disconnecting { .. }// We are disconnecting from a peer that may not have been registered before
|
||||
| NewConnectionState::Dialing { .. } // We are dialing a potentially new peer
|
||||
| NewConnectionState::Disconnected { .. } // Dialing a peer that responds by a different ID can be immediately
|
||||
// disconnected without having being stored in the db before
|
||||
| NewConnectionState::Disconnected // Dialing a peer that responds by a different ID can be immediately
|
||||
// disconnected without having being stored in the db before
|
||||
) {
|
||||
warn!(%peer_id, ?new_state, "Updating state of unknown peer");
|
||||
}
|
||||
|
||||
@@ -1010,7 +1010,7 @@ mod tests {
|
||||
BeaconBlockBellatrix::empty(&Spec::default_spec());
|
||||
|
||||
let tx = VariableList::from(vec![0; 1024]);
|
||||
let txs = VariableList::from(std::iter::repeat(tx).take(5000).collect::<Vec<_>>());
|
||||
let txs = VariableList::from(std::iter::repeat_n(tx, 5000).collect::<Vec<_>>());
|
||||
|
||||
block.body.execution_payload.execution_payload.transactions = txs;
|
||||
|
||||
@@ -1030,7 +1030,7 @@ mod tests {
|
||||
BeaconBlockBellatrix::empty(&Spec::default_spec());
|
||||
|
||||
let tx = VariableList::from(vec![0; 1024]);
|
||||
let txs = VariableList::from(std::iter::repeat(tx).take(100000).collect::<Vec<_>>());
|
||||
let txs = VariableList::from(std::iter::repeat_n(tx, 100000).collect::<Vec<_>>());
|
||||
|
||||
block.body.execution_payload.execution_payload.transactions = txs;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user