maci
maci copied to clipboard
Couldn't get a large amount of logs from Alchemy
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).
For this issue, maybe this can be handled by the coordinator service having some local storage or using a subgraph to retrieve events.
this https://github.com/privacy-scaling-explorations/maci/pull/758 will fix it for MACI