-
Notifications
You must be signed in to change notification settings - Fork 21
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
feat: Allow individual list of monikers per network #9
base: develop
Are you sure you want to change the base?
feat: Allow individual list of monikers per network #9
Conversation
…er' config as default if nothing is defined Signed-off-by: Simon Lichtenauer <[email protected]>
Hi @qwertzlbert Our goal was to simplify the configuration as much as possible. Therefore, currently, if you specify monikers as an array, it will track all chains where those monikers exist. Your PR seems to be valid for the following scenario:
And you want to track only We considered such cases as well, but thought they were rare. Therefore, we chose to specify the monikers in an array and track them if they exist. |
@carameleon Not only that, but in some cases I might want to get data for different validator monikers from different networks to be able to compare them. This is especially useful in scenarios were I track a lot of different chains, but want to track different monikers across them. Currently this would mean I have to define a big list with monikers which also might return data I'm not interested in.
The change I propose leaves you the option to keep it simple and just define a global list of moniker, the same way as it is now, while still having the flexibility to define an override list for each network if you want. Hope this explains the use-case a bit better |
Just found some issues with my change. I'll close the PR until I'm ready |
…fferent monikers per chain config due to multiple simultanious write access (#2) * fix: remove global variable as it creates bogus results when using different monikers per chain config due to multiple simultanious write access Signed-off-by: Simon Lichtenauer <[email protected]> * remove log message used for debugging Signed-off-by: Simon Lichtenauer <[email protected]> --------- Signed-off-by: Simon Lichtenauer <[email protected]>
@@ -17,9 +17,6 @@ var ( | |||
_ common.CollectorLoop = loop | |||
) | |||
|
|||
// NOTE: this is for solo mode |
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 global packageMonikers
variable needs to be removed in all packages as it created race conditions due to multiple loops writing to this variable at the same time. This worked as long as the moniker
variable was the same for all loops, but with my added change which allows moniker configuration per chain, this creates unexpected results.
As the config is passed to the loop via the p
variable anyway, p.Monikers
is used instead, removing the race-condition
Found the root cause of the issue faster than I thought so re-opened the PR. |
PR(Pull Request) Overview
A simple change to allow defining individual lists of monikers for each network.
If no
monikers
variable is defined, the content of the rootmonikers
variable will be used.This helps in situation were you need to track different monikers across different networks, without the need to define them all globally for all networks
Changes
Description of Changes
This change allows to specify individual lists of monikers which should be tracked per configured chain. E.g.
Testing Method
Just a simple execution to test if the overwrite works or not. I did not add any tests yet