Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add retry logic to RPC methods #1166

Merged
merged 3 commits into from
Sep 8, 2024
Merged

Conversation

sergeytimoshin
Copy link
Contributor

@sergeytimoshin sergeytimoshin commented Sep 8, 2024

Added the 'async-trait' crate to provide async trait methods in RPC interfaces.
Implemented async versions of existing synchronous methods and added retry logic for better error handling in 'SolanaRpcConnection'.

Added the 'async-trait' crate to provide async trait methods in RPC interfaces.
Implemented async versions of existing synchronous methods and added retry logic for better error handling in 'SolanaRpcConnection'.
..Default::default()
},
)
.map_err(RpcError::from)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we use this logic in send_transaction in forester which already has retry logic, is that retry logic now redundant?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. We need retry logic for each rpc method (otherwise we can easily throw out of from process_queue), so I decided to consolidate it in one place.

The `build_signed_transaction_batch` method in `TransactionBuilder` now uses `async_trait` to support async/await syntax. This change ensures better concurrency handling and simplifies the implementation of asynchronous code within the trait. Additionally, added a TODO comment about optimizing retry logic for sending transactions.
Move `async_trait::async_trait` to the correct location. This change improves code readability by maintaining a consistent import ordering.
@ananas-block ananas-block merged commit c7491d0 into main Sep 8, 2024
17 checks passed
@ananas-block ananas-block deleted the sergey/solana-rpc-retry branch September 8, 2024 11:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants