Merge branch 'unstable' into eip4844

This commit is contained in:
Diva M
2023-03-10 11:19:56 -05:00
29 changed files with 1012 additions and 148 deletions

View File

@@ -268,6 +268,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)]
@@ -290,6 +291,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
@@ -312,6 +314,7 @@ impl<T: EthSpec> ExecutionLayer<T> {
default_datadir,
builder_profit_threshold,
execution_timeout_multiplier,
always_prefer_builder_payload,
} = config;
if urls.len() > 1 {
@@ -384,6 +387,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 {
@@ -845,7 +849,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";