Skip to content
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

eth: Add tests of Beacon API response structs & update Beacon API client #9077

Merged
merged 6 commits into from
Jan 18, 2024

Conversation

sebastianst
Copy link
Member

@sebastianst sebastianst commented Jan 18, 2024

Description

  • Fixes beacon L1 client to use updated format for path eth/v1/beacon/blob_sidecars
  • Adds tests for JSON API response types

Metadata

@sebastianst sebastianst force-pushed the seb/ecotone-beacon-api branch from a542214 to 833335f Compare January 18, 2024 17:27
@sebastianst sebastianst marked this pull request as ready for review January 18, 2024 17:28
@sebastianst sebastianst requested a review from a team as a code owner January 18, 2024 17:28
@sebastianst sebastianst requested review from trianglesphere and roberto-bayardo and removed request for trianglesphere January 18, 2024 17:28
Copy link
Contributor

coderabbitai bot commented Jan 18, 2024

Walkthrough

The recent update involves enhancing the Ethereum-related data structures and their processing within a codebase. The FakeBeacon now initializes with a new type of sidecar that includes signed block headers. The APIBlobSidecar has been extended and can convert to the older BlobSidecar type. New tests ensure JSON compatibility with the Ethereum beacon node API. Additionally, a new Bytes96 type has been created for better data handling, and the L1BeaconClient logic has been updated to process sidecar data differently.

Changes

File Path Change Summary
op-batcher/batcher/config.go
op-batcher/flags/flags.go
Changed DataAvailabilityType to flags.DataAvailabilityType, updated validation logic, and introduced functionality for handling data availability types.
op-e2e/e2eutils/.../blobs.go Modified Start method to use eth.APIBlobSidecar, added SignedBlockHeader to instances.
op-e2e/eip4844_test.go Introduced new test function TestSystem4844E2E for end-to-end testing with EIP-4844 enabled.
op-e2e/setup.go Added DataAvailabilityType field to SystemConfig struct, and modified DefaultSystemConfig function.
op-service/client/http.go Modified Get method to support query parameters in HTTP request.
op-service/eth/blobs_api.go Extended BlobSidecar with APIBlobSidecar, added conversion method, introduced SignedBeaconBlockHeader and BeaconBlockHeader, updated response struct to use APIBlobSidecar.
op-service/eth/blobs_api_test.go Added tests for JSON unmarshaling and response object validation, included utility functions for testing.
op-service/eth/types.go Removed ErrBedrockScalarPaddingNotEmpty, added Bytes96 type with methods for data handling and output formatting.
op-service/sources/.../l1_beacon_client.go Updated GetBlobSidecars method to process and return eth.BlobSidecar objects from server data.

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share

Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit-tests for this file.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit tests for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository from git and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit tests.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • The JSON schema for the configuration file is available here.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.v2.json

CodeRabbit Discord Community

Join our Discord Community to get help, request features, and share feedback.

op-service/eth/blobs_api.go Outdated Show resolved Hide resolved
op-e2e/e2eutils/fakebeacon/blobs.go Show resolved Hide resolved
op-service/eth/blobs_api_test.go Outdated Show resolved Hide resolved
@sebastianst sebastianst force-pushed the seb/ecotone-beacon-api branch from 833335f to 0e96593 Compare January 18, 2024 17:36
@sebastianst sebastianst changed the base branch from develop to eip4844-da-test January 18, 2024 17:36
@sebastianst sebastianst force-pushed the seb/ecotone-beacon-api branch from 74cdf62 to 505ac81 Compare January 18, 2024 20:56
@protolambda protolambda merged commit 55e6baa into eip4844-da-test Jan 18, 2024
0 of 15 checks passed
@protolambda protolambda deleted the seb/ecotone-beacon-api branch January 18, 2024 21:01
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.

3 participants