mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-20 05:14:35 +00:00
Kintsugi review comments (#2831)
* Fix makefile * Return on invalid finalized block * Fix todo in gossip scoring * Require --merge for --fee-recipient * Bump eth2_serde_utils * Change schema versions * Swap hash/uint256 test_random impls * Use default for ExecutionPayload::empty * Check for DBs before removing * Remove kintsugi docker image * Fix CLI default value
This commit is contained in:
@@ -3281,6 +3281,9 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
|
||||
"Finalized block has an invalid execution payload.",
|
||||
))
|
||||
.map_err(BeaconChainError::InvalidFinalizedPayloadShutdownError)?;
|
||||
|
||||
// Exit now, the node is in an invalid state.
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
// Due to race conditions, it's technically possible that the head we load here is
|
||||
|
||||
@@ -13,7 +13,7 @@ slog = "2.5.2"
|
||||
futures = "0.3.7"
|
||||
sensitive_url = { path = "../../common/sensitive_url" }
|
||||
reqwest = { version = "0.11.0", features = ["json","stream"] }
|
||||
eth2_serde_utils = { path = "../../consensus/serde_utils" }
|
||||
eth2_serde_utils = "0.1.1"
|
||||
serde_json = "1.0.58"
|
||||
serde = { version = "1.0.116", features = ["derive"] }
|
||||
eth1 = { path = "../eth1" }
|
||||
|
||||
@@ -747,9 +747,7 @@ impl<T: BeaconChainTypes> Worker<T> {
|
||||
self.propagate_validation_result(message_id, peer_id, MessageAcceptance::Ignore);
|
||||
return None;
|
||||
}
|
||||
// TODO: check that this is what we're supposed to do when we don't want to
|
||||
// penalize a peer for our configuration issue
|
||||
// in the verification process BUT is this the proper way to handle it?
|
||||
// TODO(merge): reconsider peer scoring for this event.
|
||||
Err(e @BlockError::ExecutionPayloadError(ExecutionPayloadError::RequestFailed(_)))
|
||||
| Err(e @BlockError::ExecutionPayloadError(ExecutionPayloadError::NoExecutionConnection)) => {
|
||||
debug!(self.log, "Could not verify block for gossip, ignoring the block";
|
||||
|
||||
@@ -406,9 +406,7 @@ pub fn cli_app<'a, 'b>() -> App<'a, 'b> {
|
||||
collected from any blocks produced by this node. Defaults to a junk \
|
||||
address whilst the merge is in development stages. THE DEFAULT VALUE \
|
||||
WILL BE REMOVED BEFORE THE MERGE ENTERS PRODUCTION")
|
||||
// TODO: remove this default value. It's just there to make life easy during merge
|
||||
// testnets.
|
||||
.default_value("0x0000000000000000000000000000000000000001"),
|
||||
.requires("merge")
|
||||
)
|
||||
|
||||
/*
|
||||
|
||||
@@ -14,7 +14,12 @@ use std::net::{IpAddr, Ipv4Addr, ToSocketAddrs};
|
||||
use std::net::{TcpListener, UdpSocket};
|
||||
use std::path::{Path, PathBuf};
|
||||
use std::str::FromStr;
|
||||
use types::{Checkpoint, Epoch, EthSpec, Hash256, PublicKeyBytes, GRAFFITI_BYTES_LEN};
|
||||
use types::{Address, Checkpoint, Epoch, EthSpec, Hash256, PublicKeyBytes, GRAFFITI_BYTES_LEN};
|
||||
|
||||
// TODO(merge): remove this default value. It's just there to make life easy during
|
||||
// early testnets.
|
||||
const DEFAULT_FEE_RECIPIENT: [u8; 20] =
|
||||
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1];
|
||||
|
||||
/// Gets the fully-initialized global client.
|
||||
///
|
||||
@@ -38,12 +43,18 @@ pub fn get_config<E: EthSpec>(
|
||||
// If necessary, remove any existing database and configuration
|
||||
if client_config.data_dir.exists() && cli_args.is_present("purge-db") {
|
||||
// Remove the chain_db.
|
||||
fs::remove_dir_all(client_config.get_db_path())
|
||||
.map_err(|err| format!("Failed to remove chain_db: {}", err))?;
|
||||
let chain_db = client_config.get_db_path();
|
||||
if chain_db.exists() {
|
||||
fs::remove_dir_all(chain_db)
|
||||
.map_err(|err| format!("Failed to remove chain_db: {}", err))?;
|
||||
}
|
||||
|
||||
// Remove the freezer db.
|
||||
fs::remove_dir_all(client_config.get_freezer_db_path())
|
||||
.map_err(|err| format!("Failed to remove chain_db: {}", err))?;
|
||||
let freezer_db = client_config.get_freezer_db_path();
|
||||
if freezer_db.exists() {
|
||||
fs::remove_dir_all(freezer_db)
|
||||
.map_err(|err| format!("Failed to remove freezer_db: {}", err))?;
|
||||
}
|
||||
}
|
||||
|
||||
// Create `datadir` and any non-existing parent directories.
|
||||
@@ -242,7 +253,12 @@ pub fn get_config<E: EthSpec>(
|
||||
client_config.execution_endpoints = Some(client_config.eth1.endpoints.clone());
|
||||
}
|
||||
|
||||
client_config.fee_recipient = clap_utils::parse_optional(cli_args, "fee-recipient")?;
|
||||
client_config.fee_recipient = Some(
|
||||
clap_utils::parse_optional(cli_args, "fee-recipient")?
|
||||
// TODO(merge): remove this default value. It's just there to make life easy during
|
||||
// early testnets.
|
||||
.unwrap_or_else(|| Address::from(DEFAULT_FEE_RECIPIENT)),
|
||||
);
|
||||
|
||||
if let Some(freezer_dir) = cli_args.value_of("freezer-dir") {
|
||||
client_config.freezer_db_path = Some(PathBuf::from(freezer_dir));
|
||||
|
||||
Reference in New Issue
Block a user