osmosis-labs / osmosis

The AMM Laboratory
https://app.osmosis.zone
Apache License 2.0
893 stars 595 forks source link

feat: [indexer] optimization - publish token supplies and pool pair data after synced (backport #8762) #8767

Closed mergify[bot] closed 1 month ago

mergify[bot] commented 1 month ago

This commit is the extension of a previous https://github.com/osmosis-labs/osmosis/pull/8744 (it was closed for avoiding some complicated merge issues and also for easier testing purposes).

This commit:

  1. Promotes the node status checker from sqs level to common level, so that it is used by both sqs and indexer ingesters.
  2. Modifies the fullIndexerBlockProcessStrategy in indexer such that it delays the publishing of token supplies and pool pair data until the node sync finishes.
  3. Adds test cases for the full_indexer_block_process_strategy::ProcessBlock function:
    1. When the node has caught up and is no longer syncing:
      • Publishes the correct number of token supplies and offsets.
      • Publishes the correct number of pool pairs, along with the expected number of pools with creation data.
      • Returns an error if it fails to verify the node's syncing status.
    2. When the node is still syncing:
      • Returns an error, and no data should be published.

Tested in v26.x to confirm:

  1. Before node sync is complete, full block processor is skipped.
  2. Full block processor is performed only after node sync is complete
  3. Incremental processor is performed afterwards
  4. Token supply and token supply offset data publishing is working as designed here, i.e. they should be published only after full block processor has been performed


This is an automatic backport of pull request #8762 done by Mergify.