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:
chonghe
2026-06-15 14:03:13 +08:00
committed by GitHub
parent 378f01670b
commit d8e406b6ac
10 changed files with 203 additions and 41 deletions

View File

@@ -62,7 +62,7 @@ impl GraffitiSettings {
validator_graffiti
.map(|graffiti| Self::Specified {
graffiti,
policy: policy.unwrap_or(GraffitiPolicy::PreserveUserGraffiti),
policy: policy.unwrap_or_default(),
})
.unwrap_or(Self::Unspecified)
}
@@ -480,9 +480,9 @@ mod tests {
// for the case of empty append_graffiti_string, i.e., user-specified graffiti is 30-32 characters
graffiti.to_string()
} else {
// There is a space between the client version info and user graffiti
// There is a space between the user graffiti and client version info
// as defined in calculate_graffiti function in engine_api.rs
format!("{} {}", append_graffiti_string, graffiti)
format!("{} {}", graffiti, append_graffiti_string)
};
let expected_graffiti_prefix_bytes = expected_graffiti_string.as_bytes();