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

fix: build local payload with timestamp from beacon clock #194

Merged
merged 4 commits into from
Aug 9, 2024

Conversation

merklefruit
Copy link
Collaborator

This PR fixes the edge case in which the previous slot was missed by the proposer before us, and we would
use the wrong block timestamp. Now we use the timestamp according to the beacon proposal slot instead.

This also contains minor refactoring to the local payload fetcher to be a little cleaner.

@merklefruit merklefruit added C: bolt-sidecar Component: bolt-sidecar T: bug Type: Bug labels Aug 9, 2024
@merklefruit merklefruit self-assigned this Aug 9, 2024
bolt-sidecar/src/builder/payload_builder.rs Outdated Show resolved Hide resolved
Comment on lines +231 to +234
/// Fetch the previous RANDAO value from the beacon chain.
///
/// NOTE: for some reason, using the ApiResult from `beacon_api_client` doesn't work, so
/// we are making a direct request to the beacon client endpoint.
Copy link
Contributor

Choose a reason for hiding this comment

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

hmm just curious to know some more detail

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think it has to do with the type that the beacon_api_client crate expects to deserialize from the result of that API call - maybe it has changed or it's not updated to what Lighthouse is responding, so it fails to deserialize.

This is probably a bug in the beacon_api_client crate - but I haven't investigated

@namn-grg
Copy link
Contributor

namn-grg commented Aug 9, 2024

Great catch ser!

Copy link
Contributor

@mempirate mempirate left a comment

Choose a reason for hiding this comment

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

LGTM!

@merklefruit merklefruit merged commit 6466e30 into unstable Aug 9, 2024
2 checks passed
@merklefruit merklefruit deleted the nico/fix/local-payload-missed-slot branch August 9, 2024 12:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: bolt-sidecar Component: bolt-sidecar T: bug Type: Bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants