mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-03 00:31:50 +00:00
Merged with unstable
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
[package]
|
||||
name = "lcli"
|
||||
description = "Lighthouse CLI (modeled after zcli)"
|
||||
version = "3.2.1"
|
||||
version = "3.3.0"
|
||||
authors = ["Paul Hauner <paul@paulhauner.com>"]
|
||||
edition = "2021"
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ use types::{EthSpec, FullPayload, SignedBeaconBlock};
|
||||
|
||||
const HTTP_TIMEOUT: Duration = Duration::from_secs(5);
|
||||
|
||||
pub fn run<T: EthSpec>(mut env: Environment<T>, matches: &ArgMatches) -> Result<(), String> {
|
||||
pub fn run<T: EthSpec>(env: Environment<T>, matches: &ArgMatches) -> Result<(), String> {
|
||||
let spec = &T::default_spec();
|
||||
let executor = env.core_context().executor;
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ use types::EthSpec;
|
||||
pub const ETH1_GENESIS_UPDATE_INTERVAL: Duration = Duration::from_millis(7_000);
|
||||
|
||||
pub fn run<T: EthSpec>(
|
||||
mut env: Environment<T>,
|
||||
env: Environment<T>,
|
||||
testnet_dir: PathBuf,
|
||||
matches: &ArgMatches<'_>,
|
||||
) -> Result<(), String> {
|
||||
|
||||
@@ -789,6 +789,7 @@ fn run<T: EthSpec>(
|
||||
max_log_size: 0,
|
||||
max_log_number: 0,
|
||||
compression: false,
|
||||
is_restricted: true,
|
||||
})
|
||||
.map_err(|e| format!("should start logger: {:?}", e))?
|
||||
.build()
|
||||
|
||||
@@ -59,7 +59,7 @@ use types::{BeaconState, CloneConfig, EthSpec, Hash256};
|
||||
|
||||
const HTTP_TIMEOUT: Duration = Duration::from_secs(10);
|
||||
|
||||
pub fn run<T: EthSpec>(mut env: Environment<T>, matches: &ArgMatches) -> Result<(), String> {
|
||||
pub fn run<T: EthSpec>(env: Environment<T>, matches: &ArgMatches) -> Result<(), String> {
|
||||
let spec = &T::default_spec();
|
||||
let executor = env.core_context().executor;
|
||||
|
||||
|
||||
@@ -94,7 +94,7 @@ struct Config {
|
||||
exclude_post_block_thc: bool,
|
||||
}
|
||||
|
||||
pub fn run<T: EthSpec>(mut env: Environment<T>, matches: &ArgMatches) -> Result<(), String> {
|
||||
pub fn run<T: EthSpec>(env: Environment<T>, matches: &ArgMatches) -> Result<(), String> {
|
||||
let spec = &T::default_spec();
|
||||
let executor = env.core_context().executor;
|
||||
|
||||
@@ -339,6 +339,10 @@ fn do_transition<T: EthSpec>(
|
||||
.map_err(|e| format!("Unable to build caches: {:?}", e))?;
|
||||
debug!("Build all caches (again): {:?}", t.elapsed());
|
||||
|
||||
let mut ctxt = ConsensusContext::new(pre_state.slot())
|
||||
.set_current_block_root(block_root)
|
||||
.set_proposer_index(block.message().proposer_index());
|
||||
|
||||
if !config.no_signature_verification {
|
||||
let get_pubkey = move |validator_index| {
|
||||
validator_pubkey_cache
|
||||
@@ -359,18 +363,20 @@ fn do_transition<T: EthSpec>(
|
||||
get_pubkey,
|
||||
decompressor,
|
||||
&block,
|
||||
Some(block_root),
|
||||
Some(block.message().proposer_index()),
|
||||
&mut ctxt,
|
||||
spec,
|
||||
)
|
||||
.map_err(|e| format!("Invalid block signature: {:?}", e))?;
|
||||
debug!("Batch verify block signatures: {:?}", t.elapsed());
|
||||
|
||||
// Signature verification should prime the indexed attestation cache.
|
||||
assert_eq!(
|
||||
ctxt.num_cached_indexed_attestations(),
|
||||
block.message().body().attestations().len()
|
||||
);
|
||||
}
|
||||
|
||||
let t = Instant::now();
|
||||
let mut ctxt = ConsensusContext::new(pre_state.slot())
|
||||
.set_current_block_root(block_root)
|
||||
.set_proposer_index(block.message().proposer_index());
|
||||
per_block_processing(
|
||||
&mut pre_state,
|
||||
&block,
|
||||
|
||||
Reference in New Issue
Block a user