graphprotocol / indexer-rs

Rewrite of indexer-service in Rust with Scalar TAP implementation
Apache License 2.0
16 stars 14 forks source link

Store invalid receipts even if there are no valid ones in batch #214

Open aasseman opened 2 weeks ago

aasseman commented 2 weeks ago

rav_requester_single will throw an error if there are no valid receipts to aggregate, before attempting to move the invalid receipts it found to the failed receipts table.

https://github.com/graphprotocol/indexer-rs/blob/6747363bd539ff022d72efdb905c3e720f6dd884/tap-agent/src/agent/sender_allocation.rs#L481-L514

There could be a situation where all the receipts that have an eligible timestamp are invalid, so they don't get to be moved to the invalid receipts table. An extreme situation is where # invalid receipts >= rav_receipts_limit, in which case we'd get stuck unable to create a new RAV even if there are more recent valid receipts in store.