Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(mirror): wait 15 seconds before sending transactions (near#10990)
The test pytest/tools/mirror/offline_test.py often fails with many fewer transactions observed than wanted, and the logs reveal that many transactions are invalid because the access keys used do not exist in the target chain. This happens because some early transactions that should have added those keys never make it on chain. These transactions are sent successfully from the perspective of the ClientActor, but the logs show that they're dropped by the peer manager: ``` DEBUG handle{handler="PeerManagerMessageRequest" actor="PeerManagerActor" msg_type="NetworkRequests"}: network: Failed sending message: peer not connected to=ed25519:Fz7d1xkkt3XsvTPiwk4JRhMuPru4Ss7cLS8fdhshDRj3 num_connected_peers=1 msg=Routed(RoutedMessageV2 { msg: RoutedMessage { ... body: tx GFW8HgTndXVKdcLHdsCXxURjHxDnnEqHadrbxvsLKVQb ... ``` So, the peer manager is dropping the transaction instead of routing it, and the test fails because many subsequent transactions depended on that one. A git bisect shows that this behavior starts after near#9651. It seems that this failure to route messages happens for a bit longer after startup after that PR. The proper way to handle this might be to implement a mechanism whereby these messages won't just silently be dropped, and the ClientActor can receive a notification that it wasn't successful so that we can retry it later. But for now a workaround is to just wait a little bit before sending transactions. So we'll set a 15 second timer for the first batch of transactions, and then proceed normally with the others
- Loading branch information