Skip to content

Commit 3a996fb

Browse files
committed
Merge remote-tracking branch 'origin/stable' into unstable
2 parents 22ccdb6 + d6ba8c3 commit 3a996fb

File tree

19 files changed

+146
-89
lines changed

19 files changed

+146
-89
lines changed

Cargo.lock

+5-6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+4-1
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ bytes = "1"
107107
clap = { version = "4.5.4", features = ["derive", "cargo", "wrap_help"] }
108108
# Turn off c-kzg's default features which include `blst/portable`. We can turn on blst's portable
109109
# feature ourselves when desired.
110-
c-kzg = { version = "1", default-features = false }
110+
c-kzg = { version = "1", default-features = false }
111111
compare_fields_derive = { path = "common/compare_fields_derive" }
112112
criterion = "0.5"
113113
delay_map = "0.3"
@@ -240,6 +240,9 @@ validator_client = { path = "validator_client" }
240240
validator_dir = { path = "common/validator_dir" }
241241
warp_utils = { path = "common/warp_utils" }
242242

243+
[patch.crates-io]
244+
quick-protobuf = { git = "https://github.com/sigp/quick-protobuf.git", rev = "681f413312404ab6e51f0b46f39b0075c6f4ebfd" }
245+
243246
[profile.maxperf]
244247
inherits = "release"
245248
lto = "fat"

beacon_node/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "beacon_node"
3-
version = "5.2.1"
3+
version = "5.3.0"
44
authors = [
55
"Paul Hauner <[email protected]>",
66
"Age Manning <[email protected]",

beacon_node/beacon_chain/src/canonical_head.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ use fork_choice::{
4848
};
4949
use itertools::process_results;
5050
use parking_lot::{Mutex, RwLock, RwLockReadGuard, RwLockWriteGuard};
51-
use slog::{crit, debug, error, warn, Logger};
51+
use slog::{crit, debug, error, info, warn, Logger};
5252
use slot_clock::SlotClock;
5353
use state_processing::AllCaches;
5454
use std::sync::Arc;
@@ -1212,7 +1212,7 @@ fn detect_reorg<E: EthSpec>(
12121212
&metrics::FORK_CHOICE_REORG_DISTANCE,
12131213
reorg_distance.as_u64() as i64,
12141214
);
1215-
warn!(
1215+
info!(
12161216
log,
12171217
"Beacon chain re-org";
12181218
"previous_head" => ?old_block_root,

beacon_node/eth1/src/service.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1129,7 +1129,7 @@ impl Service {
11291129

11301130
Ok(BlockCacheUpdateOutcome {
11311131
blocks_imported,
1132-
head_block_number: self.inner.block_cache.read().highest_block_number(),
1132+
head_block_number: block_cache.highest_block_number(),
11331133
})
11341134
}
11351135
}

beacon_node/network/src/sync/range_sync/chain.rs

+4-8
Original file line numberDiff line numberDiff line change
@@ -111,9 +111,6 @@ pub struct SyncingChain<T: BeaconChainTypes> {
111111
/// The current processing batch, if any.
112112
current_processing_batch: Option<BatchId>,
113113

114-
/// Batches validated by this chain.
115-
validated_batches: u64,
116-
117114
/// The chain's log.
118115
log: slog::Logger,
119116
}
@@ -161,7 +158,6 @@ impl<T: BeaconChainTypes> SyncingChain<T> {
161158
attempted_optimistic_starts: HashSet::default(),
162159
state: ChainSyncingState::Stopped,
163160
current_processing_batch: None,
164-
validated_batches: 0,
165161
log: log.new(o!("chain" => id)),
166162
}
167163
}
@@ -182,8 +178,10 @@ impl<T: BeaconChainTypes> SyncingChain<T> {
182178
}
183179

184180
/// Progress in epochs made by the chain
185-
pub fn validated_epochs(&self) -> u64 {
186-
self.validated_batches * EPOCHS_PER_BATCH
181+
pub fn processed_epochs(&self) -> u64 {
182+
self.processing_target
183+
.saturating_sub(self.start_epoch)
184+
.into()
187185
}
188186

189187
/// Returns the total count of pending blocks in all the batches of this chain
@@ -655,7 +653,6 @@ impl<T: BeaconChainTypes> SyncingChain<T> {
655653
let removed_batches = std::mem::replace(&mut self.batches, remaining_batches);
656654

657655
for (id, batch) in removed_batches.into_iter() {
658-
self.validated_batches = self.validated_batches.saturating_add(1);
659656
// only for batches awaiting validation can we be sure the last attempt is
660657
// right, and thus, that any different attempt is wrong
661658
match batch.state() {
@@ -1212,7 +1209,6 @@ impl<T: BeaconChainTypes> slog::KV for SyncingChain<T> {
12121209
)?;
12131210
serializer.emit_usize("batches", self.batches.len())?;
12141211
serializer.emit_usize("peers", self.peers.len())?;
1215-
serializer.emit_u64("validated_batches", self.validated_batches)?;
12161212
serializer.emit_arguments("state", &format_args!("{:?}", self.state))?;
12171213
slog::Result::Ok(())
12181214
}

beacon_node/network/src/sync/range_sync/chain_collection.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ use types::{Epoch, Hash256, Slot};
2424
const PARALLEL_HEAD_CHAINS: usize = 2;
2525

2626
/// Minimum work we require a finalized chain to do before picking a chain with more peers.
27-
const MIN_FINALIZED_CHAIN_VALIDATED_EPOCHS: u64 = 10;
27+
const MIN_FINALIZED_CHAIN_PROCESSED_EPOCHS: u64 = 10;
2828

2929
/// The state of the long range/batch sync.
3030
#[derive(Clone)]
@@ -273,8 +273,8 @@ impl<T: BeaconChainTypes, C: BlockStorage> ChainCollection<T, C> {
273273
// chains are different, check that they don't have the same number of peers
274274
if let Some(syncing_chain) = self.finalized_chains.get_mut(&syncing_id) {
275275
if max_peers > syncing_chain.available_peers()
276-
&& syncing_chain.validated_epochs()
277-
> MIN_FINALIZED_CHAIN_VALIDATED_EPOCHS
276+
&& syncing_chain.processed_epochs()
277+
> MIN_FINALIZED_CHAIN_PROCESSED_EPOCHS
278278
{
279279
syncing_chain.stop_syncing();
280280
old_id = Some(Some(syncing_id));

book/src/late-block-re-orgs.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,10 @@ A pair of messages at `INFO` level will be logged if a re-org opportunity is det
5050
5151
> INFO Proposing block to re-org current head head_to_reorg: 0xf64f…2b49, slot: 1105320
5252
53-
This should be followed shortly after by a `WARN` log indicating that a re-org occurred. This is
53+
This should be followed shortly after by a `INFO` log indicating that a re-org occurred. This is
5454
expected and normal:
5555

56-
> WARN Beacon chain re-org reorg_distance: 1, new_slot: 1105320, new_head: 0x72791549e4ca792f91053bc7cf1e55c6fbe745f78ce7a16fc3acb6f09161becd, previous_slot: 1105319, previous_head: 0xf64f8e5ed617dc18c1e759dab5d008369767c3678416dac2fe1d389562842b49
56+
> INFO Beacon chain re-org reorg_distance: 1, new_slot: 1105320, new_head: 0x72791549e4ca792f91053bc7cf1e55c6fbe745f78ce7a16fc3acb6f09161becd, previous_slot: 1105319, previous_head: 0xf64f8e5ed617dc18c1e759dab5d008369767c3678416dac2fe1d389562842b49
5757
5858
In case a re-org is not viable (which should be most of the time), Lighthouse will just propose a
5959
block as normal and log the reason the re-org was not attempted at debug level:

boot_node/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "boot_node"
3-
version = "5.2.1"
3+
version = "5.3.0"
44
authors = ["Sigma Prime <[email protected]>"]
55
edition = { workspace = true }
66

common/eth2/src/lib.rs

+8-1
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ impl fmt::Display for Error {
121121
pub struct Timeouts {
122122
pub attestation: Duration,
123123
pub attester_duties: Duration,
124+
pub attestation_subscriptions: Duration,
124125
pub liveness: Duration,
125126
pub proposal: Duration,
126127
pub proposer_duties: Duration,
@@ -137,6 +138,7 @@ impl Timeouts {
137138
Timeouts {
138139
attestation: timeout,
139140
attester_duties: timeout,
141+
attestation_subscriptions: timeout,
140142
liveness: timeout,
141143
proposal: timeout,
142144
proposer_duties: timeout,
@@ -2540,7 +2542,12 @@ impl BeaconNodeHttpClient {
25402542
.push("validator")
25412543
.push("beacon_committee_subscriptions");
25422544

2543-
self.post(path, &subscriptions).await?;
2545+
self.post_with_timeout(
2546+
path,
2547+
&subscriptions,
2548+
self.timeouts.attestation_subscriptions,
2549+
)
2550+
.await?;
25442551

25452552
Ok(())
25462553
}

common/lighthouse_version/src/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ pub const VERSION: &str = git_version!(
1717
// NOTE: using --match instead of --exclude for compatibility with old Git
1818
"--match=thiswillnevermatchlol"
1919
],
20-
prefix = "Lighthouse/v5.2.1-",
21-
fallback = "Lighthouse/v5.2.1"
20+
prefix = "Lighthouse/v5.3.0-",
21+
fallback = "Lighthouse/v5.3.0"
2222
);
2323

2424
/// Returns the first eight characters of the latest commit hash for this build.

consensus/types/src/chain_spec.rs

+15
Original file line numberDiff line numberDiff line change
@@ -1372,10 +1372,13 @@ pub struct Config {
13721372
#[serde(with = "serde_utils::quoted_u64")]
13731373
max_per_epoch_activation_exit_churn_limit: u64,
13741374

1375+
#[serde(default = "default_custody_requirement")]
13751376
#[serde(with = "serde_utils::quoted_u64")]
13761377
custody_requirement: u64,
1378+
#[serde(default = "default_data_column_sidecar_subnet_count")]
13771379
#[serde(with = "serde_utils::quoted_u64")]
13781380
data_column_sidecar_subnet_count: u64,
1381+
#[serde(default = "default_number_of_columns")]
13791382
#[serde(with = "serde_utils::quoted_u64")]
13801383
number_of_columns: u64,
13811384
}
@@ -1516,6 +1519,18 @@ const fn default_maximum_gossip_clock_disparity_millis() -> u64 {
15161519
500
15171520
}
15181521

1522+
const fn default_custody_requirement() -> u64 {
1523+
1
1524+
}
1525+
1526+
const fn default_data_column_sidecar_subnet_count() -> u64 {
1527+
32
1528+
}
1529+
1530+
const fn default_number_of_columns() -> u64 {
1531+
128
1532+
}
1533+
15191534
fn max_blocks_by_root_request_common(max_request_blocks: u64) -> usize {
15201535
let max_request_blocks = max_request_blocks as usize;
15211536
RuntimeVariableList::<Hash256>::from_vec(

lcli/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "lcli"
33
description = "Lighthouse CLI (modeled after zcli)"
4-
version = "5.2.1"
4+
version = "5.3.0"
55
authors = ["Paul Hauner <[email protected]>"]
66
edition = { workspace = true }
77

lighthouse/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "lighthouse"
3-
version = "5.2.1"
3+
version = "5.3.0"
44
authors = ["Sigma Prime <[email protected]>"]
55
edition = { workspace = true }
66
autotests = false

slasher/src/database/lmdb_impl.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -165,8 +165,12 @@ impl<'env> Cursor<'env> {
165165
}
166166

167167
pub fn get_current(&mut self) -> Result<Option<(Key<'env>, Value<'env>)>, Error> {
168+
// FIXME: lmdb has an extremely broken API which can mutate the SHARED REFERENCE
169+
// `value` after `get_current` is called. We need to convert it to a Vec here in order
170+
// to avoid `value` changing after another cursor operation. I think this represents a bug
171+
// in the LMDB bindings, as shared references should be immutable.
168172
if let Some((Some(key), value)) = self.cursor.get(None, None, MDB_GET_CURRENT).optional()? {
169-
Ok(Some((Cow::Borrowed(key), Cow::Borrowed(value))))
173+
Ok(Some((Cow::Borrowed(key), Cow::Owned(value.to_vec()))))
170174
} else {
171175
Ok(None)
172176
}

slasher/tests/random.rs

+5
Original file line numberDiff line numberDiff line change
@@ -235,3 +235,8 @@ fn no_crash_blocks_example1() {
235235
},
236236
);
237237
}
238+
239+
#[test]
240+
fn no_crash_aug_24() {
241+
random_test(13519442335106054152, TestConfig::default())
242+
}

0 commit comments

Comments
 (0)