-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Return payload value in Wei from /eth/v3/validator/blocks
#13497
Conversation
5d939cd
to
071a1a1
Compare
@@ -435,6 +435,9 @@ func (s *Service) validateMergeTransitionBlock(ctx context.Context, stateVersion | |||
if err != nil { | |||
return invalidBlock{error: err} | |||
} | |||
if payload == nil { |
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.
I'm not sure if this should exist... doesn't the check below is empty execution data deal with this?
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.
you are right, I moved this check to IsEmptyExecutionData
value uint64 | ||
p *enginev1.ExecutionPayloadCapella | ||
weiValue math.Wei | ||
gweiValue uint64 |
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.
do we still need to keep gweiValue
now we have weiValue
?
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.
I kept gweiValue
so that we don't have to convert every time we want to get the value in Gwei.
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.
ok with this but lets also wait for thoughts from terence
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 - I still have some hesitations on tracking two values vs one value, but it's not a show stopper. Can move on
What type of PR is this?
Bug fix
What does this PR do? Why is it needed?
consensus-types/blocks/getters.go
where callingExecution()
would return a new wrapped object with0
value. Actually there is no need to unwrap and re-wrap, we can just return the field value directly. Making sure it's of the correct type should be done in the setter.ValueInWei()
method to theExecutionData
interface so that we can retrieve the payload value both in Wei and Gwei. The/eth/v3/validator/blocks
API endpoint should return Wei values.Which issues(s) does this PR fix?
Fixes #13466
Aligns with ethereum/beacon-APIs#400
Other notes for review