Skip to content

Commit

Permalink
Log fee recipients in VC (#3526)
Browse files Browse the repository at this point in the history
## Issue Addressed

Resolves #3524 

## Proposed Changes

Log fee recipient in the `Validator exists in beacon chain` log. Logging in the BN already happens here https://github.com/sigp/lighthouse/blob/18c61a5e8be3e54226a86a69b96f8f4f7fd790e4/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 #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>
  • Loading branch information
pawanjay176 and paulhauner committed Aug 30, 2022
1 parent 661307d commit c578588
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions validator_client/src/duties_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -400,13 +400,23 @@ async fn poll_validator_indices<T: SlotClock + 'static, E: EthSpec>(
)
.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 {
Ok(Some(response)) => {
info!(
log,
"Validator exists in beacon chain";
"pubkey" => ?pubkey,
"validator_index" => response.data.index
"validator_index" => response.data.index,
"fee_recipient" => fee_recipient
);
duties_service
.validator_store
Expand All @@ -420,7 +430,8 @@ async fn poll_validator_indices<T: SlotClock + 'static, E: EthSpec>(
debug!(
log,
"Validator without index";
"pubkey" => ?pubkey
"pubkey" => ?pubkey,
"fee_recipient" => fee_recipient
)
}
// Don't exit early on an error, keep attempting to resolve other indices.
Expand All @@ -430,6 +441,7 @@ async fn poll_validator_indices<T: SlotClock + 'static, E: EthSpec>(
"Failed to resolve pubkey to index";
"error" => %e,
"pubkey" => ?pubkey,
"fee_recipient" => fee_recipient
)
}
}
Expand Down

0 comments on commit c578588

Please sign in to comment.