kkrt-labs / kakarot-rpc

Kakarot ZK EVM Ethereum RPC adapter
MIT License
136 stars 103 forks source link

[URGENT] gemba: review the nonce management strategy for the relayer fleet [3] #1502

Closed Eikix closed 3 weeks ago

Eikix commented 3 weeks ago

Describe the enhancement request

During Tech strategy meeting, review nonce management strategy with @ClementWalter

after v0.7.5 fixes, we are still observing strong occurrences of "failed to relay transactions" errors in the RPC. This suggests nonces in the relayer fleet are still subject to falling out of sync a lot, cf:

image

Where we see in the "logs occurence" dozens of nonce errors.

greged93 commented 3 weeks ago

In order to reduce the nonce errors, the final decision is to call Starknet each time to get the relayer nonce before sending the transaction and to remove the local nonce handling.

Investigate as well a way to "lock" the relayer for as long as we don't receive Starknet's status of the transaction.

Duration: 3 hours