Skip to content

Commit

Permalink
Merge latest unstable
Browse files Browse the repository at this point in the history
  • Loading branch information
AgeManning committed Mar 13, 2023
2 parents 6cf9338 + 90cef1d commit 4988a15
Show file tree
Hide file tree
Showing 30 changed files with 228 additions and 157 deletions.
8 changes: 4 additions & 4 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 beacon_node/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "beacon_node"
version = "3.5.0"
version = "3.5.1"
authors = ["Paul Hauner <paul@paulhauner.com>", "Age Manning <Age@AgeManning.com"]
edition = "2021"

Expand Down
20 changes: 10 additions & 10 deletions beacon_node/beacon_chain/src/events.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,43 +65,43 @@ impl<T: EthSpec> ServerSentEventHandler<T> {
EventKind::Attestation(_) => self
.attestation_tx
.send(kind)
.map(|count| log_count(count, "attestation")),
.map(|count| log_count("attestation", count)),
EventKind::Block(_) => self
.block_tx
.send(kind)
.map(|count| log_count(count, "block")),
.map(|count| log_count("block", count)),
EventKind::FinalizedCheckpoint(_) => self
.finalized_tx
.send(kind)
.map(|count| log_count(count, "finalized checkpoint")),
.map(|count| log_count("finalized checkpoint", count)),
EventKind::Head(_) => self
.head_tx
.send(kind)
.map(|count| log_count(count, "head")),
.map(|count| log_count("head", count)),
EventKind::VoluntaryExit(_) => self
.exit_tx
.send(kind)
.map(|count| log_count(count, "exit")),
.map(|count| log_count("exit", count)),
EventKind::ChainReorg(_) => self
.chain_reorg_tx
.send(kind)
.map(|count| log_count(count, "chain reorg")),
.map(|count| log_count("chain reorg", count)),
EventKind::ContributionAndProof(_) => self
.contribution_tx
.send(kind)
.map(|count| log_count(count, "contribution and proof")),
.map(|count| log_count("contribution and proof", count)),
EventKind::PayloadAttributes(_) => self
.payload_attributes_tx
.send(kind)
.map(|count| log_count(count, "payload attributes")),
.map(|count| log_count("payload attributes", count)),
EventKind::LateHead(_) => self
.late_head
.send(kind)
.map(|count| log_count(count, "late head")),
.map(|count| log_count("late head", count)),
EventKind::BlockReward(_) => self
.block_reward_tx
.send(kind)
.map(|count| log_count(count, "block reward")),
.map(|count| log_count("block reward", count)),
};
if let Err(SendError(event)) = result {
trace!(self.log, "No receivers registered to listen for event"; "event" => ?event);
Expand Down
1 change: 0 additions & 1 deletion beacon_node/beacon_chain/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![recursion_limit = "128"] // For lazy-static
pub mod attestation_rewards;
pub mod attestation_verification;
mod attester_cache;
Expand Down
2 changes: 2 additions & 0 deletions beacon_node/client/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ pub struct Config {
pub monitoring_api: Option<monitoring_api::Config>,
pub slasher: Option<slasher::Config>,
pub logger_config: LoggerConfig,
pub always_prefer_builder_payload: bool,
}

impl Default for Config {
Expand All @@ -105,6 +106,7 @@ impl Default for Config {
validator_monitor_pubkeys: vec![],
validator_monitor_individual_tracking_threshold: DEFAULT_INDIVIDUAL_TRACKING_THRESHOLD,
logger_config: LoggerConfig::default(),
always_prefer_builder_payload: false,
}
}
}
Expand Down
8 changes: 7 additions & 1 deletion beacon_node/execution_layer/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ struct Inner<E: EthSpec> {
payload_cache: PayloadCache<E>,
builder_profit_threshold: Uint256,
log: Logger,
always_prefer_builder_payload: bool,
}

#[derive(Debug, Default, Clone, Serialize, Deserialize)]
Expand All @@ -241,6 +242,7 @@ pub struct Config {
/// The minimum value of an external payload for it to be considered in a proposal.
pub builder_profit_threshold: u128,
pub execution_timeout_multiplier: Option<u32>,
pub always_prefer_builder_payload: bool,
}

/// Provides access to one execution engine and provides a neat interface for consumption by the
Expand All @@ -263,6 +265,7 @@ impl<T: EthSpec> ExecutionLayer<T> {
default_datadir,
builder_profit_threshold,
execution_timeout_multiplier,
always_prefer_builder_payload,
} = config;

if urls.len() > 1 {
Expand Down Expand Up @@ -335,6 +338,7 @@ impl<T: EthSpec> ExecutionLayer<T> {
payload_cache: PayloadCache::default(),
builder_profit_threshold: Uint256::from(builder_profit_threshold),
log,
always_prefer_builder_payload,
};

Ok(Self {
Expand Down Expand Up @@ -796,7 +800,9 @@ impl<T: EthSpec> ExecutionLayer<T> {

let relay_value = relay.data.message.value;
let local_value = *local.block_value();
if local_value >= relay_value {
if !self.inner.always_prefer_builder_payload
&& local_value >= relay_value
{
info!(
self.log(),
"Local block is more profitable than relay block";
Expand Down
Loading

0 comments on commit 4988a15

Please sign in to comment.