babylonlabs-io / babylon-staking-indexer

Other
1 stars 2 forks source link

Check global param in cache before db insertion #14

Open jrwbabylonlab opened 1 month ago

jrwbabylonlab commented 1 month ago

In the indexer, we are constantly trying to save the global params per each polling iteration. what we should do instead are:

  1. Pull the existing global params into memory at service start up time
  2. For each polling result, check if already exist in memory
  3. Only if not exist, we insert.

This is a improvement ticket

gusin13 commented 1 day ago

@jrwbabylonlab if we pull from memory then how would indexer identify or update in case if params change in babylon?

jrwbabylonlab commented 1 hour ago

@jrwbabylonlab if we pull from memory then how would indexer identify or update in case if params change in babylon?

@gusin13 the polling mechanism still continues, it just try to compare with the already saved result and see if there is changes.

Very low priority, don't think we actually need to do anything about it at this stage