Skip to content

Commit 0e6da0f

Browse files
committed
Merge branch 'release-v7.0.0' into v7-backmerge
2 parents d6cd049 + 82d1674 commit 0e6da0f

File tree

29 files changed

+65
-54
lines changed

29 files changed

+65
-54
lines changed

beacon_node/beacon_chain/src/beacon_chain.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -738,7 +738,7 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
738738
///
739739
/// - `slot` always increases by `1`.
740740
/// - Skipped slots contain the root of the closest prior
741-
/// non-skipped slot (identical to the way they are stored in `state.block_roots`).
741+
/// non-skipped slot (identical to the way they are stored in `state.block_roots`).
742742
/// - Iterator returns `(Hash256, Slot)`.
743743
///
744744
/// Will return a `BlockOutOfRange` error if the requested start slot is before the period of
@@ -802,7 +802,7 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
802802
///
803803
/// - `slot` always decreases by `1`.
804804
/// - Skipped slots contain the root of the closest prior
805-
/// non-skipped slot (identical to the way they are stored in `state.block_roots`) .
805+
/// non-skipped slot (identical to the way they are stored in `state.block_roots`) .
806806
/// - Iterator returns `(Hash256, Slot)`.
807807
/// - The provided `block_root` is included as the first item in the iterator.
808808
pub fn rev_iter_block_roots_from(
@@ -831,7 +831,7 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
831831
/// - `slot` always decreases by `1`.
832832
/// - Iterator returns `(Hash256, Slot)`.
833833
/// - As this iterator starts at the `head` of the chain (viz., the best block), the first slot
834-
/// returned may be earlier than the wall-clock slot.
834+
/// returned may be earlier than the wall-clock slot.
835835
pub fn rev_iter_state_roots_from<'a>(
836836
&'a self,
837837
state_root: Hash256,

beacon_node/beacon_chain/src/beacon_proposer_cache.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ pub fn compute_proposer_duties_from_head<T: BeaconChainTypes>(
178178
/// - Returns an error if `state.current_epoch() > target_epoch`.
179179
/// - No-op if `state.current_epoch() == target_epoch`.
180180
/// - It must be the case that `state.canonical_root() == state_root`, but this function will not
181-
/// check that.
181+
/// check that.
182182
pub fn ensure_state_is_in_epoch<E: EthSpec>(
183183
state: &mut BeaconState<E>,
184184
state_root: Hash256,

beacon_node/beacon_chain/src/block_verification.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
//! - Verification for gossip blocks (i.e., should we gossip some block from the network).
66
//! - Verification for normal blocks (e.g., some block received on the RPC during a parent lookup).
77
//! - Verification for chain segments (e.g., some chain of blocks received on the RPC during a
8-
//! sync).
8+
//! sync).
99
//!
1010
//! The primary source of complexity here is that we wish to avoid doing duplicate work as a block
1111
//! moves through the verification process. For example, if some block is verified for gossip, we

beacon_node/beacon_chain/src/early_attester_cache.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ pub struct CacheItem<E: EthSpec> {
3333
///
3434
/// - Produce an attestation without using `chain.canonical_head`.
3535
/// - Verify that a block root exists (i.e., will be imported in the future) during attestation
36-
/// verification.
36+
/// verification.
3737
/// - Provide a block which can be sent to peers via RPC.
3838
#[derive(Default)]
3939
pub struct EarlyAttesterCache<E: EthSpec> {

beacon_node/beacon_chain/src/eth1_finalization_cache.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,7 @@ pub mod tests {
461461
let last_finalized_eth1 = eth1s_by_count
462462
.range(0..(finalized_deposits + 1))
463463
.map(|(_, eth1)| eth1)
464-
.last()
464+
.next_back()
465465
.cloned();
466466
assert_eq!(
467467
eth1cache.finalize(finalized_checkpoint),

beacon_node/beacon_chain/tests/payload_invalidation.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1282,7 +1282,7 @@ impl InvalidHeadSetup {
12821282
///
12831283
/// 1. A chain where the only viable head block has an invalid execution payload.
12841284
/// 2. A block (`fork_block`) which will become the head of the chain when
1285-
/// it is imported.
1285+
/// it is imported.
12861286
async fn new() -> InvalidHeadSetup {
12871287
let slots_per_epoch = E::slots_per_epoch();
12881288
let mut rig = InvalidPayloadRig::new().enable_attestations();

beacon_node/execution_layer/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1682,7 +1682,7 @@ impl<E: EthSpec> ExecutionLayer<E> {
16821682
///
16831683
/// - `Some(true)` if the given `block_hash` is the terminal proof-of-work block.
16841684
/// - `Some(false)` if the given `block_hash` is certainly *not* the terminal proof-of-work
1685-
/// block.
1685+
/// block.
16861686
/// - `None` if the `block_hash` or its parent were not present on the execution engine.
16871687
/// - `Err(_)` if there was an error connecting to the execution engine.
16881688
///

beacon_node/lighthouse_network/src/peer_manager/mod.rs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -991,23 +991,23 @@ impl<E: EthSpec> PeerManager<E> {
991991
/// - Do not prune outbound peers to exceed our outbound target.
992992
/// - Do not prune more peers than our target peer count.
993993
/// - If we have an option to remove a number of peers, remove ones that have the least
994-
/// long-lived subnets.
994+
/// long-lived subnets.
995995
/// - When pruning peers based on subnet count. If multiple peers can be chosen, choose a peer
996-
/// that is not subscribed to a long-lived sync committee subnet.
996+
/// that is not subscribed to a long-lived sync committee subnet.
997997
/// - When pruning peers based on subnet count, do not prune a peer that would lower us below the
998-
/// MIN_SYNC_COMMITTEE_PEERS peer count. To keep it simple, we favour a minimum number of sync-committee-peers over
999-
/// uniformity subnet peers. NOTE: We could apply more sophisticated logic, but the code is
1000-
/// simpler and easier to maintain if we take this approach. If we are pruning subnet peers
1001-
/// below the MIN_SYNC_COMMITTEE_PEERS and maintaining the sync committee peers, this should be
1002-
/// fine as subnet peers are more likely to be found than sync-committee-peers. Also, we're
1003-
/// in a bit of trouble anyway if we have so few peers on subnets. The
1004-
/// MIN_SYNC_COMMITTEE_PEERS
1005-
/// number should be set low as an absolute lower bound to maintain peers on the sync
1006-
/// committees.
998+
/// MIN_SYNC_COMMITTEE_PEERS peer count. To keep it simple, we favour a minimum number of sync-committee-peers over
999+
/// uniformity subnet peers. NOTE: We could apply more sophisticated logic, but the code is
1000+
/// simpler and easier to maintain if we take this approach. If we are pruning subnet peers
1001+
/// below the MIN_SYNC_COMMITTEE_PEERS and maintaining the sync committee peers, this should be
1002+
/// fine as subnet peers are more likely to be found than sync-committee-peers. Also, we're
1003+
/// in a bit of trouble anyway if we have so few peers on subnets. The
1004+
/// MIN_SYNC_COMMITTEE_PEERS
1005+
/// number should be set low as an absolute lower bound to maintain peers on the sync
1006+
/// committees.
10071007
/// - Do not prune trusted peers. NOTE: This means if a user has more trusted peers than the
1008-
/// excess peer limit, all of the following logic is subverted as we will not prune any peers.
1009-
/// Also, the more trusted peers a user has, the less room Lighthouse has to efficiently manage
1010-
/// its peers across the subnets.
1008+
/// excess peer limit, all of the following logic is subverted as we will not prune any peers.
1009+
/// Also, the more trusted peers a user has, the less room Lighthouse has to efficiently manage
1010+
/// its peers across the subnets.
10111011
///
10121012
/// Prune peers in the following order:
10131013
/// 1. Remove worst scoring peers

beacon_node/lighthouse_network/src/peer_manager/peerdb.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ impl<E: EthSpec> PeerDB<E> {
153153
matches!(
154154
self.connection_status(peer_id),
155155
Some(PeerConnectionStatus::Disconnected { .. })
156-
| Some(PeerConnectionStatus::Unknown { .. })
156+
| Some(PeerConnectionStatus::Unknown)
157157
| None
158158
) && !self.score_state_banned_or_disconnected(peer_id)
159159
}
@@ -771,8 +771,8 @@ impl<E: EthSpec> PeerDB<E> {
771771
NewConnectionState::Connected { .. } // We have established a new connection (peer may not have been seen before)
772772
| NewConnectionState::Disconnecting { .. }// We are disconnecting from a peer that may not have been registered before
773773
| NewConnectionState::Dialing { .. } // We are dialing a potentially new peer
774-
| NewConnectionState::Disconnected { .. } // Dialing a peer that responds by a different ID can be immediately
775-
// disconnected without having being stored in the db before
774+
| NewConnectionState::Disconnected // Dialing a peer that responds by a different ID can be immediately
775+
// disconnected without having being stored in the db before
776776
) {
777777
warn!(%peer_id, ?new_state, "Updating state of unknown peer");
778778
}

beacon_node/lighthouse_network/src/rpc/codec.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1010,7 +1010,7 @@ mod tests {
10101010
BeaconBlockBellatrix::empty(&Spec::default_spec());
10111011

10121012
let tx = VariableList::from(vec![0; 1024]);
1013-
let txs = VariableList::from(std::iter::repeat(tx).take(5000).collect::<Vec<_>>());
1013+
let txs = VariableList::from(std::iter::repeat_n(tx, 5000).collect::<Vec<_>>());
10141014

10151015
block.body.execution_payload.execution_payload.transactions = txs;
10161016

@@ -1030,7 +1030,7 @@ mod tests {
10301030
BeaconBlockBellatrix::empty(&Spec::default_spec());
10311031

10321032
let tx = VariableList::from(vec![0; 1024]);
1033-
let txs = VariableList::from(std::iter::repeat(tx).take(100000).collect::<Vec<_>>());
1033+
let txs = VariableList::from(std::iter::repeat_n(tx, 100000).collect::<Vec<_>>());
10341034

10351035
block.body.execution_payload.execution_payload.transactions = txs;
10361036

0 commit comments

Comments
 (0)