From d1ffd73d18809c5001900dbf1aa37a52ecea60ee Mon Sep 17 00:00:00 2001 From: Seungbae Yu Date: Wed, 15 Nov 2023 18:55:17 +0900 Subject: [PATCH] fix(eth/polar): fix typos (#1307) There are some typos. ## Summary by CodeRabbit - **Refactor** - Updated terminology for clarity in the codebase, including renaming interfaces and methods to better reflect their purpose. - **Documentation** - Improved log messages for more accurate debugging information. - Removed duplicate comments to enhance code maintainability. - Updated comments to align with the renamed functions and variables for consistency. - **Style** - Made minor adjustments to comments for consistency in naming conventions. --- eth/core/precompile/method.go | 4 ++-- eth/eth.go | 6 +++--- eth/node/node.go | 5 +++-- eth/polar/api/web3.go | 2 +- eth/polar/api_backend.go | 2 +- eth/polar/backend.go | 3 --- eth/version/version.go | 2 +- 7 files changed, 11 insertions(+), 13 deletions(-) diff --git a/eth/core/precompile/method.go b/eth/core/precompile/method.go index cd4d4cc45..06157fac4 100644 --- a/eth/core/precompile/method.go +++ b/eth/core/precompile/method.go @@ -55,10 +55,10 @@ type method struct { // that implements the respective precompile method. rcvr StatefulImpl - // AbiMethod is the ABI `Methods` struct corresponding to this precompile's executable. + // abiMethod is the ABI `Methods` struct corresponding to this precompile's executable. abiMethod abi.Method - // Execute is the precompile's executable which will execute the logic of the implemented + // execute is the precompile's executable which will execute the logic of the implemented // ABI method. execute reflect.Method } diff --git a/eth/eth.go b/eth/eth.go index 66979c7b8..6feb8e768 100644 --- a/eth/eth.go +++ b/eth/eth.go @@ -55,9 +55,9 @@ type ( Has(hash common.Hash) bool } - // ExecutionLayerNode is the entrypoint for the evm execution environment. + // NetworkingStack is the entrypoint for the evm execution environment. NetworkingStack interface { - // IsExtRPCEnabled returns true if the networking stack is configured to expose JSON-RPC API. + // ExtRPCEnabled returns true if the networking stack is configured to expose JSON-RPC API. ExtRPCEnabled() bool // RegisterHandler manually registers a new handler into the networking stack. @@ -72,7 +72,7 @@ type ( // Start starts the networking stack. Start() error - // Close stops the networking stack + // Close stops the networking stack. Close() error } diff --git a/eth/node/node.go b/eth/node/node.go index 7b243efed..edcff8d81 100644 --- a/eth/node/node.go +++ b/eth/node/node.go @@ -55,12 +55,13 @@ func (n *GethExecutionNode) ExtRPCEnabled() bool { return n.Node.Config().ExtRPCEnabled() } -// ExtRPCEnabled returns whether or not the external RPC service is enabled. +// EventMux retrieves the event multiplexer used by all the network services in +// the current protocol stack. func (n *GethExecutionNode) EventMux() *event.TypeMux { //nolint:staticcheck // still in geth. return n.Node.EventMux() } -// DefaultConfig returns the default configuration for the provider. +// DefaultGethNodeConfig returns the default configuration for the provider. func DefaultGethNodeConfig() *node.Config { nodeCfg := node.DefaultConfig nodeCfg.P2P.NoDiscovery = true diff --git a/eth/polar/api/web3.go b/eth/polar/api/web3.go index 661ac102a..5d5f0d8dc 100644 --- a/eth/polar/api/web3.go +++ b/eth/polar/api/web3.go @@ -37,7 +37,7 @@ type Web3API interface { Sha3(input hexutil.Bytes) hexutil.Bytes } -// web3Api offers network related RPC methods. +// web3API offers network related RPC methods. type web3API struct { b Web3Backend } diff --git a/eth/polar/api_backend.go b/eth/polar/api_backend.go index 0d4d3d146..d3d9a6481 100644 --- a/eth/polar/api_backend.go +++ b/eth/polar/api_backend.go @@ -405,7 +405,7 @@ func (b *backend) GetLogs( for i, receipt := range receipts { logs[i] = receipt.Logs } - b.logger.Debug("called eth.rpc.backend.GetBody", "block_hash", blockHash, "number", number) + b.logger.Debug("called eth.rpc.backend.GetLogs", "block_hash", blockHash, "number", number) return logs, nil } diff --git a/eth/polar/backend.go b/eth/polar/backend.go index 51630ed0c..a10acb229 100644 --- a/eth/polar/backend.go +++ b/eth/polar/backend.go @@ -89,9 +89,6 @@ func New( stack executionLayerNode, logHandler log.Handler, ) *Polaris { - // When creating a Polaris EVM, we allow the implementing chain - // to specify their own log handler. If logHandler is nil then we - // we use the default geth log handler. // When creating a Polaris EVM, we allow the implementing chain // to specify their own log handler. If logHandler is nil then we // we use the default geth log handler. diff --git a/eth/version/version.go b/eth/version/version.go index 597422923..32cc9a28e 100644 --- a/eth/version/version.go +++ b/eth/version/version.go @@ -73,7 +73,7 @@ func ClientName(clientIdentifier string) string { ) } -// runtimeInfo returns build and platform information about the current binary. +// Info returns build and platform information about the current binary. // // If the package that is currently executing is a prefixed by our go-ethereum // module path, it will print out commit and date VCS information. Otherwise,