Remove strict fee recipient (#3552)

## Issue Addressed

Resolves: #3550

Remove the `--strict-fee-recipient` flag. It will cause missed proposals prior to the bellatrix transition.

Co-authored-by: realbigsean <sean@sigmaprime.io>
This commit is contained in:
realbigsean 2022-09-08 23:46:02 +00:00
parent 81d078bfc7
commit a9f075c3c0
5 changed files with 14 additions and 52 deletions

View File

@ -430,20 +430,6 @@ fn builder_registration_timestamp_override_flag() {
assert_eq!(config.builder_registration_timestamp_override, Some(100)) assert_eq!(config.builder_registration_timestamp_override, Some(100))
}); });
} }
#[test]
fn strict_fee_recipient_flag() {
CommandLineTest::new()
.flag("strict-fee-recipient", None)
.run()
.with_config(|config| assert!(config.strict_fee_recipient));
}
#[test]
fn no_strict_fee_recipient_flag() {
CommandLineTest::new()
.run()
.with_config(|config| assert!(!config.strict_fee_recipient));
}
#[test] #[test]
fn monitoring_endpoint() { fn monitoring_endpoint() {
CommandLineTest::new() CommandLineTest::new()

View File

@ -43,7 +43,6 @@ pub struct BlockServiceBuilder<T, E: EthSpec> {
context: Option<RuntimeContext<E>>, context: Option<RuntimeContext<E>>,
graffiti: Option<Graffiti>, graffiti: Option<Graffiti>,
graffiti_file: Option<GraffitiFile>, graffiti_file: Option<GraffitiFile>,
strict_fee_recipient: bool,
} }
impl<T: SlotClock + 'static, E: EthSpec> BlockServiceBuilder<T, E> { impl<T: SlotClock + 'static, E: EthSpec> BlockServiceBuilder<T, E> {
@ -55,7 +54,6 @@ impl<T: SlotClock + 'static, E: EthSpec> BlockServiceBuilder<T, E> {
context: None, context: None,
graffiti: None, graffiti: None,
graffiti_file: None, graffiti_file: None,
strict_fee_recipient: false,
} }
} }
@ -89,11 +87,6 @@ impl<T: SlotClock + 'static, E: EthSpec> BlockServiceBuilder<T, E> {
self self
} }
pub fn strict_fee_recipient(mut self, strict_fee_recipient: bool) -> Self {
self.strict_fee_recipient = strict_fee_recipient;
self
}
pub fn build(self) -> Result<BlockService<T, E>, String> { pub fn build(self) -> Result<BlockService<T, E>, String> {
Ok(BlockService { Ok(BlockService {
inner: Arc::new(Inner { inner: Arc::new(Inner {
@ -111,7 +104,6 @@ impl<T: SlotClock + 'static, E: EthSpec> BlockServiceBuilder<T, E> {
.ok_or("Cannot build BlockService without runtime_context")?, .ok_or("Cannot build BlockService without runtime_context")?,
graffiti: self.graffiti, graffiti: self.graffiti,
graffiti_file: self.graffiti_file, graffiti_file: self.graffiti_file,
strict_fee_recipient: self.strict_fee_recipient,
}), }),
}) })
} }
@ -125,7 +117,6 @@ pub struct Inner<T, E: EthSpec> {
context: RuntimeContext<E>, context: RuntimeContext<E>,
graffiti: Option<Graffiti>, graffiti: Option<Graffiti>,
graffiti_file: Option<GraffitiFile>, graffiti_file: Option<GraffitiFile>,
strict_fee_recipient: bool,
} }
/// Attempts to produce attestations for any block producer(s) at the start of the epoch. /// Attempts to produce attestations for any block producer(s) at the start of the epoch.
@ -324,9 +315,7 @@ impl<T: SlotClock + 'static, E: EthSpec> BlockService<T, E> {
let self_ref = &self; let self_ref = &self;
let proposer_index = self.validator_store.validator_index(&validator_pubkey); let proposer_index = self.validator_store.validator_index(&validator_pubkey);
let validator_pubkey_ref = &validator_pubkey; let validator_pubkey_ref = &validator_pubkey;
let fee_recipient = self.validator_store.get_fee_recipient(&validator_pubkey);
let strict_fee_recipient = self.strict_fee_recipient;
// Request block from first responsive beacon node. // Request block from first responsive beacon node.
let block = self let block = self
.beacon_nodes .beacon_nodes
@ -377,17 +366,6 @@ impl<T: SlotClock + 'static, E: EthSpec> BlockService<T, E> {
} }
}; };
// Ensure the correctness of the execution payload's fee recipient.
if strict_fee_recipient {
if let Ok(execution_payload) = block.body().execution_payload() {
if Some(execution_payload.fee_recipient()) != fee_recipient {
return Err(BlockError::Recoverable(
"Incorrect fee recipient used by builder".to_string(),
));
}
}
}
if proposer_index != Some(block.proposer_index()) { if proposer_index != Some(block.proposer_index()) {
return Err(BlockError::Recoverable( return Err(BlockError::Recoverable(
"Proposer index does not match block proposer. Beacon chain re-orged" "Proposer index does not match block proposer. Beacon chain re-orged"

View File

@ -268,11 +268,10 @@ pub fn cli_app<'a, 'b>() -> App<'a, 'b> {
headers during proposals and will sign over headers. Useful for outsourcing \ headers during proposals and will sign over headers. Useful for outsourcing \
execution payload construction during proposals.") execution payload construction during proposals.")
.takes_value(false), .takes_value(false),
) ).arg(
.arg(
Arg::with_name("strict-fee-recipient") Arg::with_name("strict-fee-recipient")
.long("strict-fee-recipient") .long("strict-fee-recipient")
.help("If this flag is set, Lighthouse will refuse to sign any block whose \ .help("[DEPRECATED] If this flag is set, Lighthouse will refuse to sign any block whose \
`fee_recipient` does not match the `suggested_fee_recipient` sent by this validator. \ `fee_recipient` does not match the `suggested_fee_recipient` sent by this validator. \
This applies to both the normal block proposal flow, as well as block proposals \ This applies to both the normal block proposal flow, as well as block proposals \
through the builder API. Proposals through the builder API are more likely to have a \ through the builder API. Proposals through the builder API are more likely to have a \

View File

@ -61,9 +61,6 @@ pub struct Config {
/// A list of custom certificates that the validator client will additionally use when /// A list of custom certificates that the validator client will additionally use when
/// connecting to a beacon node over SSL/TLS. /// connecting to a beacon node over SSL/TLS.
pub beacon_nodes_tls_certs: Option<Vec<PathBuf>>, pub beacon_nodes_tls_certs: Option<Vec<PathBuf>>,
/// Enabling this will make sure the validator client never signs a block whose `fee_recipient`
/// does not match the `suggested_fee_recipient`.
pub strict_fee_recipient: bool,
} }
impl Default for Config { impl Default for Config {
@ -99,7 +96,6 @@ impl Default for Config {
builder_proposals: false, builder_proposals: false,
builder_registration_timestamp_override: None, builder_registration_timestamp_override: None,
gas_limit: None, gas_limit: None,
strict_fee_recipient: false,
} }
} }
} }
@ -334,7 +330,11 @@ impl Config {
} }
if cli_args.is_present("strict-fee-recipient") { if cli_args.is_present("strict-fee-recipient") {
config.strict_fee_recipient = true; warn!(
log,
"The flag `--strict-fee-recipient` has been deprecated due to a bug causing \
missed proposals. The flag will be ignored."
);
} }
Ok(config) Ok(config)

View File

@ -420,7 +420,6 @@ impl<T: EthSpec> ProductionValidatorClient<T> {
.runtime_context(context.service_context("block".into())) .runtime_context(context.service_context("block".into()))
.graffiti(config.graffiti) .graffiti(config.graffiti)
.graffiti_file(config.graffiti_file.clone()) .graffiti_file(config.graffiti_file.clone())
.strict_fee_recipient(config.strict_fee_recipient)
.build()?; .build()?;
let attestation_service = AttestationServiceBuilder::new() let attestation_service = AttestationServiceBuilder::new()