mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-18 12:22:51 +00:00
Add a flag to always use payloads from builders (#4052)
## Issue Addressed #4040 ## Proposed Changes - Add the `always_prefer_builder_payload` field to `Config` in `beacon_node/client/src/config.rs`. - Add that same field to `Inner` in `beacon_node/execution_layer/src/lib.rs` - Modify the logic for picking the payload in `beacon_node/execution_layer/src/lib.rs` - Add the `always-prefer-builder-payload` flag to the beacon node CLI - Test the new flags in `lighthouse/tests/beacon_node.rs` Co-authored-by: Paul Hauner <paul@paulhauner.com>
This commit is contained in:
@@ -957,4 +957,13 @@ pub fn cli_app<'a, 'b>() -> App<'a, 'b> {
|
||||
This is equivalent to --http and --validator-monitor-auto.")
|
||||
.takes_value(false)
|
||||
)
|
||||
.arg(
|
||||
Arg::with_name("always-prefer-builder-payload")
|
||||
.long("always-prefer-builder-payload")
|
||||
.help("If set, the beacon node always uses the payload from the builder instead of the local payload.")
|
||||
// The builder profit threshold flag is used to provide preference
|
||||
// to local payloads, therefore it fundamentally conflicts with
|
||||
// always using the builder.
|
||||
.conflicts_with("builder-profit-threshold")
|
||||
)
|
||||
}
|
||||
|
||||
@@ -753,6 +753,11 @@ pub fn get_config<E: EthSpec>(
|
||||
client_config.chain.optimistic_finalized_sync =
|
||||
!cli_args.is_present("disable-optimistic-finalized-sync");
|
||||
|
||||
// Payload selection configs
|
||||
if cli_args.is_present("always-prefer-builder-payload") {
|
||||
client_config.always_prefer_builder_payload = true;
|
||||
}
|
||||
|
||||
Ok(client_config)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user