Log fee recipients in VC (#3526)

## Issue Addressed

Resolves #3524 

## Proposed Changes

Log fee recipient in the `Validator exists in beacon chain` log. Logging in the BN already happens here 18c61a5e8b/beacon_node/beacon_chain/src/beacon_chain.rs (L3858-L3865)

I also think it's good practice to encourage users to set the fee recipient in the VC rather than the BN because of issues mentioned here https://github.com/sigp/lighthouse/issues/3432

Some example logs from prater:
```
Aug 30 03:47:09.922 INFO Validator exists in beacon chain        fee_recipient: 0xab97_ad88, validator_index: 213615, pubkey: 0xb542b69ba14ddbaf717ca1762ece63a4804c08d38a1aadf156ae718d1545942e86763a1604f5065d4faa550b7259d651, service: duties


Aug 30 03:48:05.505 INFO Validator exists in beacon chain        fee_recipient: Fee recipient for validator not set in validator_definitions.yml or provided with the `--suggested-fee-recipient flag`, validator_index: 210710, pubkey: 0xad5d67cc7f990590c7b3fa41d593c4cf12d9ead894be2311fbb3e5c733d8c1b909e9d47af60ea3480fb6b37946c35390, service: duties
```


Co-authored-by: Paul Hauner <paul@paulhauner.com>
This commit is contained in:
Pawan Dhananjay 2022-08-30 05:47:32 +00:00
parent 661307dce1
commit c5785887a9

View File

@ -400,13 +400,23 @@ async fn poll_validator_indices<T: SlotClock + 'static, E: EthSpec>(
) )
.await; .await;
let fee_recipient = duties_service
.validator_store
.get_fee_recipient(&pubkey)
.map(|fr| fr.to_string())
.unwrap_or_else(|| {
"Fee recipient for validator not set in validator_definitions.yml \
or provided with the `--suggested-fee-recipient` flag"
.to_string()
});
match download_result { match download_result {
Ok(Some(response)) => { Ok(Some(response)) => {
info!( info!(
log, log,
"Validator exists in beacon chain"; "Validator exists in beacon chain";
"pubkey" => ?pubkey, "pubkey" => ?pubkey,
"validator_index" => response.data.index "validator_index" => response.data.index,
"fee_recipient" => fee_recipient
); );
duties_service duties_service
.validator_store .validator_store
@ -420,7 +430,8 @@ async fn poll_validator_indices<T: SlotClock + 'static, E: EthSpec>(
debug!( debug!(
log, log,
"Validator without index"; "Validator without index";
"pubkey" => ?pubkey "pubkey" => ?pubkey,
"fee_recipient" => fee_recipient
) )
} }
// Don't exit early on an error, keep attempting to resolve other indices. // Don't exit early on an error, keep attempting to resolve other indices.
@ -430,6 +441,7 @@ async fn poll_validator_indices<T: SlotClock + 'static, E: EthSpec>(
"Failed to resolve pubkey to index"; "Failed to resolve pubkey to index";
"error" => %e, "error" => %e,
"pubkey" => ?pubkey, "pubkey" => ?pubkey,
"fee_recipient" => fee_recipient
) )
} }
} }