-
Notifications
You must be signed in to change notification settings - Fork 1.5k
refactor: replace interface{} with any for clarity and modernization #18445
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
Conversation
Signed-off-by: zhetaicheleba <taicheleba@outlook.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR modernizes the codebase by replacing all occurrences of interface{} with the equivalent any type alias, which was introduced in Go 1.18. This change improves code readability and aligns with modern Go conventions without affecting functionality.
Key changes:
- Replaced
interface{}withanythroughout function signatures, struct fields, and type definitions - Updated sync.Pool
Newfunctions to returnanyinstead ofinterface{} - Simplified type alias declaration in
exec3_parallel.gofrom an empty interface toany
Reviewed changes
Copilot reviewed 74 out of 74 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| execution/vm/stack.go | Updated sync.Pool New function return type |
| execution/vm/program/program_test.go | Updated test struct field type |
| execution/vm/interpreter.go | Updated sync.Pool New function return type |
| execution/vm/asm/compiler.go | Updated struct field and function parameter types |
| execution/types/withdrawal.go | Updated sync.Pool New function return type |
| execution/types/set_code_tx.go | Updated slice types in hash computation functions |
| execution/types/rlp_fuzzer_test.go | Updated function parameters and struct field types |
| execution/types/legacy_tx.go | Updated slice types in hash computation functions |
| execution/types/hashing.go | Updated sync.Pool New function and hash function parameter types |
| execution/types/genesis.go | Updated function parameter type |
| execution/types/ethutils/receipt.go | Updated return types and local variable types |
| execution/types/encdec_test.go | Updated test helper function parameter types |
| execution/types/dynamic_fee_tx.go | Updated slice types in hash computation functions |
| execution/types/block_test.go | Updated test helper function parameter types |
| execution/types/block_access_list_test.go | Updated test slice type |
| execution/types/blob_tx.go | Updated slice types in hash computation functions |
| execution/types/accounts/account.go | Updated sync.Pool New function return type |
| execution/types/access_list_tx.go | Updated slice types in hash computation functions |
| execution/types/aa_transaction.go | Updated slice types in hash computation functions |
| execution/types/aa_abi.go | Updated function parameter type |
| execution/tracing/tracers/tracers_test.go | Updated local variable type |
| execution/tracing/tracers/internal/tracetest/prestate_test.go | Updated struct field type |
| execution/tests/testutil/state_test_util.go | Updated function parameter type |
| execution/tests/testutil/rlp_test_util.go | Updated struct field and function parameter types |
| execution/tests/statedb_insert_chain_transaction_test.go | Updated function parameter type |
| execution/tests/init_test.go | Updated function parameter types |
| execution/state/versionmap.go | Updated struct fields and method parameter/return types |
| execution/state/versionedio.go | Updated struct field types |
| execution/state/intra_block_state_test.go | Updated test helper function parameter types |
| execution/state/intra_block_state.go | Updated sync.Pool New function return type |
| execution/stagedsync/sync.go | Updated function return type and local variable type |
| execution/stagedsync/stage_txlookup.go | Updated lambda function parameter and return types |
| execution/stagedsync/stage_senders.go | Updated lambda function parameter and return types |
| execution/stagedsync/headerdownload/header_data_struct.go | Updated heap interface method parameter/return types |
| execution/stagedsync/exec3_parallel.go | Simplified empty interface type alias to any |
| execution/stagedsync/exec3_metrics.go | Updated local variable types and function parameter types |
| execution/rlp/encode_test.go | Updated test struct field and function parameter types |
| execution/rlp/encode.go | Updated function parameter types |
| execution/rlp/encbuffer.go | Updated sync.Pool New function and encode method parameter types |
| execution/rlp/decode_test.go | Updated test struct fields and function parameter types |
| execution/rlp/decode.go | Updated function parameter types and type variable |
| execution/protocol/rules/ethash/rules.go | Updated local variable type |
| execution/protocol/rules/ethash/ethash.go | Updated struct fields and function parameter/return types |
| execution/protocol/rules/ethash/algorithm.go | Updated sync.Pool New function return types |
| execution/protocol/rules/clique/clique.go | Updated local variable type |
| execution/protocol/rules/aura/aurainterfaces/interface.go | Updated type alias |
| execution/protocol/block_exec.go | Updated local variable and function parameter types |
| execution/protocol/aa/aa_exec.go | Updated method return type |
| execution/p2p/bbd.go | Updated local variable types |
| execution/execmodule/forkchoice.go | Updated local variable types |
| execution/engineapi/engine_block_downloader/download_request.go | Updated method return type |
| execution/engineapi/engine_block_downloader/block_downloader.go | Updated local variable type |
| execution/commitment/trie/trie_test.go | Updated slice type in benchmark |
| execution/abi/unpack_test.go | Updated test struct fields and function parameter types |
| execution/abi/unpack.go | Updated function return types |
| execution/abi/type_test.go | Updated test struct field type |
| execution/abi/topics_test.go | Updated test struct field types and function parameter types |
| execution/abi/topics.go | Updated function parameter types and local variable types |
| execution/abi/reflect_test.go | Updated test struct field type |
| execution/abi/reflect.go | Updated function parameter and return types |
| execution/abi/packing_test.go | Updated test struct field type |
| execution/abi/event_test.go | Updated test struct fields and function parameter types |
| execution/abi/error.go | Updated method return type and function parameter types |
| execution/abi/compiler/solidity.go | Updated struct field types and local variable types |
| execution/abi/compiler/helpers.go | Updated struct field types |
| execution/abi/bind/bind.go | Updated local variable type |
| execution/abi/bind/base_test.go | Updated local variable types and function parameter types |
| execution/abi/bind/base.go | Updated function parameter types |
| execution/abi/bind/backends/simulated_test.go | Updated test struct field and local variable types |
| execution/abi/bind/backends/simulated.go | Updated method return type |
| execution/abi/argument.go | Updated function parameter and return types |
| execution/abi/abifuzzer_test.go | Updated function parameter and return types |
| execution/abi/abi_test.go | Updated local variable types |
| execution/abi/abi.go | Updated function parameter and return types |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This change replaces occurrences of interface{} with the predeclared identifier any, introduced in Go 1.18 as an alias for interface{}.
As noted in the Go 1.18 Release Notes:
This improves readability and aligns the codebase with modern Go conventions.