Skip to content

Eth1 block hashes have type Hash32#2693

Merged
djrtwo merged 2 commits intoethereum:devfrom
benjaminion:eth1-hash-type
Nov 23, 2021
Merged

Eth1 block hashes have type Hash32#2693
djrtwo merged 2 commits intoethereum:devfrom
benjaminion:eth1-hash-type

Conversation

@benjaminion
Copy link
Contributor

[Same as #2689, see comments there. Sorry - I got in a mess with my branches and needed to redo this.]

Pernickety and largely of historical value now, but since we have added a custom Hash32 type for Eth1 block hashes it ought to be used in the definition of initialize_beacon_state_from_eth1().

Related question: why are we not migrating all the other hashes over to the Hash32 type, only the Eth1 block hash? For example here

#### `hash`

`def hash(data: bytes) -> Bytes32` is SHA256.

Historical note: Hash32 used to be a thing back at the dawn of time, before being superseded by the generic Bytes32.

Copy link
Contributor

@djrtwo djrtwo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there is an initialize_beacon_state_from_eth1 function in each fork. Let's make the function signatures match in this update

Copy link
Contributor

@hwwhww hwwhww left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I updated initialize_beacon_state_from_eth1 in other forks.
LGTM. 👍

@djrtwo djrtwo merged commit 44fec31 into ethereum:dev Nov 23, 2021
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 this pull request may close these issues.

3 participants