Merged with unstable

This commit is contained in:
Mark Mackey
2022-11-30 15:14:02 -06:00
125 changed files with 4287 additions and 1502 deletions

View File

@@ -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"

View File

@@ -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;

View File

@@ -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> {

View File

@@ -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()

View File

@@ -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;

View File

@@ -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,