Skip to content

feat(ethexe/blob-loader): extend BlobLoader tests and add Mock BlobReader#5381

Open
playX18 wants to merge 7 commits intomasterfrom
ap/blob-loader-tests
Open

feat(ethexe/blob-loader): extend BlobLoader tests and add Mock BlobReader#5381
playX18 wants to merge 7 commits intomasterfrom
ap/blob-loader-tests

Conversation

@playX18
Copy link
Copy Markdown
Member

@playX18 playX18 commented Apr 28, 2026

Resolves #4674

@playX18 playX18 self-assigned this Apr 28, 2026
@playX18 playX18 added A0-pleasereview PR is ready to be reviewed by the team D4-test Autotests, and examples D8-ethexe ethexe-related PR labels Apr 28, 2026
@semanticdiff-com
Copy link
Copy Markdown

semanticdiff-com Bot commented Apr 28, 2026

Review changes with  SemanticDiff

Changed Files
File Status
  ethexe/blob-loader/src/lib.rs  2% smaller
  Cargo.lock Unsupported file format
  ethexe/blob-loader/Cargo.toml Unsupported file format
  ethexe/blob-loader/src/tests.rs  0% smaller
  utils/gear-workspace-hack/Cargo.toml Unsupported file format

@StackOverflowExcept1on
Copy link
Copy Markdown
Member

Maybe we'd rather not have MockBlobLoader, but rather test various cases of ConsensusLayerBlobReader? For example: beacon rpc disconnect, the case when chain id != anvil, blob re-request, invalid json data.

@playX18 playX18 marked this pull request as ready for review April 28, 2026 08:22
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, 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 enhances the testing capabilities for the BlobLoader component. By introducing a mock BlobReader and expanding the test suite, it ensures more robust validation of blob loading processes, including handling of network failures, invalid JSON responses, and various chain configurations. The changes also include necessary dependency updates to support these testing improvements.

Highlights

  • Testing Infrastructure: Added a comprehensive suite of tests for the BlobLoader, including a mock BlobReader to simulate various network and beacon node scenarios.
  • Dependency Management: Updated Cargo dependencies to include ethexe-db for testing purposes and adjusted workspace-hack configurations.
  • Code Refactoring: Refactored ConsensusLayerBlobReader to improve testability and streamlined the BlobLoader's asynchronous blob reading logic.
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.

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
Copy Markdown
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 updates the ethexe blob loader to improve code loading efficiency and adds comprehensive tests for the consensus layer blob reader. The changes include adding ethexe-db to dependencies, refining the ConsensusLayerBlobReader struct, and introducing new test utilities for simulating beacon server responses and anvil interactions. I have kept the review comment regarding the Cargo.toml configuration, as removing the target-specific cfg for dependencies could break compilation for WASM-targeted crates in the workspace.


### BEGIN HAKARI SECTION
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
[dependencies]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

high

Removing the target-specific cfg for these dependencies will force them to be resolved for all targets, including wasm32-unknown-unknown. Many of these crates (e.g., alloy with node-bindings and provider-ws) require std and are not compatible with the no_std environment used for Gear programs. This change is likely to break the compilation of WASM-targeted crates in the workspace. This also applies to the build-dependencies section at line 489.

Suggested change
[dependencies]
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]

Copy link
Copy Markdown
Member

@ecol-master ecol-master left a comment

Choose a reason for hiding this comment

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

From my view there is a number of useless tests, for example, tests connected with fake beacon server. I think we do not need to test de-/serialise errors.

Comment thread ethexe/blob-loader/src/lib.rs Outdated
Comment thread ethexe/blob-loader/src/lib.rs Outdated
Comment thread ethexe/blob-loader/src/lib.rs Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A0-pleasereview PR is ready to be reviewed by the team D4-test Autotests, and examples D8-ethexe ethexe-related PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ethexe: write tests for BlobLoaderService

3 participants