-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Eth1 connections #10073
Eth1 connections #10073
Conversation
Michael Neuder seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
Awesome work @michaelneuder this works as expected! I hope you don't mind I pushed a few commits to generate the protos and some Bazel fixes. I have just tested this out locally and it works as expected:
I even found out my eth1 node was down due to your feature, so thanks a lot :) |
For some reason our CLA assistant wants a second Michael to sign the agreement. Ill see if I can skip that, because it might have been from a commit on another computer you had |
cool! thanks for the review!! I am going to try to sort out these failing checks in order to merge. |
hi @michaelneuder I see some failures in building due to Once the PR is green, ill make an exception for the CLA assistant and merge |
e8cd6a9
to
de27b62
Compare
175a06a
to
72bb618
Compare
Ok I made a few more changes in regards to the errors we were looking at. I think I messed up the git state a bit, but it seems like all the changes are here. A few notes:
Hoping this fixes the checks that we were erroring out on. |
Thank you @michaelneuder this is merged! |
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.
It seems I was too late to review this before it was merged in, but there is a resource leak here with regards to dialing the eth1 json-rpc server.
|
||
// CurrentETH1ConnectionError returns the error (if any) of the current connection. | ||
func (s *Service) CurrentETH1ConnectionError() error { | ||
_, _, err := s.dialETH1Nodes(s.cfg.currHttpEndpoint) |
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 clients should be closed after we dial them otherwise there is a resource leak and the connection is
kept active.
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.
sorry, totally missed this. thanks for addressing!
func (s *Service) ETH1ConnectionErrors() []error { | ||
var errs []error | ||
for _, ep := range s.cfg.httpEndpoints { | ||
_, _, err := s.dialETH1Nodes(ep) |
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.
Same thing applies here
@michaelneuder Could you kindly address the feedback from @nisdas? |
Sorry missed these comments! |
What type of PR is this?
Feature
What does this PR do? Why is it needed?
This implements an API to get the info about current ETH1 connections. It was a feature request opened in #9972.
Which issues(s) does this PR fix?
Fixes #9972.
Other notes for review
ChainInfoFetcher
interface rather than creating a new interface in the powchain package.beacon-chain/powchain/service_test.go
, I was only able to unit testCurrentETH1Endpoint()
andETH1Endpoints()
. I couldn't find a test that callsdialETH1Nodes
. Since the functions are really quite simple, hopefully living without the coverage is OK. But let me know if there is something I am missing.beacon-chain/rpc/prysm/v1alpha1/node/service_test.go
I needed a mock that implemented thepowchain.ChainInfoFetcher
interface. I added it to thetestutil
package inbeacon-chain/rpc/testutil/mock_powchain_info_fetcher.go
. The mock just returns the fields it was constructed with or with the zero values.