-
Notifications
You must be signed in to change notification settings - Fork 189
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
[torii] Indexing optimization #1583
Comments
I think it's because we need the block information on top of that (to process blocks). Which the events page doesn't contain. Should we care about blocks apart from their block number? |
It also seems we need the txn information, we store each transaction and its receipt @Tarrence torii/processors/store_transaction.rs |
hmm yeah. perhaps we should parallelize things. we can do a map -> reduce, creating all the db queries in map then applying them sequentially in reduce |
then maybe use starknet_getEvents then query only txs we are interested in |
yeah that is a good optimization too. we will need to keep a registry of all world's contract address to filter txns by (i think we have this already in the db) |
Wouldn't it be basically the same thing? Because I think we'd sitll do the same thing for blocks. As we have a block processsor that takes in the block data |
Is your feature request related to a problem? Please describe.
I'm curious so i ran a torii on mainnet, indexing a block could take around 10s on laptop.
The current indexing process is :
torii calls
starknet_getBlockWithTxs
to retrieve alls tx hash of a blocktorii calls
starknet_getTransactionReceipt
for EACH TXDescribe the solution you'd like
It should be possible to do it in 1 call using
starknet_getEvents
, filtering on world addressThe text was updated successfully, but these errors were encountered: