-
Notifications
You must be signed in to change notification settings - Fork 938
[Merged by Bors] - Add graffiti cli flag to the validator client. #1425
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
|
Curious about your thoughts on this. As you know the VC asks for a beacon block from the BN. The BN can set the graffiti and that will be the default for block when the VC asks to produce a block. I was thinking potentially a simpler approach would be like this. I think there would be very minimal code changes and hence complexity in this approach. What do you think? |
|
Yea that would definitely cut down the code changes, it's a little janky the way I have it. I was trying to avoid modifying the block after producing it though. Was thinking we'd want to keep the relationship more strictly BN --> produce block. VC --> sign block. But if it's not worth the complexity I can update it, just let me know. |
|
Yeah fair point. @michaelsproul - What logic do you think we should go with here? |
|
Hmm, I can see benefits to both approaches but I'm in favour of keeping it simple and letting the validator client modify the graffiti. It makes sense that the VC has "control" over what it signs, including mutating the block if it wants to. Thanks @realbigsean for fixing this pain point |
This reverts commit d4309b4.
|
Ok, I updated this, but am getting some errors. I'm seeing this log in the beacon node:
and this log in the validator client:
I'm not too familiar with how the state root's calculated. But if it incorporates the graffiti, it seems like the beacon node isn't able to validate the signed block correctly because it has a different idea of what the state is. |
|
Ah, you're totally right. Let's stick with your original approach, recalculating the state root is expensive. Sorry I didn't think of this before |
|
ok cool, updated it back 👍 |
| // If graffiti has been set in the validator client, overwrite any graffiti sent from the beacon node. | ||
| if let Some(graffiti) = self.graffiti { | ||
| block.body.graffiti = 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.
This still seems to be doing things the mutating way, something might have gone awry during the reverting process?
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.
Yep, messed something up trying to revert. Removed this, thanks.
|
Another thing we need to concern ourselves is following the eth2 API spec. The VC <-> BN API is supposed to be standardised so we can't ad-hoc modify that API. As it turns out, the new spec requires the graffiti field. However it's not an Option, but rather a String. It might be best to conform to the API's here to save us the hassle in the future. See here: |
Yea so the graffiti is an Option as it's being passed into the but in the actual GET request, it's a String query param that may or may not be included: Which is in line with the API (the graffiti param is the only of the three not required). There are a couple of other things about this endpoint that are not in line with the API though, like the name is "block" rather than "blocks" and "slot" is a query param rather than a path param, but I'm guessing those would be out of scope for this PR? |
|
Yep perfect! Yeah we need to do one big PR to bring us in line with the API specs. This looks good to me. I'll await @michaelsproul final approval before merging. Thanks! |
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.
LGTM
Are we merging post-Medalla launch?
|
Would like to run this on the testnet first |
|
This looks fine to me. Lets get it in to prevent PR upkeep. bors r+ |
## Issue Addressed #1419 ## Proposed Changes Creates a `--graffiti` cli flag in the validator client. If the flag is set, it overrides graffiti in the beacon node. ## Additional Info
|
Pull request successfully merged into master. Build succeeded: |
## Issue Addressed #1419 ## Proposed Changes Creates a `--graffiti` cli flag in the validator client. If the flag is set, it overrides graffiti in the beacon node. ## Additional Info
Issue Addressed
#1419
Proposed Changes
Creates a
--graffiticli flag in the validator client. If the flag is set, it overrides graffiti in the beacon node.Additional Info