-
Notifications
You must be signed in to change notification settings - Fork 20.4k
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
cmd, dashboard, eth, p2p: separate full nodes from light ones on the dashboard #19606
Conversation
1f54991
to
66a69b7
Compare
commit: null, | ||
version: null, | ||
commit: null, | ||
syncMode: '', |
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.
Pls remove the sync mode, that's mostly an internal detail, is not that useful on the outside, at least not now.
dashboard/dashboard.go
Outdated
"io" | ||
"github.com/ethereum/go-ethereum/eth" | ||
"github.com/ethereum/go-ethereum/les" | ||
|
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.
Pls remove empty lines from in between these imports. The only empty line should be between stdlib and externals.
dashboard/dashboard.go
Outdated
peerCh chan p2p.MeteredPeerEvent // Peer event channel. | ||
subPeer event.Subscription // Peer event subscription. | ||
|
||
syncMode downloader.SyncMode |
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.
Pls remove the sync mode, that's mostly an internal detail, is not that useful on the outside, at least not now.
dashboard/message.go
Outdated
Commit string `json:"commit,omitempty"` | ||
Version string `json:"version,omitempty"` | ||
Commit string `json:"commit,omitempty"` | ||
SyncMode string `json:"syncMode,omitempty"` |
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.
Pls remove the sync mode, that's mostly an internal detail, is not that useful on the outside, at least not now.
eth/backend.go
Outdated
@@ -481,6 +481,7 @@ func (s *Ethereum) EthVersion() int { return int(s.protocolMa | |||
func (s *Ethereum) NetVersion() uint64 { return s.networkID } | |||
func (s *Ethereum) Downloader() *downloader.Downloader { return s.protocolManager.downloader } | |||
func (s *Ethereum) Synced() bool { return atomic.LoadUint32(&s.protocolManager.acceptTxs) == 1 } | |||
func (s *Ethereum) IsLesServer() bool { return s.lesServer != nil } |
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.
I'd rather we don't add a method here. If you use admin.nodeInfo
(or the equivalent call against the Eth object), you should be able to derive this whether eth
, les
or both protocols are advertised.
p2p/metrics.go
Outdated
Elapsed time.Duration // Time elapsed between the connection and the handshake/disconnection | ||
Enode string // Node URL |
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.
This seems to be Peer.Enode()
, can't we get rid of this extra redundancy?
3ea7735
to
abc3abb
Compare
@@ -873,9 +876,13 @@ func (srv *Server) listenLoop() { | |||
continue | |||
} | |||
if remoteIP != nil { | |||
fd = newMeteredConn(fd, true, remoteIP) | |||
var addr *net.TCPAddr |
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.
@fjl Could you please take a look? I didn't know what is the proper solution for this merge conflict.
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.
The relevant information is that I use the TCPAddr
instead of the IP
.
) | ||
|
||
// MeteredPeerEvent is an event emitted when peers connect or disconnect. | ||
type MeteredPeerEvent struct { | ||
Type MeteredPeerEventType // Type of peer event | ||
IP net.IP // IP address of the peer | ||
ID enode.ID // NodeID of the peer | ||
Addr string // TCP address of the peer |
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.
Isn't this also available via Peer?
47dbae5
to
33cdcc1
Compare
closing because I am merging #19397 instead. |
Why? This is a lot more complete |
Sorry, I meant I'm merging #19762 which includes this PR. |
Supersedes #19397
This PR contains the separation of the ETH peers from the LES peers on the dashboard.