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

feat(primitives): Create our own custom execution types #1856

Merged
merged 23 commits into from
Aug 7, 2024

Conversation

itsdevbear
Copy link
Member

@itsdevbear itsdevbear commented Aug 7, 2024

Summary by CodeRabbit

  • New Features

    • Enhanced handling of execution hashes across various components, improving compatibility and standardization.
    • Introduction of the ExecutionHash and ExecutionAddress types in the common package.
  • Bug Fixes

    • Resolved inconsistencies related to execution hash and execution address types in function signatures and return values.
  • Refactor

    • Updated numerous interfaces and methods to replace gethprimitives types with common types for improved code clarity and maintainability.
  • Chores

    • Cleaned up import statements and removed unnecessary dependencies related to the gethprimitives package throughout the codebase.
    • Updated the JWT secret format to a clearer hexadecimal representation.

@itsdevbear itsdevbear requested a review from ocnc as a code owner August 7, 2024 15:42
Copy link
Contributor

coderabbitai bot commented Aug 7, 2024

Caution

Review failed

The pull request is closed.

Walkthrough

The updates bring a substantial refactor to the codebase, primarily shifting from gethprimitives.ExecutionHash to common.ExecutionHash. This transition enhances consistency, maintainability, and interoperability across various modules and interfaces. By eliminating the gethprimitives dependency, the architecture is streamlined, promoting a unified approach to execution hashes and improving the overall coherence of the system. Additionally, mock implementations have been updated to align with these changes, ensuring that testing remains effective and relevant.

Changes

Files Change Summary
mod/beacon/blockchain/types.go Replaced gethprimitives.ExecutionHash with common.ExecutionHash across interfaces like ExecutionEngine, ExecutionPayloadHeader, and LocalBuilder.
mod/beacon/validator/types.go Updated types from gethprimitives.ExecutionHash to common.ExecutionHash in various interfaces, including Eth1Data and PayloadBuilder.
mod/cli/pkg/commands/deposit/create.go Modified return type in broadcastDepositTx from TxHash to common.ExecutionHash, reflecting a standardized transaction hash type.
mod/execution/pkg/client/*.go Changed method signatures to utilize common.ExecutionHash, updating interactions and payload submissions across engine client methods.
mod/consensus-types/go.mod Adjusted dependencies, reintroducing gethprimitives as an indirect requirement, along with a version update for gohashtree.
mod/primitives/go.mod Removed direct dependency on github.com/ethereum/go-ethereum, added golang.org/x/crypto, and restructured indirect requirements.
mod/node-api/backend/mocks/*.mock.go Updated mock implementations to replace bytes.B32 with common.Root across various methods, aligning with the new standard types.
kurtosis/src/nodes/jwt-secret.hex Changed JWT secret format to include 0x prefix for hexadecimal representation, enhancing clarity and consistency.

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant EngineClient
    participant Payload
    participant ExecutionHash

    Client->>EngineClient: Submit Payload
    EngineClient->>Payload: Create Execution Payload
    Payload->>ExecutionHash: Generate Hash
    ExecutionHash-->>Payload: Return Hash
    Payload-->>EngineClient: Return Execution Payload
    EngineClient-->>Client: Return Status
Loading

🐰 In the meadow where bunnies play,
A change has come, hip-hip-hooray!
From geth we’ve leapt, to common we bound,
Execution hashes, now joyfully found.
With each new hop, our code feels right,
A brighter path in the digital light! 🌼✨


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 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 Configuration 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 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 for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

codecov bot commented Aug 7, 2024

Codecov Report

Attention: Patch coverage is 74.88789% with 56 lines in your changes missing coverage. Please review.

Project coverage is 24.42%. Comparing base (1ad255b) to head (2f043a2).

Files Patch % Lines
mod/primitives/pkg/common/consensus.go 52.17% 10 Missing and 1 partial ⚠️
mod/primitives/pkg/common/execution.go 76.08% 10 Missing and 1 partial ⚠️
mod/execution/pkg/client/engine.go 0.00% 4 Missing ⚠️
mod/execution/pkg/client/eth.go 0.00% 4 Missing ⚠️
mod/cli/pkg/commands/deposit/create.go 0.00% 3 Missing ⚠️
mod/cli/pkg/commands/genesis/payload.go 0.00% 3 Missing ⚠️
mod/beacon/validator/block_builder.go 0.00% 2 Missing ⚠️
mod/config/pkg/spec/testnet.go 0.00% 2 Missing ⚠️
mod/config/pkg/viper/parser.go 0.00% 2 Missing ⚠️
...ngine-primitives/pkg/engine-primitives/requests.go 75.00% 2 Missing ⚠️
... and 10 more
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1856      +/-   ##
==========================================
+ Coverage   24.20%   24.42%   +0.21%     
==========================================
  Files         326      328       +2     
  Lines       14062    14138      +76     
  Branches       21       21              
==========================================
+ Hits         3404     3453      +49     
- Misses      10543    10567      +24     
- Partials      115      118       +3     
Files Coverage Δ
mod/beacon/blockchain/service.go 0.00% <ø> (ø)
mod/config/pkg/spec/devnet.go 0.00% <ø> (ø)
mod/consensus-types/pkg/types/block.go 92.72% <100.00%> (ø)
mod/consensus-types/pkg/types/body.go 69.38% <100.00%> (ø)
mod/consensus-types/pkg/types/eth1data.go 89.13% <ø> (ø)
mod/consensus-types/pkg/types/genesis.go 97.36% <100.00%> (+0.07%) ⬆️
mod/consensus-types/pkg/types/payload.go 91.98% <100.00%> (ø)
mod/consensus-types/pkg/types/payload_header.go 96.01% <100.00%> (ø)
...onsensus-types/pkg/types/withdrawal_credentials.go 100.00% <100.00%> (ø)
...ine-primitives/pkg/engine-primitives/attributes.go 73.80% <100.00%> (ø)
... and 38 more

@itsdevbear itsdevbear changed the title feat(primitives): Create our own custom hash feat(primitives): Create our own custom prims Aug 7, 2024
@itsdevbear itsdevbear changed the title feat(primitives): Create our own custom prims feat(primitives): Create our own custom execution types Aug 7, 2024
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE

Commits

Files that changed from the base of the PR and between 1f86ed9 and 39d5802.

Files selected for processing (47)
  • mod/beacon/blockchain/types.go (4 hunks)
  • mod/beacon/validator/block_builder.go (2 hunks)
  • mod/beacon/validator/types.go (5 hunks)
  • mod/cli/pkg/commands/deposit/create.go (1 hunks)
  • mod/cli/pkg/commands/genesis/payload.go (2 hunks)
  • mod/consensus-types/pkg/types/body.go (2 hunks)
  • mod/consensus-types/pkg/types/body_test.go (2 hunks)
  • mod/consensus-types/pkg/types/eth1data.go (3 hunks)
  • mod/consensus-types/pkg/types/eth1data_test.go (6 hunks)
  • mod/consensus-types/pkg/types/genesis.go (2 hunks)
  • mod/consensus-types/pkg/types/payload.go (9 hunks)
  • mod/consensus-types/pkg/types/payload_header.go (7 hunks)
  • mod/consensus-types/pkg/types/payload_header_test.go (5 hunks)
  • mod/consensus-types/pkg/types/payload_test.go (7 hunks)
  • mod/da/pkg/blob/types.go (2 hunks)
  • mod/da/pkg/store/types.go (2 hunks)
  • mod/engine-primitives/pkg/engine-primitives/engine.go (3 hunks)
  • mod/engine-primitives/pkg/engine-primitives/engine_test.go (3 hunks)
  • mod/engine-primitives/pkg/engine-primitives/requests.go (8 hunks)
  • mod/engine-primitives/pkg/engine-primitives/requests_test.go (4 hunks)
  • mod/execution/pkg/client/cache/cache.go (5 hunks)
  • mod/execution/pkg/client/cache/cache_test.go (4 hunks)
  • mod/execution/pkg/client/engine.go (2 hunks)
  • mod/execution/pkg/client/eth.go (2 hunks)
  • mod/execution/pkg/client/ethclient/client.go (2 hunks)
  • mod/execution/pkg/client/ethclient/engine.go (3 hunks)
  • mod/execution/pkg/client/helpers.go (2 hunks)
  • mod/execution/pkg/engine/engine.go (3 hunks)
  • mod/execution/pkg/engine/metrics.go (7 hunks)
  • mod/execution/pkg/engine/types.go (1 hunks)
  • mod/payload/pkg/builder/payload.go (3 hunks)
  • mod/payload/pkg/builder/types.go (2 hunks)
  • mod/primitives/pkg/bytes/b.go (1 hunks)
  • mod/primitives/pkg/bytes/b20.go (1 hunks)
  • mod/primitives/pkg/bytes/b256.go (1 hunks)
  • mod/primitives/pkg/bytes/b32.go (1 hunks)
  • mod/primitives/pkg/bytes/b4.go (1 hunks)
  • mod/primitives/pkg/bytes/b48.go (1 hunks)
  • mod/primitives/pkg/bytes/b8.go (1 hunks)
  • mod/primitives/pkg/bytes/b96.go (1 hunks)
  • mod/primitives/pkg/bytes/utils.go (1 hunks)
  • mod/primitives/pkg/common/execution.go (1 hunks)
  • mod/primitives/pkg/encoding/hex/bytes.go (1 hunks)
  • mod/primitives/pkg/encoding/hex/bytes_test.go (1 hunks)
  • mod/state-transition/pkg/core/state_processor.go (3 hunks)
  • mod/state-transition/pkg/core/state_processor_genesis.go (1 hunks)
  • mod/state-transition/pkg/core/types.go (3 hunks)
Additional comments not posted (122)
mod/primitives/pkg/bytes/b.go (1)

34-34: LGTM! The change ensures compliance with the encoding.TextMarshaler interface.

The method now correctly returns both a byte slice and an error, enhancing robustness and clarity.

mod/da/pkg/store/types.go (1)

48-48: LGTM! The change enhances modularity and maintainability.

The method now returns common.ExecutionHash instead of gethprimitives.ExecutionHash, consolidating common types into a single package.

mod/execution/pkg/client/eth.go (1)

68-78: LGTM! The change improves modularity and type management.

The function now accepts common.ExecutionHash instead of gethprimitives.ExecutionHash and converts it back to gethprimitives.ExecutionHash for internal use, ensuring backward compatibility.

mod/da/pkg/blob/types.go (1)

51-51: Verify the impact of the return type change.

The return type of GetBlobKzgCommitments has been changed from eip4844.KZGCommitments[gethprimitives.ExecutionHash] to eip4844.KZGCommitments[common.ExecutionHash]. Ensure that all usages of this method are compatible with the new return type.

Verification successful

Verify the impact of the return type change.

The return type of GetBlobKzgCommitments has been changed from eip4844.KZGCommitments[gethprimitives.ExecutionHash] to eip4844.KZGCommitments[common.ExecutionHash]. Ensure that all usages of this method are compatible with the new return type.

  • mod/da/pkg/blob/factory_test.go
  • mod/state-transition/pkg/core/state_processor_payload.go
  • mod/da/pkg/store/types.go
  • mod/state-transition/pkg/core/types.go
  • mod/da/pkg/store/store.go
  • mod/da/pkg/blob/types.go
  • mod/da/pkg/blob/factory.go
  • mod/consensus-types/pkg/types/body.go
  • mod/consensus-types/pkg/types/body_test.go
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all usages of `GetBlobKzgCommitments` are compatible with the new return type.

# Test: Search for the method usage. Expect: Only occurrences of the new return type.
rg --type go -A 5 $'GetBlobKzgCommitments'

Length of output: 5214

mod/execution/pkg/engine/types.go (2)

37-37: Verify the impact of the return type change.

The return type of GetParentHash has been changed from gethprimitives.ExecutionHash to common.ExecutionHash. Ensure that all usages of this method are compatible with the new return type.


36-36: Verify the impact of the return type change.

The return type of GetBlockHash has been changed from gethprimitives.ExecutionHash to common.ExecutionHash. Ensure that all usages of this method are compatible with the new return type.

Verification successful

Verification successful.

The return type of GetBlockHash has been consistently updated to common.ExecutionHash across the codebase. All usages are compatible with the new return type.

  • mod/beacon/validator/types.go
  • mod/beacon/blockchain/payload.go
  • mod/beacon/blockchain/execution_engine.go
  • mod/beacon/blockchain/types.go
  • mod/beacon/validator/block_builder.go
  • mod/state-transition/pkg/core/state_processor_payload.go
  • mod/payload/pkg/builder/types.go
  • mod/payload/pkg/builder/payload.go
  • mod/state-transition/pkg/core/types.go
  • mod/state-transition/pkg/core/state_processor_genesis.go
  • mod/execution/pkg/engine/types.go
  • mod/execution/pkg/engine/engine.go
  • mod/engine-primitives/pkg/engine-primitives/requests_test.go
  • mod/engine-primitives/pkg/engine-primitives/requests.go
  • mod/consensus-types/pkg/types/payload_header.go
  • mod/consensus-types/pkg/types/payload_header_test.go
  • mod/consensus-types/pkg/types/payload.go
  • mod/consensus-types/pkg/types/payload_test.go
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all usages of `GetBlockHash` are compatible with the new return type.

# Test: Search for the method usage. Expect: Only occurrences of the new return type.
rg --type go -A 5 $'GetBlockHash'

Length of output: 15426

mod/consensus-types/pkg/types/eth1data_test.go (5)

102-102: Verify the impact of the type change.

The type of BlockHash in the Eth1Data structure has been changed from gethprimitives.ExecutionHash{} to common.ExecutionHash{}. Ensure that this change does not affect the deposit count retrieval logic.


89-89: Verify the impact of the type change.

The type of BlockHash in the Eth1Data structure has been changed from gethprimitives.ExecutionHash{} to common.ExecutionHash{}. Ensure that this change does not affect the tree generation logic.

Verification successful

Verification successful.

The type of BlockHash in the Eth1Data structure has been consistently updated to common.ExecutionHash across the codebase. There are no compatibility issues found with this change.

  • mod/consensus-types/pkg/types/eth1data.go
  • mod/consensus-types/pkg/types/payload_header.go
  • mod/consensus-types/pkg/types/payload.go
  • mod/consensus-types/pkg/types/eth1data_test.go
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all usages of `Eth1Data.BlockHash` are compatible with the new type.

# Test: Search for the usage of `BlockHash` in the `Eth1Data` structure. Expect: Only occurrences of the new type.
rg --type go -A 5 $'BlockHash'

Length of output: 47479


66-66: Verify the impact of the type change.

The type of BlockHash in the Eth1Data structure has been changed from gethprimitives.ExecutionHash{} to common.ExecutionHash{}. Ensure that this change does not affect the size calculation logic.

Verification successful

Verify the impact of the type change.

The type of BlockHash in the Eth1Data structure has been changed from gethprimitives.ExecutionHash{} to common.ExecutionHash{}. Ensure that this change does not affect the size calculation logic.


Verification successful.

The type of BlockHash in the Eth1Data structure has been changed from gethprimitives.ExecutionHash{} to common.ExecutionHash{}. The size calculation logic remains unaffected as both types are 32-byte hashes, and the size definitions are consistent.

  • mod/consensus-types/pkg/types/eth1data.go: Eth1DataSize is defined as 72 bytes, accounting for BlockHash.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all usages of `Eth1Data.BlockHash` are compatible with the new type.

# Test: Search for the usage of `BlockHash` in the `Eth1Data` structure. Expect: Only occurrences of the new type.
rg --type go -A 5 $'BlockHash'

Length of output: 47479


Script:

#!/bin/bash
# Description: Verify size definitions and calculations involving `BlockHash`.

# Search for size definitions and calculations involving `BlockHash`.
rg --type go -A 5 'BlockHash' | grep -i 'size\|length\|calc\|define'

Length of output: 954


36-36: Verify the impact of the type change.

The type of BlockHash in the Eth1Data structure has been changed from gethprimitives.ExecutionHash{} to common.ExecutionHash{}. Ensure that this change does not affect the serialization logic.

Verification successful

Verify serialization logic compatibility.

The type of BlockHash in the Eth1Data structure has been changed from gethprimitives.ExecutionHash{} to common.ExecutionHash{}. Ensure that this change does not affect the serialization logic by checking the methods handling serialization and deserialization.


Verify serialization method implementations for compatibility.

The type of BlockHash in the Eth1Data structure has been changed. Ensure that the serialization methods correctly handle the new type by inspecting their implementations.


Verify serialization method implementations for compatibility.

The type of BlockHash in the Eth1Data structure has been changed. Ensure that the serialization methods correctly handle the new type by inspecting their implementations.


Verification successful.

The type of BlockHash in the Eth1Data structure has been changed from gethprimitives.ExecutionHash{} to common.ExecutionHash{}. The serialization methods (HashTreeRoot, MarshalSSZ, UnmarshalSSZ, MarshalSSZTo, HashTreeRootWith) correctly handle the new type, ensuring that the serialization logic remains unaffected.

  • HashTreeRoot: Correctly computes the SSZ hash tree root.
  • MarshalSSZ: Marshals the object to SSZ format.
  • UnmarshalSSZ: Unmarshals the object from SSZ format.
  • MarshalSSZTo: Marshals the object into a pre-allocated byte slice.
  • HashTreeRootWith: Hashes the object with a hasher.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all usages of `Eth1Data.BlockHash` are compatible with the new type.

# Test: Search for the usage of `BlockHash` in the `Eth1Data` structure. Expect: Only occurrences of the new type.
rg --type go -A 5 $'BlockHash'

Length of output: 47479


Script:

#!/bin/bash
# Description: Verify serialization methods for `Eth1Data` structure.

# Search for serialization-related methods in `eth1data.go`.
rg --type go 'MarshalSSZ|UnmarshalSSZ|HashTreeRoot|json.Marshal|json.Unmarshal' mod/consensus-types/pkg/types/eth1data.go

Length of output: 767


Script:

#!/bin/bash
# Description: Extract implementations of serialization methods in `eth1data.go`.

# Extract implementations of the identified methods.
ast-grep --lang go --pattern $'func (e *Eth1Data) HashTreeRoot() $_ { $$$ }\nfunc (e *Eth1Data) MarshalSSZ() $_ { $$$ }\nfunc (e *Eth1Data) UnmarshalSSZ($_) $_ { $$$ }\nfunc (e *Eth1Data) MarshalSSZTo($_) $_ { $$$ }\nfunc (e *Eth1Data) HashTreeRootWith($_) $_ { $$$ }' mod/consensus-types/pkg/types/eth1data.go

Length of output: 962


Script:

#!/bin/bash
# Description: Extract implementations of serialization methods in `eth1data.go`.

# Extract implementation of `HashTreeRoot` method.
ast-grep --lang go --pattern $'func (e *Eth1Data) HashTreeRoot() $_ { $$$ }' mod/consensus-types/pkg/types/eth1data.go

# Extract implementation of `MarshalSSZ` method.
ast-grep --lang go --pattern $'func (e *Eth1Data) MarshalSSZ() $_ { $$$ }' mod/consensus-types/pkg/types/eth1data.go

# Extract implementation of `UnmarshalSSZ` method.
ast-grep --lang go --pattern $'func (e *Eth1Data) UnmarshalSSZ($_) $_ { $$$ }' mod/consensus-types/pkg/types/eth1data.go

# Extract implementation of `MarshalSSZTo` method.
ast-grep --lang go --pattern $'func (e *Eth1Data) MarshalSSZTo($_) $_ { $$$ }' mod/consensus-types/pkg/types/eth1data.go

# Extract implementation of `HashTreeRootWith` method.
ast-grep --lang go --pattern $'func (e *Eth1Data) HashTreeRootWith($_) $_ { $$$ }' mod/consensus-types/pkg/types/eth1data.go

Length of output: 2834


77-77: Verify the impact of the type change.

The type of BlockHash in the Eth1Data structure has been changed from gethprimitives.ExecutionHash{} to common.ExecutionHash{}. Ensure that this change does not affect the hash tree root calculation logic.

mod/primitives/pkg/common/execution.go (8)

53-55: LGTM!

The method correctly converts the ExecutionHash to a hex string.


56-60: LGTM!

The method correctly implements the Stringer interface by returning the hex representation of the hash.


62-65: LGTM!

The method correctly marshals the ExecutionHash to text by returning its hex representation.


72-75: LGTM!

The method correctly marshals the ExecutionHash to JSON by returning its hex representation.


43-46: LGTM!

The type ExecutionHash is correctly defined as a fixed-size array of 32 bytes.


77-80: Verify the usage of hex.DecodeFixedJSON.

Ensure that hex.DecodeFixedJSON correctly handles invalid JSON strings and that its usage here is safe.

Verification successful

Verified the usage of hex.DecodeFixedJSON.

The test cases in bytes_test.go confirm that hex.DecodeFixedJSON correctly handles invalid JSON strings and raises errors as expected. The usage of this function in UnmarshalJSON is safe and appropriate.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the usage of `hex.DecodeFixedJSON`.

# Test: Search for the function usage. Expect: Correct handling of invalid JSON strings.
rg --type go -A 5 $'hex.DecodeFixedJSON'

Length of output: 1046


Script:

#!/bin/bash
# Extract and review the test cases for `hex.DecodeFixedJSON` in `bytes_test.go`.

# Display the relevant test cases to ensure correct handling of invalid JSON strings.
rg --type go -A 10 -B 5 'hex.DecodeFixedJSON' mod/primitives/pkg/encoding/hex/bytes_test.go

Length of output: 473


67-70: Verify the usage of hex.DecodeFixedText.

Ensure that hex.DecodeFixedText correctly handles invalid hex strings and that its usage here is safe.

Verification successful

Verify the test coverage for hex.DecodeFixedText with invalid hex strings.

Ensure that the tests in mod/primitives/pkg/encoding/hex/bytes_test.go cover invalid input cases.


The usage of hex.DecodeFixedText is verified.

The test cases in mod/primitives/pkg/encoding/hex/bytes_test.go confirm that hex.DecodeFixedText correctly handles invalid hex strings, ensuring its safe usage in the UnmarshalText method.

  • mod/primitives/pkg/encoding/hex/bytes_test.go
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the usage of `hex.DecodeFixedText`.

# Test: Search for the function usage. Expect: Correct handling of invalid hex strings.
rg --type go -A 5 $'hex.DecodeFixedText'

Length of output: 1506


Script:

#!/bin/bash
# Extract test cases for hex.DecodeFixedText from bytes_test.go
rg --type go -A 10 'hex.DecodeFixedText' mod/primitives/pkg/encoding/hex/bytes_test.go

Length of output: 490


49-51: Verify the usage of hexutil.MustDecode.

Ensure that hexutil.MustDecode correctly handles invalid hex strings and that its usage here is safe.

mod/execution/pkg/client/helpers.go (2)

30-30: LGTM!

The import statement correctly adds the common package.


56-58: LGTM!

The function correctly handles the new return type *common.ExecutionHash and maintains its original functionality.

mod/execution/pkg/client/ethclient/client.go (2)

29-29: LGTM!

The import statement correctly adds the common package.


62-64: LGTM!

The function correctly handles the new parameter type common.ExecutionHash and maintains its original functionality.

mod/execution/pkg/client/cache/cache.go (5)

25-25: Import change approved.

The import statement for common.ExecutionHash aligns with the transition from gethprimitives.ExecutionHash to common.ExecutionHash.


39-40: Type change approved.

The type of headerByHashCache has been changed to use common.ExecutionHash, ensuring consistency with the new hash type.


56-58: Method change approved.

The NewEngineCache method has been updated to use common.ExecutionHash for headerByHashCache, ensuring the cache is instantiated with the new hash type.


79-79: Method parameter type change approved.

The HeaderByHash method's parameter type has been changed to common.ExecutionHash, ensuring type consistency.


90-93: Internal type usage change approved.

The AddHeader method now uses common.ExecutionHash internally, ensuring type consistency.

mod/primitives/pkg/bytes/b32.go (1)

70-70: Method call change approved.

The UnmarshalJSON method now calls UnmarshalJSONHelper instead of unmarshalJSONHelper, suggesting a shift towards a more unified or standardized approach to JSON unmarshalling.

mod/primitives/pkg/bytes/b4.go (1)

68-68: Method call change approved.

The UnmarshalJSON method now calls UnmarshalJSONHelper instead of unmarshalJSONHelper, suggesting a shift towards a more unified or standardized approach to JSON unmarshalling.

mod/primitives/pkg/bytes/b20.go (1)

68-68: LGTM! But verify the usage of UnmarshalJSONHelper.

The change to use UnmarshalJSONHelper instead of unmarshalJSONHelper is approved.

However, ensure that UnmarshalJSONHelper is correctly implemented and used across the codebase.

Verification successful

LGTM! The implementation and usage of UnmarshalJSONHelper are correct.

  • The function UnmarshalJSONHelper is properly defined in mod/primitives/pkg/bytes/utils.go.
  • It is appropriately used in the UnmarshalJSON methods of various structs across multiple files.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the usage of `UnmarshalJSONHelper` in the codebase.

# Test: Search for the function definition and usage. Expect: Correct implementation and usage.
rg --type go $'UnmarshalJSONHelper'

Length of output: 640


Script:

#!/bin/bash
# Extract the implementation of UnmarshalJSONHelper from utils.go
ast-grep --lang go --pattern $'func UnmarshalJSONHelper(target []byte, input []byte) error {
  $$$
}' mod/primitives/pkg/bytes/utils.go

# Review the usage context of UnmarshalJSONHelper in the mentioned files
for file in mod/primitives/pkg/bytes/b20.go mod/primitives/pkg/bytes/b48.go mod/primitives/pkg/bytes/b4.go mod/primitives/pkg/bytes/b256.go mod/primitives/pkg/bytes/b32.go mod/primitives/pkg/bytes/b96.go mod/primitives/pkg/bytes/b8.go; do
  echo "File: $file"
  rg --context 5 --line-number "UnmarshalJSONHelper" $file
done

Length of output: 8001

mod/primitives/pkg/bytes/b8.go (1)

68-68: LGTM! But verify the usage of UnmarshalJSONHelper.

The change to use UnmarshalJSONHelper instead of unmarshalJSONHelper is approved.

However, ensure that UnmarshalJSONHelper is correctly implemented and used across the codebase.

Verification successful

Verified: The implementation and usage of UnmarshalJSONHelper are correct and consistent across the codebase.

  • The function performs necessary checks and operations to ensure proper unmarshaling.
  • It is used correctly in multiple files, indicating its reliability.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the usage of `UnmarshalJSONHelper` in the codebase.

# Test: Search for the function definition and usage. Expect: Correct implementation and usage.
rg --type go $'UnmarshalJSONHelper'

Length of output: 640


Script:

#!/bin/bash
# Extract the implementation of `UnmarshalJSONHelper` from `utils.go` for review.
ast-grep --lang go --pattern $'func UnmarshalJSONHelper(target []byte, input []byte) error {
  $$$
}' mod/primitives/pkg/bytes/utils.go

Length of output: 964

mod/primitives/pkg/encoding/hex/bytes.go (1)

29-33: LGTM! But verify the error handling strategy.

The change to return only []byte from EncodeBytes is approved.

However, ensure that error handling is appropriately managed within the function or elsewhere in the codebase.

Verification successful

Verification successful. No issues found.

The EncodeBytes function's change to return only []byte is appropriate. The hex.Encode function used within does not return an error, ensuring that the operation is safe and does not require additional error handling.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the error handling strategy for `EncodeBytes`.

# Test: Search for the function definition and usage. Expect: Appropriate error handling.
rg --type go $'EncodeBytes'

Length of output: 529


Script:

#!/bin/bash
# Extract the complete implementation of the EncodeBytes function to verify error handling.

ast-grep --lang go --pattern $'func EncodeBytes[B ~[]byte](b B) []byte {
  $$$
}' mod/primitives/pkg/encoding/hex/bytes.go

Length of output: 547

mod/primitives/pkg/bytes/utils.go (1)

31-31: LGTM! But verify the function usage in the codebase.

The code changes are approved.

However, ensure that all function calls to UnmarshalJSONHelper are updated to match the new name.

Verification successful

Function usage is consistent.

All occurrences of UnmarshalJSONHelper in the codebase match the new function name.

  • mod/primitives/pkg/bytes/b20.go
  • mod/primitives/pkg/bytes/b4.go
  • mod/primitives/pkg/bytes/b32.go
  • mod/primitives/pkg/bytes/b48.go
  • mod/primitives/pkg/bytes/b8.go
  • mod/primitives/pkg/bytes/b256.go
  • mod/primitives/pkg/bytes/b96.go
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `UnmarshalJSONHelper` match the new name.

# Test: Search for the function usage. Expect: Only occurrences of the new name.
rg --type go -A 5 $'UnmarshalJSONHelper'

Length of output: 3782

mod/engine-primitives/pkg/engine-primitives/engine_test.go (4)

27-27: LGTM!

The import of common.ExecutionHash ensures consistency in hash types.


58-60: LGTM!

The changes to ForkchoiceStateV1 are consistent with the new hash type.


62-66: LGTM!

The test assertions for ForkchoiceStateV1 have been correctly updated.


84-87: LGTM!

The changes to PayloadStatusV1 are consistent with the new hash type.

mod/primitives/pkg/bytes/b48.go (1)

69-69: LGTM! But verify the function usage in the codebase.

The code changes are approved.

However, ensure that all function calls to UnmarshalJSONHelper are updated to match the new name.

Verification successful

Verification Successful: All function calls to UnmarshalJSONHelper are correctly updated to match the new name.

  • The function UnmarshalJSONHelper is consistently used across the codebase without any discrepancies.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `UnmarshalJSONHelper` match the new name.

# Test: Search for the function usage. Expect: Only occurrences of the new name.
rg --type go -A 5 $'UnmarshalJSONHelper'

Length of output: 3782

mod/execution/pkg/client/cache/cache_test.go (3)

31-31: Import statement addition looks good.

The common package is correctly imported to use the ExecutionHash function.


54-54: Hash computation change looks good.

The hash computation now uses common.ExecutionHash(h.Hash()), aligning with the new hashing mechanism.

However, ensure that all function calls to common.ExecutionHash are correct.

Verification successful

Hash computation change looks good.

The hash computation now uses common.ExecutionHash(h.Hash()), aligning with the new hashing mechanism. The usage of common.ExecutionHash is consistent across the codebase.

  • mod/execution/pkg/client/cache/cache_test.go: Verified the correct usage of common.ExecutionHash.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `common.ExecutionHash` are correct.

# Test: Search for the function usage. Expect: Only occurrences of the new function.
rg --type python -A 5 $'common.ExecutionHash'

Length of output: 75


Script:

#!/bin/bash
# Description: Verify all function calls to `common.ExecutionHash` are correct.

# Test: Search for the function usage. Expect: Only occurrences of the new function.
rg --type go -A 5 'common.ExecutionHash'

Length of output: 56672


73-80: Hash computation changes look good.

The hash computations now use common.ExecutionHash(h1.Hash()) and common.ExecutionHash(newHeader.Hash()), aligning with the new hashing mechanism.

However, ensure that all function calls to common.ExecutionHash are correct.

Verification successful

Hash computation changes look good.

The hash computations now use common.ExecutionHash(h1.Hash()) and common.ExecutionHash(newHeader.Hash()), aligning with the new hashing mechanism.

  • Verified correct usage of common.ExecutionHash across the codebase.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `common.ExecutionHash` are correct.

# Test: Search for the function usage. Expect: Only occurrences of the new function.
rg --type python -A 5 $'common.ExecutionHash'

Length of output: 75


Script:

#!/bin/bash
# Description: Verify all function calls to `common.ExecutionHash` are correct.

# Test: Search for the function usage. Expect: Only occurrences of the new function.
rg --type go -A 5 $'common.ExecutionHash'

Length of output: 56672

mod/primitives/pkg/bytes/b96.go (1)

69-69: Change to UnmarshalJSONHelper looks good.

The call to unmarshalJSONHelper is updated to UnmarshalJSONHelper, aligning with the new API design.

However, ensure that all function calls to UnmarshalJSONHelper are correct.

Verification successful

Change to UnmarshalJSONHelper looks good.

The call to UnmarshalJSONHelper is updated and used consistently across multiple files, aligning with the new API design.

  • mod/primitives/pkg/bytes/b20.go
  • mod/primitives/pkg/bytes/b256.go
  • mod/primitives/pkg/bytes/b96.go
  • mod/primitives/pkg/bytes/b8.go
  • mod/primitives/pkg/bytes/utils.go
  • mod/primitives/pkg/bytes/b4.go
  • mod/primitives/pkg/bytes/b48.go
  • mod/primitives/pkg/bytes/b32.go
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `UnmarshalJSONHelper` are correct.

# Test: Search for the function usage. Expect: Only occurrences of the new function.
rg --type python -A 5 $'UnmarshalJSONHelper'

Length of output: 74


Script:

#!/bin/bash
# Description: Verify all function calls to `UnmarshalJSONHelper` are correct.

# Test: Search for the function usage. Expect: Only occurrences of the new function.
rg --type go -A 5 $'UnmarshalJSONHelper'

Length of output: 3782

mod/primitives/pkg/bytes/b256.go (1)

69-69: Change to UnmarshalJSONHelper looks good.

The call to unmarshalJSONHelper is updated to UnmarshalJSONHelper, aligning with the new API design.

However, ensure that all function calls to UnmarshalJSONHelper are correct.

Verification successful

Change to UnmarshalJSONHelper looks good.

The call to unmarshalJSONHelper is updated to UnmarshalJSONHelper, aligning with the new API design. The function is used consistently across multiple files.

  • mod/primitives/pkg/bytes/b8.go
  • mod/primitives/pkg/bytes/b48.go
  • mod/primitives/pkg/bytes/b4.go
  • mod/primitives/pkg/bytes/b32.go
  • mod/primitives/pkg/bytes/b20.go
  • mod/primitives/pkg/bytes/b256.go
  • mod/primitives/pkg/bytes/b96.go
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `UnmarshalJSONHelper` are correct.

# Test: Search for the function usage. Expect: Only occurrences of the new function.
rg --type python -A 5 $'UnmarshalJSONHelper'

Length of output: 74


Script:

#!/bin/bash
# Description: Verify all function calls to `UnmarshalJSONHelper` are correct.

# Test: Search for the function usage. Expect: Only occurrences of the new function.
rg --type go -A 5 $'UnmarshalJSONHelper'

Length of output: 3782

mod/payload/pkg/builder/types.go (5)

60-60: LGTM!

The return type of GetBlockHash has been changed from gethprimitives.ExecutionHash to common.ExecutionHash for consistency.


64-64: LGTM!

The return type of GetParentHash has been changed from gethprimitives.ExecutionHash to common.ExecutionHash for consistency.


70-70: LGTM!

The return type of GetBlockHash has been changed from gethprimitives.ExecutionHash to common.ExecutionHash for consistency.


72-72: LGTM!

The return type of GetParentHash has been changed from gethprimitives.ExecutionHash to common.ExecutionHash for consistency.


106-106: LGTM!

The return type of NotifyForkchoiceUpdate has been changed from gethprimitives.ExecutionHash to common.ExecutionHash for consistency.

mod/engine-primitives/pkg/engine-primitives/engine.go (4)

77-77: LGTM!

The type of HeadBlockHash has been changed from gethprimitives.ExecutionHash to common.ExecutionHash for consistency.


82-82: LGTM!

The type of SafeBlockHash has been changed from gethprimitives.ExecutionHash to common.ExecutionHash for consistency.


85-85: LGTM!

The type of FinalizedBlockHash has been changed from gethprimitives.ExecutionHash to common.ExecutionHash for consistency.


98-98: LGTM!

The type of LatestValidHash has been changed from *gethprimitives.ExecutionHash to *common.ExecutionHash for consistency.

mod/state-transition/pkg/core/state_processor_genesis.go (1)

78-78: LGTM!

The block hash is now wrapped in common.ExecutionHash before being passed to SetEth1Data, enhancing type safety.

mod/consensus-types/pkg/types/eth1data.go (2)

46-46: Transition to common.ExecutionHash approved.

The change from gethprimitives.ExecutionHash to common.ExecutionHash in the BlockHash field is consistent with the goal of unifying the codebase under the common package.


62-62: Transition to common.ExecutionHash in New method approved.

The change from gethprimitives.ExecutionHash to common.ExecutionHash in the blockHash parameter aligns with the updated Eth1Data struct.

mod/consensus-types/pkg/types/body_test.go (1)

92-92: Transition to common.ExecutionHash in TestBeaconBlockBody_SetBlobKzgCommitments approved.

The change from gethprimitives.ExecutionHash to common.ExecutionHash in the KZGCommitments type is consistent with the goal of unifying the codebase under the common package.

mod/consensus-types/pkg/types/genesis.go (2)

134-134: Transition to common.ExecutionHash for ParentHash approved.

The change from gethprimitives.ZeroHash to common.ExecutionHash{} in the ParentHash field is consistent with the goal of unifying the codebase under the common package.


154-154: Transition to common.NewExecutionHashFromHex for BlockHash approved.

The change from gethprimitives.HexToHash(...) to common.NewExecutionHashFromHex(...) in the BlockHash field is consistent with the goal of unifying the codebase under the common package.

mod/primitives/pkg/encoding/hex/bytes_test.go (1)

57-57: Verify the assumption about hex.EncodeBytes error handling.

The removal of error handling assumes that hex.EncodeBytes will not produce an error in this context. Ensure that hex.EncodeBytes is guaranteed not to produce errors or that this assumption is valid for the test cases.

Verification successful

Verified the assumption about hex.EncodeBytes error handling.

The EncodeBytes function does not return an error type, confirming that it does not produce errors. The removal of error handling in the test function is justified.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify that `hex.EncodeBytes` does not produce errors.

# Test: Search for the function definition. Expect: No error return type.
rg --type go -A 5 $'func EncodeBytes'

Length of output: 444

mod/engine-primitives/pkg/engine-primitives/requests_test.go (3)

118-118: LGTM!

The change standardizes the type definition for execution hashes, improving code consistency.


183-184: LGTM!

The change standardizes the type definition for execution hashes, improving code consistency.


51-55: LGTM! But verify the usage of common.ExecutionHash.

The changes standardize the type definition for execution hashes, improving code consistency.

However, ensure that all instances of common.ExecutionHash are correctly used throughout the codebase.

Verification successful

LGTM! Verified the consistent usage of common.ExecutionHash throughout the codebase.

The changes standardize the type definition for execution hashes, improving code consistency. All instances of common.ExecutionHash are correctly used across the codebase.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the usage of `common.ExecutionHash` in the codebase.

# Test: Search for the type definition and its usage. Expect: Consistent usage.
rg --type go -A 5 $'common.ExecutionHash'

Length of output: 56672

mod/cli/pkg/commands/genesis/payload.go (2)

167-167: LGTM!

The changes ensure that the ParentHash is correctly formatted or validated before being assigned, enhancing the integrity and consistency of the execution payload data.


179-179: LGTM!

The changes ensure that the BlockHash is correctly formatted or validated before being assigned, enhancing the integrity and consistency of the execution payload data.

mod/execution/pkg/client/ethclient/engine.go (2)

40-43: LGTM! Transition to common.ExecutionHash is appropriate.

The change from []gethprimitives.ExecutionHash to []common.ExecutionHash aligns with the new type system.


57-63: LGTM! Transition to common.ExecutionHash is appropriate.

The change from []gethprimitives.ExecutionHash to []common.ExecutionHash aligns with the new type system. The cast of parentBlockRoot is also correctly updated.

mod/execution/pkg/client/engine.go (2)

46-48: LGTM! Transition to common.ExecutionHash is appropriate.

The change from []gethprimitives.ExecutionHash to []common.ExecutionHash aligns with the new type system. The return type is also correctly updated.


94-94: LGTM! Transition to common.ExecutionHash is appropriate.

The change from (*gethprimitives.ExecutionHash, error) to (*common.ExecutionHash, error) aligns with the new type system.

mod/payload/pkg/builder/payload.go (2)

43-44: LGTM! Transition to common.ExecutionHash is appropriate.

The change from gethprimitives.ExecutionHash to common.ExecutionHash aligns with the new type system.


104-105: LGTM! Transition to common.ExecutionHash is appropriate.

The change from gethprimitives.ExecutionHash to common.ExecutionHash aligns with the new type system.

mod/beacon/blockchain/types.go (3)

114-116: LGTM! But verify the function usage in the codebase.

The code changes are approved.

However, ensure that all function calls to GetBlockHash and GetParentHash match the new return signature.


93-93: LGTM! But verify the function usage in the codebase.

The code changes are approved.

However, ensure that all function calls to NotifyForkchoiceUpdate match the new return signature.

Verification successful

All function calls to NotifyForkchoiceUpdate match the new return signature.

The return values are correctly handled in the codebase.

  • mod/payload/pkg/builder/payload.go
  • mod/execution/pkg/engine/engine.go
  • mod/beacon/blockchain/execution_engine.go
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `NotifyForkchoiceUpdate` match the new return signature.

# Test: Search for the function usage. Expect: Only occurrences of the new signature.
rg --type go -A 5 $'NotifyForkchoiceUpdate'

Length of output: 4285


Script:

#!/bin/bash
# Description: Verify the handling of return values for all occurrences of `NotifyForkchoiceUpdate`.

# Test: Search for the function usage and check the handling of return values.
rg --type go -A 10 $'NotifyForkchoiceUpdate' | grep -E 'payloadID|latestValidHash|err'

Length of output: 883


140-141: LGTM! But verify the function usage in the codebase.

The code changes are approved.

However, ensure that all function calls to LocalBuilder methods match the new parameter types.

Verification successful

Verification Successful

All function calls to LocalBuilder.RequestPayloadAsync correctly use the updated common.ExecutionHash type for the headEth1BlockHash and finalEth1BlockHash parameters.

  • mod/payload/pkg/builder/payload.go
  • mod/beacon/blockchain/types.go
  • mod/beacon/blockchain/payload.go
  • mod/beacon/blockchain/execution_engine.go
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `LocalBuilder` methods match the new parameter types.

# Test: Search for the function usage. Expect: Only occurrences of the new signature.
rg --type go -A 5 $'LocalBuilder'

Length of output: 5940


Script:

#!/bin/bash
# Description: Verify all function calls to `LocalBuilder` methods match the new parameter types.

# Search for the method signatures within the LocalBuilder interface
ast-grep --lang go --pattern $'type LocalBuilder[$_] interface {
  $_
}' -A 10

# Search for the usage of the LocalBuilder methods across the codebase
rg --type go 'LocalBuilder' -A 10

Length of output: 9562


Script:

#!/bin/bash
# Description: Verify all function calls to `LocalBuilder.RequestPayloadAsync` match the new parameter types.

# Search for calls to the RequestPayloadAsync method of LocalBuilder
rg --type go 'RequestPayloadAsync' -A 5

Length of output: 2546


Script:

#!/bin/bash
# Description: Verify all function calls to `LocalBuilder.RequestPayloadAsync` match the new parameter types by extracting full parameter lists.

# Search for calls to the RequestPayloadAsync method and include more lines to capture the full parameter lists
rg --type go 'RequestPayloadAsync' -A 10

Length of output: 4487

mod/execution/pkg/engine/metrics.go (6)

107-107: LGTM! But verify the function usage in the codebase.

The code changes are approved.

However, ensure that all function calls to markNewPayloadInvalidPayloadStatus match the new parameter types.

Verification successful

Function usage verified and consistent with the new parameter type.

  • The GetBlockHash method returns common.ExecutionHash, matching the updated parameter type in markNewPayloadInvalidPayloadStatus.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `markNewPayloadInvalidPayloadStatus` match the new parameter types.

# Test: Search for the function usage. Expect: Only occurrences of the new signature.
rg --type go -A 5 $'markNewPayloadInvalidPayloadStatus'

Length of output: 1023


Script:

#!/bin/bash
# Description: Verify the return type of `req.ExecutionPayload.GetBlockHash()`.

# Test: Search for the definition of `GetBlockHash` method. Expect: The return type should be `common.ExecutionHash`.
rg --type go 'func (.*) GetBlockHash' -A 1

Length of output: 435


148-148: LGTM! But verify the function usage in the codebase.

The code changes are approved.

However, ensure that all function calls to markNewPayloadUndefinedError match the new parameter types.

Verification successful

Function usage verified!

The function calls to markNewPayloadUndefinedError correctly use the new parameter type common.ExecutionHash.

  • mod/execution/pkg/engine/engine.go: The method req.ExecutionPayload.GetBlockHash() returns common.ExecutionHash, matching the updated function signature.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `markNewPayloadUndefinedError` match the new parameter types.

# Test: Search for the function usage. Expect: Only occurrences of the new signature.
rg --type go -A 5 $'markNewPayloadUndefinedError'

Length of output: 873


Script:

#!/bin/bash
# Description: Verify the return type of `req.ExecutionPayload.GetBlockHash()` to ensure it matches `common.ExecutionHash`.

# Test: Search for the definition of `GetBlockHash` method. Expect: The return type should be `common.ExecutionHash`.
rg --type go 'func (.*) GetBlockHash' -A 1

Length of output: 435


125-126: LGTM! But verify the function usage in the codebase.

The code changes are approved.

However, ensure that all function calls to markNewPayloadJSONRPCError match the new parameter types.

Verification successful

Function calls match the new parameter types.

The parameters passed to markNewPayloadJSONRPCError are consistent with the updated types common.ExecutionHash.

  • req.ExecutionPayload.GetBlockHash() returns common.ExecutionHash.
  • *lastValidHash is of type common.ExecutionHash.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `markNewPayloadJSONRPCError` match the new parameter types.

# Test: Search for the function usage. Expect: Only occurrences of the new signature.
rg --type go -A 5 $'markNewPayloadJSONRPCError'

Length of output: 877


Script:

#!/bin/bash
# Description: Verify the types of parameters passed to markNewPayloadJSONRPCError in engine.go

# Search for the definition of ExecutionPayload and lastValidHash to verify their types
rg --type go -A 10 'type ExecutionPayload' mod/execution/pkg/engine/engine.go
rg --type go -A 10 'lastValidHash' mod/execution/pkg/engine/engine.go

Length of output: 863


Script:

#!/bin/bash
# Description: Verify the types of ExecutionPayload and common.ExecutionHash in the codebase

# Search for the definition of ExecutionPayload
rg --type go -A 10 'type ExecutionPayload' 

# Search for the definition of common.ExecutionHash
rg --type go -A 10 'ExecutionHash' | rg 'common'

Length of output: 37062


86-87: LGTM! But verify the function usage in the codebase.

The code changes are approved.

However, ensure that all function calls to markNewPayloadAcceptedSyncingPayloadStatus match the new parameter types.

Verification successful

Function calls to markNewPayloadAcceptedSyncingPayloadStatus are consistent with the new parameter types.

The methods GetBlockHash and GetParentHash return common.ExecutionHash, which matches the updated parameter types in markNewPayloadAcceptedSyncingPayloadStatus.

  • mod/consensus-types/pkg/types/payload.go: GetBlockHash and GetParentHash return common.ExecutionHash.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `markNewPayloadAcceptedSyncingPayloadStatus` match the new parameter types.

# Test: Search for the function usage. Expect: Only occurrences of the new signature.
rg --type go -A 5 $'markNewPayloadAcceptedSyncingPayloadStatus'

Length of output: 1029


Script:

#!/bin/bash
# Description: Verify the return types of GetBlockHash and GetParentHash methods.

# Search for the GetBlockHash method definition and its return type.
rg --type go -A 5 'func (.*) GetBlockHash' 

# Search for the GetParentHash method definition and its return type.
rg --type go -A 5 'func (.*) GetParentHash' 

Length of output: 2131


66-67: LGTM! But verify the function usage in the codebase.

The code changes are approved.

However, ensure that all function calls to markNewPayloadValid match the new parameter types.


52-53: LGTM! But verify the function usage in the codebase.

The code changes are approved.

However, ensure that all function calls to markNewPayloadCalled match the new parameter types.

Verification successful

Verified: Function usage matches the new parameter types.

The return types of GetBlockHash and GetParentHash are indeed common.ExecutionHash, ensuring compatibility with the updated markNewPayloadCalled function parameters.

  • GetBlockHash return type: common.ExecutionHash
  • GetParentHash return type: common.ExecutionHash
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `markNewPayloadCalled` match the new parameter types.

# Test: Search for the function usage. Expect: Only occurrences of the new signature.
rg --type go -A 5 $'markNewPayloadCalled'

Length of output: 877


Script:

#!/bin/bash
# Description: Verify the return types of `GetBlockHash()` and `GetParentHash()` methods.

# Search for the definitions of `GetBlockHash` and `GetParentHash` to check their return types.
rg --type go 'func GetBlockHash' -A 2
rg --type go 'func GetParentHash' -A 2

Length of output: 80


Script:

#!/bin/bash
# Description: Verify the return types of `GetBlockHash()` and `GetParentHash()` methods with a broader search pattern.

# Search for the definitions of `GetBlockHash` and `GetParentHash` to check their return types.
rg --type go 'GetBlockHash' -A 5 -B 5
rg --type go 'GetParentHash' -A 5 -B 5

Length of output: 51958

mod/state-transition/pkg/core/types.go (3)

150-151: LGTM! But verify the function usage in the codebase.

The code changes are approved.

However, ensure that all function calls to GetParentHash and GetBlockHash match the new return type.

Verification successful

Verification Successful!

All function calls to GetParentHash and GetBlockHash match the new return type common.ExecutionHash.

  • mod/state-transition/pkg/core/types.go
  • mod/beacon/validator/types.go
  • mod/beacon/blockchain/types.go
  • mod/consensus-types/pkg/types/payload.go
  • mod/engine-primitives/pkg/engine-primitives/requests.go
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `GetParentHash` and `GetBlockHash` match the new return type.

# Test: Search for the function usage. Expect: Only occurrences of the new signature.
rg --type go -A 5 $'GetParentHash'
rg --type go -A 5 $'GetBlockHash'

Length of output: 29530


83-83: LGTM! But verify the function usage in the codebase.

The code changes are approved.

However, ensure that all function calls to GetBlobKzgCommitments match the new return type.


173-173: LGTM! But verify the function usage in the codebase.

The code changes are approved.

However, ensure that all function calls to GetBlockHash match the new return type.

Verification successful

Ensure all GetBlockHash function calls match the new return type common.ExecutionHash.

The search results indicate that the GetBlockHash function is defined and used in various files. The return type common.ExecutionHash is consistently applied in these instances. Here are the key locations to review:

  • Function Definitions:

    • mod/payload/pkg/builder/types.go
    • mod/state-transition/pkg/core/types.go
    • mod/execution/pkg/engine/types.go
    • mod/engine-primitives/pkg/engine-primitives/requests_test.go
    • mod/consensus-types/pkg/types/payload_header.go
    • mod/consensus-types/pkg/types/payload.go
  • Function Usages:

    • mod/payload/pkg/builder/payload.go
    • mod/state-transition/pkg/core/state_processor_genesis.go
    • mod/state-transition/pkg/core/state_processor_payload.go
    • mod/execution/pkg/engine/engine.go
    • mod/beacon/validator/block_builder.go
    • mod/beacon/blockchain/payload.go
    • mod/beacon/blockchain/execution_engine.go
    • mod/consensus-types/pkg/types/payload_test.go

All instances should be reviewed to ensure that they handle the common.ExecutionHash type correctly.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `GetBlockHash` match the new return type.

# Test: Search for the function usage. Expect: Only occurrences of the new signature.
rg --type go -A 5 $'GetBlockHash'

Length of output: 15426

mod/cli/pkg/commands/deposit/create.go (1)

278-278: LGTM! But verify the function usage in the codebase.

The code changes are approved.

However, ensure that all function calls to broadcastDepositTx handle the new return type common.ExecutionHash correctly.

Verification successful

Verified: The function broadcastDepositTx and its return type common.ExecutionHash are correctly handled in the codebase.

The txHash variable, which is assigned the result of broadcastDepositTx, is used appropriately with the Hex() method, indicating proper handling of the new return type.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `broadcastDepositTx` handle the new return type `common.ExecutionHash` correctly.

# Test: Search for the function usage. Expect: Only occurrences of the new return type.
rg --type go -A 5 $'broadcastDepositTx'

Length of output: 830


Script:

#!/bin/bash
# Description: Verify the usage of `txHash` in the `mod/cli/pkg/commands/deposit/create.go` file to ensure it handles `common.ExecutionHash` correctly.

# Test: Search for the usage of `txHash`. Expect: Correct handling of `common.ExecutionHash`.
rg --type go -A 5 $'txHash' mod/cli/pkg/commands/deposit/create.go

Length of output: 300

mod/beacon/validator/types.go (4)

162-164: LGTM! But verify the method usage in the codebase.

The code changes are approved.

However, ensure that all calls to GetBlockHash and GetParentHash handle the new type common.ExecutionHash correctly.


153-153: LGTM! But verify the method usage in the codebase.

The code changes are approved.

However, ensure that all calls to New handle the new type common.ExecutionHash correctly.

Verification successful

LGTM! But verify the method usage in the codebase.

The code changes are approved.

However, ensure that all calls to New handle the new type common.ExecutionHash correctly.

  • The search results indicate that common.ExecutionHash is widely used and integrated into multiple parts of the codebase.
  • The New method calls involving common.ExecutionHash appear to be consistent with the intended changes.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all calls to `New` handle the new type `common.ExecutionHash` correctly.

# Test: Search for the method usage. Expect: Only occurrences of the new type.
rg --type go -A 5 $'Eth1Data.New'

Length of output: 32


Script:

#!/bin/bash
# Description: Verify all calls to `New` handle the new type `common.ExecutionHash` correctly.

# Search for the method usage of `New` in the codebase
rg --type go -A 5 'New('

# Search for the usage of `common.ExecutionHash` in the codebase
rg --type go 'common.ExecutionHash'

Length of output: 13605


Script:

#!/bin/bash
# Description: Verify all calls to `New` handle the new type `common.ExecutionHash` correctly.

# Correct the regex error and search for the method usage of `New` in the codebase
rg --type go -A 5 'New\('

Length of output: 96586


90-90: LGTM! But verify the method usage in the codebase.

The code changes are approved.

However, ensure that all calls to SetBlobKzgCommitments handle the new type common.ExecutionHash correctly.

Verification successful

Verified: The method SetBlobKzgCommitments handles the new type common.ExecutionHash correctly.

  • The GetCommitments method in block_builder.go returns []eip4844.KZGCommitment, which aligns with the expected type eip4844.KZGCommitments[common.ExecutionHash].
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all calls to `SetBlobKzgCommitments` handle the new type `common.ExecutionHash` correctly.

# Test: Search for the method usage. Expect: Only occurrences of the new type.
rg --type go -A 5 $'SetBlobKzgCommitments'

Length of output: 2256


Script:

#!/bin/bash
# Description: Verify the type of the argument passed to `SetBlobKzgCommitments` in `block_builder.go`.

# Test: Search for the definition of `blobsBundle.GetCommitments()` to check the return type.
rg --type go -A 5 'func (b *BlobsBundle) GetCommitments' 

Length of output: 58


Script:

#!/bin/bash
# Description: Verify the type of the argument passed to `SetBlobKzgCommitments` in `block_builder.go`.

# Test: Search for the definition of `GetCommitments` method and the `BlobsBundle` type definition to check the return type.

# Search for the `GetCommitments` method definition
rg --type go -A 5 'GetCommitments'

# Search for the `BlobsBundle` type definition
rg --type go -A 10 'type BlobsBundle'

Length of output: 13756


207-208: LGTM! But verify the method usage in the codebase.

The code changes are approved.

However, ensure that all calls to PayloadBuilder methods handle the new type common.ExecutionHash correctly.

mod/execution/pkg/engine/engine.go (1)

115-115: LGTM! But verify the method usage in the codebase.

The code changes are approved.

However, ensure that all calls to NotifyForkchoiceUpdate handle the new return type common.ExecutionHash correctly.

Also applies to: 254-254

mod/engine-primitives/pkg/engine-primitives/requests.go (5)

Line range hint 197-219:
LGTM! But verify the block header construction in the codebase.

The change to the block header construction in the HasValidVersionedAndBlockHashes method is approved.

However, ensure that all block header constructions match the new type.

Verification successful

Verification successful! The block header construction uses the new type consistently across the codebase.

  • The change to use coretypes.NewBlockWithHeader is correctly applied and consistent.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all block header constructions match the new type.

# Test: Search for the block header construction. Expect: Only occurrences of the new type.
rg --type go -A 5 $'NewBlockWithHeader'

Length of output: 1188


Script:

#!/bin/bash
# Description: Verify all block header constructions to ensure consistency.

# Test: Search for block header constructions. Expect: Only occurrences of the new type.
rg --type go -A 5 'coretypes.NewBlockWithHeader'

Length of output: 534


69-69: LGTM! But verify the struct usage in the codebase.

The change to the VersionedHashes field in the NewPayloadRequest struct is approved.

However, ensure that all usages of the NewPayloadRequest struct match the new field type.


129-129: LGTM! But verify the method usage in the codebase.

The change to the withdrawalsHash variable in the HasValidVersionedAndBlockHashes method is approved.

However, ensure that all usages of the HasValidVersionedAndBlockHashes method match the new variable type.

Verification successful

Verify the type consistency of withdrawalsHash in the HasValidVersionedAndBlockHashes method.

The change to the withdrawalsHash variable in the HasValidVersionedAndBlockHashes method is approved. However, ensure that the test cases in requests_test.go are consistent with this change.


The change to withdrawalsHash in the HasValidVersionedAndBlockHashes method is consistent across the codebase.

The usage of common.ExecutionHash is consistent in both the method and the test cases.

  • mod/engine-primitives/pkg/engine-primitives/requests.go
  • mod/engine-primitives/pkg/engine-primitives/requests_test.go
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all usages of `HasValidVersionedAndBlockHashes` method match the new variable type.

# Test: Search for the method usage. Expect: Only occurrences of the new variable type.
rg --type go -A 5 $'HasValidVersionedAndBlockHashes'

Length of output: 3655


Script:

#!/bin/bash
# Description: Verify the type consistency of `withdrawalsHash` in the `HasValidVersionedAndBlockHashes` method.

# Test: Search for the definition and usage of `withdrawalsHash` in the `HasValidVersionedAndBlockHashes` method.
rg --type go -A 5 'withdrawalsHash' mod/engine-primitives/pkg/engine-primitives/requests.go

# Test: Search for the usage of `common.ExecutionHash` in the test file to ensure consistency.
rg --type go 'common.ExecutionHash' mod/engine-primitives/pkg/engine-primitives/requests_test.go

Length of output: 1292


42-43: LGTM! But verify the interface usage in the codebase.

The changes to the ExecutionPayloadT interface methods are approved.

However, ensure that all implementations of ExecutionPayloadT interface methods match the new return type.

Verification successful

Verify method return types for ExecutionPayloadT interface implementations

Ensure that the methods GetBlockHash and GetParentHash in the ExecutionPayloadT interface return common.ExecutionHash.


All implementations of ExecutionPayloadT interface methods match the new return type.

The methods GetBlockHash and GetParentHash consistently return common.ExecutionHash across the codebase.

  • Verified in multiple files, including:
    • mod/state-transition/pkg/core/types.go
    • mod/payload/pkg/builder/types.go
    • mod/execution/pkg/engine/types.go
    • mod/engine-primitives/pkg/engine-primitives/requests.go
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all implementations of `ExecutionPayloadT` interface methods match the new return type.

# Test: Search for the interface usage. Expect: Only occurrences of the new return type.
rg --type go -A 5 $'ExecutionPayloadT'

Length of output: 92607


Script:

#!/bin/bash
# Description: Verify the return types of GetBlockHash and GetParentHash methods in ExecutionPayloadT interface implementations.

# Search for the GetBlockHash method definitions and their return types.
rg --type go -A 3 'GetBlockHash()' 

# Search for the GetParentHash method definitions and their return types.
rg --type go -A 3 'GetParentHash()'

Length of output: 20766


107-107: LGTM! But verify the function usage in the codebase.

The change to the versionedHashes parameter in the BuildNewPayloadRequest function is approved.

However, ensure that all calls to BuildNewPayloadRequest match the new parameter type.

Verification successful

Verified: All calls to BuildNewPayloadRequest match the new parameter type.

The versionedHashes parameter in the BuildNewPayloadRequest function is correctly updated to use common.ExecutionHash, and all calls to this function have been verified to match the new parameter type.

  • mod/state-transition/pkg/core/state_processor_payload.go: body.GetBlobKzgCommitments().ToVersionedHashes() returns []common.ExecutionHash.
  • mod/engine-primitives/pkg/engine-primitives/requests_test.go: Uses []common.ExecutionHash for versionedHashes.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all calls to `BuildNewPayloadRequest` match the new parameter type.

# Test: Search for the function usage. Expect: Only occurrences of the new parameter type.
rg --type go -A 5 $'BuildNewPayloadRequest'

Length of output: 3290


Script:

#!/bin/bash
# Description: Verify the return type of `body.GetBlobKzgCommitments().ToVersionedHashes()`.

# Test: Search for the definition and return type of `ToVersionedHashes`.
rg --type go 'func ToVersionedHashes' -A 5

Length of output: 44


Script:

#!/bin/bash
# Description: Verify the return type of `body.GetBlobKzgCommitments().ToVersionedHashes()`.

# Test: Search for the definition and return type of `ToVersionedHashes` more broadly.
rg 'ToVersionedHashes' -A 5

Length of output: 1892


Script:

#!/bin/bash
# Description: Verify the type of `HashT` in `KZGCommitments`.

# Test: Search for the definition and instantiation of `KZGCommitments`.
rg 'KZGCommitments' -A 5

Length of output: 5565

mod/consensus-types/pkg/types/body.go (1)

255-255: LGTM! But verify the method usage in the codebase.

The change to the GetBlobKzgCommitments method is approved.

However, ensure that all calls to GetBlobKzgCommitments match the new return type.

Verification successful

The method usage is consistent with the new return type.

The change to the GetBlobKzgCommitments method to return eip4844.KZGCommitments[common.ExecutionHash] has been verified and is correctly applied across the codebase.

  • mod/state-transition/pkg/core/types.go
  • mod/state-transition/pkg/core/state_processor_payload.go
  • mod/da/pkg/blob/factory_test.go
  • mod/da/pkg/blob/types.go
  • mod/da/pkg/blob/factory.go
  • mod/da/pkg/store/store.go
  • mod/da/pkg/store/types.go
  • mod/consensus-types/pkg/types/body_test.go
  • mod/consensus-types/pkg/types/body.go
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all calls to `GetBlobKzgCommitments` match the new return type.

# Test: Search for the method usage. Expect: Only occurrences of the new return type.
rg --type go -A 5 $'GetBlobKzgCommitments'

Length of output: 5214

mod/beacon/validator/block_builder.go (1)

310-310: LGTM! But verify the method usage in the codebase.

The change to the buildBlockBody method is approved.

However, ensure that all usages of the buildBlockBody method match the new type.

mod/consensus-types/pkg/types/payload_test.go (7)

48-49: LGTM! Type replacement is correct.

The ParentHash and FeeRecipient fields are now using common.ExecutionHash and common.ExecutionAddress, respectively. This aligns with the refactoring objective.


60-60: LGTM! Type replacement is correct.

The BlockHash field is now using common.ExecutionHash. This aligns with the refactoring objective.


114-114: LGTM! Assertion update is correct.

The assertion now validates ParentHash using common.ExecutionHash. This aligns with the refactoring objective.


117-119: LGTM! Assertion update is correct.

The assertion now validates FeeRecipient using common.ExecutionAddress. This aligns with the refactoring objective.


142-142: LGTM! Assertion update is correct.

The assertion now validates BlockHash using common.ExecutionHash. This aligns with the refactoring objective.


190-191: LGTM! Type replacement is correct.

The ParentHash and FeeRecipient fields are now using common.ExecutionHash and common.ExecutionAddress, respectively. This aligns with the refactoring objective.


202-202: LGTM! Type replacement is correct.

The BlockHash field is now using common.ExecutionHash. This aligns with the refactoring objective.

mod/state-transition/pkg/core/state_processor.go (2)

53-53: LGTM! Type replacement is correct.

The New method in the Eth1DataT interface now uses common.ExecutionHash. This aligns with the refactoring objective.


103-103: LGTM! Type replacement is correct.

The New method in the Eth1DataT interface now uses common.ExecutionHash. This aligns with the refactoring objective.

mod/consensus-types/pkg/types/payload_header_test.go (5)

40-41: LGTM! Type replacement is correct.

The ParentHash and FeeRecipient fields are now using common.ExecutionHash and common.ExecutionAddress, respectively. This aligns with the refactoring objective.


52-52: LGTM! Type replacement is correct.

The BlockHash field is now using common.ExecutionHash. This aligns with the refactoring objective.


65-65: LGTM! Assertion update is correct.

The assertion now validates ParentHash using common.ExecutionHash. This aligns with the refactoring objective.


68-69: LGTM! Assertion update is correct.

The assertion now validates FeeRecipient using common.ExecutionAddress. This aligns with the refactoring objective.


81-81: LGTM! Assertion update is correct.

The assertion now validates BlockHash using common.ExecutionHash. This aligns with the refactoring objective.

mod/consensus-types/pkg/types/payload_header.go (6)

274-290: LGTM!

The changes to use common types in the MarshalJSON method are approved.


318-334: LGTM!

The changes to use common types in the UnmarshalJSON method are approved.


460-461: LGTM!

The change to return common.ExecutionHash in the GetParentHash method is approved.


468-470: LGTM!

The change to return common.ExecutionAddress in the GetFeeRecipient method is approved.


527-528: LGTM!

The change to return common.ExecutionHash in the GetBlockHash method is approved.


Line range hint 574-586:
LGTM!

The changes to use common types in the ToHeader method are approved.

mod/consensus-types/pkg/types/payload.go (6)

278-294: LGTM!

The changes to use common types in the MarshalJSON method are approved.


325-341: LGTM!

The changes to use common types in the UnmarshalJSON method are approved.


467-468: LGTM!

The change to return common.ExecutionHash in the GetParentHash method is approved.


474-476: LGTM!

The change to return common.ExecutionAddress in the GetFeeRecipient method is approved.


529-530: LGTM!

The change to return common.ExecutionHash in the GetBlockHash method is approved.


Line range hint 574-586:
LGTM!

The changes to use common types in the ToHeader method are approved.

Comment on lines +262 to 264
commitments eip4844.KZGCommitments[common.ExecutionHash],
) {
b.BlobKzgCommitments = commitments
Copy link
Contributor

Choose a reason for hiding this comment

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

Tip

Codebase Verification

Inconsistency in parameter type for SetBlobKzgCommitments method.

The return type of blobsBundle.GetCommitments() is []eip4844.KZGCommitment, which does not match the expected parameter type eip4844.KZGCommitments[common.ExecutionHash] for the SetBlobKzgCommitments method. Please ensure type consistency.

  • block_builder.go: body.SetBlobKzgCommitments(blobsBundle.GetCommitments()) uses []eip4844.KZGCommitment.
Analysis chain

LGTM! But verify the method usage in the codebase.

The change to the SetBlobKzgCommitments method is approved.

However, ensure that all calls to SetBlobKzgCommitments match the new parameter type.


Verify the parameter type in block_builder.go and body_test.go for SetBlobKzgCommitments.

The change to the SetBlobKzgCommitments method is approved. However, ensure that the calls to this method in block_builder.go and body_test.go use the new parameter type eip4844.KZGCommitments[common.ExecutionHash].


Verify the return type of blobsBundle.GetCommitments() in block_builder.go.

The change to the SetBlobKzgCommitments method is approved. However, ensure that the return type of blobsBundle.GetCommitments() in block_builder.go matches eip4844.KZGCommitments[common.ExecutionHash].


Verify the return type of blobsBundle.GetCommitments() in block_builder.go.

The change to the SetBlobKzgCommitments method is approved. However, ensure that the return type of blobsBundle.GetCommitments() in block_builder.go matches eip4844.KZGCommitments[common.ExecutionHash].

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all calls to `SetBlobKzgCommitments` match the new parameter type.

# Test: Search for the method usage. Expect: Only occurrences of the new parameter type.
rg --type go -A 5 $'SetBlobKzgCommitments'

Length of output: 2256


Script:

#!/bin/bash
# Description: Verify the parameter type used in `block_builder.go` and `body_test.go` for `SetBlobKzgCommitments`.

# Check the parameter type in `block_builder.go`
rg --type go -A 5 'SetBlobKzgCommitments' mod/beacon/validator/block_builder.go

# Check the parameter type in `body_test.go`
rg --type go -A 5 'SetBlobKzgCommitments' mod/consensus-types/pkg/types/body_test.go

Length of output: 645


Script:

#!/bin/bash
# Description: Verify the return type of `blobsBundle.GetCommitments()` in `block_builder.go`.

# Search for the definition of `blobsBundle.GetCommitments`
rg --type go 'func (b *BlobsBundle) GetCommitments' -A 5

Length of output: 58


Script:

#!/bin/bash
# Description: Verify the return type of `blobsBundle.GetCommitments()` in `block_builder.go`.

# Search for the definition of `GetCommitments` method in the entire codebase.
rg --type go 'GetCommitments' -A 5

Length of output: 6731

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 21

Outside diff range comments (2)
mod/config/pkg/spec/devnet.go (1)

Line range hint 7-9:
Update license year to 2024.

The license header should be updated to reflect the current year.

-// Copyright (C) 2023, Berachain Foundation. All rights reserved.
+// Copyright (C) 2024, Berachain Foundation. All rights reserved.
mod/node-api/backend/types.go (1)

[!TIP]
Codebase Verification

Instances of gethprimitives.ExecutionAddress still present:

  • testing/e2e/e2e_staking_test.go
  • mod/cli/pkg/commands/deposit/create.go
  • mod/engine-primitives/pkg/engine-primitives/requests.go
  • mod/execution/pkg/deposit/contract.go

Please update these occurrences to common.ExecutionAddress to maintain consistency across the codebase.

Analysis chain

Line range hint 149-152:
LGTM! But verify the usage of the new type in the codebase.

The change to return common.ExecutionAddress instead of gethprimitives.ExecutionAddress aligns with the PR objectives.

However, ensure that all instances of gethprimitives.ExecutionAddress have been replaced with common.ExecutionAddress throughout the codebase.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all instances of `gethprimitives.ExecutionAddress` have been replaced with `common.ExecutionAddress`.

# Test: Search for the old type usage. Expect: No occurrences of the old type.
rg --type go 'gethprimitives.ExecutionAddress'

Length of output: 687

Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE

Commits

Files that changed from the base of the PR and between 39d5802 and f5bd114.

Files selected for processing (47)
  • mod/beacon/blockchain/service.go (3 hunks)
  • mod/beacon/go.mod (2 hunks)
  • mod/cli/pkg/commands/deposit/create.go (3 hunks)
  • mod/cli/pkg/commands/genesis/deposit.go (2 hunks)
  • mod/cli/pkg/commands/genesis/payload.go (2 hunks)
  • mod/config/go.mod (2 hunks)
  • mod/config/pkg/spec/devnet.go (2 hunks)
  • mod/config/pkg/spec/testnet.go (5 hunks)
  • mod/config/pkg/viper/parser.go (2 hunks)
  • mod/consensus-types/pkg/types/genesis.go (2 hunks)
  • mod/consensus-types/pkg/types/payload.go (9 hunks)
  • mod/consensus-types/pkg/types/payload_header.go (7 hunks)
  • mod/consensus-types/pkg/types/validator_test.go (23 hunks)
  • mod/consensus-types/pkg/types/withdrawal_credentials.go (3 hunks)
  • mod/consensus-types/pkg/types/withdrawal_credentials_test.go (3 hunks)
  • mod/da/go.mod (2 hunks)
  • mod/da/pkg/store/pruner_test.go (2 hunks)
  • mod/engine-primitives/pkg/engine-primitives/attributes.go (6 hunks)
  • mod/engine-primitives/pkg/engine-primitives/attributes_test.go (3 hunks)
  • mod/engine-primitives/pkg/engine-primitives/requests.go (8 hunks)
  • mod/engine-primitives/pkg/engine-primitives/requests_test.go (6 hunks)
  • mod/engine-primitives/pkg/engine-primitives/withdrawal.go (4 hunks)
  • mod/engine-primitives/pkg/engine-primitives/withdrawal_test.go (3 hunks)
  • mod/engine-primitives/pkg/engine-primitives/withdrawals_test.go (3 hunks)
  • mod/execution/pkg/client/engine.go (3 hunks)
  • mod/execution/pkg/client/types.go (1 hunks)
  • mod/execution/pkg/deposit/contract.go (2 hunks)
  • mod/execution/pkg/engine/types.go (3 hunks)
  • mod/node-api/backend/types.go (3 hunks)
  • mod/node-api/go.mod (2 hunks)
  • mod/node-api/handlers/proof/types/response.go (2 hunks)
  • mod/node-api/handlers/proof/types/types.go (2 hunks)
  • mod/node-core/go.mod (2 hunks)
  • mod/node-core/pkg/components/storage/types.go (3 hunks)
  • mod/payload/go.mod (2 hunks)
  • mod/payload/pkg/attributes/factory.go (3 hunks)
  • mod/payload/pkg/attributes/types.go (2 hunks)
  • mod/payload/pkg/builder/config.go (3 hunks)
  • mod/payload/pkg/builder/types.go (4 hunks)
  • mod/primitives/go.mod (4 hunks)
  • mod/primitives/pkg/common/execution.go (1 hunks)
  • mod/state-transition/go.mod (2 hunks)
  • mod/state-transition/pkg/core/state/statedb.go (2 hunks)
  • mod/state-transition/pkg/core/state/types.go (3 hunks)
  • mod/state-transition/pkg/core/state_processor_genesis.go (2 hunks)
  • mod/state-transition/pkg/core/types.go (5 hunks)
  • testing/e2e/e2e_staking_test.go (4 hunks)
Additional comments not posted (112)
mod/config/pkg/spec/devnet.go (2)

Line range hint 11-14:
Remove unnecessary import.

The import statement for gethprimitives has been removed, which is correct since common.ExecutionAddress is now used.


33-33: Update the function signature.

The function signature has been updated to use common.ExecutionAddress instead of gethprimitives.ExecutionAddress. This change is consistent with the goal of consolidating types under the common package.

However, ensure that all function calls to DevnetChainSpec match the updated signature.

Verification successful

All function calls to DevnetChainSpec match the updated signature.

  • The function DevnetChainSpec is correctly defined to use common.ExecutionAddress.
  • The only call to DevnetChainSpec in mod/node-core/pkg/components/chain_spec.go matches the updated signature.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `DevnetChainSpec` match the updated signature.

# Test: Search for the function usage. Expect: Only occurrences of the new signature.
rg --type go -A 5 $'DevnetChainSpec'

Length of output: 1241


Script:

#!/bin/bash
# Description: Verify the full definition of `DevnetChainSpec` and all its calls to ensure they match the updated signature.

# Extract the full definition of `DevnetChainSpec`
echo "Definition of DevnetChainSpec:"
rg --type go -A 10 -B 2 'func DevnetChainSpec' 

# Extract all calls to `DevnetChainSpec`
echo "Calls to DevnetChainSpec:"
rg --type go 'DevnetChainSpec()'

Length of output: 1282

mod/execution/pkg/client/types.go (1)

Line range hint 7-9:
Remove unnecessary import.

The import statement for gethprimitives has been removed, which is correct since common.ExecutionAddress is now used.

mod/payload/pkg/attributes/types.go (2)

Line range hint 7-9:
Remove unnecessary import.

The import statement for gethprimitives has been removed, which is correct since common.ExecutionAddress is now used.


44-44: Update the interface method signature.

The method signature for New has been updated to use common.ExecutionAddress instead of gethprimitives.ExecutionAddress. This change is consistent with the goal of consolidating types under the common package.

However, ensure that all implementations of the PayloadAttributes interface are updated to match the new method signature.

mod/payload/pkg/builder/config.go (2)

26-26: Import looks good.

The new import statement for common is correct and necessary for the changes made.


43-43: Changes to Config structure and DefaultConfig function look good.

The type change from gethprimitives.ExecutionAddress to common.ExecutionAddress is consistent and aligns with the overall refactor.

Also applies to: 55-55

mod/config/pkg/viper/parser.go (2)

27-27: Import looks good.

The new import statement for common is correct and necessary for the changes made.


36-37: Changes to StringToExecutionAddressFunc function look good.

The changes to use common.ExecutionAddress and common.NewExecutionAddressFromHex are consistent with the overall refactor and maintain the functionality.

mod/execution/pkg/engine/types.go (2)

35-36: Changes to ExecutionPayload interface look good.

The changes to use common.ExecutionHash and common.ExecutionAddress are consistent with the overall refactor and maintain the functionality.

Also applies to: 43-43


69-69: Changes to Withdrawal interface look good.

The change to use common.ExecutionAddress is consistent with the overall refactor and maintains the functionality.

mod/node-api/handlers/proof/types/types.go (2)

24-24: Consolidate imports for maintainability.

The import of gethprimitives has been replaced with common, which likely improves maintainability and reduces dependencies.


66-66: Align return type with consolidated import.

The return type of GetFeeRecipient has been updated to common.ExecutionAddress, aligning with the new import.

Ensure that all implementations of this interface are updated to match the new return type.

Verification successful

Align return type with consolidated import.

The return type of GetFeeRecipient has been updated to common.ExecutionAddress, aligning with the new import.

Ensure that all implementations of this interface are updated to match the new return type.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all implementations of the `ExecutionPayloadHeader` interface are updated to match the new return type.

# Test: Search for the `ExecutionPayloadHeader` interface implementation. Expect: Only occurrences of the new return type.
rg --type go -A 5 $'ExecutionPayloadHeader'

Length of output: 267328

mod/consensus-types/pkg/types/withdrawal_credentials.go (2)

Line range hint 17-17:
Consolidate imports for maintainability.

The import of gethprimitives has been replaced with common, which likely improves maintainability and reduces dependencies.


42-42: Align parameter type with consolidated import.

The parameter type of address in NewCredentialsFromExecutionAddress has been updated to common.ExecutionAddress, aligning with the new import.

mod/execution/pkg/deposit/contract.go (2)

31-31: Consolidate imports for maintainability.

The import of common has been added, which likely improves maintainability and reduces dependencies.


49-56: Align parameter type with consolidated import and ensure compatibility.

The parameter type of address in NewWrappedBeaconDepositContract has been updated to common.ExecutionAddress, aligning with the new import. The explicit conversion back to gethprimitives.ExecutionAddress ensures compatibility with the existing contract initialization.

Ensure that all usages of this function are updated to match the new parameter type.

Verification successful

Verification successful.

The parameter type of address in NewWrappedBeaconDepositContract has been updated to common.ExecutionAddress, which is compatible with ExecutionAddressT as both are defined as [20]byte. The usage of this function has been correctly updated to match the new parameter type.

  • mod/execution/pkg/deposit/contract.go (function definition)
  • mod/node-core/pkg/components/deposit_contract.go (function usage)
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all usages of the `NewWrappedBeaconDepositContract` function are updated to match the new parameter type.

# Test: Search for the `NewWrappedBeaconDepositContract` function usage. Expect: Only occurrences of the new parameter type.
rg --type go -A 5 $'NewWrappedBeaconDepositContract'

Length of output: 1029


Script:

#!/bin/bash
# Description: Verify the return type of `DepositContractAddress` function to ensure it matches `common.ExecutionAddress`.

# Find the definition of `DepositContractAddress` function in the repository.
rg --type go 'DepositContractAddress' -A 5

Length of output: 3934


Script:

#!/bin/bash
# Description: Verify that `ExecutionAddressT` is equivalent to `common.ExecutionAddress`.

# Find the definition of `ExecutionAddressT` in the `mod/chain-spec/pkg/chain` package.
rg --type go 'ExecutionAddressT' mod/chain-spec/pkg/chain

Length of output: 5193


Script:

#!/bin/bash
# Description: Verify that `common.ExecutionAddress` is compatible with `[20]byte`.

# Find the definition of `common.ExecutionAddress` in the repository.
rg --type go 'type ExecutionAddress' mod

Length of output: 112

mod/engine-primitives/pkg/engine-primitives/attributes_test.go (2)

38-38: LGTM! Transition to common.ExecutionAddress is correct.

The change from gethprimitives.ExecutionAddress to common.ExecutionAddress aligns with the PR objectives and improves consistency.


68-68: LGTM! Transition to common.ExecutionAddress is correct.

The change from gethprimitives.ExecutionAddress to common.ExecutionAddress aligns with the PR objectives and improves consistency.

mod/engine-primitives/pkg/engine-primitives/withdrawal_test.go (4)

36-36: LGTM! Transition to common.ExecutionAddress is correct.

The change from gethprimitives.ExecutionAddress to common.ExecutionAddress aligns with the PR objectives and improves consistency.


53-53: LGTM! Transition to common.ExecutionAddress is correct.

The change from gethprimitives.ExecutionAddress to common.ExecutionAddress aligns with the PR objectives and improves consistency.

Also applies to: 60-60


67-67: LGTM! Transition to common.ExecutionAddress is correct.

The change from gethprimitives.ExecutionAddress to common.ExecutionAddress aligns with the PR objectives and improves consistency.


89-89: LGTM! Transition to common.ExecutionAddress is correct.

The change from gethprimitives.ExecutionAddress to common.ExecutionAddress aligns with the PR objectives and improves consistency.

mod/state-transition/pkg/core/state/types.go (2)

81-81: LGTM! Transition to common.ExecutionAddress is correct.

The change from gethprimitives.ExecutionAddress to common.ExecutionAddress aligns with the PR objectives and improves consistency.


90-90: LGTM! Transition to common.ExecutionAddress is correct.

The change from gethprimitives.ExecutionAddress to common.ExecutionAddress aligns with the PR objectives and improves consistency.

mod/payload/pkg/attributes/factory.go (2)

41-41: LGTM! Standardized execution address type.

The change from gethprimitives.ExecutionAddress to common.ExecutionAddress improves consistency across the codebase.


52-52: LGTM! Updated function signature.

The change from gethprimitives.ExecutionAddress to common.ExecutionAddress in the function signature maintains consistency with the updated struct definition.

mod/engine-primitives/pkg/engine-primitives/withdrawals_test.go (3)

58-58: LGTM! Standardized execution address type in tests.

The change from gethprimitives.ExecutionAddress to common.ExecutionAddress in the test cases ensures consistency with the updated type definitions.


64-64: LGTM! Standardized execution address type in tests.

The change from gethprimitives.ExecutionAddress to common.ExecutionAddress in the test cases ensures consistency with the updated type definitions.


97-97: LGTM! Standardized execution address type in tests.

The change from gethprimitives.ExecutionAddress to common.ExecutionAddress in the test cases ensures consistency with the updated type definitions.

mod/node-api/handlers/proof/types/response.go (1)

80-80: LGTM! Standardized execution address type.

The change from gethprimitives.ExecutionAddress to common.ExecutionAddress improves consistency across the codebase.

mod/da/pkg/store/pruner_test.go (1)

29-29: LGTM! But verify the function usage in the codebase.

The code changes are approved.

However, ensure that all function calls to common.ExecutionAddress match the new import.

Verification successful

Verified: The import path for common.ExecutionAddress is consistent across the codebase.

The changes to the import statement are correctly reflected in all relevant files.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `common.ExecutionAddress` match the new import.

# Test: Search for the function usage. Expect: Only occurrences of the new import.
rg --type go -A 5 $'common.ExecutionAddress'

Length of output: 48328

mod/payload/pkg/builder/types.go (3)

59-63: LGTM!

The code changes are approved.


69-71: LGTM!

The code changes are approved.


105-105: LGTM!

The code changes are approved.

mod/config/pkg/spec/testnet.go (2)

35-35: LGTM!

The code changes are approved.


Line range hint 48-97:
LGTM!

The code changes are approved.

mod/state-transition/go.mod (1)

21-21: Dependency Management Update: geth-primitives moved to indirect dependencies.

The github.com/berachain/beacon-kit/mod/geth-primitives dependency has been moved from the main require section to the indirect dependencies section. This indicates it is no longer directly used in this module but is still required by other dependencies.

mod/beacon/go.mod (1)

22-22: Dependency Management Update: geth-primitives moved to indirect dependencies.

The github.com/berachain/beacon-kit/mod/geth-primitives dependency has been moved from the main require section to the indirect dependencies section. This indicates it is no longer directly used in this module but is still required by other dependencies.

mod/primitives/go.mod (2)

17-17: New Direct Dependency: golang.org/x/crypto added.

The golang.org/x/crypto package has been added as a direct dependency. This may imply new cryptographic requirements within the module.


44-44: Dependency Management Update: go-ethereum moved to indirect dependencies.

The github.com/ethereum/go-ethereum dependency has been moved from the main require section to the indirect dependencies section. This indicates it is no longer directly used in this module but is still required by other dependencies.

mod/payload/go.mod (1)

19-19: Verify the necessity of re-adding geth-primitives as an indirect dependency.

The re-addition of github.com/berachain/beacon-kit/mod/geth-primitives as an indirect dependency should be verified to ensure it is required and does not introduce any inconsistencies.

Verification successful

The re-addition of geth-primitives as an indirect dependency is necessary.

The geth-primitives dependency is used in multiple files across various modules, confirming its necessity and ensuring that its re-addition does not introduce any inconsistencies.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the necessity of `geth-primitives` as an indirect dependency.

# Test: Search for the usage of `geth-primitives`. Expect: Occurrences in indirectly required dependencies.
rg --type go -l 'geth-primitives'

Length of output: 665

mod/state-transition/pkg/core/state_processor_genesis.go (1)

75-75: Verify the impact of changing the argument type to common.Root{}.

The modification of the argument type in the SetEth1Data function from common.Bytes32 to common.Root{} enhances type safety. Verify that this change aligns with the project's data representation strategy and does not introduce any issues.

Verification successful

Verify the definition and usage of common.Root.

The modification to common.Root{} needs to be verified for consistency and correctness across the codebase. Ensure that common.Root is correctly defined and compatible with the SetEth1Data function.


The change to common.Root{} is consistent with the codebase's usage patterns.

The type common.Root is extensively used across the codebase in various contexts, including function parameters, return types, and struct fields. The modification to common.Root{} in the SetEth1Data function aligns with these usage patterns and enhances type safety. No issues were found with this change.

  • mod/state-transition/pkg/core/state_processor_genesis.go uses common.Root{} consistently.
  • common.Root is widely integrated and utilized across multiple files and contexts.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the impact of changing the argument type to `common.Root{}`.

# Test: Search for the usage of `SetEth1Data` with the new argument type. Expect: Occurrences with `common.Root{}`.
rg --type go 'SetEth1Data' -A 5

Length of output: 4770


Script:

#!/bin/bash
# Description: Verify the definition and usage of `common.Root`.

# Test: Search for the definition of `common.Root`.
rg --type go 'type Root' -A 5

# Test: Search for the usage of `common.Root`.
rg --type go 'common.Root' -A 5

Length of output: 120462

mod/node-api/go.mod (1)

22-22: Verify the necessity of re-adding geth-primitives as an indirect dependency.

The re-addition of github.com/berachain/beacon-kit/mod/geth-primitives as an indirect dependency should be verified to ensure it is required and does not introduce any inconsistencies.

Verification successful

The necessity of re-adding geth-primitives as an indirect dependency is verified.

The search results show that geth-primitives is used in multiple files across different modules, indicating that it is required by various parts of the codebase. This supports the necessity of having it as an indirect dependency.

  • testing/e2e/e2e_staking_test.go
  • mod/primitives/pkg/net/jwt/jwt.go
  • mod/primitives/pkg/net/jwt/jwt_test.go
  • mod/execution/pkg/deposit/contract.go
  • mod/execution/pkg/client/eth.go
  • mod/execution/pkg/client/engine.go
  • mod/execution/pkg/client/errors.go
  • mod/execution/pkg/client/client.go
  • mod/execution/pkg/client/ethclient/client.go
  • mod/execution/pkg/client/cache/cache.go
  • mod/execution/pkg/client/cache/cache_test.go
  • mod/consensus-types/pkg/types/genesis.go
  • mod/consensus-types/pkg/types/genesis_test.go
  • mod/cli/pkg/commands/deposit/create.go
  • mod/cli/pkg/commands/genesis/payload.go
  • mod/engine-primitives/pkg/engine-primitives/requests.go
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the necessity of `geth-primitives` as an indirect dependency.

# Test: Search for the usage of `geth-primitives`. Expect: Occurrences in indirectly required dependencies.
rg --type go -l 'geth-primitives'

Length of output: 665

mod/engine-primitives/pkg/engine-primitives/attributes.go (3)

73-73: LGTM! Verify consistency across the codebase.

The parameter type change to common.ExecutionAddress aligns with the transition to the common package.

Ensure that all calls to NewPayloadAttributes are updated accordingly.


55-55: LGTM! Verify consistency across the codebase.

The field type change to common.ExecutionAddress aligns with the transition to the common package.

Ensure that all usages of PayloadAttributes are updated accordingly.

Verification successful

Verify consistency of SuggestedFeeRecipient field type in PayloadAttributes.

Ensure that all instances of the SuggestedFeeRecipient field within PayloadAttributes use common.ExecutionAddress.


Verification successful.

The SuggestedFeeRecipient field type has been consistently updated to common.ExecutionAddress across the codebase.

  • mod/execution/pkg/client/types.go
  • mod/payload/pkg/attributes/types.go
  • mod/engine-primitives/pkg/engine-primitives/attributes.go
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all usages of PayloadAttributes are updated.

# Test: Search for usages of PayloadAttributes. Expect: Only occurrences of the new field type.
rg --type go -A 5 'PayloadAttributes'

Length of output: 41113


Script:

#!/bin/bash
# Description: Verify that all instances of SuggestedFeeRecipient in PayloadAttributes use common.ExecutionAddress.

# Search for all struct definitions and usages of PayloadAttributes with context lines to verify the field type.
rg --type go -A 10 'type PayloadAttributes' | grep -A 10 'SuggestedFeeRecipient'

Length of output: 1064


98-98: LGTM! Verify consistency across the codebase.

The parameter type change to common.ExecutionAddress aligns with the transition to the common package.

Ensure that all calls to PayloadAttributes.New are updated accordingly.

Verification successful

Let's broaden our search to verify the consistency of the PayloadAttributes changes.


Verified: The parameter type change to common.ExecutionAddress for suggestedFeeRecipient in PayloadAttributes.New is consistently applied across the codebase.

  • The search results show multiple instances where PayloadAttributes and its methods, including New, are used with the updated parameter type.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all calls to PayloadAttributes.New are updated.

# Test: Search for calls to PayloadAttributes.New. Expect: Only occurrences of the new parameter type.
rg --type go -A 5 'PayloadAttributes.New'

Length of output: 41


Script:

#!/bin/bash
# Description: Verify all instances and usage of PayloadAttributes to ensure consistency.

# Test: Search for instances and usage of PayloadAttributes. Expect: Consistent use of the new parameter type.
rg --type go -A 5 'PayloadAttributes'

Length of output: 41113

mod/consensus-types/pkg/types/genesis.go (1)

154-154: LGTM! Verify consistency across the codebase.

The field initialization change to common.NewExecutionHashFromHex aligns with the transition to the common package.

Ensure that all usages of BlockHash are updated accordingly.

mod/primitives/pkg/common/execution.go (15)

32-35: Ensure interface implementations are correct.

The ExecutionHash type correctly implements the encoding.TextMarshaler, encoding.TextUnmarshaler, json.Marshaler, and json.Unmarshaler interfaces.


57-59: LGTM!

The Hex method correctly converts the ExecutionHash to a hex string.


60-64: LGTM!

The String method correctly implements the Stringer interface by returning the hex representation.


66-69: LGTM!

The MarshalText method correctly returns the hex representation of the ExecutionHash.


71-74: LGTM!

The UnmarshalText method correctly parses a hex string into the ExecutionHash.


76-79: LGTM!

The MarshalJSON method correctly returns the JSON representation of the ExecutionHash.


81-84: LGTM!

The UnmarshalJSON method correctly parses a JSON string into the ExecutionHash.


37-40: Ensure interface implementations are correct.

The ExecutionAddress type correctly implements the encoding.TextMarshaler, encoding.TextUnmarshaler, json.Marshaler, and json.Unmarshaler interfaces.


100-102: LGTM!

The Hex method correctly converts the ExecutionAddress to a hex string.


103-107: LGTM!

The String method correctly implements the Stringer interface by returning the hex representation.


109-112: LGTM!

The MarshalText method correctly returns the hex representation of the ExecutionAddress.


114-118: LGTM!

The UnmarshalText method correctly parses a hex string into the ExecutionAddress.


120-123: LGTM!

The MarshalJSON method correctly returns the JSON representation of the ExecutionAddress.


125-128: LGTM!

The UnmarshalJSON method correctly parses a JSON string into the ExecutionAddress.


130-151: LGTM!

The checksumHex method correctly returns the checksummed hex representation of the ExecutionAddress.

mod/engine-primitives/pkg/engine-primitives/withdrawal.go (3)

47-47: LGTM! Verify compatibility of common.ExecutionAddress.

The change from gethprimitives.ExecutionAddress to common.ExecutionAddress is approved.

Ensure that common.ExecutionAddress is compatible with the rest of the codebase.

Verification successful

LGTM! Verify compatibility of common.ExecutionAddress.

The change from gethprimitives.ExecutionAddress to common.ExecutionAddress is approved. The search results indicate that common.ExecutionAddress is widely used across the codebase, suggesting compatibility.

  • Verify the definition of common.ExecutionAddress in mod/primitives/pkg/common/execution.go.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the compatibility of `common.ExecutionAddress`.

# Test: Search for the definition and usage of `common.ExecutionAddress`. Expect: Verify its compatibility.
rg --type go --word-regexp 'ExecutionAddress' | rg 'common'

Length of output: 11942


166-166: LGTM! Verify compatibility of common.ExecutionAddress.

The change from gethprimitives.ExecutionAddress to common.ExecutionAddress is approved.

Ensure that common.ExecutionAddress is compatible with the rest of the codebase.

Verification successful

The change from gethprimitives.ExecutionAddress to common.ExecutionAddress is verified as compatible.

The common.ExecutionAddress type is widely used across the codebase, indicating its well-established integration. The change aligns with the transition from gethprimitives to common.

  • common.ExecutionAddress is defined and used extensively in various modules, ensuring its compatibility.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the compatibility of `common.ExecutionAddress`.

# Test: Search for the definition and usage of `common.ExecutionAddress`. Expect: Verify its compatibility.
rg --type go --word-regexp 'ExecutionAddress' | rg 'common'

Length of output: 11942


59-59: LGTM! Verify compatibility of common.ExecutionAddress.

The change from gethprimitives.ExecutionAddress to common.ExecutionAddress is approved.

Ensure that common.ExecutionAddress is compatible with the rest of the codebase.

Verification successful

Verify the definition and compatibility of common.ExecutionAddress.

The change from gethprimitives.ExecutionAddress to common.ExecutionAddress appears to be well-integrated across the codebase. To ensure full compatibility, verify the definition and implementation of common.ExecutionAddress.


Verified: common.ExecutionAddress is compatible with the rest of the codebase.

The change from gethprimitives.ExecutionAddress to common.ExecutionAddress is compatible. The definition and utility functions of common.ExecutionAddress align with the expected structure and usage of Ethereum addresses.

  • Definition found in mod/primitives/pkg/common/execution.go as a 20-byte array.
  • Utility functions like NewExecutionAddressFromHex and Hex support its usage.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the compatibility of `common.ExecutionAddress`.

# Test: Search for the definition and usage of `common.ExecutionAddress`. Expect: Verify its compatibility.
rg --type go --word-regexp 'ExecutionAddress' | rg 'common'

Length of output: 11942


Script:

#!/bin/bash
# Description: Verify the definition and compatibility of `common.ExecutionAddress`.

# Locate the definition of `common.ExecutionAddress`.
rg --type go 'type ExecutionAddress' -A 10

Length of output: 892

mod/engine-primitives/pkg/engine-primitives/requests_test.go (5)

77-78: LGTM! Verify compatibility of common.ExecutionAddress.

The change from gethprimitives.ExecutionAddress to common.ExecutionAddress is approved.

Ensure that common.ExecutionAddress is compatible with the rest of the codebase.

Verification successful

Verified: Compatibility of common.ExecutionAddress

The change from gethprimitives.ExecutionAddress to common.ExecutionAddress is verified and compatible with the rest of the codebase.

  • The common.ExecutionAddress type is extensively used across multiple modules.
  • It includes necessary methods for serialization and deserialization, ensuring its compatibility.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the compatibility of `common.ExecutionAddress`.

# Test: Search for the definition and usage of `common.ExecutionAddress`. Expect: Verify its compatibility.
rg --type go --word-regexp 'ExecutionAddress' | rg 'common'

Length of output: 11942


117-117: LGTM! Verify compatibility of common.ExecutionHash.

The change from []gethprimitives.ExecutionHash to []common.ExecutionHash is approved.

Ensure that common.ExecutionHash is compatible with the rest of the codebase.

Verification successful

Verified Compatibility of common.ExecutionHash

The change from []gethprimitives.ExecutionHash to []common.ExecutionHash is compatible with the rest of the codebase. The common.ExecutionHash type is widely used and well-integrated across various modules.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the compatibility of `common.ExecutionHash`.

# Test: Search for the definition and usage of `common.ExecutionHash`. Expect: Verify its compatibility.
rg --type go --word-regexp 'ExecutionHash' | rg 'common'

Length of output: 14644


108-109: LGTM! Verify compatibility of common.ExecutionAddress.

The change from gethprimitives.ExecutionAddress to common.ExecutionAddress is approved.

Ensure that common.ExecutionAddress is compatible with the rest of the codebase.

Verification successful

Verify the compatibility of common.ExecutionAddress.

The change from gethprimitives.ExecutionAddress to common.ExecutionAddress appears to be well-integrated across the codebase. The search results show consistent usage in method signatures and JSON mappings, indicating that common.ExecutionAddress is correctly defined and used.

  • Definition and Methods:

    • mod/primitives/pkg/common/execution.go: Defines ExecutionAddress and related methods.
  • Key Usages:

    • mod/state-transition/pkg/core/types.go: Method signatures using common.ExecutionAddress.
    • mod/node-api/backend/types.go: Method signatures using common.ExecutionAddress.
    • mod/payload/pkg/builder/config.go: JSON mappings for common.ExecutionAddress.

No issues found. The change is compatible with the rest of the codebase.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the compatibility of `common.ExecutionAddress`.

# Test: Search for the definition and usage of `common.ExecutionAddress`. Expect: Verify its compatibility.
rg --type go --word-regexp 'ExecutionAddress' | rg 'common'

Length of output: 11942


53-54: LGTM! Verify compatibility of common.ExecutionHash.

The change from gethprimitives.ExecutionHash to common.ExecutionHash is approved.

Ensure that common.ExecutionHash is compatible with the rest of the codebase.

Verification successful

Verified! The common.ExecutionHash is widely used and well-integrated across the codebase, confirming its compatibility.

  • The type common.ExecutionHash is defined in mod/primitives/pkg/common/execution.go.
  • It is used extensively in various modules, indicating its integration and compatibility.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the compatibility of `common.ExecutionHash`.

# Test: Search for the definition and usage of `common.ExecutionHash`. Expect: Verify its compatibility.
rg --type go --word-regexp 'ExecutionHash' | rg 'common'

Length of output: 14644


50-51: LGTM! Verify compatibility of common.ExecutionHash.

The change from gethprimitives.ExecutionHash to common.ExecutionHash is approved.

Ensure that common.ExecutionHash is compatible with the rest of the codebase.

Verification successful

The search results indicate that common.ExecutionHash is widely used across multiple files in the codebase. To ensure compatibility, we need to verify the definition and methods associated with common.ExecutionHash.


To ensure full compatibility, we need to verify all methods associated with common.ExecutionHash.


To ensure we capture all methods related to common.ExecutionHash, let's perform a broader search.


LGTM! Compatibility of common.ExecutionHash Verified.

The change from gethprimitives.ExecutionHash to common.ExecutionHash is approved. The common.ExecutionHash type is well-defined and includes essential methods for conversion, marshaling, and unmarshaling operations.

  • Definition: type ExecutionHash [32]byte
  • Methods: Hex, String, MarshalText, UnmarshalText, MarshalJSON, UnmarshalJSON
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the compatibility of `common.ExecutionHash`.

# Test: Search for the definition and usage of `common.ExecutionHash`. Expect: Verify its compatibility.
rg --type go --word-regexp 'ExecutionHash' | rg 'common'

Length of output: 14644


Script:

#!/bin/bash
# Description: Verify the definition and methods of `common.ExecutionHash`.

# Search for the definition of `common.ExecutionHash`.
rg --type go --word-regexp 'type ExecutionHash' -A 10

# Search for methods associated with `common.ExecutionHash`.
rg --type go --word-regexp 'func (h ExecutionHash)' -A 5

Length of output: 943


Script:

#!/bin/bash
# Description: Verify all methods associated with `common.ExecutionHash`.

# Search for all methods associated with `common.ExecutionHash`.
rg --type go --word-regexp 'func (h ExecutionHash)' -A 10

Length of output: 59


Script:

#!/bin/bash
# Description: Verify all methods associated with `common.ExecutionHash`.

# Search for all methods related to `common.ExecutionHash`.
rg --type go --pcre2 'func \(([^)]+) ExecutionHash\)' -A 10

Length of output: 2232

mod/cli/pkg/commands/genesis/payload.go (2)

179-179: LGTM! Verify compatibility of common.ExecutionHash.

The change to use common.ExecutionHash for BlockHash is approved.

Ensure that common.ExecutionHash is compatible with the rest of the codebase.

Verification successful

Verified: common.ExecutionHash is compatible with the rest of the codebase.

The usage of common.ExecutionHash is extensive and consistent across multiple modules, confirming its compatibility and integration within the codebase.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the compatibility of `common.ExecutionHash`.

# Test: Search for the definition and usage of `common.ExecutionHash`. Expect: Verify its compatibility.
rg --type go --word-regexp 'ExecutionHash' | rg 'common'

Length of output: 14644


167-167: LGTM! Verify compatibility of common.ExecutionHash.

The change to use common.ExecutionHash for ParentHash is approved.

Ensure that common.ExecutionHash is compatible with the rest of the codebase.

Verification successful

Verified: The transition to common.ExecutionHash is compatible.

The common.ExecutionHash is well-integrated and used extensively across the codebase, ensuring its compatibility with the rest of the system.

  • The type is defined as a 32-byte array and supports necessary marshaling/unmarshaling methods.
  • It is used consistently in various packages and contexts, confirming its reliability.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the compatibility of `common.ExecutionHash`.

# Test: Search for the definition and usage of `common.ExecutionHash`. Expect: Verify its compatibility.
rg --type go --word-regexp 'ExecutionHash' | rg 'common'

Length of output: 14644

mod/execution/pkg/client/engine.go (2)

46-48: LGTM! But verify the function usage in the codebase.

The code changes are approved.

However, ensure that all function calls to NewPayload match the new signature.


94-94: LGTM! But verify the function usage in the codebase.

The code changes are approved.

However, ensure that all function calls to ForkchoiceUpdated match the new signature.

testing/e2e/e2e_staking_test.go (1)

195-195: LGTM! But verify the function usage in the codebase.

The code changes are approved.

However, ensure that all function calls to generateNewDepositTx match the new signature.

Verification successful

Ensure sender.Address() returns gethprimitives.ExecutionAddress.

The function call to generateNewDepositTx in testing/e2e/e2e_staking_test.go passes sender.Address(). Verify that sender.Address() returns a gethprimitives.ExecutionAddress.


Broaden the search for the Address method to verify its return type.

We need to locate the Address method definition to confirm it returns gethprimitives.ExecutionAddress.


Verify the compatibility between common.Address and gethprimitives.ExecutionAddress.

We need to ensure that common.Address is compatible with or can be converted to gethprimitives.ExecutionAddress.


Broaden the search for the definition of common.Address to verify its compatibility with gethprimitives.ExecutionAddress.

We need to locate the definition of common.Address to confirm its compatibility with gethprimitives.ExecutionAddress.


Verification successful: sender.Address() is compatible with gethprimitives.ExecutionAddress.

The type gethprimitives.ExecutionAddress is an alias for common.Address, ensuring compatibility with the updated function signature in generateNewDepositTx.

  • sender.Address() returns common.Address, which is compatible with gethprimitives.ExecutionAddress.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `generateNewDepositTx` match the new signature.

# Test: Search for the function usage. Expect: Only occurrences of the new signature.
rg --type go -A 5 $'generateNewDepositTx'

Length of output: 768


Script:

#!/bin/bash
# Description: Verify the return type of sender.Address().

# Search for the definition of Address method in the codebase.
rg --type go 'func (s \*Sender) Address' -A 5

Length of output: 47


Script:

#!/bin/bash
# Description: Broaden the search for the definition of Address method.

# Search for any method named Address in the codebase.
rg --type go 'Address' -A 5

Length of output: 157472


Script:

#!/bin/bash
# Description: Verify the definition of common.Address and its compatibility with gethprimitives.ExecutionAddress.

# Search for the definition of common.Address.
rg --type go 'type Address' -A 5

Length of output: 34


Script:

#!/bin/bash
# Description: Broaden the search for the definition of common.Address.

# Search for any type definition named Address in the codebase.
rg --type go 'Address' -A 5

Length of output: 157472

mod/config/go.mod (1)

21-21: LGTM!

The code changes are approved.

mod/consensus-types/pkg/types/withdrawal_credentials_test.go (4)

27-27: Import statement change approved.

The import statement has been updated to use common instead of gethprimitives, which aligns with the new architecture.


32-32: Type change approved in TestNewCredentialsFromExecutionAddress.

The type of address has been updated to common.ExecutionAddress, which aligns with the new import structure.


54-54: Type change approved in TestNewCredentialsFromExecutionAddress.

The type of expectedAddress has been updated to common.ExecutionAddress, ensuring consistency with the updated import.


68-68: Type change approved in TestToExecutionAddress.

The type of expectedAddress has been updated to common.ExecutionAddress, which aligns with the new import structure.

mod/state-transition/pkg/core/types.go (6)

82-82: Type change approved in GetBlobKzgCommitments.

The type of ExecutionHash has been updated to common.ExecutionHash, which aligns with the new import structure.


149-149: Type change approved in GetParentHash.

The type of ExecutionHash has been updated to common.ExecutionHash, which aligns with the new import structure.


150-150: Type change approved in GetBlockHash.

The type of ExecutionHash has been updated to common.ExecutionHash, ensuring consistency with the updated import.


153-153: Type change approved in GetFeeRecipient.

The type of ExecutionAddress has been updated to common.ExecutionAddress, which aligns with the new import structure.


172-172: Type change approved in GetBlockHash.

The type of ExecutionHash has been updated to common.ExecutionHash, which aligns with the new import structure.


245-245: Type change approved in GetAddress.

The type of ExecutionAddress has been updated to common.ExecutionAddress, which aligns with the new import structure.

mod/beacon/blockchain/service.go (2)

51-51: Type change approved in GetSuggestedFeeRecipient.

The type of ExecutionAddress has been updated to common.ExecutionAddress, which aligns with the new import structure.


114-114: Type change approved in NewService constructor.

The type of ExecutionAddress has been updated to common.ExecutionAddress, which aligns with the new import structure.

mod/cli/pkg/commands/deposit/create.go (1)

278-278: LGTM! But verify the function usage in the codebase.

The code changes are approved.

However, ensure that all function calls to broadcastDepositTx handle the new return type common.ExecutionHash.

Verification successful

Verify the handling of the new return type common.ExecutionHash for broadcastDepositTx.

The initial search shows where broadcastDepositTx is called and its return value assigned to txHash. To ensure the new return type common.ExecutionHash is handled correctly, we need to trace the usage of txHash in the codebase.


Verify the handling of the new return type common.ExecutionHash for broadcastDepositTx.

The txHash returned by broadcastDepositTx is used in a logging statement with txHash.Hex(). To ensure the new return type common.ExecutionHash is handled correctly, we need to verify that common.ExecutionHash has a Hex() method.


Verified: The new return type common.ExecutionHash is handled correctly.

The common.ExecutionHash type includes a Hex() method, ensuring that the logging statement using txHash.Hex() works correctly. The changes are verified, and no issues are found.

  • common.ExecutionHash definition and methods: mod/primitives/pkg/common/execution.go
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `broadcastDepositTx` handle the new return type `common.ExecutionHash`.

# Test: Search for the function usage. Expect: Only occurrences of the new return type.
rg --type go -A 5 $'broadcastDepositTx'

Length of output: 830


Script:

#!/bin/bash
# Description: Trace the usage of `txHash` to ensure the new return type `common.ExecutionHash` is handled correctly.

# Search for the assignment of `txHash` and its subsequent usage.
rg --type go -A 10 'txHash, err = broadcastDepositTx' mod/cli/pkg/commands/deposit/create.go

Length of output: 325


Script:

#!/bin/bash
# Description: Verify that `common.ExecutionHash` has a `Hex()` method.

# Search for the definition of `common.ExecutionHash` and check for the `Hex()` method.
rg --type go 'type ExecutionHash' -A 15

Length of output: 1160

mod/node-core/pkg/components/storage/types.go (2)

223-223: LGTM! But verify the function usage in the codebase.

The code changes are approved.

However, ensure that all implementations of the WithdrawalCredentials interface handle the new type common.ExecutionAddress.


214-214: LGTM! But verify the function usage in the codebase.

The code changes are approved.

However, ensure that all implementations of the Withdrawal interface handle the new type common.ExecutionAddress.

Verification successful

The verification is successful.

The change to use common.ExecutionAddress in the Withdrawal interface has been consistently applied across the codebase.

  • Instances of common.ExecutionAddress have been found in various files, confirming the update.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all implementations of the `Withdrawal` interface handle the new type `common.ExecutionAddress`.

# Test: Search for the interface usage. Expect: Only occurrences of the new type.
rg --type go -A 5 $'Withdrawal'

Length of output: 322995

mod/state-transition/pkg/core/state/statedb.go (1)

196-196: LGTM! But verify the function usage in the codebase.

The code changes are approved.

However, ensure that all usages of the withdrawalAddress variable handle the new type common.ExecutionAddress.

Verification successful

The new type common.ExecutionAddress is handled correctly in the codebase.

The ToExecutionAddress method returns common.ExecutionAddress, and this type is used consistently across various parts of the codebase.

  • mod/state-transition/pkg/core/state/statedb.go
  • mod/consensus-types/pkg/types/withdrawal_credentials.go
  • mod/node-api/backend/types.go
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all usages of the `withdrawalAddress` variable handle the new type `common.ExecutionAddress`.

# Test: Search for the variable usage. Expect: Only occurrences of the new type.
rg --type go -A 5 $'withdrawalAddress'

Length of output: 1243


Script:

#!/bin/bash
# Description: Find the definition of `GetWithdrawalCredentials().ToExecutionAddress()` to verify its return type.

# Test: Search for the definition of `ToExecutionAddress`. Expect: The return type should be `common.ExecutionAddress`.
rg --type go 'func ToExecutionAddress' -A 3

Length of output: 45


Script:

#!/bin/bash
# Description: Find the function definition that takes `withdrawalAddress` as a parameter to verify its expected type.

# Test: Search for the function definition that takes `withdrawalAddress`. Expect: The parameter type should be `common.ExecutionAddress`.
rg --type go 'func $_(' -A 3 | rg 'withdrawalAddress'

Length of output: 120


Script:

#!/bin/bash
# Description: Find the definition of `ToExecutionAddress` in the context of `GetWithdrawalCredentials`.

# Test: Search for the definition of `GetWithdrawalCredentials` and its method `ToExecutionAddress`. Expect: The return type should be `common.ExecutionAddress`.
rg --type go 'func (.*) GetWithdrawalCredentials' -A 10 | rg 'ToExecutionAddress'

Length of output: 81


Script:

#!/bin/bash
# Description: Find the function definition that takes `withdrawalAddress` as a parameter to verify its expected type.

# Test: Search for the function definition that takes `withdrawalAddress`. Expect: The parameter type should be `common.ExecutionAddress`.
rg --type go 'func ' -A 3 | rg 'withdrawalAddress'

Length of output: 50


Script:

#!/bin/bash
# Description: Find all usages of `ExecutionAddress` type in the codebase.

# Test: Search for the `ExecutionAddress` type. Expect: Identify where `common.ExecutionAddress` is used.
rg --type go 'common.ExecutionAddress'

Length of output: 10195


Script:

#!/bin/bash
# Description: Find all usages of `ToExecutionAddress` method in the codebase.

# Test: Search for the `ToExecutionAddress` method. Expect: Identify where `ToExecutionAddress` is used.
rg --type go 'ToExecutionAddress'

Length of output: 3467

mod/engine-primitives/pkg/engine-primitives/requests.go (2)

162-162: Ensure type compatibility when converting blobHash.

The explicit conversion of blobHash to common.ExecutionHash ensures type compatibility. This is a good practice to prevent type mismatch errors.


197-199: Ensure type compatibility in block header construction.

The conversion of fields to gethprimitives.ExecutionHash and gethprimitives.ExecutionAddress ensures type compatibility when constructing the block header. This is a good practice to prevent type mismatch errors.

mod/node-core/go.mod (1)

53-53: Ensure correct management of indirect dependencies.

The gethprimitives dependency has been re-added as an indirect dependency. Verify that this change does not affect the build process and that the indirect dependency is correctly managed.

mod/consensus-types/pkg/types/payload.go (6)

278-294: LGTM!

The changes to use common.ExecutionHash and common.ExecutionAddress in the MarshalJSON function are correct.


325-341: LGTM!

The changes to use common.ExecutionHash and common.ExecutionAddress in the UnmarshalJSON function are correct.


467-467: LGTM!

The change to return common.ExecutionHash in the GetParentHash function is correct.


474-474: LGTM!

The change to return common.ExecutionAddress in the GetFeeRecipient function is correct.


529-529: LGTM!

The change to return common.ExecutionHash in the GetBlockHash function is correct.


Line range hint 574-586:
LGTM!

The changes to use common.ExecutionHash and common.ExecutionAddress in the ToHeader function are correct.

mod/consensus-types/pkg/types/validator_test.go (10)

51-51: LGTM!

The changes to use common.ExecutionAddress in the TestNewValidatorFromDeposit function are correct.

Also applies to: 60-60, 83-83, 92-92, 115-115, 124-124


366-366: LGTM!

The changes to use common.ExecutionAddress in the TestValidator_IsFullyWithdrawable function are correct.

Also applies to: 390-390, 403-403


435-435: LGTM!

The changes to use common.ExecutionAddress in the TestValidator_IsPartiallyWithdrawable function are correct.

Also applies to: 458-458, 470-470


502-502: LGTM!

The changes to use common.ExecutionAddress in the TestValidator_HasEth1WithdrawalCredentials function are correct.


573-573: LGTM!

The changes to use common.ExecutionAddress in the TestValidator_MarshalUnmarshalSSZ function are correct.

Also applies to: 598-598, 615-615, 640-640


709-709: LGTM!

The changes to use common.ExecutionAddress in the TestValidator_HashTreeRoot function are correct.

Also applies to: 733-733


837-837: LGTM!

The changes to use common.ExecutionAddress in the TestValidator_GetWithdrawalCredentials function are correct.

Also applies to: 841-841


904-904: LGTM!

The changes to use common.ExecutionAddress in the TestValidator_New function are correct.

Also applies to: 913-913


904-904: LGTM!

The changes to use common.ExecutionAddress in the TestValidator_New function are correct.

Also applies to: 913-913


904-904: LGTM!

The changes to use common.ExecutionAddress in the TestValidator_New function are correct.

Also applies to: 913-913

)

type PayloadAttributes interface {
// IsNil returns true if the payload attributes are nil.
IsNil() bool
// GetSuggestedFeeRecipient returns the suggested fee recipient.
GetSuggestedFeeRecipient() gethprimitives.ExecutionAddress
GetSuggestedFeeRecipient() common.ExecutionAddress
Copy link
Contributor

Choose a reason for hiding this comment

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

Tip

Codebase Verification

Update the method signature in the mock implementation.

The method GetSuggestedFeeRecipient in the file mod/engine-primitives/pkg/engine-primitives/mocks/payload_attributer.mock.go still uses common.Address instead of common.ExecutionAddress. Please update the mock implementation to match the new method signature.

  • File: mod/engine-primitives/pkg/engine-primitives/mocks/payload_attributer.mock.go
  • Lines: Relevant lines where GetSuggestedFeeRecipient is defined and used.
Analysis chain

Update the interface method signature.

The method signature for GetSuggestedFeeRecipient has been updated to use common.ExecutionAddress instead of gethprimitives.ExecutionAddress. This change is consistent with the goal of consolidating types under the common package.

However, ensure that all implementations of the PayloadAttributes interface are updated to match the new method signature.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all implementations of the `PayloadAttributes` interface match the updated method signature.

# Test: Search for the interface implementations. Expect: Only occurrences of the new signature.
rg --type go -A 5 $'GetSuggestedFeeRecipient'

Length of output: 8204

Comment on lines +140 to 143
address common.ExecutionAddress,
amount math.Gwei,
) T
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Tip

Codebase Verification

Ensure all instances of gethprimitives.ExecutionAddress are replaced with common.ExecutionAddress.

The following occurrences of gethprimitives.ExecutionAddress still exist and need to be updated:

  • testing/e2e/e2e_staking_test.go
  • mod/execution/pkg/deposit/contract.go
  • mod/engine-primitives/pkg/engine-primitives/requests.go
  • mod/cli/pkg/commands/deposit/create.go
Analysis chain

LGTM! But verify the usage of the new type in the codebase.

The change to use common.ExecutionAddress instead of gethprimitives.ExecutionAddress aligns with the PR objectives.

However, ensure that all instances of gethprimitives.ExecutionAddress have been replaced with common.ExecutionAddress throughout the codebase.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all instances of `gethprimitives.ExecutionAddress` have been replaced with `common.ExecutionAddress`.

# Test: Search for the old type usage. Expect: No occurrences of the old type.
rg --type go 'gethprimitives.ExecutionAddress'

Length of output: 687


Script:

#!/bin/bash
# Description: Extract and review the context around the occurrences of `gethprimitives.ExecutionAddress`.

# Extract 5 lines of context around each occurrence to understand if they need to be updated.
rg --type go --context 5 'gethprimitives.ExecutionAddress'

Length of output: 5313

Comment on lines +95 to +98
// NewExecutionAddressFromHex creates a new address from a hex string.
func NewExecutionAddressFromHex(input string) ExecutionAddress {
return ExecutionAddress(hex.MustToBytes(input))
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Ensure error handling in NewExecutionAddressFromHex.

The NewExecutionAddressFromHex function uses hex.MustToBytes which might panic on invalid input. Consider handling errors gracefully.

- return ExecutionAddress(hex.MustToBytes(input))
+ bytes, err := hex.ToBytes(input)
+ if err != nil {
+     // Handle error appropriately, e.g., log or return a default value
+ }
+ return ExecutionAddress(bytes)

Committable suggestion was skipped due to low confidence.

Comment on lines +52 to +55
// NewExecutionHashFromHex creates a new hash from a hex string.
func NewExecutionHashFromHex(input string) ExecutionHash {
return ExecutionHash(hex.MustToBytes(input))
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Ensure error handling in NewExecutionHashFromHex.

The NewExecutionHashFromHex function uses hex.MustToBytes which might panic on invalid input. Consider handling errors gracefully.

- return ExecutionHash(hex.MustToBytes(input))
+ bytes, err := hex.ToBytes(input)
+ if err != nil {
+     // Handle error appropriately, e.g., log or return a default value
+ }
+ return ExecutionHash(bytes)

Committable suggestion was skipped due to low confidence.

@@ -34,12 +33,12 @@ type PayloadAttributer interface {
constraints.Nillable
// GetSuggestedFeeRecipient returns the suggested fee recipient for the
// block.
GetSuggestedFeeRecipient() gethprimitives.ExecutionAddress
GetSuggestedFeeRecipient() common.ExecutionAddress
Copy link
Contributor

Choose a reason for hiding this comment

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

Tip

Codebase Verification

Inconsistency Detected: Update Mock Implementation

The return type of GetSuggestedFeeRecipient in the PayloadAttributer interface has been updated to common.ExecutionAddress. However, the mock implementation in payload_attributer.mock.go still returns common.Address. Please update the mock implementation to return common.ExecutionAddress to maintain consistency.

  • File: mod/engine-primitives/pkg/engine-primitives/mocks/payload_attributer.mock.go
  • Lines:
    • func (_m *PayloadAttributer) GetSuggestedFeeRecipient() common.Address {
    • func (_c *PayloadAttributer_GetSuggestedFeeRecipient_Call) Return(_a0 common.Address) *PayloadAttributer_GetSuggestedFeeRecipient_Call {
    • func (_c *PayloadAttributer_GetSuggestedFeeRecipient_Call) RunAndReturn(run func() common.Address) *PayloadAttributer_GetSuggestedFeeRecipient_Call {
Analysis chain

LGTM! Verify consistency across the codebase.

The return type change to common.ExecutionAddress aligns with the transition to the common package.

Ensure that all implementations of PayloadAttributer are updated accordingly.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all implementations of PayloadAttributer are updated.

# Test: Search for implementations of PayloadAttributer. Expect: Only occurrences of the new return type.
rg --type go -A 5 'PayloadAttributer'

Length of output: 16464

GetBlockHash() gethprimitives.ExecutionHash
GetParentHash() gethprimitives.ExecutionHash
GetBlockHash() common.ExecutionHash
GetParentHash() common.ExecutionHash
Copy link
Contributor

Choose a reason for hiding this comment

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

Tip

Codebase Verification

Inconsistent type usage detected.

The return type of GetParentHash has been updated to common.ExecutionHash, but there are still several occurrences of gethprimitives.ExecutionHash in the codebase. Please update the following instances to ensure consistency:

  • mod/engine-primitives/pkg/engine-primitives/requests.go: blobHashes = make([]gethprimitives.ExecutionHash, 0)
  • mod/engine-primitives/pkg/engine-primitives/requests.go: ParentHash: gethprimitives.ExecutionHash(payload.GetParentHash())
  • mod/engine-primitives/pkg/engine-primitives/requests.go: Root: gethprimitives.ExecutionHash(payload.GetStateRoot())
  • mod/engine-primitives/pkg/engine-primitives/requests.go: ReceiptHash: gethprimitives.ExecutionHash(payload.GetReceiptsRoot())
  • mod/engine-primitives/pkg/engine-primitives/requests.go: MixDigest: gethprimitives.ExecutionHash(payload.GetPrevRandao())
  • mod/engine-primitives/pkg/engine-primitives/requests.go: WithdrawalsHash: (*gethprimitives.ExecutionHash)(withdrawalsHash)
  • mod/engine-primitives/pkg/engine-primitives/requests.go: ParentBeaconRoot: (*gethprimitives.ExecutionHash)(n.ParentBeaconBlockRoot)
  • mod/engine-primitives/pkg/engine-primitives/requests.go: }); block.Hash() != gethprimitives.ExecutionHash(payload.GetBlockHash())
  • mod/execution/pkg/client/eth.go: gethprimitives.ExecutionHash(hash)
Analysis chain

Ensure consistent type replacements throughout the codebase.

The return type of GetParentHash has been updated from gethprimitives.ExecutionHash to common.ExecutionHash. Verify that this type change is consistently applied throughout the codebase.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the consistency of type replacements.

# Test: Search for occurrences of `gethprimitives.ExecutionHash`. Expect: No occurrences.
rg --type go 'gethprimitives.ExecutionHash'

Length of output: 1152

@@ -126,7 +126,7 @@
func (n *NewPayloadRequest[ExecutionPayloadT, WithdrawalT]) HasValidVersionedAndBlockHashes() error {
var (
gethWithdrawals []*gethprimitives.Withdrawal
withdrawalsHash *gethprimitives.ExecutionHash
withdrawalsHash *common.ExecutionHash
Copy link
Contributor

Choose a reason for hiding this comment

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

Tip

Codebase Verification

Update all instances of gethprimitives.ExecutionHash to common.ExecutionHash.

The following occurrences of gethprimitives.ExecutionHash need to be updated to common.ExecutionHash to ensure consistency:

  • mod/engine-primitives/pkg/engine-primitives/requests.go
    • Line containing blobHashes = make([]gethprimitives.ExecutionHash, 0)
    • Line containing ParentHash: gethprimitives.ExecutionHash(payload.GetParentHash())
    • Line containing Root: gethprimitives.ExecutionHash(payload.GetStateRoot())
    • Line containing ReceiptHash: gethprimitives.ExecutionHash(payload.GetReceiptsRoot())
    • Line containing MixDigest: gethprimitives.ExecutionHash(payload.GetPrevRandao())
    • Line containing WithdrawalsHash: (*gethprimitives.ExecutionHash)(withdrawalsHash)
    • Line containing ParentBeaconRoot: (*gethprimitives.ExecutionHash)(n.ParentBeaconBlockRoot)
    • Line containing block.Hash() != gethprimitives.ExecutionHash(payload.GetBlockHash())
  • mod/execution/pkg/client/eth.go
    • Line containing gethprimitives.ExecutionHash(hash)

Please update these instances to maintain consistency in the codebase.

Analysis chain

Ensure consistent type replacements throughout the codebase.

The withdrawalsHash variable type has been updated from gethprimitives.ExecutionHash to common.ExecutionHash. Verify that this type change is consistently applied throughout the codebase.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the consistency of type replacements.

# Test: Search for occurrences of `gethprimitives.ExecutionHash`. Expect: No occurrences.
rg --type go 'gethprimitives.ExecutionHash'

Length of output: 1152


Script:

#!/bin/bash
# Description: List occurrences of `gethprimitives.ExecutionHash` with surrounding context to understand usage.

# List occurrences with 3 lines of context before and after each match.
rg --type go 'gethprimitives.ExecutionHash' -C 3

Length of output: 4157

GetValidatorIndex() math.U64
},
] struct {
// ExecutionPayload is the payload to the execution client.
ExecutionPayload ExecutionPayloadT
// VersionedHashes is the versioned hashes of the execution payload.
VersionedHashes []gethprimitives.ExecutionHash
VersionedHashes []common.ExecutionHash
Copy link
Contributor

Choose a reason for hiding this comment

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

Tip

Codebase Verification

Ensure consistent type replacements throughout the codebase.

The type gethprimitives.ExecutionHash is still present in multiple locations. To maintain consistency and avoid potential type mismatches, please update the following instances to common.ExecutionHash:

  • mod/execution/pkg/client/eth.go:

    • Line with gethprimitives.ExecutionHash(hash)
  • mod/engine-primitives/pkg/engine-primitives/requests.go:

    • Line with blobHashes = make([]gethprimitives.ExecutionHash, 0)
    • Line with ParentHash: gethprimitives.ExecutionHash(payload.GetParentHash())
    • Line with Root: gethprimitives.ExecutionHash(payload.GetStateRoot())
    • Line with ReceiptHash: gethprimitives.ExecutionHash(payload.GetReceiptsRoot())
    • Line with MixDigest: gethprimitives.ExecutionHash(payload.GetPrevRandao())
    • Line with WithdrawalsHash: (*gethprimitives.ExecutionHash)(withdrawalsHash)
    • Line with ParentBeaconRoot: (*gethprimitives.ExecutionHash)(n.ParentBeaconBlockRoot)
    • Line with block.Hash() != gethprimitives.ExecutionHash(payload.GetBlockHash())
Analysis chain

Ensure consistent type replacements throughout the codebase.

The VersionedHashes field type has been updated from gethprimitives.ExecutionHash to common.ExecutionHash. Verify that this type change is consistently applied throughout the codebase.


Ensure consistent type replacements throughout the codebase.

The type gethprimitives.ExecutionHash is still present in multiple locations. Verify if these instances should be updated to common.ExecutionHash for consistency.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the consistency of type replacements.

# Test: Search for occurrences of `gethprimitives.ExecutionHash`. Expect: No occurrences.
rg --type go 'gethprimitives.ExecutionHash'

Length of output: 1152


Script:

#!/bin/bash
# Description: Gather context around occurrences of `gethprimitives.ExecutionHash`.

# Search for occurrences of `gethprimitives.ExecutionHash` with context lines for better understanding.
rg --type go 'gethprimitives.ExecutionHash' -A 5 -B 5

Length of output: 5183

Comment on lines 318 to 334
ParentHash *common.ExecutionHash `json:"parentHash"`
FeeRecipient *common.ExecutionAddress `json:"feeRecipient"`
StateRoot *bytes.B32 `json:"stateRoot"`
ReceiptsRoot *bytes.B32 `json:"receiptsRoot"`
LogsBloom *bytes.B256 `json:"logsBloom"`
Random *bytes.B32 `json:"prevRandao"`
Number *math.U64 `json:"blockNumber"`
GasLimit *math.U64 `json:"gasLimit"`
GasUsed *math.U64 `json:"gasUsed"`
Timestamp *math.U64 `json:"timestamp"`
ExtraData *bytes.Bytes `json:"extraData"`
BaseFeePerGas *math.U256 `json:"baseFeePerGas"`
BlockHash *common.ExecutionHash `json:"blockHash"`
TransactionsRoot *bytes.B32 `json:"transactionsRoot"`
WithdrawalsRoot *bytes.B32 `json:"withdrawalsRoot"`
BlobGasUsed *math.U64 `json:"blobGasUsed"`
ExcessBlobGas *math.U64 `json:"excessBlobGas"`
Copy link
Contributor

Choose a reason for hiding this comment

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

Tip

Codebase Verification

Ensure consistent type replacements throughout the codebase.

The following files still contain occurrences of gethprimitives.ExecutionHash and gethprimitives.ExecutionAddress. Please replace them with the corresponding new types from the common package:

  • testing/e2e/e2e_staking_test.go: gethprimitives.ExecutionAddress
  • mod/execution/pkg/deposit/contract.go: gethprimitives.ExecutionAddress
  • mod/execution/pkg/client/eth.go: gethprimitives.ExecutionHash
  • mod/engine-primitives/pkg/engine-primitives/requests.go: Multiple occurrences of both gethprimitives.ExecutionHash and gethprimitives.ExecutionAddress
  • mod/cli/pkg/commands/deposit/create.go: gethprimitives.ExecutionAddress

Please ensure these changes are consistently applied throughout the codebase.

Analysis chain

Ensure consistent type replacements throughout the codebase.

The UnmarshalJSON function has been updated to use the new types from the common package. Verify that these type changes are consistently applied throughout the codebase.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the consistency of type replacements.

# Test: Search for occurrences of `gethprimitives.ExecutionHash` and `gethprimitives.ExecutionAddress`. Expect: No occurrences.
rg --type go 'gethprimitives.ExecutionHash|gethprimitives.ExecutionAddress'

Length of output: 1827

Comment on lines 274 to 290
ParentHash common.ExecutionHash `json:"parentHash"`
FeeRecipient common.ExecutionAddress `json:"feeRecipient"`
StateRoot bytes.B32 `json:"stateRoot"`
ReceiptsRoot bytes.B32 `json:"receiptsRoot"`
LogsBloom bytes.B256 `json:"logsBloom"`
Random bytes.B32 `json:"prevRandao"`
Number math.U64 `json:"blockNumber"`
GasLimit math.U64 `json:"gasLimit"`
GasUsed math.U64 `json:"gasUsed"`
Timestamp math.U64 `json:"timestamp"`
ExtraData bytes.Bytes `json:"extraData"`
BaseFeePerGas *math.U256 `json:"baseFeePerGas"`
BlockHash common.ExecutionHash `json:"blockHash"`
TransactionsRoot bytes.B32 `json:"transactionsRoot"`
WithdrawalsRoot bytes.B32 `json:"withdrawalsRoot"`
BlobGasUsed math.U64 `json:"blobGasUsed"`
ExcessBlobGas math.U64 `json:"excessBlobGas"`
Copy link
Contributor

Choose a reason for hiding this comment

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

Tip

Codebase Verification

Ensure consistent type replacements throughout the codebase.

The MarshalJSON function has been updated to use the new types from the common package. However, there are still occurrences of gethprimitives.ExecutionHash and gethprimitives.ExecutionAddress in the codebase. Please replace these types with the new types from the common package in the following lines:

  • mod/execution/pkg/client/eth.go:77
  • mod/execution/pkg/deposit/contract.go:56
  • mod/cli/pkg/commands/deposit/create.go:225, 235
  • mod/engine-primitives/pkg/engine-primitives/requests.go:130, 197, 200, 202, 211, 212, 215, 219, 183, 199
  • testing/e2e/e2e_staking_test.go:195
Analysis chain

Ensure consistent type replacements throughout the codebase.

The MarshalJSON function has been updated to use the new types from the common package. Verify that these type changes are consistently applied throughout the codebase.


Ensure consistent type replacements throughout the codebase.

The MarshalJSON function has been updated to use the new types from the common package. However, there are still occurrences of gethprimitives.ExecutionHash and gethprimitives.ExecutionAddress in the codebase. Verify that these type changes are consistently applied throughout the codebase.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the consistency of type replacements.

# Test: Search for occurrences of `gethprimitives.ExecutionHash` and `gethprimitives.ExecutionAddress`. Expect: No occurrences.
rg --type go 'gethprimitives.ExecutionHash|gethprimitives.ExecutionAddress'

Length of output: 1827


Script:

#!/bin/bash
# Description: Verify specific lines for type replacements.

# Check specific lines in the files for `gethprimitives.ExecutionHash` and `gethprimitives.ExecutionAddress`.

# mod/execution/pkg/client/eth.go
rg --type go --line-number 'gethprimitives.ExecutionHash' mod/execution/pkg/client/eth.go
rg --type go --line-number 'gethprimitives.ExecutionAddress' mod/execution/pkg/client/eth.go

# mod/execution/pkg/deposit/contract.go
rg --type go --line-number 'gethprimitives.ExecutionAddress' mod/execution/pkg/deposit/contract.go

# mod/cli/pkg/commands/deposit/create.go
rg --type go --line-number 'gethprimitives.ExecutionAddress' mod/cli/pkg/commands/deposit/create.go

# mod/engine-primitives/pkg/engine-primitives/requests.go
rg --type go --line-number 'gethprimitives.ExecutionHash' mod/engine-primitives/pkg/engine-primitives/requests.go
rg --type go --line-number 'gethprimitives.ExecutionAddress' mod/engine-primitives/pkg/engine-primitives/requests.go

# testing/e2e/e2e_staking_test.go
rg --type go --line-number 'gethprimitives.ExecutionAddress' testing/e2e/e2e_staking_test.go

Length of output: 1773

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 9

Outside diff range comments (1)
mod/state-transition/pkg/core/state/types.go (1)

[!TIP]
Codebase Verification

Instances of gethprimitives.ExecutionAddress found in the codebase

The following files still reference gethprimitives.ExecutionAddress:

  • testing/e2e/e2e_staking_test.go
  • mod/execution/pkg/deposit/contract.go
  • mod/engine-primitives/pkg/engine-primitives/requests.go
  • mod/cli/pkg/commands/deposit/create.go

These instances should be updated to use common.ExecutionAddress to maintain consistency with the changes made to the Withdrawal interface.

Analysis chain

Line range hint 74-83:
LGTM! But verify the interface usage in the codebase.

The Withdrawal interface is consistent with the new common package types.

However, ensure that all instances of Withdrawal interface usage are updated accordingly.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all instances of the `Withdrawal` interface usage.

# Test: Search for the `Withdrawal` interface usage. Expect: Only occurrences of the new type.
rg --type go -A 5 $'Withdrawal'

Length of output: 323005


Script:

#!/bin/bash
# Description: Verify that all instances of the `Withdrawal` interface usage have been updated to use `common.ExecutionAddress` instead of `gethprimitives.ExecutionAddress`.

# Test: Search for any remaining instances of `gethprimitives.ExecutionAddress` in the context of `Withdrawal`.
rg --type go 'gethprimitives.ExecutionAddress'

Length of output: 687

Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE

Commits

Files that changed from the base of the PR and between f5bd114 and c5a0bef.

Files selected for processing (19)
  • mod/beacon/validator/block_builder.go (2 hunks)
  • mod/consensus-types/pkg/types/attestation_data_test.go (2 hunks)
  • mod/consensus-types/pkg/types/block.go (2 hunks)
  • mod/consensus-types/pkg/types/block_test.go (5 hunks)
  • mod/consensus-types/pkg/types/body.go (3 hunks)
  • mod/consensus-types/pkg/types/genesis_test.go (2 hunks)
  • mod/consensus-types/pkg/types/payload_header.go (7 hunks)
  • mod/consensus-types/pkg/types/payload_header_test.go (5 hunks)
  • mod/consensus-types/pkg/types/signing_data_test.go (2 hunks)
  • mod/da/pkg/types/sidecar_test.go (3 hunks)
  • mod/da/pkg/types/sidecars_test.go (3 hunks)
  • mod/node-api/handlers/beacon/types/response.go (1 hunks)
  • mod/node-api/handlers/proof/types/response.go (2 hunks)
  • mod/node-api/handlers/utils/id.go (2 hunks)
  • mod/payload/pkg/attributes/types.go (3 hunks)
  • mod/primitives/pkg/common/consensus.go (3 hunks)
  • mod/primitives/pkg/merkle/tree_test.go (3 hunks)
  • mod/state-transition/pkg/core/state/types.go (4 hunks)
  • mod/state-transition/pkg/core/types.go (5 hunks)
Additional comments not posted (39)
mod/payload/pkg/attributes/types.go (1)

33-33: Verify the impact of the return type change.

The return type of GetRandaoMixAtIndex has been updated from common.Root to common.Bytes32. Ensure that all implementations and calls to this method are updated accordingly.

Verification successful

The return type change has been successfully propagated.

The return type of GetRandaoMixAtIndex has been updated from common.Root to common.Bytes32, and all implementations and calls to this method have been updated accordingly.

  • Verified in the following files:
    • mod/payload/pkg/builder/types.go
    • mod/state-transition/pkg/core/state_processor_payload.go
    • mod/state-transition/pkg/core/state/interfaces.go
    • mod/state-transition/pkg/core/state/statedb.go
    • mod/storage/pkg/beacondb/randao.go
    • mod/state-transition/pkg/core/state_processor_randao.go
    • mod/state-transition/pkg/core/interfaces.go
    • mod/payload/pkg/attributes/types.go
    • mod/payload/pkg/attributes/factory.go
    • mod/node-core/pkg/components/storage/types.go
    • mod/node-api/backend/randao.go
    • mod/node-api/backend/mocks/beacon_state.mock.go
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all implementations and calls to `GetRandaoMixAtIndex` match the new return type.

# Test: Search for the method usage. Expect: Only occurrences of the new return type.
rg --type go -A 5 $'GetRandaoMixAtIndex'

Length of output: 10666

mod/consensus-types/pkg/types/signing_data_test.go (2)

59-59: Verify the impact of the type change in test cases.

The test cases now use common.Root instead of bytes.B32 for ObjectRoot. Ensure that all related test cases are updated accordingly.

Also applies to: 63-63

Verification successful

The impact of the type change in test cases has been verified.

All instances of ObjectRoot have been updated to use common.Root consistently across the test cases and the main code.

  • mod/consensus-types/pkg/types/signing_data_test.go
  • mod/consensus-types/pkg/types/signing_data.go
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all related test cases match the new type.

# Test: Search for the test case usage. Expect: Only occurrences of the new type.
rg --type go -A 5 $'ObjectRoot'

Length of output: 3112


35-35: Verify the impact of the type change.

The ObjectRoot field in SigningData is now initialized with common.Root instead of bytes.B32. Ensure that all usages of generateSigningData are updated accordingly.

Verification successful

Verify the impact of the type change.

The ObjectRoot field in SigningData is now initialized with common.Root instead of bytes.B32. All usages of generateSigningData in the mod/consensus-types/pkg/types/signing_data_test.go file are consistent with this change.

  • mod/consensus-types/pkg/types/signing_data_test.go
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all usages of `generateSigningData` match the new type.

# Test: Search for the function usage. Expect: Only occurrences of the new type.
rg --type go -A 5 $'generateSigningData'

Length of output: 1519

mod/node-api/handlers/beacon/types/response.go (1)

52-52: Verify the impact of the type change.

The type of GenesisValidatorsRoot has been updated from common.Bytes32 to common.Root. Ensure that all usages of GenesisData are updated accordingly.

Verification successful

Verify the impact of the type change.

The type of GenesisValidatorsRoot has been updated from common.Bytes32 to common.Root. Ensure that all usages of GenesisData are updated accordingly.


Verification successful.

The type of GenesisValidatorsRoot has been updated from common.Bytes32 to common.Root and this change has been correctly propagated in the relevant files.

  • mod/node-api/handlers/beacon/types/response.go: Definition updated.
  • mod/node-api/handlers/beacon/genesis.go: Usage updated.

No issues found in other references.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all usages of `GenesisData` match the new type.

# Test: Search for the type usage. Expect: Only occurrences of the new type.
rg --type go -A 5 $'GenesisData'

Length of output: 4867


Script:

#!/bin/bash
# Description: Verify the exact usage of `GenesisData` to ensure the type change is correctly propagated.

# Check the definition and usage of `GenesisData` in `mod/node-api/handlers/beacon/types/response.go`
rg --type go -A 5 'type GenesisData struct' mod/node-api/handlers/beacon/types/response.go

# Check the usage of `GenesisData` in `mod/node-api/handlers/beacon/genesis.go`
rg --type go -A 5 'GenesisData' mod/node-api/handlers/beacon/genesis.go

# Check the usage of `GenesisData` in `mod/runtime/pkg/middleware/`
rg --type go -A 5 'GenesisData' mod/runtime/pkg/middleware/

# Check the usage of `GenesisData` in `mod/beacon/blockchain/`
rg --type go -A 5 'GenesisData' mod/beacon/blockchain/

# Check the usage of `GenesisData` in `mod/primitives/pkg/events/`
rg --type go -A 5 'GenesisData' mod/primitives/pkg/events/

Length of output: 4640

mod/state-transition/pkg/core/state/types.go (3)

Line range hint 1-55:
LGTM!

The BeaconStateMarshallable interface is consistent with the new common package types.


Line range hint 56-73:
LGTM!

The Validator interface is consistent with the new common package types.


Line range hint 84-92:
LGTM!

The WithdrawalCredentials interface is consistent with the new common package types.

mod/node-api/handlers/proof/types/response.go (3)

Line range hint 1-29:
LGTM!

The BlockProposerResponse struct is consistent with the new common package types.


Line range hint 30-50:
LGTM!

The ExecutionNumberResponse struct is consistent with the new common package types.


Line range hint 51-82:
LGTM! But verify the struct usage in the codebase.

The ExecutionFeeRecipientResponse struct is consistent with the new common package types.

However, ensure that all instances of ExecutionFeeRecipientResponse struct usage are updated accordingly.

Verification successful

LGTM! But verify the usage of common.ExecutionAddress in the codebase.

The ExecutionFeeRecipientResponse struct is consistent with the new common package types.

However, ensure that all instances of common.ExecutionAddress usage are updated accordingly.


Verification successful.

The common.ExecutionAddress type is used consistently across the codebase, confirming that the transition has been correctly implemented.

  • mod/node-api/handlers/proof/types/response.go
  • mod/node-api/handlers/proof/execution_fee_recipient.go
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all instances of the `ExecutionFeeRecipientResponse` struct usage.

# Test: Search for the `ExecutionFeeRecipientResponse` struct usage. Expect: Only occurrences of the new type.
rg --type go -A 5 $'ExecutionFeeRecipientResponse'

Length of output: 1436


Script:

#!/bin/bash
# Description: Verify all instances of the `common.ExecutionAddress` usage.

# Test: Search for the `common.ExecutionAddress` usage in the codebase. Expect: Consistent usage across the codebase.
rg --type go 'common.ExecutionAddress'

Length of output: 10286

mod/consensus-types/pkg/types/attestation_data_test.go (3)

Line range hint 1-100:
LGTM!

The TestAttestationData_MarshalSSZ_UnmarshalSSZ function is consistent with the new common package types.


Line range hint 101-120:
LGTM!

The TestAttestationData_GetTree function is consistent with the new common package types.


Line range hint 121-134:
LGTM! But verify the function usage in the codebase.

The TestAttestationData_Getters function is consistent with the new common package types.

However, ensure that all instances of TestAttestationData_Getters function usage are updated accordingly.

Verification successful

Verification successful!

The TestAttestationData_Getters function is only defined and used in the mod/consensus-types/pkg/types/attestation_data_test.go file. The transition to the new common.Root type is consistent and no further updates are needed.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all instances of the `TestAttestationData_Getters` function usage.

# Test: Search for the `TestAttestationData_Getters` function usage. Expect: Only occurrences of the new type.
rg --type go -A 5 $'TestAttestationData_Getters'

Length of output: 620

mod/node-api/handlers/utils/id.go (1)

58-62: LGTM! But verify the function usage in the codebase.

The refactoring to use common.NewRootFromHex improves readability and potentially enhances error handling.

However, ensure that all function calls to SlotFromBlockID are correctly updated to handle the new method.

Verification successful

LGTM! The function usage is correctly updated.

The refactoring to use common.NewRootFromHex in SlotFromBlockID is correctly integrated into the codebase, and the error handling is consistent with the new implementation.

  • mod/node-api/handlers/beacon/header.go
  • mod/node-api/handlers/beacon/block.go
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `SlotFromBlockID` are correctly updated.

# Test: Search for the function usage. Expect: Only occurrences with the new method.
rg --type go -A 5 $'SlotFromBlockID'

Length of output: 1628


Script:

#!/bin/bash
# Extract context around the usage of SlotFromBlockID in header.go and block.go

# Extract 10 lines of context around SlotFromBlockID usage in header.go
rg --type go -A 10 -B 10 $'SlotFromBlockID' mod/node-api/handlers/beacon/header.go

# Extract 10 lines of context around SlotFromBlockID usage in block.go
rg --type go -A 10 -B 10 $'SlotFromBlockID' mod/node-api/handlers/beacon/block.go

Length of output: 1289

mod/primitives/pkg/common/consensus.go (1)

67-116: LGTM! But verify the usage of the new Root type in the codebase.

The introduction of the new Root type and its associated methods enhance the clarity, usability, and functionality of the Root type.

However, ensure that all instances of the Root type are correctly updated to use the new methods.

mod/da/pkg/types/sidecars_test.go (2)

44-51: LGTM!

The changes ensure that all entries in the slices are explicitly recognized as common.Root types, enhancing type safety.


99-106: LGTM!

The changes ensure that all entries in the slices are explicitly recognized as common.Root types, enhancing type safety.

Also applies to: 132-139

mod/da/pkg/types/sidecar_test.go (3)

49-56: LGTM! Improved type safety and clarity.

The conversion of byte arrays to common.Root types enhances type safety and clarity in the tests.


97-99: LGTM! Improved type safety and clarity.

The conversion of byte arrays to common.Root types enhances type safety and clarity in the tests.


147-154: LGTM! Improved type safety and clarity.

The conversion of byte arrays to common.Root types enhances type safety and clarity in the tests.

mod/consensus-types/pkg/types/block_test.go (4)

41-42: LGTM! Improved type safety and clarity.

The conversion of bytes.B32 to common.Root types enhances type safety and clarity in the block generation.


75-75: LGTM! Improved type safety and clarity.

The conversion of bytes.B32 to common.Root types enhances type safety and clarity in the test.


165-165: LGTM! Improved type safety and clarity.

The conversion of bytes.B32 to common.Root types enhances type safety and clarity in the test.


184-184: LGTM! Improved type safety and clarity.

The conversion of bytes.B32 to common.Root types enhances type safety and clarity in the test.

mod/consensus-types/pkg/types/block.go (1)

69-69: LGTM! Improved type safety and clarity.

The conversion of bytes.B32 to common.Root types enhances type safety and clarity in the block initialization.

mod/primitives/pkg/merkle/tree_test.go (2)

Line range hint 159-163:
LGTM! But verify the usage of common.Root in the codebase.

The change to use common.Root(byteslib.ToBytes32([]byte("buzz"))) instead of byteslib.ToBytes32([]byte("buzz")) is approved.

However, ensure that all instances of common.Root are correctly used throughout the codebase.

Verification successful

LGTM! The usage of common.Root is consistent and correct throughout the codebase.

The change to use common.Root(byteslib.ToBytes32([]byte("buzz"))) instead of byteslib.ToBytes32([]byte("buzz")) is approved.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all instances of `common.Root` usage in the codebase.

# Test: Search for the usage of `common.Root`. Expect: Proper encapsulation of byte conversions.
rg --type go -A 5 $'common.Root'

Length of output: 129522


Line range hint 114-118:
LGTM! But verify the usage of common.Root in the codebase.

The change to use common.Root(byteslib.ToBytes32([]byte("buzz"))) instead of byteslib.ToBytes32([]byte("buzz")) is approved.

However, ensure that all instances of common.Root are correctly used throughout the codebase.

Verification successful

LGTM! The change to use common.Root(byteslib.ToBytes32([]byte("buzz"))) instead of byteslib.ToBytes32([]byte("buzz")) is consistent with the usage of common.Root across the codebase.

  • The usage of common.Root is consistent and widespread throughout the codebase.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all instances of `common.Root` usage in the codebase.

# Test: Search for the usage of `common.Root`. Expect: Proper encapsulation of byte conversions.
rg --type go -A 5 $'common.Root'

Length of output: 129522

mod/state-transition/pkg/core/types.go (4)

82-83: LGTM!

The change to use common.ExecutionHash instead of gethprimitives.ExecutionHash in the GetBlobKzgCommitments method is approved.


149-155: LGTM!

The changes to use common.ExecutionHash and common.ExecutionAddress instead of gethprimitives.ExecutionHash and gethprimitives.ExecutionAddress in the ExecutionPayload interface are approved.


172-173: LGTM!

The change to use common.ExecutionHash instead of gethprimitives.ExecutionHash in the GetBlockHash method is approved.


245-246: LGTM!

The change to use common.ExecutionAddress instead of gethprimitives.ExecutionAddress in the GetAddress method is approved.

mod/consensus-types/pkg/types/genesis_test.go (2)

53-57: LGTM!

The changes to use common.ExecutionHash{} and common.ExecutionAddress{} instead of gethprimitives.ZeroHash and gethprimitives.ZeroAddress in the TestDefaultGenesisDeneb test case are approved.


Line range hint 146-146:
LGTM!

The test case TestGenesisUnmarshalJSON indirectly tests the changes to use common.ExecutionHash{} and common.ExecutionAddress{} and is consistent with the new types.

mod/consensus-types/pkg/types/body.go (3)

255-255: LGTM! Transition to common.ExecutionHash is appropriate.

The return type change aligns with the PR objectives to transition from gethprimitives.ExecutionHash to common.ExecutionHash.


262-263: LGTM! Transition to common.ExecutionHash is appropriate.

The parameter type change aligns with the PR objectives to transition from gethprimitives.ExecutionHash to common.ExecutionHash.


295-297: LGTM! Consistent use of common.Root.

The updates ensure consistency in using common.Root and align with the PR objectives.

mod/beacon/validator/block_builder.go (1)

308-310: LGTM! Transition to common.ExecutionHash is appropriate.

The change aligns with the PR objectives to transition from gethprimitives.ZeroHash to common.ExecutionHash{}.

mod/consensus-types/pkg/types/payload_header_test.go (2)

Line range hint 40-54:
LGTM! Transition to common types is appropriate.

The changes align with the PR objectives to transition from gethprimitives to common.


Line range hint 65-83:
LGTM! Transition to common types in tests is appropriate.

The changes ensure that the tests reflect the new implementation and remain valid.

@@ -46,9 +45,9 @@ type ExecutionPayloadHeader struct {
// Contents
//
// ParentHash is the hash of the parent block.
ParentHash gethprimitives.ExecutionHash `json:"parentHash"`
ParentHash common.ExecutionHash `json:"parentHash"`
Copy link
Contributor

Choose a reason for hiding this comment

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

Tip

Codebase Verification

Inconsistent type replacement for ExecutionHash found in multiple files.

The type gethprimitives.ExecutionHash still exists in several files. Please update these occurrences to common.ExecutionHash for consistency:

  • mod/execution/pkg/client/eth.go: Line with gethprimitives.ExecutionHash(hash)
  • mod/engine-primitives/pkg/engine-primitives/requests.go: Multiple lines
Analysis chain

LGTM! But verify the consistency of type replacements.

The type of ParentHash has been correctly updated to common.ExecutionHash. Ensure that this change is consistently applied throughout the codebase.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the consistency of type replacements for `ParentHash`.

# Test: Search for occurrences of `gethprimitives.ExecutionHash`. Expect: No occurrences.
rg --type go 'gethprimitives.ExecutionHash'

Length of output: 1152

// FeeRecipient is the address of the fee recipient.
FeeRecipient gethprimitives.ExecutionAddress `json:"feeRecipient"`
FeeRecipient common.ExecutionAddress `json:"feeRecipient"`
Copy link
Contributor

Choose a reason for hiding this comment

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

Tip

Codebase Verification

Inconsistent type replacements found.

The type gethprimitives.ExecutionAddress is still present in multiple files. Please update the following occurrences to common.ExecutionAddress to ensure consistency across the codebase:

  • testing/e2e/e2e_staking_test.go
  • mod/execution/pkg/deposit/contract.go
  • mod/engine-primitives/pkg/engine-primitives/requests.go
  • mod/cli/pkg/commands/deposit/create.go
Analysis chain

LGTM! But verify the consistency of type replacements.

The type of FeeRecipient has been correctly updated to common.ExecutionAddress. Ensure that this change is consistently applied throughout the codebase.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the consistency of type replacements for `FeeRecipient`.

# Test: Search for occurrences of `gethprimitives.ExecutionAddress`. Expect: No occurrences.
rg --type go 'gethprimitives.ExecutionAddress'

Length of output: 687

Comment on lines +318 to +334
ParentHash *common.ExecutionHash `json:"parentHash"`
FeeRecipient *common.ExecutionAddress `json:"feeRecipient"`
StateRoot *bytes.B32 `json:"stateRoot"`
ReceiptsRoot *bytes.B32 `json:"receiptsRoot"`
LogsBloom *bytes.B256 `json:"logsBloom"`
Random *bytes.B32 `json:"prevRandao"`
Number *math.U64 `json:"blockNumber"`
GasLimit *math.U64 `json:"gasLimit"`
GasUsed *math.U64 `json:"gasUsed"`
Timestamp *math.U64 `json:"timestamp"`
ExtraData *bytes.Bytes `json:"extraData"`
BaseFeePerGas *math.U256 `json:"baseFeePerGas"`
BlockHash *common.ExecutionHash `json:"blockHash"`
TransactionsRoot *common.Root `json:"transactionsRoot"`
WithdrawalsRoot *common.Root `json:"withdrawalsRoot"`
BlobGasUsed *math.U64 `json:"blobGasUsed"`
ExcessBlobGas *math.U64 `json:"excessBlobGas"`
Copy link
Contributor

Choose a reason for hiding this comment

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

Tip

Codebase Verification

Inconsistencies found in type replacements.

The types gethprimitives.ExecutionHash and gethprimitives.ExecutionAddress are still present in multiple files. Please ensure these are updated to common.ExecutionHash and common.ExecutionAddress where applicable.

  • testing/e2e/e2e_staking_test.go
  • mod/engine-primitives/pkg/engine-primitives/requests.go
  • mod/execution/pkg/client/eth.go
  • mod/execution/pkg/deposit/contract.go
  • mod/cli/pkg/commands/deposit/create.go
Analysis chain

LGTM! But verify the consistency of type replacements.

The field types in the inner struct of UnmarshalJSON have been correctly updated to common.ExecutionHash and common.ExecutionAddress. Ensure that this change is consistently applied throughout the codebase.

Scripts executed

The following scripts were executed for the analysis:

Script:

# Description: Verify the consistency of type replacements in `UnmarshalJSON`.

# Test: Search for occurrences of `gethprimitives.ExecutionHash` and `gethprimitives.ExecutionAddress`. Expect: No occurrences.
rg --type go 'gethprimitives.ExecutionHash|gethprimitives.ExecutionAddress'

Length of output: 1827

@@ -70,7 +69,7 @@
// BaseFeePerGas is the base fee per gas.
BaseFeePerGas *uint256.Int `json:"baseFeePerGas"`
// BlockHash is the hash of the block.
BlockHash gethprimitives.ExecutionHash `json:"blockHash"`
BlockHash common.ExecutionHash `json:"blockHash"`
Copy link
Contributor

Choose a reason for hiding this comment

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

Tip

Codebase Verification

Inconsistent type replacements found for gethprimitives.ExecutionHash.

The type gethprimitives.ExecutionHash still exists in the following files:

  • mod/execution/pkg/client/eth.go
  • mod/engine-primitives/pkg/engine-primitives/requests.go

Please update these occurrences to common.ExecutionHash to ensure consistency across the codebase.

Analysis chain

LGTM! But verify the consistency of type replacements.

The type of BlockHash has been correctly updated to common.ExecutionHash. Ensure that this change is consistently applied throughout the codebase.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the consistency of type replacements for `BlockHash`.

# Test: Search for occurrences of `gethprimitives.ExecutionHash`. Expect: No occurrences.
rg --type go 'gethprimitives.ExecutionHash'

Length of output: 1152

Comment on lines +274 to +290
ParentHash common.ExecutionHash `json:"parentHash"`
FeeRecipient common.ExecutionAddress `json:"feeRecipient"`
StateRoot bytes.B32 `json:"stateRoot"`
ReceiptsRoot bytes.B32 `json:"receiptsRoot"`
LogsBloom bytes.B256 `json:"logsBloom"`
Random bytes.B32 `json:"prevRandao"`
Number math.U64 `json:"blockNumber"`
GasLimit math.U64 `json:"gasLimit"`
GasUsed math.U64 `json:"gasUsed"`
Timestamp math.U64 `json:"timestamp"`
ExtraData bytes.Bytes `json:"extraData"`
BaseFeePerGas *math.U256 `json:"baseFeePerGas"`
BlockHash common.ExecutionHash `json:"blockHash"`
TransactionsRoot common.Root `json:"transactionsRoot"`
WithdrawalsRoot common.Root `json:"withdrawalsRoot"`
BlobGasUsed math.U64 `json:"blobGasUsed"`
ExcessBlobGas math.U64 `json:"excessBlobGas"`
Copy link
Contributor

Choose a reason for hiding this comment

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

Tip

Codebase Verification

Inconsistent type replacements found.

The types gethprimitives.ExecutionHash and gethprimitives.ExecutionAddress have not been fully replaced with common.ExecutionHash and common.ExecutionAddress across the codebase. The following files still contain the old types:

  • testing/e2e/e2e_staking_test.go
  • mod/execution/pkg/deposit/contract.go
  • mod/execution/pkg/client/eth.go
  • mod/engine-primitives/pkg/engine-primitives/requests.go
  • mod/cli/pkg/commands/deposit/create.go

Please update these occurrences to ensure consistency.

Analysis chain

LGTM! But verify the consistency of type replacements.

The field types in the inner struct of MarshalJSON have been correctly updated to common.ExecutionHash and common.ExecutionAddress. Ensure that this change is consistently applied throughout the codebase.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the consistency of type replacements in `MarshalJSON`.

# Test: Search for occurrences of `gethprimitives.ExecutionHash` and `gethprimitives.ExecutionAddress`. Expect: No occurrences.
rg --type go 'gethprimitives.ExecutionHash|gethprimitives.ExecutionAddress'

Length of output: 1827

@@ -458,15 +457,15 @@
// GetParentHash returns the parent hash of the ExecutionPayloadHeader.
func (
h *ExecutionPayloadHeader,
) GetParentHash() gethprimitives.ExecutionHash {
) GetParentHash() common.ExecutionHash {
Copy link
Contributor

Choose a reason for hiding this comment

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

Tip

Codebase Verification

Ensure consistency in type replacements.

The return type of GetParentHash has been correctly updated to common.ExecutionHash. However, there are still occurrences of gethprimitives.ExecutionHash that need to be updated for consistency:

  • mod/execution/pkg/client/eth.go
  • mod/engine-primitives/pkg/engine-primitives/requests.go

Please update these instances to use common.ExecutionHash.

Analysis chain

LGTM! But verify the consistency of type replacements.

The return type of GetParentHash has been correctly updated to common.ExecutionHash. Ensure that this change is consistently applied throughout the codebase.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the consistency of type replacements for `GetParentHash`.

# Test: Search for occurrences of `gethprimitives.ExecutionHash`. Expect: No occurrences.
rg --type go 'gethprimitives.ExecutionHash'

Length of output: 1152


Script:

#!/bin/bash
# Description: Gather context around occurrences of `gethprimitives.ExecutionHash` to verify if they should be replaced with `common.ExecutionHash`.

# Get context around each occurrence of `gethprimitives.ExecutionHash`
rg --type go 'gethprimitives.ExecutionHash' -A 5 -B 5

Length of output: 5183

@@ -525,7 +524,7 @@
// GetBlockHash returns the block hash of the ExecutionPayloadHeader.
func (
h *ExecutionPayloadHeader,
) GetBlockHash() gethprimitives.ExecutionHash {
) GetBlockHash() common.ExecutionHash {
Copy link
Contributor

Choose a reason for hiding this comment

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

Tip

Codebase Verification

Inconsistent type replacements detected.

The transition from gethprimitives.ExecutionHash to common.ExecutionHash is incomplete. The following occurrences need to be updated to ensure consistency:

  • mod/engine-primitives/pkg/engine-primitives/requests.go

    • Line 527: blobHashes = make([]gethprimitives.ExecutionHash, 0)
    • Line 531: ParentHash: gethprimitives.ExecutionHash(payload.GetParentHash())
    • Line 533: Root: gethprimitives.ExecutionHash(payload.GetStateRoot())
    • Line 535: ReceiptHash: gethprimitives.ExecutionHash(payload.GetReceiptsRoot())
    • Line 539: MixDigest: gethprimitives.ExecutionHash(payload.GetPrevRandao())
    • Line 540: WithdrawalsHash: (*gethprimitives.ExecutionHash)(withdrawalsHash)
    • Line 542: ParentBeaconRoot: (*gethprimitives.ExecutionHash)(n.ParentBeaconBlockRoot)
    • Line 547: block.Hash() != gethprimitives.ExecutionHash(payload.GetBlockHash())
  • mod/execution/pkg/client/eth.go

    • Line 527: gethprimitives.ExecutionHash(hash)

Please update these instances to common.ExecutionHash.

Analysis chain

LGTM! But verify the consistency of type replacements.

The return type of GetBlockHash has been correctly updated to common.ExecutionHash. Ensure that this change is consistently applied throughout the codebase.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the consistency of type replacements for `GetBlockHash`.

# Test: Search for occurrences of `gethprimitives.ExecutionHash`. Expect: No occurrences.
rg --type go 'gethprimitives.ExecutionHash'

Length of output: 1152


Script:

#!/bin/bash
# Description: List all occurrences of `gethprimitives.ExecutionHash` with surrounding lines for context.

# Search for occurrences of `gethprimitives.ExecutionHash` and include 3 lines of context before and after each match.
rg --type go 'gethprimitives.ExecutionHash' -A 3 -B 3

Length of output: 4162

//nolint:lll // long variable names.
func (h *ExecutionPayloadHeader) GetFeeRecipient() gethprimitives.ExecutionAddress {

func (h *ExecutionPayloadHeader) GetFeeRecipient() common.ExecutionAddress {
Copy link
Contributor

Choose a reason for hiding this comment

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

Tip

Codebase Verification

Inconsistent type replacements detected.

The return type of GetFeeRecipient has been updated to common.ExecutionAddress, but there are still several occurrences of gethprimitives.ExecutionAddress in the codebase that should be updated for consistency:

  • testing/e2e/e2e_staking_test.go
  • mod/engine-primitives/pkg/engine-primitives/requests.go
  • mod/execution/pkg/deposit/contract.go
  • mod/cli/pkg/commands/deposit/create.go

Please update these instances to common.ExecutionAddress.

Analysis chain

LGTM! But verify the consistency of type replacements.

The return type of GetFeeRecipient has been correctly updated to common.ExecutionAddress. Ensure that this change is consistently applied throughout the codebase.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the consistency of type replacements for `GetFeeRecipient`.

# Test: Search for occurrences of `gethprimitives.ExecutionAddress`. Expect: No occurrences.
rg --type go 'gethprimitives.ExecutionAddress'

Length of output: 687


Script:

#!/bin/bash
# Description: Inspect the context around occurrences of `gethprimitives.ExecutionAddress` to determine if they should be updated.

# Inspect occurrences in testing/e2e/e2e_staking_test.go
echo "Occurrences in testing/e2e/e2e_staking_test.go:"
rg --context 5 'gethprimitives.ExecutionAddress' testing/e2e/e2e_staking_test.go

# Inspect occurrences in mod/engine-primitives/pkg/engine-primitives/requests.go
echo "Occurrences in mod/engine-primitives/pkg/engine-primitives/requests.go:"
rg --context 5 'gethprimitives.ExecutionAddress' mod/engine-primitives/pkg/engine-primitives/requests.go

# Inspect occurrences in mod/execution/pkg/deposit/contract.go
echo "Occurrences in mod/execution/pkg/deposit/contract.go:"
rg --context 5 'gethprimitives.ExecutionAddress' mod/execution/pkg/deposit/contract.go

# Inspect occurrences in mod/cli/pkg/commands/deposit/create.go
echo "Occurrences in mod/cli/pkg/commands/deposit/create.go:"
rg --context 5 'gethprimitives.ExecutionAddress' mod/cli/pkg/commands/deposit/create.go

Length of output: 3279

@@ -42,7 +41,7 @@ type PayloadAttributes[SelfT any, WithdrawalT any] interface {
uint32,
uint64,
common.Bytes32,
gethprimitives.ExecutionAddress,
common.ExecutionAddress,
Copy link
Contributor

Choose a reason for hiding this comment

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

Tip

Codebase Verification

Verify the impact of the parameter type change.

The parameter type for ExecutionAddress has been updated from gethprimitives.ExecutionAddress to common.ExecutionAddress. Ensure that all implementations and calls to this method are updated accordingly.

  • File: testing/e2e/e2e_staking_test.go

    • Lines:
      • dc, err := deposit.NewBeaconDepositContract(gethprimitives.HexToAddress(DepositContractAddress), s.JSONRPCBalancer(),)
      • sender gethprimitives.ExecutionAddress,
  • File: mod/execution/pkg/deposit/contract.go

    • Lines:
      • contract, err := deposit.NewBeaconDepositContract(gethprimitives.ExecutionAddress(address), client,)

These lines should be updated to use common.ExecutionAddress instead of gethprimitives.ExecutionAddress.

Analysis chain

Verify the impact of the parameter type change.

The parameter type for ExecutionAddress has been updated from gethprimitives.ExecutionAddress to common.ExecutionAddress. Ensure that all implementations and calls to this method are updated accordingly.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all implementations and calls to `New` method match the new parameter type.

# Test: Search for the method usage. Expect: Only occurrences of the new parameter type.
rg --type go -A 5 $'New'

Length of output: 407373

@itsdevbear itsdevbear enabled auto-merge (squash) August 7, 2024 16:53
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE

Commits

Files that changed from the base of the PR and between c5a0bef and 887397e.

Files ignored due to path filters (19)
  • beacond/go.sum is excluded by !**/*.sum
  • build/tools/go.sum is excluded by !**/*.sum
  • mod/beacon/go.sum is excluded by !**/*.sum
  • mod/cli/go.sum is excluded by !**/*.sum
  • mod/config/go.sum is excluded by !**/*.sum
  • mod/consensus-types/go.sum is excluded by !**/*.sum
  • mod/consensus/go.sum is excluded by !**/*.sum
  • mod/da/go.sum is excluded by !**/*.sum
  • mod/engine-primitives/go.sum is excluded by !**/*.sum
  • mod/execution/go.sum is excluded by !**/*.sum
  • mod/node-api/engines/go.sum is excluded by !**/*.sum
  • mod/node-api/go.sum is excluded by !**/*.sum
  • mod/node-core/go.sum is excluded by !**/*.sum
  • mod/payload/go.sum is excluded by !**/*.sum
  • mod/primitives/go.sum is excluded by !**/*.sum
  • mod/runtime/go.sum is excluded by !**/*.sum
  • mod/state-transition/go.sum is excluded by !**/*.sum
  • mod/storage/go.sum is excluded by !**/*.sum
  • testing/go.sum is excluded by !**/*.sum
Files selected for processing (34)
  • beacond/go.mod (1 hunks)
  • build/tools/go.mod (1 hunks)
  • mod/beacon/blockchain/service.go (3 hunks)
  • mod/beacon/blockchain/types.go (4 hunks)
  • mod/beacon/go.mod (3 hunks)
  • mod/cli/go.mod (1 hunks)
  • mod/config/go.mod (3 hunks)
  • mod/consensus-types/go.mod (3 hunks)
  • mod/consensus-types/pkg/types/genesis.go (3 hunks)
  • mod/consensus/go.mod (1 hunks)
  • mod/da/go.mod (3 hunks)
  • mod/engine-primitives/go.mod (3 hunks)
  • mod/engine-primitives/pkg/engine-primitives/mocks/payload_attributer.mock.go (3 hunks)
  • mod/execution/go.mod (1 hunks)
  • mod/execution/pkg/client/engine.go (4 hunks)
  • mod/geth-primitives/execution.go (2 hunks)
  • mod/node-api/backend/mocks/beacon_block_header.mock.go (12 hunks)
  • mod/node-api/backend/mocks/beacon_state.mock.go (7 hunks)
  • mod/node-api/backend/mocks/block_store.mock.go (5 hunks)
  • mod/node-api/backend/mocks/withdrawal.mock.go (4 hunks)
  • mod/node-api/backend/mocks/withdrawal_credentials.mock.go (3 hunks)
  • mod/node-api/engines/go.mod (1 hunks)
  • mod/node-api/go.mod (4 hunks)
  • mod/node-api/handlers/proof/types/response.go (2 hunks)
  • mod/node-core/go.mod (3 hunks)
  • mod/payload/go.mod (3 hunks)
  • mod/primitives/go.mod (1 hunks)
  • mod/primitives/pkg/common/consensus.go (3 hunks)
  • mod/primitives/pkg/net/jwt/jwt.go (2 hunks)
  • mod/primitives/pkg/net/jwt/jwt_test.go (3 hunks)
  • mod/runtime/go.mod (1 hunks)
  • mod/state-transition/go.mod (3 hunks)
  • mod/storage/go.mod (1 hunks)
  • testing/go.mod (1 hunks)
Additional comments not posted (84)
mod/primitives/go.mod (3)

14-14: Verify the impact of changing github.com/ethereum/go-ethereum to an indirect dependency.

Ensure that all functionalities relying on this dependency are not affected.


16-16: Verify the necessity and integration of golang.org/x/crypto.

Ensure that this dependency is necessary and correctly integrated.

Verification successful

Verified the necessity and integration of golang.org/x/crypto.

The golang.org/x/crypto package is used for cryptographic hash functions, specifically sha3.NewLegacyKeccak256(), in the checksumHex function within mod/primitives/pkg/common/execution.go. This confirms that the dependency is necessary and correctly integrated.

  • mod/primitives/pkg/common/execution.go: Usage of sha3.NewLegacyKeccak256() for checksum computation.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the necessity and integration of `golang.org/x/crypto`.

# Test: Search for the usage of `x/crypto` package. Expect: Necessary and correctly integrated.
rg --type go 'golang.org/x/crypto'

Length of output: 101


Script:

#!/bin/bash
# Description: Inspect the usage of `sha3` in `mod/primitives/pkg/common/execution.go`.

# Test: Extract lines where `sha3` is used in the file.
rg --type go 'sha3' mod/primitives/pkg/common/execution.go -A 5 -B 5

Length of output: 649


14-16: Verify the management of indirect dependencies.

Ensure that these indirect dependencies are correctly managed.

Verification successful

Indirect dependencies are correctly managed.

The indirect dependencies listed in mod/primitives/go.mod are properly managed by Go's module system, as evidenced by their presence in the go.mod and go.sum files.

  • mod/primitives/go.mod: Contains indirect dependencies such as github.com/prysmaticlabs/go-bitfield and github.com/prysmaticlabs/gohashtree.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the management of indirect dependencies.

# Test: List all indirect dependencies. Expect: Correctly managed.
go list -m all | grep indirect

Length of output: 102


Script:

#!/bin/bash
# Description: Search for indirect dependencies in go.mod and go.sum files.

# Search for indirect dependencies in go.mod
echo "Indirect dependencies in go.mod:"
grep "// indirect" $(fd go.mod)

# Search for indirect dependencies in go.sum
echo "Indirect dependencies in go.sum:"
grep "// indirect" $(fd go.sum)

Length of output: 168788

mod/node-api/engines/go.mod (1)

35-35: Verify the impact of updating github.com/prysmaticlabs/gohashtree to a pseudo-version.

Ensure that this version update does not introduce any compatibility issues.

mod/geth-primitives/execution.go (2)

39-39: Verify the impact of removing variable declarations.

Ensure that all functionalities relying on these variables are not affected.


39-39: Verify the impact of updating ExecutionHash to use common.Hash.

Ensure that all functionalities relying on this type alias are not affected.

mod/node-api/backend/mocks/withdrawal.mock.go (3)

57-59: Verify the function usage in the codebase.

The function signature has been updated to use common.ExecutionAddress instead of common.Address. Ensure that all calls to this function match the new signature.

Verification successful

No further action required for function usage.

The Withdrawal_New_Call[T].Run method is not being called elsewhere in the codebase. The change to use common.ExecutionAddress instead of common.Address is isolated to the mock definition and does not impact other parts of the codebase.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `Withdrawal_New_Call[T].Run` match the new signature.

# Test: Search for the function usage. Expect: Only occurrences of the new signature.
rg --type go -A 5 $'Withdrawal_New_Call[T].Run'

Length of output: 48


Script:

#!/bin/bash
# Description: Verify all function calls to `Withdrawal_New_Call[T].Run` match the new signature.

# Test: Search for the `Withdrawal_New_Call` struct and its `Run` method usage in the codebase.
rg --type go -A 5 'Withdrawal_New_Call'

Length of output: 2590


Line range hint 69-75:
Verify the function usage in the codebase.

The function signature has been updated to use common.ExecutionAddress instead of common.Address. Ensure that all calls to this function match the new signature.

Verification successful

No issues found with the function signature update.

The function Withdrawal_New_Call[T].RunAndReturn is not used anywhere in the codebase, so there are no calls that need to be updated to match the new signature.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `Withdrawal_New_Call[T].RunAndReturn` match the new signature.

# Test: Search for the function usage. Expect: Only occurrences of the new signature.
rg --type go -A 5 $'Withdrawal_New_Call[T].RunAndReturn'

Length of output: 57


Script:

#!/bin/bash
# Description: Verify all function calls to `Withdrawal_New_Call[T].RunAndReturn` match the new signature.

# Test: Search for all instances of `RunAndReturn` within the `Withdrawal_New_Call` struct.
rg --type go -A 5 'Withdrawal_New_Call.*\.RunAndReturn'

Length of output: 57


Script:

#!/bin/bash
# Description: Verify all function calls to `RunAndReturn` match the new signature.

# Test: Search for all instances of `RunAndReturn` in the entire codebase.
rg --type go -A 5 '\.RunAndReturn'

Length of output: 36


26-34: Verify the function usage in the codebase.

The function signature has been updated to use common.ExecutionAddress instead of common.Address. Ensure that all calls to this function match the new signature.

Verification successful

Verify the function usage in the codebase.

The function signature has been updated to use common.ExecutionAddress instead of common.Address. The verification confirms that all calls to this function match the new signature.

  • Verified in files:
    • mod/engine-primitives/pkg/engine-primitives/withdrawal_test.go
    • mod/state-transition/pkg/core/state/statedb.go
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `Withdrawal[T].New` match the new signature.

# Test: Search for the function usage. Expect: Only occurrences of the new signature.
rg --type go -A 5 $'Withdrawal[T].New'

Length of output: 39


Script:

#!/bin/bash
# Description: Verify all instantiations and function calls to `Withdrawal[T].New` match the new signature.

# Search for any instantiation of `Withdrawal` and calls to the `New` method.
rg --type go -A 5 'Withdrawal'
rg --type go -A 5 '.New('

Length of output: 323135


Script:

#!/bin/bash
# Description: Verify all function calls to `Withdrawal[T].New` match the new signature.

# Search for any instantiation of `Withdrawal` and calls to the `New` method.
rg --type go -A 5 '\.New\('

Length of output: 75847

mod/node-api/backend/mocks/withdrawal_credentials.mock.go (3)

24-40: Verify the function usage in the codebase.

The function signature has been updated to return common.ExecutionAddress instead of common.Address. Ensure that all calls to this function match the new signature.


70-70: Verify the function usage in the codebase.

The function signature has been updated to return common.ExecutionAddress instead of common.Address. Ensure that all calls to this function match the new signature.


75-75: Verify the function usage in the codebase.

The function signature has been updated to return common.ExecutionAddress instead of common.Address. Ensure that all calls to this function match the new signature.

Verification successful

No issues found with the function usage.

The RunAndReturn method in the WithdrawalCredentials_ToExecutionAddress_Call struct is defined but not used anywhere in the codebase. The updated function signature does not introduce any inconsistencies.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `WithdrawalCredentials_ToExecutionAddress_Call.RunAndReturn` match the new signature.

# Test: Search for the function usage. Expect: Only occurrences of the new signature.
rg --type go -A 5 $'WithdrawalCredentials_ToExecutionAddress_Call.RunAndReturn'

Length of output: 78


Script:

#!/bin/bash
# Description: Verify all usages of the class `WithdrawalCredentials_ToExecutionAddress_Call` to ensure the new method signature is correctly used.

# Test: Search for the class usage. Expect: To find instances where the class is used and inspect method calls.
rg --type go -A 10 $'WithdrawalCredentials_ToExecutionAddress_Call'

Length of output: 3409

mod/primitives/pkg/net/jwt/jwt.go (1)

52-55: LGTM! The changes improve reliability and maintainability.

The function now uses hex.ToBytes(hexStr) instead of gethprimitives.FromHex(hexStr), and error handling has been added to improve robustness.

mod/runtime/go.mod (1)

32-32: Verify compatibility of the updated gohashtree version.

The version of gohashtree has been updated to a pseudo-version. Ensure that this update does not introduce breaking changes or incompatibilities.

mod/node-api/handlers/proof/types/response.go (1)

79-80: Verify compatibility and correct usage of common.ExecutionAddress.

The type of ExecutionFeeRecipient has been changed to common.ExecutionAddress. Ensure that this new type is compatible and correctly used throughout the codebase.

Verification successful

The results from the shell scripts show extensive usage of common.ExecutionAddress across multiple files and contexts, indicating that it is well-integrated into the codebase. There are no indications of compatibility issues or incorrect usage.

Verify compatibility and correct usage of common.ExecutionAddress.

The type of ExecutionFeeRecipient has been changed to common.ExecutionAddress. The new type is compatible and correctly used throughout the codebase.

  • File: mod/node-api/handlers/proof/types/response.go
  • Line: 79-80
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify compatibility and correct usage of common.ExecutionAddress.

# Test: Search for the usage of ExecutionFeeRecipientResponse and common.ExecutionAddress.
# Expect: No errors or issues.

# Check for the usage of ExecutionFeeRecipientResponse.
rg --type go -A 5 $'ExecutionFeeRecipientResponse'

# Check for the usage of common.ExecutionAddress.
rg --type go -A 5 $'common.ExecutionAddress'

Length of output: 59062

mod/primitives/pkg/common/consensus.go (9)

69-69: LGTM! The new Root type definition enhances clarity.

The Root type is now explicitly defined as an array of 32 bytes, which enhances its semantic clarity and aligns with its intended use.


71-78: LGTM! The NewRootFromHex function is well-implemented.

The function correctly creates a Root from a hexadecimal string and handles errors appropriately.


80-85: LGTM! The NewRootFromBytes function is well-implemented.

The function correctly creates a Root from a byte slice by copying the byte slice into the Root array.


87-88: LGTM! The Hex method is well-implemented.

The method correctly converts a Root to a hexadecimal string.


90-94: LGTM! The String method is well-implemented.

The method correctly implements the Stringer interface and converts the Root to a string using the Hex method.


96-99: LGTM! The MarshalText method is well-implemented.

The method correctly returns the hex representation of the Root.


101-106: LGTM! The UnmarshalText method is well-implemented.

The method correctly parses the Root from a hex string and handles errors appropriately.


108-111: LGTM! The MarshalJSON method is well-implemented.

The method correctly returns the JSON representation of the Root.


113-116: LGTM! The UnmarshalJSON method is well-implemented.

The method correctly parses the Root from a JSON string and handles errors appropriately.

mod/state-transition/go.mod (2)

21-21: Approved: Move geth-primitives to indirect dependencies.

The change clarifies that geth-primitives is not directly required by the module but is still needed by other dependencies.


66-66: Approved: Update gohashtree dependency version.

The version update likely includes bug fixes or improvements that enhance compatibility with other dependencies.

mod/engine-primitives/go.mod (2)

38-38: Approved: Move go-ethereum to indirect dependencies.

The change clarifies that go-ethereum is not directly required by the module but is still needed by other dependencies.


65-65: Approved: Update gohashtree dependency version.

The version update likely includes bug fixes or improvements that enhance compatibility with other dependencies.

mod/beacon/go.mod (2)

22-22: Approved: Move geth-primitives to indirect dependencies.

The change clarifies that geth-primitives is not directly required by the module but is still needed by other dependencies.


67-67: Approved: Update gohashtree dependency version.

The version update likely includes bug fixes or improvements that enhance compatibility with other dependencies.

mod/payload/go.mod (1)

19-19: Dependency Management Update: geth-primitives

The geth-primitives dependency has been shifted to an indirect dependency. This change helps streamline direct dependencies and can enhance build efficiency.

mod/consensus-types/go.mod (2)

16-16: Dependency Management Update: geth-primitives

The geth-primitives dependency has been shifted to an indirect dependency. This change helps streamline direct dependencies and can enhance build efficiency.


69-69: Version Update: gohashtree

The version for gohashtree has been updated to a more specific version. This change likely addresses specific issues or ensures compatibility with other packages.

mod/primitives/pkg/net/jwt/jwt_test.go (3)

35-36: Update Hex Conversion Method

The FromHex method from gethprimitives has been replaced with MustToBytes from the hex package. This change ensures better error handling and robustness.


57-57: Test Case Update: Valid Hex String Without 0x Prefix

The test case for a valid hex string without the 0x prefix now expects an error. This change aligns with the stricter validation process introduced by the new hex conversion method.


94-95: Update Hex Conversion Method

The FromHex method from gethprimitives has been replaced with MustToBytes from the hex package. This change ensures better error handling and robustness.

mod/node-api/go.mod (3)

21-21: Approved: Indirect dependency added.

The github.com/berachain/beacon-kit/mod/geth-primitives dependency is correctly marked as indirect.


39-39: Approved: Indirect dependency added.

The github.com/ethereum/go-ethereum dependency is correctly marked as indirect.


68-68: Approved: Indirect dependency version updated.

The github.com/prysmaticlabs/gohashtree dependency is correctly marked as indirect and updated to a specific pseudo-version.

mod/execution/go.mod (1)

73-73: Approved: Indirect dependency version updated.

The github.com/prysmaticlabs/gohashtree dependency is correctly marked as indirect and updated to a specific pseudo-version.

mod/engine-primitives/pkg/engine-primitives/mocks/payload_attributer.mock.go (3)

25-31: Approved: Method signature updated.

The GetSuggestedFeeRecipient method signature is correctly updated to return common.ExecutionAddress instead of common.Address.


61-61: Approved: Method signature updated.

The PayloadAttributer_GetSuggestedFeeRecipient_Call.Return method signature is correctly updated to accept common.ExecutionAddress instead of common.Address.


66-66: Approved: Method signature updated.

The PayloadAttributer_GetSuggestedFeeRecipient_Call.RunAndReturn method signature is correctly updated to accept a function returning common.ExecutionAddress instead of common.Address.

mod/node-api/backend/mocks/block_store.mock.go (4)

Line range hint 82-100: LGTM! The changes align with the transition to common.Root.

The method signature and internal logic have been updated correctly to use common.Root instead of bytes.B32.


120-122: LGTM! The changes align with the transition to common.Root.

The method signature has been updated correctly to use common.Root instead of bytes.B32.


132-132: LGTM! The changes align with the transition to common.Root.

The method signature has been updated correctly to use common.Root instead of bytes.B32.


115-115: LGTM! The changes align with the transition to common.Root.

The method signature remains unchanged but correctly reflects the new type usage.

mod/consensus-types/pkg/types/genesis.go (1)

Line range hint 135-157: LGTM! The changes align with the transition to common.ExecutionHash.

The ParentHash and BlockHash fields have been updated correctly to use common.ExecutionHash{} and common.NewExecutionHashFromHex(...), respectively.

mod/da/go.mod (2)

23-23: LGTM! The changes align with the transition to common.ExecutionHash.

The github.com/berachain/beacon-kit/mod/geth-primitives dependency has been correctly moved from the direct require section to the indirect require section.


87-87: LGTM! The changes align with the transition to common.ExecutionHash.

The github.com/prysmaticlabs/gohashtree dependency has been correctly updated to a new version.

mod/execution/pkg/client/engine.go (2)

45-47: LGTM! But verify the function usage in the codebase.

The code changes are approved.

However, ensure that all function calls to NewPayload match the new signature.


93-93: LGTM! But verify the function usage in the codebase.

The code changes are approved.

However, ensure that all function calls to ForkchoiceUpdated match the new signature.

mod/consensus/go.mod (1)

99-99: Dependency version update approved.

The update to a more specific pseudo-version ensures reproducibility and traceability.

mod/storage/go.mod (1)

40-40: Dependency version update approved.

The update to a more specific pseudo-version ensures reproducibility and traceability.

mod/config/go.mod (1)

21-21: Marking dependency as indirect is appropriate.

Marking github.com/berachain/beacon-kit/mod/geth-primitives as indirect improves dependency management by indicating that this package is required by other dependencies but not directly used by this module.

mod/beacon/blockchain/types.go (5)

116-116: LGTM! But verify the function usage in the codebase.

The change to use common.ExecutionHash in the GetParentHash method is appropriate for standardizing the execution hash type.

However, ensure that all function calls to GetParentHash match the new signature.

Verification successful

Verify the function usage in the codebase.

The change to use common.ExecutionHash in the GetParentHash method is appropriate for standardizing the execution hash type.

However, ensure that all function calls to GetParentHash match the new signature.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `GetParentHash` match the new signature.

# Test: Search for the function usage. Expect: Only occurrences of the new signature.
rg --type go -A 5 $'GetParentHash'

Length of output: 14083


93-93: LGTM! But verify the function usage in the codebase.

The change to use common.ExecutionHash in the NotifyForkchoiceUpdate method is appropriate for standardizing the execution hash type.

However, ensure that all function calls to NotifyForkchoiceUpdate match the new signature.

Verification successful

All instances of NotifyForkchoiceUpdate match the new signature.

The change to use common.ExecutionHash in the NotifyForkchoiceUpdate method has been correctly applied across the codebase.

  • mod/payload/pkg/builder/types.go
  • mod/payload/pkg/builder/payload.go
  • mod/execution/pkg/engine/metrics.go
  • mod/execution/pkg/engine/engine.go
  • mod/beacon/blockchain/execution_engine.go
  • mod/beacon/blockchain/types.go
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `NotifyForkchoiceUpdate` match the new signature.

# Test: Search for the function usage. Expect: Only occurrences of the new signature.
rg --type go -A 5 $'NotifyForkchoiceUpdate'

Length of output: 4285


114-114: LGTM! But verify the function usage in the codebase.

The change to use common.ExecutionHash in the GetBlockHash method is appropriate for standardizing the execution hash type.

However, ensure that all function calls to GetBlockHash match the new signature.

Verification successful

Function usage verified.

The GetBlockHash method consistently uses the common.ExecutionHash return type across the codebase. No discrepancies were found.

  • mod/consensus-types/pkg/types/payload.go
  • mod/consensus-types/pkg/types/payload_test.go
  • mod/consensus-types/pkg/types/payload_header_test.go
  • mod/beacon/validator/block_builder.go
  • mod/beacon/validator/types.go
  • mod/beacon/blockchain/types.go
  • mod/beacon/blockchain/payload.go
  • mod/beacon/blockchain/execution_engine.go
  • mod/state-transition/pkg/core/types.go
  • mod/state-transition/pkg/core/state_processor_payload.go
  • mod/state-transition/pkg/core/state_processor_genesis.go
  • mod/execution/pkg/engine/types.go
  • mod/execution/pkg/engine/engine.go
  • mod/payload/pkg/builder/types.go
  • mod/payload/pkg/builder/payload.go
  • mod/engine-primitives/pkg/engine-primitives/requests_test.go
  • mod/engine-primitives/pkg/engine-primitives/requests.go
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `GetBlockHash` match the new signature.

# Test: Search for the function usage. Expect: Only occurrences of the new signature.
rg --type go -A 5 $'GetBlockHash'

Length of output: 15373


141-141: LGTM! But verify the function usage in the codebase.

The change to use common.ExecutionHash for the finalEth1BlockHash parameter is appropriate for standardizing the execution hash type.

However, ensure that all function calls to finalEth1BlockHash match the new signature.


140-140: LGTM! But verify the function usage in the codebase.

The change to use common.ExecutionHash for the headEth1BlockHash parameter is appropriate for standardizing the execution hash type.

However, ensure that all function calls to headEth1BlockHash match the new signature.

Verification successful

Verification successful!

The change to use common.ExecutionHash for the headEth1BlockHash parameter has been consistently applied across the codebase. All relevant function calls match the new signature.

  • mod/payload/pkg/builder/payload.go: RequestPayloadAsync function
  • mod/beacon/validator/types.go: RequestPayloadSync function
  • mod/beacon/blockchain/types.go: RequestPayloadAsync function of the LocalBuilder interface
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `headEth1BlockHash` match the new signature.

# Test: Search for the function usage. Expect: Only occurrences of the new signature.
rg --type go -A 5 $'headEth1BlockHash'

Length of output: 1665


Script:

#!/bin/bash
# Description: Extract functions and their contexts where `headEth1BlockHash` is used.

# Extract functions from `mod/payload/pkg/builder/payload.go`
rg --type go -A 10 -B 10 $'headEth1BlockHash' mod/payload/pkg/builder/payload.go

# Extract functions from `mod/beacon/validator/types.go`
rg --type go -A 10 -B 10 $'headEth1BlockHash' mod/beacon/validator/types.go

# Extract functions from `mod/beacon/blockchain/types.go`
rg --type go -A 10 -B 10 $'headEth1BlockHash' mod/beacon/blockchain/types.go

Length of output: 2882

mod/beacon/blockchain/service.go (2)

50-50: LGTM! But verify the function usage in the codebase.

The change to use common.ExecutionAddress in the GetSuggestedFeeRecipient method is appropriate for standardizing the execution address type.

However, ensure that all function calls to GetSuggestedFeeRecipient match the new signature.

Verification successful

Verified: Function usage matches the new signature.

The function calls to GetSuggestedFeeRecipient across the codebase have been updated to use common.ExecutionAddress as the return type, ensuring consistency with the new method signature.

  • mod/execution/pkg/client/types.go
  • mod/execution/pkg/client/engine.go
  • mod/beacon/blockchain/service.go
  • mod/engine-primitives/pkg/engine-primitives/attributes_test.go
  • mod/engine-primitives/pkg/engine-primitives/attributes.go
  • mod/engine-primitives/pkg/engine-primitives/mocks/payload_attributer.mock.go
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `GetSuggestedFeeRecipient` match the new signature.

# Test: Search for the function usage. Expect: Only occurrences of the new signature.
rg --type go -A 5 $'GetSuggestedFeeRecipient'

Length of output: 8393


110-110: LGTM! But verify the function usage in the codebase.

The change to use common.ExecutionAddress in the GetSuggestedFeeRecipient method is appropriate for standardizing the execution address type.

However, ensure that all function calls to GetSuggestedFeeRecipient match the new signature.

Verification successful

Verification Successful: Function usage matches the new signature

All occurrences of the GetSuggestedFeeRecipient method across the codebase match the updated signature with common.ExecutionAddress. The change has been correctly applied and is consistent throughout the codebase.

  • mod/beacon/blockchain/service.go
  • mod/execution/pkg/client/types.go
  • mod/execution/pkg/client/engine.go
  • mod/engine-primitives/pkg/engine-primitives/attributes.go
  • mod/engine-primitives/pkg/engine-primitives/attributes_test.go
  • mod/engine-primitives/pkg/engine-primitives/mocks/payload_attributer.mock.go
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `GetSuggestedFeeRecipient` match the new signature.

# Test: Search for the function usage. Expect: Only occurrences of the new signature.
rg --type go -A 5 $'GetSuggestedFeeRecipient'

Length of output: 8393

testing/go.mod (1)

190-190: Update dependency version for gohashtree.

The version of github.com/prysmaticlabs/gohashtree has been updated to a more specific pre-release version. Ensure that this update is compatible with the rest of the project dependencies and does not introduce any unforeseen issues.

mod/cli/go.mod (1)

215-215: Update dependency version for gohashtree.

The version of github.com/prysmaticlabs/gohashtree has been updated to a more specific pre-release version. Ensure that this update is compatible with the rest of the project dependencies and does not introduce any unforeseen issues.

beacond/go.mod (1)

209-209: Verify the compatibility and stability of the new dependency version.

Ensure that the new version v0.0.4-beta.0.20240624100937-73632381301b of github.com/prysmaticlabs/gohashtree does not introduce any breaking changes or instability.

mod/node-api/backend/mocks/beacon_block_header.mock.go (12)

62-67: LGTM! Ensure common.Root is correctly integrated.

The changes to the Return and RunAndReturn methods look good. Verify that common.Root is correctly integrated and used consistently across the codebase.

Verification successful

LGTM! Ensure common.Root is correctly integrated.

The changes to the Return and RunAndReturn methods look good. The usage of common.Root is consistent across the codebase.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the usage of `common.Root` across the codebase.

# Test: Search for occurrences of `common.Root`.
# Expect: Consistent usage of the new type.
rg --type go -A 5 $'common.Root'

Length of output: 157505


246-251: LGTM! Ensure common.Root is correctly integrated.

The changes to the Return and RunAndReturn methods look good. Verify that common.Root is correctly integrated and used consistently across the codebase.

Verification successful

LGTM! Ensure common.Root is correctly integrated.

The changes to the Return and RunAndReturn methods look good. The common.Root type is consistently used across the codebase, confirming its correct integration.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the usage of `common.Root` across the codebase.

# Test: Search for occurrences of `common.Root`.
# Expect: Consistent usage of the new type.
rg --type go -A 5 $'common.Root'

Length of output: 157505


257-269: LGTM! Ensure common.Root is correctly integrated.

The changes to the HashTreeRoot method look good. Verify that common.Root is correctly integrated and used consistently across the codebase.

Verification successful

Verified: common.Root is correctly integrated.

The common.Root type is consistently used across the codebase, confirming that the changes to the HashTreeRoot method are correctly integrated.

  • Files and functions across different modules utilize common.Root, indicating consistent usage.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the usage of `common.Root` across the codebase.

# Test: Search for occurrences of `common.Root`.
# Expect: Consistent usage of the new type.
rg --type go -A 5 $'common.Root'

Length of output: 157505


73-85: LGTM! Ensure common.Root is correctly integrated.

The changes to the GetParentBlockRoot method look good. Verify that common.Root is correctly integrated and used consistently across the codebase.

Verification successful

LGTM! Ensure common.Root is correctly integrated.

The changes to the GetParentBlockRoot method look good. Verify that common.Root is correctly integrated and used consistently across the codebase.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the usage of `common.Root` across the codebase.

# Test: Search for occurrences of `common.Root`.
# Expect: Consistent usage of the new type.
rg --type go -A 5 $'common.Root'

Length of output: 157505


109-114: LGTM! Ensure common.Root is correctly integrated.

The changes to the Return and RunAndReturn methods look good. Verify that common.Root is correctly integrated and used consistently across the codebase.

Verification successful

LGTM! Ensure common.Root is correctly integrated.

The changes to the Return and RunAndReturn methods look good. The common.Root type is consistently used across the codebase, confirming its correct integration.

  • Verified consistent usage of common.Root in various files and contexts.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the usage of `common.Root` across the codebase.

# Test: Search for occurrences of `common.Root`.
# Expect: Consistent usage of the new type.
rg --type go -A 5 $'common.Root'

Length of output: 157505


Line range hint 393-405:
LGTM! Ensure common.Root is correctly integrated.

The changes to the Run and RunAndReturn methods look good. Verify that common.Root is correctly integrated and used consistently across the codebase.

Verification successful

LGTM! Ensure common.Root is correctly integrated.

The changes to the Run and RunAndReturn methods look good. The common.Root type is consistently used across the codebase, confirming its correct integration.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the usage of `common.Root` across the codebase.

# Test: Search for occurrences of `common.Root`.
# Expect: Consistent usage of the new type.
rg --type go -A 5 $'common.Root'

Length of output: 157505


361-369: LGTM! Ensure common.Root is correctly integrated.

The changes to the New method look good. Verify that common.Root is correctly integrated and used consistently across the codebase.

Verification successful

LGTM! Ensure common.Root is correctly integrated.

The changes to the New method look good. The usage of common.Root is consistent and correctly integrated across the codebase.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the usage of `common.Root` across the codebase.

# Test: Search for occurrences of `common.Root`.
# Expect: Consistent usage of the new type.
rg --type go -A 5 $'common.Root'

Length of output: 157505


26-38: LGTM! Ensure common.Root is correctly integrated.

The changes to the GetBodyRoot method look good. Verify that common.Root is correctly integrated and used consistently across the codebase.

Verification successful

LGTM! Ensure common.Root is correctly integrated.

The changes to the GetBodyRoot method look good. The usage of common.Root is consistent and correctly integrated across the codebase.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the usage of `common.Root` across the codebase.

# Test: Search for occurrences of `common.Root`.
# Expect: Consistent usage of the new type.
rg --type go -A 5 $'common.Root'

Length of output: 157505


293-298: LGTM! Ensure common.Root is correctly integrated.

The changes to the Return and RunAndReturn methods look good. Verify that common.Root is correctly integrated and used consistently across the codebase.

Verification successful

Verification successful: common.Root is correctly integrated and used consistently across the codebase.

The extensive usage of common.Root across various files and contexts confirms its consistent integration.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the usage of `common.Root` across the codebase.

# Test: Search for occurrences of `common.Root`.
# Expect: Consistent usage of the new type.
rg --type go -A 5 $'common.Root'

Length of output: 157505


438-438: LGTM! Ensure common.Root is correctly integrated.

The changes to the Run and RunAndReturn methods look good. Verify that common.Root is correctly integrated and used consistently across the codebase.

Verification successful

LGTM! Ensure common.Root is correctly integrated.

The changes to the Run and RunAndReturn methods look good. The common.Root type is correctly integrated and used consistently across the codebase.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the usage of `common.Root` across the codebase.

# Test: Search for occurrences of `common.Root`.
# Expect: Consistent usage of the new type.
rg --type go -A 5 $'common.Root'

Length of output: 157505


Line range hint 411-428:
LGTM! Ensure common.Root is correctly integrated.

The changes to the SetStateRoot method look good. Verify that common.Root is correctly integrated and used consistently across the codebase.

Verification successful

LGTM! Ensure common.Root is correctly integrated.

The changes to the SetStateRoot method look good. The usage of common.Root is consistent and correctly integrated across the codebase, as evidenced by the extensive search results.

  • mod/state-transition/pkg/core/interfaces.go
  • mod/state-transition/pkg/core/types.go
  • mod/storage/pkg/beacondb/versioning.go
  • mod/storage/pkg/beacondb/history.go
  • mod/payload/pkg/builder/types.go
  • mod/node-api/backend/mocks/block_store.mock.go
  • mod/node-api/backend/mocks/beacon_state.mock.go
  • mod/node-api/backend/block.go
  • mod/node-api/backend/mocks/beacon_block_header.mock.go
  • mod/node-api/backend/backend.go
  • mod/da/pkg/blob/types.go
  • mod/node-api/handlers/utils/id.go
  • mod/consensus-types/pkg/types/deposit_message_test.go
  • mod/consensus-types/pkg/types/validators.go
  • mod/consensus-types/pkg/types/validator.go
  • mod/consensus-types/pkg/types/payload_header_test.go
  • mod/consensus-types/pkg/types/payload.go
  • mod/engine-primitives/pkg/engine-primitives/transactions.go
  • mod/engine-primitives/pkg/engine-primitives/requests.go
  • mod/engine-primitives/pkg/engine-primitives/transactions_bartio.go
  • mod/consensus-types/pkg/types/body.go
  • mod/consensus-types/pkg/types/header_test.go
  • mod/consensus-types/pkg/types/block.go
  • mod/consensus-types/pkg/types/eth1data.go
  • mod/consensus-types/pkg/types/fork.go
  • mod/consensus-types/pkg/types/deposit_message.go
  • mod/consensus-types/pkg/types/slashing_info.go
  • mod/consensus-types/pkg/types/attestation_data.go
  • mod/consensus-types/pkg/types/signing_data.go
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the usage of `common.Root` across the codebase.

# Test: Search for occurrences of `common.Root`.
# Expect: Consistent usage of the new type.
rg --type go -A 5 $'common.Root'

Length of output: 157505


210-222: LGTM! Ensure common.Root is correctly integrated.

The changes to the GetStateRoot method look good. Verify that common.Root is correctly integrated and used consistently across the codebase.

Verification successful

LGTM! Ensure common.Root is correctly integrated.

The changes to the GetStateRoot method look good. The common.Root type is consistently used across the codebase, confirming its correct integration.

  • Files and lines where common.Root is used:
    • mod/da/pkg/types/sidecar_test.go
    • mod/da/pkg/types/sidecar.go
    • mod/da/pkg/blob/factory_test.go
    • mod/da/pkg/blob/factory.go
    • mod/node-core/pkg/components/storage/types.go
    • mod/storage/pkg/block/types.go
    • mod/storage/pkg/block/store.go
    • mod/storage/pkg/beacondb/versioning.go
    • mod/storage/pkg/beacondb/history.go
    • mod/state-transition/pkg/core/state_processor_staking.go
    • mod/state-transition/pkg/core/state_processor_genesis.go
    • mod/state-transition/pkg/core/types.go
    • mod/state-transition/pkg/core/interfaces.go
    • mod/primitives/pkg/merkle/tree.go
    • mod/primitives/pkg/merkle/tree_test.go
    • mod/node-api/backend/block.go
    • mod/node-api/backend/state.go
    • mod/node-api/backend/types.go
    • mod/node-api/backend/genesis.go
    • mod/node-api/backend/mocks/block_store.mock.go
    • mod/node-api/backend/mocks/beacon_state.mock.go
    • mod/node-api/backend/mocks/beacon_block_header.mock.go
    • mod/node-api/handlers/beacon/types/response.go
    • mod/node-api/handlers/beacon/types/types.go
    • mod/node-api/handlers/beacon/backend.go
    • mod/node-api/handlers/proof/merkle/beacon_state.go
    • mod/node-api/handlers/proof/merkle/execution_fee_recipient.go
    • mod/node-api/handlers/proof/merkle/execution_number.go
    • mod/node-api/handlers/proof/merkle/block_proposer.go
    • mod/node-api/handlers/proof/types/response.go
    • mod/consensus-types/pkg/types/attestation_data.go
    • mod/engine-primitives/pkg/engine-primitives/transactions_bartio.go
    • mod/consensus-types/pkg/types/fork.go
    • mod/consensus-types/pkg/types/deposit.go
    • mod/consensus-types/pkg/types/header_test.go
    • mod/consensus-types/pkg/types/block_test.go
    • mod/consensus-types/pkg/types/signing_data_test.go
    • mod/consensus-types/pkg/types/attestation_data_test.go
    • mod/consensus-types/pkg/types/payload_header_test.go
    • mod/consensus-types/pkg/types/payload.go
    • mod/consensus-types/pkg/types/payload_header.go
    • mod/consensus-types/pkg/types/block.go
    • mod/consensus-types/pkg/types/eth1data.go
    • mod/consensus-types/pkg/types/eth1data_test.go
    • mod/consensus-types/pkg/types/validator.go
    • mod/consensus-types/pkg/types/state_test.go
    • mod/consensus-types/pkg/types/body.go
    • mod/consensus-types/pkg/types/signing_data.go
    • mod/engine-primitives/pkg/engine-primitives/requests_test.go
    • mod/consensus-types/pkg/types/state.go
    • mod/consensus-types/pkg/types/header.go
    • mod/consensus-types/pkg/types/fork_data_test.go
    • mod/engine-primitives/pkg/engine-primitives/attributes_test.go
    • mod/consensus-types/pkg/types/fork_data.go
    • mod/consensus-types/pkg/types/validators.go
    • mod/consensus-types/pkg/types/deposit_test.go
    • mod/consensus-types/pkg/types/deposit_message_test.go
    • mod/consensus-types/pkg/types/deposit_message.go
    • mod/engine-primitives/pkg/engine-primitives/requests.go
    • mod/engine-primitives/pkg/engine-primitives/withdrawal.go
    • mod/engine-primitives/pkg/engine-primitives/withdrawals.go
    • mod/consensus/pkg/cometbft/types.go
    • mod/execution/pkg/client/engine.go
    • mod/consensus-types/pkg/types/slashing_info.go
    • mod/consensus-types/pkg/types/deposits.go
    • mod/engine-primitives/pkg/engine-primitives/attributes.go
    • mod/execution/pkg/client/ethclient/engine.go
    • mod/beacon/blockchain/types.go
    • mod/beacon/validator/types.go
    • mod/beacon/validator/block_builder.go
    • mod/cli/pkg/utils/parser/validator.go
    • mod/cli/pkg/commands/genesis/deposit.go
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the usage of `common.Root` across the codebase.

# Test: Search for occurrences of `common.Root`.
# Expect: Consistent usage of the new type.
rg --type go -A 5 $'common.Root'

Length of output: 157505

build/tools/go.mod (1)

240-240: Verify the necessity and stability of the new dependency.

Ensure that the new dependency github.com/prysmaticlabs/gohashtree is necessary and does not introduce any issues.

Verification successful

The gohashtree dependency appears to be necessary and stable.

  • The gohashtree dependency is used extensively across the codebase, particularly in test files and various modules.
  • There are no immediate conflicts or issues found in the go.mod files.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the necessity and stability of the new dependency.

# Test: Check the changelog or release notes for the new version.
# Expect: No breaking changes or major issues.
curl -s https://api.github.com/repos/prysmaticlabs/gohashtree/releases/tags/v0.0.4-beta.0.20240624100937-73632381301b | jq '.body'

Length of output: 135


Script:

#!/bin/bash
# Find references to 'gohashtree' in the codebase to understand its usage.
rg 'gohashtree'

# Check the dependency tree for potential conflicts or issues.
go mod graph | grep 'gohashtree'

Length of output: 11717


Script:

#!/bin/bash
# Search for critical usage of 'gohashtree' in the codebase.
rg 'gohashtree' -A 5

# List all dependencies in go.mod files to manually check for potential conflicts.
fd -e go.mod --exec cat

Length of output: 40739

mod/node-api/backend/mocks/beacon_state.mock.go (6)

143-159: LGTM! The return type change enhances type safety and clarity.

The function GetBlockRootAtIndex now returns common.Root instead of bytes.B32, which is more semantically appropriate.


190-195: LGTM! The return type change in the call structure is consistent with the function update.

The Return method in BeaconState_GetBlockRootAtIndex_Call now correctly handles common.Root.


366-382: LGTM! The return type change enhances type safety and clarity.

The function GetGenesisValidatorsRoot now returns common.Root instead of bytes.B32, which is more semantically appropriate.


412-417: LGTM! The return type change in the call structure is consistent with the function update.

The Return method in BeaconState_GetGenesisValidatorsRoot_Call now correctly handles common.Root.


1136-1152: LGTM! The return type change enhances type safety and clarity.

The function StateRootAtIndex now returns common.Root instead of bytes.B32, which is more semantically appropriate.


1183-1188: LGTM! The return type change in the call structure is consistent with the function update.

The Return method in BeaconState_StateRootAtIndex_Call now correctly handles common.Root.

@@ -51,6 +50,7 @@ require (
cosmossdk.io/schema v0.1.1 // indirect
github.com/VictoriaMetrics/fastcache v1.12.2 // indirect
github.com/berachain/beacon-kit/mod/chain-spec v0.0.0-20240705193247-d464364483df // indirect
github.com/berachain/beacon-kit/mod/geth-primitives v0.0.0-20240806160829-cde2d1347e7e // indirect
Copy link
Contributor

Choose a reason for hiding this comment

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

Tip

Codebase Verification

Direct usage of geth-primitives still present in the codebase.

The geth-primitives dependency is still being imported directly in multiple files. This contradicts the review comment stating it has been removed from direct dependencies. Please review and update the dependency management strategy to ensure consistency.

  • testing/e2e/e2e_staking_test.go
  • mod/execution/pkg/client/eth.go
  • mod/execution/pkg/deposit/contract.go
  • mod/execution/pkg/client/errors.go
  • mod/execution/pkg/client/client.go
  • mod/execution/pkg/client/cache/cache_test.go
  • mod/execution/pkg/client/cache/cache.go
  • mod/execution/pkg/client/ethclient/client.go
  • mod/engine-primitives/pkg/engine-primitives/requests.go
  • mod/cli/pkg/commands/genesis/payload.go
  • mod/cli/pkg/commands/deposit/create.go
Analysis chain

Update dependency management strategy for geth-primitives.

The geth-primitives dependency has been removed from direct dependencies and reintroduced as an indirect dependency. Ensure that this change aligns with the project's dependency management strategy and does not introduce any issues.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the impact of changing `geth-primitives` from a direct to an indirect dependency.

# Test: Check for any issues or missing dependencies resulting from this change.
rg --type go 'geth-primitives'

Length of output: 2188

@itsdevbear itsdevbear merged commit 3472ef3 into main Aug 7, 2024
18 checks passed
@itsdevbear itsdevbear deleted the execution-hash branch August 7, 2024 18:28
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.

2 participants