merge with unstable

This commit is contained in:
realbigsean
2022-11-01 13:18:00 -04:00
143 changed files with 4773 additions and 1876 deletions

View File

@@ -1,7 +1,7 @@
[package]
name = "lcli"
description = "Lighthouse CLI (modeled after zcli)"
version = "3.1.2"
version = "3.2.1"
authors = ["Paul Hauner <paul@paulhauner.com>"]
edition = "2021"

View File

@@ -2,7 +2,7 @@
# - from the `lighthouse` dir with the command: `docker build -f ./lcli/Dockerflie .`
# - from the current directory with the command: `docker build -f ./Dockerfile ../`
FROM rust:1.62.1-bullseye AS builder
RUN apt-get update && apt-get -y upgrade && apt-get install -y cmake libclang-dev
RUN apt-get update && apt-get -y upgrade && apt-get install -y cmake libclang-dev protobuf-compiler
COPY . lighthouse
ARG PORTABLE
ENV PORTABLE $PORTABLE

View File

@@ -21,13 +21,9 @@ pub fn run<T: EthSpec>(
.value_of("eth1-endpoint")
.map(|e| {
warn!("The --eth1-endpoint flag is deprecated. Please use --eth1-endpoints instead");
vec![String::from(e)]
String::from(e)
})
.or_else(|| {
matches
.value_of("eth1-endpoints")
.map(|s| s.split(',').map(String::from).collect())
});
.or_else(|| matches.value_of("eth1-endpoints").map(String::from));
let mut eth2_network_config = Eth2NetworkConfig::load(testnet_dir.clone())?;
@@ -35,12 +31,9 @@ pub fn run<T: EthSpec>(
let mut config = Eth1Config::default();
if let Some(v) = endpoints.clone() {
let endpoints = v
.iter()
.map(|s| SensitiveUrl::parse(s))
.collect::<Result<_, _>>()
let endpoint = SensitiveUrl::parse(&v)
.map_err(|e| format!("Unable to parse eth1 endpoint URL: {:?}", e))?;
config.endpoints = Eth1Endpoint::NoAuth(endpoints);
config.endpoint = Eth1Endpoint::NoAuth(endpoint);
}
config.deposit_contract_address = format!("{:?}", spec.deposit_contract_address);
config.deposit_contract_deploy_block = eth2_network_config.deposit_contract_deploy_block;
@@ -49,7 +42,7 @@ pub fn run<T: EthSpec>(
config.node_far_behind_seconds = max(5, config.follow_distance) * spec.seconds_per_eth1_block;
let genesis_service =
Eth1GenesisService::new(config, env.core_context().log().clone(), spec.clone());
Eth1GenesisService::new(config, env.core_context().log().clone(), spec.clone())?;
env.runtime().block_on(async {
let _ = genesis_service

View File

@@ -781,8 +781,8 @@ fn run<T: EthSpec>(
.map_err(|e| format!("should start tokio runtime: {:?}", e))?
.initialize_logger(LoggerConfig {
path: None,
debug_level: "trace",
logfile_debug_level: "trace",
debug_level: String::from("trace"),
logfile_debug_level: String::from("trace"),
log_format: None,
log_color: false,
disable_log_timestamp: false,

View File

@@ -121,7 +121,7 @@ pub fn run<T: EthSpec>(mut env: Environment<T>, matches: &ArgMatches) -> Result<
};
for i in 0..runs {
let mut state = state.clone_with(CloneConfig::committee_caches_only());
let mut state = state.clone_with(CloneConfig::all());
let start = Instant::now();

View File

@@ -74,7 +74,7 @@ use eth2::{
use ssz::Encode;
use state_processing::{
block_signature_verifier::BlockSignatureVerifier, per_block_processing, per_slot_processing,
BlockSignatureStrategy, VerifyBlockRoot,
BlockSignatureStrategy, ConsensusContext, VerifyBlockRoot,
};
use std::borrow::Cow;
use std::fs::File;
@@ -360,6 +360,7 @@ fn do_transition<T: EthSpec>(
decompressor,
&block,
Some(block_root),
Some(block.message().proposer_index()),
spec,
)
.map_err(|e| format!("Invalid block signature: {:?}", e))?;
@@ -367,12 +368,15 @@ fn do_transition<T: EthSpec>(
}
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,
None,
BlockSignatureStrategy::NoVerification,
VerifyBlockRoot::True,
&mut ctxt,
spec,
)
.map_err(|e| format!("State transition failed: {:?}", e))?;