-
Notifications
You must be signed in to change notification settings - Fork 877
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
base: unstable
Are you sure you want to change the base?
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) -> 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.
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
Issue Addressed
Additional Info
Thank you @ethDreamer and @michaelsproul for the help and guidance