fuseio / fuse-nft-subgraph

Subgraph that indexes NFTs on Fuse network
MIT License
0 stars 6 forks source link

Templating ERC721 & Handling some known failures in IPFS.cat #6

Closed GundamDweeb closed 2 years ago

GundamDweeb commented 2 years ago

Hi All,

Kent from Graphrica.

Major changes in this branch:

  1. Templating ERC721 - This indexes each contract seperately, and allows a bit more flexibility if other handlers need to be added. See Erc721.create(contractAddress). This should also speed up indexing/syncing.
  2. IPFS is deprecated and is known to fail with timeouts.
  3. I did make an attempt to parse some base64 json into json - this is a work in progress and I hope to solve this with some internal teams.
  4. CozyCosmonauts cause IPFS to fail, I just save the URI and skip the reading of metadata. We can work on this.

@leonprou @mul53

fixes #3 :

See here for testing: https://thegraph.com/hosted-service/subgraph/gundamdweeb/fuse-network-erc721?query=Account%20with%20Cozy

gitguardian[bot] commented 2 years ago

⚠️ GitGuardian has uncovered 2 secrets following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

🔎 Detected hardcoded secrets in your pull request
| GitGuardian id | Secret | Commit | Filename | | | -------------- | ------------------------- | ---------------- | --------------- | -------------------- | | [-](https://dashboard.gitguardian.com/incidents/secrets) | Generic High Entropy Secret | 3d932cd411407c0c4f123d0b2ce4de6bb764ed2e | src/mapping.ts | [View secret](https://github.com/fuseio/fuse-nft-subgraph/commit/3d932cd411407c0c4f123d0b2ce4de6bb764ed2e#diff-e11b4aa93c68408d2a221e4fed08ec4bL95) | | [-](https://dashboard.gitguardian.com/incidents/secrets) | Generic High Entropy Secret | 6142301de9a3d4f94e6b495349973631f5329815 | src/mapping.ts | [View secret](https://github.com/fuseio/fuse-nft-subgraph/commit/6142301de9a3d4f94e6b495349973631f5329815#diff-e11b4aa93c68408d2a221e4fed08ec4bR94) |
🛠 Guidelines to remediate hardcoded secrets
1. Understand the implications of revoking this secret by investigating where it is used in your code. 2. Replace and store your secrets safely. [Learn here](https://blog.gitguardian.com/secrets-api-management?utm_source=product&utm_medium=GitHub_checks&utm_campaign=check_run_comment) the best practices. 3. Revoke and [rotate these secrets](https://docs.gitguardian.com/secrets-detection/detectors/generics/generic_high_entropy_secret#revoke-the-secret?utm_source=product&utm_medium=GitHub_checks&utm_campaign=check_run_comment). 4. If possible, [rewrite git history](https://blog.gitguardian.com/rewriting-git-history-cheatsheet?utm_source=product&utm_medium=GitHub_checks&utm_campaign=check_run_comment). Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data. To avoid such incidents in the future consider - following these [best practices](https://blog.gitguardian.com/secrets-api-management/?utm_source=product&utm_medium=GitHub_checks&utm_campaign=check_run_comment) for managing and storing secrets including API keys and other credentials - install [secret detection on pre-commit](https://docs.gitguardian.com/internal-repositories-monitoring/integrations/git_hooks/pre_commit?utm_source=product&utm_medium=GitHub_checks&utm_campaign=check_run_comment) to catch secret before it leaves your machine and ease remediation.

🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

Our GitHub checks need improvements? Share your feedbacks!

GundamDweeb commented 2 years ago

@mul53

Here is some of the tasks and known issues I was working with:

Fuse Network ERC721

Tasks:

https://github.com/fuseio/fuse-nft-subgraph/pull/4

13085303 - Last Block Failure - 14149632 - Last Block Failure - 0x876b6d93c27aee580ad492267200c6ce30228f8dbedbaddda0a064d2c92a27e8 14 149 632

https://explorer.fuse.io/tx/0x63be68eaf3607404a3ae900f4969ca0ad51838465c50976d877e7ca9627cb4ef/token-transfers

Current Issues:

https://thegraph.com/hosted-service/subgraph/gundamdweeb/fuse-network-erc721?query=IPFS%20Failures

IPFS Failures to check

GundamDweeb commented 2 years ago

I have removed the escape from readMetadata for Cozy Collection -

Let's see how it deals with the IPFS! @mul53

I have put logging in to help.

GundamDweeb commented 2 years ago

Here is a Pending version of Fix - https://thegraph.com/hosted-service/subgraph/gundamdweeb/fuse-network-erc721?version=pending

GundamDweeb commented 2 years ago

So by removing the Cozy Check - it fails once again at the same block mentioned above on that tx. I am pushing a version that just skips that first ID in cozy. https://thegraph.com/hosted-service/subgraph/gundamdweeb/fuse-network-erc721?version=pending` Screenshot 2022-05-06 at 07 31 48

Please see @mul53

leonprou commented 2 years ago

Hey @GundamDweeb , Thanks for the PR 👍 About the Cozy issues, can you give more details? Cozy is a top project so we need it to be included

GundamDweeb commented 2 years ago

Hi @leonprou

This PR is being closed.