fix: correct pre-Deneb attestation propagation slot range boundary - #9031
Conversation
slotWithPastTolerance floors the disparity-adjusted time to a slot, which is one slot too strict at the exact boundary where compute_time_at_slot(slot + range + 1) + MAXIMUM_GOSSIP_CLOCK_DISPARITY equals current_time_ms. Use isCurrentSlotGivenGossipDisparity to extend the lower bound by one slot only within the disparity window. Caught by consensus-specs gossip validation reference tests
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request addresses a subtle bug in the pre-Deneb attestation propagation validation logic. The previous implementation was too strict at the boundary where the disparity-adjusted time aligned with the current time, causing valid attestations to be rejected. The fix adjusts the lower bound of the permissible slot range by one slot, but only when the clock still considers the previous slot current within the gossip disparity window. This ensures compliance with consensus-specs gossip validation reference tests. Additionally, the test utility was updated to skip the 'heze' fork in spec tests. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request corrects the pre-Deneb attestation propagation slot range boundary calculation. The previous implementation was one slot too strict at the boundary due to flooring. The new logic correctly extends the lower bound by one slot within the gossip disparity window, aligning with the consensus specs. The changes also include updates to skip certain tests. The fix appears correct and well-implemented.
| // ``` | ||
| export const defaultSkipOpts: SkipOpts = { | ||
| skippedForks: ["eip7805"], | ||
| skippedForks: ["eip7805", "heze"], |
There was a problem hiding this comment.
not related but good to skip for now before someone else runs into same issue, we don't have boilerplate for heze set up yet, so we can't pass this right now
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 77cee14fac
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Performance Report✔️ no performance regression detected Full benchmark results
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## unstable #9031 +/- ##
============================================
- Coverage 52.32% 52.32% -0.01%
============================================
Files 848 848
Lines 62507 62505 -2
Branches 4603 4603
============================================
- Hits 32705 32703 -2
Misses 29736 29736
Partials 66 66 🚀 New features to boost your workflow:
|
|
🎉 This PR is included in v1.41.0 🎉 |
slotWithPastTolerancefloors the disparity-adjusted time to a slot, which is one slot too strict at the exact boundary wherecompute_time_at_slot(slot + range + 1) + MAXIMUM_GOSSIP_CLOCK_DISPARITYequalscurrent_time_ms. UseisCurrentSlotGivenGossipDisparityto extend the lower bound by one slot only within the disparity window.Caught by consensus-specs gossip validation reference tests ethereum/consensus-specs#4902