-
Notifications
You must be signed in to change notification settings - Fork 61
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: add more recursion endpoints #144
base: develop
Are you sure you want to change the base?
Conversation
Vercel deployment URL: https://ordinals-5ut3rkhrx-blockstack.vercel.app 🚀 |
Codecov Report
@@ Coverage Diff @@
## develop #144 +/- ##
===========================================
- Coverage 91.98% 87.74% -4.25%
===========================================
Files 26 34 +8
Lines 2970 3622 +652
Branches 239 294 +55
===========================================
+ Hits 2732 3178 +446
- Misses 236 440 +204
- Partials 2 4 +2
|
bf66c92
to
acf5e54
Compare
acf5e54
to
389ec23
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good! A few comments
}, | ||
}, | ||
async (request, reply) => { | ||
const blockHeight = (await fastify.db.getChainTipBlockHeight()) ?? 'blockheight'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the word blockheight
the right thing to return if we don't have a proper block height here? Not familiar with the ord docs on this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, that's to match the current ord
implementation. https://sourcegraph.com/search?q=context:global+repo:ordinals/ord+and+%7C%7C+%22
`; | ||
|
||
const result = await this.sql<{ block_hash: string }[]>` | ||
SELECT block_hash FROM inscriptions_per_block |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we could make these queries more efficient if we modified the chain_tip
materialized view to keep also the block hash and timestamp. That way it would be a O(1) retrieval from the DB always.
Forgot about this one. A lot of recursive viewing doesn't really work in our explorer due to security concerns, so it might not be too important to have these endpoints right now.. |
Adding these endpoints covered by
ord
https://docs.ordinals.com/inscriptions.html?highlight=rec#recursion
todo
cacheing: what's your preferred etag/cacheing option? we could add a stats/inscriptioncountperblock cache for most, and a custom new cache for the /:blockheight show endpoint.