mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-02 16:21:42 +00:00
Prepare sensitive_url for crates.io (#8223)
Another good candidate for publishing separately from Lighthouse is `sensitive_url` as it's a general utility crate and not related to Ethereum. This PR prepares it to be spun out into its own crate. I've made the `full` field on `SensitiveUrl` private and instead provided an explicit getter called `.expose_full()`. It's a bit ugly for the diff but I prefer the explicit nature of the getter. I've also added some extra tests and doc strings along with feature gating `Serialize` and `Deserialize` implementations behind the `serde` feature. Co-Authored-By: Mac L <mjladson@pm.me>
This commit is contained in:
@@ -656,7 +656,7 @@ impl<T: SlotClock> BeaconNodeFallback<T> {
|
||||
R: Future<Output = Result<O, Err>>,
|
||||
Err: Debug,
|
||||
{
|
||||
inc_counter_vec(&ENDPOINT_REQUESTS, &[candidate.as_ref()]);
|
||||
inc_counter_vec(&ENDPOINT_REQUESTS, &[candidate.server().redacted()]);
|
||||
|
||||
// There exists a race condition where `func` may be called when the candidate is
|
||||
// actually not ready. We deem this an acceptable inefficiency.
|
||||
@@ -668,7 +668,7 @@ impl<T: SlotClock> BeaconNodeFallback<T> {
|
||||
error = ?e,
|
||||
"Request to beacon node failed"
|
||||
);
|
||||
inc_counter_vec(&ENDPOINT_ERRORS, &[candidate.as_ref()]);
|
||||
inc_counter_vec(&ENDPOINT_ERRORS, &[candidate.server().redacted()]);
|
||||
Err((candidate.to_string(), Error::RequestFailed(e)))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user