Skip to content

Conversation

@wemeetagain
Copy link
Member

Motivation

Description

  • replace custodyGroups with custodyColumns where we're tracking per-peer
    • code was wrongly comparing groups and columns, but this wasn't causing bugged behavior given the current configuration
  • in BlockInputSync (unknown sync), don't unilaterally exclude a peer after fetching data from it. Instead only exclude the peer upon (most) errors
  • in unknown block sync e2e test, create the proper type of block input (BlockInputColumns). Using the wrong class causes the block input to fail to process

@wemeetagain wemeetagain requested a review from a team as a code owner September 17, 2025 22:02
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Summary of Changes

Hello @wemeetagain, 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 introduces several targeted fixes and a significant refactoring to enhance the beacon node's data availability sampling (DAS) capabilities and improve the robustness of its unknown block synchronization. The changes clarify how data availability columns are tracked per peer, refine the conditions under which peers are excluded during sync operations, and ensure the accuracy of related end-to-end tests. These adjustments are crucial for the upcoming #8200 merge, contributing to a more stable and correct implementation of the Fulu upgrade.

Highlights

  • Refactor custodyGroups to custodyColumns: A widespread renaming and logical adjustment from custodyGroups to custodyColumns to accurately reflect the per-peer tracking of data availability columns, impacting network events, peer management, and sync logic.
  • Refined Peer Exclusion in Unknown Block Sync: Modified the BlockInputSync mechanism to only exclude peers upon encountering most errors during data fetching, specifically avoiding exclusion for REQUEST_RATE_LIMITED and REQUEST_TIMEOUT errors, improving sync resilience.
  • E2E Test Fix for Unknown Block Sync: Corrected an end-to-end test by using the appropriate BlockInputColumns class for block input creation, ensuring the test accurately simulates block processing in the context of data availability.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a 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 introduces several small fixes and improvements. The primary change is the renaming of custodyGroups to custodyColumns across the codebase for better clarity and correctness, especially where per-peer data is tracked for sync purposes. Another significant improvement is in the unknown block sync logic, where peers are no longer unilaterally excluded after a data fetch, but only upon specific, non-transient errors. This should improve sync reliability. The e2e test for unknown block sync is also fixed to use the correct block input type for the fulu fork.

Overall, the changes are positive and improve code quality and robustness. I've found one minor performance improvement opportunity in peerManager.ts to avoid a redundant computation.

@codecov
Copy link

codecov bot commented Sep 18, 2025

Codecov Report

❌ Patch coverage is 25.92593% with 20 lines in your changes missing coverage. Please review.
✅ Project coverage is 54.34%. Comparing base (7a201b6) to head (1f269e8).
⚠️ Report is 2 commits behind head on mkeil/refactor-block-input-on-unstable.

Additional details and impacted files
@@                            Coverage Diff                             @@
##           mkeil/refactor-block-input-on-unstable    #8420      +/-   ##
==========================================================================
- Coverage                                   54.34%   54.34%   -0.01%     
==========================================================================
  Files                                         853      853              
  Lines                                       64112    64122      +10     
  Branches                                     4788     4789       +1     
==========================================================================
+ Hits                                        34840    34844       +4     
- Misses                                      29201    29207       +6     
  Partials                                       71       71              
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Member

@matthewkeil matthewkeil left a comment

Choose a reason for hiding this comment

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

LGTM!! 🚀

Partially resolves #8130 . There is still some usage of custodyGroups on the network thread but that might be ok. Maybe that is the line where groups and columns is divided. Groups on peer caches on the network thread and columns on the main thread where they are consumed by sync. And conversion happens when the peerConnected event happens. Need to add a peerUpdated event #8424


const headInput = BlockInputPreData.createFromBlock({
block: head,
const headInput = BlockInputColumns.createFromBlock({
Copy link
Member

Choose a reason for hiding this comment

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

Very nice catch. Was looking for this bug and totally missed that this was the wrong type of blockInput. Your rock sir!!

@matthewkeil matthewkeil merged commit 0d70dde into mkeil/refactor-block-input-on-unstable Sep 18, 2025
22 of 24 checks passed
@matthewkeil matthewkeil deleted the cayman/fix-e2e branch September 18, 2025 09:35
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.

4 participants