Skip to content
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

Remove asset_creator_unique as we now allow duplicate rows #158

Closed
wants to merge 1 commit into from

Conversation

danenbm
Copy link
Contributor

@danenbm danenbm commented Jan 17, 2024

Notes

  • We now allow for duplicates because we allow for stale rows, but if there is a duplicate @NicolasPennie found it will not index due to a contraint. Detected by Helius metrics dropping updates on regular NFTs.
  • Same issue exists for both cNFT and regular NFTs.
  • If we remove the constraint it works again.

Testing

Tested with "Improve workspace usage (#141)" (c572af9) reverted, because the new workspace stuff is causing issue with docker build that needs to be fixed. I don't think it should change the outcome at all of this testing since it is not related.

  • Ran with Bubblegum using devnet txs:

    • Create and mint to tree with 3 creators:
      • 2DP84v6Pi3e4v5i7KSvzmK4Ufbzof3TAiEqDbm9gg8jZpBRF9f1Cy6x54kvZoHPX9k1XfqbsG1FTv2KVP9fvNrN6
    • Update metadata to have only two creators, with previous third creator being moved to second creator position, and thus creating a duplicate creator row in asset_creators:
      • 3bsL5zmLKvhN9Je4snTKxjFSpmXEEg2cvMHm2rCNgaEYkNXBqJTA4N7QmvBSWPiNUQPtzJSYzpQYX92NowV3L7vN
  • See expected results in asset_creators table before an after the update_metadata.

  • curl commands below run successfully.

    • Before the update all three creators are listed by getAsset, and all three getAssetsByCreator calls below return the asset.
    • After the update metadata, as expected, only the first and third creators are listed by getAsset, and only the first and third getAssetsByCreator return the asset.
curl --request POST --url 'http://localhost:9090' --header 'Content-Type: application/json' --data '{
    "jsonrpc": "2.0",
    "method": "getAsset",
    "params": [
      "FLFoCw2RBbxiw9rbEeqPWJ5rasArD9kTCKWEJirTexsU"
    ],
    "id": 0
}' | json_pp

// first creator
curl --request POST --url 'http://localhost:9090'  --header 'Content-Type: application/json' --data '{
  "jsonrpc": "2.0",
  "id": 0,
  "method": "getAssetsByCreator",
  "params": {
    "creatorAddress": "Fq4HDXfutKjEZ7zZP2JmKboSm2ZsYsKEJ7BLQAfrpNcc",
    "page": 1,
    "limit": 50,
    "sortBy": {
      "sortBy": "created",
      "sortDirection": "asc"
    }
  }
}' | json_pp

// second creator
curl --request POST --url 'http://localhost:9090'  --header 'Content-Type: application/json' --data '{
  "jsonrpc": "2.0",
  "id": 0,
  "method": "getAssetsByCreator",
  "params": {
    "creatorAddress": "5EzkzhGFwiPQgwa5gv4VJxsu1oTBjb1YnWASSjtkG72K",
    "page": 1,
    "limit": 50,
    "sortBy": {
      "sortBy": "created",
      "sortDirection": "asc"
    }
  }
}' | json_pp

// third creator
curl --request POST --url 'http://localhost:9090'  --header 'Content-Type: application/json' --data '{
  "jsonrpc": "2.0",
  "id": 0,
  "method": "getAssetsByCreator",
  "params": {
    "creatorAddress": "3Le8mq2Y7kpAwAKmTRyr7n6vcM9hdDuxmiWA3tUYi4Nw",
    "page": 1,
    "limit": 50,
    "sortBy": {
      "sortBy": "created",
      "sortDirection": "asc"
    }
  }
}' | json_pp

@danenbm danenbm requested a review from NicolasPennie January 17, 2024 21:08
@danenbm danenbm marked this pull request as ready for review January 17, 2024 21:58
@danenbm
Copy link
Contributor Author

danenbm commented Jan 24, 2024

Closed in favor of #162

@danenbm danenbm closed this Jan 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant