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

Minor patches for koios-1.0.10 #177

Merged
merged 1 commit into from Mar 30, 2023
Merged

Minor patches for koios-1.0.10 #177

merged 1 commit into from Mar 30, 2023

Conversation

rdlrt
Copy link
Contributor

@rdlrt rdlrt commented Mar 23, 2023

Description

  • Bump up margin for tx rollback lookup for asset_info_cache to 1000 , as 100 is too small a margin for 2-3 blocks , which can contain more than 100 transactions (of which if oldest transaction contains a mint, it will not get into the cache)
  • Specs:
    • Fix examples in for preprod/preview
    • Update tx_info > plutus_contracts > address to be nullable
  • For asset_list object in address/account/tx related endpoints - reduce strictness with asset_info_cache, making it a LEFT JOIN instead of INNER JOIN in case the cache does not (yet) have an entry for those assets - since it's only used for decimals. The asset_info/policy_asset_info/asset_addresses/asset_nft_address/policy_asset_list endpoints have more dependency on this cache - they're untouched

How has this been tested?

  • Asset info cache was tested based on results against user reported error
  • Spec changes were tested using schemathesis on preprod/preview

@rdlrt rdlrt requested a review from Scitz0 March 23, 2023 07:37
@rdlrt rdlrt force-pushed the minor-patch branch 3 times, most recently from b23449e to 89677e0 Compare March 23, 2023 09:28
Copy link
Contributor

@Scitz0 Scitz0 left a comment

Choose a reason for hiding this comment

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

👍

@rdlrt
Copy link
Contributor Author

rdlrt commented Mar 30, 2023

For asset info cache, monitored the result of query below for a week, it did not return any transactions that was more than a 5 blocks ago:

select * from multi_asset ma left join grest.asset_info_cache aic ON ma.id = aic.asset_id LEFT JOIN ma_tx_mint mtm ON mtm.ident = ma.id WHERE aic.asset_id is NULL AND mtm.tx_id IS NOT NULL AND mtm.tx_id <= (select min(id) from tx where block_id = ((select id from block order by id desc limit 1) - 5));

For the scope of missed transactions, the increase in index seems to have done the trick.

@rdlrt rdlrt merged commit 3e9f48d into main Mar 30, 2023
2 checks passed
@rdlrt rdlrt deleted the minor-patch branch March 30, 2023 06:04
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.

None yet

2 participants