maci icon indicating copy to clipboard operation
maci copied to clipboard

Couldn't get a large amount of logs from Alchemy

Open baumstern opened this issue 3 years ago • 1 comments
trafficstars

Since Alchemy has a limit to retrieve a logs, genMaciStateFromContract() might fails when a MACI instance has a large amount of logs; a single eth_getLogs call would fail when MACI instance has over 10k sign-ups or 10k publishMessages.

Possibly failing point

v1: https://github.com/privacy-scaling-explorations/maci/blob/v1/contracts/ts/genMaciState.ts#L67-L85, https://github.com/privacy-scaling-explorations/maci/blob/v1/contracts/ts/genMaciState.ts#L235-L258

v0.10.x: https://github.com/privacy-scaling-explorations/maci/blob/master/cli/ts/utils.ts#L63-L71

Its not a MACI-side bug, but think it would be a common pitfall and think we could have a better way to handle this (Note that sending a request of an interval of 2,000 blocks to Alchemy endpoint would fails with 429 Too Many Requests error).

baumstern avatar Jun 08 '22 08:06 baumstern

For this issue, maybe this can be handled by the coordinator service having some local storage or using a subgraph to retrieve events.

corydickson avatar Jun 08 '22 20:06 corydickson

this https://github.com/privacy-scaling-explorations/maci/pull/758 will fix it for MACI

ctrlc03 avatar Oct 23 '23 10:10 ctrlc03