go-ethereum icon indicating copy to clipboard operation
go-ethereum copied to clipboard

eth: unify the eth receiver name (s, eth) -> e

Open georgehao opened this issue 1 year ago • 3 comments

Purpose

Currently, eth.Ethereum have two named receiver s and eth. This don't follow golang code style.

s receiver: https://github.com/ethereum/go-ethereum/blob/master/eth/backend.go#L309 eth receiver: https://github.com/ethereum/go-ethereum/blob/master/eth/state_accessor.go#L177

So, this pr unify the receiver name

georgehao avatar Jan 20 '24 10:01 georgehao

What is the logic for calling Ethereum s ?

holiman avatar Jan 20 '24 15:01 holiman

What is the logic for calling Ethereum s ?

I noticed that most of the receivers were originally called s. Of course, they can be unified as eth for more clarity.

But, backend.go is in the eth package. if the receiver is also call eth, maybe confused. eg:

eth.Etherbase()
eth.MakeProtocols()

developer can't recognize whether the function is a package method or struct method. And this will cause error invoke. Maybe receiver name callse is more suitable

georgehao avatar Jan 20 '24 15:01 georgehao

Maybe was s for "service" ?

lightclient avatar Jan 22 '24 13:01 lightclient