Fix bug in --builder-proposals
(#5151)
* Fix bug in `--builder-proposals` * Add tests * More sensible test order * Fix duplicate builder-boost test case * Cargo fmt and rename
This commit is contained in:
parent
b035638f9b
commit
d2aef1b35c
@ -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_true_override() {
|
||||
let config = Config {
|
||||
builder_proposals: false,
|
||||
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 prefer_builder_proposals_validator() {
|
||||
ApiTester::new()
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user