ethereum / beacon-APIs

Collection of RESTful APIs provided by Ethereum Beacon nodes
https://ethereum.github.io/beacon-APIs/
Creative Commons Zero v1.0 Universal
328 stars 167 forks source link

Clarify that payload & block values are in Wei #400

Closed michaelsproul closed 8 months ago

michaelsproul commented 8 months ago

Require both execution payload value and consensus block value to be denominated in wei.

There are advantages to wei+gwei or wei+wei, and we just need to choose one. I've chosen to use the wei+wei option, because the consistency makes the API less confusing, and I think this trumps concerns about performance or unnecessary zero padding.

Closes #397

michaelsproul commented 8 months ago

Relatedly, the current spec uses decimal representation for both values. In Lighthouse were were using hex for the U256 execution payload value and decimal for the u64 consensus block value. If everyone is OK with decimal I'll go ahead and fix our impl.

nflaig commented 8 months ago

The values in the rewards API are denominated in gwei. Shouldn't we use the same unit across all APIs?

https://github.com/ethereum/beacon-APIs/blob/cfbe6677f6e9e936dfca8708467c7e0382c07b19/types/rewards.yaml#L48

mcdee commented 8 months ago

This API has wei-level values. I don't think that it makes sense to update everywhere, but it does make sense to be consistent within a single endpoint so all wei values here (as execution layer values are in wei precision).