Skip to content
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

Closed
wants to merge 5 commits into from

Conversation

kurkomisi
Copy link
Contributor

Supersedes #19397

This PR contains the separation of the ETH peers from the LES peers on the dashboard.

Screenshot from 2019-05-21 19-02-34

commit: null,
version: null,
commit: null,
syncMode: '',
Copy link
Member

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.

"io"
"github.com/ethereum/go-ethereum/eth"
"github.com/ethereum/go-ethereum/les"

Copy link
Member

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.

peerCh chan p2p.MeteredPeerEvent // Peer event channel.
subPeer event.Subscription // Peer event subscription.

syncMode downloader.SyncMode
Copy link
Member

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.

Commit string `json:"commit,omitempty"`
Version string `json:"version,omitempty"`
Commit string `json:"commit,omitempty"`
SyncMode string `json:"syncMode,omitempty"`
Copy link
Member

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 }
Copy link
Member

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
Copy link
Member

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?

@kurkomisi kurkomisi force-pushed the dashboard-separate-light branch 2 times, most recently from 3ea7735 to abc3abb Compare June 27, 2019 11:21
@@ -873,9 +876,13 @@ func (srv *Server) listenLoop() {
continue
}
if remoteIP != nil {
fd = newMeteredConn(fd, true, remoteIP)
var addr *net.TCPAddr
Copy link
Contributor Author

@kurkomisi kurkomisi Jun 27, 2019

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.

Copy link
Contributor Author

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
Copy link
Member

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?

@fjl fjl removed the status:triage label Jul 18, 2019
@fjl
Copy link
Contributor

fjl commented Nov 12, 2019

closing because I am merging #19397 instead.

@fjl fjl closed this Nov 12, 2019
@karalabe
Copy link
Member

Why? This is a lot more complete

@fjl
Copy link
Contributor

fjl commented Nov 12, 2019

Sorry, I meant I'm merging #19762 which includes this PR.

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.

4 participants