mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-05 09:41:42 +00:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6d5a2b509f | ||
|
|
77eabc5401 |
8
Cargo.lock
generated
8
Cargo.lock
generated
@@ -439,7 +439,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "beacon_node"
|
||||
version = "3.2.0"
|
||||
version = "3.2.1"
|
||||
dependencies = [
|
||||
"beacon_chain",
|
||||
"clap",
|
||||
@@ -597,7 +597,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "boot_node"
|
||||
version = "3.2.0"
|
||||
version = "3.2.1"
|
||||
dependencies = [
|
||||
"beacon_node",
|
||||
"clap",
|
||||
@@ -3105,7 +3105,7 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55"
|
||||
|
||||
[[package]]
|
||||
name = "lcli"
|
||||
version = "3.2.0"
|
||||
version = "3.2.1"
|
||||
dependencies = [
|
||||
"account_utils",
|
||||
"beacon_chain",
|
||||
@@ -3605,7 +3605,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "lighthouse"
|
||||
version = "3.2.0"
|
||||
version = "3.2.1"
|
||||
dependencies = [
|
||||
"account_manager",
|
||||
"account_utils",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "beacon_node"
|
||||
version = "3.2.0"
|
||||
version = "3.2.1"
|
||||
authors = ["Paul Hauner <paul@paulhauner.com>", "Age Manning <Age@AgeManning.com"]
|
||||
edition = "2021"
|
||||
|
||||
|
||||
@@ -654,11 +654,11 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
|
||||
})
|
||||
})
|
||||
.and_then(|mut snapshot| {
|
||||
// Regardless of where we got the state from, attempt to build all the
|
||||
// caches except the tree hash cache.
|
||||
// Regardless of where we got the state from, attempt to build the committee
|
||||
// caches.
|
||||
snapshot
|
||||
.beacon_state
|
||||
.build_all_caches(&self.spec)
|
||||
.build_all_committee_caches(&self.spec)
|
||||
.map_err(Into::into)
|
||||
.map(|()| snapshot)
|
||||
})?;
|
||||
|
||||
@@ -668,10 +668,9 @@ pub fn serve<T: BeaconChainTypes>(
|
||||
"Invalid validator ID".to_string(),
|
||||
))
|
||||
}))
|
||||
.and(log_filter.clone())
|
||||
.and(warp::path::end())
|
||||
.and_then(
|
||||
|state_id: StateId, chain: Arc<BeaconChain<T>>, validator_id: ValidatorId, log| {
|
||||
|state_id: StateId, chain: Arc<BeaconChain<T>>, validator_id: ValidatorId| {
|
||||
blocking_json_task(move || {
|
||||
let (data, execution_optimistic) = state_id
|
||||
.map_state_and_execution_optimistic(
|
||||
@@ -679,23 +678,7 @@ pub fn serve<T: BeaconChainTypes>(
|
||||
|state, execution_optimistic| {
|
||||
let index_opt = match &validator_id {
|
||||
ValidatorId::PublicKey(pubkey) => {
|
||||
// Fast path: use the pubkey cache which is probably
|
||||
// initialised at the head.
|
||||
match state.get_validator_index_read_only(pubkey) {
|
||||
Ok(result) => result,
|
||||
Err(e) => {
|
||||
// Slow path, fall back to iteration.
|
||||
debug!(
|
||||
log,
|
||||
"Validator look-up cache miss";
|
||||
"reason" => ?e,
|
||||
);
|
||||
state
|
||||
.validators()
|
||||
.iter()
|
||||
.position(|v| v.pubkey == *pubkey)
|
||||
}
|
||||
}
|
||||
state.validators().iter().position(|v| v.pubkey == *pubkey)
|
||||
}
|
||||
ValidatorId::Index(index) => Some(*index as usize),
|
||||
};
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "boot_node"
|
||||
version = "3.2.0"
|
||||
version = "3.2.1"
|
||||
authors = ["Sigma Prime <contact@sigmaprime.io>"]
|
||||
edition = "2021"
|
||||
|
||||
|
||||
@@ -17,8 +17,8 @@ pub const VERSION: &str = git_version!(
|
||||
// NOTE: using --match instead of --exclude for compatibility with old Git
|
||||
"--match=thiswillnevermatchlol"
|
||||
],
|
||||
prefix = "Lighthouse/v3.2.0-",
|
||||
fallback = "Lighthouse/v3.2.0"
|
||||
prefix = "Lighthouse/v3.2.1-",
|
||||
fallback = "Lighthouse/v3.2.1"
|
||||
);
|
||||
|
||||
/// Returns `VERSION`, but with platform information appended to the end.
|
||||
|
||||
@@ -447,21 +447,6 @@ impl<T: EthSpec> BeaconState<T> {
|
||||
Ok(self.pubkey_cache().get(pubkey))
|
||||
}
|
||||
|
||||
/// Immutable variant of `get_validator_index` which errors if the cache is not up to date.
|
||||
pub fn get_validator_index_read_only(
|
||||
&self,
|
||||
pubkey: &PublicKeyBytes,
|
||||
) -> Result<Option<usize>, Error> {
|
||||
let pubkey_cache = self.pubkey_cache();
|
||||
if pubkey_cache.len() != self.validators().len() {
|
||||
return Err(Error::PubkeyCacheIncomplete {
|
||||
cache_len: pubkey_cache.len(),
|
||||
registry_len: self.validators().len(),
|
||||
});
|
||||
}
|
||||
Ok(pubkey_cache.get(pubkey))
|
||||
}
|
||||
|
||||
/// The epoch corresponding to `self.slot()`.
|
||||
pub fn current_epoch(&self) -> Epoch {
|
||||
self.slot().epoch(T::slots_per_epoch())
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
[package]
|
||||
name = "lcli"
|
||||
description = "Lighthouse CLI (modeled after zcli)"
|
||||
version = "3.2.0"
|
||||
version = "3.2.1"
|
||||
authors = ["Paul Hauner <paul@paulhauner.com>"]
|
||||
edition = "2021"
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "lighthouse"
|
||||
version = "3.2.0"
|
||||
version = "3.2.1"
|
||||
authors = ["Sigma Prime <contact@sigmaprime.io>"]
|
||||
edition = "2021"
|
||||
autotests = false
|
||||
|
||||
Reference in New Issue
Block a user