Fix race condition in ETH execution confirmation#729
Fix race condition in ETH execution confirmation#729
Conversation
Ahh that works. We could also require two "confirmations" for the respond event. One is when the signer generates the signature and one is when we index the respond event. I'm not leaning in either direction, just wanted to comment in this alternative |
|
ahh I could see the issue, basically eth indexes the block where the transaction happens before solana indexes the respond() event, so when eth indexes that block it does not know to look for that transaction.
what do you mean by requiring two confirmations instead of one or another? @ChaoticTempest |
|
I'm ok with the increased Alchemy bill. As long as it adds stability. |
because this logic runs every time we process a block, so we make a call for each transaction in each process_block() for all the blocks before the transaction receipt is found |
|
That does not seam right, let's discuss it on our 1-1 |
AI-generated. Creating this PR for the future discussion with @ppca
Problem
test_solana_eth_bidirectional_flowis flaky because of a race condition between the Solana stream and the ETH indexer.When the test broadcasts an ETH transaction, Anvil auto-mines it into block N. The ETH indexer processes block N and checks
backlog.pending_execution(Ethereum)for watchers — but the Solana stream hasn't registered the watcher yet (it's still processing the `Respond` event). By the time the watcher is registered, block N has already been processed, and in Anvil auto-mine mode, no new blocks arrive, so the watcher is never checked again.Fix
Replace the block-receipts-based lookup in `collect_execution_confirmations` with a direct `eth_getTransactionReceipt` query per watched tx hash. This reliably finds the receipt regardless of which block the tx was mined in or when the watcher was registered.
Also use the receipt's actual `block_number` instead of the current processing block number, so `eth_call` replay and `ExecutionConfirmed` events reference the correct block.