Skip to content

Improve Indexer Data Consistency and Sync Reliability #25

@ECHOAD

Description

@ECHOAD

🚀 Enhancements to Passage Indexer: Fix Desynchronization Issues

This PR proposes enhancements to the Passage indexer to address several critical data consistency issues that are currently impacting the accuracy and reliability of the marketplace. These problems stem primarily from desynchronization between the on-chain state and the indexer, leading to broken user experiences and incorrect marketplace behavior.


🧩 Identified Issues

1. Stale or "ghost" bids still indexed as active

  • Bids that have already been canceled or accepted on-chain are still returned by the indexer as active.
  • Attempting to revoke them from the frontend results in contract errors (bid does not exist).

2. Outdated ownership data

  • After a successful purchase or transfer, NFTs are still reported as being owned by the previous owner.
  • This leads to inconsistencies when displaying ownership or validating actions on the frontend.

3. NFTs sold still appear as listed for sale

  • Some NFTs that have been sold continue to show up with a stale price or as listed.
  • They do not reflect their actual on-chain status.

4. Incorrect data in listing filters

  • Desynchronized data causes NFTs that are no longer listed to appear when using filters like "For Sale".
  • This results in inaccurate search results and frustration for users.

5. General indexer desynchronization

  • Root cause seems to be missing or delayed processing of contract events such as:
    • TransferNFT
    • BidAccepted
    • Listing removals
  • The indexer is not consistently aligned with the on-chain state.

🧪 Real User Examples

  • NFTs that have been purchased still appear as listed, showing a price and the previous owner's address.
  • Bids shown as active return a bid does not exist error when trying to cancel.
  • Filter “For Sale” returns NFTs that are no longer available due to outdated indexer data.

🔍 Supporting Evidence

{
  "data": {"bid":{"token_id":"1283","bidder":"pasg13lzly6934ymemk6k3tzvlu3tl7v7gzq3qpldxr","price":{"denom":"upasg","amount":"9000000000"}}}
}

Likely outdated

[
  {
    "nft": {
      "tokenId": 2622,
      "owner": "pasg13lzly6934ymemk6k3tzvlu3tl7v7gzq3qpldxr",
      "metadata": {
        "image": "ipfs://bafkreig4lies4jzwywh23lmjcpaz2u7vgcrm6dv23cf4kr24qbsdgd4d5u",
        "image_data": null,
        "external_url": null,
        "description": null,
        "name": "Strange Clan: Kira 02622",
        "attributes": [
          {
            "display_type": "u32",
            "trait_type": "Token ID",
            "value": "2622"
          },
          {
            "display_type": "String",
            "trait_type": "Animal",
            "value": "Husky"
          },
          {
            "display_type": "String",
            "trait_type": "Class",
            "value": "Blacksmith"
          },
          {
            "display_type": "String",
            "trait_type": "Version",
            "value": "v2"
          },
          {
            "display_type": "String",
            "trait_type": "Color",
            "value": "c3"
          },
          {
            "display_type": "String",
            "trait_type": "Variant",
            "value": "None"
          },
          {
            "display_type": "String",
            "trait_type": "Background",
            "value": "BG T2 B3"
          }
        ],
        "background_color": null,
        "animation_url": null,
        "youtube_url": null
      },
      "createdOnBlockHeight": 4647210,
      "mintedOnBlockHeight": null,
      "mintPrice": null,
      "mintDenom": null
    },
    "collection": {
      "address": "pasg1kwdranvwf6vl2grh99layugwdnph6um2x0c0l8qyvrcgsjcykuhs6vaz9p",
      "name": "Strange Clan: Kira"
    },
    "price": "6000000000",
    "denom": "upasg",
    "createdHeight": 12715338,
    "createdDatetime": "2025-03-11T15:49:05.354Z",
    "createdByAddress": "pasg13lzly6934ymemk6k3tzvlu3tl7v7gzq3qpldxr"
  },
  {
    "nft": {
      "tokenId": 902,
      "owner": "pasg12t85xnfv6kfh0ntk5cxjpxqefug4ej46pps8kj",
      "metadata": {
        "image": "https://strange-clan-nft.s3.us-east-2.amazonaws.com/previews/00902_Red Gator_Hunter_v1_c2_Marked Skin 2_BG C2.png",
        "image_data": null,
        "external_url": null,
        "description": null,
        "name": "Red Gator",
        "attributes": [
          {
            "display_type": "String",
            "trait_type": "Name",
            "value": "Red Gator"
          },
          {
            "display_type": "String",
            "trait_type": "Base",
            "value": "Hunter_v1_c2"
          },
          {
            "display_type": "String",
            "trait_type": "Accessory",
            "value": "Marked Skin 2"
          },
          {
            "display_type": "String",
            "trait_type": "Background",
            "value": "blue"
          }
        ],
        "background_color": null,
        "animation_url": null,
        "youtube_url": null
      },
      "createdOnBlockHeight": 4648058,
      "mintedOnBlockHeight": null,
      "mintPrice": null,
      "mintDenom": null
    },
    "collection": {
      "address": "pasg1a2366fuydkz20h9q9kaxg5vqwpu8prgs6mhwn5qha3wsups0trcq5gl8d2",
      "name": "Passage Marketplace"
    },
    "price": "9000000000",
    "denom": "upasg",
    "createdHeight": 11501310,
    "createdDatetime": "2024-12-18T17:40:42.421Z",
    "createdByAddress": "pasg13lzly6934ymemk6k3tzvlu3tl7v7gzq3qpldxr"
  }
]

Ask null means is not listed

{
  "data": {"ask":null}
}

Still listed

{
  "tokenId": 1283,
  "owner": "pasg1wp3rf5v6sxqexfsfs8lzhpsnecq054jmmr0v0q",
  "metadata": {
    "image": "https://strange-clan-nft.s3.us-east-2.amazonaws.com/previews/01283_Cat_Farmer_v2_c1_Techno Skin Blue_BG A1.png",
    "image_data": null,
    "external_url": null,
    "description": null,
    "name": "Cat",
    "attributes": [
      {
        "display_type": "String",
        "trait_type": "Name",
        "value": "Cat"
      },
      {
        "display_type": "String",
        "trait_type": "Base",
        "value": "Farmer_v2_c1"
      },
      {
        "display_type": "String",
        "trait_type": "Accessory",
        "value": "Techno Skin Blue"
      },
      {
        "display_type": "String",
        "trait_type": "Background",
        "value": "blue"
      }
    ],
    "background_color": null,
    "animation_url": null,
    "youtube_url": null
  },
  "createdOnBlockHeight": 4648072,
  "mintedOnBlockHeight": null,
  "mintPrice": null,
  "mintDenom": null,
  "collection": "pasg1a2366fuydkz20h9q9kaxg5vqwpu8prgs6mhwn5qha3wsups0trcq5gl8d2",
  "bids": [],
  "listings": [
    {
      "datetime": "2025-02-07T21:05:27.045Z",
      "price": "9000000000",
      "denom": "upasg",
      "usdPrice": 33.72
    }
  ],
  "priceHistory": []
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions