celo-org/optics-monorepo

bug: kathy nonce collision

Closed this issue · 2 comments

I was debugging with @ltchang2019 and believe I have a hypothesis for why Kathy is crash-looping.

When booting, kathy spawns N tasks, each responsible for dispatching messages to a particular configured replica. Issues arise when each task tries to dispatch a message at the same time or close together, because the individual tasks attempt to use the same account Nonce.

I believe this might necessitate a fix at the ethers-rs level.

CC @prestwich for thoughts.

does at least 1 message get through per boot? if 0 messages are sent, then it is not nonce-related

Yeah, usually 1 message, sometimes none if the reboot was close enough to the last dispatch and the mempool indexing hasnt caught up.