-
Notifications
You must be signed in to change notification settings - Fork 248
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
chore(config)_: integrate new rpc providers configs #6178
base: develop
Are you sure you want to change the base?
Conversation
Jenkins BuildsClick to see older builds (56)
|
e0e484f
to
d2795bc
Compare
todo:
|
todo:
|
1ecae6e
to
afb9730
Compare
d2795bc
to
526f19c
Compare
526f19c
to
54f6a89
Compare
1c51d12
to
c1b756f
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #6178 +/- ##
============================================
- Coverage 60.05% 19.13% -40.92%
============================================
Files 832 817 -15
Lines 109840 108221 -1619
============================================
- Hits 65961 20713 -45248
- Misses 36148 84685 +48537
+ Partials 7731 2823 -4908
Flags with carried forward coverage won't be shown. Click here to find out more.
|
* default_networks.go * explicit provider initialization with more granular config (rps limiter, order) * token overrides made more flexible, support not only infura and grove * get_status_node.go * override status-proxy auth instead of passing override config to rpc/client.go * config.go * ProviderConfig removed * client.go * Now any provider can be enabled/disabled (if user wants to use only his custom RPC urls) * Use bearer auth instead of URL auth * Provider order is defined by default_networks.go
* add method to make a deepcopy of a network + tests * improved logging * improved memory allocation
54f6a89
to
8582775
Compare
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 didn't check the wallet logic at all
|
||
rpcProviders := []params.RpcProvider{ | ||
// Proxy providers | ||
*params.NewProxyProvider(chainID, "proxy-nodefleet", proxyUrl(stageName, "nodefleet", chainName, networkName), false), |
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.
Looks like all these strings ("proxy-nodefleet"
, "nodefleet"
, etc) should be defined as const variables.
require.True(t, strings.Contains(n.FallbackURL, ganacheURL)) | ||
// Check direct providers for tokens | ||
for _, provider := range n.RpcProviders { | ||
if provider.Type == params.EmbeddedDirectProviderType { |
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.
🙏
if provider.Type == params.EmbeddedDirectProviderType { | |
if provider.Type != params.EmbeddedDirectProviderType { | |
continue |
@@ -117,19 +118,25 @@ func OverrideEmbeddedProxyProviders(networks []params.Network, enabled bool, use | |||
return updatedNetworks | |||
} | |||
|
|||
func deepCopyNetworks(networks []params.Network) []params.Network { | |||
func DeepCopyNetwork(network params.Network) params.Network { |
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.
Perhaps this could be a method of params.network
?
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 agree with Igor's suggestion for this and the function below.
if provider.AuthType != params.NoAuth { | ||
switch provider.AuthType { |
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.
Why check if NoAuth
, if the switch/case already does it? 🤔
return fmt.Errorf("failed to begin transaction: %w", err) | ||
} | ||
defer func() { | ||
if p := recover(); p != 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.
Oh, this is an smart thing to rollback in case of a panic 👍
Perhaps we should do this for all db transactions? Or at least write it down as a guideline?
@@ -102,3 +102,14 @@ func CompareNetworksList(t require.TestingT, expectedNetworks, actualNetworks [] | |||
CompareNetworks(t, expectedNetwork, network) | |||
} | |||
} | |||
|
|||
func ConvertNetworksToPointers(networks []params.Network) []*params.Network { |
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.
func ConvertNetworksToPointers(networks []params.Network) []*params.Network { | |
func DereferenceNetworks(networks []params.Network) []*params.Network { |
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.
Though Dereference
is the opposite thing 🤔 😄
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.
@friofry nice and clean. Thanks.
*params.NewProxyProvider(chainID, "proxy-grove", proxyUrl(stageName, "grove", chainName, networkName), false), | ||
// Direct providers | ||
*params.NewDirectProvider(chainID, "direct-infura", "https://mainnet.infura.io/v3/", true), | ||
*params.NewDirectProvider(chainID, "direct-grove", "https://eth-archival.rpc.grove.city/v1/", false), |
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.
@dlipicar mentioned today that grove updated the format of their endpoints, maybe you can align with that?
@@ -117,19 +118,25 @@ func OverrideEmbeddedProxyProviders(networks []params.Network, enabled bool, use | |||
return updatedNetworks | |||
} | |||
|
|||
func deepCopyNetworks(networks []params.Network) []params.Network { | |||
func DeepCopyNetwork(network params.Network) params.Network { |
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 agree with Igor's suggestion for this and the function below.
This is the follow-up PR for the improved RPC configuration. See description: #6151