-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Fix RPC name override #11813
Fix RPC name override #11813
Conversation
I see that you haven't updated any CHANGELOG files. Would it make sense to do so? |
core/chains/legacyevm/chain.go
Outdated
name := fmt.Sprintf("eth-sendonly-rpc-%d", i) | ||
if node.Name != nil && *node.Name != "" { | ||
name = *node.Name | ||
} | ||
rpc := evmclient.NewRPCClient(lggr, empty, (*url.URL)(node.HTTPURL), name, int32(i), chainID, | ||
commonclient.Secondary) |
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 is safe to pass the nodeName
directly. We validate that all nodes are named. Notice that we already pas it without nil check on the line below.
name := fmt.Sprintf("eth-sendonly-rpc-%d", i) | |
if node.Name != nil && *node.Name != "" { | |
name = *node.Name | |
} | |
rpc := evmclient.NewRPCClient(lggr, empty, (*url.URL)(node.HTTPURL), name, int32(i), chainID, | |
commonclient.Secondary) | |
rpc := evmclient.NewRPCClient(lggr, empty, (*url.URL)(node.HTTPURL), *node.Name, int32(i), chainID, | |
commonclient.Secondary) |
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.
Can we get a test demonstrating what this fixes?
We haven't had the ability to test prom metrics coherently in the past, since they are all mixed up in global state. However, we could add a txtar test and checks the /metrics endpoint, like for /health: https://github.com/smartcontractkit/chainlink/blob/develop/testdata/scripts/health/multi-chain.txtar |
Added the test, but it does not feel that this is the right approach. The script seems too complex for txtar test. Also it's quite limited in terms of available metrics as node does not perform any actions. Automated check against soaked node might be a better option. |
I was hoping it could be made simpler, but soak tests would be fine too 🤷 |
SonarQube Quality Gate |
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.
Thanks for fixing this!
@jmank88 on second thought, implementation of a more generalized "framework" for metrics testing seems like a high-effort low-priority task. As the current approach gets the job done in this particular case, do you mind merging the fix as is? |
Did you try using the basic
I don't fully understand the extra retry logic though. Was it flakey without? |
I did not observe the flake. But |
No description provided.