optimism icon indicating copy to clipboard operation
optimism copied to clipboard

geth: update to v1.13.13

Open axelKingsley opened this issue 1 year ago • 4 comments

Updates the go.mod to use op-geth based on upstream version v1.13.13

This PR is made against develop because there were no required changes to support the previous version v1.13.12

Changes required to support the new version:

  • trie pakcage updated to triedb package
  • core types deprecated for types types

axelKingsley avatar Apr 23 '24 16:04 axelKingsley

Semgrep found 13 sol-style-notice-over-dev-natspec findings:

Prefer @notice over @dev in natspec comments

Ignore this finding from sol-style-notice-over-dev-natspec.

semgrep-app[bot] avatar Apr 23 '24 16:04 semgrep-app[bot]

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 43.47%. Comparing base (acd8cf8) to head (2f9772c). Report is 130 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #10271      +/-   ##
===========================================
+ Coverage    42.33%   43.47%   +1.14%     
===========================================
  Files           73       41      -32     
  Lines         4845     3986     -859     
  Branches       766      614     -152     
===========================================
- Hits          2051     1733     -318     
+ Misses        2684     2143     -541     
  Partials       110      110              
Flag Coverage Δ
cannon-go-tests 81.43% <ø> (ø)
chain-mon-tests 27.14% <ø> (ø)
common-ts-tests ?
contracts-ts-tests 12.25% <ø> (ø)
core-utils-tests ?
sdk-tests 40.27% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

see 32 files with indirect coverage changes

codecov[bot] avatar Apr 23 '24 17:04 codecov[bot]

Semgrep found 6 golang_fmt_errorf_no_params findings:

No fmt.Errorf invocations without fmt arguments allowed

Ignore this finding from golang_fmt_errorf_no_params.

Semgrep found 2 import-text-template findings:

  • op-bindings/bindgen/remote_handlers.go
  • op-bindings/bindgen/generator_local.go

When working with web applications that involve rendering user-generated content, it's important to properly escape any HTML content to prevent Cross-Site Scripting (XSS) attacks. In Go, the text/template package does not automatically escape HTML content, which can leave your application vulnerable to these types of attacks. To mitigate this risk, it's recommended to use the html/template package instead, which provides built-in functionality for HTML escaping. By using html/template to render your HTML content, you can help to ensure that your web application is more secure and less susceptible to XSS vulnerabilities.

Ignore this finding from import-text-template.

semgrep-app[bot] avatar Apr 25 '24 21:04 semgrep-app[bot]

Walkthrough

Walkthrough

The modifications primarily involve updating types and import paths related to the Ethereum Go client code across various files. The changes focus on transitioning from core.GenesisAlloc and core.GenesisAccount to types.GenesisAlloc and types.Account, respectively. Additionally, there's a shift from using the trie package to the triedb package for trie database functionalities, reflecting an overall reorganization and type standardization within the library.

Changes

Files Summary
op-chain-ops/genesis/config.go, op-chain-ops/genesis/genesis.go, op-chain-ops/genesis/layer_two.go, op-chain-ops/state/memory_db.go, op-e2e/e2eutils/addresses.go, op-e2e/e2eutils/setup.go, op-e2e/external.go, op-e2e/setup.go, op-program/client/l2/db_test.go, op-proposer/proposer/abi_test.go Updated from core.GenesisAlloc and core.GenesisAccount to types.GenesisAlloc and types.Account.
op-e2e/actions/l1_replica_test.go, op-e2e/actions/l2_engine_test.go, op-program/client/l2/engine_backend_test.go, op-program/client/mpt/trie.go, packages/contracts-bedrock/scripts/go-ffi/differential-testing.go, packages/contracts-bedrock/scripts/go-ffi/trie.go Changed import paths and initialization from trie to triedb for trie database operations.

Recent Review Details

Configuration used: .coderabbit.yml Review profile: CHILL

Commits Files that changed from the base of the PR and between acd8cf8aa16d0e59508ee402458a97945f03e1c6 and 2f9772cb7c81a3b4796427c7b0b536b71d319032.
Files ignored due to path filters (4)
  • go.mod is excluded by !**/*.mod
  • go.sum is excluded by !**/*.sum
  • op-ufm/go.mod is excluded by !**/*.mod
  • op-ufm/go.sum is excluded by !**/*.sum
Files selected for processing (16)
  • op-chain-ops/genesis/config.go (3 hunks)
  • op-chain-ops/genesis/genesis.go (2 hunks)
  • op-chain-ops/genesis/layer_two.go (1 hunks)
  • op-chain-ops/state/memory_db.go (2 hunks)
  • op-e2e/actions/l1_replica_test.go (2 hunks)
  • op-e2e/actions/l2_engine_test.go (3 hunks)
  • op-e2e/e2eutils/addresses.go (1 hunks)
  • op-e2e/e2eutils/setup.go (4 hunks)
  • op-e2e/external.go (2 hunks)
  • op-e2e/setup.go (3 hunks)
  • op-program/client/l2/db_test.go (4 hunks)
  • op-program/client/l2/engine_backend_test.go (2 hunks)
  • op-program/client/mpt/trie.go (2 hunks)
  • op-proposer/proposer/abi_test.go (2 hunks)
  • packages/contracts-bedrock/scripts/go-ffi/differential-testing.go (3 hunks)
  • packages/contracts-bedrock/scripts/go-ffi/trie.go (2 hunks)
Files skipped from review due to trivial changes (1)
  • packages/contracts-bedrock/scripts/go-ffi/differential-testing.go
Additional comments not posted (35)
op-e2e/e2eutils/addresses.go (2)

8-8: Updated import to use types instead of core aligns with the PR objectives.


14-14: The function collectAllocAddrs correctly uses types.GenesisAlloc as per the PR's transition plan.

op-chain-ops/genesis/layer_two.go (1)

73-73: The function HasAnyDevAccounts has been correctly updated to use types.GenesisAlloc, aligning with the PR's transition plan.

op-e2e/external.go (2)

17-17: Updated import to use types instead of core aligns with the PR objectives.


79-80: The Genesis field in ExternalRunner struct correctly uses types.GenesisAlloc for the allocation map, aligning with the PR's transition plan.

op-proposer/proposer/abi_test.go (2)

15-15: Updated import to use types instead of core aligns with the PR objectives.


31-31: The simulatedBackend function correctly uses types.GenesisAlloc for the allocation map, aligning with the PR's transition plan.

op-program/client/mpt/trie.go (2)

12-13: Updated imports to use triedb and hashdb instead of trie align with the PR objectives.


51-51: The ReadTrie function correctly uses triedb.NewDatabase and trie.New, aligning with the PR's transition plan.

op-e2e/actions/l1_replica_test.go (2)

13-14: Updated imports to use triedb and hashdb instead of trie align with the PR objectives.


63-63: The TestL1Replica_ActL1Sync function correctly uses triedb.NewDatabase, aligning with the PR's transition plan.

op-program/client/l2/db_test.go (3)

18-19: Updated imports to use triedb and hashdb instead of trie align with the PR objectives.


115-115: The TestSupportsStateDBOperations function correctly uses triedb.NewDatabase, aligning with the PR's transition plan.


127-127: The TestUpdateState function correctly uses triedb.NewDatabase, aligning with the PR's transition plan.

op-chain-ops/genesis/genesis.go (2)

114-114: The NewL2Genesis function correctly initializes an empty types.Account map, aligning with the PR's transition plan.


203-203: The NewL1Genesis function correctly initializes an empty types.Account map, aligning with the PR's transition plan.

packages/contracts-bedrock/scripts/go-ffi/trie.go (2)

16-16: Import of triedb package added.

This change aligns with the PR's objective to transition from the trie package to the triedb package.


137-137: Replacement of trie.NewEmpty with triedb.NewDatabase.

This change correctly implements the transition from using the trie package to the triedb package for initializing a new trie database. Ensure that all functionalities provided by the old trie.NewEmpty are compatible or appropriately handled by triedb.NewDatabase.

op-e2e/e2eutils/setup.go (4)

12-12: Import of types from github.com/ethereum/go-ethereum/core/types.

This change is necessary for the transition from core types to types types, aligning with the PR's objectives.


90-91: Updated AllocParams struct to use types.GenesisAlloc.

This change correctly updates the type definitions from core.GenesisAlloc to types.GenesisAlloc, ensuring compatibility with the new types package.


115-115: Updated account creation to use types.Account.

This change is part of the transition from core.GenesisAccount to types.Account, aligning with the PR's objectives.


136-136: Updated account creation to use types.Account.

This change is consistent with the updates made in other parts of the codebase, transitioning from core.GenesisAccount to types.Account.

op-chain-ops/state/memory_db.go (2)

50-52: Updated GetAccount method to return types.Account.

This change correctly updates the method to return types.Account instead of core.GenesisAccount, aligning with the PR's objectives.


74-74: Updated account creation in createAccount method to use types.Account.

This change is consistent with the updates made in other parts of the codebase, transitioning from core.GenesisAccount to types.Account.

op-e2e/actions/l2_engine_test.go (3)

17-18: Import of triedb and triedb/hashdb packages added.

This change aligns with the PR's objective to transition from the trie package to the triedb package.


38-38: Replacement of trie.NewEmpty with triedb.NewDatabase in test setup.

This change correctly implements the transition from using the trie package to the triedb package for initializing a new trie database in the test environment. Ensure that all functionalities provided by the old trie.NewEmpty are compatible or appropriately handled by triedb.NewDatabase.


101-101: Repeated change for triedb.NewDatabase in another test setup.

This change is consistent with the updates made in other parts of the codebase, transitioning from trie.NewEmpty to triedb.NewDatabase.

op-program/client/l2/engine_backend_test.go (3)

22-23: Import of triedb and triedb/hashdb packages added.

This change aligns with the PR's objective to transition from the trie package to the triedb package.


297-297: Updated account allocation to use types.Account.

This change correctly updates the account allocation to use types.Account instead of core.GenesisAccount, aligning with the PR's objectives.


304-304: Replacement of trie.NewEmpty with triedb.NewDatabase in test setup.

This change correctly implements the transition from using the trie package to the triedb package for initializing a new trie database in the test environment. Ensure that all functionalities provided by the old trie.NewEmpty are compatible or appropriately handled by triedb.NewDatabase.

op-e2e/setup.go (2)

468-475: Update to use types.Account aligns with the PR's objective to transition from core types.


497-504: Correct implementation of the new types.Account in the genesis allocation setup.

op-chain-ops/genesis/config.go (3)

820-820: Update to use types.GenesisAlloc aligns with the latest Ethereum standards.


824-824: The Copy method correctly duplicates the ForgeAllocs structure using the updated types.GenesisAlloc.


844-847: The UnmarshalJSON method has been updated to handle the new types.GenesisAlloc format. Ensure that all fields are correctly mapped and that there are no data type mismatches or missing fields.


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

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit 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.

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

CodeRabbit Commands (invoked as PR comments)

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

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

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • 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.

coderabbitai[bot] avatar May 01 '24 14:05 coderabbitai[bot]

This PR is stale because it has been open 14 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] avatar May 16 '24 01:05 github-actions[bot]

Geth dep is at v1.13.15 / v1.101315.1-rc.2 already, closing this.

op-chain-ops diff is partially applied, partially outdated (due to removal of packages). Op-program diff was applied to develop.

protolambda avatar May 16 '24 11:05 protolambda