Skip to content

Eth1 block hashes have type Hash32#2689

Closed
benjaminion wants to merge 0 commit intoethereum:devfrom
benjaminion:dev
Closed

Eth1 block hashes have type Hash32#2689
benjaminion wants to merge 0 commit intoethereum:devfrom
benjaminion:dev

Conversation

@benjaminion
Copy link
Contributor

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.

I concur!

I do agree it worthwhile to do an exploratory typing investigation on changing hash return type itself.

Does make me wonder... should typing distinguish between keccak and sha256 hashes...

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