-
-
Notifications
You must be signed in to change notification settings - Fork 414
feat: update networking config to match CL spec #8510
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
Conversation
|
/gemini review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request is a great initiative to refactor networking configurations to align with the Consensus Layer (CL) specifications. The changes are extensive and consistently applied across the codebase, including updates to tests, which significantly improves maintainability by centralizing these constants. I've identified one minor point regarding a new configuration that could be clarified. Overall, this is a high-quality contribution.
|
/gemini review |
| // Reject ContributionAndProofs of previous slots | ||
| // for api ContributionAndProofs, we allow them to be added to the pool | ||
| if (!priority && slot < this.clock.slotWithPastTolerance(MAXIMUM_GOSSIP_CLOCK_DISPARITY)) { | ||
| if (!priority && slot < this.clock.slotWithPastTolerance(this.config.MAXIMUM_GOSSIP_CLOCK_DISPARITY / 1000)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this was wrong before slotWithPastTolerance expects value in seconds
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This is a great pull request that refactors networking configurations to align with the Consensus Layer (CL) specifications. The changes are well-organized and consistently applied across the codebase, which significantly improves maintainability by centralizing configuration parameters. The removal of hardcoded constants in favor of values from ChainConfig is a solid improvement. All tests have been updated accordingly, and the new constant names and values appear correct. Overall, this is a high-quality contribution.
| export const EPOCHS_PER_SUBNET_SUBSCRIPTION = 256; | ||
| export const ATTESTATION_SUBNET_EXTRA_BITS = 0; | ||
| export const ATTESTATION_SUBNET_PREFIX_BITS = | ||
| Math.ceil(Math.log2(ATTESTATION_SUBNET_COUNT)) + ATTESTATION_SUBNET_EXTRA_BITS; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The ATTESTATION_ constants are part of config as per spec but kept here since we use them in ssz containers which makes it hard to move them. We still return them from config/spec now and I don't think anyone wants to configure those.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I had to guess, that would be an oversight/bug? Not sure if its worth updating the spec by now, but I don't think config should affect ssz container definitions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I don't see why those are in config and likely an oversight in the spec but it's part of phase0 and I don't really feel like it's worth fixing this as it's simple for us to just keep them as constants.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## unstable #8510 +/- ##
============================================
+ Coverage 52.19% 52.22% +0.02%
============================================
Files 852 852
Lines 65054 65082 +28
Branches 4771 4771
============================================
+ Hits 33955 33986 +31
+ Misses 31030 31027 -3
Partials 69 69 🚀 New features to boost your workflow:
|
Performance Report✔️ no performance regression detected Full benchmark results
|
**Motivation** Conform to CL spec **Description** - move networking constants to config - remove constants no longer part of spec - enable "p2p-interface.md" in config test Closes ChainSafe#6351 Closes ChainSafe#7529
|
🎉 This PR is included in v1.36.0 🎉 |
Motivation
Conform to CL spec
Description
Closes #6351
Closes #7529