mirror of
https://github.com/sigp/lighthouse.git
synced 2026-06-30 03:14:25 +00:00
Append client version info to user graffiti by default (#9313)
Closes issue #9287 Co-Authored-By: Tan Chee Keong <tanck@sigmaprime.io> Co-Authored-By: chonghe <44791194+chong-he@users.noreply.github.com> Co-Authored-By: Michael Sproul <michael@sigmaprime.io>
This commit is contained in:
@@ -2393,12 +2393,12 @@ impl BeaconNodeHttpClient {
|
||||
.append_pair("builder_boost_factor", &builder_booster_factor.to_string());
|
||||
}
|
||||
|
||||
// Only append the HTTP URL request if the graffiti_policy is to AppendClientVersions
|
||||
// If PreserveUserGraffiti (default), then the HTTP URL request does not contain graffiti_policy
|
||||
// Only append the HTTP URL request if the graffiti_policy is PreserveUserGraffiti
|
||||
// If AppendClientVersions (default), then we do not modify the HTTP URL request
|
||||
// so that the default case is compliant to the spec
|
||||
if let Some(GraffitiPolicy::AppendClientVersions) = graffiti_policy {
|
||||
if let Some(GraffitiPolicy::PreserveUserGraffiti) = graffiti_policy {
|
||||
path.query_pairs_mut()
|
||||
.append_pair("graffiti_policy", "AppendClientVersions");
|
||||
.append_pair("graffiti_policy", "PreserveUserGraffiti");
|
||||
}
|
||||
|
||||
Ok(path)
|
||||
@@ -2600,9 +2600,12 @@ impl BeaconNodeHttpClient {
|
||||
.append_pair("builder_boost_factor", &builder_booster_factor.to_string());
|
||||
}
|
||||
|
||||
if let Some(GraffitiPolicy::AppendClientVersions) = graffiti_policy {
|
||||
// Only append the HTTP URL request if the graffiti_policy is PreserveUserGraffiti
|
||||
// If AppendClientVersions (default), then we do not modify the HTTP URL request
|
||||
// so that the default case is compliant to the spec
|
||||
if let Some(GraffitiPolicy::PreserveUserGraffiti) = graffiti_policy {
|
||||
path.query_pairs_mut()
|
||||
.append_pair("graffiti_policy", "AppendClientVersions");
|
||||
.append_pair("graffiti_policy", "PreserveUserGraffiti");
|
||||
}
|
||||
|
||||
Ok(path)
|
||||
|
||||
@@ -758,10 +758,10 @@ pub struct ProposerData {
|
||||
pub slot: Slot,
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, Serialize, Deserialize, Default, Debug)]
|
||||
#[derive(Clone, Copy, Serialize, Deserialize, Default, Debug, PartialEq)]
|
||||
pub enum GraffitiPolicy {
|
||||
#[default]
|
||||
PreserveUserGraffiti,
|
||||
#[default]
|
||||
AppendClientVersions,
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user