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

use correct timestamp for empty ExecutionPayload #2638

Merged
merged 1 commit into from
Oct 2, 2021
Merged

use correct timestamp for empty ExecutionPayload #2638

merged 1 commit into from
Oct 2, 2021

Conversation

etan-status
Copy link
Contributor

There are two similar functions to compute the timestamp for a given
beacon chain slot. compute_time_at_slot is used for processing Eth1
votes, and does not take into account GENESIS_TIME. The other one,
compute_timestamp_at_slot, is used everywhere else. When processing
ExecutionPayload, the merge/beacon-chain.md spec uses the latter,
compute_timestamp_at_slot, to verify the timestamp. However, in the
test code, build_empty_execution_payload uses compute_time_at_slot.
This patch changes the test to use the same function for creating the
timestamp that is later used to verify it. Note that GENESIS_TIME is 0
so there is no practical difference.

There are two similar functions to compute the timestamp for a given
beacon chain slot. `compute_time_at_slot` is used for processing Eth1
votes, and does not take into account `GENESIS_TIME`. The other one,
`compute_timestamp_at_slot`, is used everywhere else. When processing
`ExecutionPayload`, the `merge/beacon-chain.md` spec uses the latter,
`compute_timestamp_at_slot`, to verify the timestamp. However, in the
test code, `build_empty_execution_payload` uses `compute_time_at_slot`.
This patch changes the test to use the same function for creating the
timestamp that is later used to verify it. Note that `GENESIS_TIME` is 0
so there is no practical difference.
@etan-status etan-status marked this pull request as ready for review October 1, 2021 12:53
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.

LGTM 👍

@hwwhww hwwhww merged commit 296f9ba into ethereum:dev Oct 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants