mirror of
https://github.com/sigp/lighthouse.git
synced 2026-04-24 00:08:27 +00:00
Compare commits
5 Commits
v7.0.0-bet
...
v7.0.0-bet
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
796e3567c8 | ||
|
|
56bb6c1968 | ||
|
|
8f2194eb2c | ||
|
|
8d058e4040 | ||
|
|
3645d57099 |
8
Cargo.lock
generated
8
Cargo.lock
generated
@@ -860,7 +860,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "beacon_node"
|
name = "beacon_node"
|
||||||
version = "7.0.0-beta.2"
|
version = "7.0.0-beta.3"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"account_utils",
|
"account_utils",
|
||||||
"beacon_chain",
|
"beacon_chain",
|
||||||
@@ -1108,7 +1108,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "boot_node"
|
name = "boot_node"
|
||||||
version = "7.0.0-beta.2"
|
version = "7.0.0-beta.3"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"beacon_node",
|
"beacon_node",
|
||||||
"bytes",
|
"bytes",
|
||||||
@@ -4811,7 +4811,7 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "lcli"
|
name = "lcli"
|
||||||
version = "7.0.0-beta.2"
|
version = "7.0.0-beta.3"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"account_utils",
|
"account_utils",
|
||||||
"beacon_chain",
|
"beacon_chain",
|
||||||
@@ -5366,7 +5366,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "lighthouse"
|
name = "lighthouse"
|
||||||
version = "7.0.0-beta.2"
|
version = "7.0.0-beta.3"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"account_manager",
|
"account_manager",
|
||||||
"account_utils",
|
"account_utils",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "beacon_node"
|
name = "beacon_node"
|
||||||
version = "7.0.0-beta.2"
|
version = "7.0.0-beta.3"
|
||||||
authors = [
|
authors = [
|
||||||
"Paul Hauner <paul@paulhauner.com>",
|
"Paul Hauner <paul@paulhauner.com>",
|
||||||
"Age Manning <Age@AgeManning.com",
|
"Age Manning <Age@AgeManning.com",
|
||||||
|
|||||||
@@ -1783,10 +1783,17 @@ pub fn check_block_is_finalized_checkpoint_or_descendant<
|
|||||||
block: B,
|
block: B,
|
||||||
) -> Result<B, BlockError> {
|
) -> Result<B, BlockError> {
|
||||||
// If we have a split block newer than finalization then we also ban blocks which are not
|
// If we have a split block newer than finalization then we also ban blocks which are not
|
||||||
// descended from that split block.
|
// descended from that split block. It's important not to try checking `is_descendant` if
|
||||||
|
// finality is ahead of the split and the split block has been pruned, as `is_descendant` will
|
||||||
|
// return `false` in this case.
|
||||||
|
let finalized_slot = fork_choice
|
||||||
|
.finalized_checkpoint()
|
||||||
|
.epoch
|
||||||
|
.start_slot(T::EthSpec::slots_per_epoch());
|
||||||
let split = chain.store.get_split_info();
|
let split = chain.store.get_split_info();
|
||||||
let is_descendant_from_split_block =
|
let is_descendant_from_split_block = split.slot == 0
|
||||||
split.slot == 0 || fork_choice.is_descendant(split.block_root, block.parent_root());
|
|| split.slot <= finalized_slot
|
||||||
|
|| fork_choice.is_descendant(split.block_root, block.parent_root());
|
||||||
|
|
||||||
if fork_choice.is_finalized_checkpoint_or_descendant(block.parent_root())
|
if fork_choice.is_finalized_checkpoint_or_descendant(block.parent_root())
|
||||||
&& is_descendant_from_split_block
|
&& is_descendant_from_split_block
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
use crate::errors::BeaconChainError;
|
use crate::errors::BeaconChainError;
|
||||||
use crate::{BeaconChainTypes, BeaconStore};
|
use crate::{BeaconChainTypes, BeaconStore};
|
||||||
use bls::PUBLIC_KEY_UNCOMPRESSED_BYTES_LEN;
|
use bls::PUBLIC_KEY_UNCOMPRESSED_BYTES_LEN;
|
||||||
|
use slog::{debug, Logger};
|
||||||
use smallvec::SmallVec;
|
use smallvec::SmallVec;
|
||||||
use ssz::{Decode, Encode};
|
use ssz::{Decode, Encode};
|
||||||
use ssz_derive::{Decode, Encode};
|
use ssz_derive::{Decode, Encode};
|
||||||
@@ -18,6 +19,7 @@ use types::{BeaconState, FixedBytesExtended, Hash256, PublicKey, PublicKeyBytes}
|
|||||||
/// keys in compressed form and they are needed in decompressed form for signature verification.
|
/// keys in compressed form and they are needed in decompressed form for signature verification.
|
||||||
/// Decompression is expensive when many keys are involved.
|
/// Decompression is expensive when many keys are involved.
|
||||||
pub struct ValidatorPubkeyCache<T: BeaconChainTypes> {
|
pub struct ValidatorPubkeyCache<T: BeaconChainTypes> {
|
||||||
|
log: Logger,
|
||||||
pubkeys: Vec<PublicKey>,
|
pubkeys: Vec<PublicKey>,
|
||||||
indices: HashMap<PublicKeyBytes, usize>,
|
indices: HashMap<PublicKeyBytes, usize>,
|
||||||
pubkey_bytes: Vec<PublicKeyBytes>,
|
pubkey_bytes: Vec<PublicKeyBytes>,
|
||||||
@@ -33,6 +35,7 @@ impl<T: BeaconChainTypes> ValidatorPubkeyCache<T> {
|
|||||||
store: BeaconStore<T>,
|
store: BeaconStore<T>,
|
||||||
) -> Result<Self, BeaconChainError> {
|
) -> Result<Self, BeaconChainError> {
|
||||||
let mut cache = Self {
|
let mut cache = Self {
|
||||||
|
log: store.log.clone(),
|
||||||
pubkeys: vec![],
|
pubkeys: vec![],
|
||||||
indices: HashMap::new(),
|
indices: HashMap::new(),
|
||||||
pubkey_bytes: vec![],
|
pubkey_bytes: vec![],
|
||||||
@@ -64,7 +67,14 @@ impl<T: BeaconChainTypes> ValidatorPubkeyCache<T> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let indices_len = indices.len();
|
||||||
|
debug!(
|
||||||
|
store.log,
|
||||||
|
"Loaded pubkey cache from store. Indices: {}", indices_len
|
||||||
|
);
|
||||||
|
|
||||||
Ok(ValidatorPubkeyCache {
|
Ok(ValidatorPubkeyCache {
|
||||||
|
log: store.log.clone(),
|
||||||
pubkeys,
|
pubkeys,
|
||||||
indices,
|
indices,
|
||||||
pubkey_bytes,
|
pubkey_bytes,
|
||||||
@@ -105,6 +115,12 @@ impl<T: BeaconChainTypes> ValidatorPubkeyCache<T> {
|
|||||||
self.pubkeys.reserve(validator_keys.len());
|
self.pubkeys.reserve(validator_keys.len());
|
||||||
self.indices.reserve(validator_keys.len());
|
self.indices.reserve(validator_keys.len());
|
||||||
|
|
||||||
|
let count = validator_keys.len();
|
||||||
|
debug!(
|
||||||
|
self.log,
|
||||||
|
"Importing new pubkeys to the pubkey cache. count: {}", count
|
||||||
|
);
|
||||||
|
|
||||||
let mut store_ops = Vec::with_capacity(validator_keys.len());
|
let mut store_ops = Vec::with_capacity(validator_keys.len());
|
||||||
for pubkey_bytes in validator_keys {
|
for pubkey_bytes in validator_keys {
|
||||||
let i = self.pubkeys.len();
|
let i = self.pubkeys.len();
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "boot_node"
|
name = "boot_node"
|
||||||
version = "7.0.0-beta.2"
|
version = "7.0.0-beta.3"
|
||||||
authors = ["Sigma Prime <contact@sigmaprime.io>"]
|
authors = ["Sigma Prime <contact@sigmaprime.io>"]
|
||||||
edition = { workspace = true }
|
edition = { workspace = true }
|
||||||
|
|
||||||
|
|||||||
@@ -17,8 +17,8 @@ pub const VERSION: &str = git_version!(
|
|||||||
// NOTE: using --match instead of --exclude for compatibility with old Git
|
// NOTE: using --match instead of --exclude for compatibility with old Git
|
||||||
"--match=thiswillnevermatchlol"
|
"--match=thiswillnevermatchlol"
|
||||||
],
|
],
|
||||||
prefix = "Lighthouse/v7.0.0-beta.2-",
|
prefix = "Lighthouse/v7.0.0-beta.3-",
|
||||||
fallback = "Lighthouse/v7.0.0-beta.2"
|
fallback = "Lighthouse/v7.0.0-beta.3"
|
||||||
);
|
);
|
||||||
|
|
||||||
/// Returns the first eight characters of the latest commit hash for this build.
|
/// Returns the first eight characters of the latest commit hash for this build.
|
||||||
@@ -54,7 +54,7 @@ pub fn version_with_platform() -> String {
|
|||||||
///
|
///
|
||||||
/// `1.5.1`
|
/// `1.5.1`
|
||||||
pub fn version() -> &'static str {
|
pub fn version() -> &'static str {
|
||||||
"7.0.0-beta.2"
|
"7.0.0-beta.3"
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Returns the name of the current client running.
|
/// Returns the name of the current client running.
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "lcli"
|
name = "lcli"
|
||||||
description = "Lighthouse CLI (modeled after zcli)"
|
description = "Lighthouse CLI (modeled after zcli)"
|
||||||
version = "7.0.0-beta.2"
|
version = "7.0.0-beta.3"
|
||||||
authors = ["Paul Hauner <paul@paulhauner.com>"]
|
authors = ["Paul Hauner <paul@paulhauner.com>"]
|
||||||
edition = { workspace = true }
|
edition = { workspace = true }
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "lighthouse"
|
name = "lighthouse"
|
||||||
version = "7.0.0-beta.2"
|
version = "7.0.0-beta.3"
|
||||||
authors = ["Sigma Prime <contact@sigmaprime.io>"]
|
authors = ["Sigma Prime <contact@sigmaprime.io>"]
|
||||||
edition = { workspace = true }
|
edition = { workspace = true }
|
||||||
autotests = false
|
autotests = false
|
||||||
|
|||||||
Reference in New Issue
Block a user