Conversation
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 significantly upgrades the beacon node's synchronization capabilities by integrating support for the Gloas fork's execution payload envelopes. It introduces a new network protocol for fetching these envelopes by range and refactors the block processing pipeline to incorporate their validation and state transition. These changes are crucial for ensuring the node can correctly sync and process blocks once the Gloas fork activates, maintaining data integrity and network compatibility. 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 introduces support for gloas range sync by integrating handling of execution payload envelopes throughout the block processing and networking stack. However, a critical security flaw was identified: the importExecutionPayloadEnvelope function, used by both the API and potentially gossip handlers, does not perform BLS signature verification, which bypasses a fundamental security guarantee. It is imperative to add signature verification to this function before merging. Additionally, improvements are needed for code clarity in argument handling for an overloaded function and to add a defensive type check to prevent potential runtime errors.
I am having trouble creating individual review comments. Click here to see my feedback.
packages/beacon-node/src/chain/chain.ts (1082-1096)
The logic to handle the overloaded signatures of processChainSegment is a bit dense and could be hard to follow. Consider refactoring for improved readability by explicitly handling the different argument combinations.
async processChainSegment(
blocks: IBlockInput[],
envelopesOrOpts?: Map<Slot, gloas.SignedExecutionPayloadEnvelope> | null | ImportBlockOpts,
opts?: ImportBlockOpts
): Promise<void> {
let envelopes: Map<Slot, gloas.SignedExecutionPayloadEnvelope> | null = null;
let importOpts: ImportBlockOpts | undefined;
if (envelopesOrOpts instanceof Map || envelopesOrOpts === null) {
envelopes = envelopesOrOpts;
importOpts = opts;
} else {
importOpts = envelopesOrOpts;
}
return this.blockProcessor.processBlocksJob(blocks, importOpts, envelopes);
}packages/beacon-node/src/sync/utils/downloadByRange.ts (554)
The code directly casts block.message.body to gloas.BeaconBlockBody. While it's expected that a block with an envelope is a gloas block, adding a type check with isGloasBeaconBlock would make the code safer and prevent potential runtime errors if a non-gloas block is somehow passed with an envelope.
if (!isGloasBeaconBlock(block.message)) {
// This should not happen if an envelope is present
throw new Error(`Block at slot ${block.message.slot} is not a gloas block but has an envelope`);
}
const bid = block.message.body.signedExecutionPayloadBid.message;
|
Should we target |
depends on the change, we can test it first on the epbs-devnet-0 branch in case of this PR, generally should target unstable |
in that case I'd separate to multiple PRs to make it easier to review because it has different concerns |
…8995) ## Summary This PR packages **local range-sync hardening** that is valid independent of devnet-specific peer behavior. Notably, this PR does **not** switch range sync to a by-root strategy. ### Included - Treat req/resp rate-limit server errors as transient in peer scoring (no downscore for rate-limit responses). - Range sync batch retry hardening: - avoid counting transient download errors toward max-attempt failure, - add retry delay for transient req/resp/rate-limit paths to avoid hot retry loops. - Add peer quarantine for repeated post-fork download error patterns (2-strike threshold before quarantine). - Ensure post-Gloas envelope requests are still made even when column request window is out-of-range. - Harden envelope validation: - require envelope presence for every validated block slot in request range (`ENVELOPE_MISSING_FOR_BLOCK`), - keep block/envelope consistency checks. - Make multi-request req/resp fanout safer by awaiting all in-flight requests (`Promise.allSettled`) before rethrowing first failure. ### Tests - `pnpm lint` - `pnpm vitest packages/beacon-node/test/unit/network/reqresp/score.test.ts packages/beacon-node/test/unit/sync/range/batch.test.ts packages/beacon-node/test/unit/sync/utils/requestByRange.test.ts packages/beacon-node/test/unit/sync/utils/downloadByRange.test.ts` ## Notes This is intentionally scoped to mergeable local robustness improvements and excludes investigation-only by-root range-sync experiments. --------- Co-authored-by: lodekeeper <lodekeeper@users.noreply.github.com>
|
I have merged this PR into the |
no need to merge this branch, let's keep this PR as draft and cherry-pick each different parts to |
Motivation
Description
AI Assistance Disclosure
implement with Codex