Open Pitasi opened 2 years ago
Keep in mind the data from cns
changes unfrequently.
maintain a global list of enabled chains
when I say this, it's also possible to maintain a list of all the chains (enabled or not) and then filter the list when requested
maintain a similar list for the ChainIDs
when I say this, if we already have the full list of chains, we can just returns the ChainID from the structs we have in memory :)
Current api-server sql queries do something like this:
While performance-wise is totally fine, it joins a table from
cns
with (most of the time) tables fromtracelistener
.In the mindset of separating concerns, and eventually stop sharing database among services, I would love to do the following. (feel free to change the DoD if a cleaner code is possible!)
DoD:
cnsclient
pkg) that polls the database (say every 5 seconds)(and pass the global
EnabledChains
list as a param to the query)