Transfers per Block returns less results than limit
Cross-posting from Discord
I have an issue that is causing reliability issues with our backfill and will create issues if we use this for prod to keep up with chainhead data. There are some blocks that do not return a full page with a request. E.g. block 840480. Response total indicates 67. Sending a request with offset 0 and limit 60 returns 56. Page 2 (offet 60/limit 60) returns 7 for a total of 63.
Now, if I send offset 56 (& limit 60) I get 11, for a grand total of 67 which is expected. However, not getting a full page (results=limit) is an issue
curl -L 'https://api.hiro.so/ordinals/v1/inscriptions/transfers?block=840480&offset=0&limit=60' \
-H 'Accept: application/json' > temp/840480.json
Block 839852 offset 360 looks to be the worst offender with just 29/60 (total = 1361)
import requests
len(requests.get('https://api.hiro.so/ordinals/v1/inscriptions/transfers?block=839852&offset=360&limit=60').json()['results'])
@WHYTEWYLL @sam-xyz
Thanks for the feedback @forgxyz! I'm moving this issue to the ordinals-api for better tracking.
Hi @forgxyz, I believe this issue has been resolved in the latest 3.x release.
I tested your endpoints, and the results looked correct on first glance:
block=840480&offset=0&limit=60→ returned total 58, and 58 were displayedblock=840480&offset=60&limit=60→ returned total 0, and 0 were displayedblock=839852&offset=360&limit=60→ returned total 514, and 60 were displayed (as expected based on the limit)
The total values remained consistent across multiple tries.
I'll go ahead and close this for now since it appears to be resolved. If you're still encountering issues, feel free to share a specific example and I’ll be happy to take a closer look.