Skip to content

Commit ec37ad9

Browse files
authored
Merge branch 'unstable' into tracing-spans-test
2 parents 1cd9683 + c06ac81 commit ec37ad9

File tree

19 files changed

+56
-45
lines changed

19 files changed

+56
-45
lines changed

beacon_node/beacon_chain/src/historical_blocks.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
202202
let signature_set = signed_blocks
203203
.iter()
204204
.zip_eq(block_roots)
205-
.filter(|&(_block, block_root)| (block_root != self.genesis_block_root))
205+
.filter(|&(_block, block_root)| block_root != self.genesis_block_root)
206206
.map(|(block, block_root)| {
207207
block_proposal_signature_set_from_parts(
208208
block,

beacon_node/beacon_chain/src/metrics.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1673,15 +1673,19 @@ pub static BLOBS_FROM_EL_EXPECTED: LazyLock<Result<Histogram>> = LazyLock::new(|
16731673
try_create_histogram_with_buckets(
16741674
"beacon_blobs_from_el_expected",
16751675
"Number of blobs expected from the execution layer",
1676-
Ok(vec![0.0, 3.0, 6.0, 9.0, 12.0, 18.0, 24.0, 30.0]),
1676+
Ok(vec![
1677+
0.0, 3.0, 6.0, 9.0, 12.0, 18.0, 24.0, 30.0, 36.0, 42.0, 48.0,
1678+
]),
16771679
)
16781680
});
16791681

16801682
pub static BLOBS_FROM_EL_RECEIVED: LazyLock<Result<Histogram>> = LazyLock::new(|| {
16811683
try_create_histogram_with_buckets(
16821684
"beacon_blobs_from_el_received_total",
16831685
"Number of blobs fetched from the execution layer",
1684-
linear_buckets(0.0, 4.0, 20),
1686+
Ok(vec![
1687+
0.0, 3.0, 6.0, 9.0, 12.0, 18.0, 24.0, 30.0, 36.0, 42.0, 48.0,
1688+
]),
16851689
)
16861690
});
16871691

beacon_node/genesis/src/interop.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ fn alternating_eth1_withdrawal_credentials_fn<'a>(
169169
pubkey: &'a PublicKey,
170170
spec: &'a ChainSpec,
171171
) -> Hash256 {
172-
if index % 2usize == 0usize {
172+
if index.is_multiple_of(2) {
173173
bls_withdrawal_credentials(pubkey, spec)
174174
} else {
175175
eth1_withdrawal_credentials(pubkey, spec)

beacon_node/http_api/src/aggregate_attestation.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,6 @@ pub fn get_aggregate_attestation<T: BeaconChainTypes>(
6363
} else if endpoint_version == V1 {
6464
Ok(warp::reply::json(&GenericResponse::from(aggregate_attestation)).into_response())
6565
} else {
66-
return Err(unsupported_version_rejection(endpoint_version));
66+
Err(unsupported_version_rejection(endpoint_version))
6767
}
6868
}

beacon_node/http_api/tests/tests.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6270,7 +6270,9 @@ impl ApiTester {
62706270

62716271
// Produce a BLS to execution change event
62726272
self.client
6273-
.post_beacon_pool_bls_to_execution_changes(&[self.bls_to_execution_change.clone()])
6273+
.post_beacon_pool_bls_to_execution_changes(std::slice::from_ref(
6274+
&self.bls_to_execution_change,
6275+
))
62746276
.await
62756277
.unwrap();
62766278

beacon_node/lighthouse_network/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ impl<'de> Deserialize<'de> for PeerIdSerialized {
6363
struct ClearDialError<'a>(&'a DialError);
6464

6565
impl ClearDialError<'_> {
66-
fn most_inner_error(err: &(dyn std::error::Error)) -> &(dyn std::error::Error) {
66+
fn most_inner_error(err: &dyn std::error::Error) -> &dyn std::error::Error {
6767
let mut current = err;
6868
while let Some(source) = current.source() {
6969
current = source;

beacon_node/lighthouse_network/tests/rpc_tests.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -652,9 +652,8 @@ fn test_tcp_blocks_by_range_chunked_rpc_terminates_correctly() {
652652
}
653653

654654
// if we need to send messages send them here. This will happen after a delay
655-
if message_info.is_some() {
655+
if let Some((peer_id, inbound_request_id)) = &message_info {
656656
messages_sent += 1;
657-
let (peer_id, inbound_request_id) = message_info.as_ref().unwrap();
658657
receiver.send_response(*peer_id, *inbound_request_id, rpc_response.clone());
659658
debug!("Sending message {}", messages_sent);
660659
if messages_sent == messages_to_send + extra_messages_to_send {
@@ -1074,9 +1073,8 @@ fn test_tcp_blocks_by_root_chunked_rpc_terminates_correctly() {
10741073
}
10751074

10761075
// if we need to send messages send them here. This will happen after a delay
1077-
if message_info.is_some() {
1076+
if let Some((peer_id, inbound_request_id)) = &message_info {
10781077
messages_sent += 1;
1079-
let (peer_id, inbound_request_id) = message_info.as_ref().unwrap();
10801078
receiver.send_response(*peer_id, *inbound_request_id, rpc_response.clone());
10811079
debug!("Sending message {}", messages_sent);
10821080
if messages_sent == messages_to_send + extra_messages_to_send {

beacon_node/store/src/database/redb_impl.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,11 @@ impl<E: EthSpec> Redb<E> {
204204
mut_db.compact().map_err(Into::into).map(|_| ())
205205
}
206206

207-
pub fn iter_column_keys_from<K: Key>(&self, column: DBColumn, from: &[u8]) -> ColumnKeyIter<K> {
207+
pub fn iter_column_keys_from<K: Key>(
208+
&self,
209+
column: DBColumn,
210+
from: &[u8],
211+
) -> ColumnKeyIter<'_, K> {
208212
let table_definition: TableDefinition<'_, &[u8], &[u8]> =
209213
TableDefinition::new(column.into());
210214

@@ -232,11 +236,11 @@ impl<E: EthSpec> Redb<E> {
232236
}
233237

234238
/// Iterate through all keys and values in a particular column.
235-
pub fn iter_column_keys<K: Key>(&self, column: DBColumn) -> ColumnKeyIter<K> {
239+
pub fn iter_column_keys<K: Key>(&self, column: DBColumn) -> ColumnKeyIter<'_, K> {
236240
self.iter_column_keys_from(column, &vec![0; column.key_size()])
237241
}
238242

239-
pub fn iter_column_from<K: Key>(&self, column: DBColumn, from: &[u8]) -> ColumnIter<K> {
243+
pub fn iter_column_from<K: Key>(&self, column: DBColumn, from: &[u8]) -> ColumnIter<'_, K> {
240244
let table_definition: TableDefinition<'_, &[u8], &[u8]> =
241245
TableDefinition::new(column.into());
242246

@@ -269,7 +273,7 @@ impl<E: EthSpec> Redb<E> {
269273
}
270274
}
271275

272-
pub fn iter_column<K: Key>(&self, column: DBColumn) -> ColumnIter<K> {
276+
pub fn iter_column<K: Key>(&self, column: DBColumn) -> ColumnIter<'_, K> {
273277
self.iter_column_from(column, &vec![0; column.key_size()])
274278
}
275279

consensus/state_processing/src/per_block_processing/tests.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -906,7 +906,7 @@ async fn invalid_proposer_slashing_duplicate_slashing() {
906906
let mut ctxt = ConsensusContext::new(state.slot());
907907
let result_1 = process_operations::process_proposer_slashings(
908908
&mut state,
909-
&[proposer_slashing.clone()],
909+
std::slice::from_ref(&proposer_slashing),
910910
VerifySignatures::False,
911911
&mut ctxt,
912912
&spec,
@@ -915,7 +915,7 @@ async fn invalid_proposer_slashing_duplicate_slashing() {
915915

916916
let result_2 = process_operations::process_proposer_slashings(
917917
&mut state,
918-
&[proposer_slashing],
918+
std::slice::from_ref(&proposer_slashing),
919919
VerifySignatures::False,
920920
&mut ctxt,
921921
&spec,

consensus/swap_or_not_shuffle/src/shuffle_list.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,7 @@ pub fn shuffle_list(
9696
loop {
9797
buf.set_round(r);
9898

99-
let pivot = buf.raw_pivot() as usize % list_size;
100-
99+
let pivot = (buf.raw_pivot() % list_size as u64) as usize;
101100
let mirror = (pivot + 1) >> 1;
102101

103102
buf.mix_in_position(pivot >> 8);

0 commit comments

Comments
 (0)