berachain / beacon-kit

A modular framework for building EVM consensus clients β›΅οΈβœ¨
https://berachain.com
Other
82 stars 45 forks source link

feat(ssz): consolidate lists into one type #1666

Closed itsdevbear closed 5 days ago

itsdevbear commented 5 days ago

Summary by CodeRabbit

coderabbitai[bot] commented 5 days ago

[!WARNING]

Rate limit exceeded

@itsdevbear has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 5 minutes and 51 seconds before requesting another review.

How to resolve this issue? After the wait time has elapsed, a review can be triggered using the `@coderabbitai review` command as a PR comment. Alternatively, push new commits to this PR. We recommend that you space out your commits to avoid hitting the rate limit.
How do rate limits work? CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our [FAQ](https://coderabbit.ai/docs/faq) for further information.
Commits Files that changed from the base of the PR and between 37c7cb17a642219bb3154a8feebd42fefa3c0768 and 962b4577bb0c3231d1b20462ae88f33ee9c281e5.

Walkthrough

This update focuses on modifying the usage of lists within various components of the project. The primary change involves replacing ssz.ListCompositeFromElements with ssz.ListFromElements, which impacts how certain lists are constructed and manipulated. Additionally, there are updates to method signatures and type handling, particularly for the Withdrawal struct and List type, enabling more efficient and flexible processing.

Changes

File(s) Change Summary
mod/cli/pkg/commands/genesis/payload.go, mod/consensus-types/pkg/genesis/genesis.go, mod/consensus-types/pkg/types/payload.go Replaced ssz.ListCompositeFromElements with ssz.ListFromElements for list construction.
mod/engine-primitives/pkg/engine-primitives/withdrawal.go Changed receiver type in methods for Withdrawal struct from (Withdrawal) to (*Withdrawal).
mod/primitives/pkg/ssz/list.go Renamed ListBasic to List, updated functions and method signatures to handle various types.

Poem

In the code where lists now dance, A rabbit found a change by chance. πŸ‡ From composite to a simpler song, Elements compile where they belong. Structs and types in harmony, Enhanced the code so gracefully. Hip-hip-hooray, the code's delight, A rabbit's joy in every byte!


[!TIP]

Early access features: enabled We are currently testing the following features in early access: - **OpenAI `gpt-4o` model for code reviews and chat**: OpenAI claims that this model is better at understanding and generating code than the previous models. We seek your feedback over the next few weeks before making it generally available. Note: - You can enable or disable early access features from the CodeRabbit UI or by updating the CodeRabbit configuration file. - Please join our [Discord Community](https://discord.com/invite/GsXnASn26c) to provide feedback and report issues.
Tips ### Chat There are 3 ways to chat with [CodeRabbit](https://coderabbit.ai): - Review comments: Directly reply to a review comment made by CodeRabbit. Example: - `I pushed a fix in commit .` - `Generate unit testing code for this file.` - `Open a follow-up GitHub issue for this discussion.` - 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 testing code 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 and render them as a table.` - `@coderabbitai show all the console.log statements in this repository.` - `@coderabbitai read src/utils.ts and generate unit testing code.` - `@coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.` - `@coderabbitai help me debug CodeRabbit configuration file.` 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 an incremental review. This is useful when automatic reviews are disabled for the repository. - `@coderabbitai full review` to do a full review from scratch and review all the files again. - `@coderabbitai summary` to regenerate the summary of the PR. - `@coderabbitai resolve` resolve all the CodeRabbit review comments. - `@coderabbitai configuration` to show the current CodeRabbit configuration for the repository. - `@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. - Please see the [configuration documentation](https://docs.coderabbit.ai/guides/configure-coderabbit) for more information. - 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/schema.v2.json` ### Documentation and Community - Visit our [Documentation](https://coderabbit.ai/docs) for detailed information on how to use CodeRabbit. - Join our [Discord Community](https://discord.com/invite/GsXnASn26c) to get help, request features, and share feedback. - Follow us on [X/Twitter](https://twitter.com/coderabbitai) for updates and announcements.
codecov[bot] commented 5 days ago

Codecov Report

Attention: Patch coverage is 7.69231% with 48 lines in your changes missing coverage. Please review.

Project coverage is 22.70%. Comparing base (ed9bbea) to head (962b457).

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/berachain/beacon-kit/pull/1666/graphs/tree.svg?width=650&height=150&src=pr&token=0l5iJ3ZbzV&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=berachain)](https://app.codecov.io/gh/berachain/beacon-kit/pull/1666?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=berachain) ```diff @@ Coverage Diff @@ ## main #1666 +/- ## ========================================== + Coverage 22.65% 22.70% +0.05% ========================================== Files 270 270 Lines 11831 11804 -27 Branches 18 18 ========================================== Hits 2680 2680 + Misses 9029 9002 -27 Partials 122 122 ``` | [Files](https://app.codecov.io/gh/berachain/beacon-kit/pull/1666?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=berachain) | Coverage Ξ” | | |---|---|---| | [mod/consensus-types/pkg/genesis/genesis.go](https://app.codecov.io/gh/berachain/beacon-kit/pull/1666?src=pr&el=tree&filepath=mod%2Fconsensus-types%2Fpkg%2Fgenesis%2Fgenesis.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=berachain#diff-bW9kL2NvbnNlbnN1cy10eXBlcy9wa2cvZ2VuZXNpcy9nZW5lc2lzLmdv) | `94.94% <100.00%> (ΓΈ)` | | | [mod/consensus-types/pkg/types/payload.go](https://app.codecov.io/gh/berachain/beacon-kit/pull/1666?src=pr&el=tree&filepath=mod%2Fconsensus-types%2Fpkg%2Ftypes%2Fpayload.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=berachain#diff-bW9kL2NvbnNlbnN1cy10eXBlcy9wa2cvdHlwZXMvcGF5bG9hZC5nbw==) | `92.92% <100.00%> (ΓΈ)` | | | [mod/cli/pkg/commands/genesis/payload.go](https://app.codecov.io/gh/berachain/beacon-kit/pull/1666?src=pr&el=tree&filepath=mod%2Fcli%2Fpkg%2Fcommands%2Fgenesis%2Fpayload.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=berachain#diff-bW9kL2NsaS9wa2cvY29tbWFuZHMvZ2VuZXNpcy9wYXlsb2FkLmdv) | `0.00% <0.00%> (ΓΈ)` | | | [...ine-primitives/pkg/engine-primitives/withdrawal.go](https://app.codecov.io/gh/berachain/beacon-kit/pull/1666?src=pr&el=tree&filepath=mod%2Fengine-primitives%2Fpkg%2Fengine-primitives%2Fwithdrawal.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=berachain#diff-bW9kL2VuZ2luZS1wcmltaXRpdmVzL3BrZy9lbmdpbmUtcHJpbWl0aXZlcy93aXRoZHJhd2FsLmdv) | `56.52% <0.00%> (ΓΈ)` | | | [mod/primitives/pkg/ssz/vector.go](https://app.codecov.io/gh/berachain/beacon-kit/pull/1666?src=pr&el=tree&filepath=mod%2Fprimitives%2Fpkg%2Fssz%2Fvector.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=berachain#diff-bW9kL3ByaW1pdGl2ZXMvcGtnL3Nzei92ZWN0b3IuZ28=) | `42.00% <33.33%> (-2.69%)` | :arrow_down: | | [mod/primitives/pkg/ssz/list.go](https://app.codecov.io/gh/berachain/beacon-kit/pull/1666?src=pr&el=tree&filepath=mod%2Fprimitives%2Fpkg%2Fssz%2Flist.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=berachain#diff-bW9kL3ByaW1pdGl2ZXMvcGtnL3Nzei9saXN0Lmdv) | `0.00% <0.00%> (ΓΈ)` | |