Skip to content

Commit

Permalink
Merge branch 'unstable' into eip4844
Browse files Browse the repository at this point in the history
  • Loading branch information
divagant-martian committed Mar 17, 2023
2 parents 9974dfe + 020fb48 commit 607242c
Show file tree
Hide file tree
Showing 27 changed files with 853 additions and 1,029 deletions.
17 changes: 14 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM rust:1.65.0-bullseye AS builder
FROM rust:1.66.0-bullseye AS builder
RUN apt-get update && apt-get -y upgrade && apt-get install -y cmake clang libclang-dev protobuf-compiler
COPY . lighthouse
ARG FEATURES
Expand Down
14 changes: 2 additions & 12 deletions beacon_node/beacon_chain/src/beacon_chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5291,7 +5291,7 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
latest_valid_hash,
ref validation_error,
} => {
debug!(
warn!(
self.log,
"Invalid execution payload";
"validation_error" => ?validation_error,
Expand All @@ -5300,11 +5300,6 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
"head_block_root" => ?head_block_root,
"method" => "fcU",
);
warn!(
self.log,
"Fork choice update invalidated payload";
"status" => ?status
);

match latest_valid_hash {
// The `latest_valid_hash` is set to `None` when the EE
Expand Down Expand Up @@ -5350,19 +5345,14 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
PayloadStatus::InvalidBlockHash {
ref validation_error,
} => {
debug!(
warn!(
self.log,
"Invalid execution payload block hash";
"validation_error" => ?validation_error,
"head_hash" => ?head_hash,
"head_block_root" => ?head_block_root,
"method" => "fcU",
);
warn!(
self.log,
"Fork choice update invalidated payload";
"status" => ?status
);
// The execution engine has stated that the head block is invalid, however it
// hasn't returned a latest valid ancestor.
//
Expand Down
8 changes: 4 additions & 4 deletions beacon_node/beacon_chain/src/block_verification.rs
Original file line number Diff line number Diff line change
Expand Up @@ -306,10 +306,10 @@ pub enum BlockError<T: EthSpec> {
///
/// ## Peer scoring
///
/// TODO(merge): reconsider how we score peers for this.
///
/// The peer sent us an invalid block, but I'm not really sure how to score this in an
/// "optimistic" sync world.
/// The peer sent us an invalid block, we must penalise harshly.
/// If it's actually our fault (e.g. our execution node database is corrupt) we have bigger
/// problems to worry about than losing peers, and we're doing the network a favour by
/// disconnecting.
ParentExecutionPayloadInvalid {
parent_root: Hash256,
},
Expand Down
4 changes: 2 additions & 2 deletions beacon_node/beacon_chain/src/execution_payload.rs
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ async fn notify_new_payload<'a, T: BeaconChainTypes>(
latest_valid_hash,
ref validation_error,
} => {
debug!(
warn!(
chain.log,
"Invalid execution payload";
"validation_error" => ?validation_error,
Expand Down Expand Up @@ -206,7 +206,7 @@ async fn notify_new_payload<'a, T: BeaconChainTypes>(
PayloadStatus::InvalidBlockHash {
ref validation_error,
} => {
debug!(
warn!(
chain.log,
"Invalid execution payload block hash";
"validation_error" => ?validation_error,
Expand Down
5 changes: 3 additions & 2 deletions beacon_node/beacon_chain/src/validator_monitor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ use std::io;
use std::marker::PhantomData;
use std::str::Utf8Error;
use std::time::{Duration, SystemTime, UNIX_EPOCH};
use store::AbstractExecPayload;
use types::{
AttesterSlashing, BeaconBlockRef, BeaconState, ChainSpec, Epoch, EthSpec, Hash256,
IndexedAttestation, ProposerSlashing, PublicKeyBytes, SignedAggregateAndProof,
Expand Down Expand Up @@ -1736,9 +1737,9 @@ fn u64_to_i64(n: impl Into<u64>) -> i64 {
}

/// Returns the delay between the start of `block.slot` and `seen_timestamp`.
pub fn get_block_delay_ms<T: EthSpec, S: SlotClock>(
pub fn get_block_delay_ms<T: EthSpec, S: SlotClock, P: AbstractExecPayload<T>>(
seen_timestamp: Duration,
block: BeaconBlockRef<'_, T>,
block: BeaconBlockRef<'_, T, P>,
slot_clock: &S,
) -> Duration {
get_slot_delay_ms::<S>(seen_timestamp, block.slot(), slot_clock)
Expand Down
6 changes: 5 additions & 1 deletion beacon_node/client/src/notifier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,11 @@ async fn capella_readiness_logging<T: BeaconChainTypes>(

match beacon_chain.check_capella_readiness().await {
CapellaReadiness::Ready => {
info!(log, "Ready for Capella")
info!(
log,
"Ready for Capella";
"info" => "ensure the execution endpoint is updated to the latest Capella/Shanghai release"
)
}
readiness @ CapellaReadiness::ExchangeCapabilitiesFailed { error: _ } => {
error!(
Expand Down
2 changes: 1 addition & 1 deletion beacon_node/execution_layer/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ const DEFAULT_SUGGESTED_FEE_RECIPIENT: [u8; 20] =
const CONFIG_POLL_INTERVAL: Duration = Duration::from_secs(60);

/// A payload alongside some information about where it came from.
enum ProvenancedPayload<P> {
pub enum ProvenancedPayload<P> {
/// A good ol' fashioned farm-to-table payload from your local EE.
Local(P),
/// A payload from a builder (e.g. mev-boost).
Expand Down
13 changes: 10 additions & 3 deletions beacon_node/http_api/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ use lighthouse_version::version_with_platform;
use network::{NetworkMessage, NetworkSenders, ValidatorSubscriptionMessage};
use operation_pool::ReceivedPreCapella;
use parking_lot::RwLock;
use publish_blocks::ProvenancedBlock;
use serde::{Deserialize, Serialize};
use slog::{crit, debug, error, info, warn, Logger};
use slot_clock::SlotClock;
Expand Down Expand Up @@ -1123,9 +1124,15 @@ pub fn serve<T: BeaconChainTypes>(
chain: Arc<BeaconChain<T>>,
network_tx: UnboundedSender<NetworkMessage<T::EthSpec>>,
log: Logger| async move {
publish_blocks::publish_block(None, block, chain, &network_tx, log)
.await
.map(|()| warp::reply().into_response())
publish_blocks::publish_block(
None,
ProvenancedBlock::Local(block),
chain,
&network_tx,
log,
)
.await
.map(|()| warp::reply().into_response())
},
);

Expand Down
5 changes: 3 additions & 2 deletions beacon_node/http_api/src/metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,10 @@ lazy_static::lazy_static! {
"http_api_beacon_proposer_cache_misses_total",
"Count of times the proposer cache has been missed",
);
pub static ref HTTP_API_BLOCK_BROADCAST_DELAY_TIMES: Result<Histogram> = try_create_histogram(
pub static ref HTTP_API_BLOCK_BROADCAST_DELAY_TIMES: Result<HistogramVec> = try_create_histogram_vec(
"http_api_block_broadcast_delay_times",
"Time between start of the slot and when the block was broadcast"
"Time between start of the slot and when the block was broadcast",
&["provenance"]
);
pub static ref HTTP_API_BLOCK_PUBLISHED_LATE_TOTAL: Result<IntCounter> = try_create_int_counter(
"http_api_block_published_late_total",
Expand Down
Loading

0 comments on commit 607242c

Please sign in to comment.