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

feat: support cursed inscriptions #85

Merged
merged 8 commits into from
Jun 8, 2023
Merged

feat: support cursed inscriptions #85

merged 8 commits into from
Jun 8, 2023

Conversation

rafaelcr
Copy link
Collaborator

@rafaelcr rafaelcr commented May 30, 2023

  • Keep prev_output and prev_offset in the locations table so we can calculate gaps
  • Add /sats/:ordinal/inscriptions endpoint to list all cursed inscriptions for a single sat
  • Support new chainhook event cursed_inscription_revealed
  • Save and expose curse_type on all endpoints

@rafaelcr rafaelcr temporarily deployed to Preview May 30, 2023 15:23 — with GitHub Actions Inactive
@rafaelcr rafaelcr requested a review from lgalabru May 30, 2023 15:23
@github-actions
Copy link

github-actions bot commented May 30, 2023

Vercel deployment URL: https://ordinals-ghr0hog7v-blockstack.vercel.app 🚀

@rafaelcr rafaelcr temporarily deployed to Preview May 30, 2023 20:48 — with GitHub Actions Inactive
@rafaelcr rafaelcr requested a review from lgalabru June 5, 2023 20:46
Copy link
Member

@lgalabru lgalabru left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the deployed version, the inscriptions data are nested in a cursed_inscription_reveal field (vs inscription_reveal).
This is something we could change in future versions, but I think it was a good choice. cursed inscriptions are a bit polarizing, and the ingestion rules are different: you should always wipe cursed inscriptions when ingesting blessed inscription is an idempotent operation.
By keeping the cursed_inscription_reveal schema, developers have to "opt-in" (with an explicit code path) if they want to support cursed inscription.
If we mix everything under inscription_reveal, developers are receiving cursed data by default, and have to "opt-out" by explicitly testing the inscription number if they don't want to support "cursed" inscriptions.

Note that there's also a new field available that you should probably keep: curse_type, which will tell you why the inscription is cursed (even tag, batch, p2wsh as we speak).

@rafaelcr
Copy link
Collaborator Author

rafaelcr commented Jun 6, 2023

@lgalabru a few questions

the inscriptions data are nested in a cursed_inscription_reveal field (vs inscription_reveal)

Does a cursed_inscription_reveal event have the exact same schema as inscription_reveal?

you should always wipe cursed inscriptions when ingesting blessed inscription is an idempotent operation

Can you expand a bit on this? When should I wipe cursed inscriptions?

there's also a new field available that you should probably keep: curse_type

Gotcha, should I return this data on cursed inscription responses too?

@lgalabru
Copy link
Member

lgalabru commented Jun 7, 2023

Does a cursed_inscription_reveal event have the exact same schema as inscription_reveal?

Yep

Can you expand a bit on this? When should I wipe cursed inscriptions?

We can leave this for a future iteration, we're resetting blessed and cursed inscriptions pretty regularly. At some point, we will be adding new curse types, and I think we will keep the blessed inscriptions (to avoid re-ingesting 10M inscriptions), and only reset the cursed inscriptions.

Gotcha, should I return this data on cursed inscription responses too?

That'd be great for the explorer I think.

@rafaelcr rafaelcr temporarily deployed to Preview June 8, 2023 01:04 — with GitHub Actions Inactive
@rafaelcr rafaelcr temporarily deployed to Preview June 8, 2023 01:06 — with GitHub Actions Inactive
@rafaelcr rafaelcr requested a review from lgalabru June 8, 2023 01:08
Copy link
Member

@lgalabru lgalabru left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking great, thanks @rafaelcr!

@rafaelcr rafaelcr merged commit fb93474 into develop Jun 8, 2023
5 checks passed
@rafaelcr rafaelcr deleted the feat/cursed branch June 8, 2023 01:17
blockstack-devops pushed a commit that referenced this pull request Jun 8, 2023
## [0.3.0](v0.2.0...v0.3.0) (2023-06-08)

### Features

* support cursed inscriptions ([#85](#85)) ([fb93474](fb93474))
@blockstack-devops
Copy link

🎉 This PR is included in version 0.3.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

4 participants