-
Notifications
You must be signed in to change notification settings - Fork 951
Append client version info to graffiti #7558
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| .await, | ||
| ), | ||
| }; | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the wrong place to do this. This function will call produce_block_with_verification() which will call produce_block_on_state() which will call the graffiti_calculator.get_graffiti() again. I would suggest you pass this argument down the function calls along with the graffiti. So maybe (inside graffiti_calculator.rs) create some new enum:
enum GraffitiSettings {
Unspecified,
Specified {
graffiti: Graffiti,
policy: GraffitiPolicy,
}
}
impl GraffitiSettings {
fn new(validator_graffiti: Option<Graffiti>, policy: GraffitiPolicy) {
validator_graffiti.map(|graffiti| Self::Specified {
graffiti,
policy,
})
.unwrap_or(Self::Unspecified)
}
}and pass that down through the functions. Then you'd want to change get_graffiti to:
pub async fn get_graffiti(&self, graffiti_settings: GraffitiSettings) -> GraffitiThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks so much for the comment, made some amendment based on your comment. If you have some time to spare, will appreciate for another look to see if this is on the right track @ethDreamer
michaelsproul
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved modulo some very small doc/CLI flag tweaks
book/src/help_vc.md
Outdated
| metrics being collected. | ||
| --graffiti-append | ||
| When used, client version info will be automatically appended to user | ||
| custom graffiti. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should probably have a note that this should only be used with a Lighthouse BN (due to using a non-standard query parameter).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Revised in 63746d8
Also revise the word from append to prepend, as the client version info is attached before user graffiti, not after
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch, makes sense!
Co-authored-by: Michael Sproul <michaelsproul@users.noreply.github.com>
|
Did some testing with Kurtosis local testnet, by adding the following to Before, graffiti is: |
Merge Queue Status✅ The pull request has been merged at 45a1328 This pull request spent 40 minutes 55 seconds in the queue, including 38 minutes 52 seconds running CI. Required conditions to merge
|
Issue Addressed
Additional Info
Thank you @ethDreamer and @michaelsproul for the help and guidance