neonevm / proxy-model.py

Neon Proxy for Solana
https://neon-labs.org
Other
17 stars 19 forks source link

Use Solana's `signatureSubscribe` instead of busy-polling `getSignatureStatuses` #1090

Closed kevinji closed 1 year ago

kevinji commented 1 year ago

The current logic in check_confirm_of_tx_sig_list (get_confirmed_slot_for_tx_sig_list in this repo's version) and _wait_for_confirm_of_tx_list busy-polls the getSignatureStatuses API and then goes to sleep if the txs are not ready, blocking the thread in the meantime. It would be more efficient if instead the code used the Solana WebSocket interface and subscribed via signatureSubscribe to all relevant signatures.

We're observing that the proxy spends a decent amount of time waiting in the _wait_for_confirm_of_tx_list function:

Screenshot 2023-05-03 at 18 14 44