-
Notifications
You must be signed in to change notification settings - Fork 250
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
Improve rpc errors logging #6362
base: develop
Are you sure you want to change the base?
Conversation
Jenkins Builds
|
} | ||
|
||
// NewProviderStatus processes ProviderCallStatus and returns a new ProviderStatus. | ||
func NewProviderStatus(res ProviderCallStatus) ProviderStatus { |
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 method was only used in tests.
) | ||
|
||
// CreateEthClientFromProvider creates an Ethereum RPC client from the given RpcProvider. | ||
func CreateEthClientFromProvider(provider params.RpcProvider, rpcUserAgentName string) (*rpc.Client, error) { |
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 function is extracted from rpc/client.go to have a clear way of creating rpc.Client from RpcProvider.
@@ -15,32 +17,77 @@ import ( | |||
type RPSLimitedEthClientInterface interface { | |||
EthClientInterface | |||
GetLimiter() *rpclimiter.RPCRpsLimiter | |||
GetName() string | |||
CopyWithName(name string) RPSLimitedEthClientInterface | |||
GetCircuitName() string |
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.
Name was always a circuit name, so renamed to avoid ambiguity.
Multiple providers can share the same circuit, hence 2 properties Circuit and Provider.
return NewRPSLimitedEthClient(c.rpcClient, c.limiter, circuitName, c.providerName) | ||
} | ||
|
||
func (c *RPSLimitedEthClient) ExecuteWithRPSLimit(f func(client EthClientInterface) (interface{}, error)) (interface{}, error) { |
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.
Extracted this function from rpc/chain/client.go
as this logic is more related to RpsLimitedEthClient
than chain client.
@@ -44,6 +44,7 @@ func (a *Aggregator) Update(providerStatus rpcstatus.ProviderStatus) { | |||
// Update existing provider status or add a new provider. | |||
if ps, exists := a.providerStatuses[providerStatus.Name]; exists { | |||
ps.Status = providerStatus.Status | |||
ps.ChainID = providerStatus.ChainID |
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 layer supposed to be chainID-agnostic? (as in, we don't deal with chainIDs with market providers, but we do once we go into a more specific layer of RPC/collectibles providers)
While debugging status-im/status-mobile#22155 I needed more information in the logs.
So this PR addresses 2 issues:
Changes:
Closes #6266