Skip to content

Skip calculation of boosted_relay_value when builder_boost_factor pro… #5352

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion beacon_node/http_api/src/produce_block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ use warp::{
Reply,
};

/// If default boost factor is provided in validator/blocks v3 request, we will skip the calculation
/// to keep the precision.
const DEFAULT_BOOST_FACTOR: u64 = 100;

pub fn get_randao_verification(
query: &api_types::ValidatorBlocksQuery,
randao_reveal_infinity: bool,
Expand Down Expand Up @@ -52,14 +56,19 @@ pub async fn produce_block_v3<T: BeaconChainTypes>(
})?;

let randao_verification = get_randao_verification(&query, randao_reveal.is_infinity())?;
let builder_boost_factor = if query.builder_boost_factor == Some(DEFAULT_BOOST_FACTOR) {
None
} else {
query.builder_boost_factor
};

let block_response_type = chain
.produce_block_with_verification(
randao_reveal,
slot,
query.graffiti,
randao_verification,
query.builder_boost_factor,
builder_boost_factor,
BlockProductionVersion::V3,
)
.await
Expand Down