wormhole-foundation / example-liquidity-layer

Apache License 2.0
11 stars 11 forks source link

solana: handle dropped websocket subscriptions gracefully #97

Open a5-pickle opened 5 months ago

a5-pickle commented 5 months ago

Off-chain processes stop receiving log events after some point if the process has run for long enough.

Consider adding multiplexer or other solution using onLogs instead of anchor's addEventListener.

Also applies to onSlotChange. Hopefully share same sort of solution between the two subscriptions?

Consider using https://solana-labs.github.io/solana-web3.js/classes/Connection.html#removeSlotChangeListener and https://solana-labs.github.io/solana-web3.js/classes/Connection.html#removeOnLogsListener.