Skip to content
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

Fix bug in --builder-proposals #5151

Merged
merged 5 commits into from
Jan 31, 2024
Merged
Show file tree
Hide file tree
Changes from 3 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
52 changes: 52 additions & 0 deletions validator_client/src/http_api/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1177,6 +1177,58 @@ async fn validator_derived_builder_boost_factor_with_process_defaults() {
.await;
}

#[tokio::test]
async fn validator_builder_boost_factor_global_builder_proposals_true() {
let config = Config {
builder_proposals: true,
prefer_builder_proposals: false,
builder_boost_factor: None,
..Config::default()
};
ApiTester::new_with_config(config)
.await
.assert_default_builder_boost_factor(None);
}

#[tokio::test]
async fn validator_builder_boost_factor_global_builder_proposals_false() {
let config = Config {
builder_proposals: false,
prefer_builder_proposals: false,
builder_boost_factor: None,
..Config::default()
};
ApiTester::new_with_config(config)
.await
.assert_default_builder_boost_factor(Some(0));
}

#[tokio::test]
async fn validator_builder_boost_factor_global_prefer_builder_proposals_true() {
let config = Config {
builder_proposals: true,
prefer_builder_proposals: true,
builder_boost_factor: None,
..Config::default()
};
ApiTester::new_with_config(config)
.await
.assert_default_builder_boost_factor(Some(u64::MAX));
}

#[tokio::test]
async fn validator_builder_boost_factor_global_prefer_builder_proposals_false() {
let config = Config {
builder_proposals: true,
prefer_builder_proposals: false,
builder_boost_factor: None,
..Config::default()
};
ApiTester::new_with_config(config)
.await
.assert_default_builder_boost_factor(None);
jimmygchen marked this conversation as resolved.
Show resolved Hide resolved
jimmygchen marked this conversation as resolved.
Show resolved Hide resolved
}

#[tokio::test]
async fn prefer_builder_proposals_validator() {
ApiTester::new()
Expand Down
2 changes: 1 addition & 1 deletion validator_client/src/validator_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -572,7 +572,7 @@ impl<T: SlotClock + 'static, E: EthSpec> ValidatorStore<T, E> {
return Some(u64::MAX);
}
self.builder_boost_factor.or({
if self.builder_proposals {
if !self.builder_proposals {
Some(0)
} else {
None
Expand Down
Loading