Skip to content

reduce customtypes import #943

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

Merged
merged 20 commits into from
May 8, 2025
Merged

reduce customtypes import #943

merged 20 commits into from
May 8, 2025

Conversation

ceyonur
Copy link
Collaborator

@ceyonur ceyonur commented May 4, 2025

Why this should be merged

Importing customtypes and params pkg causes side-effects of libevm. We should reduce importing of those pkgs in custom-facing client code.

AvalancheGo Follow-up PR: ava-labs/avalanchego#3918

How this works

This pull request refactors logging functionality by consolidating and renaming the logging package, alongside minor code improvements and cleanup. The most significant changes include replacing the log and customtypes packages with a unified customlog package, updating imports and references accordingly, and simplifying variable declarations for consistency.

Logging Refactor:

  • Renamed the log package to customlog across multiple files, including format.go, handler.go, and logger.go, and updated their package declarations and references.
  • Replaced references to customtypes.FlattenLogs with customlog.FlattenLogs in core/blockchain.go, eth/filters/filter.go, and other files.

Code Cleanup and Simplification:

  • Removed unused fields (Version and BlockExtraData) and associated logic from ethclient/ethclient.go to streamline block handling, to prevent importing customtypes and libevm side-effects.

How this was tested

Added to imports_test

Need to be documented?

No

Need to update RELEASES.md?

Probably

@ceyonur ceyonur marked this pull request as ready for review May 5, 2025 10:30
@ceyonur ceyonur requested a review from a team as a code owner May 5, 2025 10:30
@ceyonur ceyonur changed the title Ceyonur/reduce customtype import reduce customtypes import May 5, 2025
@ceyonur ceyonur requested a review from a team May 5, 2025 18:15
Copy link
Contributor

@tsachiherman tsachiherman left a comment

Choose a reason for hiding this comment

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

could you fix the

no required module provides package github.com/ava-labs/coreth/plugin/evm/customlogs; to add it:

lint message ?

maybe you forgot to add customlogs to this PR ?

@ceyonur
Copy link
Collaborator Author

ceyonur commented May 7, 2025

could you fix the

no required module provides package github.com/ava-labs/coreth/plugin/evm/customlogs; to add it:

lint message ?

maybe you forgot to add customlogs to this PR ?

it was gitignored

ceyonur and others added 2 commits May 8, 2025 16:13
Co-authored-by: Quentin McGaw <[email protected]>
Signed-off-by: Ceyhun Onur <[email protected]>
Co-authored-by: Quentin McGaw <[email protected]>
Signed-off-by: Ceyhun Onur <[email protected]>
@ceyonur ceyonur enabled auto-merge May 8, 2025 14:13
@ceyonur ceyonur added this pull request to the merge queue May 8, 2025
Merged via the queue into master with commit f73fd02 May 8, 2025
8 checks passed
@ceyonur ceyonur deleted the ceyonur/reduce-customtype-import branch May 8, 2025 14:33
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.

5 participants