Skip to content
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

gwei vs wei in block v3 #397

Closed
michaelsproul opened this issue Dec 18, 2023 · 4 comments · Fixed by #400
Closed

gwei vs wei in block v3 #397

michaelsproul opened this issue Dec 18, 2023 · 4 comments · Fixed by #400

Comments

@michaelsproul
Copy link
Collaborator

michaelsproul commented Dec 18, 2023

I found a discrepancy between Teku and Lighthouse's implementation of the block v3 endpoint. Lighthouse returns the consensus block value in gwei and the execution payload value in wei. Teku uses wei for both.

Arguably both are reasonable interpretations of the current spec, because we usually use gwei on the consensus layer (we can't represent sub-gwei units on the CL). On the other hand, using wei for both is nice from a consistency point of view.

We should choose between gwei+wei, or wei everywhere and then update the descriptions of the block v3 headers accordingly. The current descriptions leave a lot to be desired:

Eth-Execution-Payload-Value: Required in response so client can determine relative value of execution payloads.
Eth-Consensus-Block-Value: Required in response so client can determine relative value of consensus blocks.

@michaelsproul
Copy link
Collaborator Author

I think my preference is for wei everywhere for consistency, even though it means padding values with 9 zeroes and introducing unnecessary precision.

@rolfyone
Copy link
Collaborator

If we're just adding 9 0's everywhere maybe gwei is more sensible?

@michaelsproul
Copy link
Collaborator Author

I guess consumers of the API should read the docs, and might be used to getting CL values in gwei and EL values in wei?

@rolfyone
Copy link
Collaborator

I guess consumers of the API should read the docs, and might be used to getting CL values in gwei and EL values in wei?

True, the problem is this grey area where things are moving around for EL value, I could understand either interpretation, good issue to define it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants
@rolfyone @michaelsproul and others